/* handlebars v4.7.6 Copyright (C) 2011-2019 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT @preserve */ function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} !function(t,e){"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!= typeof globalThis?globalThis:t||self).noUiSlider={})}(this,function(ot){function n(t){return"object"==_typeof(t)&&"function"==typeof t.to} function st(t){t.parentElement.removeChild(t)} function at(t){return null!=t} function lt(t){t.preventDefault()} function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)} function ut(t,e,r){0=e[r];)r+=1;return r} function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))} function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0, c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0ot.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%", t.innerHTML=String(s.to(r))))}),a} function L(){n&&(st(n),n=null)} function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function to(t){return String(Math.round(t))}}; return n=d.appendChild(O(e,r,t))} function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]} function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0); if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function l(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r}; if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue- n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))), [t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]} ft(t=d,f.cssClasses.target),0===f.dir?ft(t,f.cssClasses.ltr):ft(t,f.cssClasses.rtl),0===f.ort?ft(t,f.cssClasses.horizontal):ft(t,f.cssClasses.vertical),ft(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl: f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){var r=P(e,f.cssClasses.connects);l=[],(a=[]).push(N(r,t[0]));for(var n=0;n"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function o(a){return"function"==typeof a}; o(/x/)&&(b.isFunction=o=function o(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o; var p=Array.isArray||function(a){return!(!a||"object"!=_typeof(a))&&"[object Array]"===n.call(a)}; b.isArray=p}, function(a,b,c){function d(a,b){var c=b&&b.loc,g=void 0,h=void 0,i=void 0,j=void 0;c&&(g=c.start.line,h=c.end.line,i=c.start.column,j=c.end.column,a+=" - "+g+":"+i);for(var k=Error.prototype.constructor.call(this, a),l=0;l0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b, c)})},a.exports=b["default"]}, function(a,b,c){(function(d){var e=c(13)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(5),h=c(6),i=f(h);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,d){l&&(l.key= b,l.index=c,l.first=0===c,l.last=!!d,m&&(l.contextPath=m+b)),k+=f(a[b],{data:l,blockParams:g.blockParams([a[b],b],[m+b,null])})} if(!b)throw new i["default"]("Must pass iterator to #each");var f=b.fn,h=b.inverse,j=0,k="",l=void 0,m=void 0;if(b.data&&b.ids&&(m=g.appendContextPath(b.data.contextPath,b.ids[0])+"."),g.isFunction(a)&& (a=a.call(this)),b.data&&(l=g.createFrame(b.data)),a&&"object"==_typeof(a))if(g.isArray(a))for(var n=a.length;j=0?b:parseInt(a,10)}return a}, log:function log(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f=v.LAST_COMPATIBLE_COMPILER_REVISION&&b<=v.COMPILER_REVISION)){if(b2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+ (i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null, o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t|| 1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]), r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$), u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1, parseError:function parseError(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)}, setInput:function setInput(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1, first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, input:function input(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++): this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a}, unput:function unput(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g); this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line, last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&& (this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this}, more:function more(){return this._more=!0,this}, less:function less(a){this.unput(this.match.slice(a))}, pastInput:function pastInput(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")}, upcomingInput:function upcomingInput(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")}, showPosition:function showPosition(){var a=this.pastInput(),b=(new Array(a.length+1)).join("-");return a+this.upcomingInput()+"\n"+b+"^"}, next:function next(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+ 1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b, this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this, this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+ 1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, lex:function lex(){var a=this.next();return"undefined"!=typeof a?a:this.lex()}, begin:function begin(a){this.conditionStack.push(a)}, popState:function popState(){return this.conditionStack.pop()}, _currentRules:function _currentRules(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}, topState:function topState(){return this.conditionStack[this.conditionStack.length-2]}, pushState:function pushState(a){this.begin(a)}}; return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substring(a,b.yyleng-c+a)} switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(), 15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(), 14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(), 44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(), 14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1, 2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75; case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24, 25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}, a}(); return b.lexer=c,a.prototype=b,b.Parser=a,new a}(); b["default"]=c,a.exports=b["default"]}, function(a,b,c){function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a} function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c} function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c} function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}} function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e, d.leftStripped}} var i=c(1)["default"];b.__esModule=!0;var j=c(49),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d= a.body,i=0,j=d.length;i 0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}} function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"\x26"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}} function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{}, loc:e}} function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&& (c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip, inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}} function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program", body:a,strip:{},loc:b}} function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}} var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock= n;var p=c(6),q=o(p)}, function(a,b,c){function d(){} function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data= !0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)} function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)} function e(a,b){return f||(f=d()),f.call(this,a,b)} if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=m.extend({},b),"data"in b|| (b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),f._child(a,b,c,e)},e} function g(a,b){if(a===b)return!0;if(m.isArray(a)&&m.isArray(b)&&a.length===b.length){for(var c=0;c1)throw new l["default"]("Unsupported number of partial arguments: "+ c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type; e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")}, PartialBlockStatement:function PartialBlockStatement(a){this.PartialStatement(a)}, MustacheStatement:function MustacheStatement(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")}, Decorator:function Decorator(a){this.DecoratorBlock(a)}, ContentStatement:function ContentStatement(a){a.value&&this.opcode("appendContent",a.value)}, CommentStatement:function CommentStatement(){}, SubExpression:function SubExpression(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)}, ambiguousSexpr:function ambiguousSexpr(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d), this.opcode("invokeAmbiguous",e,f)}, simpleSexpr:function simpleSexpr(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")}, helperSexpr:function helperSexpr(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+ f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,o["default"].helpers.simpleId(e))}}, PathExpression:function PathExpression(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=o["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam", d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")}, StringLiteral:function StringLiteral(a){this.opcode("pushString",a.value)}, NumberLiteral:function NumberLiteral(a){this.opcode("pushLiteral",a.value)}, BooleanLiteral:function BooleanLiteral(a){this.opcode("pushLiteral",a.value)}, UndefinedLiteral:function UndefinedLiteral(){this.opcode("pushLiteral","undefined")}, NullLiteral:function NullLiteral(){this.opcode("pushLiteral","null")}, Hash:function Hash(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c=0)return[b,e]}}}}, function(a,b,c){function d(a){this.value=a} function e(){} function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;f0&&(c+=", "+d.join(", "));var e=0;g(this.aliases).forEach(function(a){var d= b.aliases[a];d.children&&d.referenceCount>1&&(c+=", alias"+ ++e+"\x3d"+a,d.children[0]="alias"+e)}),this.lookupPropertyFunctionIsUsed&&(c+=", "+this.lookupPropertyFunctionVarDeclaration()); var f=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&f.push("blockParams"),this.useDepths&&f.push("depths");var h=this.mergeSource(c);return a?(f.push(h),Function.apply(this, f)):this.source.wrap(["function(",f.join(","),") {\n ",h,"}"])}, mergeSource:function mergeSource(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a, g=a):(f&&(e?f.prepend("buffer +\x3d "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer \x3d "+(d?"":this.initializeBuffer()), f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()}, lookupPropertyFunctionVarDeclaration:function lookupPropertyFunctionVarDeclaration(){return"\n lookupProperty \x3d container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()}, blockValue:function blockValue(a){var b=this.aliasable("container.hooks.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b, "call",c))}, ambiguousBlockValue:function ambiguousBlockValue(){var a=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack(); b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," \x3d ",this.source.functionCall(a,"call",b),"}"])}, appendContent:function appendContent(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a}, append:function append(){if(this.isInline())this.replaceStack(function(a){return[" !\x3d null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack())); else{var a=this.popStack();this.pushSource(["if (",a," !\x3d null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0), " }"])}}, appendEscaped:function appendEscaped(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))}, getContext:function getContext(a){this.lastContext=a}, pushContext:function pushContext(){this.pushStackLiteral(this.contextName(this.lastContext))}, lookupOnContext:function lookupOnContext(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)}, lookupBlockParam:function lookupBlockParam(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)}, lookupData:function lookupData(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)}, resolvePath:function resolvePath(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;cthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()}, topStackName:function topStackName(){return"stack"+this.stackSlot}, flushInline:function flushInline(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;bright}); eR.add("\x3c",function(left,right){return left=right}); eR.add("\x3c\x3d",function(left,right){return left<=right}); eR.add("\x3d\x3d\x3d",function(left,right){return left===right}); eR.add("!\x3d\x3d",function(left,right){return left!==right}); eR.add("in",function(left,right){if(!isArray(right))right=right.split(",");return right.indexOf(left)!==-1}); var isHelper=function isHelper(){var args=arguments,left=args[0],operator=args[1],right=args[2],options=args[3];if(args.length==2){options=args[1];if(left)return options.fn(this);return options.inverse(this)}if(args.length== 3){right=args[1];options=args[2];if(left==right)return options.fn(this);return options.inverse(this)}if(eR.call(operator,left,right))return options.fn(this);return options.inverse(this)}; Handlebars.registerHelper("is",isHelper);Handlebars.registerHelper("nl2br",function(text){var nl2br=(text+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+"\x3cbr\x3e"+"$2");return new Handlebars.SafeString(nl2br)}); Handlebars.registerHelper("log",function(){console.log(["Values:"].concat(Array.prototype.slice.call(arguments,0,-1)))}); Handlebars.registerHelper("debug",function(){console.log("Context:",this);console.log(["Values:"].concat(Array.prototype.slice.call(arguments,0,-1)))}); Handlebars.registerHelper("for",function(from,to,incr,block){var accum="";for(var i=from;iv2?options.fn(this):options.inverse(this);case "\x3e\x3d":return v1>=v2?options.fn(this): options.inverse(this);case "\x26\x26":return v1&&v2?options.fn(this):options.inverse(this);case "||":return v1||v2?options.fn(this):options.inverse(this);default:return options.inverse(this)}}); Handlebars.registerHelper("math",function(lvalue,operator,rvalue,options){lvalue=parseFloat(lvalue);rvalue=parseFloat(rvalue);return{"+":lvalue+rvalue,"-":lvalue-rvalue,"*":lvalue*rvalue,"/":lvalue/rvalue, "%":lvalue%rvalue}[operator]}); Handlebars.registerHelper("var",function(name,value){this[name]=value}); Handlebars.registerHelper("mathRound",function(tmpr,absolute,decimalPoint){try{if(!$.isNumeric(tmpr))return"";else if(decimalPoint===0){var tmprValue=Math.round(Math.abs(tmpr));if(!absolute&&tmpr<0)tmprValue*= -1;return String(tmprValue)}else{var decimal=Math.pow(10,decimalPoint);var _tmprValue=Math.round(Math.abs(tmpr)*decimal)/decimal;if(!absolute&&tmpr<0)_tmprValue*=-1;return String(_tmprValue)}}catch(e){return String(tmpr)}}); Handlebars.registerHelper("mathRoundCustom",function(nTmpr,hdayType){if(!$.isNumeric(nTmpr))return"";else if(hdayType=="now")return mathRound(nTmpr,1);else return nTmpr}); Handlebars.registerHelper("convertTmprByCpName",function(tmpr,cpName){if(cpName==="KMA"||cpName==="")return tmpr;else{var tmprData=parseFloat(tmpr);return mathRound(tmprData,0)}}); Handlebars.registerHelper("getLength",function(obj){return obj.length}); Handlebars.registerHelper("dateFormat",function(sDate,originFormat,convertFormat){return dateFormat(sDate,originFormat,convertFormat)}); Handlebars.registerHelper("selectOne",function(sDomestic,sOverseas){return $.isEmptyObject(sDomestic)?sOverseas:sDomestic}); Handlebars.registerHelper("regionFullName",function(sRgnName1,sRgnName2,sRgnName3){return sRgnName1+($.isEmptyObject(sRgnName2)?" "+sRgnName3:" "+sRgnName2+" "+sRgnName3)}); Handlebars.registerHelper("dayTimeWetrTxt",function(cpName){if(cpName=="ACCUWEATHER")return this.dayWetrTxt2;else if(cpName=="TWC")return this.dayNarrative;return null}); Handlebars.registerHelper("nightWetrTxt",function(cpName){if(cpName=="ACCUWEATHER")return this.nightWetrTxt2;else if(cpName=="TWC")return this.nightNarrative;return null}); Handlebars.registerHelper("convertTideKind",function(sTideKind){var result="-";if(sTideKind.length>0)if(sTideKind=="+")result="\uace0";else if(sTideKind=="-")result="\uc800";return result}); Handlebars.registerHelper("convertTideKindCss",function(sTideKind){var result="";if(sTideKind.length>0)if(sTideKind=="+")result="high";else if(sTideKind=="-")result="low";return result}); Handlebars.registerHelper("convertTideTm",function(sTideTm){var result=sTideTm;if(sTideTm.length==4)result=sTideTm.substring(0,2)+":"+sTideTm.substring(2,4);return result}); Handlebars.registerHelper("pastBlogURL",function(){if(responsiveSizeType.deviceType==="Mobile")return"https://m.blog.naver.com/naver_weather/222057189278";else return"https://blog.naver.com/naver_weather/222057189278"}); Handlebars.registerHelper("airTrendGraphWidth",function(array,num1,num2){return array.length*num1-num2}); Handlebars.registerHelper("selectDateClass",function(aplYmdt){var DATE_FORMAT="YYYYMMDDHH";var today=moment();var oneDayAfter=moment().add(1,"days");var twoDayAfter=moment().add(2,"days");return moment(aplYmdt, DATE_FORMAT).isSame(moment(today,DATE_FORMAT),"day")?"today":moment(aplYmdt,DATE_FORMAT).isSame(moment(oneDayAfter,DATE_FORMAT),"day")?"tomorrow":moment(aplYmdt,DATE_FORMAT).isSame(moment(twoDayAfter,DATE_FORMAT), "day")?"after_tomorrow":""}); Handlebars.registerHelper("selectDateSplitClass",function(aplYmdt){var DATE_FORMAT="YYYYMMDDHH";var oneDayAfter=moment().add(1,"days").hours("00").minutes("00");var twoDayAfter=moment().add(2,"days").hours("00").minutes("00"); return moment(aplYmdt,DATE_FORMAT).isSame(moment(oneDayAfter,DATE_FORMAT),"minute")?"tomorrow":moment(aplYmdt,DATE_FORMAT).isSame(moment(twoDayAfter,DATE_FORMAT),"minute")?"after_tomorrow":""}); Handlebars.registerHelper("isMidnight",function(aplYmdt,options){var DATE_FORMAT="YYYYMMDDHH";var today=moment();return!moment(aplYmdt,DATE_FORMAT).isSame(moment(today,DATE_FORMAT),"day")&&aplYmdt.lastIndexOf("00")=== 8?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("convertAplTm",function(aplYmdt){var DATE_FORMAT="YYYYMMDDHH";var oneDayAfter=moment().add(1,"days").hours("00").minutes("00");var twoDayAfter=moment().add(2,"days").hours("00").minutes("00"); return moment(aplYmdt,DATE_FORMAT).isSame(moment(oneDayAfter,DATE_FORMAT),"minute")?"\ub0b4\uc77c":moment(aplYmdt,DATE_FORMAT).isSame(moment(twoDayAfter,DATE_FORMAT),"minute")?"\ubaa8\ub808":aplYmdt.substring(8, 10)+"\uc2dc"}); Handlebars.registerHelper("isToday",function(aplYmd){var DATE_FORMAT="YYYYMMDD";var today=moment();var compare=moment(aplYmd,DATE_FORMAT);return today.isSame(compare,"day")?"\uc624\ub298":aplYmdToDay(aplYmd).dayText}); Handlebars.registerHelper("isAmPm",function(amTxt,pmTxt){var now=moment().format("a");return now==="am"?amTxt:pmTxt}); Handlebars.registerHelper("isUpdown",function(tideKind){return tideKind==="+"?"\uace0":"\uc800"}); Handlebars.registerHelper("airHourlyTrendInnerContentHtml",function(airHourlyTrend,nowDate,nowDateHour,nowTime){var PM10_VALUE,PM25_VALUE,PM10_MESSAGE,PM25_MESSAGE,PM10_LEGEND1,PM25_LEGEND1,PM10_CONVERT_PERCENT, PM25_CONVERT_PERCENT,PM10_LEVEL_CLASS,PM25_LEVEL_CLASS,fixedAplYmd,fixedAplTm,resultHtml;PM10_MESSAGE="\ubbf8\uc138";PM10_VALUE=airHourlyTrend.stationPM10;PM10_LEGEND1=airHourlyTrend.stationPM10Legend1; PM10_CONVERT_PERCENT=airHourlyTrend.stationPM10ConvertPercent;PM10_LEVEL_CLASS=airHourlyTrend.stationPM10LevelClass;PM25_MESSAGE="\ucd08\ubbf8\uc138";PM25_VALUE=airHourlyTrend.stationPM25;PM25_LEGEND1= airHourlyTrend.stationPM25Legend1;PM25_CONVERT_PERCENT=airHourlyTrend.stationPM25ConvertPercent;PM25_LEVEL_CLASS=airHourlyTrend.stationPM25LevelClass;if(PM10_VALUE<=0)PM10_VALUE="-";if(PM25_VALUE<=0)PM25_VALUE= "-";if(airHourlyTrend.aplTm==="24"){fixedAplYmd=moment(airHourlyTrend.aplYmd,"YYYYMMDD").add(1,"days").format("YYYYMMDD");fixedAplTm="00"}else{fixedAplYmd=airHourlyTrend.aplYmd;fixedAplTm=airHourlyTrend.aplTm}var hourlyAirDateStr= "".concat(fixedAplYmd).concat(fixedAplTm);var timeClass="",timeItemClass="",timeText="";var TOMORROW=moment(nowDate,"YYYYMMDD").add(+1,"days").format("YYYYMMDD");var AFTER_TOMORROW=moment(nowDate,"YYYYMMDD").add(+2, "days").format("YYYYMMDD");if(hourlyAirDateStr===nowDateHour){timeClass="now";timeItemClass="on";timeText=fixedAplTm+"\uc2dc"}else if(fixedAplTm==="00")if(fixedAplYmd===TOMORROW){timeClass="tomorrow";timeText= "\ub0b4\uc77c"}else if(fixedAplYmd===AFTER_TOMORROW){timeClass="after_tomorrow";timeText="\ubaa8\ub808"}else if(fixedAplYmd>AFTER_TOMORROW){var dayInfo=aplYmdToDay(fixedAplYmd);timeText=moment(fixedAplYmd, "YYYYMMDD").format("MM.DD.");timeText="".concat(timeText).concat(dayInfo.dayText)}if(timeText==="")timeText="".concat(fixedAplTm,"\uc2dc");resultHtml='\n\t\t\x3cli class\x3d"data"\x3e\n\t\t\t\x3cspan class\x3d"time '.concat(timeClass, '"\x3e').concat(timeText,'\x3c/span\x3e\n\t\t\t\x3cdiv class\x3d"time_item ').concat(timeItemClass,'"\x3e\n\t\t\t\t\x3cdiv class\x3d"bar bg_').concat(PM10_LEVEL_CLASS,'" style\x3d"height: ').concat(PM10_CONVERT_PERCENT, '%;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cdiv class\x3d"bar bg_').concat(PM25_LEVEL_CLASS,'" style\x3d"height: ').concat(PM25_CONVERT_PERCENT,'%;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cdiv class\x3d"info"\x3e\n\t\t\t\t\t\x3cdiv class\x3d"info_item"\x3e\n\t\t\t\t\t\t\x3cstrong class\x3d"name"\x3e').concat(PM10_MESSAGE, '\x3c/strong\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"value ').concat(PM10_LEVEL_CLASS,'"\x3e').concat(PM10_LEGEND1," ").concat(PM10_VALUE,'\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"info_item"\x3e\n\t\t\t\t\t\t\x3cstrong class\x3d"name"\x3e').concat(PM25_MESSAGE, '\x3c/strong\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"value ').concat(PM25_LEVEL_CLASS,'"\x3e').concat(PM25_LEGEND1," ").concat(PM25_VALUE,"\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/li\x3e\n\t\t"); return resultHtml}); Handlebars.registerHelper("todayHourlyAlignLeft",function(cpName){return cpName==="TWC"?"":"align_left"}); Handlebars.registerHelper("ifIsSnow",function(isSnow,options){return isSnow?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("talkObjectRegionBtn",function(talkRegionBtnInfo){var onClass=talkRegionBtnInfo.isOn===true?" on":"";var newClass=talkRegionBtnInfo.isNew===true?" new":"";var resultHtml='\n \x3cli\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-'.concat(talkRegionBtnInfo.regionCode, '" class\x3d"city_link').concat(onClass).concat(newClass,' _cnObjectRegionBtn" data-region-code\x3d"').concat(talkRegionBtnInfo.regionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(talkRegionBtnInfo.clickCode, "')\"\x3e\n ").concat(talkRegionBtnInfo.regionName,'\n \x3cspan class\x3d"blind new_text"\x3e\uc0c8 \ub313\uae00 \uc788\uc74c\x3c/span\x3e\n \x3c/a\x3e\n \x3c/li\x3e'); return resultHtml}); Handlebars.registerHelper("talkCategoryRegionBtn",function(talkRegionBtnInfo){var onClass=talkRegionBtnInfo.isOn===true?" on":"";var resultHtml='\n \x3cli\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-'.concat(talkRegionBtnInfo.regionCode, '" class\x3d"area_link').concat(onClass,' _cnCategoryRegionBtn" data-region-code\x3d"').concat(talkRegionBtnInfo.regionCode,'" data-upper-region-code\x3d"').concat(talkRegionBtnInfo.upperRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(talkRegionBtnInfo.clickCode, "')\"\x3e\n ").concat(talkRegionBtnInfo.regionName,"\n \x3c/a\x3e\n \x3c/li\x3e");return resultHtml}); Handlebars.registerHelper("talkKeepRegionBtn",function(talkRegionBtnInfo){var onClass=talkRegionBtnInfo.isOn===true?" on":"";var resultHtml='\n \x3cli\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-'.concat(talkRegionBtnInfo.regionCode, '" class\x3d"area_link').concat(onClass,' _cnCategoryRegionBtn" data-region-code\x3d"').concat(talkRegionBtnInfo.regionCode,'" data-upper-region-code\x3d"').concat(talkRegionBtnInfo.upperRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(talkRegionBtnInfo.clickCode, "')\"\x3e\n ").concat(talkRegionBtnInfo.regionName,"\n \x3c/a\x3e\n \x3c/li\x3e");return resultHtml}); Handlebars.registerHelper("nextCctv",function(channel,cctvDataCache){var _nextCctv$cctvStrtSec;var nextCctv=getNextCctv(channel,cctvDataCache);return(_nextCctv$cctvStrtSec=nextCctv===null||nextCctv===void 0? void 0:nextCctv.cctvStrtSecnNm)!==null&&_nextCctv$cctvStrtSec!==void 0?_nextCctv$cctvStrtSec:"\uad6c\uac04\uc5c6\uc74c"}); Handlebars.registerHelper("nextCctvThumbnail",function(channel,cctvDataCache){var nextCctv=getNextCctv(channel,cctvDataCache);var cctvThumbnailUrl=nextCctv===null||nextCctv===void 0?void 0:nextCctv.thumbnailUrl; return cctvThumbnailUrl?oCommon.fnGetImageCdnProxyUrl(cctvThumbnailUrl):""}); Handlebars.registerHelper("prevCctv",function(channel,cctvDataCache){var _prevCctv$cctvStrtSec;var prevCctv=getPrevCctv(channel,cctvDataCache);return(_prevCctv$cctvStrtSec=prevCctv===null||prevCctv===void 0? void 0:prevCctv.cctvStrtSecnNm)!==null&&_prevCctv$cctvStrtSec!==void 0?_prevCctv$cctvStrtSec:"\uad6c\uac04\uc5c6\uc74c"}); Handlebars.registerHelper("prevCctvThumbnail",function(channel,cctvDataCache){var prevCctv=getPrevCctv(channel,cctvDataCache);var cctvThumbnailUrl=prevCctv===null||prevCctv===void 0?void 0:prevCctv.thumbnailUrl; return cctvThumbnailUrl?oCommon.fnGetImageCdnProxyUrl(cctvThumbnailUrl):""}); Handlebars.registerHelper("currentCctvThumbnail",function(channel){var cctvThumbnailUrl=channel===null||channel===void 0?void 0:channel.thumbnailUrl;return cctvThumbnailUrl?oCommon.fnGetImageCdnProxyUrl(cctvThumbnailUrl): ""}); Handlebars.registerHelper("notExistNextCctv",function(channel,cctvDataCache,options){var nextCctv=getNextCctv(channel,cctvDataCache);return nextCctv?options.inverse(this):options.fn(this)}); Handlebars.registerHelper("notExistPrevCctv",function(channel,cctvDataCache,options){var prevCctv=getPrevCctv(channel,cctvDataCache);return prevCctv?options.inverse(this):options.fn(this)}); Handlebars.registerHelper("talkMapMarkerRadius",function(talkCountClass){var radius;switch(talkCountClass){case "level2":radius="60";break;case "level3":radius="68";break;case "level4":radius="78";break; case "level5":radius="88";break;default:radius="52";break}return radius}); Handlebars.registerHelper("toLowerCase",function(str){return str.toLowerCase()}); Handlebars.registerHelper("windDrctnKor",function(windDrctn){return getWindDrctnName(windDrctn)}); Handlebars.registerHelper("emptyChecker",function(value,defaultValue){if(typeof value==="number")return value;else return _.isEmpty(value)?defaultValue:value}); Handlebars.registerHelper("unitConverter",function(value,unit){if(typeof value==="number")return unit;else if(_.isEmpty(value))return"";else if(value==="-")return"";else return unit}); Handlebars.registerHelper("convertToPrettyZero",function(value){return value==="0.0"?"0":value}); Handlebars.registerHelper("convertRainSnowAmt",function(value){if(value==="0.0")return"0";else if(value===0)return 0;else if(!value)return"-";else return value}); Handlebars.registerHelper("checkEmptyValue",function(value){return value!==0&&!value}); Handlebars.registerHelper("removePadZero",function(value){return value.replace(/^0+/,"")}); Handlebars.registerHelper("renderMonthLoop",function(startMonth,endMonth,thisMonth){var html="";for(var month=startMonth;month<=endMonth;month++){var padWithZero=getPadWithZero(month);html+='\n\t\t\t\t\x3coption value\x3d"'.concat(padWithZero, '" ').concat(padWithZero==thisMonth?'selected\x3d""':"","\x3e").concat(Number(month),"\uc6d4\x3c/option\x3e\n\t\t\t")}return html}); Handlebars.registerHelper("renderCalendarTable",function(tideCalendar,tideInfoForMonth,today){var html="";var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator= tideCalendar[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _dayTideInfo$tideFcas;var cal=_step.value;var day=cal.solarDate;var dayTideInfo= tideInfoForMonth[day];var tideFcast=dayTideInfo===null||dayTideInfo===void 0?void 0:(_dayTideInfo$tideFcas=dayTideInfo.tideFcastList)===null||_dayTideInfo$tideFcas===void 0?void 0:_dayTideInfo$tideFcas[0]; if(cal.dayOfWeek=="1")html+="\x3ctr\x3e";var dimmed=cal.thisMonth?"":'class\x3d"dimmed" disabled';var lunarDate="".concat(dateFormat(cal.lunarDate,"YYYYMMDD","M.D."));if(lunarDate=="Invalid date")try{var year= cal.lunarDate.substr(0,4);var month=parseInt(cal.lunarDate.substr(4,2));var _day=parseInt(cal.lunarDate.substr(6,2));lunarDate=month+"."+_day+"."}catch(e){}html+="\n \x3ctd ".concat(dimmed, ' \n data-day-of-week\x3d"').concat(cal.dayOfWeek,'"\n data-s-date\x3d"').concat(dateFormat(cal.solarDate,"YYYYMMDD","MM.DD."),'"\n data-l-date\x3d"').concat(lunarDate, '"\n data-tide-type-Name\x3d"').concat(_.defaultTo(tideFcast===null||tideFcast===void 0?void 0:tideFcast.tideTypeName,"-"),'" \n data-period-name\x3d"').concat(_.defaultTo(tideFcast=== null||tideFcast===void 0?void 0:tideFcast.periodName,"-"),'"\n ').concat(renderTideInfoLoop(dayTideInfo),'\n \x3e\n \x3cbutton type\x3d"button" class\x3d"btn_detail ').concat(cal.solarDate== today?"on":"",'" ').concat(!cal.thisMonth?"disabled ":"",'\x3e\n \x3cspan class\x3d"calendar_day"\x3e').concat(dateFormat(cal.solarDate,"YYYYMMDD","D"),'\x3c/span\x3e\n \x3cspan class\x3d"calendar_lunar"\x3e').concat(lunarDate, '\x3c/span\x3e\n \x3cspan class\x3d"tide_sign ').concat((tideFcast===null||tideFcast===void 0?void 0:tideFcast.periodCode)==1?"sign_blue":(tideFcast===null||tideFcast===void 0?void 0: tideFcast.periodCode)==2?"sign_red":"",'"\x3e\x3cspan class\x3d"blind"\x3e').concat(tideFcast===null||tideFcast===void 0?void 0:tideFcast.periodName,"\x3c/span\x3e\x3c/span\x3e\n \x3c/button\x3e\n \x3c/td\x3e\n "); if(cal.dayOfWeek=="7")html+="\x3c/tr\x3e"}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}html+='\n \x3ctr id\x3d"_idTideDetail" style\x3d"display:table-row; display:none;"\x3e\n \x3ctd colspan\x3d"7"\x3e\n \x3cdiv class\x3d"detail_area"\x3e\n \x3cstrong class\x3d"detail_day"\x3e\x3c!--06.04.(\ubaa9)--\x3e \x3cspan class\x3d"day_lunar"\x3e\x3c!--\uc74c\ub825 04.13--\x3e\x3c/span\x3e\x3cspan class\x3d"icon_moon moon1"\x3e\x3cspan class\x3d"blind"\x3e\x3c!--\ucd08\uc2b9\ub2ec--\x3e\x3c/span\x3e\x3c/span\x3e\x3c/strong\x3e\n \x3cul class\x3d"info_list _cnTideInfo"\x3e\x3c/ul\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n \x3c/tr\x3e\n '; function renderTideInfoLoop(dayTideInfo){var html="";for(var index=0;index<(dayTideInfo===null||dayTideInfo===void 0?void 0:dayTideInfo.tideFcastList.length);index++){var tideInfo=dayTideInfo.tideFcastList[index]; var tideKind=tideInfo.tideKind==="+"?"\uace0":tideInfo.tideKind==="-"?"\uc800":"";var tideKindClass=tideInfo.tideKind==="+"?"title_red":tideInfo.tideKind==="-"?"title_blue":"";html+="\n data-tide-tm".concat(index, '\x3d"').concat(tideInfo.tideTm,'" data-tide-height').concat(index,'\x3d"').concat(tideInfo.height,'" data-tide-kind').concat(index,'\x3d"').concat(tideKind,'" data-tide-kind-class').concat(index,'\x3d"').concat(tideKindClass, '"\n ')}return html} return html}); Handlebars.registerHelper("donutColorByType",function(level,colorType){var levelInfo=oBlockScriptService.templateInstanceInfoMap.lifeIndex[0].instance.LifeIndexLevelInfo[level.toUpperCase()];switch(colorType){case "color":return levelInfo.color; case "bgcolor":return levelInfo.backgroundColor;default:return""}}); Handlebars.registerHelper("replace",function(origin,target,replace){return origin.replace(target,replace)}); Handlebars.registerHelper("isBetween",function(from,to,format,options){var start=moment(from,format);var end=moment(to,format);return moment().isBetween(start,end)?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("isWeekend",function(options){var day=moment().format("d");var dayText=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"][day];var result=false;if(dayText==="\uae08"&& moment().isBetween(moment("1201","HHmm"),moment("2359","HHmm")))result=true;if(dayText==="\ud1a0")result=true;if(dayText==="\uc77c"&&moment().isBetween(moment("0000","HHmm"),moment("1200","HHmm")))result= true;return result?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("isWeekday",function(options){var day=moment().format("d");var dayText=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"][day];var result=false;if(dayText==="\uc77c"&& moment().isBetween(moment("1201","HHmm"),moment("2359","HHmm")))result=true;if(dayText==="\uc6d4"||dayText==="\ud654"||dayText==="\uc218"||dayText==="\ubaa9")result=true;if(dayText==="\uae08"&&moment().isBetween(moment("0000", "HHmm"),moment("1200","HHmm")))result=true;return result?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("lowerCase",function(value){return(value||"").toLowerCase()}); Handlebars.registerHelper("cpNameKor",function(cpName){var cpNameMap={"KMA":"\uae30\uc0c1\uccad","ACCUWEATHER":"\uc544\ud050\uc6e8\ub354","TWC":"\uc6e8\ub354\ucc44\ub110","WEATHERNEWS":"\uc6e8\ub354\ub274\uc2a4"}; return cpNameMap[cpName]}); Handlebars.registerHelper("cpNameClass",function(cpName){var cpClassMap={"KMA":"type_kma","ACCUWEATHER":"type_accu","TWC":"type_channel","WEATHERNEWS":"type_news"};return cpClassMap[cpName]}); Handlebars.registerHelper("cpNameActionCode",function(cpName){var cpActionCodeMap={"KMA":"cpskmi","ACCUWEATHER":"cpsacc","TWC":"cpstwc","WEATHERNEWS":"cpswni"};return cpActionCodeMap[cpName]}); Handlebars.registerHelper("convertAplYmd",function(aplYmd,tzMin){var _tzMin;tzMin=(_tzMin=tzMin)!==null&&_tzMin!==void 0?_tzMin:540;var inputDate=moment.utc(aplYmd,"YYYYMMDD");var today=moment().utc().add(tzMin, "minutes");if(inputDate.isSame(today,"day"))return"\uc624\ub298";else if(inputDate.isSame(today.clone().add(1,"day"),"day"))return"\ub0b4\uc77c";else if(inputDate.isSame(today.clone().add(2,"day"),"day"))return"\ubaa8\ub808"; else return""}); Handlebars.registerHelper("lookup",function(obj,key){return obj[key]}); Handlebars.registerHelper("replaceSearchKeyword",function(origin,target){return origin.replace(target,'\x3cem class\x3d"interest_link_emphasis"\x3e'.concat(target,"\x3c/em\x3e"))}); Handlebars.registerHelper("checkFollow",function(regionCode,regionCodeArray,options){return regionCodeArray.includes(regionCode)?options.fn(this):options.inverse(this)}); Handlebars.registerHelper("selectAirLevel",function(pm10LevelClass,pm25LevelClass,options){var parseLevel=function parseLevel(value){var parts=value.split("_");var suffix=parts[1];return suffix==="none"? -1:parseInt(suffix)}; var pm10Level=parseLevel(pm10LevelClass);var pm25Level=parseLevel(pm25LevelClass);if(pm25Level>=pm10Level)return pm25LevelClass;else return pm10LevelClass}); return eR}); function getWindDrctnName(windDrctn){var windDrctnInfo={"E":"\ub3d9\ud48d","W":"\uc11c\ud48d","S":"\ub0a8\ud48d","N":"\ubd81\ud48d","NE":"\ubd81\ub3d9\ud48d","NW":"\ubd81\uc11c\ud48d","SE":"\ub0a8\ub3d9\ud48d", "SW":"\ub0a8\uc11c\ud48d","SSW":"\ub0a8\ub0a8\uc11c\ud48d","NNW":"\ubd81\ubd81\uc11c\ud48d","NNE":"\ubd81\ubd81\ub3d9\ud48d","WSW":"\uc11c\ub0a8\uc11c\ud48d","SSE":"\ub0a8\ub0a8\ub3d9\ud48d","WNW":"\uc11c\ubd81\uc11c\ud48d", "ESE":"\ub3d9\ub0a8\ub3d9\ud48d","ENE":"\ub3d9\ubd81\ub3d9\ud48d","CLM":"\ubb34\ud48d"};return windDrctnInfo[windDrctn]} function getPadWithZero(number){var numberStr=number.toString();if(numberStr.length===1)numberStr="0"+numberStr;return numberStr} function dateFormat(sDate,originFormat,convertFormat){return moment(sDate,originFormat).format(convertFormat)} function aplYmdToDay(aplYmd){var day=moment(aplYmd,"YYYYMMDD").format("d");var dayText=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"][day];var dayInfo={};dayInfo.day=day;dayInfo.dayText= dayText;return dayInfo} function mathRound(value,decimalPoint){var result=value;if(value instanceof String)result=result.trim();result=Number(result);if(result!==NaN)if(!decimalPoint||decimalPoint===0)result=result.toFixed(); else result=result.toFixed(decimalPoint);return result} function getNextCctv(channel,cctvDataCache){if(Array.isArray(cctvDataCache)){var selectedChannel=cctvDataCache.find(function(cctv){return cctv.channel===channel}); var idx=cctvDataCache.findIndex(function(cctv){return cctv.channel===channel}); return idx>=0&&idx= nextIndex})}} function getPrevCctv(channel,cctvDataCache){if(Array.isArray(cctvDataCache)){var selectedChannel=cctvDataCache.find(function(cctv){return cctv.channel===channel}); var idx=cctvDataCache.findIndex(function(cctv){return cctv.channel===channel}); return idx>0?cctvDataCache[idx-1]:undefined}else{var _ret=function(){var selectedChannel=cctvDataCache[channel];var selectedGroup=selectedChannel.cctvGrpNo;var selectedIndex=selectedChannel.cctvGrpInSeq; var prevIndex=selectedIndex-1;var prevCctv;while(prevCctv===undefined&&prevIndex>0){prevCctv=Object.values(cctvDataCache).filter(function(cctv){return cctv.cctvGrpNo===selectedGroup&&cctv.cctvGrpInSeq=== prevIndex})[0]; prevIndex--}return{v:prevCctv}}(); if(_typeof(_ret)==="object")return _ret.v}} Handlebars.getTemplate=function(name,fnCallback){if(Handlebars.templates===undefined||Handlebars.templates[name]===undefined){var sURL=oCommon.fnGetHandlebarsUrl(name);$.ajax({url:sURL,method:"GET",cache:true, complete:fnCallback}).done(function(data){if(Handlebars.templates===undefined)Handlebars.templates={};Handlebars.templates[name]=Handlebars.compile(data)}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[templates.js] handlebar API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}else fnCallback()}; Handlebars.getTemplateSync=function(name){if(Handlebars.templates===undefined)Handlebars.templates={};if(Handlebars.templates[name]===undefined){var sURL=oCommon.fnGetHandlebarsUrl(name);$.ajax({url:sURL, method:"GET",cache:true,async:false}).done(function(data){if(typeof data!=="string"||data.trim()===""){if(!Handlebars._emptyReported)Handlebars._emptyReported={};if(!Handlebars._emptyReported[name]){Handlebars._emptyReported[name]= true;oCommon.fnSendErrorToNelo("[templates.js] \ube48 handlebar \uc751\ub2f5 name\x3d"+name+" url\x3d"+sURL)}return}Handlebars.templates[name]=Handlebars.compile(data)}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[templates.js] handlebar API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}var t=Handlebars.templates[name]; return typeof t==="function"?t:function(){return""}}; function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} !function(a,b,c,d){function e(a,b,c){return setTimeout(j(a,c),b)} function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1} function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm, "{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}} function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)} function j(a,b){return function(){return a.apply(b,arguments)}} function k(a,b){return _typeof(a)==oa?a.apply(b?b[0]||d:d,b):a} function l(a,b){return a===d?b:a} function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})} function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})} function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1} function p(a,b){return a.indexOf(b)>-1} function q(a){return a.trim().split(/\s+/g)} function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d} function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g? g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY); b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers? b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k} function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX= e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)} function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)? l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g} function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}} function F(a,b,c){return{x:b/a||0,y:c/a||0}} function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma} function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)} function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI} function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)} function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)} function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)} function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]} function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)} function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]} function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)} function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target, i)}),b===Ea)for(e=0;e-1&&d.splice(a, 1)}; setTimeout(e,cb)}} function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d=f&&db>=g)return!0}return!1} function V(a,b){this.manager=a,this.set(b)} function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb} function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b} function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]} function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""} function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""} function _(a,b){var c=b.manager;return c?c.get(a):a} function aa(){Y.apply(this,arguments)} function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null} function ca(){aa.apply(this,arguments)} function da(){Y.apply(this,arguments),this._timer=null,this._input=null} function ea(){aa.apply(this,arguments)} function fa(){aa.apply(this,arguments)} function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0} function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)} function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input= y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])}, this)} function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}} function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)} var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object"); for(var b=Object(a),c=1;ch&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}), c&&b.splice(h,1))}}); var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function handler(a){var b=Za[a.type];if(b===Ea&&(this.started= !0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}}); var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function handler(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager, b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}); var cb=2500,db=25;i(R,x,{handler:function handler(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&& U.call(this,c))return;this.callback(a,b,c)}}, destroy:function destroy(){this.touch.destroy(),this.mouse.destroy()}}); var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function set(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&& mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()}, update:function update(){this.set(this.manager.options.touchAction)}, compute:function compute(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))}, preventDefaults:function preventDefaults(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb], g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0}, preventSrc:function preventSrc(a){this.manager.session.prevented=!0,a.preventDefault()}}; var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function set(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this}, recognizeWith:function recognizeWith(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this}, dropRecognizeWith:function dropRecognizeWith(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)}, requireFailure:function requireFailure(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this}, dropRequireFailure:function dropRequireFailure(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this}, hasRequireFailures:function hasRequireFailures(){return this.requireFail.length>0}, canRecognizeWith:function canRecognizeWith(a){return!!this.simultaneous[a.id]}, emit:function emit(a){function b(b){c.manager.emit(b,a)} var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))}, tryEmit:function tryEmit(a){return this.canEmit()?this.emit(a):void(this.state=tb)}, canEmit:function canEmit(){for(var a=0;af?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)): (e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction}, attrTest:function attrTest(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))}, emit:function emit(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch", threshold:0,pointers:2},getTouchAction:function getTouchAction(){return[jb]}, attrTest:function attrTest(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)}, emit:function emit(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press", pointers:1,time:251,threshold:9},getTouchAction:function getTouchAction(){return[hb]}, process:function process(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType& Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this); else if(a.eventType&Ga)return rb;return tb}, reset:function reset(){clearTimeout(this._timer)}, emit:function emit(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate", threshold:0,pointers:2},getTouchAction:function getTouchAction(){return[jb]}, attrTest:function attrTest(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe", threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function getTouchAction(){return ba.prototype.getTouchAction.call(this)}, attrTest:function attrTest(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&& a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga}, emit:function emit(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap", pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function getTouchAction(){return[ib]}, process:function process(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}; throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.");} function f(){for(var t=[],n=0;n=this.duration){this.stop();return}this.elapsed+=1E3/60;this.trigger("tick",{elapsed:this.elapsed,ratio:this.elapsed/this.duration})}}]); return Timer}(Component); function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=0&&config.volume<=1){this.player.muted=false;this.player.volume=config.volume}this.$movieRoot.prepend(this.player.shadowRoot); this.createSlider();this.$playBtn.off("click.movieplay").on("click.movieplay",function(e){return _this.onPlayBtnClick(e)}); $.each({start:function start(e){return _this.onSlideStart(e)}, end:function end(e){return _this.onSlideEnd(e)}, slide:function slide(e){return _this.onSlide(e)}},function(type,listener){return _this.slider.on(type,listener)}); this._playerListeners={play:function play(e){return _this.updateBtn(e)}, pause:function pause(e){return _this.updateBtn(e)}, timeupdate:function timeupdate(e){return _this.onTimeupdate(e)}, ended:function ended(e){return _this.onEnded(e)}, loadedmetadata:function loadedmetadata(e){return _this.onLoadedmetadata(e)}, loadeddata:function loadeddata(e){return _this.onLoadeddata(e)}, seeking:function seeking(e){return _this.onSeeking(e)}}; $.each(this._playerListeners,function(type,listener){return _this.player.addEventListener(type,listener)})} _createClass(MoviePlay,[{key:"onSeeking",value:function onSeeking(e){this.playerCurrentTime=this.player.currentTime;this.displayCurrentTime(this.playerCurrentTime)}}, {key:"onLoadeddata",value:function onLoadeddata(e){if(osName==="ios")if(this.playerCurrentTime!==0)this.player.currentTime=this.playerCurrentTime}}, {key:"changeSource",value:function changeSource(srcObject){this.player.srcObject=new naver.player.coreplayer.VODProvider3(srcObject);this.createSlider()}}, {key:"createSlider",value:function createSlider(){if(this.slider)this.slider.destroy();this.slider=noUiSlider.create(this.$playRoot.find("._cnSlider").html("").get(0),{start:0,behaviour:"snap",connect:[true, false],animate:false,range:{min:0,max:1}});this.$playRoot.find(".slider .noUi-base .noUi-connect").addClass("progress_current");this.$playRoot.find(".slider .noUi-handle").addClass("progress_handle");this.$playBtn.addClass("btn_play").removeClass("clicked").find(".blind").text("\uc7ac\uc0dd")}}, {key:"togglePlay",value:function togglePlay(){if(this.player.paused){this.player.play();this.updateBtn()}else{this.started=false;this.player.pause()}}}, {key:"pausePlayer",value:function pausePlayer(){this.player.pause()}}, {key:"destroySlider",value:function destroySlider(){if(this.slider)this.slider.destroy()}}, {key:"destroy",value:function destroy(){var _this2=this;this.player.pause();this.$playBtn.off("click.movieplay");if(this.slider)this.slider.destroy();if(this._playerListeners){$.each(this._playerListeners, function(type,listener){return _this2.player.removeEventListener(type,listener)}); this._playerListeners=null}}}, {key:"updateBtn",value:function updateBtn(e){if(this._isPreloading)return;var isPlaying=e!==undefined?e.type==="play":!this.player.paused;if(e!==undefined&&e.type==="pause"&&this.started)return;if(isPlaying){this.$playBtn.addClass("clicked"); this.$playBtn.find(".blind").text("\uc77c\uc2dc\uc815\uc9c0")}else{this.$playBtn.removeClass("clicked");this.$playBtn.find(".blind").text("\uc7ac\uc0dd")}}}, {key:"onPlayBtnClick",value:function onPlayBtnClick(e){if(e!==undefined)e.preventDefault();if(!this.started){this.started=true;this.player.play();this.updateBtn();return}this.togglePlay()}}, {key:"onSlideStart",value:function onSlideStart(e){this.isPlayingWhenSlideStart=!this.player.paused;this.player.pause()}}, {key:"onSlideEnd",value:function onSlideEnd(e){this.isPlayingWhenSlideStart&&this.player.play();this.isPlayingWhenSlideStart=false}}, {key:"onSlide",value:function onSlide(e){this.player.currentTime=this.player.duration*parseFloat(e[0])}}, {key:"onTimeupdate",value:function onTimeupdate(e){var currentTime=this.player.currentTime;var duration=this.player.duration;if(this.$poster)this.$poster.css("opacity",0);this.displayCurrentTime(currentTime); this.slider.set(currentTime/duration)}}, {key:"onEnded",value:function onEnded(e){if(this.isReplay)this.player.play();else{this.$playBtn.removeClass("clicked");this.$playBtn.find(".blind").text("\uc7ac\uc0dd");this.$playRoot.find(".video_area").addClass("is_on")}}}, {key:"onLoadedmetadata",value:function onLoadedmetadata(e){var _this3=this;if(!this.$poster){this.$poster=$('\x3cdiv class\x3d"video_poster"\x3e\x3cimg class\x3d"img" src\x3d"'.concat(this.player.poster, '" alt\x3d""\x3e'));this.$movieRoot.append(this.$poster)}this.$poster.find("img").attr("src",this.player.poster);if(osName==="ios"){this._isPreloading=true;var wasMuted=this.player.muted;this.player.muted= true;var playPromise=this.player.play();if(playPromise!==undefined)playPromise.then(function(_){_this3._isPreloading=false;_this3.player.muted=wasMuted;if(_this3.started){_this3.player.currentTime=0;_this3.$playBtn.addClass("clicked").find(".blind").text("\uc77c\uc2dc\uc815\uc9c0")}else{_this3.player.pause(); _this3.player.currentTime=0;_this3.$playBtn.removeClass("clicked").find(".blind").text("\uc7ac\uc0dd")}})["catch"](function(e){_this3._isPreloading=false; _this3.player.muted=wasMuted;if(e.name!=="NotAllowedError")oCommon.fnSendInfoToNelo("[MoviePlayer.js] iOS onLoadedMetaData - play \ud6c4 \uc624\ub958 \ubc1c\uc0dd : ".concat(e.message," ").concat(e.stack), e.message)}); else this._isPreloading=false}}}, {key:"displayCurrentTime",value:function displayCurrentTime(currentTime){var currentTimeStr=moment.utc(currentTime*1E3).format("mm:ss");this.$playRoot.find(".timer_progress").html("".concat(currentTimeStr, '\x3cspan class\x3d"blind"\x3e\uc7ac\uc0dd \uc911\x3c/span\x3e'))}}]); return MoviePlay}(); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} !function(t,e){"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!= typeof globalThis?globalThis:t||self).turf={})}(this,function(t){function e(t){return e="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(t){return _typeof(t)}:function(t){return t&& "function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof(t)},e(t)} function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");} function r(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}, e:function e(t){throw t;}, f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,s=!0,a=!1;return{s:function s(){_n2= _n2.call(t)}, n:function n(){var t=_n2.next();return s=t.done,t}, e:function e(t){a=!0,o=t}, f:function f(){try{s||null==_n2["return"]||_n2["return"]()}finally{if(a)throw o;}}}} function c(t){var e=function(t,e){if("object"!=_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value."); }return("string"===e?String:Number)(t)}(t,"string"); return"symbol"==_typeof(e)?e:String(e)} var f=6371008.8,g={centimeters:100*f,centimetres:100*f,degrees:360/(2*Math.PI),feet:3.28084*f,inches:39.37*f,kilometers:f/1E3,kilometres:f/1E3,meters:f,metres:f,miles:f/1609.344,millimeters:1E3*f,millimetres:1E3* f,nauticalmiles:f/1852,radians:1,yards:1.0936*f},p={acres:2.47105E-4,centimeters:1E4,centimetres:1E4,feet:10.763910417,hectares:1E-4,inches:1550.003100006,kilometers:1E-6,kilometres:1E-6,meters:1,metres:1, miles:3.86E-7,nauticalmiles:2.9155334959812285E-7,millimeters:1E6,millimetres:1E6,yards:1.195990046};function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={type:"Feature"};return(0=== n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r} function d(t,e){switch(t){case "Point":return y(e).geometry;case "LineString":return k(e).geometry;case "Polygon":return _(e).geometry;case "MultiPoint":return I(e).geometry;case "MultiLineString":return w(e).geometry; case "MultiPolygon":return N(e).geometry;default:throw new Error(t+" is invalid");}} function y(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length< 2)throw new Error("coordinates must be at least 2 numbers long");if(!V(t[0])||!V(t[1]))throw new Error("coordinates must contain numbers");return v({type:"Point",coordinates:t},e,n)} function m(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(t.map(function(t){return y(t,e)}),n)} function _(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=h(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions."); if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return b(t.map(function(t){return _(t,e)}),n)} function k(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return v({type:"LineString",coordinates:t}, e,n)} function E(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(t.map(function(t){return k(t,e)}),n)} function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n} function w(t,e){return v({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})} function I(t,e){return v({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})} function N(t,e){return v({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})} function S(t,e){return v({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})} function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n} function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=g[e];if(!n)throw new Error(e+" units is invalid");return t*n} function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=g[e];if(!n)throw new Error(e+" units is invalid");return t/n} function C(t,e){return T(L(t,e))} function R(t){var e=t%360;return e<0&&(e+=360),e} function O(t){return(t%=360)>0?t>180?t-360:t:t<-180?t+360:t} function T(t){return 180*(t%(2*Math.PI))/Math.PI} function A(t){return t%360*Math.PI/180} function D(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number"); return P(L(t,e),n)} function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number"); var r=p[e];if(!r)throw new Error("invalid original units");var i=p[n];if(!i)throw new Error("invalid final units");return t/r*i} function V(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)} function q(t){return null!==t&&"object"===e(t)&&!Array.isArray(t)} function G(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers"); t.forEach(function(t){if(!V(t))throw new Error("bbox must only contain numbers");})} function B(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(e(t)))throw new Error("id must be a number or a string");} var Y=Object.freeze({__proto__:null,areaFactors:p,azimuthToBearing:O,bearingToAzimuth:R,convertArea:F,convertLength:D,degreesToRadians:A,earthRadius:f,factors:g,feature:v,featureCollection:b,geometry:d, geometryCollection:S,isNumber:V,isObject:q,lengthToDegrees:C,lengthToRadians:L,lineString:k,lineStrings:E,multiLineString:w,multiPoint:I,multiPolygon:N,point:y,points:m,polygon:_,polygons:x,radiansToDegrees:T, radiansToLength:P,round:M,validateBBox:G,validateId:B});function z(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return a(t.geometry.coordinates); if("Point"===t.type)return a(t.coordinates)}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return a(t);throw new Error("coord must be GeoJSON Point or an Array of numbers"); } function X(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array"); } function j(t){if(t.length>1&&V(t[0])&&V(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return j(t[0]);throw new Error("coordinates must only contain numbers");} function U(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type);} function Z(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required"); if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type);} function W(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+ ", FeatureCollection required");var r,i=h(t.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required"); if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type);}}catch(t){i.e(t)}finally{i.f()}} function H(t){return"Feature"===t.type?t.geometry:t} function J(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type} var Q=Object.freeze({__proto__:null,collectionOf:W,containsNumber:j,featureOf:Z,geojsonType:U,getCoord:z,getCoords:X,getGeom:H,getType:J});function K(t,e){if(!0===(arguments.length>2&&void 0!==arguments[2]? arguments[2]:{})["final"])return function(t,e){var n=K(e,t);return n=(n+180)%360}(t,e); var n=z(t),r=z(e),i=A(n[0]),o=A(r[0]),s=A(n[1]),a=A(r[1]),u=Math.sin(o-i)*Math.cos(a),l=Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(o-i);return T(Math.atan2(u,l))} function $(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=z(t),o=A(i[0]),s=A(i[1]),a=A(n),u=L(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(a)); return y([T(o+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l))),T(l)],r.properties)} function tt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z(t),i=z(e),o=A(i[1]-r[1]),s=A(i[0]-r[0]),a=A(r[1]),u=A(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)* Math.cos(u);return P(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)} function et(t,e){var n;return(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})["final"]?nt(z(e),z(t)):nt(z(t),z(e)))>180?-(360-n):n} function nt(t,e){var n=A(t[1]),r=A(e[1]),i=A(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(T(Math.atan2(i,o))+360)% 360} function rt(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,h,c=0,f=0,g=t.type,p="FeatureCollection"===g,v="Feature"===g,d=p?t.features.length:1,y=0;ya||f>u||g>l)return s= o,a=n,u=f,l=g,void(i=0);var p=k([s,o],t.properties);if(!1===e(p,n,r,g,i))return!1;i++,s=o})&&void 0}}})} function vt(t,e,n){var r=n,i=!1;return pt(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r} function dt(t,e){if(!t)throw new Error("geojson is required");ft(t,function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case "LineString":if(!1===e(t,n,r,0,0))return!1; break;case "Polygon":for(var s=0;s0){e+=Math.abs(It(t[0]));for(var n=1;n=e?(r+2)%e:r+2],a=i[0]*wt,u=o[1]*wt;n+=(s[0]*wt-a)*Math.sin(u),r++}return n* bt} function Nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==e.recompute)return t.bbox;var n=[1/0,1/0,-1/0,-1/0];return rt(t,function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]> t[1]&&(n[1]=t[1]),n[2]e[2]&&(n|=2),t[1]e[3]&&(n|=8),n} function Lt(t,e){var n,r=[],i=h(t);try{for(i.s();!(n=i.n()).done;){var o=St(n.value,e);o.length>0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}}catch(t){i.e(t)}finally{i.f()}return r} function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions"); var s=[n,r];return _([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})} var Rt=function(){function t(e){n(this,t),this.points=e.points||[],this.duration=e.duration||1E4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length= this.points.length,this.delay=0;for(var r=0;rt&&(e.push(r),n=i)}return e}}, {key:"vector",value:function value(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}}, {key:"pos",value:function value(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length- 1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t),s={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3], y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return s}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}]),t}(); function Ot(t){for(var e,n,r=X(t),i=0,o=1;o0} function Tt(t,e){for(var n=0,r=0,i=0,o=0,s=0,a=0,u=0,l=0,h=null,c=null,f=t[0],g=t[1],p=e.length;n0&&l>0)a=l,s=(h=c)[0]-f;else{if(u=c[0]-t[0],l>0&&a<=0)if((o=s*l-u*a)>0)i+=1;else{if(0===o)return 0}else if(a>0&&l<=0)if((o=s*l-u*a)<0)i+=1; else{if(0===o)return 0}else if(0===l&&a<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&l<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&0===l){if(u<=0&&s>=0)return 0;if(s<=0&&u>=0)return 0}h=c,a=l,s=u}}return i% 2!=0} function At(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=z(t),i=H(e),o=i.type,s=e.bbox, a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1; "Polygon"===o&&(a=[a]);for(var u=!1,l=0;l2&&void 0!==arguments[2]?arguments[2]:{},r=z(t),i=X(e),o=0;oi)return!1}else if(0!==g)return!1;return r?"start"===r?Math.abs(c)>= Math.abs(f)?c>0?a0?u=Math.abs(f)?c>0?a<=o&&o0?u<=s&&s=Math.abs(f)?c>0?a0?u=Math.abs(f)?c>0?a<=o&&o<=l:l<=o&&o<=a:f>0?u<=s&&s<=h:h<=s&&s<=u} function Vt(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!qt(Nt(t),Nt(e)))return!1;var n,r=h(H(e).coordinates);try{for(r.s();!(n=r.n()).done;){var i, o=h(n.value);try{for(o.s();!(i=o.n()).done;)if(!At(i.value,t))return!1}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}return!0} function qt(t,e){return!(t[0]>e[0])&&!(t[2]e[1])&&!(t[3]0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zt;if(n(this,t),this.data=e,this.length=this.data.length, this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)} return i(t,[{key:"push",value:function value(t){this.data.push(t),this.length++,this._up(this.length-1)}}, {key:"pop",value:function value(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}}, {key:"peek",value:function value(){return this.data[0]}}, {key:"_up",value:function value(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}}, {key:"_down",value:function value(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=s,t=o}e[t]= i}}]),t}(); function zt(t,e){return te?1:0} function Xt(t,e){return t.p.x>e.p.x?1:t.p.xe.p.y?1:-1:1} function jt(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x0?(h.isLeftEndpoint= !0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,h.isLeftEndpoint=!1),e.push(l),e.push(h),s=a,Ht+=1}}Zt+=1} var Qt=i(function t(e){n(this,t),this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}); function Kt(t,e){if(null===t||null===e)return!1;if(t.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.leftSweepEvent)|| t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;var n=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y, i=t.rightSweepEvent.p.x,o=t.rightSweepEvent.p.y,s=e.leftSweepEvent.p.x,a=e.leftSweepEvent.p.y,u=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,h=(l-a)*(i-n)-(u-s)*(o-r),c=(u-s)*(r-a)-(l-a)*(n-s),f=(i-n)* (r-a)-(o-r)*(n-s);if(0===h)return!1;var g=c/h,p=f/h;return g>=0&&g<=1&&p>=0&&p<=1&&[n+g*(i-n),r+g*(o-r)]} var $t=function $t(t,e){var n=new Yt([],Xt);return function(t,e){if("FeatureCollection"===t.type)for(var n=t.features,r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeDuplicates,i=void 0===r||r,o=n.ignoreSelfIntersections,s=void 0!==o&&o,a=[];"FeatureCollection"===t.type?a=a.concat(t.features): "Feature"===t.type?a.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||a.push(v(t)),"FeatureCollection"===e.type?a=a.concat(e.features):"Feature"=== e.type?a.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||a.push(v(e));var u=$t(b(a),s),l=[];if(i){var h={};u.forEach(function(t){var e=t.join(","); h[e]||(h[e]=!0,l.push(t))})}else l=u; return b(l.map(function(t){return y(t)}))} function ee(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case "Polygon":return function(t){var e= arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return ne(r,i)}(n,e); case "MultiPolygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return r.forEach(function(t){o.push(ne(t, i))}),b(o)}(n,e); default:throw new Error("invalid poly");}} function ne(t,e){return t.length>1?w(t,e):k(t[0],e)} function re(t,e){var n=H(t),r=H(e),i=n.type,o=r.type;switch(i){case "MultiPoint":switch(o){case "LineString":return ie(n,r);case "Polygon":return se(n,r);default:throw new Error("feature2 "+o+" geometry not supported"); }case "LineString":switch(o){case "MultiPoint":return ie(r,n);case "LineString":return function(t,e){if(te(t,e).features.length>0)for(var n=0;n0} function se(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<= n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections)&&n,i=!0;return ft(t,function(t){ft(e,function(e){if(!1===i)return!1;i=function(t,e, n){switch(t.type){case "Point":switch(e.type){case "Point":return r=t.coordinates,i=e.coordinates,!(r[0]===i[0]&&r[1]===i[1]);case "LineString":return!le(e,t);case "Polygon":return!At(t,e)}break;case "LineString":switch(e.type){case "Point":return!le(t, e);case "LineString":return!function(t,e,n){var r=te(t,e,{ignoreSelfIntersections:n});if(r.features.length>0)return!0;return!1}(t,e,n); case "Polygon":return!he(e,t,n)}break;case "Polygon":switch(e.type){case "Point":return!At(e,t);case "LineString":return!he(t,e,n);case "Polygon":return!function(t,e,n){var r,i=h(t.coordinates[0]);try{for(i.s();!(r= i.n()).done;)if(At(r.value,e))return!0}catch(t){i.e(t)}finally{i.f()}var o,s=h(e.coordinates[0]);try{for(s.s();!(o=s.n()).done;)if(At(o.value,t))return!0}catch(t){s.e(t)}finally{s.f()}var a=te(ee(t),ee(e), {ignoreSelfIntersections:n});if(a.features.length>0)return!0;return!1}(e,t,n)}}var r,i; return!1}(t.geometry,e.geometry,r)})}),i} function le(t,e){for(var n=0;n0} function ce(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&& n[1]<=t[1])} var fe=Object.defineProperty,ge=function ge(t,e){return fe(t,"name",{value:e,configurable:!0})},pe=function(){function t(e){var r,i,o; n(this,t),this.direction=!1,this.compareProperties=!0,this.precision=Math.pow(10,-(null!=(r=null==e?void 0:e.precision)?r:17)),this.direction=null!=(i=null==e?void 0:e.direction)&&i,this.compareProperties= null==(o=null==e?void 0:e.compareProperties)||o} return i(t,[{key:"compare",value:function value(t,e){var n=this;if(t.type!==e.type)return!1;if(!de(t,e))return!1;switch(t.type){case "Point":return this.compareCoord(t.coordinates,e.coordinates);case "LineString":return this.compareLine(t.coordinates, e.coordinates);case "Polygon":return this.comparePolygon(t,e);case "GeometryCollection":return this.compareGeometryCollection(t,e);case "Feature":return this.compareFeature(t,e);case "FeatureCollection":return this.compareFeatureCollection(t, e);default:if(t.type.startsWith("Multi")){var r=ye(t),i=ye(e);return r.every(function(t){return i.some(function(e){return n.compare(t,e)})})}}return!1}}, {key:"compareCoord",value:function value(t,e){var n=this;return t.length===e.length&&t.every(function(t,r){return Math.abs(t-e[r])2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!de(t,e))return!1;var i=t,o=e;if(r&& !this.compareCoord(i[0],o[0])){var s=this.fixStartIndex(o,i);if(!s)return!1;o=s}var a=this.compareCoord(i[n],o[n]);return this.direction||a?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+ n)])&&this.comparePath(i.slice().reverse(),o)}}, {key:"fixStartIndex",value:function value(t,e){for(var n,r=-1,i=0;i=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n}}, {key:"comparePath",value:function value(t,e){var n=this;return t.every(function(t,r){return n.compareCoord(t,e[r])})}}, {key:"comparePolygon",value:function value(t,e){var n=this;if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length); return r.every(function(t){return i.some(function(e){return n.compareLine(t,e,1,!0)})})}return!1}}, {key:"compareGeometryCollection",value:function value(t,e){var n=this;return de(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every(function(t,r){return n.compare(t,e.geometries[r])})}}, {key:"compareFeature",value:function value(t,e){return t.id===e.id&&(!this.compareProperties||_e(t.properties,e.properties))&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}}, {key:"compareFeatureCollection",value:function value(t,e){var n=this;return de(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every(function(t,r){return n.compare(t,e.features[r])})}}, {key:"compareBBox",value:function value(t,e){return Boolean(!t.bbox&&!e.bbox)||!(!t.bbox||!e.bbox)&&this.compareCoord(t.bbox,e.bbox)}}]),t}(); ge(pe,"GeojsonEquality");var ve=pe;function de(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length} function ye(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})} function me(t,e,n){return(new ve(n)).compare(t,e)} function _e(t,e){if(null===t&&null===e)return!0;if(null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0,o=n;i1&&void 0!==arguments[1]?arguments[1]:{},r="object"===e(n)?n.mutate:n;if(!t)throw new Error("geojson is required");var i=J(t),o=[];switch(i){case "LineString":o=Ee(t, i);break;case "MultiLineString":case "Polygon":X(t).forEach(function(t){o.push(Ee(t,i))}); break;case "MultiPolygon":X(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(Ee(t,i))}),o.push(e)}); break;case "Point":return t;case "MultiPoint":var s={};X(t).forEach(function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(s,e)||(o.push(t),s[e]=!0)}); break;default:throw new Error(i+" geometry not supported");}return t.coordinates?!0===r?(t.coordinates=o,t):{type:i,coordinates:o}:!0===r?(t.geometry.coordinates=o,t):v({type:i,coordinates:o},t.properties, {bbox:t.bbox,id:t.id})} function Ee(t,e){var n=X(t);if(2===n.length&&!be(n[0],n[1]))return n;var r=[],i=n.length-1,o=r.length;r.push(n[0]);for(var s=1;s2&&we(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1))}if(r.push(n[n.length-1]),o=r.length,("Polygon"===e||"MultiPolygon"===e)&&be(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon"); return"LineString"===e&&o<3||we(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1),r} function be(t,e){return t[0]===e[0]&&t[1]===e[1]} function we(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],l=a-o,h=u-s;return 0===(r-o)*h-(i-s)*l&&(Math.abs(l)>=Math.abs(h)?l>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)} function Ie(t,e){var n,r=null!=(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections)&&n,i=!1;return ft(t,function(t){ft(e,function(e){if(!0===i)return!0;i=!ue(t.geometry, e.geometry,{ignoreSelfIntersections:r})})}),i} function Ne(t,e,n,r,i){Se(t,e,n||0,r||t.length-1,i||Pe)} function Se(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Se(t,e,Math.max(n,Math.floor(e-s*u/o+l)),Math.min(r,Math.floor(e+ (o-s)*u/o+l)),i)}var h=t[e],c=n,f=r;for(Me(t,n,e),i(t[r],h)>0&&Me(t,n,r);c0;)f--}0===i(t[n],h)?Me(t,n,f):Me(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f- 1)}} function Me(t,e,n){var r=t[e];t[e]=t[n],t[n]=r} function Pe(t,e){return te?1:0} var Le=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;n(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()} return i(t,[{key:"all",value:function value(){return this._all(this.data,[])}}, {key:"search",value:function value(t){var e=this.data,n=[];if(!Ge(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i, e),e--;this._adjustParentBBoxes(r,i,e)}}, {key:"_split",value:function value(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Be(n.children.splice(o,n.children.length-o)); s.height=n.height,s.leaf=n.leaf,Re(n,this.toBBox),Re(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}}, {key:"_splitRoot",value:function value(t,e){this.data=Be([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Re(this.data,this.toBBox)}}, {key:"_chooseSplitIndex",value:function value(t,e,n){for(var r,i,o,s,a,u,l,h=1/0,c=1/0,f=e;f<=n-e;f++){var g=Oe(t,0,f,this.toBBox),p=Oe(t,f,n,this.toBBox),v=(i=g,o=p,s=void 0,a=void 0,u=void 0,l=void 0, s=Math.max(i.minX,o.minX),a=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),l=Math.min(i.maxY,o.maxY),Math.max(0,u-s)*Math.max(0,l-a)),d=Fe(g)+Fe(p);v=e;h--){var c=t.children[h];Te(s,t.leaf?i(c):c),a+=Ve(s)}return a}}, {key:"_adjustParentBBoxes",value:function value(t,e,n){for(var r=n;r>=0;r--)Te(e[r],t)}}, {key:"_condense",value:function value(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():Re(t[n],this.toBBox)}}]),t}(); function Ce(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY} function Be(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}} function Ye(t,e,n,r,i){for(var o=[e,n];o.length;)if(!((n=o.pop())-(e=o.pop())<=r)){var s=e+Math.ceil((n-e)/r/2)*r;Ne(t,s,e,n,i),o.push(e,s,s,n)}} var ze=Object.freeze({__proto__:null,"default":Le});function Xe(t){var e=new Le(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Nt(t), Le.prototype.insert.call(this,t)},e.load=function(t){var e=[]; return Array.isArray(t)?t.forEach(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:Nt(t),e.push(t)}):at(t,function(t){if("Feature"!==t.type)throw new Error("invalid features"); t.bbox=t.bbox?t.bbox:Nt(t),e.push(t)}),Le.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature"); return t.bbox=t.bbox?t.bbox:Nt(t),Le.prototype.remove.call(this,t,e)},e.clear=function(){return Le.prototype.clear.call(this)},e.search=function(t){return b(Le.prototype.search.call(this,this.toBBox(t)))}, e.collides=function(t){return Le.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return b(Le.prototype.all.call(this))},e.toJSON=function(){return Le.prototype.toJSON.call(this)},e.fromJSON= function(t){return Le.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e; if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=Nt(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson"); e=Nt(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e} function je(t){if(!t)throw new Error("geojson is required");var e=[];return ft(t,function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case "Polygon":n=X(r);break;case "LineString":n= [X(r)]}n.forEach(function(n){var r=function(t,e){var n=[];return t.reduce(function(t,r){var i=k([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=ni?n:i,l=r>o? r:o;return[s,a,u,l]}(t,r),n.push(i),r}),n}(n,t.properties); r.forEach(function(t){t.id=e.length,e.push(t)})})}}(t,e)}),b(e)} var Ue=Object.defineProperty,Ze=Object.defineProperties,We=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ke= function Ke(t,e,n){return e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},$e=function $e(t,e){for(var n in e||(e={}))Je.call(e,n)&&Ke(t,n,e[n]); if(He){var r,i=h(He(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Qe.call(e,n)&&Ke(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},tn=function tn(t,e){return Ze(t,We(e))}; function en(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("lines and pt are required arguments");var r=y([1/0,1/0],{dist:1/0,index:-1,multiFeatureIndex:-1, location:-1}),i=0;return ft(t,function(t,o,s){for(var a=X(t),u=0;u0&&d.features[0]&& (m=tn($e({},d.features[0]),{properties:{dist:tt(e,d.features[0],n),multiFeatureIndex:s,location:i+tt(l,d.features[0],n)}})),l.properties.dist2&&void 0!==arguments[2]?arguments[2]:{};if(!q(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=Xe(),a=je(t);s.load(a);var u=[];return pt(e, function(t){var e=!1;t&&(at(s.search(t),function(n){if(!1===e){var o=X(t).sort(),s=X(n).sort();if(sn(o,s))e=!0,r=r?un(r,t)||r:t;else if(0===i?Dt(o[0],n)&&Dt(o[1],n):en(n,o[0]).properties.dist<=i&&en(n, o[1]).properties.dist<=i)e=!0,r=r?un(r,t)||r:t;else if(0===i?Dt(s[0],t)&&Dt(s[1],t):en(t,s[0]).properties.dist<=i&&en(t,s[1]).properties.dist<=i)if(r){var a=un(r,n);a?r=a:u.push(n)}else r=n}}),!1===e&& r&&(o.push(r),u.length&&(o=o.concat(u),u=[]),r=void 0))}),r&&o.push(r),b(o)} function un(t,e){var n=X(e),r=X(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;if(sn(n[0],i))s.unshift(n[1]);else if(sn(n[0],o))s.push(n[1]);else if(sn(n[1],i))s.unshift(n[0]);else{if(!sn(n[1],o))return; s.push(n[0])}return t} function ln(t,e){var n=R(et(t[0],t[1])),r=R(et(e[0],e[1]));return n===r||(r-n)%180==0} function hn(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e);} function cn(t,e){return!!fn(e.coordinates[0],t.coordinates)||!!fn(e.coordinates[e.coordinates.length-1],t.coordinates)} function fn(t,e){return t[0]===e[0]&&t[1]===e[1]} function gn(t){return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]} function pn(t){for(var e=0;ee[0])&&!(t[2]e[1])&&!(t[3]1&&void 0!==arguments[1]?arguments[1]:{},n=Nt(t);return y([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)} var kn={exports:{}};!function(t,n){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");} function n(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}, e:function e(t){throw t;}, f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,s=!0,a=!1;return{s:function s(){_n3= _n3.call(t)}, n:function n(){var t=_n3.next();return s=t.done,t}, e:function e(t){a=!0,o=t}, f:function f(){try{s||null==_n3["return"]||_n3["return"]()}finally{if(a)throw o;}}}} var m=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getEndCapStyle",value:function value(){return this._endCapStyle}}, {key:"isSingleSided",value:function value(){return this._isSingleSided}}, {key:"setQuadrantSegments",value:function value(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=e.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=e.JOIN_MITRE,this._mitreLimit= Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==e.JOIN_ROUND&&(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS)}}, {key:"getJoinStyle",value:function value(){return this._joinStyle}}, {key:"setJoinStyle",value:function value(t){this._joinStyle=t}}, {key:"setSimplifyFactor",value:function value(t){this._simplifyFactor=t<0?0:t}}, {key:"getSimplifyFactor",value:function value(){return this._simplifyFactor}}, {key:"getQuadrantSegments",value:function value(){return this._quadrantSegments}}, {key:"setEndCapStyle",value:function value(t){this._endCapStyle=t}}, {key:"getMitreLimit",value:function value(){return this._mitreLimit}}, {key:"setMitreLimit",value:function value(t){this._mitreLimit=t}}, {key:"setSingleSided",value:function value(t){this._isSingleSided=t}}],[{key:"constructor_", value:function value(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor= e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n), this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}}, {key:"bufferDistanceError",value:function value(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)}}]),e}(); m.CAP_ROUND=1,m.CAP_FLAT=2,m.CAP_SQUARE=3,m.JOIN_ROUND=1,m.JOIN_MITRE=2,m.JOIN_BEVEL=3,m.DEFAULT_QUADRANT_SEGMENTS=8,m.DEFAULT_MITRE_LIMIT=5,m.DEFAULT_SIMPLIFY_FACTOR=.01;var _=function(e){i(o,e);var n= f(o);function o(e){var r;return t(this,o),(r=n.call(this,e)).name=Object.keys({Exception:o})[0],r} return r(o,[{key:"toString",value:function value(){return this.message}}]),o}(l(Error)),x=function(e){i(r,e); var n=f(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).name=Object.keys({IllegalArgumentException:r})[0],i} return r}(_),k=function(){function e(){t(this,e)} return r(e,[{key:"filter",value:function value(t){}}]),e}(); function E(){} function b(){} function w(){} var I,N,S,M,P,L,C,R,O=function(){function e(){t(this,e)} return r(e,null,[{key:"equalsWithTolerance",value:function value(t,e,n){return Math.abs(t-e)<=n}}]),e}(),T=function(){function e(n,r){t(this,e),this.low=r||0,this.high=n||0} return r(e,null,[{key:"toBinaryString",value:function value(t){var e,n="";for(e=2147483648;e>0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]),e}(); function A(){} function D(){} A.NaN=NaN,A.isNaN=function(t){return Number.isNaN(t)},A.isInfinite=function(t){return!Number.isFinite(t)},A.MAX_VALUE=Number.MAX_VALUE,A.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,A.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY, "function"==typeof Float64Array&&"function"==typeof Int32Array?(L=2146435072,C=new Float64Array(1),R=new Int32Array(C.buffer),A.doubleToLongBits=function(t){C[0]=t; var e=0|R[0],n=0|R[1];return(n&L)===L&&0!=(1048575&n)&&0!==e&&(e=0,n=2146959360),new T(n,e)},A.longBitsToDouble=function(t){return R[0]=t.low,R[1]=t.high,C[0]}):(I=1023,N=Math.log2,S=Math.floor,M=Math.pow, P=function(){for(var t=53;t>0;t--){var e=M(2,t)-1; if(S(N(e))+1===t)return e}return 0}(),A.doubleToLongBits=function(t){var e,n,r,i,o,s,a,u,l; if(t<0||1/t===Number.NEGATIVE_INFINITY?(s=1<<31,t=-t):s=0,0===t)return new T(u=s,l=0);if(t===1/0)return new T(u=2146435072|s,l=0);if(t!=t)return new T(u=2146959360,l=0);if(i=0,l=0,(e=S(t))>1)if(e<=P)(i= S(N(e)))<=20?(l=0,u=e<<20-i&1048575):(l=e%(n=M(2,r=i-20))<<32-r,u=e/n&1048575);else for(r=e,l=0;0!==(r=S(n=r/2));)i++,l>>>=1,l|=(1&u)<<31,u>>>=1,n!==r&&(u|=524288);if(a=i+I,o=0===e,e=t-e,i<52&&0!==e)for(r= 0;;){if((n=2*e)>=1?(e=n-1,o?(a--,o=!1):(r<<=1,r|=1,i++)):(e=n,o?0==--a&&(i++,o=!1):(r<<=1,i++)),20===i)u|=r,r=0;else if(52===i){l|=r;break}if(1===n){i<20?u|=r<<20-i:i<52&&(l|=r<<52-i);break}}return u|= a<<20,new T(u|=s,l)},A.longBitsToDouble=function(t){var e,n,r,i,o=t.high,s=t.low,a=o&1<<31?-1:1; for(r=((2146435072&o)>>20)-I,i=0,n=1<<19,e=1;e<=20;e++)o&n&&(i+=M(2,-e)),n>>>=1;for(n=1<<31,e=21;e<=52;e++)s&n&&(i+=M(2,-e)),n>>>=1;if(-1023===r){if(0===i)return 0*a;r=-1022}else{if(1024===r)return 0=== i?a/0:NaN;i+=1}return a*i*M(2,r)}); var F=function(e){i(r,e);var n=f(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).name=Object.keys({RuntimeException:r})[0],i} return r}(_),V=function(e){i(o,e); var n=f(o);function o(){var e;return t(this,o),e=n.call(this),o.constructor_.apply(h(e),arguments),e} return r(o,null,[{key:"constructor_",value:function value(){if(0===arguments.length)F.constructor_.call(this);else if(1===arguments.length){var t=arguments[0];F.constructor_.call(this,t)}}}]),o}(F),q=function(){function e(){t(this, e)} return r(e,null,[{key:"shouldNeverReachHere",value:function value(){if(0===arguments.length)e.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new V("Should never reach here"+ (null!==t?": "+t:""));}}}, {key:"isTrue",value:function value(){if(1===arguments.length){var t=arguments[0];e.isTrue(t,null)}else if(2===arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new V:new V(n);}}}, {key:"equals",value:function value(){if(2===arguments.length){var t=arguments[0],n=arguments[1];e.equals(t,n,null)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(!i.equals(r))throw new V("Expected "+ r+" but encountered "+i+(null!==o?": "+o:""));}}}]),e}(),G=new ArrayBuffer(8),B=new Float64Array(G),Y=new Int32Array(G),z=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getM",value:function value(){return A.NaN}}, {key:"setOrdinate",value:function value(t,n){switch(t){case e.X:this.x=n;break;case e.Y:this.y=n;break;case e.Z:this.setZ(n);break;default:throw new x("Invalid ordinate index: "+t);}}}, {key:"equals2D",value:function value(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!O.equalsWithTolerance(this.x, e.x,n)&&!!O.equalsWithTolerance(this.y,e.y,n)}}}, {key:"setM",value:function value(t){throw new x("Invalid ordinate index: "+e.M);}}, {key:"getZ",value:function value(){return this.z}}, {key:"getOrdinate",value:function value(t){switch(t){case e.X:return this.x;case e.Y:return this.y;case e.Z:return this.getZ()}throw new x("Invalid ordinate index: "+t);}}, {key:"equals3D",value:function value(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||A.isNaN(this.getZ())&&A.isNaN(t.getZ()))}}, {key:"equals",value:function value(t){return t instanceof e&&this.equals2D(t)}}, {key:"equalInZ",value:function value(t,e){return O.equalsWithTolerance(this.getZ(),t.getZ(),e)}}, {key:"setX",value:function value(t){this.x=t}}, {key:"compareTo",value:function value(t){var e=t;return this.xe.x?1:this.ye.y?1:0}}, {key:"getX",value:function value(){return this.x}}, {key:"setZ",value:function value(t){this.z=t}}, {key:"clone",value:function value(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return q.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t; }}}, {key:"copy",value:function value(){return new e(this)}}, {key:"toString",value:function value(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}}, {key:"distance3D",value:function value(t){var e=this.x-t.x,n=this.y-t.y,r=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+r*r)}}, {key:"getY",value:function value(){return this.y}}, {key:"setY",value:function value(t){this.y=t}}, {key:"distance",value:function value(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}}, {key:"hashCode",value:function value(){var t=17;return 37*(t=37*t+e.hashCode(this.x))+e.hashCode(this.y)}}, {key:"setCoordinate",value:function value(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}, {key:"interfaces_",get:function get(){return[E,b,w]}}],[{key:"constructor_", value:function value(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)e.constructor_.call(this,0,0);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.x,t.y,t.getZ())}else if(2=== arguments.length){var n=arguments[0],r=arguments[1];e.constructor_.call(this,n,r,e.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.x=i,this.y=o,this.z= s}}}, {key:"hashCode",value:function value(t){return B[0]=t,Y[0]^Y[1]}}]),e}(),X=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"compare",value:function value(t,n){var r=e.compare(t.x,n.x);if(0!==r)return r;var i=e.compare(t.y,n.y);return 0!==i?i:this._dimensionsToTest<=2?0:e.compare(t.getZ(),n.getZ())}}, {key:"interfaces_",get:function get(){return[D]}}],[{key:"constructor_", value:function value(){if(this._dimensionsToTest=2,0===arguments.length)e.constructor_.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new x("only 2 or 3 dimensions may be specified"); this._dimensionsToTest=t}}}, {key:"compare",value:function value(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0}}]),e}(); z.DimensionalComparator=X,z.NULL_ORDINATE=A.NaN,z.X=0,z.Y=1,z.Z=2,z.M=3;var j=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getArea",value:function value(){return this.getWidth()*this.getHeight()}}, {key:"equals",value:function value(t){if(!(t instanceof e))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()}}, {key:"intersection",value:function value(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new e;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny;return new e(n, this._maxx=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return!this.isNull()&&r>= this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}}}, {key:"intersects",value:function value(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy|| t._maxythis._maxx||(r.x>i.x?r.x:i.x)this._maxy||(r.y>i.y?r.y:i.y)this._maxx||othis._maxy||sthis._maxx&&(this._maxx= n._maxx),n._minythis._maxy&&(this._maxy=n._maxy))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny= i,this._maxy=i):(rthis._maxx&&(this._maxx=r),ithis._maxy&&(this._maxy=i))}}}, {key:"minExtent",value:function value(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0}}, {key:"translate",value:function value(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}}, {key:"copy",value:function value(){return new e(this)}}, {key:"toString",value:function value(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}}, {key:"setToNull",value:function value(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}}, {key:"disjoint",value:function value(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxxthis._maxy||t._maxye?t:e}}, {key:"expandBy",value:function value(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-= e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}}, {key:"contains",value:function value(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof z){var n=arguments[0];return this.covers(n)}}else if(2=== arguments.length){var r=arguments[0],i=arguments[1];return this.covers(r,i)}}}, {key:"centre",value:function value(){return this.isNull()?null:new z((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}}, {key:"init",value:function value(){if(0===arguments.length)this.setToNull();else if(1===arguments.length)if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else{if(arguments[0]instanceof e){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4=== arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];ot._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)}}, {key:"hashCode",value:function value(){var t=17;return 37*(t=37*(t=37*(t=37*t+z.hashCode(this._minx))+z.hashCode(this._maxx))+z.hashCode(this._miny))+z.hashCode(this._maxy)}}, {key:"interfaces_",get:function get(){return[E,w]}}],[{key:"constructor_", value:function value(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length)if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x, t.x,t.y,t.y)}else{if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o= arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}}}, {key:"intersects",value:function value(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.y e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(l>u||hu||h=this.size())throw new nt;return this.array[t]}}, {key:"push",value:function value(t){return this.array.push(t),t}}, {key:"pop",value:function value(){if(0===this.array.length)throw new et;return this.array.pop()}}, {key:"peek",value:function value(){if(0===this.array.length)throw new et;return this.array[this.array.length-1]}}, {key:"empty",value:function value(){return 0===this.array.length}}, {key:"isEmpty",value:function value(){return this.empty()}}, {key:"search",value:function value(t){return this.array.indexOf(t)}}, {key:"size",value:function value(){return this.array.length}}, {key:"toArray",value:function value(){return this.array.slice()}}]),o}(rt); function ot(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1} var st=function(){function e(n){t(this,e),this.str=n} return r(e,[{key:"append",value:function value(t){this.str+=t}}, {key:"setCharAt",value:function value(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}}, {key:"toString",value:function value(){return this.str}}]),e}(),at=function(){function e(n){t(this,e),this.value=n} return r(e,[{key:"intValue",value:function value(){return this.value}}, {key:"compareTo",value:function value(t){return this.valuet?1:0}}],[{key:"compare", value:function value(t,e){return te?1:0}}, {key:"isNan",value:function value(t){return Number.isNaN(t)}}, {key:"valueOf",value:function value(t){return new e(t)}}]),e}(),ut=function(){function e(){t(this,e)} return r(e,null,[{key:"isWhitespace",value:function value(t){return t<=32&&t>=0||127===t}}, {key:"toUpperCase",value:function value(t){return t.toUpperCase()}}]),e}(),lt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"le",value:function value(t){return this._hi9?(c=!0,f="9"):f="0"+h,a.append(f),r=r.subtract(e.valueOf(h)).multiply(e.TEN), c&&r.selfAdd(e.TEN);var g=!0,p=e.magnitude(r._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return n[0]=i,a.toString()}}, {key:"sqr",value:function value(){return this.multiply(this)}}, {key:"doubleValue",value:function value(){return this._hi+this._lo}}, {key:"subtract",value:function value(){if(arguments[0]instanceof e){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}}, {key:"equals",value:function value(){if(1===arguments.length&&arguments[0]instanceof e){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}}, {key:"isZero",value:function value(){return 0===this._hi&&0===this._lo}}, {key:"selfSubtract",value:function value(){if(arguments[0]instanceof e){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()? this:this.selfAdd(-n,0)}}}, {key:"getSpecialNumberString",value:function value(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}}, {key:"min",value:function value(t){return this.le(t)?this:t}}, {key:"selfDivide",value:function value(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0]; return this.selfDivide(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null,c=null,f=null;return l=this._hi/r,f=(o=(h=e.SPLIT*l)-(o=h-l))*(a=(f= e.SPLIT*r)-(a=f-r))-(c=l*r)+o*(u=r-a)+(s=l-o)*a+s*u,f=l+(h=(this._hi-c-f+this._lo-l*i)/r),this._hi=f,this._lo=l-f+h,this}}}, {key:"dump",value:function value(){return"DD\x3c"+this._hi+", "+this._lo+"\x3e"}}, {key:"divide",value:function value(){if(arguments[0]instanceof e){var t=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;return r=(s=this._hi/t._hi)-(n=(a=e.SPLIT*s)-(n=a-s)),l=n*(i= (l=e.SPLIT*t._hi)-(i=l-t._hi))-(u=s*t._hi)+n*(o=t._hi-i)+r*i+r*o,new e(l=s+(a=(this._hi-u-l+this._lo-s*t._lo)/t._hi),s-l+a)}if("number"==typeof arguments[0]){var h=arguments[0];return A.isNaN(h)?e.createNaN(): e.copy(this).selfDivide(h,0)}}}, {key:"ge",value:function value(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}}, {key:"pow",value:function value(t){if(0===t)return e.valueOf(1);var n=new e(this),r=e.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&r.selfMultiply(n),(i/=2)>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal(): r}}, {key:"ceil",value:function value(){if(this.isNaN())return e.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new e(t,n)}}, {key:"compareTo",value:function value(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0}}, {key:"rint",value:function value(){return this.isNaN()?this:this.add(.5).floor()}}, {key:"setValue",value:function value(){if(arguments[0]instanceof e){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}}, {key:"max",value:function value(t){return this.ge(t)?this:t}}, {key:"sqrt",value:function value(){if(this.isZero())return e.valueOf(0);if(this.isNegative())return e.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=e.valueOf(n),i=this.subtract(r.sqr())._hi*(.5*t);return r.add(i)}}, {key:"selfAdd",value:function value(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0],r=null, i=null,o=null,s=null,a=null,u=null;return s=(o=this._hi+n)-(a=o-this._hi),i=(u=(s=n-a+(this._hi-s))+this._lo)+(o-(r=o+u)),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(2===arguments.length){var l= arguments[0],h=arguments[1],c=null,f=null,g=null,p=null,v=null,d=null,y=null;p=this._hi+l,f=this._lo+h,v=p-(d=p-this._hi),g=f-(y=f-this._lo);var m=(c=p+(d=(v=l-d+(this._hi-v))+f))+(d=(g=h-y+(this._lo-g))+ (d+(p-c))),_=d+(c-m);return this._hi=m,this._lo=_,this}}}, {key:"selfMultiply",value:function value(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0]; return this.selfMultiply(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null;o=(l=e.SPLIT*this._hi)-this._hi,h=e.SPLIT*r,o=l-o,s=this._hi-o,a= h-r;var c=(l=this._hi*r)+(h=o*(a=h-a)-l+o*(u=r-a)+s*a+s*u+(this._hi*i+this._lo*r)),f=h+(o=l-c);return this._hi=c,this._lo=f,this}}}, {key:"selfSqr",value:function value(){return this.selfMultiply(this)}}, {key:"floor",value:function value(){if(this.isNaN())return e.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new e(t,n)}}, {key:"negate",value:function value(){return this.isNaN()?this:new e(-this._hi,-this._lo)}}, {key:"clone",value:function value(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t;}}}, {key:"multiply",value:function value(){if(arguments[0]instanceof e){var t=arguments[0];return t.isNaN()?e.createNaN():e.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var n=arguments[0];return A.isNaN(n)? e.createNaN():e.copy(this).selfMultiply(n,0)}}}, {key:"isNaN",value:function value(){return A.isNaN(this._hi)}}, {key:"intValue",value:function value(){return Math.trunc(this._hi)}}, {key:"toString",value:function value(){var t=e.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}}, {key:"toStandardNotation",value:function value(){var t=this.getSpecialNumberString();if(null!==t)return t;var n=(new Array(1)).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;if("."===r.charAt(0))o= "0"+r;else if(i<0)o="0."+e.stringOfChar("0",-i)+r;else if(-1===r.indexOf(".")){var s=i-r.length;o=r+e.stringOfChar("0",s)+".0"}return this.isNegative()?"-"+o:o}}, {key:"reciprocal",value:function value(){var t,n,r,i,o=null,s=null,a=null,u=null;t=(r=1/this._hi)-(o=(a=e.SPLIT*r)-(o=a-r)),s=(u=e.SPLIT*this._hi)-this._hi;var l=r+(a=(1-(i=r*this._hi)-(u=o*(s=u-s)-i+o* (n=this._hi-s)+t*s+t*n)-r*this._lo)/this._hi);return new e(l,r-l+a)}}, {key:"toSciNotation",value:function value(){if(this.isZero())return e.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var n=(new Array(1)).fill(null),r=this.extractSignificantDigits(!1, n),i=e.SCI_NOT_EXPONENT_CHAR+n[0];if("0"===r.charAt(0))throw new IllegalStateException("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()? "-"+s+i:s+i}}, {key:"abs",value:function value(){return this.isNaN()?e.NaN:this.isNegative()?this.negate():new e(this)}}, {key:"isPositive",value:function value(){return this._hi>0||0===this._hi&&this._lo>0}}, {key:"lt",value:function value(t){return this._hit._hi||this._hi===t._hi&&this._lo>t._lo}}, {key:"isNegative",value:function value(){return this._hi<0||0===this._hi&&this._lo<0}}, {key:"trunc",value:function value(){return this.isNaN()?e.NaN:this.isPositive()?this.floor():this.ceil()}}, {key:"signum",value:function value(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}}, {key:"interfaces_",get:function get(){return[w,E,b]}}],[{key:"constructor_", value:function value(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else{if("string"==typeof arguments[0]){var r=arguments[0];e.constructor_.call(this,e.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i, o)}}}, {key:"determinant",value:function value(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1], r=arguments[2],i=arguments[3];return e.determinant(e.valueOf(t),e.valueOf(n),e.valueOf(r),e.valueOf(i))}if(arguments[3]instanceof e&&arguments[2]instanceof e&&arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[1],s=arguments[2],a=arguments[3];return arguments[0].multiply(a).selfSubtract(o.multiply(s))}}}, {key:"sqr",value:function value(t){return e.valueOf(t).selfMultiply(t)}}, {key:"valueOf",value:function value(){if("string"==typeof arguments[0]){var t=arguments[0];return e.parse(t)}if("number"==typeof arguments[0])return new e(arguments[0])}}, {key:"sqrt",value:function value(t){return e.valueOf(t).sqrt()}}, {key:"parse",value:function value(t){for(var n=0,r=t.length;ut.isWhitespace(t.charAt(n));)n++;var i=!1;if(n= r);){var c=t.charAt(n);if(n++,ut.isDigit(c)){var f=c-"0";s.selfMultiply(e.TEN),s.selfAdd(f),a++}else{if("."!==c){if("e"===c||"E"===c){var g=t.substring(n);try{l=at.parseInt(g)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+g+" in string "+t):e;}break}throw new NumberFormatException("Unexpected character '"+c+"' at position "+n+" in string "+t);}u=a,h=!0}}var p= s;h||(u=a);var v=a-u-l;if(0===v)p=s;else if(v>0){var d=e.TEN.pow(v);p=s.divide(d)}else if(v<0){var y=e.TEN.pow(-v);p=s.multiply(y)}return i?p.negate():p}}, {key:"createNaN",value:function value(){return new e(A.NaN,A.NaN)}}, {key:"copy",value:function value(t){return new e(t)}}, {key:"magnitude",value:function value(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r}}, {key:"stringOfChar",value:function value(t,e){for(var n=new st,r=0;r0){if(s<=0)return e.signum(a);i=o+s}else{if(!(o<0))return e.signum(a);if(s>=0)return e.signum(a); i=-o-s}var u=e.DP_SAFE_EPSILON*i;return a>=u||-a>=u?e.signum(a):2}}, {key:"signum",value:function value(t){return t>0?1:t<0?-1:0}}]),e}(); ht.DP_SAFE_EPSILON=1E-15;var ct=function(){function e(){t(this,e)} return r(e,[{key:"getM",value:function value(t){if(this.hasM()){var e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return A.NaN}}, {key:"setOrdinate",value:function value(t,e,n){}}, {key:"getZ",value:function value(t){return this.hasZ()?this.getOrdinate(t,2):A.NaN}}, {key:"size",value:function value(){}}, {key:"getOrdinate",value:function value(t,e){}}, {key:"getCoordinate",value:function value(){}}, {key:"getCoordinateCopy",value:function value(t){}}, {key:"createCoordinate",value:function value(){}}, {key:"getDimension",value:function value(){}}, {key:"hasM",value:function value(){return this.getMeasures()>0}}, {key:"getX",value:function value(t){}}, {key:"hasZ",value:function value(){return this.getDimension()-this.getMeasures()>2}}, {key:"getMeasures",value:function value(){return 0}}, {key:"expandEnvelope",value:function value(t){}}, {key:"copy",value:function value(){}}, {key:"getY",value:function value(t){}}, {key:"toCoordinateArray",value:function value(){}}, {key:"interfaces_",get:function get(){return[b]}}]),e}(); ct.X=0,ct.Y=1,ct.Z=2,ct.M=3;var ft=function(){function e(){t(this,e)} return r(e,null,[{key:"index",value:function value(t,e,n){return ht.orientationIndex(t,e,n)}}, {key:"isCCW",value:function value(){if(arguments[0]instanceof Array){var t=arguments[0],n=t.length-1;if(n<3)throw new x("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0], i=0,o=1;o<=n;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do(a-=1)<0&&(a=n);while(t[a].equals2D(r)&&a!==i);var u=i;do u=(u+1)%n;while(t[u].equals2D(r)&&u!==i);var l=t[a],h=t[u];if(l.equals2D(r)||h.equals2D(r)|| l.equals2D(h))return!1;var c=e.index(l,r,h);return 0===c?l.x>h.x:c>0}if(ot(arguments[0],ct)){var f=arguments[0],g=f.size()-1;if(g<3)throw new x("Ring has fewer than 4 points, so orientation cannot be determined"); for(var p=f.getCoordinate(0),v=0,d=1;d<=g;d++){var y=f.getCoordinate(d);y.y>p.y&&(p=y,v=d)}var m=null,_=v;do(_-=1)<0&&(_=g),m=f.getCoordinate(_);while(m.equals2D(p)&&_!==v);var k=null,E=v;do E=(E+1)%g, k=f.getCoordinate(E);while(k.equals2D(p)&&E!==v);if(m.equals2D(p)||k.equals2D(p)||m.equals2D(k))return!1;var b=e.index(m,p,k);return 0===b?m.x>k.x:b>0}}}]),e}(); ft.CLOCKWISE=-1,ft.RIGHT=ft.CLOCKWISE,ft.COUNTERCLOCKWISE=1,ft.LEFT=ft.COUNTERCLOCKWISE,ft.COLLINEAR=0,ft.STRAIGHT=ft.COLLINEAR;var gt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getCoordinate",value:function value(){return this._minCoord}}, {key:"getRightmostSide",value:function value(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)), n}}, {key:"findRightmostEdgeAtVertex",value:function value(){var t=this._minDe.getEdge().getCoordinates();q.isTrue(this._minIndex>0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r=== ft.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)}}, {key:"getRightmostSideOfSegment",value:function value(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=tt.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n, this._minCoord=e[n])}}, {key:"findRightmostEdgeAtNode",value:function value(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length- 1)}}, {key:"findEdge",value:function value(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}q.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()), "inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)=== tt.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_", value:function value(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),e}(),pt=function(e){i(o,e); var n=f(o);function o(e,r){var i;return t(this,o),(i=n.call(this,r?e+" [ "+r+" ]":e)).pt=r?new z(r):void 0,i.name=Object.keys({TopologyException:o})[0],i} return r(o,[{key:"getCoordinate",value:function value(){return this.pt}}]),o}(F),vt=function(){function e(){t(this,e),this.array=[]} return r(e,[{key:"addLast",value:function value(t){this.array.push(t)}}, {key:"removeFirst",value:function value(){return this.array.shift()}}, {key:"isEmpty",value:function value(){return 0===this.array.length}}]),e}(),dt=function(e,n){i(s,e); var o=f(s);function s(e){var n;return t(this,s),(n=o.call(this)).array=[],e instanceof W&&n.addAll(e),n} return r(s,[{key:"interfaces_",get:function get(){return[rt,W]}}, {key:"ensureCapacity",value:function value(){}}, {key:"add",value:function value(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}}, {key:"clear",value:function value(){this.array=[]}}, {key:"addAll",value:function value(t){var e,n=y(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.array.push(r)}}catch(t){n.e(t)}finally{n.f()}}}, {key:"set",value:function value(t,e){var n=this.array[t];return this.array[t]=e,n}}, {key:"iterator",value:function value(){return new yt(this)}}, {key:"get",value:function value(t){if(t<0||t>=this.size())throw new nt;return this.array[t]}}, {key:"isEmpty",value:function value(){return 0===this.array.length}}, {key:"sort",value:function value(t){t?this.array.sort(function(e,n){return t.compare(e,n)}):this.array.sort()}}, {key:"size",value:function value(){return this.array.length}}, {key:"toArray",value:function value(){return this.array.slice()}}, {key:"remove",value:function value(t){for(var e=0,n=this.array.length;e=1&&e.getDepth(tt.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}}, {key:"computeDepths",value:function value(t){var e=new K,n=new vt,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o= i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}}}, {key:"compareTo",value:function value(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0}}, {key:"getEnvelope",value:function value(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;re.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.xr.x?n.x:r.x,c=n.y> r.y?n.y:r.y,f=((i>u?i:u)+(sl?o:l)+(an?n:t}if(Number.isInteger(arguments[2])&& Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}}}, {key:"wrap",value:function value(t,e){return t<0?e- -t%e:t%e}}, {key:"max",value:function value(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3], s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}}}, {key:"average",value:function value(t,e){return(t+e)/2}}]),e}(); kt.LOG_10=Math.log(10);var Et=function(){function e(){t(this,e)} return r(e,null,[{key:"segmentToSegment",value:function value(t,n,r,i){if(t.equals(n))return e.pointToSegment(t,r,i);if(r.equals(i))return e.pointToSegment(i,t,n);var o=!1;if(j.intersects(t,n,r,i)){var s= (n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(0===s)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=((t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y))/s,l=a/s;(l<0||l>1||u<0||u>1)&&(o=!0)}}else o=!0;return o? kt.min(e.pointToSegment(t,r,i),e.pointToSegment(n,r,i),e.pointToSegment(r,t,n),e.pointToSegment(i,t,n)):0}}, {key:"pointToSegment",value:function value(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;if(i<=0)return t.distance(e); if(i>=1)return t.distance(n);var o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(o)*Math.sqrt(r)}}, {key:"pointToLinePerpendicular",value:function value(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)}}, {key:"pointToSegmentString",value:function value(t,n){if(0===n.length)throw new x("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i0)&&(o=a,i=s)}return i}}}, {key:"extend",value:function value(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();if(e.copy(n,0,i,0,o),o>0)for(var s=o;s0)&&(e=r)}return e}}]),e}(),Mt=function(){function e(){t(this,e)} return r(e,null,[{key:"toDimensionSymbol",value:function value(t){switch(t){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L; case e.A:return e.SYM_A}throw new x("Unknown dimension value: "+t);}}, {key:"toDimensionValue",value:function value(t){switch(ut.toUpperCase(t)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L; case e.SYM_A:return e.A}throw new x("Unknown dimension symbol: "+t);}}]),e}(); Mt.P=0,Mt.L=1,Mt.A=2,Mt.FALSE=-1,Mt.TRUE=-2,Mt.DONTCARE=-3,Mt.SYM_FALSE="F",Mt.SYM_TRUE="T",Mt.SYM_DONTCARE="*",Mt.SYM_P="0",Mt.SYM_L="1",Mt.SYM_A="2";var Pt=function(){function e(){t(this,e)} return r(e,[{key:"filter",value:function value(t){}}]),e}(),Lt=function(){function e(){t(this,e)} return r(e,[{key:"filter",value:function value(t,e){}}, {key:"isDone",value:function value(){}}, {key:"isGeometryChanged",value:function value(){}}]),e}(),Ct=function(e){i(s,e); var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"computeEnvelopeInternal",value:function value(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)}}, {key:"isRing",value:function value(){return this.isClosed()&&this.isSimple()}}, {key:"getCoordinates",value:function value(){return this._points.toCoordinateArray()}}, {key:"copyInternal",value:function value(){return new s(this._points.copy(),this._factory)}}, {key:"equalsExact",value:function value(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof U){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n= t;if(this._points.size()!==n._points.size())return!1;for(var r=0;r 0){var n=this._points.copy();St.reverse(n),this._points=n}return null}}}}, {key:"getCoordinate",value:function value(){return this.isEmpty()?null:this._points.getCoordinate(0)}}, {key:"getBoundaryDimension",value:function value(){return this.isClosed()?Mt.FALSE:0}}, {key:"isClosed",value:function value(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}}, {key:"reverseInternal",value:function value(){var t=this._points.copy();return St.reverse(t),this.getFactory().createLineString(t)}}, {key:"getEndPoint",value:function value(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}}, {key:"getTypeCode",value:function value(){return U.TYPECODE_LINESTRING}}, {key:"getDimension",value:function value(){return 1}}, {key:"getLength",value:function value(){return It.ofLine(this._points)}}, {key:"getNumPoints",value:function value(){return this._points.size()}}, {key:"compareToSameClass",value:function value(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 1&&this.getCoordinateSequence().size()=1&&this.get(this.size()-1).equals2D(r))return null; g(o(s.prototype),"add",this).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],a=arguments[1];return this.add(i,a),!0}}else if(3===arguments.length){if("boolean"== typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1];if(arguments[2])for(var h=0;h=0;c--)this.add(u[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof z){var f=arguments[0],p=arguments[1];if(!arguments[2]){var v=this.size();if(v> 0){if(f>0&&this.get(f-1).equals2D(p))return null;if(f_&&(x=-1);for(var k=m;k!==_;k+=x)this.add(d[k],y);return!0}}}, {key:"closeRing",value:function value(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_", value:function value(){if(0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1]; this.ensureCapacity(e.length),this.add(e,n)}}}]),s}(dt); Wt.coordArrayType=(new Array(0)).fill(null);var Ht=function(){function e(){t(this,e)} return r(e,null,[{key:"isRing",value:function value(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}}, {key:"ptNotInList",value:function value(t,n){for(var r=0;r=t?e:[]}}, {key:"indexOf",value:function value(t,e){for(var n=0;n0)&&(e=t[n]);return e}}, {key:"extract",value:function value(t,e,n){e=kt.clamp(e,0,t.length);var r=(n=kt.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Ht.compare(n,r);return Ht.isEqualReversed(n,r)? 0:i}}, {key:"OLDcompare",value:function value(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Ht.increasingDirection(n),o=Ht.increasingDirection(r), s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0){var t=new Kt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(t=3),t<2&&(t=2),new $t(arguments[0],t)}if(3===arguments.length){var e=arguments[2],n=arguments[1]-e;return e>1&&(e=1),n>3&&(n=3),n<2&&(n=2),new $t(arguments[0],n+e,e)}}}}, {key:"interfaces_",get:function get(){return[bt,w]}}],[{key:"instance", value:function value(){return e.instanceObject}}]),e}(); te.instanceObject=new te;var ee=function(e){i(s,e);var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"copyInternal",value:function value(){for(var t=(new Array(this._geometries.length)).fill(null),e=0;e=0?t:e}}]),e}(),oe=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"readResolve",value:function value(){return e.nameToTypeMap.get(this._name)}}, {key:"toString",value:function value(){return this._name}}, {key:"interfaces_",get:function get(){return[w]}}],[{key:"constructor_", value:function value(){this._name=null;var t=arguments[0];this._name=t,e.nameToTypeMap.put(t,this)}}]),e}(); oe.nameToTypeMap=new re,ie.Type=oe,ie.FIXED=new oe("FIXED"),ie.FLOATING=new oe("FLOATING"),ie.FLOATING_SINGLE=new oe("FLOATING SINGLE"),ie.maximumPreciseValue=9007199254740992;var se=function(e){i(s,e); var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"copyInternal",value:function value(){for(var t=(new Array(this._geometries.length)).fill(null),e=0;e1){if(u instanceof Ft)return this.createMultiPolygon(e.toPolygonArray(t));if(u instanceof Ct)return this.createMultiLineString(e.toLineStringArray(t)); if(u instanceof Ot)return this.createMultiPoint(e.toPointArray(t));q.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}}, {key:"createMultiPointFromCoords",value:function value(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}}, {key:"createPoint",value:function value(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0]; return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(ot(arguments[0],ct))return new Ot(arguments[0],this)}}}, {key:"getCoordinateSequenceFactory",value:function value(){return this._coordinateSequenceFactory}}, {key:"createPolygon",value:function value(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(ot(arguments[0],ct)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof zt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Ft(arguments[0], arguments[1],this)}}, {key:"getSRID",value:function value(){return this._SRID}}, {key:"createGeometryCollection",value:function value(){return 0===arguments.length?new Bt(null,this):1===arguments.length?new Bt(arguments[0],this):void 0}}, {key:"getPrecisionModel",value:function value(){return this._precisionModel}}, {key:"createLinearRing",value:function value(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t= arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(ot(arguments[0],ct))return new zt(arguments[0],this)}}}, {key:"createMultiPolygon",value:function value(){return 0===arguments.length?new ee(null,this):1===arguments.length?new ee(arguments[0],this):void 0}}, {key:"createMultiPoint",value:function value(){if(0===arguments.length)return new Yt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Yt(arguments[0],this);if(ot(arguments[0], ct)){var t=arguments[0];if(null===t)return this.createMultiPoint((new Array(0)).fill(null));for(var e=(new Array(t.size())).fill(null),n=0;n="a"&&t<="z"||t>="A"&&t<="Z"}}, {key:"isNumeric_",value:function value(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}}, {key:"isWhiteSpace_",value:function value(t){return" "==t||"\t"==t||"\r"==t||"\n"==t}}, {key:"nextChar_",value:function value(){return this.wkt.charAt(++this.index_)}}, {key:"nextToken",value:function value(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=ve;else if(","==e)t=me;else if(")"==e)t=de;else if(this.isNumeric_(e)||"-"==e)t=ye,r=this.readNumber_();else if(this.isAlpha_(e))t= pe,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=_e}return{position:n,value:r,type:t}}}, {key:"readNumber_",value:function value(){var t,e=this.index_,n=!1,r=!1;do"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_();while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e, this.index_--))}}, {key:"readText_",value:function value(){var t,e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}]),e}(),Ee=function(){function e(n,r){t(this, e),this.lexer_=n,this.token_,this.layout_=ue,this.factory=r} return r(e,[{key:"consume_",value:function value(){this.token_=this.lexer_.nextToken()}}, {key:"isTokenType",value:function value(t){return this.token_.type==t}}, {key:"match",value:function value(t){var e=this.isTokenType(t);return e&&this.consume_(),e}}, {key:"parse",value:function value(){return this.consume_(),this.parseGeometry_()}}, {key:"parseGeometryLayout_",value:function value(){var t=ue,e=this.token_;if(this.isTokenType(pe)){var n=e.value;"Z"===n?t=le:"M"===n?t=he:"ZM"===n&&(t=ce),t!==ue&&this.consume_()}return t}}, {key:"parseGeometryCollectionText_",value:function value(){if(this.match(ve)){var t=[];do t.push(this.parseGeometry_());while(this.match(me));if(this.match(de))return t}else if(this.isEmptyGeometry_())return[]; throw new Error(this.formatErrorMessage_());}}, {key:"parsePointText_",value:function value(){if(this.match(ve)){var t=this.parsePoint_();if(this.match(de))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_()); }}, {key:"parseLineStringText_",value:function value(){if(this.match(ve)){var t=this.parsePointList_();if(this.match(de))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_()); }}, {key:"parsePolygonText_",value:function value(){if(this.match(ve)){var t=this.parseLineStringTextList_();if(this.match(de))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_()); }}, {key:"parseMultiPointText_",value:function value(){var t;if(this.match(ve)){if(t=this.token_.type==ve?this.parsePointTextList_():this.parsePointList_(),this.match(de))return t}else if(this.isEmptyGeometry_())return[]; throw new Error(this.formatErrorMessage_());}}, {key:"parseMultiLineStringText_",value:function value(){if(this.match(ve)){var t=this.parseLineStringTextList_();if(this.match(de))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_()); }}, {key:"parseMultiPolygonText_",value:function value(){if(this.match(ve)){var t=this.parsePolygonTextList_();if(this.match(de))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_()); }}, {key:"parsePoint_",value:function value(){for(var t=[],e=this.layout_.length,n=0;n1?t.createPolygon(r[0],r.slice(1)):t.createPolygon(r[0])},r=this.token_; if(this.match(pe)){var i=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==i){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(i){case "POINT":var s= this.parsePointText_();return s?t.createPoint(u(z,p(s))):t.createPoint();case "LINESTRING":var a=this.parseLineStringText_().map(e);return t.createLineString(a);case "LINEARRING":var l=this.parseLineStringText_().map(e); return t.createLinearRing(l);case "POLYGON":var h=this.parsePolygonText_();return h&&0!==h.length?n(h):t.createPolygon();case "MULTIPOINT":var c=this.parseMultiPointText_();if(!c||0===c.length)return t.createMultiPoint(); var f=c.map(e).map(function(e){return t.createPoint(e)}); return t.createMultiPoint(f);case "MULTILINESTRING":var g=this.parseMultiLineStringText_().map(function(n){return t.createLineString(n.map(e))}); return t.createMultiLineString(g);case "MULTIPOLYGON":var v=this.parseMultiPolygonText_();if(!v||0===v.length)return t.createMultiPolygon();var d=v.map(n);return t.createMultiPolygon(d);default:throw new Error("Invalid geometry type: "+ i);}}throw new Error(this.formatErrorMessage_());}}]),e}(); function be(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")} function we(t){for(var e=t.getCoordinates().map(function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e}),n=[],r=0,i=e.length;r0&&(e+=" "+r),t.isEmpty()?e+" "+ge:e+" ("+n(t)+")"} var Me=function(){function e(n){t(this,e),this.geometryFactory=n||new ae,this.precisionModel=this.geometryFactory.getPrecisionModel()} return r(e,[{key:"read",value:function value(t){var e=new ke(t);return(new Ee(e,this.geometryFactory)).parse()}}, {key:"write",value:function value(t){return Se(t)}}]),e}(),Pe=function(){function e(n){t(this,e),this.parser=new Me(n)} return r(e,[{key:"write",value:function value(t){return this.parser.write(t)}}],[{key:"toLineString", value:function value(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),e}(),Le=function(){function e(){t(this,e),e.constructor_.apply(this, arguments)} return r(e,[{key:"getIndexAlongSegment",value:function value(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}}, {key:"getTopologySummary",value:function value(){var t=new Kt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}}, {key:"computeIntersection",value:function value(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)}}, {key:"getIntersectionNum",value:function value(){return this._result}}, {key:"computeIntLineIndex",value:function value(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1)); else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]= 0)}}}, {key:"isProper",value:function value(){return this.hasIntersection()&&this._isProper}}, {key:"setPrecisionModel",value:function value(t){this._precisionModel=t}}, {key:"isInteriorIntersection",value:function value(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e< this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}}}, {key:"getIntersection",value:function value(t){return this._intPt[t]}}, {key:"isEndPoint",value:function value(){return this.hasIntersection()&&!this._isProper}}, {key:"hasIntersection",value:function value(){return this._result!==e.NO_INTERSECTION}}, {key:"getEdgeDistance",value:function value(t,n){return e.computeEdgeDistance(this._intPt[n],this._inputLines[t][0],this._inputLines[t][1])}}, {key:"isCollinear",value:function value(){return this._result===e.COLLINEAR_INTERSECTION}}, {key:"toString",value:function value(){return Pe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Pe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}}, {key:"getEndpoint",value:function value(t,e){return this._inputLines[t][e]}}, {key:"isIntersection",value:function value(t){for(var e=0;ei?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y); 0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return q.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o}}, {key:"nonRobustComputeEdgeDistance",value:function value(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return q.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o}}]),e}(); Le.DONT_INTERSECT=0,Le.DO_INTERSECT=1,Le.COLLINEAR=2,Le.NO_INTERSECTION=0,Le.POINT_INTERSECTION=1,Le.COLLINEAR_INTERSECTION=2;var Ce=function(e){i(s,e);var n=f(s);function s(){return t(this,s),n.call(this)} return r(s,[{key:"isInSegmentEnvelopes",value:function value(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}}, {key:"computeIntersection",value:function value(){if(3!==arguments.length)return g(o(s.prototype),"computeIntersection",this).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper= !1,j.intersects(e,n,t)&&0===ft.index(e,n,t)&&0===ft.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=Le.POINT_INTERSECTION,null;this._result=Le.NO_INTERSECTION}}, {key:"intersection",value:function value(t,e,n,r){var i=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(i)||(i=new z(s.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(i), i}}, {key:"checkDD",value:function value(t,e,n,r,i){var o=ht.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);xt.out.println("DD in env \x3d "+s+" --------------------- "+o),i.distance(o)>1E-4&&xt.out.println("Distance \x3d "+ i.distance(o))}}, {key:"intersectionSafe",value:function value(t,e,n,r){var i=_t.intersection(t,e,n,r);return null===i&&(i=s.nearestEndpoint(t,e,n,r)),i}}, {key:"computeCollinearIntersection",value:function value(t,e,n,r){var i=j.intersects(t,e,n),o=j.intersects(t,e,r),s=j.intersects(n,r,t),a=j.intersects(n,r,e);return i&&o?(this._intPt[0]=n,this._intPt[1]= r,Le.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=t,this._intPt[1]=e,Le.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?Le.COLLINEAR_INTERSECTION:Le.POINT_INTERSECTION): i&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?Le.COLLINEAR_INTERSECTION:Le.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||a?Le.COLLINEAR_INTERSECTION:Le.POINT_INTERSECTION): o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||s?Le.COLLINEAR_INTERSECTION:Le.POINT_INTERSECTION):Le.NO_INTERSECTION}}, {key:"computeIntersect",value:function value(t,e,n,r){if(this._isProper=!1,!j.intersects(t,e,n,r))return Le.NO_INTERSECTION;var i=ft.index(t,e,n),o=ft.index(t,e,r);if(i>0&&o>0||i<0&&o<0)return Le.NO_INTERSECTION; var s=ft.index(n,r,t),a=ft.index(n,r,e);return s>0&&a>0||s<0&&a<0?Le.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,r):(0===i||0===o||0===s||0===a?(this._isProper=!1, t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:0===i?this._intPt[0]=new z(n):0===o?this._intPt[0]=new z(r):0===s?this._intPt[0]=new z(t):0===a&&(this._intPt[0]= new z(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,r)),Le.POINT_INTERSECTION)}}],[{key:"nearestEndpoint", value:function value(t,e,n,r){var i=t,o=Et.pointToSegment(t,n,r),s=Et.pointToSegment(e,n,r);return sr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=ft.index(t,e,this._p); if(i===ft.COLLINEAR)return this._isPointOnSegment=!0,null;e.ythis.location.length){var e=(new Array(3)).fill(null);e[tt.ON]=this.location[tt.ON],e[tt.LEFT]=Z.NONE,e[tt.RIGHT]=Z.NONE,this.location=e}for(var n= 0;n1&&t.append(Z.toLocationSymbol(this.location[tt.LEFT])),t.append(Z.toLocationSymbol(this.location[tt.ON])),this.location.length> 1&&t.append(Z.toLocationSymbol(this.location[tt.RIGHT])),t.toString()}}, {key:"setLocations",value:function value(t,e,n){this.location[tt.ON]=t,this.location[tt.LEFT]=e,this.location[tt.RIGHT]=n}}, {key:"get",value:function value(t){return t1}}, {key:"isAnyNull",value:function value(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!== this._startDe);this._maxNodeDegree*=2}}, {key:"addPoints",value:function value(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;a--)this._pts.add(r[a])}}}, {key:"isHole",value:function value(){return this._isHole}}, {key:"setInResult",value:function value(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)}}, {key:"containsPoint",value:function value(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Oe.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1; return!0}}, {key:"addHole",value:function value(t){this._holes.add(t)}}, {key:"isShell",value:function value(){return null===this._shell}}, {key:"getLabel",value:function value(){return this._label}}, {key:"getEdges",value:function value(){return this._edges}}, {key:"getMaxNodeDegree",value:function value(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}}, {key:"getShell",value:function value(){return this._shell}}, {key:"mergeLabel",value:function value(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e, tt.RIGHT);if(n===Z.NONE)return null;if(this._label.getLocation(e)===Z.NONE)return this._label.setLocation(e,n),null}}}, {key:"setShell",value:function value(t){this._shell=t,null!==t&&t.addHole(this)}}, {key:"toPolygon",value:function value(t){for(var e=(new Array(this._holes.size())).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)}}, {key:"isInResult",value:function value(){return this._isInResult}}, {key:"isVisited",value:function value(){return this._isVisited}}],[{key:"constructor_", value:function value(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label= t}}}]),e}(),Ge=function(e){i(s,e); var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"isIncidentEdgeInResult",value:function value(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}}, {key:"isIsolated",value:function value(){return 1===this._label.getGeometryCount()}}, {key:"getCoordinate",value:function value(){return this._coord}}, {key:"print",value:function value(t){t.println("node "+this._coord+" lbl: "+this._label)}}, {key:"computeIM",value:function value(t){}}, {key:"computeMergedLocation",value:function value(t,e){var n=Z.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Z.BOUNDARY&&(n=r)}return n}}, {key:"setLabel",value:function value(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return g(o(s.prototype),"setLabel",this).apply(this,arguments);var t=arguments[0], e=arguments[1];null===this._label?this._label=new Ae(t,e):this._label.setLocation(t,e)}}, {key:"getEdges",value:function value(){return this._edges}}, {key:"mergeLabel",value:function value(){if(arguments[0]instanceof s){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Ae)for(var e=arguments[0],n=0;n<2;n++){var r=this.computeMergedLocation(e, n);this._label.getLocation(n)===Z.NONE&&this._label.setLocation(n,r)}}}, {key:"add",value:function value(t){this._edges.insert(t),t.setNode(this)}}, {key:"setLabelBoundary",value:function value(t){if(null===this._label)return null;var e=Z.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Z.BOUNDARY:n=Z.INTERIOR;break; case Z.INTERIOR:default:n=Z.BOUNDARY}this._label.setLocation(t,n)}}],[{key:"constructor_", value:function value(){this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new Ae(0,Z.NONE)}}]),s}(qe),Be=function(e){i(r,e); var n=f(r);function r(){return t(this,r),n.apply(this,arguments)} return r}(ne); function Ye(t){return null==t?0:t.color} function ze(t){return null==t?null:t.parent} function Xe(t,e){null!==t&&(t.color=e)} function je(t){return null==t?null:t.left} function Ue(t){return null==t?null:t.right} var Ze=function(e){i(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this)).root_=null,e.size_=0,e} return r(o,[{key:"get",value:function value(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null}}, {key:"put",value:function value(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function getValue(){return this.value}, getKey:function getKey(){return this.key}},this.size_=1,null; var n,r,i=this.root_;do if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:0,getValue:function getValue(){return this.value}, getKey:function getKey(){return this.key}}; return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null}}, {key:"fixAfterInsertion",value:function value(t){var e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)ze(t)===je(ze(ze(t)))?1===Ye(e=Ue(ze(ze(t))))?(Xe(ze(t),0),Xe(e,0),Xe(ze(ze(t)),1),t=ze(ze(t))): (t===Ue(ze(t))&&(t=ze(t),this.rotateLeft(t)),Xe(ze(t),0),Xe(ze(ze(t)),1),this.rotateRight(ze(ze(t)))):1===Ye(e=je(ze(ze(t))))?(Xe(ze(t),0),Xe(e,0),Xe(ze(ze(t)),1),t=ze(ze(t))):(t===je(ze(t))&&(t=ze(t), this.rotateRight(t)),Xe(ze(t),0),Xe(ze(ze(t)),1),this.rotateLeft(ze(ze(t))));this.root_.color=0}}, {key:"values",value:function value(){var t=new dt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=o.successor(e));)t.add(e.value);return t}}, {key:"entrySet",value:function value(){var t=new K,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=o.successor(e));)t.add(e);return t}}, {key:"rotateLeft",value:function value(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right= e,e.left=t,t.parent=e}}}, {key:"rotateRight",value:function value(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left= e,e.right=t,t.parent=e}}}, {key:"getFirstEntry",value:function value(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}}, {key:"size",value:function value(){return this.size_}}, {key:"containsKey",value:function value(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return!0;e=e.right}}return!1}}],[{key:"successor", value:function value(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}]),o}(Be), We=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"find",value:function value(t){return this.nodeMap.get(t)}}, {key:"addNode",value:function value(){if(arguments[0]instanceof z){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ge){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}}}, {key:"print",value:function value(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}}, {key:"iterator",value:function value(){return this.nodeMap.values().iterator()}}, {key:"values",value:function value(){return this.nodeMap.values()}}, {key:"getBoundaryNodes",value:function value(t){for(var e=new dt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Z.BOUNDARY&&e.add(r)}return e}}, {key:"add",value:function value(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_", value:function value(){this.nodeMap=new Ze,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),e}(),He=function(){function e(){t(this,e)} return r(e,null,[{key:"isNorthern",value:function value(t){return t===e.NE||t===e.NW}}, {key:"isOpposite",value:function value(t,e){return t!==e&&2==(t-e+4)%4}}, {key:"commonHalfPlane",value:function value(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=te?t:e)?3:n}}, {key:"isInHalfPlane",value:function value(t,n){return n===e.SE?t===e.SE||t===e.SW:t===n||t===n+1}}, {key:"quadrant",value:function value(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new x("Cannot compute the quadrant for point ( "+ t+", "+n+" )");return t>=0?n>=0?e.NE:e.SE:n>=0?e.NW:e.SW}if(arguments[0]instanceof z&&arguments[1]instanceof z){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new x("Cannot compute the quadrant for two identical points "+ r);return i.x>=r.x?i.y>=r.y?e.NE:e.SE:i.y>=r.y?e.NW:e.SW}}}]),e}(); He.NE=0,He.NW=1,He.SW=2,He.SE=3;var Je=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"compareDirection",value:function value(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(), a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r}}, {key:"buildMaximalEdgeRings",value:function value(t){for(var e=new dt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Ve(r,this._geometryFactory); e.add(i),i.setInResult()}}return e}}, {key:"placePolygonHoles",value:function value(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}}}, {key:"getPolygons",value:function value(){return this.computePolygons(this._shellList)}}, {key:"findShell",value:function value(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return q.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n}}, {key:"add",value:function value(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];$e.linkResultDirectedEdges(n); var r=this.buildMaximalEdgeRings(e),i=new dt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}],[{key:"constructor_", value:function value(){this._geometryFactory=null,this._shellList=new dt;var t=arguments[0];this._geometryFactory=t}}, {key:"findEdgeRingContaining",value:function value(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(), h=l.getEnvelopeInternal();if(!h.equals(r)&&h.contains(r)){i=Ht.ptNotInList(n.getCoordinates(),l.getCoordinates());var c=!1;Oe.isInRing(i,l.getCoordinates())&&(c=!0),c&&(null===o||s.contains(h))&&(s=(o= u).getLinearRing().getEnvelopeInternal())}}return o}}]),e}(),en=function(){function e(){t(this,e)} return r(e,[{key:"getBounds",value:function value(){}}]),e}(),nn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getItem",value:function value(){return this._item}}, {key:"getBounds",value:function value(){return this._bounds}}, {key:"interfaces_",get:function get(){return[en,w]}}],[{key:"constructor_", value:function value(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}}]),e}(),rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"poll",value:function value(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t}}, {key:"size",value:function value(){return this._size}}, {key:"reorder",value:function value(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)< 0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)}}, {key:"clear",value:function value(){this._size=0,this._items.clear()}}, {key:"peek",value:function value(){return this.isEmpty()?null:this._items.get(1)}}, {key:"isEmpty",value:function value(){return 0===this._size}}, {key:"add",value:function value(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/ 2)));this._items.set(e,t)}}],[{key:"constructor_", value:function value(){this._size=null,this._items=null,this._size=0,this._items=new dt,this._items.add(null)}}]),e}(),on=function(){function e(){t(this,e)} return r(e,[{key:"insert",value:function value(t,e){}}, {key:"remove",value:function value(t,e){}}, {key:"query",value:function value(){}}]),e}(),sn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getLevel",value:function value(){return this._level}}, {key:"size",value:function value(){return this._childBoundables.size()}}, {key:"getChildBoundables",value:function value(){return this._childBoundables}}, {key:"addChildBoundable",value:function value(t){q.isTrue(null===this._bounds),this._childBoundables.add(t)}}, {key:"isEmpty",value:function value(){return this._childBoundables.isEmpty()}}, {key:"getBounds",value:function value(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}}, {key:"interfaces_",get:function get(){return[en,w]}}],[{key:"constructor_", value:function value(){if(this._childBoundables=new dt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}}]),e}(),an={reverseOrder:function reverseOrder(){return{compare:function compare(t, e){return e.compareTo(t)}}}, min:function min(t){return an.sort(t),t.get(0)}, sort:function sort(t,e){var n=t.toArray();e?At.sort(n,e):At.sort(n);for(var r=t.iterator(),i=0,o=n.length;ie.area(this._boundable2)?(this.expand(this._boundable1, this._boundable2,!1,t,n),null):(this.expand(this._boundable2,this._boundable1,!0,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,!1,t,n),null;if(i)return this.expand(this._boundable2, this._boundable1,!0,t,n),null;throw new x("neither boundable is composite");}}, {key:"isLeaves",value:function value(){return!(e.isComposite(this._boundable1)||e.isComposite(this._boundable2))}}, {key:"compareTo",value:function value(t){var e=t;return this._distancee._distance?1:0}}, {key:"expand",value:function value(t,n,r,i,o){for(var s=t.getChildBoundables().iterator();s.hasNext();){var a=s.next(),u=null;(u=r?new e(n,a,this._itemDistance):new e(a,n,this._itemDistance)).getDistance()< o&&i.add(u)}}}, {key:"getBoundable",value:function value(t){return 0===t?this._boundable1:this._boundable2}}, {key:"getDistance",value:function value(){return this._distance}}, {key:"distance",value:function value(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}}, {key:"interfaces_",get:function get(){return[E]}}],[{key:"constructor_", value:function value(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance= n,this._distance=this.distance()}}, {key:"area",value:function value(t){return t.getBounds().getArea()}}, {key:"isComposite",value:function value(t){return t instanceof sn}}]),e}(),hn=function(){function e(){t(this,e)} return r(e,[{key:"visitItem",value:function value(t){}}]),e}(),cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"queryInternal",value:function value(){if(ot(arguments[2],hn)&&arguments[0]instanceof Object&&arguments[1]instanceof sn)for(var t=arguments[0],e=arguments[2],n=arguments[1].getChildBoundables(), r=0;r-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof sn?this.boundablesAtLevel(n,s,i):(q.isTrue(s instanceof nn),-1===n&&i.add(s))}return null}}}, {key:"query",value:function value(){if(1===arguments.length){var t=arguments[0];this.build();var e=new dt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t, this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root, r)}}}, {key:"build",value:function value(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built= !0}}, {key:"getRoot",value:function value(){return this.build(),this._root}}, {key:"remove",value:function value(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root, e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(), n)&&u instanceof sn&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}}}, {key:"createHigherLevels",value:function value(t,e){q.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}}, {key:"depth",value:function value(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n= e.next();if(n instanceof sn){var r=this.depth(n);r>t&&(t=r)}}return t+1}}}, {key:"createParentBoundables",value:function value(t,e){q.isTrue(!t.isEmpty());var n=new dt;n.add(this.createNode(e));var r=new dt(t);an.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o= i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n}}, {key:"isEmpty",value:function value(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}}, {key:"interfaces_",get:function get(){return[w]}}],[{key:"constructor_", value:function value(){if(this._root=null,this._built=!1,this._itemBoundables=new dt,this._nodeCapacity=null,0===arguments.length)e.constructor_.call(this,e.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t= arguments[0];q.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}}, {key:"compareDoubles",value:function value(t,e){return t>e?1:t0);for(var n=new dt,r=0;r=0;){var u=o.poll(),l=u.getDistance();if(l>=i)break;u.isLeaves()?a.size()l&&(a.poll(), a.add(u)),i=a.peek().getDistance()):u.expandToQueue(o,i)}return s.getItems(a)}}}, {key:"createNode",value:function value(t){return new pn(t)}}, {key:"size",value:function value(){return 0===arguments.length?g(o(s.prototype),"size",this).call(this):g(o(s.prototype),"size",this).apply(this,arguments)}}, {key:"insert",value:function value(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof j))return g(o(s.prototype),"insert",this).apply(this,arguments);var t=arguments[0], e=arguments[1];if(t.isNull())return null;g(o(s.prototype),"insert",this).call(this,t,e)}}, {key:"getIntersectsOp",value:function value(){return s.intersectsOp}}, {key:"verticalSlices",value:function value(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=(new Array(e)).fill(null),i=t.iterator(),o=0;o0;){var s=o.poll(),a=s.getDistance();if(a>=r)break;s.isLeaves()?(r=a,i=s):s.expandToQueue(o,r)}return null===i? null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var h=new ln(this.getRoot(),u.getRoot(), l);return this.nearestNeighbour(h)}if(3===arguments.length){var c=arguments[2],f=new nn(arguments[0],arguments[1]),g=new ln(this.getRoot(),f,c);return this.nearestNeighbour(g)[0]}if(4===arguments.length){var p= arguments[2],v=arguments[3],d=new nn(arguments[0],arguments[1]),y=new ln(this.getRoot(),d,p);return this.nearestNeighbourK(y,v)}}}}, {key:"isWithinDistance",value:function value(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=A.POSITIVE_INFINITY,r=new rn;for(r.add(t);!r.isEmpty();){var i=r.poll(),o=i.getDistance();if(o> e)return!1;if(i.maximumDistance()<=e)return!0;if(i.isLeaves()){if((n=o)<=e)return!0}else i.expandToQueue(r,n)}return!1}if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=new ln(this.getRoot(), s.getRoot(),a);return this.isWithinDistance(l,u)}}}, {key:"interfaces_",get:function get(){return[on,w]}}],[{key:"constructor_", value:function value(){if(0===arguments.length)s.constructor_.call(this,s.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];cn.constructor_.call(this,t)}}}, {key:"centreX",value:function value(t){return s.avg(t.getMinX(),t.getMaxX())}}, {key:"avg",value:function value(t,e){return(t+e)/2}}, {key:"getItems",value:function value(t){for(var e=(new Array(t.size())).fill(null),n=0;!t.isEmpty();){var r=t.poll();e[n]=r.getBoundable(0).getItem(),n++}return e}}, {key:"centreY",value:function value(t){return s.avg(t.getMinY(),t.getMaxY())}}]),s}(cn),pn=function(e){i(o,e); var n=f(o);function o(){var e;return t(this,o),e=n.call(this),o.constructor_.apply(h(e),arguments),e} return r(o,[{key:"computeBounds",value:function value(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t}}], [{key:"constructor_", value:function value(){var t=arguments[0];sn.constructor_.call(this,t)}}]),o}(sn); gn.STRtreeNode=pn,gn.xComparator=new (function(){function e(){t(this,e)} return r(e,[{key:"interfaces_",get:function get(){return[D]}}, {key:"compare",value:function value(t,e){return cn.compareDoubles(gn.centreX(t.getBounds()),gn.centreX(e.getBounds()))}}]),e}()),gn.yComparator=new (function(){function e(){t(this,e)} return r(e,[{key:"interfaces_",get:function get(){return[D]}}, {key:"compare",value:function value(t,e){return cn.compareDoubles(gn.centreY(t.getBounds()),gn.centreY(e.getBounds()))}}]),e}()),gn.intersectsOp=new (function(){function e(){t(this,e)} return r(e,[{key:"interfaces_",get:function get(){return[IntersectsOp]}}, {key:"intersects",value:function value(t,e){return t.intersects(e)}}]),e}()),gn.DEFAULT_NODE_CAPACITY=10; var vn=function(){function e(){t(this,e)} return r(e,null,[{key:"relativeSign",value:function value(t,e){return te?1:0}}, {key:"compare",value:function value(t,n,r){if(n.equals2D(r))return 0;var i=e.relativeSign(n.x,r.x),o=e.relativeSign(n.y,r.y);switch(t){case 0:return e.compareValue(i,o);case 1:return e.compareValue(o,i); case 2:return e.compareValue(o,-i);case 3:return e.compareValue(-i,o);case 4:return e.compareValue(-i,-o);case 5:return e.compareValue(-o,-i);case 6:return e.compareValue(-o,i);case 7:return e.compareValue(i, -o)}return q.shouldNeverReachHere("invalid octant value"),0}}, {key:"compareValue",value:function value(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}]),e}(),dn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getCoordinate",value:function value(){return this.coord}}, {key:"print",value:function value(t){t.print(this.coord),t.print(" seg # \x3d "+this.segmentIndex)}}, {key:"compareTo",value:function value(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?vn.compare(this._segmentOctant, this.coord,e.coord):1:-1}}, {key:"isEndPoint",value:function value(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}}, {key:"toString",value:function value(){return this.segmentIndex+":"+this.coord.toString()}}, {key:"isInterior",value:function value(){return this._isInterior}}, {key:"interfaces_",get:function get(){return[E]}}],[{key:"constructor_", value:function value(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString= t,this.coord=new z(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),e}(),yn=function(){function e(){t(this,e)} return r(e,[{key:"hasNext",value:function value(){}}, {key:"next",value:function value(){}}, {key:"remove",value:function value(){}}]),e}(),mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getSplitCoordinates",value:function value(){var t=new Wt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()}}, {key:"addCollapsedNodes",value:function value(){var t=new dt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue(); this.add(this._edge.getCoordinate(n),n)}}}, {key:"createSplitEdgePts",value:function value(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new z(t.coord),new z(e.coord)];var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()|| !e.coord.equals2D(r);i||n--;var o=(new Array(n)).fill(null),s=0;o[s++]=new z(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new z(e.coord)), o}}, {key:"print",value:function value(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}}, {key:"findCollapsesFromExistingVertices",value:function value(t){for(var e=0;e=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}if(arguments[0]instanceof z&&arguments[1]instanceof z){var o=arguments[0],s=arguments[1],a=s.x-o.x, u=s.y-o.y;if(0===a&&0===u)throw new x("Cannot compute the octant for two identical points "+o);return e.octant(a,u)}}}]),e}(),xn=function(){function e(){t(this,e)} return r(e,[{key:"getCoordinates",value:function value(){}}, {key:"size",value:function value(){}}, {key:"getCoordinate",value:function value(t){}}, {key:"isClosed",value:function value(){}}, {key:"setData",value:function value(t){}}, {key:"getData",value:function value(){}}]),e}(),kn=function(){function e(){t(this,e)} return r(e,[{key:"addIntersection",value:function value(t,e){}}, {key:"interfaces_",get:function get(){return[xn]}}]),e}(),En=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getCoordinates",value:function value(){return this._pts}}, {key:"size",value:function value(){return this._pts.length}}, {key:"getCoordinate",value:function value(t){return this._pts[t]}}, {key:"isClosed",value:function value(){return this._pts[0].equals(this._pts[this._pts.length-1])}}, {key:"getSegmentOctant",value:function value(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}}, {key:"setData",value:function value(t){this._data=t}}, {key:"safeOctant",value:function value(t,e){return t.equals2D(e)?0:_n.octant(t,e)}}, {key:"getData",value:function value(){return this._data}}, {key:"addIntersection",value:function value(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i= new z(arguments[0].getIntersection(r));this.addIntersection(i,n)}}}, {key:"toString",value:function value(){return Pe.toLineString(new $t(this._pts))}}, {key:"getNodeList",value:function value(){return this._nodeList}}, {key:"addIntersectionNode",value:function value(t,e){var n=e,r=n+1;if(r=0&&r>=0||n<=0&&r<=0?Math.max(n, r):0}if(arguments[0]instanceof z){var i=arguments[0];return ft.index(this.p0,this.p1,i)}}}, {key:"toGeometry",value:function value(t){return t.createLineString([this.p0,this.p1])}}, {key:"isVertical",value:function value(){return this.p0.x===this.p1.x}}, {key:"equals",value:function value(t){if(!(t instanceof e))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)}}, {key:"intersection",value:function value(t){var e=new Ce;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}}, {key:"project",value:function value(){if(arguments[0]instanceof z){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new z(t);var n=this.projectionFactor(t),r=new z;return r.x=this.p0.x+ n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof e){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1)return null;if(o<= 0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new e(a,u)}}}, {key:"normalize",value:function value(){this.p1.compareTo(this.p0)<0&&this.reverse()}}, {key:"angle",value:function value(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}}, {key:"getCoordinate",value:function value(t){return 0===t?this.p0:this.p1}}, {key:"distancePerpendicular",value:function value(t){return Et.pointToLinePerpendicular(t,this.p0,this.p1)}}, {key:"minY",value:function value(){return Math.min(this.p0.y,this.p1.y)}}, {key:"midPoint",value:function value(){return e.midPoint(this.p0,this.p1)}}, {key:"projectionFactor",value:function value(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?A.NaN:((t.x-this.p0.x)* e+(t.y-this.p0.y)*n)/r}}, {key:"closestPoints",value:function value(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=(new Array(2)).fill(null),r=A.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o, n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e}}, {key:"toString",value:function value(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}}, {key:"isHorizontal",value:function value(){return this.p0.y===this.p1.y}}, {key:"reflect",value:function value(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),r=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()), i=e*e+n*n,o=e*e-n*n,s=t.getX(),a=t.getY();return new z((-o*s-2*e*n*a-2*e*r)/i,(o*a-2*e*n*s-2*n*r)/i)}}, {key:"distance",value:function value(){if(arguments[0]instanceof e){var t=arguments[0];return Et.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof z){var n=arguments[0];return Et.pointToSegment(n, this.p0,this.p1)}}}, {key:"pointAlong",value:function value(t){var e=new z;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e}}, {key:"hashCode",value:function value(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=A.doubleToLongBits(this.p1.x);return n^=31*A.doubleToLongBits(this.p1.y), e^Math.trunc(n)^Math.trunc(n>>32)}}, {key:"interfaces_",get:function get(){return[E,w]}}],[{key:"constructor_", value:function value(){if(this.p0=null,this.p1=null,0===arguments.length)e.constructor_.call(this,new z,new z);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.p0,t.p1)}else if(2=== arguments.length){var n=arguments[0],r=arguments[1];this.p0=n,this.p1=r}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];e.constructor_.call(this,new z(i,o), new z(s,a))}}}, {key:"midPoint",value:function value(t,e){return new z((t.x+e.x)/2,(t.y+e.y)/2)}}]),e}(),wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"overlap",value:function value(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1), e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_", value:function value(){this._overlapSeg1=new bn,this._overlapSeg2=new bn}}]),e}(),In=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getLineSegment",value:function value(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}}, {key:"computeSelect",value:function value(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(n-e==1)return r.select(this,e),null;if(!t.intersects(i,o))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=He.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_", value:function value(){if(this._monoChains=new dt,this._index=new gn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0]; Mn.constructor_.call(this,t)}}}]),o}(Mn),Ln=function(e){i(s,e); var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"overlap",value:function value(){if(4!==arguments.length)return g(o(s.prototype),"overlap",this).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(), i=e.getContext();this._si.processIntersections(r,t,i,n)}}],[{key:"constructor_", value:function value(){this._si=null;var t=arguments[0];this._si=t}}]),s}(wn); Pn.SegmentOverlapAction=Ln;var Cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"isDeletable",value:function value(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i, o,t,n,r)}}, {key:"deleteShallowConcavities",value:function value(){for(var t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),i=!1;r=0;r--)this.addPt(t[r])}}, {key:"isRedundant",value:function value(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=e.PI_TIMES_2;for(;t<=-Math.PI;)t+=e.PI_TIMES_2;return t}}, {key:"angle",value:function value(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i, r)}}}, {key:"isAcute",value:function value(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0}}, {key:"isObtuse",value:function value(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0}}, {key:"interiorAngle",value:function value(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return Math.abs(o-i)}}, {key:"normalizePositive",value:function value(t){if(t<0){for(;t<0;)t+=e.PI_TIMES_2;t>=e.PI_TIMES_2&&(t=0)}else{for(;t>=e.PI_TIMES_2;)t-=e.PI_TIMES_2;t<0&&(t=0)}return t}}, {key:"angleBetween",value:function value(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return e.diff(i,o)}}, {key:"diff",value:function value(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n}}, {key:"toRadians",value:function value(t){return t*Math.PI/180}}, {key:"getTurn",value:function value(t,n){var r=Math.sin(n-t);return r>0?e.COUNTERCLOCKWISE:r<0?e.CLOCKWISE:e.NONE}}, {key:"angleBetweenOriented",value:function value(t,n,r){var i=e.angle(n,t),o=e.angle(n,r)-i;return o<=-Math.PI?o+e.PI_TIMES_2:o>Math.PI?o-e.PI_TIMES_2:o}}]),e}(); On.PI_TIMES_2=2*Math.PI,On.PI_OVER_2=Math.PI/2,On.PI_OVER_4=Math.PI/4,On.COUNTERCLOCKWISE=ft.COUNTERCLOCKWISE,On.CLOCKWISE=ft.CLOCKWISE,On.NONE=ft.COLLINEAR;var Tn=function(){function e(){t(this,e),e.constructor_.apply(this, arguments)} return r(e,[{key:"addNextSegment",value:function value(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side, this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ft.index(this._s0, this._s1,this._s2),r=n===ft.CLOCKWISE&&this._side===tt.LEFT||n===ft.COUNTERCLOCKWISE&&this._side===tt.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}}, {key:"addLineEndCap",value:function value(t,e){var n=new bn(t,e),r=new bn;this.computeOffsetSegment(n,tt.LEFT,this._distance,r);var i=new bn;this.computeOffsetSegment(n,tt.RIGHT,this._distance,i);var o= e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:this._segList.addPt(r.p1),this.addDirectedFillet(e,a+Math.PI/2,a-Math.PI/2,ft.CLOCKWISE,this._distance),this._segList.addPt(i.p1); break;case m.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case m.CAP_SQUARE:var u=new z;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new z(r.p1.x+ u.x,r.p1.y+u.y),h=new z(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(h)}}}, {key:"getCoordinates",value:function value(){return this._segList.getCoordinates()}}, {key:"addMitreJoin",value:function value(t,e,n,r){var i=_t.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==i&&(r<=0?1:i.distance(t)/Math.abs(r))<=this._bufParams.getMitreLimit())return this._segList.addPt(i), null;this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())}}, {key:"addOutsideTurn",value:function value(t,n){if(this._offset0.p1.distance(this._offset1.p0)=h&&(a-=2*Math.PI),this._segList.addPt(e), this.addDirectedFillet(t,a,h,r,i),this._segList.addPt(n)}}, {key:"addLastSegment",value:function value(){this._segList.addPt(this._offset1.p1)}}, {key:"initSideSegments",value:function value(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}}, {key:"addLimitedMitreJoin",value:function value(t,e,n,r){var i=this._seg0.p1,o=On.angle(i,this._seg0.p0),s=On.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=On.normalize(o+s),u=On.normalize(a+ Math.PI),l=r*n,h=n-l*Math.abs(Math.sin(s)),c=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),g=new z(c,f),p=new bn(i,g),v=p.pointAlongOffset(1,h),d=p.pointAlongOffset(1,-h);this._side===tt.LEFT?(this._segList.addPt(v), this._segList.addPt(d)):(this._segList.addPt(d),this._segList.addPt(v))}}, {key:"addDirectedFillet",value:function value(t,e,n,r,i){var o=r===ft.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,l=new z,h=0;h0){var r=new z((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+ 1));this._segList.addPt(r);var i=new z((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+ 1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}}, {key:"createCircle",value:function value(t){var e=new z(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}}, {key:"addBevelJoin",value:function value(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}}, {key:"init",value:function value(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Rn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t* e.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}}, {key:"addCollinear",value:function value(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===m.JOIN_BEVEL||this._bufParams.getJoinStyle()=== m.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ft.CLOCKWISE,this._distance))}}, {key:"closeRing",value:function value(){this._segList.closeRing()}}, {key:"hasNarrowConcaveAngle",value:function value(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_", value:function value(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li= null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new bn,this._seg1=new bn,this._offset0=new bn,this._offset1=new bn,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1], r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new Ce,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===m.JOIN_ROUND&&(this._closingSegLengthFactor= e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}}]),e}(); Tn.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Tn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1E-6,Tn.MAX_CLOSING_SEG_LEN_FACTOR=80;var An=function(){function e(){t(this, e),e.constructor_.apply(this,arguments)} return r(e,[{key:"getOffsetCurve",value:function value(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t, n,i);var o=i.getCoordinates();return n&&Ht.reverse(o),o}}, {key:"computeSingleSidedBufferCurve",value:function value(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o- 1],tt.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l= 2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()}}, {key:"computeRingBufferCurve",value:function value(t,e,n){var r=this.simplifyTolerance(this._distance);e===tt.RIGHT&&(r=-r);var i=Cn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s= 1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()}}, {key:"computeLineBufferCurve",value:function value(t,e){var n=this.simplifyTolerance(this._distance),r=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],tt.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o], !0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],tt.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1], s[0]),e.closeRing()}}, {key:"computePointCurve",value:function value(t,e){switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:e.createCircle(t);break;case m.CAP_SQUARE:e.createSquare(t)}}}, {key:"getLineCurve",value:function value(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i= e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()}}, {key:"getBufferParameters",value:function value(){return this._bufParams}}, {key:"simplifyTolerance",value:function value(t){return t*this._bufParams.getSimplifyFactor()}}, {key:"getRingCurve",value:function value(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return e.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t, n,i),i.getCoordinates()}}, {key:"computeOffsetCurve",value:function value(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],tt.LEFT),n.addFirstSegment(); for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()}}, {key:"isLineOffsetEmpty",value:function value(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}}, {key:"getSegGen",value:function value(t){return new Tn(this._precisionModel,this._bufParams,t)}}],[{key:"constructor_", value:function value(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}}, {key:"copyCoordinates",value:function value(t){for(var e=(new Array(t.length)).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(ot(arguments[2],rt)&&arguments[0]instanceof z&&arguments[1]instanceof Qe)for(var o=arguments[0],s= arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)< o.x||this._seg.isHorizontal()||o.ythis._seg.p1.y||ft.index(this._seg.p0,this._seg.p1,o)===ft.RIGHT)){var h=s.getDepth(tt.LEFT);this._seg.p0.equals(u[l])||(h=s.getDepth(tt.RIGHT));var c= new Fn(this._seg,h);a.add(c)}}else if(ot(arguments[2],rt)&&arguments[0]instanceof z&&ot(arguments[1],rt))for(var f=arguments[0],g=arguments[2],p=arguments[1].iterator();p.hasNext();){var v=p.next();v.isForward()&& this.findStabbedSegments(f,v,g)}}}, {key:"getDepth",value:function value(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:an.min(e)._leftDepth}}],[{key:"constructor_", value:function value(){this._subgraphs=null,this._seg=new bn;var t=arguments[0];this._subgraphs=t}}]),e}(),Fn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"compareTo",value:function value(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg); return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)}}, {key:"compareX",value:function value(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)}}, {key:"toString",value:function value(){return this._upwardSeg.toString()}}, {key:"interfaces_",get:function get(){return[E]}}],[{key:"constructor_", value:function value(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new bn(t),this._leftDepth=e}}]),e}(); Dn.DepthSegment=Fn;var Vn=function(e){i(o,e);var n=f(o);function o(){var e;return t(this,o),e=n.call(this),o.constructor_.apply(h(e),arguments),e} return r(o,null,[{key:"constructor_",value:function value(){_.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),o}(_),qn=function(){function e(){t(this,e),e.constructor_.apply(this, arguments)} return r(e,[{key:"getY",value:function value(){var t=this.y/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new Vn;return t}}, {key:"getX",value:function value(){var t=this.x/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new Vn;return t}}, {key:"getCoordinate",value:function value(){var t=new z;return t.x=this.getX(),t.y=this.getY(),t}}],[{key:"constructor_", value:function value(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2=== arguments.length)if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var i= arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else{if(arguments[0]instanceof z&&arguments[1]instanceof z){var s=arguments[0],a=arguments[1];this.x=s.y- a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],h=arguments[2];this.x=u,this.y=l,this.w=h}else if(4===arguments.length){var c=arguments[0],f=arguments[1], g=arguments[2],p=arguments[3],v=c.y-f.y,d=f.x-c.x,y=c.x*f.y-f.x*c.y,m=g.y-p.y,_=p.x-g.x,x=g.x*p.y-p.x*g.y;this.x=d*x-_*y,this.y=m*y-v*x,this.w=v*_-m*d}}}]),e}(),Gn=function(){function e(){t(this,e),e.constructor_.apply(this, arguments)} return r(e,[{key:"area",value:function value(){return e.area(this.p0,this.p1,this.p2)}}, {key:"signedArea",value:function value(){return e.signedArea(this.p0,this.p1,this.p2)}}, {key:"interpolateZ",value:function value(t){if(null===t)throw new x("Supplied point is null.");return e.interpolateZ(t,this.p0,this.p1,this.p2)}}, {key:"longestSideLength",value:function value(){return e.longestSideLength(this.p0,this.p1,this.p2)}}, {key:"isAcute",value:function value(){return e.isAcute(this.p0,this.p1,this.p2)}}, {key:"circumcentre",value:function value(){return e.circumcentre(this.p0,this.p1,this.p2)}}, {key:"area3D",value:function value(){return e.area3D(this.p0,this.p1,this.p2)}}, {key:"centroid",value:function value(){return e.centroid(this.p0,this.p1,this.p2)}}, {key:"inCentre",value:function value(){return e.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_", value:function value(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}}, {key:"area",value:function value(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)}}, {key:"signedArea",value:function value(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2}}, {key:"det",value:function value(t,e,n,r){return t*r-e*n}}, {key:"interpolateZ",value:function value(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,h=s*l-a*u,c=t.x-i,f=t.y-o,g=(l*c-a*f)/h,p=(-u*c+s*f)/h;return e.getZ()+g*(n.getZ()-e.getZ())+p*(r.getZ()- e.getZ())}}, {key:"longestSideLength",value:function value(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s}}, {key:"circumcentreDD",value:function value(t,e,n){var r=lt.valueOf(t.x).subtract(n.x),i=lt.valueOf(t.y).subtract(n.y),o=lt.valueOf(e.x).subtract(n.x),s=lt.valueOf(e.y).subtract(n.y),a=lt.determinant(r, i,o,s).multiply(2),u=r.sqr().add(i.sqr()),l=o.sqr().add(s.sqr()),h=lt.determinant(i,u,s,l),c=lt.determinant(r,u,o,l),f=lt.valueOf(n.x).subtract(h.divide(a)).doubleValue(),g=lt.valueOf(n.y).add(c.divide(a)).doubleValue(); return new z(f,g)}}, {key:"isAcute",value:function value(t,e,n){return!!On.isAcute(t,e,n)&&!!On.isAcute(e,n,t)&&!!On.isAcute(n,t,e)}}, {key:"circumcentre",value:function value(t,n,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=n.x-i,l=n.y-o,h=2*e.det(s,a,u,l),c=e.det(a,s*s+a*a,l,u*u+l*l),f=e.det(s,s*s+a*a,u,u*u+l*l);return new z(i-c/h,o+f/h)}}, {key:"perpendicularBisector",value:function value(t,e){var n=e.x-t.x,r=e.y-t.y,i=new qn(t.x+n/2,t.y+r/2,1),o=new qn(t.x-r+n/2,t.y+n+r/2,1);return new qn(i,o)}}, {key:"angleBisector",value:function value(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new z(t.x+i*o,t.y+i*s)}}, {key:"area3D",value:function value(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.getZ()-t.getZ(),s=n.x-t.x,a=n.y-t.y,u=n.getZ()-t.getZ(),l=i*u-o*a,h=o*s-r*u,c=r*a-i*s,f=l*l+h*h+c*c;return Math.sqrt(f)/2}}, {key:"centroid",value:function value(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new z(r,i)}}, {key:"inCentre",value:function value(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new z(a,u)}}]),e}(),Bn=function(){function e(){t(this, e),e.constructor_.apply(this,arguments)} return r(e,[{key:"addRingSide",value:function value(t,e,n,r,i){if(0===e&&t.length=zt.MINIMUM_VALID_SIZE&&ft.isCCW(t)&&(o=i,s=r,n=tt.opposite(n)); var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)}}, {key:"addRingBothSides",value:function value(t,e){this.addRingSide(t,e,tt.LEFT,Z.EXTERIOR,Z.INTERIOR),this.addRingSide(t,e,tt.RIGHT,Z.INTERIOR,Z.EXTERIOR)}}, {key:"addPoint",value:function value(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Z.EXTERIOR,Z.INTERIOR)}}, {key:"addPolygon",value:function value(t){var e=this._distance,n=tt.LEFT;this._distance<0&&(e=-this._distance,n=tt.RIGHT);var r=t.getExteriorRing(),i=Ht.removeRepeatedPoints(r.getCoordinates());if(this._distance< 0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addRingSide(i,e,n,Z.EXTERIOR,Z.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addRingSide(a,e,tt.opposite(n),Z.INTERIOR,Z.EXTERIOR)}}}, {key:"isTriangleErodedCompletely",value:function value(t,e){var n=new Gn(t[0],t[1],t[2]),r=n.inCentre();return Et.pointToSegment(r,n.p0,n.p1)i}}, {key:"addCollection",value:function value(t){for(var e=0;e=this._max)throw new H;var t=this._parent.getGeometryN(this._index++);return t instanceof Bt?(this._subcollectionIterator=new e(t),this._subcollectionIterator.next()): t}}, {key:"remove",value:function value(){throw new J(this.getClass().getName());}}, {key:"hasNext",value:function value(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>= this._max)}}, {key:"interfaces_",get:function get(){return[yn]}}],[{key:"constructor_", value:function value(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}}, {key:"isAtomic",value:function value(t){return!(t instanceof Bt)}}]),e}(),Xn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"locate",value:function value(t){return e.locate(t,this._geom)}}, {key:"interfaces_",get:function get(){return[Yn]}}],[{key:"constructor_", value:function value(){this._geom=null;var t=arguments[0];this._geom=t}}, {key:"locatePointInPolygon",value:function value(t,n){if(n.isEmpty())return Z.EXTERIOR;var r=n.getExteriorRing(),i=e.locatePointInRing(t,r);if(i!==Z.INTERIOR)return i;for(var o=0;o=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t), t=r}e.setNext(t)}}, {key:"computeDepths",value:function value(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(tt.LEFT),r=t.getDepth(tt.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n); if(this.computeDepths(0,e,i)!==r)throw new pt("depth mismatch at "+t.getCoordinate());}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym(); switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!== t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(q.isTrue(null!==e,"found null for first outgoing dirEdge"),q.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"), n.setNextMin(e))}}, {key:"getOutgoingDegree",value:function value(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r= 0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}}}, {key:"getLabel",value:function value(){return this._label}}, {key:"findCoveredLineEdges",value:function value(){for(var t=Z.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Z.INTERIOR;break}if(r.isInResult()){t= Z.EXTERIOR;break}}}if(t===Z.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===Z.INTERIOR):(s.isInResult()&&(i=Z.EXTERIOR), a.isInResult()&&(i=Z.INTERIOR))}}}, {key:"computeLabelling",value:function value(t){g(o(s.prototype),"computeLabelling",this).call(this,t),this._label=new Ae(Z.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(), r=0;r<2;r++){var i=n.getLocation(r);i!==Z.INTERIOR&&i!==Z.BOUNDARY||this._label.setLocation(r,Z.INTERIOR)}}}],[{key:"constructor_", value:function value(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),s}(jn),Zn=function(e){i(o,e); var n=f(o);function o(){return t(this,o),n.call(this)} return r(o,[{key:"createNode",value:function value(t){return new Ge(t,new Un)}}]),o}(Ke),Wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"compareTo",value:function value(t){var n=t;return e.compareOriented(this._pts,this._orientation,n._pts,n._orientation)}}, {key:"interfaces_",get:function get(){return[E]}}],[{key:"constructor_", value:function value(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)}}, {key:"orientation",value:function value(t){return 1===Ht.increasingDirection(t)}}, {key:"compareOriented",value:function value(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var h=t[u].compareTo(n[l]);if(0!==h)return h;var c=(u+= i)===s,f=(l+=o)===a;if(c&&!f)return-1;if(!c&&f)return 1;if(c&&f)return 0}}}]),e}(),Hn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"print",value:function value(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(), i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")}}, {key:"addAll",value:function value(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}}, {key:"findEdgeIndex",value:function value(t){for(var e=0;et?1:this.diste?1:0}}, {key:"interfaces_",get:function get(){return[E]}}],[{key:"constructor_", value:function value(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new z(t),this.segmentIndex=e,this.dist=n}}]),e}(),$n=function(){function e(){t(this, e),e.constructor_.apply(this,arguments)} return r(e,[{key:"print",value:function value(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}}, {key:"iterator",value:function value(){return this._nodeMap.values().iterator()}}, {key:"addSplitEdges",value:function value(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}}}, {key:"addEndpoints",value:function value(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}}, {key:"createSplitEdge",value:function value(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=(new Array(n)).fill(null),s=0;o[s++]= new z(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new or(o,new Ae(this.edge._label))}}, {key:"add",value:function value(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)}}, {key:"isIntersection",value:function value(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}],[{key:"constructor_", value:function value(){this._nodeMap=new Ze,this.edge=null;var t=arguments[0];this.edge=t}}]),e}(),tr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"isIntersects",value:function value(){return!this.isDisjoint()}}, {key:"isCovers",value:function value(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&& this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}}, {key:"isCoveredBy",value:function value(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&& this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}}, {key:"set",value:function value(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)}}, {key:"isWithin",value:function value(){return e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}}, {key:"isTouches",value:function value(t,n){return t>n?this.isTouches(n,t):(t===Mt.A&&n===Mt.A||t===Mt.L&&n===Mt.L||t===Mt.L&&n===Mt.A||t===Mt.P&&n===Mt.A||t===Mt.P&&n===Mt.L)&&this._matrix[Z.INTERIOR][Z.INTERIOR]=== Mt.FALSE&&(e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))}}, {key:"isOverlaps",value:function value(t,n){return t===Mt.P&&n===Mt.P||t===Mt.A&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]): t===Mt.L&&n===Mt.L&&1===this._matrix[Z.INTERIOR][Z.INTERIOR]&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR])}}, {key:"isEquals",value:function value(t,n){return t===n&&e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE&& this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}}, {key:"toString",value:function value(){for(var t=new Kt("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,Mt.toDimensionSymbol(this._matrix[e][n]));return t.toString()}}, {key:"setAll",value:function value(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t}}, {key:"get",value:function value(t,e){return this._matrix[t][e]}}, {key:"transpose",value:function value(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]= t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}}, {key:"matches",value:function value(t){if(9!==t.length)throw new x("Should be length 9: "+t);for(var n=0;n<3;n++)for(var r=0;r<3;r++)if(!e.matches(this._matrix[n][r],t.charAt(3*n+r)))return!1;return!0}}, {key:"add",value:function value(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))}}, {key:"isDisjoint",value:function value(){return this._matrix[Z.INTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.INTERIOR][Z.BOUNDARY]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.BOUNDARY]=== Mt.FALSE}}, {key:"isCrosses",value:function value(t,n){return t===Mt.P&&n===Mt.L||t===Mt.P&&n===Mt.A||t===Mt.L&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR]): t===Mt.L&&n===Mt.P||t===Mt.A&&n===Mt.P||t===Mt.A&&n===Mt.L?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]):t===Mt.L&&n===Mt.L&&0===this._matrix[Z.INTERIOR][Z.INTERIOR]}}, {key:"interfaces_",get:function get(){return[b]}}],[{key:"constructor_", value:function value(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(Mt.FALSE); else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];e.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof e){var n=arguments[0];e.constructor_.call(this),this._matrix[Z.INTERIOR][Z.INTERIOR]= n._matrix[Z.INTERIOR][Z.INTERIOR],this._matrix[Z.INTERIOR][Z.BOUNDARY]=n._matrix[Z.INTERIOR][Z.BOUNDARY],this._matrix[Z.INTERIOR][Z.EXTERIOR]=n._matrix[Z.INTERIOR][Z.EXTERIOR],this._matrix[Z.BOUNDARY][Z.INTERIOR]= n._matrix[Z.BOUNDARY][Z.INTERIOR],this._matrix[Z.BOUNDARY][Z.BOUNDARY]=n._matrix[Z.BOUNDARY][Z.BOUNDARY],this._matrix[Z.BOUNDARY][Z.EXTERIOR]=n._matrix[Z.BOUNDARY][Z.EXTERIOR],this._matrix[Z.EXTERIOR][Z.INTERIOR]= n._matrix[Z.EXTERIOR][Z.INTERIOR],this._matrix[Z.EXTERIOR][Z.BOUNDARY]=n._matrix[Z.EXTERIOR][Z.BOUNDARY],this._matrix[Z.EXTERIOR][Z.EXTERIOR]=n._matrix[Z.EXTERIOR][Z.EXTERIOR]}}}, {key:"matches",value:function value(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],n=arguments[1];return n===Mt.SYM_DONTCARE||n===Mt.SYM_TRUE&&(t>=0||t===Mt.TRUE)|| n===Mt.SYM_FALSE&&t===Mt.FALSE||n===Mt.SYM_P&&t===Mt.P||n===Mt.SYM_L&&t===Mt.L||n===Mt.SYM_A&&t===Mt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var r=arguments[1];return(new e(arguments[0])).matches(r)}}}, {key:"isTrue",value:function value(t){return t>=0||t===Mt.TRUE}}]),e}(),er=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"size",value:function value(){return this._size}}, {key:"addAll",value:function value(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),xt.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}}, {key:"ensureCapacity",value:function value(t){if(t<=this._data.length)return null;var e=Math.max(t,2*this._data.length);this._data=At.copyOf(this._data,e)}}, {key:"toArray",value:function value(){var t=(new Array(this._size)).fill(null);return xt.arraycopy(this._data,0,t,0,this._size),t}}, {key:"add",value:function value(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}],[{key:"constructor_", value:function value(){if(this._data=null,this._size=0,0===arguments.length)e.constructor_.call(this,10);else if(1===arguments.length){var t=arguments[0];this._data=(new Array(t)).fill(null)}}}]),e}(), nr=function(){function e(){t(this,e)} return r(e,[{key:"getChainStartIndices",value:function value(t){var e=0,n=new er(Math.trunc(t.length/2));n.add(e);do{var r=this.findChainEnd(t,e);n.add(r),e=r}while(en?e:n}}, {key:"getMinX",value:function value(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e e&&(r=1),this._depth[t][n]=r}}}}, {key:"getDelta",value:function value(t){return this._depth[t][tt.RIGHT]-this._depth[t][tt.LEFT]}}, {key:"getLocation",value:function value(t,e){return this._depth[t][e]<=0?Z.EXTERIOR:Z.INTERIOR}}, {key:"toString",value:function value(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}}, {key:"add",value:function value(){if(1===arguments.length)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=t.getLocation(n,r);i!==Z.EXTERIOR&&i!==Z.INTERIOR||(this.isNull(n,r)?this._depth[n][r]= e.depthAtLocation(i):this._depth[n][r]+=e.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],s=arguments[1];arguments[2]===Z.INTERIOR&&this._depth[o][s]++}}}],[{key:"constructor_", value:function value(){this._depth=Array(2).fill().map(function(){return Array(3)}); for(var t=0;t<2;t++)for(var n=0;n<3;n++)this._depth[t][n]=e.NULL_VALUE}}, {key:"depthAtLocation",value:function value(t){return t===Z.EXTERIOR?0:t===Z.INTERIOR?1:e.NULL_VALUE}}]),e}(); ir.NULL_VALUE=-1;var or=function(e){i(s,e);var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"getDepth",value:function value(){return this._depth}}, {key:"getCollapsedEdge",value:function value(){var t=(new Array(2)).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new s(t,Ae.toLineLabel(this._label))}}, {key:"isIsolated",value:function value(){return this._isIsolated}}, {key:"getCoordinates",value:function value(){return this.pts}}, {key:"setIsolated",value:function value(t){this._isIsolated=t}}, {key:"setName",value:function value(t){this._name=t}}, {key:"equals",value:function value(t){if(!(t instanceof s))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;o0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}}}, {key:"print",value:function value(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+ this._label+" "+this._depthDelta)}}, {key:"computeIM",value:function value(t){s.updateIM(this._label,t)}}, {key:"isCollapsed",value:function value(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}}, {key:"isClosed",value:function value(){return this.pts[0].equals(this.pts[this.pts.length-1])}}, {key:"getMaximumSegmentIndex",value:function value(){return this.pts.length-1}}, {key:"getDepthDelta",value:function value(){return this._depthDelta}}, {key:"getNumPoints",value:function value(){return this.pts.length}}, {key:"printReverse",value:function value(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}}, {key:"getMonotoneChainEdge",value:function value(){return null===this._mce&&(this._mce=new rr(this)),this._mce}}, {key:"getEnvelope",value:function value(){if(null===this._env){this._env=new j;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y); return t.append(") "+this._label+" "+this._depthDelta),t.toString()}}, {key:"isPointwiseEqual",value:function value(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxy o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return q.isTrue(!(s&&a),"Found bad envelope test"),a}}, {key:"initCorners",value:function value(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new z(this._maxx,this._maxy),this._corner[1]=new z(this._minx,this._maxy), this._corner[2]=new z(this._minx,this._miny),this._corner[3]=new z(this._maxx,this._miny)}}, {key:"intersects",value:function value(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled, this._p1Scaled))}}, {key:"scale",value:function value(t){return Math.round(t*this._scaleFactor)}}, {key:"getCoordinate",value:function value(){return this._originalPt}}, {key:"copyScaled",value:function value(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}}, {key:"getSafeEnvelope",value:function value(){if(null===this._safeEnv){var t=e.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y- t,this._originalPt.y+t)}return this._safeEnv}}, {key:"intersectsPixelClosure",value:function value(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1], this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]), this._li.hasIntersection()))))}}, {key:"intersectsToleranceSquare",value:function value(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t, e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&& (r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))}}, {key:"addSnappedNode",value:function value(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_", value:function value(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null, this._maxy=null,this._corner=(new Array(4)).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new x("Scale factor must be non-zero"); 1!==e&&(this._pt=new z(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new z,this._p1Scaled=new z),this.initCorners(this._pt)}}]),e}(); lr.SAFE_ENV_EXPANSION_FACTOR=.75;var hr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"select",value:function value(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}], [{key:"constructor_", value:function value(){this.selectedSegment=new bn}}]),e}(),cr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"snap",value:function value(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],s=n.getSafeEnvelope(), a=new fr(n,i,o);return this._index.query(s,new (function(){function e(){t(this,e)} return r(e,[{key:"interfaces_",get:function get(){return[hn]}}, {key:"visitItem",value:function value(t){t.select(s,a)}}]),e}())),a.isNodeAdded()}}}],[{key:"constructor_", value:function value(){this._index=null;var t=arguments[0];this._index=t}}]),e}(),fr=function(e){i(s,e); var n=f(s);function s(){var e;return t(this,s),e=n.call(this),s.constructor_.apply(h(e),arguments),e} return r(s,[{key:"isNodeAdded",value:function value(){return this._isNodeAdded}}, {key:"select",value:function value(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof In))return g(o(s.prototype),"select",this).apply(this,arguments);var t=arguments[1], e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}],[{key:"constructor_", value:function value(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e, this._hotPixelVertexIndex=n}}]),s}(hr); cr.HotPixelSnapAction=fr;var gr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)} return r(e,[{key:"processIntersections",value:function value(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1]; if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof pt))throw t;this._saveException= t}if(null!==this._resultGeometry)return null}throw this._saveException;}if(1===arguments.length){var n=arguments[0],r=e.precisionScaleFactor(this._argGeom,this._distance,n),i=new ie(r);this.bufferFixedPrecision(i)}}}, {key:"computeGeometry",value:function value(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ie.FIXED?this.bufferFixedPrecision(t): this.bufferReducedPrecision()}}, {key:"setQuadrantSegments",value:function value(t){this._bufParams.setQuadrantSegments(t)}}, {key:"bufferOriginalPrecision",value:function value(){try{var t=new sr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof F))throw t;this._saveException= t}}}, {key:"getResultGeometry",value:function value(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}}, {key:"setEndCapStyle",value:function value(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_", value:function value(){if(this._argGeom=null,this._distance=null,this._bufParams=new m,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2=== arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}}}, {key:"bufferOp",value:function value(){if(2===arguments.length){var t=arguments[1];return(new e(arguments[0])).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof U&&"number"==typeof arguments[1]){var n=arguments[1],r=arguments[2],i=new e(arguments[0]);return i.setQuadrantSegments(r),i.getResultGeometry(n)}if(arguments[2]instanceof m&&arguments[0]instanceof U&&"number"== typeof arguments[1]){var o=arguments[1];return(new e(arguments[0],arguments[2])).getResultGeometry(o)}}else if(4===arguments.length){var s=arguments[1],a=arguments[2],u=arguments[3],l=new e(arguments[0]); return l.setQuadrantSegments(a),l.setEndCapStyle(u),l.getResultGeometry(s)}}}, {key:"precisionScaleFactor",value:function value(t,e,n){var r=t.getEnvelopeInternal(),i=kt.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/ Math.log(10)+1);return Math.pow(10,o)}}]),e}(); vr.CAP_ROUND=m.CAP_ROUND,vr.CAP_BUTT=m.CAP_FLAT,vr.CAP_FLAT=m.CAP_FLAT,vr.CAP_SQUARE=m.CAP_SQUARE,vr.MAX_PRECISION_DIGITS=12;var dr=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"], yr=function(){function e(n){t(this,e),this.geometryFactory=n||new ae} return r(e,[{key:"read",value:function value(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==dr.indexOf(n)?mr[n].call(this,e.coordinates): "GeometryCollection"===n?mr[n].call(this,e.geometries):mr[n].call(this,e)}}, {key:"write",value:function value(t){var e=t.getGeometryType();if(!_r[e])throw new Error("Geometry is not supported");return _r[e].call(this,t)}}]),e}(),mr={Feature:function Feature(t){var e={}; for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!mr[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=mr.bbox.call(this,t.bbox)), e}, FeatureCollection:function FeatureCollection(t){var e={};if(t.features){e.features=[];for(var n=0;n1?0:t<-1?Mn:Math.acos(t)} function Bn(t){return t>1?Pn:t<-1?-Pn:Math.asin(t)} function Yn(){} function zn(t,e){t&&Zn.hasOwnProperty(t.type)&&Zn[t.type](t,e)} var Xn,jn,Un={Feature:function Feature(t,e){zn(t.geometry,e)}, FeatureCollection:function FeatureCollection(t,e){for(var n=t.features,r=-1,i=n.length;++rMn?t-Cn:t<-Mn?t+Cn:t,e]} function or(t){return function(e,n){return[(e+=t)>Mn?e-Cn:e<-Mn?e+Cn:e,n]}} function sr(t){var e=or(t);return e.invert=or(-t),e} function ar(t,e){var n=Fn(t),r=Vn(t),i=Fn(e),o=Vn(e);function s(t,e){var s=Fn(e),a=Fn(t)*s,u=Vn(t)*s,l=Vn(e),h=l*n+a*r;return[Dn(u*i-h*o,a*n-l*r),Bn(h*i+u*o)]} return s.invert=function(t,e){var s=Fn(e),a=Fn(t)*s,u=Vn(t)*s,l=Vn(e),h=l*i-u*o;return[Dn(u*i+l*o,a*n+h*r),Bn(h*n-a*r)]},s} function ur(t,e){(e=Qn(e))[0]-=t,nr(e);var n=Gn(-e[1]);return((-e[2]<0?-n:n)+Cn-Sn)%Cn} function lr(){var t,e=[];return{point:function point(e,n){t.push([e,n])}, lineStart:function lineStart(){e.push(t=[])}, lineEnd:Yn,rejoin:function rejoin(){e.length>1&&e.push(e.pop().concat(e.shift()))}, result:function result(){var n=e;return e=[],t=null,n}}} function hr(t,e){return Tn(t[0]-e[0])=0;--o)i.point((h=l[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,g=!g}while(!f.v);i.lineEnd()}}} function gr(t){if(e=t.length){for(var e,n,r=0,i=t[0];++re?1:t>=e?0:NaN} function vr(t){for(var e,n,r,i=t.length,o=-1,s=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n} bn(),bn(),bn(),ir.invert=ir,1===(Xn=pr).length&&(jn=Xn,Xn=function Xn(t,e){return pr(jn(t),e)}); var dr=1E9,yr=-dr;function mr(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r} function o(i,o,a,l){var h=0,c=0;if(null==i||(h=s(i,a))!==(c=s(o,a))||u(i,o)<0^a>0){do l.point(0===h||3===h?t:n,h>1?r:e);while((h=(h+a+4)%4)!==c)}else l.point(o[0],o[1])} function s(r,i){return Tn(r[0]-t)0?0:3:Tn(r[0]-n)0?2:1:Tn(r[1]-e)0?1:0:i>0?3:2} function a(t,e){return u(t.x,e.x)} function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]} return function(s){var u,l,h,c,f,g,p,v,d,y,m,_=s,x=lr(),k={point:E,lineStart:function lineStart(){k.point=b,l&&l.push(h=[]);y=!0,d=!1,p=v=NaN}, lineEnd:function lineEnd(){u&&(b(c,f),g&&d&&x.rejoin(),u.push(x.result()));k.point=E,d&&_.lineEnd()}, polygonStart:function polygonStart(){_=x,u=[],l=[],m=!0}, polygonEnd:function polygonEnd(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(f-o)*(r-s)>(g- s)*(t-o)&&++e:g<=r&&(f-o)*(r-s)<(g-s)*(t-o)&&--e;return e}(),n=m&&e,i=(u=vr(u)).length; (n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&fr(u,a,e,o,s),s.polygonEnd());_=s,u=l=h=null}}; function E(t,e){i(t,e)&&_.point(t,e)} function b(o,s){var a=i(o,s);if(l&&h.push([o,s]),y)c=o,f=s,g=a,y=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&d)_.point(o,s);else{var u=[p=Math.max(yr,Math.min(dr,p)),v=Math.max(yr,Math.min(dr,v))],x= [o=Math.max(yr,Math.min(dr,o)),s=Math.max(yr,Math.min(dr,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,h=1,c=e[0]-a,f=e[1]-u;if(s=n-a,c||!(s>0)){if(s/=c,c<0){if(s0){if(s> h)return;s>l&&(l=s)}if(s=i-a,c||!(s<0)){if(s/=c,c<0){if(s>h)return;s>l&&(l=s)}else if(c>0){if(s0)){if(s/=f,f<0){if(s0){if(s>h)return; s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>h)return;s>l&&(l=s)}else if(f>0){if(s0&&(t[0]=a+l*c,t[1]=u+l*f),h<1&&(e[0]=a+h*c,e[1]=u+h*f),!0}}}}}(u,x,t,e,n,r)?a&&(_.lineStart(), _.point(o,s),m=!1):(d||(_.lineStart(),_.point(u[0],u[1])),_.point(x[0],x[1]),a||_.lineEnd(),m=!1)}p=o,v=s,d=a} return k}} var _r=bn();function xr(t){return t} bn(),bn(),bn();var kr=1/0,Er=kr,br=-kr,wr=br,Ir={point:function point(t,e){tbr&&(br=t);ewr&&(wr=e)}, lineStart:Yn,lineEnd:Yn,polygonStart:Yn,polygonEnd:Yn,result:function result(){var t=[[kr,Er],[br,wr]];return br=wr=-(Er=kr=1/0),t}}; function Nr(t,e,n,r){return function(i,o){var s,a,u,l=e(o),h=i.invert(r[0],r[1]),c=lr(),f=e(c),g=!1,p={point:v,lineStart:y,lineEnd:m,polygonStart:function polygonStart(){p.point=_,p.lineStart=x,p.lineEnd= k,a=[],s=[]}, polygonEnd:function polygonEnd(){p.point=v,p.lineStart=y,p.lineEnd=m,a=vr(a);var t=function(t,e){var n=e[0],r=e[1],i=[Vn(n),-Fn(n),0],o=0,s=0;_r.reset();for(var a=0,u=t.length;a=0?1:-1,w=b*E,I=w>Mn,N=p*x;if(_r.add(Dn(N*b*Vn(w),v*k+N*Fn(w))),o+=I?E+ b*Cn:E,I^f>=n^m>=n){var S=$n(Qn(c),Qn(y));nr(S);var M=$n(i,S);nr(M);var P=(I^E>=0?-1:1)*Bn(M[2]);(r>P||r===P&&(S[0]||S[1]))&&(s+=I^E>=0?1:-1)}}return(o<-Sn||o0){for(g||(o.polygonStart(),g=!0),o.lineStart(), t=0;t1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Sr))} return p}} function Sr(t){return t.length>1} function Mr(t,e){return((t=t.x)[0]<0?t[1]-Pn-Sn:Pn-t[1])-((e=e.x)[0]<0?e[1]-Pn-Sn:Pn-e[1])} bn();var Pr=Nr(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN; return{lineStart:function lineStart(){t.lineStart(),e=1}, point:function point(o,s){var a=o>0?Mn:-Mn,u=Tn(o-n);Tn(u-Mn)0?Pn:-Pn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Mn&&(Tn(n-i)Sn?An((Vn(e)*(o=Fn(r))*Vn(n)-Vn(r)*(i=Fn(e))*Vn(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a, r),e=0),t.point(n=o,r=s),i=a}, lineEnd:function lineEnd(){t.lineEnd(),n=r=NaN}, clean:function clean(){return 2-e}}},function(t,e,n,r){var i; if(null==t)i=n*Pn,r.point(-Mn,i),r.point(0,i),r.point(Mn,i),r.point(Mn,0),r.point(Mn,-i),r.point(0,-i),r.point(-Mn,-i),r.point(-Mn,0),r.point(-Mn,i);else if(Tn(t[0]-e[0])>Sn){var o=t[0]0,i=Tn(n)>Sn;function o(t,e){return Fn(t)*Fn(e)>n} function s(t,e,r){var i=[1,0,0],o=$n(Qn(t),Qn(e)),s=Kn(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=n*s/u,h=-n*a/u,c=$n(i,o),f=er(i,l);tr(f,er(o,h));var g=c,p=Kn(f,g),v=Kn(g,g),d=p*p-v*(Kn(f,f)-1);if(!(d< 0)){var y=qn(d),m=er(g,(-p-y)/v);if(tr(m,f),m=Jn(m),!r)return m;var _,x=t[0],k=e[0],E=t[1],b=e[1];k0^m[1]<(Tn(m[0]-x)Mn^(x<=m[0]&&m[0]<=k)){var N=er(g,(-p+y)/v);return tr(N,f),[m,Jn(N)]}}} function a(e,n){var i=r?t:Mn-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o} return Nr(o,function(t){var e,n,u,l,h;return{lineStart:function lineStart(){l=u=!1,h=1}, point:function point(c,f){var g,p=[c,f],v=o(c,f),d=r?v?0:a(c,f):v?a(c+(c<0?Mn:-Mn),f):0;if(!e&&(l=u=v)&&t.lineStart(),v!==u&&(!(g=s(e,p))||hr(e,g)||hr(p,g))&&(p[0]+=Sn,p[1]+=Sn,v=o(p[0],p[1])),v!==u)h= 0,v?(t.lineStart(),g=s(p,e),t.point(g[0],g[1])):(g=s(e,p),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(i&&e&&r^v){var y;d&n||!(y=s(p,e,!0))||(h=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0], y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||e&&hr(e,p)||t.point(p[0],p[1]),e=p,u=v,n=d}, lineEnd:function lineEnd(){u&&t.lineEnd(),e=null}, clean:function clean(){return h|(l&&u)<<1}}},function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Fn(e),a=Vn(e),u=r*n; null==i?(i=e+r*Cn,o=e-u/2):(i=ur(s,i),o=ur(s,o),(r>0?io)&&(i+=r*Cn));for(var l,h=i;r>0?h>o:h4*e&&v--){var x=s+f,k=a+g,E=u+p,b=qn(x*x+k*k+E*E),w=Bn(E/=b),I=Tn(Tn(E)- 1)e||Tn((y*P+m*L)/_-.5)>.3||s*f+a*g+u*p2?t[2]%360*On:0,M()):[d*Rn, y*Rn,m*Rn]},I.precision=function(t){return arguments.length?(w=Dr(S,b=t*t),P()):qn(b)},I.fitExtent=function(t,e){return Or(I,t,e)},I.fitSize=function(t,e){return function(t,e,n){return Or(t,[[0, 0],e],n)}(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&N,M()}}(function(){return t})()} function qr(t){return function(e,n){var r=Fn(e),i=Fn(n),o=t(r*i);return[o*i*Vn(e),o*Vn(n)]}} function Gr(t){return function(e,n){var r=qn(e*e+n*n),i=t(r),o=Vn(i),s=Fn(i);return[Dn(e*o,r*s),Bn(r&&n*o/r)]}} qr(function(t){return qn(2/(1+t))}).invert=Gr(function(t){return 2*Bn(t/2)}); var Br=qr(function(t){return(t=Gn(t))&&t/Vn(t)}); function Yr(){return Vr(Br).scale(79.4188).clipAngle(179.999)} function zr(t,e){return[t,e]} Br.invert=Gr(function(t){return t}),zr.invert=zr; var Xr=En.BufferOp,jr=En.GeoJSONReader,Ur=En.GeoJSONWriter;function Zr(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return ht(t,function(t){var i= Zr(t,e,n,r);i&&s.push(i)}),b(s)}var a=function(t){var e=xn(t).geometry.coordinates,n=[-e[0], -e[1]];return Yr().rotate(n).scale(f)}(o),u={type:o.type, coordinates:Hr(o.coordinates,a)},l=(new jr).read(u),h=P(L(e,n),"meters"),c=Xr.bufferOp(l,h,r);if(!Wr((c=(new Ur).write(c)).coordinates))return v({type:c.type,coordinates:Jr(c.coordinates,a)},i)} function Wr(t){return Array.isArray(t[0])?Wr(t[0]):isNaN(t[0])} function Hr(t,n){return"object"!==e(t[0])?n(t):t.map(function(t){return Hr(t,n)})} function Jr(t,n){return"object"!==e(t[0])?n.invert(t):t.map(function(t){return Jr(t,n)})} function Qr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return ht(t,function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!V(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+ o);(a=Number(a))>0&&rt(t,function(t){n+=t[0]*a,r+=t[1]*a,i+=a})}),y([n/i, r/i],e.properties,e)} function Kr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return rt(t,function(t){n+=t[0],r+=t[1],i++},!0),y([n/i, r/i],e.properties)} function $r(t,e,n,r,i){var o=r.tolerance||.001,s=0,a=0,u=0,l=0;if(at(n,function(e){var n,r=null==(n=e.properties)?void 0:n.weight,i=null==r?1:r;if(!V(i=Number(i)))throw new Error("weight value must be a number"); if(i>0){l+=1;var o=i*tt(e,t);0===o&&(o=1);var h=i/o;s+=e.geometry.coordinates[0]*h,a+=e.geometry.coordinates[1]*h,u+=h}}),l<1)throw new Error("no features to measure"); var h=s/u,c=a/u;return 1===l||0===i||Math.abs(h-e[0])0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri;if(n(this,t),this.data= e,this.length=this.data.length,this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)} return i(t,[{key:"push",value:function value(t){this.data.push(t),this.length++,this._up(this.length-1)}}, {key:"pop",value:function value(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}}, {key:"peek",value:function value(){return this.data[0]}}, {key:"_up",value:function value(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}}, {key:"_down",value:function value(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=s,t=o}e[t]= i}}]),t}(); function ri(t,e){return te?1:0} var ii=rn(Object.freeze({__proto__:null,"default":ni})),oi={exports:{}},si=function si(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,u=0,l=a-1;uo!=g>o&&i<(f-h)*(o-c)/(g-c)+h&&(s=!s)}return s},ai=function ai(t,e,n,r){var i=t[0],o=t[1],s=!1; void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,u=0,l=a-1;uo!=g>o&&i<(f-h)*(o-c)/(g-c)+h&&(s=!s)}return s}; oi.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?ai(t,e,n,r):si(t,e,n,r)},oi.exports.nested=ai,oi.exports.flat=si; var ui=oi.exports,li={exports:{}};!function(t,e){!function(t){var e=134217729,n=3.3306690738754706E-16;function r(t,e,n,r,i){var o,s,a,u,l=e[0],h=r[0],c=0,f=0;h>l==h>-l?(o=l,l=e[++c]):(o=h,h=r[++f]);var g= 0;if(cl==h>-l?(a=o-((s=l+o)-l),l=e[++c]):(a=o-((s=h+o)-h),h=r[++f]),o=s,0!==a&&(i[g++]=a);cl==h>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c]):(a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f]), o=s,0!==a&&(i[g++]=a);for(;c0!=m>0)return _;var x=Math.abs(y+m);return Math.abs(_)>=o*x?_:-function(t,i,o,g,p,v,d){var y,m,_,x,k,E,b,w,I,N,S,M,P,L,C,R,O,T,A=t-p,D=o-p,F=i-v,V=g-v;k=(C=(w=A-(b=(E=e*A)-(E-A)))*(N=V-(I=(E=e*V)- (E-V)))-((L=A*V)-b*I-w*I-b*N))-(S=C-(O=(w=F-(b=(E=e*F)-(E-F)))*(N=D-(I=(E=e*D)-(E-D)))-((R=F*D)-b*I-w*I-b*N))),u[0]=C-(S+k)+(k-O),k=(P=L-((M=L+S)-(k=M-L))+(S-k))-(S=P-R),u[1]=P-(S+k)+(k-R),k=(T=M+S)-M, u[2]=M-(T-k)+(S-k),u[3]=T;var q=function(t,e){for(var n=e[0],r=1;r=G||-q>=G)return q;if(y=t-(A+(k=t-A))+(k-p),_=o-(D+(k=o-D))+(k-p),m=i-(F+(k=i-F))+(k-v),x=g-(V+(k=g-V))+(k-v),0===y&&0===m&&0===_&&0===x)return q;if(G=a*d+n*Math.abs(q),(q+=A*x+V*y-(F*_+D*m))>=G|| -q>=G)return q;k=(C=(w=y-(b=(E=e*y)-(E-y)))*(N=V-(I=(E=e*V)-(E-V)))-((L=y*V)-b*I-w*I-b*N))-(S=C-(O=(w=m-(b=(E=e*m)-(E-m)))*(N=D-(I=(E=e*D)-(E-D)))-((R=m*D)-b*I-w*I-b*N))),f[0]=C-(S+k)+(k-O),k=(P=L-((M= L+S)-(k=M-L))+(S-k))-(S=P-R),f[1]=P-(S+k)+(k-R),k=(T=M+S)-M,f[2]=M-(T-k)+(S-k),f[3]=T;var B=r(4,u,4,f,l);k=(C=(w=A-(b=(E=e*A)-(E-A)))*(N=x-(I=(E=e*x)-(E-x)))-((L=A*x)-b*I-w*I-b*N))-(S=C-(O=(w=F-(b=(E=e* F)-(E-F)))*(N=_-(I=(E=e*_)-(E-_)))-((R=F*_)-b*I-w*I-b*N))),f[0]=C-(S+k)+(k-O),k=(P=L-((M=L+S)-(k=M-L))+(S-k))-(S=P-R),f[1]=P-(S+k)+(k-R),k=(T=M+S)-M,f[2]=M-(T-k)+(S-k),f[3]=T;var Y=r(B,l,4,f,h);k=(C=(w= y-(b=(E=e*y)-(E-y)))*(N=x-(I=(E=e*x)-(E-x)))-((L=y*x)-b*I-w*I-b*N))-(S=C-(O=(w=m-(b=(E=e*m)-(E-m)))*(N=_-(I=(E=e*_)-(E-_)))-((R=m*_)-b*I-w*I-b*N))),f[0]=C-(S+k)+(k-O),k=(P=L-((M=L+S)-(k=M-L))+(S-k))-(S= P-R),f[1]=P-(S+k)+(k-R),k=(T=M+S)-M,f[2]=M-(T-k)+(S-k),f[3]=T;var z=r(Y,h,4,f,c);return c[z-1]}(t,i,g,p,v,d,x)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t, "__esModule",{value:!0})}(e)}(0,li.exports); var hi=ei,ci=ii,fi=ui,gi=li.exports.orient2d;function pi(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o= 2&&xi(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&xi(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(), e.concat(r)}(u)}(t),i=new hi(16); i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t); for(var o,s=[],a=0;ao||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f= a.pop(),g=f.node,p=wi(g,e,n),v=wi(g,r,i);if(f.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY} function _i(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:u,maxX:l,maxY:h}),f=0;f0!=xi(r,i,s)>0&&xi(o,s,r)>0!=xi(o,s,i)>0)return!1;return!0} function xi(t,e,n){return gi(t[0],t[1],e[0],e[1],n[0],n[1])} function ki(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t} function Ei(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n} function bi(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r} function wi(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s} function Ii(t,e,n,r,i,o,s,a){var u,l,h,c,f=n-t,g=r-e,p=s-i,v=a-o,d=t-i,y=e-o,m=f*f+g*g,_=f*p+g*v,x=p*p+v*v,k=f*d+g*y,E=p*d+v*y,b=m*x-_*_,w=b,I=b;0===b?(l=0,w=1,c=E,I=x):(c=m*E-_*k,(l=_*E-x*k)<0?(l=0,c= E,I=x):l>w&&(l=w,c=E+_,I=x)),c<0?(c=0,-k<0?l=0:-k>m?l=w:(l=-k,w=m)):c>I&&(c=I,-k+_<0?l=0:-k+_>m?l=w:(l=-k+_,w=m));var N=(1-(h=0===c?0:c/I))*i+h*s-((1-(u=0===l?0:l/w))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r); return N*N+S*S} function Ni(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]} ci["default"]&&(ci=ci["default"]),ti.exports=pi,ti.exports["default"]=pi;var Si=nn(ti.exports);function Mi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.concavity=e.concavity||1/ 0;var n=[];if(rt(t,function(t){n.push([t[0],t[1]])}),!n.length)return null; var r=Si(n,e.concavity);return r.length>3?_([r]):null} function Pi(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s= 0;s0;r.length0;){var a=t[Math.floor(Math.random()* o)],u=s?a.join("_"):""+a; n[u]||(n[u]=!0,r.push(a))}if(r.length0,s=t[Math.floor(Math.random()*i)];for(o&&s.join("_"),r.push(s);r.length0,g=[];if(n)i="kmrand"==n?Ji(t,e):"kmpp"==n?Qi(t,e):n;else for(var p={};i.lengthc&&(c= t[a].y);var g,p=l-u,v=c-h,d=p>v?p:v,y=.5*(l+u),m=.5*(c+h),_=[new ro({__sentinel:!0,x:y-20*d,y:m-d},{__sentinel:!0,x:y,y:m+20*d},{__sentinel:!0,x:y+20*d,y:m-d})],x=[],k=[];a=t.length;for(;a--;){for(k.length= 0,g=_.length;g--;)(p=t[a].x-_[g].x)>0&&p*p>_[g].r?(x.push(_[g]),_.splice(g,1)):p*p+(v=t[a].y-_[g].y)*v>_[g].r||(k.push(_[g].a,_[g].b,_[g].b,_[g].c,_[g].c,_[g].a),_.splice(g,1));for(oo(k),g=k.length;g;)n= k[--g],e=k[--g],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>f&&_.push(new ro(e,n,r))}Array.prototype.push.apply(x,_),a=x.length;for(;a--;)(x[a].a.__sentinel||x[a].b.__sentinel|| x[a].c.__sentinel)&&x.splice(a,1);return x}(t.features.map(function(t){var r={x:t.geometry.coordinates[0], y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r})).map(function(t){var e=[t.a.x, t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},_([[e,r,i,e]],o)}))} var ro=i(function t(e,r,i){n(this,t),this.a=e,this.b=r,this.c=i;var o,s,a=r.x-e.x,u=r.y-e.y,l=i.x-e.x,h=i.y-e.y,c=a*(e.x+r.x)+u*(e.y+r.y),f=l*(e.x+i.x)+h*(e.y+i.y),g=2*(a*(i.y-r.y)-u*(i.x-r.x));this.x= (h*c-u*f)/g,this.y=(a*f-l*c)/g,o=this.x-e.x,s=this.y-e.y,this.r=o*o+s*s}); function io(t,e){return e.x-t.x} function oo(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}} function so(t){return t} function ao(t,e){var n=function(t){if(null==t)return so;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,h=new Array(l);for(h[0]=(e+= t[0])*r+o,h[1]=(n+=t[1])*i+s;u1)for(var o,a,u=1,l=s(i[0]);ul&&(a=i[0],i[0]=i[u],i[u]=a,l=o); return i}).filter(function(t){return t.length>0})}} var co=Object.prototype.hasOwnProperty;function fo(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o}, maybeSet:function maybeSet(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o}, get:function get(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)break;h=s[l=l+1&u]}return o}, keys:function keys(){for(var t=[],e=0,n=s.length;e>7^yo[2]^yo[3])} function _o(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=function(){for(var t=fo(1.4*o.length,k,E,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n=0){var o=c[n];i===e&&o===r||i=== r&&o===e||(++g,f[n]=1)}else h[n]=e,c[n]=r}} function k(t){return mo(o[t])} function E(t,e){return go(o[t],o[e])} l=h=c=null;var b,w=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0}, has:function has(r){for(var a=e(r)&s,u=o[a],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[a=a+1&s]}return!1}, values:function values(){for(var t=[],e=0,n=o.length;e>1);er&&(r=o),si&&(i=s)} function u(t){t.forEach(a)} function l(t){t.forEach(u)} for(var h in t)o(t[h]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=Eo(t)),r=e>0&&n&&function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=o-r?(n-1)/(o-r):1,u=s-i?(n-1)/(s-i):1; function l(t){return[Math.round((t[0]-r)*a),Math.round((t[1]-i)*u)]} function h(t,e){for(var n,o,s,l,h,c=-1,f=0,g=t.length,p=new Array(g);++c1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==J(t))throw new Error("geojson must be a FeatureCollection"); if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Li(t));var r=[],i=yt(t,function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=Lo(r[0]), s=Lo(r[r.length-1]),a=Lo(i[0]),u=Lo(i[i.length-1]);if(o===u)n=i.concat(r.slice(1));else if(a===s)n=r.concat(i.slice(1));else if(o===a)n=r.slice(1).reverse().concat(i);else{if(s!==u)return null;n=r.concat(i.reverse().slice(1))}return k(n)}(t, e); return n||(r.push(t),e)}); return i&&r.push(i),r.length?1===r.length?r[0]:w(r.map(function(t){return t.coordinates})):null} function Lo(t){return t[0].toString()+","+t[1].toString()} function Co(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==J(t))throw new Error("geojson must be a FeatureCollection"); if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Li(t));var r=function(t){var e={};ft(t,function(t){e[t.geometry.type]=!0}); var n=Object.keys(e);if(1===n.length)return n[0];return null}(t); if(!r)throw new Error("geojson must be homogenous");var i=t;switch(r){case "LineString":return Po(i,e);case "Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}; if("FeatureCollection"!==J(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=Li(t));var n=[];ft(t, function(t){n.push(t.geometry)}); var r=No({geoms:S(n).geometry});return lo(r,r.objects.geoms.geometries)}(i,e); default:throw new Error(r+" is not supported");}} function Ro(t,e){var n,r,i,o,s={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:a(0),"throw":a(1),"return":a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o; function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o= s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e?1:t0))break;if(null===e.right)break;if(n(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}i.right=e,i=e,e=e.right}}return i.right=e.left,o.left=e.right, e.left=r.right,e.right=r.left,e} function Do(t,e,n,r){var i=new Oo(t,e);if(null===n)return i.left=i.right=null,i;var o=r(t,(n=Ao(t,n,r)).key);return o<0?(i.left=n.left,i.right=n,n.left=null):o>=0&&(i.right=n.right,i.left=n,n.right=null), i} function Fo(t,e,n){var r=null,i=null;if(e){var o=n((e=Ao(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}} function Vo(t,e,n,r,i){if(t){r(e+(n?"\u2514\u2500\u2500 ":"\u251c\u2500\u2500 ")+i(t)+"\n");var o=e+(n?" ":"\u2502 ");t.left&&Vo(t.left,o,!1,r,i),t.right&&Vo(t.right,o,!0,r,i)}} var qo=function(){function t(t){void 0===t&&(t=To),this._root=null,this._size=0,this._comparator=t} return t.prototype.insert=function(t,e){return this._size++,this._root=Do(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new Oo(t,e); null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,i=Ao(t,this._root,r),o=r(t,i.key);return 0===o?this._root=i:(o<0?(n.left=i.left,n.right=i,i.left=null):o>0&&(n.right= i.right,n.left=i,i.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r; return null===e?null:0===n(t,(e=Ao(t,e,n)).key)?(null===e.left?r=e.right:(r=Ao(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root; if(t){for(;t.left;)t=t.left;return this._root=Ao(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic= function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key); if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Ao(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root}, t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key); if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0; return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left; else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[]; return this.forEach(function(e){var n=e.key;return t.push(n)}),t},t.prototype.values=function(){var t=[]; return this.forEach(function(e){var n=e.data;return t.push(n)}),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key: null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left; return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right; return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left; else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null; if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root, n=null; if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root= null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,n=[],r=!1,i=new Oo(null,null),o=i; for(;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=o=o.next=n.pop()).right:r=!0;return o.next=null,i.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1); var r=t.length,i=this._comparator;if(n&&Yo(t,e,0,r-1,i),null===this._root)this._root=Go(t,e,0,r),this._size=r;else{var o=function(t,e,n){var r=new Oo(null,null),i=r,o=t,s=e;for(;null!==o&&null!==s;)n(o.key, s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;null!==o?i.next=o:null!==s&&(i.next=s);return r.next}(this.toList(),function(t,e){for(var n=new Oo(null,null),r=n,i=0;i0){var o=n+Math.floor(i/2),s=t[o],a=e[o],u=new Oo(s,a);return u.left=Go(t,e,n,o),u.right=Go(t,e,o+1,r),u}return null} function Bo(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=Bo(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=Bo(t,i+1,n),s}return null} function Yo(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do s++;while(i(t[s],o)<0);do a--;while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}Yo(t,e,n,a,i), Yo(t,e,a+1,r,i)}} function zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");} function Xo(t,e){for(var n=0;ne.x?1:t.ye.y?1:0}}]),jo(t,[{key:"link", value:function value(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n=0&&u>=0?sl?-1:0:o<0&&u<0?sl?1:0:uo?1:0}}}]),t}(),us= 0,ls=function(){function t(e,n,r,i){zo(this,t),this.id=++us,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=i} return jo(t,null,[{key:"compare",value:function value(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(os&&a>u)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!== c?c:-1}if(n>r){if(sa&&s>l)return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var g=t.comparePoint(e.rightSE.point);return g<0?1:g>0?-1:1}if(sa)return 1; if(io){var v=t.comparePoint(e.rightSE.point);if(v<0)return 1;if(v>0)return-1}if(i!==o){var d=u-s,y=i-n,m=l-a,_=o-r;if(d>y&&m<_)return 1; if(d_)return-1}return i>o?1:il?1:t.ide.id?1:0}}]),jo(t,[{key:"replaceRightSE", value:function value(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}}, {key:"bbox",value:function value(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}}, {key:"vector",value:function value(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}}, {key:"isAnEndpoint",value:function value(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}}, {key:"comparePoint",value:function value(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x0&&a.swapEvents(),as.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}}, {key:"swapEvents",value:function value(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n= r,r=s}for(var a=0,u=r.rings.length;a0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,s=-1}return new t(new as(i, !0),new as(o,!1),[r],[s])}}]),t}(),hs=function(){function t(e,n,r){if(zo(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon"); if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=$o.round(e[0][0],e[0][1]); this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=e.length;sthis.bbox.ur.x&&(this.bbox.ur.x= u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}i.x===o.x&&i.y===o.y||this.segments.push(ls.fromRing(o,i,this))} return jo(t,[{key:"getSweepEvents",value:function value(){for(var t=[],e=0,n=this.segments.length;ethis.bbox.ur.x&& (this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=n} return jo(t,[{key:"getSweepEvents",value:function value(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x= o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=n} return jo(t,[{key:"getSweepEvents",value:function value(){for(var t=[],e=0,n=this.polys.length;e0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult(): null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]), t}(),ps=function(){function t(e){zo(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]} return jo(t,[{key:"addInterior",value:function value(t){this.interiorRings.push(t),t.poly=this}}, {key:"getGeom",value:function value(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:ls.compare; zo(this,t),this.queue=e,this.tree=new qo(n),this.segments=[]} return jo(t,[{key:"process",value:function value(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e); if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -\x3e ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+ "in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,s=void 0,a=void 0;void 0===s;)null===(i=this.tree.prev(i))?s=null:void 0===i.key.consumedBy&&(s=i.key);for(;void 0===a;)null===(o=this.tree.next(o))? a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var u=null;if(s){var l=s.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!s.isAnEndpoint(l)))for(var h=this._splitSafely(s,l),c=0,f=h.length;c< f;c++)n.push(h[c])}var g=null;if(a){var p=a.getIntersection(e);if(null!==p&&(e.isAnEndpoint(p)||(g=p),!a.isAnEndpoint(p)))for(var v=this._splitSafely(a,p),d=0,y=v.length;d 0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var E=s.getIntersection(a);if(null!==E){if(!s.isAnEndpoint(E))for(var b=this._splitSafely(s,E),w=0,I=b.length;wys)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report."); for(var _=new ds(g),x=g.size,k=g.pop();k;){var E=k.key;if(g.size===x){var b=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y, "] from segment #").concat(b.id," ")+"[".concat(b.leftSE.point.x,", ").concat(b.leftSE.point.y,"] -\x3e ")+"[".concat(b.rightSE.point.x,", ").concat(b.rightSE.point.y,"] from queue. ")+"Please file a bug report."); }if(g.size>ys)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>ms)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report."); for(var w=_.process(E),I=0,N=w.length;I1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:2,r=z(t),i=z(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)} function bs(t,e){var n,r,i=(e=e||{}).threshold||1E4,o=e.p||2,s=null!=(n=e.binary)&&n,a=e.alpha||-1,u=null!=(r=e.standardization)&&r,l=[];at(t,function(t){l.push(Kr(t))}); for(var h=[],c=0;c3&&void 0!==arguments[3]?arguments[3]:{},i=e<0,o=D(Math.abs(e),r.units,"meters");i&&(o=-Math.abs(o));var s=z(t),a=function(t,e,n,r){r=void 0===r?f:Number(r);var i= e/r,o=t[0]*Math.PI/180,s=A(t[1]),a=A(n),u=i*Math.cos(a),l=s+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),c=Math.abs(h)>1E-11?u/h: Math.cos(s),g=i*Math.sin(a)/c;return[(180*(o+g)/Math.PI+540)%360-180,180*l/Math.PI]}(s,o,n); return a[0]+=a[0]-s[0]>180?-360:s[0]-a[0]>180?360:0,y(a,r.properties)} function Is(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z(t),i=z(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var o=function(t,e,n){var r=n=void 0===n?f:Number(n),i=t[1]*Math.PI/ 180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1E-11?s/u:Math.cos(i),h=Math.sqrt(s* s+l*l*a*a),c=h*r;return c}(r,i); return D(o,"meters",n.units)} function Ns(t,e,n){if(!q(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");if(0=== e)return t;var o=null!=r?r:Kr(t);return!1!==i&&void 0!==i||(t=Li(t)),rt(t,function(t){var n=et(o,t)+e,r=Is(o,t),i=X(ws(o,r,n));t[0]=i[0],t[1]=i[1]}),t} function Ss(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",s=r.angle||0,a=r.pivot||t,u=r.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required"); if(!n)throw new Error("ySemiAxis is required");if(!q(r))throw new Error("options must be an object");if(!V(i))throw new Error("steps must be a number");if(!V(s))throw new Error("angle must be a number"); var l=z(t);if("degrees"!==o){var h=ws(t,e,90,{units:o}),c=ws(t,n,0,{units:o});e=z(h)[0]-l[0],n=z(c)[1]-l[1]}for(var f=[],g=0;g=-270&&(v=-v),p<-180&&p>=-360&&(d=-d),"degrees"===o){var y=A(s),m=v*Math.cos(y)+d*Math.sin(y),x=d*Math.cos(y)-v*Math.sin(y); v=m,d=x}f.push([v+l[0],d+l[1]])}return f.push(f[0]),"degrees"===o?_([f],u):Ns(_([f],u),s,{pivot:a})} function Ms(t){var e=t*Math.PI/180;return Math.tan(e)} function Ps(t){return Ct(Nt(t))} function Ls(t){var e=[];return"FeatureCollection"===t.type?at(t,function(t){rt(t,function(n){e.push(y(n,t.properties))})}):"Feature"===t.type?rt(t,function(n){e.push(y(n,t.properties))}):rt(t,function(t){e.push(y(t))}), b(e)} var Cs=Math.PI/180,Rs=180/Math.PI,Os=function Os(t,e){this.lon=t,this.lat=e,this.x=Cs*t,this.y=Cs*e}; Os.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Os.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon); return new Os(e,t)}; var Ts=function Ts(){this.coords=[],this.length=0}; Ts.prototype.move_to=function(t){this.length++,this.coords.push(t)}; var As=function As(t){this.properties=t||{},this.geometries=[]}; As.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString", coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(ht(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must specify at least 2 geometries"); var r=xs.intersection.apply(xs,[n[0]].concat(a(n.slice(1))));return 0===r.length?null:1===r.length?_(r[0],e.properties):N(r,e.properties)} function Vs(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=JSON.stringify(n.properties||{}),i=s(t,4),o=i[0],a=i[1],u=i[2],l=i[3],h=(a+l)/2,c=(o+u)/2,f=2*e/tt([o,h],[u,h],n)*(u-o), g=2*e/tt([c,a],[c,l],n)*(l-a),p=f/2,v=2*p,d=Math.sqrt(3)/2*g,y=u-o,m=l-a,_=3/4*v,x=d,k=(y-v)/(v-p/2),E=Math.floor(k),w=(E*_-p/2-y)/2-p/2+_/2,I=Math.floor((m-d)/d),N=(m-I*d)/2,S=I*d-m>d/2;S&&(N-=d/4);for(var M= [],P=[],L=0;L<6;L++){var C=2*Math.PI/6*L;M.push(Math.cos(C)),P.push(Math.sin(C))}for(var R=[],O=0;O<=E;O++)for(var T=0;T<=I;T++){var A=O%2==1;if((0!==T||!A)&&(0!==T||!S)){var D=O*_+o-w,F=T*x+a+N;if(A&& (F-=d/2),!0===n.triangles)Gs([D,F],f/2,g/2,JSON.parse(r),M,P).forEach(function(t){n.mask?Fs(b([n.mask,t]))&&R.push(t):R.push(t)}); else{var V=qs([D,F],f/2,g/2,JSON.parse(r),M,P);n.mask?Fs(b([n.mask,V]))&&R.push(V):R.push(V)}}}return b(R)} function qs(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),_([s],r)} function Gs(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(_([u],r))}return s} function Bs(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],s=t[2],a=t[3],u=e/tt([i,o],[s,o],n)*(s-i),l=e/tt([i, o],[i,a],n)*(a-o),h=s-i,c=a-o,f=Math.floor(h/u),g=(c-Math.floor(c/l)*l)/2,p=i+(h-f*u)/2;p<=s;){for(var v=o+g;v<=a;){var d=y([p,v],n.properties);n.mask?dn(d,n.mask)&&r.push(d):r.push(d),v+=l}p+=u}return b(r)} function Ys(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o=t[0],s=t[1],a=t[2],u=t[3],l=a-o,h=D(e,r.units,"degrees"),c=u-s,f=D(n,r.units,"degrees"),g=Math.floor(Math.abs(l)/ h),p=Math.floor(Math.abs(c)/f),v=(c-p*f)/2,d=o+(l-g*h)/2,y=0;y2&&void 0!==arguments[2]?arguments[2]:{})} function Xs(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=e/tt([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/tt([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var u= 0,l=t[1];l<=t[3];){var h=null,c=null;s%2==0&&u%2==0?(h=_([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=_([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)):s%2==0&&u%2==1?(h=_([[[a,l],[a+i,l+o],[a+ i,l],[a,l]]],n.properties),c=_([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties)):u%2==0&&s%2==1?(h=_([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties),c=_([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties)): u%2==1&&s%2==1&&(h=_([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=_([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)),n.mask?(Fs(b([n.mask,h]))&&r.push(h),Fs(b([n.mask,c]))&&r.push(c)):(r.push(h), r.push(c)),l+=o,u++}s++,a+=i}return b(r)} function js(t,e,n){return tr&&(i=n,n=r,r=i),tr?(t-r)/(t-e):(t-n)/(t-e)} function Zs(t,e,n,r){return t1){for(;0!==o;)o>>=1,a++;r===1<1){for(;0!==s;)s>>=1, u++;i===1<0&&(this.childB=new $s(t,e+o,n,r-o,s),this.lowerBound=Math.min(this.lowerBound, this.childB.lowerBound),this.upperBound=Math.max(this.upperBound,this.childB.upperBound),i-s>0&&(this.childC=new $s(t,e+o,n+s,r-o,i-s),this.lowerBound=Math.min(this.lowerBound,this.childC.lowerBound),this.upperBound= Math.max(this.upperBound,this.childC.upperBound))),i-s>0&&(this.childD=new $s(t,e,n+s,o,i-s),this.lowerBound=Math.min(this.lowerBound,this.childD.lowerBound),this.upperBound=Math.max(this.upperBound,this.childD.upperBound))}} function ta(t){var e,n;if(!t)throw new Error("data is required");if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Error("data must be scalar field, i.e. array of arrays");if(t.length<2)throw new Error("data must contain at least two rows"); if((n=t[0].length)<2)throw new Error("data must contain at least two columns");for(e=1;e=e||t[s][r-1]>=e){n=!1;break}if(n&&(t[i-1][0]>= e||t[i-1][r-1]>=e)&&(n=!1),n)for(o=0;o=e||t[i-1][o]>e){n=!1;break}return n}(t,r.threshold)&&(r.linearRing?_.push([[0, 0],[0,x],[k,x],[k,0],[0,0]]):_.push([[0,0],[0,x],[k,x],[k,0]])),n.forEach(function(t,N){t.forEach(function(t,S){for(i=null,o=0;o<4;o++)if(i=E[o],"object"===e(t.edges[i])){for(u=[],s=t.edges[i],l=i,h=N, c=S,f=!1,g=[N+s.path[0][0],S+s.path[0][1]],u.push(g);!f&&"object"===e((a=n[h][c]).edges[l]);)if(s=a.edges[l],delete a.edges[l],(p=s.path[1])[0]+=h,p[1]+=c,u.push(p),l=s.move.enter,h+=s.move.x,c+=s.move.y, void 0===n[h]||void 0===n[h][c]){if(!r.linearRing)break;if(v=0,d=0,h===k?(h--,v=0):h<0?(h++,v=2):c===x?(c--,v=3):c<0&&(c++,v=1),h===N&&c===S&&v===I[i]){f=!0,l=i;break}for(;;){if(y=!1,d>4)throw new Error("Direction change counter overflow! This should never happen!"); if(void 0!==n[h]&&void 0!==n[h][c]&&(a=n[h][c],m=E[v],"object"===e(a.edges[m]))){s=a.edges[m],u.push(Qs(h,c,v,s.path)),l=m,y=!0;break}if(y)break;if(u.push(Ks(h,c,v)),c+=w[v],void 0!==n[h+=b[v]]&&void 0!== n[h][c]||(0===v&&c<0||1===v&&h<0||2===v&&c===x||3===v&&h===k)&&(h-=b[v],c-=w[v],v=(v+1)%4,d++),h===N&&c===S&&v===I[i]){f=!0,l=i;break}}}!r.linearRing||u[u.length-1][0]===g[0]&&u[u.length-1][1]===g[1]|| u.push(g),_.push(u)}})}),_}(c,f,i)}u?p.push(g):p=g,"function"==typeof i.successCallback&&i.successCallback(p,t)}),p} function na(t,e,n,r){var i,o,s,a,u,l,h=0,c=t[n+1][e],f=t[n+1][e+1],g=t[n][e+1],p=t[n][e],v=r.threshold;if(!(isNaN(p)||isNaN(g)||isNaN(f)||isNaN(c))){switch(h|=c>=v?8:0,h|=f>=v?4:0,h|=g>=v?2:0,l={cval:h= +(h|=p>=v?1:0),polygons:[],edges:{},x0:p,x1:g,x2:f,x3:c},h){case 0:r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,0]]);break;case 15:break;case 14:i=r.interpolate(p,c,v),a=r.interpolate(p,g,v),r.polygons_full&& (l.edges.left={path:[[0,i],[a,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[a,0]]);break;case 13:a=r.interpolate(p,g,v),o=r.interpolate(g,f,v),r.polygons_full&&(l.edges.bottom= {path:[[a,0],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[a,0],[1,o],[1,0]]);break;case 11:o=r.interpolate(g,f,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.right={path:[[1, o],[s,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[1,o],[s,1],[1,1]]);break;case 7:i=r.interpolate(p,c,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.top={path:[[s,1],[0,i]],move:{x:-1, y:0,enter:"right"}}),r.polygons&&l.polygons.push([[s,1],[0,i],[0,1]]);break;case 1:i=r.interpolate(p,c,v),a=r.interpolate(p,g,v),r.polygons_full&&(l.edges.bottom={path:[[a,0],[0,i]],move:{x:-1,y:0,enter:"right"}}), r.polygons&&l.polygons.push([[a,0],[0,i],[0,1],[1,1],[1,0]]);break;case 2:a=r.interpolate(p,g,v),o=r.interpolate(g,f,v),r.polygons_full&&(l.edges.right={path:[[1,o],[a,0]],move:{x:0,y:-1,enter:"top"}}), r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,o],[a,0]]);break;case 4:o=r.interpolate(g,f,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.top={path:[[s,1],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&& l.polygons.push([[0,0],[0,1],[s,1],[1,o],[1,0]]);break;case 8:i=r.interpolate(p,c,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.left={path:[[0,i],[s,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&& l.polygons.push([[0,0],[0,i],[s,1],[1,1],[1,0]]);break;case 12:i=r.interpolate(p,c,v),o=r.interpolate(g,f,v),r.polygons_full&&(l.edges.left={path:[[0,i],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&& l.polygons.push([[0,0],[0,i],[1,o],[1,0]]);break;case 9:a=r.interpolate(p,g,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.bottom={path:[[a,0],[s,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[a, 0],[s,1],[1,1],[1,0]]);break;case 3:i=r.interpolate(p,c,v),o=r.interpolate(g,f,v),r.polygons_full&&(l.edges.right={path:[[1,o],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[0,i], [0,1],[1,1],[1,o]]);break;case 6:a=r.interpolate(p,g,v),s=r.interpolate(c,f,v),r.polygons_full&&(l.edges.top={path:[[s,1],[a,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[s, 1],[a,0]]);break;case 10:i=r.interpolate(p,c,v),o=r.interpolate(g,f,v),a=r.interpolate(p,g,v),s=r.interpolate(c,f,v),u=(p+g+f+c)/4,r.polygons_full&&(uf&&(v>h&&ph&&vu&&(u=d)}var y=[];if(a&&u0&&Math.abs(x-n[_-1][0])>f){var k=parseFloat(n[_-1][0]),E=parseFloat(n[_-1][1]),b=parseFloat(n[_][0]),w=parseFloat(n[_][1]);if(k>-180&&k-180&& n[_-1][0]h&&k<180&&-180===b&&_+1h&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(k< c&&b>h){var I=k;k=b,b=I;var N=E;E=w,w=N}if(k>h&&b=180&&kh?180:-180,M]),(m=[]).push([n[_-1][0]>h?-180:180,M]),y.push(m)}else m= [],y.push(m);m.push([x,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var P=[];y.push(P);for(var L=0;Le||this.upperBound=e)&&r.push({x:this.x,y:this.y})),r}, $s.prototype.cellsBelowThreshold=function(t,e){var n=[]; return e=void 0===e||e,this.lowerBound>t||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(n=n.concat(this.childA.cellsBelowThreshold(t,e))),this.childB&&(n=n.concat(this.childB.cellsBelowThreshold(t, e))),this.childD&&(n=n.concat(this.childD.cellsBelowThreshold(t,e))),this.childC&&(n=n.concat(this.childC.cellsBelowThreshold(t,e)))):(e||this.upperBound>=t)&&n.push({x:this.x,y:this.y})),n}; var ra={square:function square(t,e,n,r,i,o){o.polygons&&t.polygons.push([[0,0],[0,1],[1,1],[1,0]])}, triangle_bl:function triangle_bl(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&& t.polygons.push([[0,a],[s,0],[0,0]])}, triangle_br:function triangle_br(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[s,0],[1,a]],move:{x:1,y:0,enter:"lb"}}),o.polygons&& t.polygons.push([[s,0],[1,a],[1,0]])}, triangle_tr:function triangle_tr(t,e,n,r,i,o){var s=o.interpolate(n,r,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,s],[a,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&& t.polygons.push([[1,s],[a,1],[1,1]])}, triangle_tl:function triangle_tl(t,e,n,r,i,o){var s=o.interpolate(i,r,o.minV,o.maxV),a=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&& t.polygons.push([[0,a],[0,1],[s,1]])}, tetragon_t:function tetragon_t(t,e,n,r,i,o){var s=o.interpolate(n,r,o.minV,o.maxV),a=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,s],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&& t.polygons.push([[0,a],[0,1],[1,1],[1,s]])}, tetragon_r:function tetragon_r(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[s,0],[a,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&& t.polygons.push([[s,0],[a,1],[1,1],[1,0]])}, tetragon_b:function tetragon_b(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[1,a]],move:{x:1,y:0,enter:"lb"}}),o.polygons&& t.polygons.push([[0,0],[0,s],[1,a],[1,0]])}, tetragon_l:function tetragon_l(t,e,n,r,i,o){var s=o.interpolate(i,r,o.minV,o.maxV),a=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&& t.polygons.push([[0,0],[0,1],[s,1],[a,0]])}, tetragon_bl:function tetragon_bl(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV);o.polygons_full&& (t.edges.bl={path:[[s,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s,0],[0,u],[0,l],[a,0]])}, tetragon_br:function tetragon_br(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate_b(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.bl={path:[[s,0],[1,l]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s,0],[1,l],[1,u],[a,0]])}, tetragon_tr:function tetragon_tr(t,e,n,r,i,o){var s=o.interpolate_a(i,r,o.minV,o.maxV),a=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.rb={path:[[1,l],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[a,1],[1,u]],move:{x:1,y:0,enter:"lt"}}),o.polygons&&t.polygons.push([[1,l],[s,1],[a,1],[1,u]])}, tetragon_tl:function tetragon_tl(t,e,n,r,i,o){var s=o.interpolate_a(i,r,o.minV,o.maxV),a=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(e,i,o.minV,o.maxV);o.polygons_full&& (t.edges.tr={path:[[a,1],[0,l]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[s,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[a,1],[0,l],[0,u],[s,1]])}, tetragon_lr:function tetragon_lr(t,e,n,r,i,o){var s=o.interpolate_a(e,i,o.minV,o.maxV),a=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.lt={path:[[0,a],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,s]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,s],[0,a],[1,u],[1,l]])}, tetragon_tb:function tetragon_tb(t,e,n,r,i,o){var s=o.interpolate_a(i,r,o.minV,o.maxV),a=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.tr={path:[[a,1],[u,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[l,0],[s,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[l,0],[s,1],[a,1],[u,0]])}, pentagon_tr:function pentagon_tr(t,e,n,r,i,o){var s=o.interpolate(i,r,o.minV,o.maxV),a=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[1,a]],move:{x:1,y:0,enter:"lb"}}),o.polygons&& t.polygons.push([[0,0],[0,1],[s,1],[1,a],[1,0]])}, pentagon_tl:function pentagon_tl(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[a,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&& t.polygons.push([[0,0],[0,s],[a,1],[1,1],[1,0]])}, pentagon_br:function pentagon_br(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&& t.polygons.push([[0,0],[0,1],[1,1],[1,a],[s,0]])}, pentagon_bl:function pentagon_bl(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&& t.polygons.push([[0,s],[0,1],[1,1],[1,0],[a,0]])}, pentagon_tr_rl:function pentagon_tr_rl(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.tl={path:[[a,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[a,1],[1,u],[1,l]])}, pentagon_rb_bt:function pentagon_rb_bt(t,e,n,r,i,o){var s=o.interpolate(n,r,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,n,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&& (t.edges.rt={path:[[1,s],[a,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[u,0],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[l,1],[1,1],[1,s],[a,0],[u,0]])}, pentagon_bl_lr:function pentagon_bl_lr(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[s,0],[0,a],[0,u],[1,l],[1,0]])}, pentagon_lt_tb:function pentagon_lt_tb(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.lb={path:[[0,s],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[a,1],[u,1],[l,0]])}, pentagon_bl_tb:function pentagon_bl_tb(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.bl={path:[[l,0],[0,s]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[a,1],[u,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[a,1],[u,0],[l,0]])}, pentagon_lt_rl:function pentagon_lt_rl(t,e,n,r,i,o){var s=o.interpolate_a(e,i,o.minV,o.maxV),a=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,i,o.minV,o.maxV);o.polygons_full&& (t.edges.lt={path:[[0,a],[u,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,l],[0,s]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,s],[0,a],[u,1],[1,1],[1,l]])}, pentagon_tr_bt:function pentagon_tr_bt(t,e,n,r,i,o){var s=o.interpolate_a(i,r,o.minV,o.maxV),a=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.br={path:[[l,0],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[a,1],[1,u]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[s,1],[a,1],[1,u],[1,0],[l,0]])}, pentagon_rb_lr:function pentagon_rb_lr(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate_b(n,r,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.lb={path:[[0,s],[1,a]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[1,a],[1,u],[l,0]])}, hexagon_lt_tr:function hexagon_lt_tr(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.lb={path:[[0,s],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[a,1],[u,1],[1,l],[1,0]])}, hexagon_bl_lt:function hexagon_bl_lt(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&& (t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[s,0],[0,a],[0,u],[l,1],[1,1],[1,0]])}, hexagon_bl_rb:function hexagon_bl_rb(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.bl={path:[[s,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.rt={path:[[1,l],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s,0],[0,u],[0,1],[1,1],[1,l],[a,0]])}, hexagon_tr_rb:function hexagon_tr_rb(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.tl={path:[[a,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[a,1],[1,u],[1,l],[s,0]])}, hexagon_lt_rb:function hexagon_lt_rb(t,e,n,r,i,o){var s=o.interpolate(e,i,o.minV,o.maxV),a=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&& (t.edges.lb={path:[[0,s],[a,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[a,1],[1,1],[1,u],[l,0]])}, hexagon_bl_tr:function hexagon_bl_tr(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&& (t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[s,0],[0,a],[0,1],[u,1],[1,l],[1,0]])}, heptagon_tr:function heptagon_tr(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),h=o.interpolate(i, r,o.minV,o.maxV),c=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[s,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[h,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1, c],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s,0],[0,u],[0,l],[h,1],[1,1],[1,c],[a,0]])}, heptagon_bl:function heptagon_bl(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate_a(i,r,o.minV,o.maxV),l=o.interpolate_b(i,r,o.minV,o.maxV),h=o.interpolate_b(n, r,o.minV,o.maxV),c=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[u,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[l,1],[1,h]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1, c],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[u,1],[l,1],[1,h],[1,c],[s,0]])}, heptagon_tl:function heptagon_tl(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV),h=o.interpolate_b(n, r,o.minV,o.maxV),c=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[s,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[l,1],[1,h]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1, c],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s,0],[0,u],[0,1],[l,1],[1,h],[1,c],[a,0]])}, heptagon_br:function heptagon_br(t,e,n,r,i,o){var s=o.interpolate(e,n,o.minV,o.maxV),a=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(i,r,o.minV,o.maxV),h=o.interpolate_b(i, r,o.minV,o.maxV),c=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[h, 1],[1,c]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[s,0],[0,a],[0,u],[l,1],[h,1],[1,c],[1,0]])}, octagon:function octagon(t,e,n,r,i,o){var s=o.interpolate_a(e,n,o.minV,o.maxV),a=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),h=o.interpolate_a(i, r,o.minV,o.maxV),c=o.interpolate_b(i,r,o.minV,o.maxV),f=o.interpolate_b(n,r,o.minV,o.maxV),g=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[s,0],[0,u]],move:{x:-1,y:0,enter:"rb"}}, t.edges.lt={path:[[0,l],[h,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[c,1],[1,f]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,g],[a,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[s, 0],[0,u],[0,l],[h,1],[c,1],[1,f],[1,g],[a,0]])}}; function ia(t,n,r,i){var o,s,a,u=!1,l=null,h=null,c=null,f=null,g=!1,p=[],v=[],d=[];if(!t)throw new Error("data is required");if(null==n)throw new Error("lowerBound is required");if(null==r)throw new Error("bandWidth is required"); if(i&&"object"!==e(i))throw new Error("options must be an object");if(a=function(t){var e,n,r,i,o;for(i=new Hs,t=t||{},o=Object.keys(i),e=0;en||t[a][i-1]n){r=!1;break}if(r&&(t[o-1][0]n||t[o-1][i-1]n)&&(r=!1),r)for(s=0;sn||t[o-1][s]n){r=!1;break}return r}(t,r.minV,r.maxV)&&(r.linearRing?x.push([[0, 0],[0,k],[E,k],[E,0],[0,0]]):x.push([[0,0],[0,k],[E,k],[E,0]])),n.forEach(function(t,M){t.forEach(function(t,P){for(i=null,s=0;s<8;s++)if(i=N[s],"object"===e(t.edges[i])){for(o=[],a=t.edges[i],h=i,c=M, f=P,g=!1,p=[M+a.path[0][0],P+a.path[0][1]],o.push(p);!g&&"object"===e((v=n[c][f]).edges[h]);)if(a=v.edges[h],delete v.edges[h],(m=a.path[1])[0]+=c,m[1]+=f,o.push(m),h=a.move.enter,c+=a.move.x,f+=a.move.y, void 0===n[c]||void 0===n[c][f]){if(d=0,y=0,c===E)c--,d=0;else if(c<0)c++,d=2;else if(f===k)f--,d=3;else{if(!(f<0))throw new Error("Left the grid somewhere in the interior!");f++,d=1}if(c===M&&f===P&&d=== S[i]){g=!0,h=i;break}for(;;){if(_=!1,y>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==n[c]&&void 0!==n[c][f])for(v=n[c][f],u=0;uo?2:sf?128:64,s|=uf?32:16,s|=l f?8:4,o=0,i={cval:s=+(s|=hf?2:1),polygons:[],edges:{},x0:h,x1:l,x2:u,x3:a,x:e,y:n},s){case 85:ra.square(i,h,l,u,a,r);case 0:case 170:break;case 169:ra.triangle_bl(i,h,l,u,a,r);break;case 166:ra.triangle_br(i, h,l,u,a,r);break;case 154:ra.triangle_tr(i,h,l,u,a,r);break;case 106:ra.triangle_tl(i,h,l,u,a,r);break;case 1:ra.triangle_bl(i,h,l,u,a,r);break;case 4:ra.triangle_br(i,h,l,u,a,r);break;case 16:ra.triangle_tr(i, h,l,u,a,r);break;case 64:ra.triangle_tl(i,h,l,u,a,r);break;case 168:ra.tetragon_bl(i,h,l,u,a,r);break;case 162:ra.tetragon_br(i,h,l,u,a,r);break;case 138:ra.tetragon_tr(i,h,l,u,a,r);break;case 42:ra.tetragon_tl(i, h,l,u,a,r);break;case 2:ra.tetragon_bl(i,h,l,u,a,r);break;case 8:ra.tetragon_br(i,h,l,u,a,r);break;case 32:ra.tetragon_tr(i,h,l,u,a,r);break;case 128:ra.tetragon_tl(i,h,l,u,a,r);break;case 5:ra.tetragon_b(i, h,l,u,a,r);break;case 20:ra.tetragon_r(i,h,l,u,a,r);break;case 80:ra.tetragon_t(i,h,l,u,a,r);break;case 65:ra.tetragon_l(i,h,l,u,a,r);break;case 165:ra.tetragon_b(i,h,l,u,a,r);break;case 150:ra.tetragon_r(i, h,l,u,a,r);break;case 90:ra.tetragon_t(i,h,l,u,a,r);break;case 105:ra.tetragon_l(i,h,l,u,a,r);break;case 160:ra.tetragon_lr(i,h,l,u,a,r);break;case 130:ra.tetragon_tb(i,h,l,u,a,r);break;case 10:ra.tetragon_lr(i, h,l,u,a,r);break;case 40:ra.tetragon_tb(i,h,l,u,a,r);break;case 101:ra.pentagon_tr(i,h,l,u,a,r);break;case 149:ra.pentagon_tl(i,h,l,u,a,r);break;case 86:ra.pentagon_bl(i,h,l,u,a,r);break;case 89:ra.pentagon_br(i, h,l,u,a,r);break;case 69:ra.pentagon_tr(i,h,l,u,a,r);break;case 21:ra.pentagon_tl(i,h,l,u,a,r);break;case 84:ra.pentagon_bl(i,h,l,u,a,r);break;case 81:ra.pentagon_br(i,h,l,u,a,r);break;case 96:ra.pentagon_tr_rl(i, h,l,u,a,r);break;case 24:ra.pentagon_rb_bt(i,h,l,u,a,r);break;case 6:ra.pentagon_bl_lr(i,h,l,u,a,r);break;case 129:ra.pentagon_lt_tb(i,h,l,u,a,r);break;case 74:ra.pentagon_tr_rl(i,h,l,u,a,r);break;case 146:ra.pentagon_rb_bt(i, h,l,u,a,r);break;case 164:ra.pentagon_bl_lr(i,h,l,u,a,r);break;case 41:ra.pentagon_lt_tb(i,h,l,u,a,r);break;case 66:ra.pentagon_bl_tb(i,h,l,u,a,r);break;case 144:ra.pentagon_lt_rl(i,h,l,u,a,r);break;case 36:ra.pentagon_tr_bt(i, h,l,u,a,r);break;case 9:ra.pentagon_rb_lr(i,h,l,u,a,r);break;case 104:ra.pentagon_bl_tb(i,h,l,u,a,r);break;case 26:ra.pentagon_lt_rl(i,h,l,u,a,r);break;case 134:ra.pentagon_tr_bt(i,h,l,u,a,r);break;case 161:ra.pentagon_rb_lr(i, h,l,u,a,r);break;case 37:ra.hexagon_lt_tr(i,h,l,u,a,r);break;case 148:ra.hexagon_bl_lt(i,h,l,u,a,r);break;case 82:ra.hexagon_bl_rb(i,h,l,u,a,r);break;case 73:ra.hexagon_tr_rb(i,h,l,u,a,r);break;case 133:ra.hexagon_lt_tr(i, h,l,u,a,r);break;case 22:ra.hexagon_bl_lt(i,h,l,u,a,r);break;case 88:ra.hexagon_bl_rb(i,h,l,u,a,r);break;case 97:ra.hexagon_tr_rb(i,h,l,u,a,r);break;case 145:case 25:ra.hexagon_lt_rb(i,h,l,u,a,r);break; case 70:case 100:ra.hexagon_bl_tr(i,h,l,u,a,r);break;case 17:0===(o=oa(h,l,u,a,c,f))?(ra.triangle_bl(i,h,l,u,a,r),ra.triangle_tr(i,h,l,u,a,r)):ra.hexagon_lt_rb(i,h,l,u,a,r);break;case 68:0===(o=oa(h,l, u,a,c,f))?(ra.triangle_tl(i,h,l,u,a,r),ra.triangle_br(i,h,l,u,a,r)):ra.hexagon_bl_tr(i,h,l,u,a,r);break;case 153:2===(o=oa(h,l,u,a,c,f))?(ra.triangle_bl(i,h,l,u,a,r),ra.triangle_tr(i,h,l,u,a,r)):ra.hexagon_lt_rb(i, h,l,u,a,r);break;case 102:2===(o=oa(h,l,u,a,c,f))?(ra.triangle_tl(i,h,l,u,a,r),ra.triangle_br(i,h,l,u,a,r)):ra.hexagon_bl_tr(i,h,l,u,a,r);break;case 152:2===(o=oa(h,l,u,a,c,f))?(ra.triangle_tr(i,h,l,u, a,r),ra.tetragon_bl(i,h,l,u,a,r)):ra.heptagon_tr(i,h,l,u,a,r);break;case 137:2===(o=oa(h,l,u,a,c,f))?(ra.triangle_bl(i,h,l,u,a,r),ra.tetragon_tr(i,h,l,u,a,r)):ra.heptagon_bl(i,h,l,u,a,r);break;case 98:2=== (o=oa(h,l,u,a,c,f))?(ra.triangle_tl(i,h,l,u,a,r),ra.tetragon_br(i,h,l,u,a,r)):ra.heptagon_tl(i,h,l,u,a,r);break;case 38:2===(o=oa(h,l,u,a,c,f))?(ra.triangle_br(i,h,l,u,a,r),ra.tetragon_tl(i,h,l,u,a,r)): ra.heptagon_br(i,h,l,u,a,r);break;case 18:0===(o=oa(h,l,u,a,c,f))?(ra.triangle_tr(i,h,l,u,a,r),ra.tetragon_bl(i,h,l,u,a,r)):ra.heptagon_tr(i,h,l,u,a,r);break;case 33:0===(o=oa(h,l,u,a,c,f))?(ra.triangle_bl(i, h,l,u,a,r),ra.tetragon_tr(i,h,l,u,a,r)):ra.heptagon_bl(i,h,l,u,a,r);break;case 72:0===(o=oa(h,l,u,a,c,f))?(ra.triangle_tl(i,h,l,u,a,r),ra.tetragon_br(i,h,l,u,a,r)):ra.heptagon_tl(i,h,l,u,a,r);break;case 132:0=== (o=oa(h,l,u,a,c,f))?(ra.triangle_br(i,h,l,u,a,r),ra.tetragon_tl(i,h,l,u,a,r)):ra.heptagon_br(i,h,l,u,a,r);break;case 136:0===(o=oa(h,l,u,a,c,f))?(ra.tetragon_tl(i,h,l,u,a,r),ra.tetragon_br(i,h,l,u,a,r)): 1===o?ra.octagon(i,h,l,u,a,r):(ra.tetragon_bl(i,h,l,u,a,r),ra.tetragon_tr(i,h,l,u,a,r));break;case 34:0===(o=oa(h,l,u,a,c,f))?(ra.tetragon_bl(i,h,l,u,a,r),ra.tetragon_tr(i,h,l,u,a,r)):1===o?ra.octagon(i, h,l,u,a,r):(ra.tetragon_tl(i,h,l,u,a,r),ra.tetragon_br(i,h,l,u,a,r))}return i}} var aa=Object.defineProperty,ua=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,ca=function ca(t,e,n){return e in t?aa(t,e,{enumerable:!0,configurable:!0, writable:!0,value:n}):t[e]=n},fa=function fa(t,e){for(var n in e||(e={}))la.call(e,n)&&ca(t,n,e[n]); if(ua){var r,i=h(ua(e));try{for(i.s();!(r=i.n()).done;){n=r.value;ha.call(e,n)&&ca(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t}; function ga(t,e){if(!q(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var n={};at(t,function(t){var e= X(t)[1];n[e]||(n[e]=[]),n[e].push(t)}); var r=Object.keys(n).map(function(t){return n[t].sort(function(t,e){return X(t)[0]-X(e)[0]})}),i=r.sort(function(t,n){return e?X(t[0])[1]-X(n[0])[1]:X(n[0])[1]-X(t[0])[1]}); return i}(t,r),s=[],a=0;a=0&&l<=1&&(f.onLine1=!0),h>=0&&h<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])} function Na(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vt(t,function(t,n){var r=n.geometry.coordinates;return t+tt(r[0],r[1],e)},0)} function Sa(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.steps||64,s=Ma(n),a=Ma(r),u=Array.isArray(t)||"Feature"!==t.type?{}:t.properties;if(s===a)return k(Pi(t,e,i).geometry.coordinates[0], u);for(var l=s,h=s=h&&c===i.length-1);c++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[c]),k(o);a=K(i[c],i[c-1])-180,u=$(i[c],s,a,r),o.push(u.geometry.coordinates)}if(h>= n)return(s=n-h)?(a=K(i[c],i[c-1])-180,u=$(i[c],s,a,r),o.push(u.geometry.coordinates),k(o)):(o.push(i[c]),k(o));if(h>=e&&o.push(i[c]),c===i.length-1)return k(o);h+=tt(i[c],i[c+1],r)}if(h0){var a=r[e-1],u=Ra(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2=== o.length&&(s.push(n[0]),s.push(n[1]))}var l,h,c,f,g,p,v,d}),k(s,t.properties)} function Ta(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(tt(t.slice(0,2),[r,n])>=tt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]} function Aa(t,e){if(!q(e=null!=e?e:{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error("\x3cgeojson\x3e is required"); if("number"!=typeof n)throw new Error("\x3cprecision\x3e must be a number");if("number"!=typeof r)throw new Error("\x3ccoordinates\x3e must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t))); var o=Math.pow(10,n);return rt(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r1&&n.push(k(l)),b(n)} function Va(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return at(e,function(e){var i=en(e,t).properties.dist;iu?(a.unshift(t),u=e):a.push(t)}else a.push(t)}),_(a,e); default:throw new Error("geometry type "+s+" is not supported");}} function Ba(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t} function Ya(t){return N(t)} function za(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return t&&(e="Feature"===t.type?t.geometry.coordinates:t.coordinates),_(e)} function Xa(t){var e,n=0,r=h(t);try{for(r.s();!(e=r.n()).done;)n+=e.value}catch(t){r.e(t)}finally{r.f()}return n/t.length} var ja=Object.defineProperty,Ua=Object.defineProperties,Za=Object.getOwnPropertyDescriptors,Wa=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Ja=Object.prototype.propertyIsEnumerable,Qa= function Qa(t,e,n){return e in t?ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ka=function Ka(t,e){for(var n in e||(e={}))Ha.call(e,n)&&Qa(t,n,e[n]); if(Wa){var r,i=h(Wa(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Ja.call(e,n)&&Qa(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},$a=function $a(t,e){return Ua(t,Za(e))}; function tu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r=1/0,i=0;at(e,function(e, o){var s=tt(t,e,n);s2&&void 0!==arguments[2]?arguments[2]:{};if(n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)? t=y(t):"Point"===t.type?t=v(t):Z(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=k(e):"LineString"===e.type?e=v(e):Z(e,"LineString","line");var r=1/0,i=t.geometry.coordinates; return pt(e,function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],s=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=[t[0]-e[0],t[1]-e[1]],s=nu(o,i);if(s<=0)return ru(t,e,{method:r.method, units:"degrees"});var a=nu(i,i);if(a<=s)return ru(t,n,{method:r.method,units:"degrees"});var u=s/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return ru(t,l,{method:r.method,units:"degrees"})}(i,e,o,n); s0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)} function gu(t,e){return e.geometry.coordinates[0].every(function(e){return At(y(e),t)})} var pu=function(){function t(e){n(this,t),this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1} return i(t,[{key:"removeInnerEdge",value:function value(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})}}, {key:"removeOuterEdge",value:function value(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})}}, {key:"addOuterEdge",value:function value(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}}, {key:"sortOuterEdges",value:function value(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]< 0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>= 0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=fu(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]- t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}}, {key:"getOuterEdges",value:function value(){return this.sortOuterEdges(),this.outerEdges}}, {key:"getOuterEdge",value:function value(t){return this.sortOuterEdges(),this.outerEdges[t]}}, {key:"addInnerEdge",value:function value(t){this.innerEdges.push(t)}}],[{key:"buildId", value:function value(t){return t.join(",")}}]),t}(),vu=function(){function t(e,r){n(this,t),this.from=e,this.to=r,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this), this.to.addInnerEdge(this)} return i(t,[{key:"getSymetric",value:function value(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}}, {key:"deleteEdge",value:function value(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}}, {key:"isEqual",value:function value(t){return this.from.id===t.from.id&&this.to.id===t.to.id}}, {key:"toString",value:function value(){return"Edge { ".concat(this.from.id," -\x3e ").concat(this.to.id," }")}}, {key:"toLineString",value:function value(){return k([this.from.coordinates,this.to.coordinates])}}, {key:"compareTo",value:function value(t){return fu(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}(),du=function(){function t(){n(this,t),this.edges=[],this.polygon=void 0,this.envelope= void 0} return i(t,[{key:"push",value:function value(t){this.edges.push(t),this.polygon=this.envelope=void 0}}, {key:"get",value:function value(t){return this.edges[t]}}, {key:"length",get:function get(){return this.edges.length}}, {key:"forEach",value:function value(t){this.edges.forEach(t)}}, {key:"map",value:function value(t){return this.edges.map(t)}}, {key:"some",value:function value(t){return this.edges.some(t)}}, {key:"isValid",value:function value(){return!0}}, {key:"isHole",value:function value(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length, i=fu(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates); return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0}}, {key:"toMultiPoint",value:function value(){return I(this.edges.map(function(t){return t.from.coordinates}))}}, {key:"toPolygon",value:function value(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates}); return t.push(this.edges[0].from.coordinates),this.polygon=_([t])}}, {key:"getEnvelope",value:function value(){return this.envelope?this.envelope:this.envelope=Ps(this.toPolygon())}}, {key:"inside",value:function value(t){return At(t,this.toPolygon())}}],[{key:"findEdgeRingContaining", value:function value(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,a,u,l,c,f=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,a=(o=f).geometry.coordinates[0].map(function(t){return t[0]}), u=o.geometry.coordinates[0].map(function(t){return t[1]}),l=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,a)!==Math.max.apply(null, l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&gu(f,i)){var g,p,v=h(t.map(function(t){return t.from.coordinates})); try{var d=function d(){var t=p.value;e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(g=t)}; for(v.s();!(p=v.n()).done;)d()}catch(t){v.e(t)}finally{v.f()}g&&e.inside(y(g))&&(r&&!gu(n,f)||(r=e))}}),r}}]),t}(); var yu=function(){function t(){n(this,t),this.edges=[],this.nodes={}} return i(t,[{key:"getNode",value:function value(t){var e=pu.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new pu(t)),n}}, {key:"addEdge",value:function value(t,e){var n=new vu(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)}}, {key:"deleteDangles",value:function value(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})}}, {key:"_removeIfDangle",value:function value(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to}); this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}}}, {key:"deleteCutEdges",value:function value(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})}}, {key:"_computeNextCWEdges",value:function value(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0=== n?t.getOuterEdges().length:n)-1).symetric.next=e})}}, {key:"_computeNextCCWEdges",value:function value(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r= l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)}}, {key:"_findLabeledEdgeRings",value:function value(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do r.label=e,r=r.next;while(!n.isEqual(r));e++}}),t}}, {key:"getEdgeRings",value:function value(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n, e.label)})}); var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}}, {key:"_findIntersectionNodes",value:function value(t){var e=[],n=t,r=function r(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next}; do r();while(!t.isEqual(n));return e}}, {key:"_findEdgeRing",value:function value(t){var e=t,n=new du;do n.push(e),e.ring=n,e=e.next;while(!t.isEqual(e));return n}}, {key:"removeNode",value:function value(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]}}, {key:"removeEdge",value:function value(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}],[{key:"fromGeoJson", value:function value(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!== t.type)throw new Error("Invalid input type '".concat(t.type,"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature"));}(e); var n=new t;return ft(e,function(t){Z(t,"LineString","Graph::fromGeoJson"),it(t,function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e})}),n}}]),t}(); function mu(t,e){var n,r;rt(t,function(t,i,o,s,a){if(r!==a)e.push([]);else{var u=n[0],l=n[1],h=t[0],c=t[1];e[a].push([.75*u+.25*h,.75*l+.25*c]),e[a].push([.25*u+.75*h,.25*l+.75*c])}n=t,r=a},!1),e.forEach(function(t){t.push(t[0])})} function _u(t,e){var n,r,i;rt(t,function(t,o,s,a,u){if(r!==a)e.push([[]]);else if(i!==u)e[a].push([]);else{var l=n[0],h=n[1],c=t[0],f=t[1];e[a][u].push([.75*l+.25*c,.75*h+.25*f]),e[a][u].push([.25*l+.75* c,.25*h+.75*f])}n=t,r=a,i=u},!1),e.forEach(function(t){t.forEach(function(t){t.push(t[0])})})} function xu(t,e,n,r,i){for(var o=0;o0?Eu(e,s,r)<0||(r=s):n>0&&u<=0&&(ku(e,s,i)||(i=s)),n=u}return[r,i]} function ku(t,e,n){return Eu(t,e,n)>0} function Eu(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])} function bu(t){return Iu(t,"mercator",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})} function wu(t){return Iu(t,"wgs84",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})} function Iu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&V(t[0])?t="mercator"===e?Nu(t): Su(t):(!0!==r&&(t=Li(t)),rt(t,function(t){var n="mercator"===e?Nu(t):Su(t);t[0]=n[0],t[1]=n[1]})),t} function Nu(t){var e=Math.PI/180,n=6378137,r=2.0037508342789244E7,i=Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]),o=[n*i*e, n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return o[0]>r&&(o[0]=r),o[0]<-r&&(o[0]=-r),o[1]>r&&(o[1]=r),o[1]<-r&&(o[1]=-r),o} function Su(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]} var Mu=Object.freeze({__proto__:null,toMercator:bu,toWgs84:wu});var Pu={20:1.07275,15:1.13795,10:1.22385,5:1.3581,2:1.51743,1:1.62762};function Lu(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>= t[1]} function Cu(t){var e=[];return function t(n){return 0===n||1===n?1:e[n]>0?e[n]:e[n]=t(n-1)*n}(t)} function Ru(t){return Tu(t),Ou(t)} function Ou(t){return Array.isArray(t)?qu(t):t&&t.bbox?qu(t.bbox):[360*Vu(),180*Vu()]} function Tu(t){null!=t&&(Array.isArray(t)?G(t):null!=t.bbox&&G(t.bbox))} function Au(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Tu(e.bbox),null==t&&(t=1);for(var n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Tu(e.bbox),null==t&&(t=1),void 0!==e.bbox&&null!==e.bbox||(e.bbox=[-180,-90,180,90]),V(e.num_vertices)&&void 0!==e.num_vertices|| (e.num_vertices=10),V(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);var n=Math.abs(e.bbox[0]-e.bbox[2]),r=Math.abs(e.bbox[1]-e.bbox[3]),i=Math.min(n/2,r/2);if(e.max_radial_length> i)throw new Error("max_radial_length is greater than the radius of the bbox");for(var o=[e.bbox[0]+e.max_radial_length,e.bbox[1]+e.max_radial_length,e.bbox[2]-e.max_radial_length,e.bbox[3]-e.max_radial_length], s=[],u=function u(){var t,n=[],r=a(Array(e.num_vertices+1)).map(Math.random);r.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),r.forEach(function(t){t=2*t*Math.PI/r[r.length-1]; var i=Math.random();n.push([i*(e.max_radial_length||10)*Math.sin(t),i*(e.max_radial_length||10)*Math.cos(t)])}),n[n.length-1]=n[0],n=n.map((t=Ou(o),function(e){return[e[0]+t[0], e[1]+t[1]]})),s.push(_([n]))},l=0;l1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.bbox;Tu(n);var r=e.num_vertices,i=e.max_length,o=e.max_rotation; null==t&&(t=1),(!V(r)||void 0===r||r<2)&&(r=10),V(i)&&void 0!==i||(i=1E-4),V(o)&&void 0!==o||(o=Math.PI/8);for(var s=[],a=0;a0;){var l=a.pop();if(l===n)return Zu(l);l.closed=!0;for(var h=t.neighbors(l),c=0,f=h.length;c1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s} function tl(t,e,n,r,i){for(var o,s=r,a=e+1;as&&(o=a,s=u)}s>r&&(o-e>1&&tl(t,e,o,r,i),i.push(t[o]),n-o>1&&tl(t,o,n,r,i))} function el(t,e){var n=t.length-1,r=[t[0]];return tl(t,0,n,e,r),r.push(t[n]),r} function nl(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r,i,o,s,a=t[0],u=[a],l=1,h=t.length;le&&(u.push(n),a=n);return a!==n&&u.push(n),u}(t,r),t=el(t,r)} function rl(t,e,n){return t.map(function(t){if(t.length<4)throw new Error("invalid polygon");for(var r=e,i=nl(t,r,n);!il(i);)i=nl(t,r-=.01*r,n);return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]|| i.push(i[0]),i})} function il(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])} function ol(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}} Hu.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t0&&(this.content[0]=e,this.bubbleUp(0)),t}, remove:function remove(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)80*n){r=o=t[0],i=s=t[1]; for(var p=n;po&&(o=a),u>s&&(s=u);l=0!==(l=Math.max(o-r,s-i))?32767/l:0}return hl(f,g,n,r,i,l,0),g} function ul(t,e,n,r,i){var o,s;if(i===Rl(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Pl(o,t[o],t[o+1],s);return s&&bl(s,s.next)&&(Ll(s),s=s.next),s} function ll(t,e){if(!t)return t;e||(e=t);var n,r=t;do if(n=!1,r.steiner||!bl(r,r.next)&&0!==El(r.prev,r,r.next))r=r.next;else{if(Ll(r),(r=e=r.prev)===r.next)break;n=!0}while(n||r!==e);return e} function hl(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do 0===i.z&&(i.z=ml(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e, n,r,i,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t= i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(s>1)}(i)}(t,r,i,o); for(var a,u,l=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?fl(t,r,i,o):cl(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Ll(t),t=u.next,l=u.next;else if((t=u)===l){s?1===s?hl(t=gl(ll(t),e,n),e,n,r,i,o, 2):2===s&&pl(t,e,n,r,i,o):hl(ll(t),e,n,r,i,o,1);break}}} function cl(t){var e=t.prev,n=t,r=t.next;if(El(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=io?i>s?i:s:o>s?o:s,g=a>u?a>l?a:l:u>l?u:l,p=r.next;p!== e;){if(p.x>=h&&p.x<=f&&p.y>=c&&p.y<=g&&xl(i,a,o,u,s,l,p.x,p.y)&&El(p.prev,p,p.next)>=0)return!1;p=p.next}return!0} function fl(t,e,n,r){var i=t.prev,o=t,s=t.next;if(El(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,c=o.y,f=s.y,g=au?a>l?a:l:u>l?u:l,d=h>c?h>f?h:f:c>f?c: f,y=ml(g,p,e,n,r),m=ml(v,d,e,n,r),_=t.prevZ,x=t.nextZ;_&&_.z>=y&&x&&x.z<=m;){if(_.x>=g&&_.x<=v&&_.y>=p&&_.y<=d&&_!==i&&_!==s&&xl(a,h,u,c,l,f,_.x,_.y)&&El(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>= g&&x.x<=v&&x.y>=p&&x.y<=d&&x!==i&&x!==s&&xl(a,h,u,c,l,f,x.x,x.y)&&El(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=g&&_.x<=v&&_.y>=p&&_.y<=d&&_!==i&&_!==s&&xl(a,h,u,c,l,f,_.x,_.y)&&El(_.prev, _,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=m;){if(x.x>=g&&x.x<=v&&x.y>=p&&x.y<=d&&x!==i&&x!==s&&xl(a,h,u,c,l,f,x.x,x.y)&&El(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0} function gl(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!bl(i,o)&&wl(i,r,r.next,o)&&Sl(i,o)&&Sl(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Ll(r),Ll(r.next),r=t=o),r=r.next}while(r!==t);return ll(r)} function pl(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&kl(s,a)){var u=Ml(s,a);return s=ll(s,s.next),u=ll(u,u.next),hl(s,e,n,r,i,o,0),void hl(u,e,n,r,i,o,0)}a=a.next}s=s.next}while(s!== t)} function vl(t,e){return t.x-e.x} function dl(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x=r.x&&r.x>=h&&i!==r.x&&xl(o n.x||r.x===n.x&&yl(n,r)))&&(n=r,f=u)),r=r.next;while(r!==l);return n}(t,e); if(!n)return e;var r=Ml(n,t);return ll(r,r.next),ll(n,n.next)} function yl(t,e){return El(t.prev,t,e.prev)<0&&El(e.next,t,t.next)<0} function ml(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))| e<<4))|e<<2))|e<<1))<<1} function _l(t){var e=t,n=t;do(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)} function kl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&wl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&& (Sl(t,e)&&Sl(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2; do n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}(t,e)&&(El(t.prev,t,e.prev)||El(t,e.prev,e))||bl(t,e)&&El(t.prev,t,t.next)>0&&El(e.prev, e,e.next)>0)} function El(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)} function bl(t,e){return t.x===e.x&&t.y===e.y} function wl(t,e,n,r){var i=Nl(El(t,e,n)),o=Nl(El(t,e,r)),s=Nl(El(n,r,t)),a=Nl(El(n,r,e));return i!==o&&s!==a||!(0!==i||!Il(t,n,e))||!(0!==o||!Il(t,r,e))||!(0!==s||!Il(n,t,r))||!(0!==a||!Il(n,e,r))} function Il(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)} function Nl(t){return t>0?1:t<0?-1:0} function Sl(t,e){return El(t.prev,t,t.next)<0?El(t,e,t.next)>=0&&El(t,t.prev,e)>=0:El(t,e,t.prev)<0||El(t,t.next,e)<0} function Ml(t,e){var n=new Cl(t.i,t.x,t.y),r=new Cl(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r} function Pl(t,e,n,r){var i=new Cl(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i} function Ll(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)} function Cl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1} function Rl(t,e,n,r){for(var i=0,o=e,s=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}; var Ol=nn(sl.exports);function Tl(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Ol(e.vertices,e.holes,2),r=[],i=[]; n.forEach(function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}); for(var o=0;o=1||u<=0||l>=1||l<=0))){var v=p,d=!o[v];d&&(o[v]=!0),e?i.push(e(p, t,n,h,c,u,s,a,f,g,l,d)):i.push(p)}} function v(t,e){var n,i,o,s,a=r[t][e],u=r[t][e+1];return a[0]f[e.isect].coord? -1:1}); for(l=[];k.length>0;){var S=k.pop(),M=S.isect,P=S.parent,L=S.winding,C=l.length,R=[f[M].coord],O=M;if(f[M].ringAndEdge1Walkable)var T=f[M].ringAndEdge1,A=f[M].nxtIsectAlongRingAndEdge1;else T=f[M].ringAndEdge2, A=f[M].nxtIsectAlongRingAndEdge2;for(;!Yl(f[M].coord,f[A].coord);){R.push(f[A].coord);var D=void 0;for(r=0;r1)for(e=0;e= 0==e} function Bl(t){for(var e=0,n=0;n0)){if(o/=f,f<0){if(o0){if(o>c)return;o>h&&(h=o)}if(o=r-u,f||!(o<0)){if(o/= f,f<0){if(o>c)return;o>h&&(h=o)}else if(f>0){if(o0)){if(o/=g,g<0){if(o0){if(o>c)return;o>h&&(h=o)}if(o=i-l,g||!(o<0)){if(o/=g,g<0){if(o> c)return;o>h&&(h=o)}else if(g>0){if(o0||c<1)||(h>0&&(t[0]=[u+h*f,l+h*g]),c<1&&(t[1]=[u+c*f,l+c*g]),!0)}}}}} function nh(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,h=t.right,c=l[0],f=l[1],g=h[0],p=h[1],v=(c+g)/2,d=(f+p)/2;if(p===f){if(v=r)return;if(c>g){if(u){if(u[1]>=i)return}else u=[v, n];o=[v,i]}else{if(u){if(u[1]1)if(c>g){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]=-wh)){var g=u*u+l*l,p=h*h+c*c,v=(c*g-l*p)/f, d=(u*p-h*g)/f,y=ah.pop()||new uh;y.arc=t,y.site=i,y.x=v+s,y.y=(y.cy=d+a)+Math.sqrt(v*v+d*d),t.circle=y;for(var m=null,_=kh._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m= _;break}_=_.R}kh.insert(m,y),m||(sh=y)}}}} function hh(t){var e=t.circle;e&&(e.P||(sh=e.N),kh.remove(e),ah.push(e),Wl(e),t.circle=null)} var ch=[];function fh(){Wl(this),this.edge=this.site=this.circle=null} function gh(t){var e=ch.pop()||new fh;return e.site=t,e} function ph(t){hh(t),_h.remove(t),ch.push(t),Wl(t)} function vh(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];ph(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)bh)a=a.L;else{if(!((i=o-mh(a,s))>bh)){r>-bh?(e=a.P,n=a):i>-bh?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){xh[t.index]= {site:t,halfedges:[]}}(t); var u=gh(t);if(_h.insert(e,u),e||n){if(e===n)return hh(e),n=gh(e.site),_h.insert(u,n),u.edge=n.edge=Kl(e.site,u.site),lh(e),void lh(n);if(n){hh(e),hh(n);var l=e.site,h=l[0],c=l[1],f=t[0]-h,g=t[1]-c,p=n.site, v=p[0]-h,d=p[1]-c,y=2*(f*d-g*v),m=f*f+g*g,_=v*v+d*d,x=[(d*m-g*_)/y+h,(f*_-v*m)/y+c];th(n.edge,l,p,x),u.edge=Kl(l,t,null,x),n.edge=Kl(t,p,null,x),lh(e),lh(n)}else u.edge=Kl(e.site,u.site)}} function yh(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var h=a-r,c=1/o-1/l,f=h/l;return c?(-f+Math.sqrt(f*f-2*c*(h*h/ (-2*l)-u+l/2+i-o/2)))/c+r:(r+a)/2} function mh(t,e){var n=t.N;if(n)return yh(n,e);var r=t.site;return r[1]===e?r[0]:1/0} var _h,xh,kh,Eh,bh=1E-6,wh=1E-12;function Ih(t,e){return e[1]-t[1]||e[0]-t[0]} function Nh(t,e){var n,r,i,o=t.sort(Ih).pop();for(Eh=[],xh=new Array(t.length),_h=new Zl,kh=new Zl;;)if(i=sh,o&&(!i||o[1]bh||Math.abs(i[0][1]-i[1][1])>bh)||delete Eh[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l, h,c,f,g,p,v,d=xh.length,y=!0; for(i=0;ibh|| Math.abs(v-f)>bh)&&(u.splice(a,0,Eh.push($l(s,g,Math.abs(p-t)bh?[t,Math.abs(c-t)bh?[Math.abs(f-r)bh?[n,Math.abs(c-n)bh?[Math.abs(f-e)=a)return null;var u=t-i.site[0],l=e-i.site[1],h=u*u+l*l;do i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r= o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],c=u*u+l*l;c2&&void 0!==arguments[2]?arguments[2]:{},r=H(t).coordinates,i=0,o=0;o=i&& o===r.length-1);o++){if(i>=e){var s=e-i; if(s){var a=K(r[o],r[o-1])-180;return $(r[o],s,a,n)}return y(r[o])}i+=tt(r[o],r[o+1],n)}return y(r[r.length-1])},t.angle=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}; if(!q(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s= n,a=R(!0!==r.mercator?K(i,o):et(i,o)),u=R(!0!==r.mercator?K(s,o):et(s,o)),l=Math.abs(a-u);return!0===r.explementary?360-l:l},t.applyFilter=qi,t.area=kt,t.areaFactors=p,t.azimuthToBearing=O,t.bbox=Nt,t.bboxClip= function(t,e){var n=H(t),r=n.type,i="Feature"===t.type?t.properties:{},o=n.coordinates; switch(r){case "LineString":case "MultiLineString":var s=[];return"LineString"===r&&(o=[o]),o.forEach(function(t){!function(t,e,n){var r,i,o,s,a,u=t.length,l=Pt(t[0],e),h=[];for(n||(n=[]),r=1;r1&&void 0!==arguments[1]?arguments[1]: {},n=e.resolution||1E4,r=e.sharpness||.85,i=[],o=H(t).coordinates.map(function(t){return{x:t[0], y:t[1]}}),s=new Rt({duration:n, points:o,sharpness:r}),a=function a(t){var e=s.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u0;else if(n!==u>0)return!0}return!1},t.booleanContains=function(t,e){var n=H(t),r=H(e),i=n.type,o=r.type,s=n.coordinates,a=r.coordinates; switch(i){case "Point":if("Point"===o)return Gt(s,a);throw new Error("feature2 "+o+" geometry not supported");case "MultiPoint":switch(o){case "Point":return function(t,e){var n,r=!1;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:{}).precision; if("number"!=typeof(n=null==n||isNaN(n)?6:n)||!(n>=0))throw new Error("precision must be a positive number");return H(t).type===H(e).type&&me(ke(t),ke(e),{precision:n})},t.booleanIntersects=Ie,t.booleanOverlap= function(t,e){var n=H(t),r=H(e),i=n.type,o=r.type; if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type"); if("Point"===i)throw new Error("Point geometry not supported");if(me(t,e,{precision:6}))return!1;var s=0;switch(i){case "MultiPoint":for(var a=0;a0},t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required"); if(!e)throw new Error("line2 is required");if("LineString"!==hn(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==hn(e,"line2"))throw new Error("line2 must be a LineString");for(var n= je(ke(t)).features,r=je(ke(e)).features,i=0;i1;case "MultiPoint":for(var i=0;i0&&te(_([r[0]]),_([r[i]])).features.length>1)return!1}return!0;case "MultiPolygon":for(i=0;i0&&te(_([o[0]]),_([o[s]])).features.length>1)return!1}return!0;default:return!1}}, t.booleanWithin=dn,t.buffer=function(t,n,r){var i=(r=r||{}).units||"kilometers",o=r.steps||8; if(!t)throw new Error("geojson is required");if("object"!==e(r))throw new Error("options must be an object");if("number"!=typeof o)throw new Error("steps must be an number");if(void 0===n)throw new Error("radius is required"); if(o<=0)throw new Error("steps must be greater than 0");var s=[];switch(t.type){case "GeometryCollection":return ht(t,function(t){var e=Zr(t,n,i,o);e&&s.push(e)}),b(s); case "FeatureCollection":return at(t,function(t){var e=Zr(t,n,i,o);e&&at(e,function(t){t&&s.push(t)})}),b(s)}return Zr(t,n,i,o)},t.center=xn,t.centerMean=Qr,t.centerMedian=function(t){var e=arguments.length> 1&&void 0!==arguments[1]?arguments[1]:{}; if(!q(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!V(n))throw new Error("counter must be a number");var r=e.weight,i=Qr(t,{weight:e.weight}),o=b([]);at(t,function(t){var e;o.features.push(Kr(t, {properties:{weight:null==(e=t.properties)?void 0:e[r]}}))}); var s={tolerance:e.tolerance,medianCandidates:[]};return $r(i.geometry.coordinates,[0,0],o,s,n)},t.centerOfMass=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}; switch(J(e)){case "Point":return y(z(e),n.properties);case "Polygon":var r=[];rt(e,function(t){r.push(t)}); var i,o,s,a,u,l,h,c,f=Kr(e,{properties:n.properties}),g=f.geometry.coordinates,p=0,v=0,d=0,m=r.map(function(t){return[t[0]-g[0],t[1]-g[1]]}); for(i=0;i2&&void 0!==arguments[2]?arguments[2]:{}; !0!==n.mutate&&(t=Li(t));var r=n.minPoints||3,i=C(e,n.units),o=new zi(t.features.length),u=t.features.map(function(t){return!1}),l=t.features.map(function(t){return!1}),h=t.features.map(function(t){return!1}), c=t.features.map(function(t){return-1}); o.load(t.features.map(function(t,e){var n=s(t.geometry.coordinates,2),r=n[0],i=n[1];return{minX:r,minY:i,maxX:r,maxY:i,index:e}})); var f=function f(n){var r=t.features[n],a=s(r.geometry.coordinates,2),u=a[0],l=a[1],h=Math.max(l-i,-90),c=Math.min(l+i,90),f=h<0&&c>0?i:Math.abs(h)=r){var i=g;g++,u[e]=!0,function(t,e){for(var n=0;n=r&&e.push.apply(e, a(o))}l[i]||(l[i]=!0,c[i]=t)}}(i,n)}else h[e]=!0}}),t.features.forEach(function(e,n){var r=t.features[n]; r.properties||(r.properties={}),c[n]>=0?(r.properties.dbscan=h[n]?"edge":"core",r.properties.cluster=c[n]):r.properties.dbscan="noise"}),t},t.clustersKmeans=function(t){var e=arguments.length>1&&void 0!== arguments[1]?arguments[1]:{},n=t.features.length; e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=Li(t));var r=lt(t),i=r.slice(0,e.numberOfClusters),o=to(r,e.numberOfClusters, i),s={};return o.centroids.forEach(function(t,e){s[e]=t}),at(t,function(t,e){var n=o.idxs[e]; t.properties.cluster=n,t.properties.centroid=s[n]}),t},t.collect=function(t,e,n,r){var i=new eo(6),o=e.features.map(function(t){var e; return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null==(e=t.properties)?void 0:e[n]}}); return i.load(o),t.features.forEach(function(t){t.properties||(t.properties={});var e=Nt(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach(function(e){At([e.minX,e.minY],t)&&o.push(e.property)}), t.properties[r]=o}),t},t.collectionOf=W,t.combine=function(t){var e={MultiPoint:{coordinates:[], properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return at(t,function(t){var n,r,i,o;switch(null==(o=t.geometry)?void 0:o.type){case "Point":e.MultiPoint.coordinates.push(t.geometry.coordinates), e.MultiPoint.properties.push(t.properties);break;case "MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,a(t.geometry.coordinates)),e.MultiPoint.properties.push(t.properties);break;case "LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates), e.MultiLineString.properties.push(t.properties);break;case "MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,a(t.geometry.coordinates)),e.MultiLineString.properties.push(t.properties);break; case "Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case "MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,a(t.geometry.coordinates)), e.MultiPolygon.properties.push(t.properties)}}),b(Object.keys(e).filter(function(t){return e[t].coordinates.length}).sort().map(function(t){return v({type:t, coordinates:e[t].coordinates},{collectedProperties:e[t].properties})}))},t.concave=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxEdge||1/0,r=function(t){var e=[],n= {}; return at(t,function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}}),b(e)}(t),i=no(r); if(i.features=i.features.filter(function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=tt(r,i,e),a=tt(i,o,e),u=tt(r,o,e);return s<=n&&a<=n&&u<=n}), i.features.length<1)return null; var o=Co(i);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),v(o)},t.containsNumber=j,t.convertArea=F,t.convertLength=D,t.convex=Mi,t.coordAll=lt,t.coordEach=rt,t.coordReduce= it,t.createBins=Vi,t.degreesToRadians=A,t.destination=$,t.difference=function(t){var e=[]; if(ht(t,function(t){e.push(t.coordinates)}),e.length<2)throw new Error("Must have at least two features"); var n=t.features[0].properties||{},r=xs.difference.apply(xs,[e[0]].concat(a(e.slice(1))));return 0===r.length?null:1===r.length?_(r[0],n):N(r,n)},t.dissolve=function(t){var e=arguments.length>1&&void 0!== arguments[1]?arguments[1]:{}; if(!q(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;W(t,"Polygon","dissolve");var r=[];if(!n)return ks(N(xs.union.apply(null,t.features.map(function(t){return t.geometry.coordinates})))); var i={};at(t,function(t){t.properties&&(Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t))}); for(var o=Object.keys(i),s=0;s1&&void 0!==arguments[1]?arguments[1]:{},o=i.properties,s=null==(e=i.autoComplete)|| e,a=null==(n=i.orderCoords)||n; if(null!=(r=i.mutate)&&r||(t=Li(t)),"FeatureCollection"===t.type){var u=[];return t.features.forEach(function(t){u.push(X(Ga(t,{},s,a)))}),N(u,o)}return Ga(t,o,s,a)},t.mask=function(t,e,n){var r,i=null!= (r=null==n?void 0:n.mutate)&&r,o=e; e&&!1===i&&(o=Li(e));var s,a,u=za(o),l=null;return"FeatureCollection"===t.type?(a=2===(s=t).features.length?xs.union(s.features[0].geometry.coordinates,s.features[1].geometry.coordinates):xs.union.apply(xs, s.features.map(function(t){return t.geometry.coordinates})),l=Ya(a)):l="Feature"===t.type?Ya(xs.union(t.geometry.coordinates)):Ya(xs.union(t.coordinates)),l.geometry.coordinates.forEach(function(t){u.geometry.coordinates.push(t[0])}), u},t.meta=xt,t.midpoint=function(t,e){return $(t,tt(t,e)/2,K(t,e))},t.moranIndex=function(t,e){var n,r,i=e.inputField,o=e.threshold||1E5,s=e.p||2,a=null!=(n=e.binary)&&n,u=bs(t,{alpha:e.alpha||-1, binary:a,p:s,standardization:null==(r=e.standardization)||r,threshold:o}),l=[];at(t,function(t){var e=t.properties||{};l.push(e[i])}); for(var c=Xa(l),f=function(t){var e,n=Xa(t),r=0,i=h(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r+=Math.pow(o-n,2)}}catch(t){i.e(t)}finally{i.f()}return r/t.length}(l),g=0,p=0,v=0,d=0,y=u.length,m= 0;m2&&void 0!==arguments[2]?arguments[2]:{},r=n.units,i=n.properties||{},o=function(t){var e=[]; switch(t.geometry?t.geometry.type:t.type){case "GeometryCollection":return ht(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection", features:e};case "FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t; default:throw new Error("points must be a Point Collection");}}(t); if(!o.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==J(e))throw new Error("line must be a LineString");var s=1/0,a=null;return at(o, function(t){var n=eu(t,e,{units:r});n0&&(u=_(o).geometry),mu(u,a),o=a.slice(0)}r.push(_(o, i))}else{if("MultiPolygon"!==t.type)throw new Error("geometry is invalid, must be Polygon or MultiPolygon");for(var l=[[[]]],h=0;h0&&(f=N(l).geometry),_u(f,c),l=c.slice(0)}r.push(N(l, i))}}),b(r)},t.polygonTangents=function(t,e){var n,r=X(t),i=X(e),o=[],a=[],u=Nt(e),l=0,h=null; switch(r[0]>u[0]&&r[0]u[1]&&r[1]_&&(_=E)}for(var b=[],w=Object.keys(u).length,I=f/w,N=0,S=0;S<_+1;S++)N+=Math.exp(-I)*Math.pow(I,S)/Cu(S),b.push(N);for(var M=[],P=0,L=0;L<_+1;L++){for(var C= 0,R=Object.keys(u);CT&&(T=D)}var F=Pu[r]/Math.sqrt(w),V={criticalValue:F,isRandom:!0,maxAbsoluteDifference:T, observedDistribution:M};return T>F&&(V.isRandom=!1),V},t.radiansToDegrees=T,t.radiansToLength=P,t.random=Gu,t.randomLineString=Fu,t.randomPoint=Au,t.randomPolygon=Du,t.randomPosition=Ru,t.rectangleGrid= Ys,t.rewind=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}; if(!q(r=r||{}))throw new Error("options is invalid");var i=null!=(e=r.mutate)&&e,o=null!=(n=r.reverse)&&n;if(!t)throw new Error("\x3cgeojson\x3e is required");if("boolean"!=typeof o)throw new Error("\x3creverse\x3e must be a boolean"); if("boolean"!=typeof i)throw new Error("\x3cmutate\x3e must be a boolean");i||"Point"===t.type||"MultiPoint"===t.type||(t=Li(t));var s=[];switch(t.type){case "GeometryCollection":return ht(t,function(t){Bu(t, o)}),t; case "FeatureCollection":return at(t,function(t){at(Bu(t,o),function(t){s.push(t)})}),b(s)}return Bu(t,o)},t.rhumbBearing=et,t.rhumbDestination=ws,t.rhumbDistance=Is,t.round=M,t.sample=function(t,e){if(!t)throw new Error("fc is required"); if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");var n=b(function(t,e){var n,r,i=t.slice(0),o=t.length,s=o-e;for(;o-- >s;)n=i[r=Math.floor((o+ 1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e)); return n},t.sector=function(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{}; if(!q(o=o||{}))throw new Error("options is invalid");var s=o.properties;if(!t)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==i)throw new Error("bearing2 is required"); if(!n)throw new Error("radius is required");if("object"!==e(o))throw new Error("options must be an object");if(Xu(r)===Xu(i))return Pi(t,n,o);var a=X(t),u=Sa(t,n,r,i,o),l=[[a]];return rt(u,function(t){l[0].push(t)}), l[0].push(a),_(l,s)},t.segmentEach=pt,t.segmentReduce=vt,t.shortestPath=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}; if(!q(n=n||{}))throw new Error("options is invalid");var r=n.obstacles||b([]),i=n.resolution||100;if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(i&&(!V(i)||i<=0))throw new Error("options.resolution must be a number, greater than 0"); var o=z(t),a=z(e);if(t=y(o),e=y(a),"FeatureCollection"===r.type){if(0===r.features.length)return k([o,a])}else{if("Polygon"!==r.type)throw new Error("invalid obstacles");r=b([v(H(r))])}var u=r;u.features.push(t), u.features.push(e);var l=s(Nt(ju(Ct(Nt(u)),1.15)),4),h=l[0],c=l[1],f=l[2],g=l[3],p=tt([h,c],[f,c],n)/i;u.features.pop(),u.features.pop();for(var d,m,_=p/tt([h,c],[f,c],n)*(f-h),x=p/tt([h,c],[h,g],n)*(g- c),E=f-h,w=g-c,I=Math.floor(E/_),N=Math.floor(w/x),S=(E-I*_)/2,M=[],P=[],L=1/0,C=1/0,R=g-(w-N*x)/2,O=0;R>=c;){for(var T=[],A=[],D=h+S,F=0;D<=f;){var G=y([D,R]),B=Ku(G,r);T.push(B?0:1),A.push(D+"|"+R);var Y= tt(G,t);!B&&Y1&&void 0!==arguments[1]?arguments[1]:{}; if(!q(i=null!=i?i:{}))throw new Error("options is invalid");var o=null!=(e=i.tolerance)?e:1,s=null!=(n=i.highQuality)&&n,a=null!=(r=i.mutate)&&r;if(!t)throw new Error("geojson is required");if(o&&o<0)throw new Error("invalid tolerance"); return!0!==a&&(t=Li(t)),ht(t,function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;if(ke(t,{mutate:!0}),"GeometryCollection"!==r)switch(r){case "LineString":t.coordinates= nl(t.coordinates,e,n);break;case "MultiLineString":t.coordinates=t.coordinates.map(function(t){return nl(t,e,n)}); break;case "Polygon":t.coordinates=rl(t.coordinates,e,n);break;case "MultiPolygon":t.coordinates=t.coordinates.map(function(t){return rl(t,e,n)})}}(t,o,s)}),t},t.square=Ta,t.squareGrid=zs,t.standardDeviationalEllipse= function(t,e){var n; if(!q(e=e||{}))throw new Error("options is invalid");var r=e.steps||64,i=e.weight,o=e.properties||{};if(!V(r))throw new Error("steps must be a number");if(!q(o))throw new Error("properties must be a number"); var s=lt(t).length,a=Qr(t,{weight:i}),u=0,l=0,h=0;at(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=ol(X(t),X(a));u+=Math.pow(r.x,2)*n,l+=Math.pow(r.y,2)*n,h+=r.x*r.y*n}); var c=u-l,f=Math.sqrt(Math.pow(c,2)+4*Math.pow(h,2)),g=2*h,p=Math.atan((c+f)/g),v=180*p/Math.PI,d=0,y=0,m=0;at(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=ol(X(t),X(a));d+=Math.pow(r.x* Math.cos(p)-r.y*Math.sin(p),2)*n,y+=Math.pow(r.x*Math.sin(p)+r.y*Math.cos(p),2)*n,m+=n}); var _=Math.sqrt(2*d/m),x=Math.sqrt(2*y/m),k=Ss(a,_,x,{units:"degrees",angle:v,steps:r,properties:o}),E=cu(t,b([k])),w={meanCenterCoordinates:X(a),semiMajorAxis:_,semiMinorAxis:x,numberOfFeatures:s,angle:v, percentageWithinEllipse:100*lt(E).length/s};return k.properties=null!=(n=k.properties)?n:{},k.properties.standardDeviationalEllipse=w,k},t.tag=function(t,e,n,r){return t=Li(t),e=Li(e),at(t,function(t){t.properties|| (t.properties={}),at(e,function(e){t.properties&&e.properties&&void 0===t.properties[r]&&At(t,e)&&(t.properties[r]=e.properties[n])})}),t},t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&& "MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon"); var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=Tl(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(Tl(t))}),e}, t.tin=no,t.toMercator=bu,t.toWgs84=wu,t.transformRotate=Ns,t.transformScale=ju,t.transformTranslate=function(t,e,n,r){if(!q(r=r||{}))throw new Error("options is invalid"); var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number"); if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==s&&void 0!==s||(t=Li(t)),rt(t,function(t){var r=X(ws(t,e,n,{units:i})); t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}),t},t.triangleGrid=Xs,t.truncate=Aa,t.union=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[]; if(ht(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must have at least 2 geometries"); var r=xs.union.apply(xs,[n[0]].concat(a(n.slice(1))));return 0===r.length?null:1===r.length?_(r[0],e.properties):N(r,e.properties)},t.unkinkPolygon=function(t){var e=[]; return ft(t,function(t){"Polygon"===t.geometry.type&&at(Fl(t),function(n){e.push(_(n.geometry.coordinates,t.properties))})}),b(e)},t.validateBBox=G,t.validateId=B,t.voronoi=function(t,e){if(!q(e=e||{}))throw new Error("options is invalid"); var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return W(t,"Point","points"),b(function(){var t=jl,e=Ul,n=null;function r(r){return new Nh(r.map(function(n, i){var o=[Math.round(t(n,i,r)/bh)*bh,Math.round(e(n,i,r)/bh)*bh];return o.index=i,o.data=n,o}),n)} return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e? e:Xl(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:Xl(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0], +t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0, 0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0], n[1]],[n[2],n[3]]]).polygons(t.features).map(function(e,n){return Object.assign(function(t){return(t=t.slice()).push(t[0]),_([t])}(e),{properties:Ri(t.features[n].properties)})}))},Object.defineProperty(t, "__esModule",{value:!0})}); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done)resolve(value);else Promise.resolve(value).then(_next, _throw)} function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve, reject,_next,_throw,"next",value)} function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)} _next(undefined)})}} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i2&&arguments[2]!==undefined?arguments[2]:false; var $elements=this.getBlockTemplateElement(templateId);if(typeof filter==="function"){var $filteredElements=$elements.filter(filter);if(first)return $filteredElements.first();return $filteredElements}return[]}}, {key:"getApiNameByTemplateId",value:function getApiNameByTemplateId(templateId){return blockTemplateIdApiNameMapJson[templateId]||""}}, {key:"getBlockData",value:function getBlockData(blockTemplateInfo){return blockData[this.getApiNameByTemplateId(blockTemplateInfo.templateId)]===undefined?blockData["".concat(this.getApiNameByTemplateId(blockTemplateInfo.templateId), "~~").concat(blockTemplateInfo.index)]:blockData[this.getApiNameByTemplateId(blockTemplateInfo.templateId)]}}, {key:"getBlockDataByKey",value:function getBlockDataByKey(key){return blockData[key]}}, {key:"getChoiceApiUrl",value:function getChoiceApiUrl(){if(phase==="real"||phase==="staging")return"https://apis.naver.com/weather-v2/weather-v2/weather-api-v2-choice";return"https://dev.apis.naver.com/weather-v2/weather-v2/weather-api-v2-choice"}}, {key:"ajaxChoiceApiWithUrl",value:function ajaxChoiceApiWithUrl(url,choiceRequestObj,successCallback,alwaysCallback){return $.ajax({type:"GET",url:url,data:{"choiceQuery":JSON.stringify(choiceRequestObj), "hn":window.location.hostname},dataType:"json",success:function success(data){if(typeof successCallback=="function"&&data.hasOwnProperty("results")&&data.results.hasOwnProperty("choiceResult")){var result= data.results.choiceResult;successCallback(result)}else oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc5d0\ub7ec url : ".concat(url,", param : ").concat(JSON.stringify(choiceRequestObj),", response : ").concat(JSON.stringify(data)), null)}}).done(function(data){}).fail(function(jqXHR,status,error){oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc2e4\ud328 url : ".concat(url,", param : ").concat(JSON.stringify(choiceRequestObj), ", page : ").concat(menu,", status : ").concat(jqXHR.status),jqXHR)}).always(function(){if(typeof alwaysCallback=="function")alwaysCallback()})}}, {key:"ajaxChoiceApiWithCommon",value:function ajaxChoiceApiWithCommon(choiceRequestObj,commonRequestObj,successCallback,alwaysCallback){var url="/choiceApi/api";return $.ajax({type:"GET",url:url,data:{"choiceQuery":JSON.stringify(choiceRequestObj), "commonQuery":JSON.stringify(commonRequestObj)},dataType:"json",success:function success(data){if(typeof successCallback=="function"&&data.hasOwnProperty("results")&&data.results.hasOwnProperty("choiceResult")){var result= data.results.choiceResult;successCallback(result)}else oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc5d0\ub7ec url : ".concat(url,", param : ").concat(JSON.stringify(choiceRequestObj),", response : ").concat(JSON.stringify(data)), null)}}).done(function(data){}).fail(function(jqXHR,status,error){oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc2e4\ud328 url : ".concat(url,", param : ").concat(JSON.stringify(choiceRequestObj), ", page : ").concat(menu,", status : ").concat(jqXHR.status),jqXHR)}).always(function(){if(typeof alwaysCallback=="function")alwaysCallback()})}}, {key:"ajaxChoiceApi",value:function ajaxChoiceApi(choiceRequestObj,successCallback,alwaysCallback){var url="/choiceApi/api";return $.ajax({type:"GET",url:url,data:{"choiceQuery":JSON.stringify(choiceRequestObj)}, dataType:"json",success:function success(data){if(typeof successCallback=="function"&&data.hasOwnProperty("results")&&data.results.hasOwnProperty("choiceResult")){var result=data.results.choiceResult;successCallback(result)}else oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc5d0\ub7ec url : ".concat(url, ", param : ").concat(JSON.stringify(choiceRequestObj),", response : ").concat(JSON.stringify(data)),null)}}).done(function(data){}).fail(function(jqXHR,status,error){oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc2e4\ud328 url : ".concat(url, ", param : ").concat(JSON.stringify(choiceRequestObj),", page : ").concat(menu,", status : ").concat(jqXHR.status),jqXHR)}).always(function(){if(typeof alwaysCallback=="function")alwaysCallback()})}}, {key:"ajaxChoiceApiNocache",value:function ajaxChoiceApiNocache(choiceRequestObj,successCallback,alwaysCallback){return $.ajax({type:"POST",url:"/choiceApi/api/nocache",data:{"choiceQuery":JSON.stringify(choiceRequestObj)}, dataType:"json",success:function success(data){if(data.hasOwnProperty("results")&&data.results.hasOwnProperty("choiceResult")){var result=data.results.choiceResult;successCallback(result)}else oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc5d0\ub7ec ".concat(data), null)}}).done(function(data){}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("choiceApi API \ud638\ucd9c\uc2e4\ud328 ".concat(JSON.stringify(choiceRequestObj),", page : ").concat(menu),null)}).always(function(){if(typeof alwaysCallback== "function")alwaysCallback()})}}, {key:"ajaxProtoChoiceApi",value:function ajaxProtoChoiceApi(params,successCallback,alwaysCallback){var resultMessage=oCommon.fnGetProtobufMessage("Result");var xhr=new XMLHttpRequest;var url="/choiceApi/api/proto?choiceQuery\x3d".concat(encodeURIComponent(JSON.stringify(params))); xhr.open("GET",url);xhr.responseType="arraybuffer";xhr.onload=function(oEvent){if(xhr&&xhr.status===200&&xhr.response.byteLength>0){var _decodeObject$results,_decodeObject$results2,_decodeObject$results3; var buffer=new Uint8Array(xhr.response);var decodeData=resultMessage.decode(buffer);var decodeObject=resultMessage.toObject(decodeData,{defaults:true});var choiceResult=decodeObject===null||decodeObject=== void 0?void 0:(_decodeObject$results=decodeObject.results)===null||_decodeObject$results===void 0?void 0:(_decodeObject$results2=_decodeObject$results.results)===null||_decodeObject$results2===void 0?void 0: (_decodeObject$results3=_decodeObject$results2.choiceResult)===null||_decodeObject$results3===void 0?void 0:_decodeObject$results3.choiceResult;if(choiceResult)successCallback(choiceResult);else oCommon.fnSendErrorToNelo("protoChoiceApi API \ud638\ucd9c\uc5d0\ub7ec ".concat(url), null)}else oCommon.fnSendErrorToNelo("protoChoiceApi API \ud638\ucd9c\uc2e4\ud328 ".concat(url,", page : ").concat(menu,", status : ").concat(xhr.status),xhr);if(typeof alwaysCallback=="function")alwaysCallback()}; xhr.send(null)}}, {key:"getTemplateInstanceInfoList",value:function getTemplateInstanceInfoList(templateId){return this.templateInstanceInfoMap[templateId]}}, {key:"checkExistsTemplate",value:function checkExistsTemplate(templateId){var value=this.getTemplateInstanceInfoList(templateId);return value!==null&&_typeof(value)==="object"}}, {key:"checkExistsTemplateAndIndex",value:function checkExistsTemplateAndIndex(templateId,index){var value=this.getTemplateInstanceInfoList(templateId);return value!==null&&_typeof(value)==="object"&&value[index- 1]}}, {key:"getTemplateInstanceInfo",value:function getTemplateInstanceInfo(templateId,option){var result=null;if(this.checkExistsTemplate(templateId))for(var i in this.getTemplateInstanceInfoList(templateId)){var templateInstanceInfo= this.templateInstanceInfoMap[templateId][i];var templateCustomInfo=templateInstanceInfo["templateInfo"].customInfo;var isEqualOption=true;for(var optionKey in templateCustomInfo){var optionValue=templateCustomInfo[optionKey]; isEqualOption=option[optionKey]!==undefined&&option[optionKey]===optionValue}if(isEqualOption){result=templateInstanceInfo;break}}return result}}, {key:"checkExistsTemplateAndOption",value:function checkExistsTemplateAndOption(templateId,option){return this.getTemplateInstanceInfo(templateId,option)!==null}}, {key:"callAllTemplateFuncInOrder",value:function callAllTemplateFuncInOrder(funcName){var result=[];if(pageJson.pageSectionInfo!==undefined){var pageSectionInfo=pageJson.pageSectionInfo;for(var _len=arguments.length, params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];for(var i in pageSectionInfo){var pageSection=pageSectionInfo[i];for(var j in pageSection.templateInfoList){var templateInfo= pageSection.templateInfoList[j];result.push(this.callTemplateFuncWithIndex(templateInfo.templateId,templateInfo.index,funcName,params))}}}return result}}, {key:"callTemplateFuncInOrderFor",value:function callTemplateFuncInOrderFor(templateId,funcName){var result=[];if(pageJson.pageSectionInfo===undefined)return result;var pageSectionInfo=pageJson.pageSectionInfo; for(var _len2=arguments.length,params=new Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++)params[_key2-2]=arguments[_key2];for(var i in pageSectionInfo){var pageSection=pageSectionInfo[i];for(var j in pageSection.templateInfoList){var templateInfo= pageSection.templateInfoList[j];if(templateInfo.templateId!==templateId)continue;result.push(this.callTemplateFuncWithIndex.apply(this,[templateInfo.templateId,templateInfo.index,funcName].concat(params)))}}return result}}, {key:"callTemplateFunc",value:function callTemplateFunc(templateId,funcName){var result=[];if(this.checkExistsTemplate(templateId))try{var templateInstanceInfoList=this.getTemplateInstanceInfoList(templateId); for(var _len3=arguments.length,params=new Array(_len3>2?_len3-2:0),_key3=2;_key3<_len3;_key3++)params[_key3-2]=arguments[_key3];for(var i in templateInstanceInfoList){var _templateInstanceInfo;result.push((_templateInstanceInfo= templateInstanceInfoList[i]["instance"])[funcName].apply(_templateInstanceInfo,params))}}catch(e){}return result}}, {key:"callTemplateFuncWithIndex",value:function callTemplateFuncWithIndex(templateId,index,funcName){var result=null;index=index||1;if(this.checkExistsTemplateAndIndex(templateId,index))try{var _templateInstanceInfo2; var templateInstanceInfoList=this.getTemplateInstanceInfoList(templateId);for(var _len4=arguments.length,params=new Array(_len4>3?_len4-3:0),_key4=3;_key4<_len4;_key4++)params[_key4-3]=arguments[_key4]; result=(_templateInstanceInfo2=templateInstanceInfoList[index-1]["instance"])[funcName].apply(_templateInstanceInfo2,params)}catch(e){}return result}}, {key:"callTemplateFuncWithOption",value:function callTemplateFuncWithOption(templateId,option,funcName){var result=null;if(this.checkExistsTemplateAndOption(templateId,option))try{var _this$getTemplateInst; for(var _len5=arguments.length,params=new Array(_len5>3?_len5-3:0),_key5=3;_key5<_len5;_key5++)params[_key5-3]=arguments[_key5];result=(_this$getTemplateInst=this.getTemplateInstanceInfo(templateId,option)["instance"])[funcName].apply(_this$getTemplateInst, params)}catch(e){}return result}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){for(var templateId in this.templateInstanceInfoMap){var templateInstanceInfoList=this.templateInstanceInfoMap[templateId]; for(var i in templateInstanceInfoList){var templateInstanceInfo=templateInstanceInfoList[i];try{templateInstanceInfo["instance"].resizeTemplate(lastResponsiveSizeType,isChanged)}catch(e){}}}}}, {key:"addTemplateInstanceMap",value:function addTemplateInstanceMap(templateId,templateInstance,templateInfo){if(this.templateInstanceInfoMap[templateId]===undefined)this.templateInstanceInfoMap[templateId]= [];this.templateInstanceInfoMap[templateId].push({"instance":templateInstance,"templateInfo":templateInfo})}}, {key:"getTemplateId",value:function getTemplateId(templateName,index){return"".concat(templateName,"~~").concat(index)}}, {key:"setSingletonInstance",value:function setSingletonInstance(id,instance){this.singletonInstanceMap[id]=instance}}, {key:"getSingletonInstance",value:function getSingletonInstance(id){return this.singletonInstanceMap[id]}}, {key:"callSingletonFuncById",value:function callSingletonFuncById(id,funcName){var result=null;var singleton=this.getSingletonInstance(id);if(singleton)try{for(var _len6=arguments.length,params=new Array(_len6> 2?_len6-2:0),_key6=2;_key6<_len6;_key6++)params[_key6-2]=arguments[_key6];result=singleton[funcName].apply(singleton,params)}catch(e){}return result}}, {key:"getInViewportTemplateIndexByTemplateId",value:function getInViewportTemplateIndexByTemplateId(templateId){var $templateElements=this.getBlockTemplateElement(templateId);var inViewportIndices=[];$templateElements.each(function(index, el){var $element=$(el);if(oCommon.fnInViewport($element,{checkVisible:true,threshold:0}))inViewportIndices.push($element.data("template-index"))}); return inViewportIndices}}, {key:"getGnbInfoByPageId",value:function getGnbInfoByPageId(pageId){var _blockGnbJson,_blockGnbJson$gnbPage;return((_blockGnbJson=blockGnbJson)===null||_blockGnbJson===void 0?void 0:(_blockGnbJson$gnbPage= _blockGnbJson.gnbPageConfigMap)===null||_blockGnbJson$gnbPage===void 0?void 0:_blockGnbJson$gnbPage[pageId])||{}}}, {key:"normalizeGroupId",value:function normalizeGroupId(value){return String(value!==null&&value!==void 0?value:"").trim().toLowerCase()}}, {key:"getVisualMapGroupByGroupId",value:function getVisualMapGroupByGroupId(groupId,excludeInstance){var normalized=this.normalizeGroupId(groupId);var templateInstanceInfoList=this.getTemplateInstanceInfoList("visualMapGroup"); var result=null;if(!normalized||!templateInstanceInfoList)return null;for(var i in templateInstanceInfoList){var _templateInstanceInfo3,_templateInstanceInfo4;var templateInstanceInfo=templateInstanceInfoList[i]; var instance=templateInstanceInfo["instance"];if(excludeInstance&&instance===excludeInstance)continue;if(instance.isEnable===false)continue;if(this.normalizeGroupId((_templateInstanceInfo3=templateInstanceInfo["templateInfo"])=== null||_templateInstanceInfo3===void 0?void 0:(_templateInstanceInfo4=_templateInstanceInfo3.customInfo)===null||_templateInstanceInfo4===void 0?void 0:_templateInstanceInfo4.groupId)===normalized){result= instance;break}}return result}}, {key:"warnBlockConfigToNelo",value:function warnBlockConfigToNelo(prefix,message){if(phase!=="real"&&phase!=="staging")return;oCommon.fnSendWarnToNelo("[".concat(prefix,"] \ube14\ub85d \uad6c\uc131 \uacbd\uace0 - ").concat(message, ", page : ").concat(menu))}}, {key:"showPreviewConfigWarn",value:function showPreviewConfigWarn($element,prefix,message,level){if(!isBlockPreview)return;var isWarn=level!=="notice";var label=isWarn?"\ube14\ub85d \uad6c\uc131 \uacbd\uace0": "\ube14\ub85d \uad6c\uc131 \ud655\uc778";console.warn("[".concat(prefix,"] ").concat(message));var color=isWarn?"#e02020":"#e08b00";var background=isWarn?"#fff5f5":"#fffaf0";$element.before('\x3cdiv style\x3d"margin:10px 0;padding:12px;border:1px solid '.concat(color, ";background:").concat(background,";color:").concat(color,';font-size:13px;"\x3e[').concat(label,"] ").concat(message,"\x3c/div\x3e"))}}]); return BlockScriptService}(); var oBlockScriptService=new BlockScriptService;function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)return oBlockScriptService.getBlockTemplateElementWithIndex(this.templateId, this.templateInfo.index);else return oBlockScriptService.getBlockTemplateElement(this.templateId)}}, {key:"getTemplateData",value:function getTemplateData(){return oBlockScriptService.getBlockData(this.templateInfo)}}, {key:"setCookie",value:function setCookie(key,value,expiredDays){var todayDate=new Date;todayDate.setDate(todayDate.getDate()+expiredDays);this.setCooKieByDateTime(key,value,todayDate)}}, {key:"setCooKieByDateTime",value:function setCooKieByDateTime(key,value,dateTime){document.cookie="".concat(key,"\x3d").concat(btoa(encodeURIComponent(value)),";path\x3d/;expires\x3d").concat(dateTime.toUTCString(), ";")}}, {key:"getCookie",value:function getCookie(key){var value=document.cookie.match("(^|;) ?"+key+"\x3d([^;]*)(;|$)");return value?decodeURIComponent(atob(value[2])):null}}, {key:"getTemplateResponsiveSizeType",value:function getTemplateResponsiveSizeType(){return oCommon.fnGetResponsiveSizeType(this.element)}}, {key:"_normalizeValidationKeys",value:function _normalizeValidationKeys(validationKeys){if(validationKeys===null)return Object.keys(this.getValidationConfig());else if(typeof validationKeys==="string")return[validationKeys]; else return validationKeys}}, {key:"validateDataByConfig",value:function validateDataByConfig(){var validationKeys=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var dataSource=arguments.length>1&&arguments[1]!==undefined? arguments[1]:null;var validationConfig=this.getValidationConfig();if(!validationConfig||Object.keys(validationConfig).length===0)return{};var validationResults={};var targetData=dataSource||this.templateData; var keysToValidate=this._normalizeValidationKeys(validationKeys);var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=keysToValidate[Symbol.iterator](), _step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var key=_step.value;var config=validationConfig[key];if(!config)continue;if(!Array.isArray(config.fields)|| config.fields.length===0)continue;if(config.isDynamic&&dataSource===null)continue;var basicValidation=this.validateFields(config.fields,config.operator||"AND",config.minLength,targetData);var isValid=basicValidation; if(config.customValidate&&typeof config.customValidate==="function")isValid=basicValidation&&config.customValidate(targetData);validationResults[key]=isValid;if(!this.isDataValid||_typeof(this.isDataValid)!== "object")this.isDataValid={};this.isDataValid[key]=isValid}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}return validationResults}}, {key:"validateFields",value:function validateFields(fields){var _this=this;var operator=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"AND";var minLength=arguments.length>2&&arguments[2]!== undefined?arguments[2]:undefined;var dataSource=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var targetData=dataSource||this.templateData;if(minLength!==undefined){var _results=fields.map(function(field){var value= _this.getNestedValue(targetData,field);return Array.isArray(value)&&value.length>=minLength}); return operator==="OR"?_results.some(function(r){return r}):_results.every(function(r){return r})}var results=fields.map(function(field){return _this.hasNestedProperty(targetData,field)}); return operator==="OR"?results.some(function(r){return r}):results.every(function(r){return r})}}, {key:"hasNestedProperty",value:function hasNestedProperty(obj,path){if(!this._hasFieldPath(obj,path))return false;var value=this.getNestedValue(obj,path);if(value===null||value===undefined)return false; if(typeof value==="string"&&value.trim()==="")return false;if(typeof value==="number"&&isNaN(value))return false;return true}}, {key:"getNestedValue",value:function getNestedValue(obj,path){var keys=path.split(".");var current=obj;var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2= keys[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var key=_step2.value;if(key.match(/^\d+$/))key=parseInt(key);if(current==null|| current[key]===undefined)return undefined;current=current[key]}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2; }}return current}}, {key:"_hasFieldPath",value:function _hasFieldPath(obj,path){var keys=path.split(".");var current=obj;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;if(!this.isDataValid||_typeof(this.isDataValid)!=="object")return; if(Object.keys(this.isDataValid).length===0)return;var keys=this._normalizeValidationKeys(validationKeys);if(keys.length===0)return;var $targets=this.element.filter("._cnNoData").add(this.element.find("._cnNoData")); keys.forEach(function(key){var isValid=_this2.isDataValid[key];var $targetWithKey=$targets.filter('[data-validation-key\x3d"'.concat(key,'"]'));var $element=$targetWithKey.length>0?$targetWithKey:$targets.not("[data-validation-key]"); if($element.length===0)return;if(isValid===false){if(!$element.hasClass("common_nodata")){var noDataClass=_this2.getNoDataClass(key);var noDataHtml=_this2.getNoDataHtml(key);$element.addClass(noDataClass); $element.prepend(noDataHtml)}}else if(isValid===true)if($element.hasClass("common_nodata")){$element.removeClass("common_nodata");$element.find(".common_nodata_wrap").remove()}})}}, {key:"getNoDataClass",value:function getNoDataClass(validationKey){if(!this.isDataValid||_typeof(this.isDataValid)!=="object")return"";return this.isDataValid[validationKey]===false?"common_nodata":""}}, {key:"getNoDataHtml",value:function getNoDataHtml(validationKey){if(!this.isDataValid||_typeof(this.isDataValid)!=="object")return"";if(this.isDataValid[validationKey]===false)return'\n \x3cdiv class\x3d"common_nodata_wrap"\x3e\n \x3cdiv class\x3d"common_nodata_inner"\x3e\n \x3cp class\x3d"common_nodata_text"\x3e\x3ci class\x3d"ico_nodata"\x3e\x3c/i\x3e\uc77c\uc2dc\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c \x3cbr class\x3d"nodata_br"\x3e\ubd88\ub7ec\uc62c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\x3c/p\x3e\n \x3cp class\x3d"common_nodata_text type_min"\x3e\ub370\uc774\ud130\x3cbr\x3e\uc5c6\uc74c\x3c/p\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; return""}}, {key:"validateDataAndRenderNoData",value:function validateDataAndRenderNoData(validationKeys,data){this.validateDataByConfig(validationKeys,data);this.renderNoData(validationKeys)}}]); return BlockTemplate}(); function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i7&&arguments[7]!==undefined?arguments[7]: "_cnCctvArea";var lsurRgnCd=arguments.length>8?arguments[8]:undefined;_classCallCheck(this,cctvService);this.naverMap=map;this.element=element;this.isCctvEnabled=isCctvEnabled;this.clickCode=clickCode; this.fnRenderCallback=fnRenderCallback;this.initChannel=initChannel;this.fnOnCallback=fnOnCallback;this.lastResponsiveSizeType=oCommon.fnGetResponsiveSizeType().deviceType;this.cctvWapperClassName=".".concat(map? "map_panel:visible":cctvWrapperClassName);this.lsurRgnCd=lsurRgnCd;this.isBaseNearby=!this.naverMap&&!_.isEmpty(this.lsurRgnCd)&&this.lsurRgnCd.startsWith("LS");this.init()} _createClass(cctvService,[{key:"init",value:function init(){var _naver,_naver$maps;this._oReferenceCctvDataCache={};this._oReferenceCctvDataListCache=[];this._missingSourceReported={};this.attachEvent(); if(this.naverMap&&typeof((_naver=naver)===null||_naver===void 0?void 0:(_naver$maps=_naver.maps)===null||_naver$maps===void 0?void 0:_naver$maps.CctvLayer)!=="undefined")this.initWithMap()}}, {key:"initWithMap",value:function initWithMap(){var _this=this;this.oCctv=null;this._oReferenceCctvDataCache=null;this._oReferenceCctvDataListCache=null;this.renderTab();this.attachEventWithMap();if(this.fnRenderCallback!= null)this.fnRenderCallback();naver.maps.Event.addListener(this.naverMap,"init",function(){if(_this.isCctvEnabled)_this.element.find("._cnBtnCctv").trigger("click");if(_this.isCctvEnabled&&_this.initChannel!== ""&&_this.initChannel!=null)_this.fnGetCctv(_this.initChannel)})}}, {key:"initAfter",value:function initAfter(){}}, {key:"renderTab",value:function renderTab(){var html='\n \x3cbutton type\x3d"button" class\x3d"btn_pin _cnBtnCctv"\x3e\n CCTV\n \x3cspan class\x3d"blind"\x3e\ud65c\uc131\ud654\x3c/span\x3e\n \x3c/button\x3e\n '; this.element.find("._cnCctvTabArea").append(html)}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click","._cnCctvClose",$.proxy(this.fnHideCctv,this));this.element.on("click","._cnCctvSlideBtn",$.proxy(this.fnClickSelectBtn,this));$(window).resize($.proxy(_.debounce(this.onCctvResize, 200),this))}}, {key:"attachEventWithMap",value:function attachEventWithMap(){var _this=this;this.element.on("click","._cnBtnCctv",$.proxy(this.fnInitCctv,this));var geojson,features,cctvSymbols,clickedSymbol;var coordinates; this.naverMap.addListener("click",function(e){geojson=_this.naverMap.pickAll(e.coord);features=geojson.features;cctvSymbols=features.filter(function(f){return f.properties.type==="cctv"}); if(!cctvSymbols||cctvSymbols.length===0)return;if(oCommon.fnIsBlockPage())oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"cctvpylclk"));else oCommon.fnSendClick(e,"map.cctvpylclk"); clickedSymbol=cctvSymbols[0];coordinates=clickedSymbol.geometry.coordinates;try{var channel=clickedSymbol.properties.id.split(":")[1];_this.fnGetCctv(channel)}catch(e){}})}}, {key:"fnInitCctv",value:function fnInitCctv(e){if(!this.oCctv)this.oCctv=new naver.maps.CctvLayer({minZoom:5});if(this.oCctv.getMap()===null){this._oReferenceCctvDataCache={};this._oReferenceCctvDataListCache= [];this.setOnCctv();if(oCommon.fnIsBlockPage())oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"cctvon"));else oCommon.fnSendClick(e,"map.cctvon")}else{this.setOffCctv();if(oCommon.fnIsBlockPage())oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(this.clickCode,"cctvoff"));else oCommon.fnSendClick(e,"map.cctvoff")}}}, {key:"setOnCctv",value:function setOnCctv(){if(this.oCctv.getMap())this.oCctv.setMap(null);this.oCctv.setMap(this.naverMap);this.element.find("button._cnBtnCctv").addClass("on");if(this.fnOnCallback)this.fnOnCallback()}}, {key:"setOffCctv",value:function setOffCctv(){if(this.oCctv)this.oCctv.setMap(null);this.element.find("button._cnBtnCctv").removeClass("on");this.fnHideCctv()}}, {key:"getCctvInstance",value:function getCctvInstance(){return this.oCctv}}, {key:"fnGetCctv",value:function fnGetCctv(channel){var choiceQueryString={};if(this.isBaseNearby)choiceQueryString={"nearbyCctvList":{"naverRgnCd":this.lsurRgnCd}};else choiceQueryString={"cctvList":{"channel":channel}}; oBlockScriptService.ajaxChoiceApi(choiceQueryString,$.proxy(this.fnSuccessCctvList,this,channel))}}, {key:"fnSuccessCctvList",value:function fnSuccessCctvList(channel,data,textStatus,jqXHR){var _ref,_data$cctvList,_this2=this;var resultData=(_ref=(_data$cctvList=data===null||data===void 0?void 0:data.cctvList)!== null&&_data$cctvList!==void 0?_data$cctvList:data===null||data===void 0?void 0:data.nearbyCctvList)!==null&&_ref!==void 0?_ref:{};if(!_.isEmpty(resultData)){var cctvList=resultData.message.result.cctvList; if(cctvList.length===0){this.fnDrawEmptyCctvPlayer();return}cctvList.forEach(function(cctv){if(typeof _this2._oReferenceCctvDataCache[cctv.channel]=="undefined")_this2._oReferenceCctvDataCache[cctv.channel]= {};_this2._oReferenceCctvDataCache[cctv.channel]=cctv;if(!_this2._oReferenceCctvDataListCache.some(function(item){return item.channel===cctv.channel}))_this2._oReferenceCctvDataListCache.push(cctv)}); this.fnDrawCctvPlayer(channel,true)}else this.fnDrawEmptyCctvPlayer()}}, {key:"fnClickSelectBtn",value:function fnClickSelectBtn(event){var _this3=this;if(oCommon.fnIsBlockPage())oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(this.clickCode,"cctvpyprnx"));else oCommon.fnSendClick(event, "map.cctvpyprnx");var channel=this.element.find("._cnCctvNow").data("channel");var selectedChannel=this._oReferenceCctvDataCache[channel];var selectedGroup=selectedChannel.cctvGrpNo;var selectedIndex=selectedChannel.cctvGrpInSeq; if($(event.currentTarget).hasClass("_cnCctvNext")){var nextCctv;if(this.isBaseNearby){var idx=this._oReferenceCctvDataListCache.findIndex(function(cctv){return cctv.channel===selectedChannel.channel}); nextCctv=idx>=0&&idx=nextIndex})}if(nextCctv)this.fnDrawCctvPlayer(nextCctv.channel); else this.fnHideCctv()}else{var prevCctv;if(this.isBaseNearby){var _idx=this._oReferenceCctvDataListCache.findIndex(function(cctv){return cctv.channel===selectedChannel.channel}); prevCctv=_idx>0?this._oReferenceCctvDataListCache[_idx-1]:undefined}else(function(){var prevIndex=selectedIndex-1;while(prevCctv===undefined&&prevIndex>0){prevCctv=Object.values(_this3._oReferenceCctvDataCache).filter(function(cctv){return cctv.cctvGrpNo=== selectedGroup&&cctv.cctvGrpInSeq===prevIndex})[0]; prevIndex--}})(); if(prevCctv)this.fnDrawCctvPlayer(prevCctv.channel);else this.fnHideCctv()}}}, {key:"fnDrawEmptyCctvPlayer",value:function fnDrawEmptyCctvPlayer(){var elContent='\n \x3cdiv class\x3d"cctv_link_layer on _cnCctvLayer"\x3e\n \x3cdiv class\x3d"cctv_layer_inner"\x3e\n \x3cstrong class\x3d"cctv_layer_title"\x3e\n \x3cem class\x3d"cctv_layer_emphasis type_vod _cnCctvBadge"\x3eVOD\x3c/em\x3e\n \x3c/strong\x3e\n \x3cdiv class\x3d"cctv_layer_offer"\x3e\n \x3cp class\x3d"cctv_offer_text"\x3e\n \x3cem class\x3d"cctv_text_emphasis"\x3e\uacbd\ucc30\uccad (UTIC) \uc81c\uacf5\x3c/em\x3e\n \uc2e4\uc81c\uc0c1\ud669\uacfc 5\ubd84-10\ubd84 \uc815\ub3c4 \ucc28\uc774\uac00 \ub0a0 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"cctv_layer_contents"\x3e\n \x3cdiv class\x3d"cctv_layer_video _cnCctvVideoLayer none"\x3e\n \x3cdiv class\x3d"cctv_video_empty"\x3e\n \x3cp class\x3d"cctv_empty_text"\x3e\n \ud604\uc7ac \ud574\ub2f9 \uc9c0\uc810\uc758 CCTV\uc601\uc0c1\uc744\x3cbr\x3e\n \ud655\uc778\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"cctv_layer_slide scroll_control "\x3e\n \x3cdiv class\x3d"cctv_slide_inner"\x3e\n \x3cdiv class\x3d"cctv_slide_list"\x3e\n \x3cdiv class\x3d"cctv_slide_item"\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_item_button _cnCctvSlideBtn _cnCctvPrev thumb_ready" aria-pressed\x3d"false" disabled\x3d""\x3e\x3cspan class\x3d"blind"\x3e\uc774\ubbf8\uc9c0 \uc900\ube44 \uc911\x3c/span\x3e\n \x3cimg src\x3d"" onerror\x3d"oCommon.thumbReady(this);" alt\x3d"\uad6c\uac04\uc5c6\uc74c" class\x3d"cctv_button_image"\x3e\n \x3cspan class\x3d"cctv_button_text"\x3e\uad6c\uac04\uc5c6\uc74c\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"cctv_slide_item _cnCctvNow" data-channel\x3d""\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_item_button _cnCctvSlideBtn _cnCctvPrev thumb_ready" aria-pressed\x3d"false" disabled\x3d""\x3e\x3cspan class\x3d"blind"\x3e\uc774\ubbf8\uc9c0 \uc900\ube44 \uc911\x3c/span\x3e\n \x3cimg src\x3d"" onerror\x3d"oCommon.thumbReady(this);" alt\x3d"\uad6c\uac04\uc5c6\uc74c" class\x3d"cctv_button_image"\x3e\n \x3cspan class\x3d"cctv_button_text"\x3e\uad6c\uac04\uc5c6\uc74c\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"cctv_slide_item"\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_item_button _cnCctvSlideBtn _cnCctvNext thumb_ready" aria-pressed\x3d"false" disabled\x3d""\x3e\x3cspan class\x3d"blind"\x3e\uc774\ubbf8\uc9c0 \uc900\ube44 \uc911\x3c/span\x3e\n \x3cimg src\x3d"" onerror\x3d"oCommon.thumbReady(this);" alt\x3d"\uad6c\uac04\uc5c6\uc74c" class\x3d"cctv_button_image"\x3e\n \x3cspan class\x3d"cctv_button_text"\x3e\uad6c\uac04\uc5c6\uc74c\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \n \x3cbutton type\x3d"button" class\x3d"cctv_slide_button type_prev _cnCctvSlideBtn _cnCctvPrev" disabled\x3d""\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_slide_button type_next _cnCctvSlideBtn _cnCctvNext" disabled\x3d""\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_layer_button type_close _cnCctvClose"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; this.fnHideCctv(undefined,false);oCommon.fnCloseAllVerticalLayers();if(document.pictureInPictureElement)document.exitPictureInPicture();if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")this.fnDisableScroll(); this.element.find(this.cctvWapperClassName).append(elContent)}}, {key:"fnDrawCctvPlayer",value:function fnDrawCctvPlayer(channel){var closeOtherLayer=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var templateName="_idCctvTemplate";var oTemplate=Handlebars.getTemplateSync(templateName); var data={"selectedChannel":this._oReferenceCctvDataCache[channel],"cctvDataCache":this.isBaseNearby?this._oReferenceCctvDataListCache:this._oReferenceCctvDataCache};if(_.isEmpty(data.selectedChannel)){this.fnDrawEmptyCctvPlayer(); return}if(oCommon.fnIsBlockPage()){data["blockPageNameEn"]=blockPageNameEn;data["clickCode"]=this.clickCode}var elContent=oTemplate(data);this.fnHideCctv(undefined,false);if(closeOtherLayer)oCommon.fnCloseAllVerticalLayers(); if(document.pictureInPictureElement)document.exitPictureInPicture();if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")this.fnDisableScroll();if(this.naverMap)this.fnDrawCctvPlayerOnMap(channel,elContent); else this.element.find(this.cctvWapperClassName).append(elContent);var _this=this;if(typeof Hls=="undefined")oCommon.fnCachedScript("https://cdn.jsdelivr.net/npm/hls.js@1.2.1/dist/hls.min.js").done(function(){_this.fnCctvPlay(channel)}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[weather_map HLS JS] script \ud638\ucd9c \uc2e4\ud328", jqXHR)}); else _this.fnCctvPlay(channel)}}, {key:"fnDrawCctvPlayerOnMap",value:function fnDrawCctvPlayerOnMap(channel,elContent){var latitude=this._oReferenceCctvDataCache[channel].y;var longitude=this._oReferenceCctvDataCache[channel].x;if(oCommon.fnGetResponsiveSizeType().deviceType=== "Pc")this.naverMap.morph(new naver.maps.LatLng(latitude,longitude));oBlockScriptService.callTemplateFunc("visualMap","hideFloatingMarker");this.element.find(this.cctvWapperClassName).append(elContent)}}, {key:"fnCctvPlay",value:function fnCctvPlay(channel){var _this$_oReferenceCctv;var _this=this;var elWrapper=this.element.find("._cnCctvLayer");var elVideo=this.element.find("video").get(0);var cctv=(_this$_oReferenceCctv= this._oReferenceCctvDataCache)===null||_this$_oReferenceCctv===void 0?void 0:_this$_oReferenceCctv[channel];var source=cctvService.resolveVideoSource(cctv,Hls.isSupported()&&!isMsie);if(source.type==="live"){this.hls= new Hls;this.hls.loadSource(source.src);this.hls.attachMedia(elVideo)}else if(source.type==="vod")elVideo.src=source.src;else{this.element.find("._cnCctvVideoLayer").addClass("none");if(source.missing&& !this._missingSourceReported[cctv.channel]){this._missingSourceReported[cctv.channel]=true;oCommon.fnSendWarnToNelo("[cctvService] CCTV \uc601\uc0c1 \uc8fc\uc18c \ub204\ub77d channel\x3d".concat(cctv.channel, " live\x3d").concat(cctv.liveAvailable," vod\x3d").concat(cctv.vodAvailable))}}elVideo.addEventListener("error",function(){_this.element.find("._cnCctvVideoLayer").addClass("none")}); elVideo.addEventListener("loadeddata",function(){elVideo.play()}); elVideo.addEventListener("canplay",function(){elVideo.play()}); elVideo.addEventListener("enterpictureinpicture",function(){_this.fnEnableScroll();elWrapper.hide();if(_this.naverMap)_this.fnHideCctvOnMap()},{once:true}); var hls=this.hls;elVideo.addEventListener("leavepictureinpicture",function(){var _hls$destroy;hls===null||hls===void 0?void 0:(_hls$destroy=hls.destroy)===null||_hls$destroy===void 0?void 0:_hls$destroy.call(hls); elWrapper.remove()},{once:true}); var isPaused=false;elVideo.addEventListener("timeupdate",function(event){var time=elVideo.currentTime.toFixed();if(time>0&&time%60===0){if(!isPaused){elVideo.pause();isPaused=true;if(confirm("\uc774 \uc9c0\uc810\uc758 CCTV \uc601\uc0c1\uc744 \uacc4\uc18d \ud655\uc778\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?")){if(oCommon.fnIsBlockPage())oCommon.fnSendClick(event, "".concat(blockPageNameEn,".").concat(_this.clickCode,"cctvmore"));else oCommon.fnSendClick(event,"map.cctvmore");elVideo.play()}else _this.fnHideCctv()}}else isPaused=false})}}, {key:"fnHideCctv",value:function fnHideCctv(){var _e$stopPropagation,_this4=this;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:undefined;var scroll=arguments.length>1&&arguments[1]!== undefined?arguments[1]:true;e===null||e===void 0?void 0:(_e$stopPropagation=e.stopPropagation)===null||_e$stopPropagation===void 0?void 0:_e$stopPropagation.call(e);if(this.hls)this.hls.destroy();if(scroll)setTimeout(function(){return _this4.fnEnableScroll()}, 300); this.element.find("._cnCctvLayer").remove();if(this.naverMap)this.fnHideCctvOnMap()}}, {key:"fnHideCctvOnMap",value:function fnHideCctvOnMap(){if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc"){var templateIndex=this.element.data("templateIndex");oBlockScriptService.callTemplateFuncWithIndex("visualMap", templateIndex,"overlayWeatherLayer")}oBlockScriptService.callTemplateFunc("visualMap","renderFloatingMarker")}}, {key:"disableCctvLayer",value:function disableCctvLayer(targetInstance){if(targetInstance){if(this.element===targetInstance.element)if(this.naverMap.cctvLayer!==undefined&&this.naverMap.cctvLayer!==null)this.naverMap.cctvLayer.setMap(null)}else if(this.naverMap.cctvLayer!== undefined&&this.naverMap.cctvLayer!==null)this.naverMap.cctvLayer.setMap(null);this.fnHideCctv()}}, {key:"onCctvResize",value:function onCctvResize(){if(this.element.find("._cnCctvLayer:visible").length)if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.fnEnableScroll();else this.fnDisableScroll()}}, {key:"fnDisableScroll",value:function fnDisableScroll(){var _this$naverMap,_this$naverMap$autoRe;$("body").addClass("_cnNotScrollCctv");(_this$naverMap=this.naverMap)===null||_this$naverMap===void 0?void 0: (_this$naverMap$autoRe=_this$naverMap.autoResize)===null||_this$naverMap$autoRe===void 0?void 0:_this$naverMap$autoRe.call(_this$naverMap)}}, {key:"fnEnableScroll",value:function fnEnableScroll(){var _this$naverMap2,_this$naverMap2$autoR;$("body").removeClass("_cnNotScrollCctv");(_this$naverMap2=this.naverMap)===null||_this$naverMap2===void 0? void 0:(_this$naverMap2$autoR=_this$naverMap2.autoResize)===null||_this$naverMap2$autoR===void 0?void 0:_this$naverMap2$autoR.call(_this$naverMap2)}}],[{key:"resolveVideoSource", value:function resolveVideoSource(cctv,hlsSupported){cctv=cctv||{};if(cctv.liveAvailable&&cctv.hlsUrl&&hlsSupported)return{type:"live",src:cctv.hlsUrl};if(cctv.vodAvailable&&cctv.vodUrl)return{type:"vod", src:cctv.vodUrl};return{type:"none",missing:Boolean(cctv.liveAvailable&&!cctv.hlsUrl||cctv.vodAvailable&&!cctv.vodUrl)}}}]); return cctvService}(); var oRainColorGuideMap={"51,51,52":"110~","49,50,56":"109","46,48,60":"108","44,46,65":"107","41,44,69":"106","39,42,73":"105","36,40,78":"104","34,38,82":"103","31,36,87":"102","29,34,91":"101","26,32,95":"100", "23,31,100":"99","21,29,104":"98","18,27,108":"97","16,25,113":"96","13,23,117":"95","11,21,121":"94","8,19,126":"93","6,17,130":"92","3,15,134":"91","0,13,138":"90","9,21,142":"89","16,27,145":"88","24,34,149":"87", "31,41,152":"86","39,47,155":"85","46,54,159":"84","54,61,162":"83","62,67,165":"82","69,74,168":"81","76,80,171":"80","87,91,177":"79","98,101,181":"78","108,111,186":"77","118,121,191":"76","129,132,196":"75", "139,142,201":"74","149,152,205":"73","159,162,210":"72","170,172,215":"71","179,181,219":"70","175,167,220":"69","170,152,220":"68","166,138,220":"67","161,124,220":"66","156,109,220":"65","152,95,220":"64", "147,81,220":"63","143,67,220":"62","138,52,220":"61","133,38,219":"60","137,41,222":"59","140,43,225":"58","143,46,228":"57","146,48,230":"56","149,51,233":"55","152,53,236":"54","155,55,239":"53","158,58,241":"52", "161,60,244":"51","163,62,246":"50","166,68,247":"49","168,73,247":"48","171,78,247":"47","173,84,247":"46","176,89,247":"45","178,94,247":"44","180,99,247":"43","183,104,247":"42","185,110,247":"41","187,114,247":"40", "190,121,248":"39","193,127,248":"38","196,132,248":"37","199,138,249":"36","202,144,249":"35","204,150,249":"34","207,156,250":"33","210,162,250":"32","213,168,250":"31","215,173,250":"30","205,144,202":"29", "194,115,155":"28","184,88,110":"27","173,60,65":"26","163,33,21":"25","169,35,23":"24","175,36,24":"23","181,38,25":"22","186,39,26":"21","191,40,27":"20","200,47,30":"19","208,53,32":"18","216,59,34":"17", "225,66,36":"16","232,71,38":"15","233,80,40":"14","234,88,42":"13","234,96,43":"12","235,104,45":"11","235,111,46":"10","198,170,57":"9","217,186,63":"8","241,206,70":"7","249,220,81":"6","250,225,77":"5", "39,88,21":"4","65,137,38":"3","90,186,55":"2","123,250,77":"1","102,212,110":"0.9","80,174,141":"0.8","58,135,173":"0.7","37,97,204":"0.6","15,59,235":"0.5","30,84,236":"0.4","44,108,237":"0.3","58,131,238":"0.2", "71,154,238":"0.1","95,198,250":"~0.1","0,0,0":"0"}; var oPm10ColorGuideMap={"41,12,4":"2001~","46,11,3":"1801~","51,10,3":"1601~","56,9,3":"1401~","61,8,2":"1201~","66,7,2":"1001~","71,6,2":"801~","76,5,1":"701~","81,4,1":"601~","86,3,1":"501~","90,3,0":"401~", "95,2,0":"321~","99,1,1":"320","100,1,1":"319","101,1,1":"318","102,1,1":"317","103,1,1":"316","104,1,1":"315","105,1,1":"314","105,1,0":"313","106,1,0":"312","107,1,0":"311","108,1,0":"310","109,1,0":"309", "110,1,0":"308","111,1,0":"307","112,1,0":"306","113,1,0":"305","114,1,0":"304","115,1,0":"303","116,1,0":"302","117,1,0":"301","118,1,0":"300","119,1,0":"299","120,1,0":"298","121,1,0":"297","122,1,0":"296", "123,1,0":"295","124,1,0":"294","125,1,0":"293","126,1,0":"292","127,1,0":"291","128,1,0":"290","129,1,0":"289","130,1,0":"288","131,1,0":"287","132,1,0":"286","133,1,0":"285","134,1,0":"284","135,1,0":"283", "136,1,0":"282","137,1,0":"281","138,1,0":"280","139,1,1":"279","140,1,1":"278","141,1,1":"277","142,1,1":"276","143,1,1":"275","144,1,1":"274","145,1,1":"273","146,1,1":"272","147,1,1":"271","148,1,1":"270", "149,1,1":"269","150,1,1":"268","151,1,1":"267","152,1,1":"266","153,1,1":"265","154,1,1":"264","155,1,1":"263","156,1,1":"262","157,1,1":"261","158,1,1":"260","159,1,1":"259","160,1,1":"258","161,1,1":"257", "162,1,1":"256","163,1,1":"255","164,1,1":"254","165,1,1":"253","166,1,1":"252","167,1,1":"251","168,1,1":"250","169,1,1":"249","170,1,1":"248","171,1,1":"247","172,1,1":"246","173,1,1":"245","174,1,1":"244", "175,1,1":"243","176,1,1":"242","177,1,1":"241","178,1,1":"240","179,1,1":"239","180,1,1":"238","181,1,1":"237","182,1,1":"236","183,1,1":"235","184,1,1":"234","185,1,1":"233","186,1,1":"232","187,1,1":"231", "188,1,1":"230","190,1,1":"229","191,1,1":"228","192,1,1":"227","193,1,1":"226","195,1,1":"225","196,1,1":"224","198,1,1":"223","199,1,1":"222","200,1,1":"221","202,1,1":"220","203,1,1":"219","204,1,1":"218", "206,1,1":"217","207,1,1":"216","209,1,1":"215","210,1,1":"214","212,1,1":"213","213,1,1":"212","214,1,1":"211","215,1,1":"210","217,1,1":"209","218,1,1":"208","220,1,1":"207","221,1,1":"206","222,1,1":"205", "223,1,1":"204","225,1,1":"203","226,1,1":"202","228,1,1":"201","229,1,1":"200","229,3,1":"199","230,5,1":"198","230,7,1":"197","230,9,1":"196","231,11,1":"195","231,13,1":"194","231,15,1":"193","232,17,1":"192", "232,19,1":"191","233,21,1":"190","233,24,1":"189","233,26,1":"188","234,28,1":"187","234,30,1":"186","235,32,1":"185","235,34,1":"184","235,36,1":"183","236,38,1":"182","236,40,1":"181","236,42,1":"180", "237,44,1":"179","237,46,1":"178","238,48,1":"177","238,50,1":"176","238,52,1":"175","239,54,1":"174","239,56,1":"173","240,58,1":"172","240,61,1":"171","240,63,1":"170","241,65,1":"169","241,67,1":"168", "241,69,1":"167","242,71,1":"166","242,73,1":"165","243,75,1":"164","243,77,1":"163","243,79,1":"162","244,81,1":"161","244,83,1":"160","244,85,1":"159","245,87,1":"158","245,89,1":"157","246,91,1":"156", "246,93,1":"155","246,95,1":"154","247,97,1":"153","247,99,1":"152","248,101,1":"151","248,103,1":"150","248,105,1":"149","248,107,1":"148","247,109,1":"147","247,111,1":"146","247,113,1":"145","247,116,1":"144", "247,118,1":"143","247,120,1":"142","247,122,1":"141","247,124,1":"140","247,126,1":"139","247,128,1":"138","246,130,1":"137","246,132,1":"136","246,134,1":"135","246,137,1":"134","246,139,1":"133","246,141,1":"132", "246,143,1":"131","246,145,1":"130","246,147,1":"129","245,149,1":"128","245,151,1":"127","245,154,1":"126","245,156,1":"125","245,158,1":"124","245,160,1":"123","245,162,1":"122","245,164,1":"121","245,166,1":"120", "244,168,1":"119","244,170,1":"118","244,172,1":"117","244,175,1":"116","244,177,1":"115","244,179,1":"114","244,181,1":"113","244,183,1":"112","244,185,1":"111","243,187,1":"110","243,189,1":"109","243,191,1":"108", "243,193,1":"107","243,196,1":"106","243,198,1":"105","243,200,1":"104","243,202,1":"103","243,204,1":"102","243,206,1":"101","242,208,1":"100","242,211,1":"99","242,213,1":"98","242,215,1":"97","242,217,1":"96", "242,219,1":"95","242,221,1":"94","242,223,1":"93","242,225,1":"92","241,227,1":"91","241,229,1":"90","241,232,1":"89","241,234,1":"88","241,236,1":"87","241,238,1":"86","240,239,1":"85","228,236,1":"84", "216,233,1":"83","204,230,1":"82","192,227,1":"81","180,223,1":"80","168,220,1":"79","156,217,1":"78","144,214,1":"77","132,210,1":"76","120,207,1":"75","108,204,1":"74","96,200,1":"73","84,197,1":"72", "72,194,1":"71","60,191,1":"70","48,188,1":"69","36,184,1":"68","24,181,1":"67","12,178,1":"66","1,175,1":"65","2,174,8":"64","4,173,15":"63","5,173,22":"62","7,172,29":"61","8,171,36":"60","10,171,43":"59", "11,170,50":"58","13,169,57":"57","14,169,65":"56","16,168,72":"55","17,167,79":"54","19,167,86":"53","20,166,93":"52","22,165,100":"51","23,165,107":"50","25,164,114":"49","26,164,121":"48","28,163,128":"47", "29,162,135":"46","31,162,142":"45","32,161,149":"44","34,160,156":"43","35,160,163":"42","37,159,170":"41","38,158,177":"40","40,158,184":"39","41,157,191":"38","43,156,198":"37","44,156,205":"36","46,155,212":"35", "47,154,219":"34","48,154,226":"33","50,153,233":"32","51,152,240":"31","53,152,247":"30","56,154,246":"29","60,155,245":"28","63,157,245":"27","66,158,244":"26","70,160,244":"25","73,162,243":"24","76,163,242":"23", "79,165,242":"22","83,167,241":"21","86,168,240":"20","89,170,240":"19","93,171,239":"18","96,173,238":"17","99,175,238":"16","103,176,237":"15","106,178,237":"14","109,180,236":"13","112,181,235":"12", "116,183,235":"11","119,185,234":"10","122,186,233":"9","126,188,233":"8","129,189,232":"7","132,191,232":"6","135,193,231":"5","139,194,230":"4","142,196,230":"3","145,198,229":"2","149,199,228":"1","150,202,232":"0", "0,0,0":"0"}; var oPm25ColorGuideMap={"100,1,1":"200~","102,1,1":"199","103,1,1":"198","105,1,0":"197","107,1,0":"196","108,1,0":"195","110,1,0":"194","112,1,0":"193","114,1,0":"192","115,1,0":"191","117,1,0":"190","119,1,0":"189", "120,1,0":"188","122,1,0":"187","124,1,0":"186","125,1,0":"185","128,1,0":"184","129,1,0":"183","130,1,0":"182","132,1,0":"181","134,1,0":"180","136,1,0":"179","137,1,0":"178","139,1,0":"177","141,1,0":"176", "142,1,0":"175","144,1,0":"174","146,1,1":"173","148,1,1":"172","149,1,1":"171","151,1,1":"170","153,1,1":"169","154,1,1":"168","156,1,1":"167","158,1,1":"166","159,1,1":"165","161,1,1":"164","163,1,1":"163", "164,1,1":"162","166,1,1":"161","168,1,1":"160","169,1,1":"159","171,1,1":"158","172,1,1":"157","174,1,1":"156","176,1,1":"155","177,1,1":"154","179,1,1":"153","180,1,1":"152","182,1,1":"151","183,1,1":"150", "185,1,1":"149","186,1,1":"148","188,1,1":"147","189,1,1":"146","191,1,1":"145","192,1,1":"144","194,1,1":"143","195,1,1":"142","197,1,1":"141","198,1,1":"140","200,1,1":"139","201,1,1":"138","203,1,1":"137", "205,1,1":"136","206,1,1":"135","208,1,1":"134","209,1,1":"133","211,1,1":"132","212,1,1":"131","214,1,1":"130","215,1,1":"129","217,1,1":"128","218,1,1":"127","220,1,1":"126","221,1,1":"125","223,1,1":"124", "224,1,1":"123","226,1,1":"122","227,1,1":"121","229,1,1":"120","229,3,1":"119","230,5,1":"118","230,7,1":"117","230,9,1":"116","231,12,1":"115","231,14,1":"114","232,16,1":"113","232,18,1":"112","232,20,1":"111", "233,22,1":"110","233,24,1":"109","234,26,1":"108","234,28,1":"107","234,31,1":"106","235,33,1":"105","235,35,1":"104","236,37,1":"103","236,39,1":"102","236,41,1":"101","237,43,1":"100","237,45,1":"99", "238,47,1":"98","238,50,1":"97","238,52,1":"96","239,54,1":"95","239,56,1":"94","240,58,1":"93","240,60,1":"92","240,62,1":"91","241,64,1":"90","241,66,1":"89","242,69,1":"88","242,71,1":"87","243,73,1":"86", "243,75,1":"85","243,77,1":"84","244,79,1":"83","244,81,1":"82","245,83,1":"81","245,85,1":"80","245,89,1":"79","245,92,1":"78","245,96,1":"77","244,99,1":"76","244,103,1":"75","244,107,1":"74","244,110,1":"73", "244,114,1":"72","244,117,1":"71","244,121,1":"70","244,125,1":"69","244,128,1":"68","244,132,1":"67","243,136,1":"66","243,139,1":"65","243,143,1":"64","243,146,1":"63","243,150,1":"62","243,154,1":"61", "243,157,1":"60","243,161,1":"59","243,164,1":"58","243,168,1":"57","243,172,1":"56","242,175,1":"55","242,179,1":"54","242,182,1":"53","242,186,1":"52","242,190,1":"51","242,193,1":"50","242,197,1":"49", "242,200,1":"48","242,204,1":"47","242,208,1":"46","242,211,1":"45","241,215,1":"44","241,219,1":"43","241,222,1":"42","241,226,1":"41","241,229,1":"40","241,233,1":"39","241,237,1":"38","240,240,1":"37", "204,230,1":"36","169,220,1":"35","135,211,1":"34","100,202,1":"33","66,192,1":"32","32,183,1":"31","1,175,1":"30","5,173,19":"29","8,172,35":"28","12,170,52":"27","15,168,68":"26","18,167,84":"25","22,165,101":"24", "25,164,117":"23","29,162,134":"22","32,161,150":"21","36,159,166":"20","39,158,183":"19","43,156,199":"18","46,155,216":"17","50,153,232":"16","54,152,247":"15","60,155,245":"14","66,158,244":"13","73,162,243":"12", "80,165,242":"11","86,168,240":"10","93,172,239":"9","100,175,238":"8","106,178,237":"7","113,181,235":"6","119,185,234":"5","126,188,233":"4","132,191,231":"3","139,195,230":"2","146,198,229":"1","150,202,232":"0", "0,0,0":"0"};function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=0)this.openBottomSheet(index)}}this.initEqkCardScroll()}}, {key:"drawEqkPolygon",value:function drawEqkPolygon(intensityData){var _this4=this;if(!this.naverMap||!this.selectedEqk)return;if(_.isEmpty(intensityData)){this.clearEqkPolygon();return}var features=intensityData.filter(function(item){return item.polygon&& item.naverRgnCd}).flatMap(function(item){var _item$polygon; return(((_item$polygon=item.polygon)===null||_item$polygon===void 0?void 0:_item$polygon.features)||[]).map(function(f){return{type:"Feature",properties:{naverRgnCd:item.naverRgnCd,mmi:item.mmi,sidoNm:item.sidoNm|| "",sigunguNm:item.sigunguNm||""},geometry:_this4.polygonService.removeInvalidHoles(f.geometry)}})}); if(_.isEmpty(features)){this.clearEqkPolygon();return}var featureCollection={type:"FeatureCollection",features:features};this.polygonLayer.clearRegionStyles();if(this.polygonLayer.isDrawn())this.polygonLayer.setData(featureCollection); else this.polygonLayer.draw(featureCollection);intensityData.forEach(function(item){var style=_this4.getEqkPolygonStyle(item.mmi);if(!item.naverRgnCd||!style.visible)return;_this4.polygonLayer.setRegionStyle(item.naverRgnCd, style)})}}, {key:"getEqkPolygonStyle",value:function getEqkPolygonStyle(mmi){var colorInfo=this.mmiColorMap[mmi];if(!colorInfo)return{visible:false};return{fillColor:colorInfo.fill,fillOpacity:this.CONFIG.FILL_OPACITY, strokeColor:colorInfo.border,strokeWeight:this.CONFIG.STROKE_WEIGHT_DEFAULT,strokeOpacity:1,strokeStyle:"solid",zIndex:this.CONFIG.Z_INDEX_DEFAULT,clickable:false,visible:true}}}, {key:"clearEqkPolygon",value:function clearEqkPolygon(){this.polygonLayer.remove()}}, {key:"drawMarkerForEarthquake",value:function drawMarkerForEarthquake(regionKey,data){if(this.element.find("#_IdEqkMapMarker-".concat(regionKey)).length>0)return;var roman=this.NUM_TO_ROMAN[data.mmi]|| data.mmi;var markerHtml='\n \x3cdiv id\x3d"_IdEqkMapMarker-'.concat(regionKey,'" class\x3d"warning_marker type_main"\x3e\n \x3cdiv class\x3d"warning_marker_inner"\x3e\n \x3cem class\x3d"warning_marker_location"\x3e').concat(data.regionName, '\x3c/em\x3e\n \x3cstrong class\x3d"warning_marker_data"\x3e').concat(roman,"\x3c/strong\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ");var $marker=$(markerHtml).css("visibility", "hidden");this.element.append($marker);var sizeWidth=$marker.outerWidth();var sizeHeight=$marker.outerHeight();$marker.remove();if(!sizeWidth||!sizeHeight)return;var marker=new naver.maps.Marker({position:new naver.maps.LatLng(data.latitude, data.longitude),map:this.naverMap,icon:{content:markerHtml,size:new naver.maps.Size(sizeWidth,sizeHeight)},zIndex:0});this.callbacks.addMarker(marker)}}, {key:"loadIntensityData",value:function loadIntensityData(eqkId){var _this5=this;if(!eqkId)return Promise.resolve(null);if(this.eqkIntensityCacheMap.has(eqkId))return Promise.resolve(this.eqkIntensityCacheMap.get(eqkId)); return new Promise(function(resolve){var choiceQuery={earthquakeIntensityWithPolygon:{earthquakeId:String(eqkId)}};oBlockScriptService.ajaxChoiceApi(choiceQuery,function(result){var _result$earthquakeInt; var intensityData=(result===null||result===void 0?void 0:(_result$earthquakeInt=result.earthquakeIntensityWithPolygon)===null||_result$earthquakeInt===void 0?void 0:_result$earthquakeInt.intensityItemList)|| [];_this5.eqkIntensityCacheMap.set(eqkId,intensityData);resolve(intensityData)}).fail(function(){oCommon.fnSendWarnToNelo("[earthquakeMapService] \uc9c4\ub3c4 \ub370\uc774\ud130 \ub85c\ub4dc \uc2e4\ud328", null,"earthquakeId: ".concat(eqkId)); resolve(null)})})}}, {key:"renderEqkCard",value:function renderEqkCard(){if(_.isEmpty(this.eqkList)){this.hideEqkCard();return}var $mapEqk=this.element.find(".map_bottom_area .map_warning._cnEqkCard");var isFirstRender=$mapEqk.length=== 0;if(isFirstRender)this.initEqkCard();if(this.eqkList.length<=1){this.selectedEqk=this.eqkList[0];this.hideEqkCardList();this.selectEarthquake(this.selectedEqk);return}this.updateActiveEqkCard()}}, {key:"initEqkCard",value:function initEqkCard(){var html='\n \x3cdiv class\x3d"map_warning type_earthquake _cnEqkCard"\x3e\n \x3cdiv class\x3d"map_warning_list scroll_control"\x3e\n \x3cdiv class\x3d"map_list_slide scroll_area" data-name\x3d"eqkCard" data-gesture-scroll\x3d"true" data-snap-selector\x3d".map_slide_item"\x3e\n \x3cdiv class\x3d"map_slide_inner is-main"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"card_slide_button btn_prev"\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"card_slide_button btn_next"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n '.concat(this.renderEqkDetailBottomSheet(), "\n \x3c/div\x3e\n ");this.element.find(".map_bottom_area").prepend(html);this.initBottomSheet()}}, {key:"updateActiveEqkCard",value:function updateActiveEqkCard(){var _this6=this;if(!this.selectedEqk||!this.eqkList.some(function(eqk){return eqk.id===_this6.selectedEqk.id}))this.selectedEqk=this.eqkList[0]; this.refreshEqkCards();this.element.find(".map_warning._cnEqkCard").removeClass("hide");this.initEqkCardScroll();this.selectEarthquake(this.selectedEqk)}}, {key:"initEqkCardScroll",value:function initEqkCardScroll(){var $scrollArea=this.element.find(".map_warning._cnEqkCard .scroll_area");if($scrollArea.length===0)return;var scrollName=$scrollArea.data("name"); if(oCommon.oScroll[scrollName])oCommon.refreshScroll(scrollName);else oCommon.initScroll($scrollArea)}}, {key:"refreshEqkCards",value:function refreshEqkCards(){var _this7=this;var $slideInner=this.element.find("._cnEqkCard .map_slide_inner");if($slideInner.length===0)return;var filteredEqkList=this.eqkList.filter(function(eqk){var _this7$selectedEqk; return eqk.id!==((_this7$selectedEqk=_this7.selectedEqk)===null||_this7$selectedEqk===void 0?void 0:_this7$selectedEqk.id)}); var cardsHtml=filteredEqkList.map(function(eqk){var datetime=eqk.epitime?eqk.epitime.substring(0,17):"";var regionLabel=_this7.getRegionLabel(eqk);var regionLabelHtml=regionLabel?'\x3cspan class\x3d"map_description_label"\x3e'.concat(regionLabel, "\x3c/span\x3e "):"";var index=_this7.eqkList.findIndex(function(item){return item.id===eqk.id}); return'\n \x3cdiv class\x3d"map_slide_item type_earthquake _cnEqkListCard" data-index\x3d"'.concat(index,'" data-eqk-id\x3d"').concat(eqk.id,'"\x3e\n \x3cdiv class\x3d"map_item_inner"\x3e\n \x3cdiv class\x3d"map_item_head"\x3e\n \x3cstrong class\x3d"map_item_title"\x3e').concat(eqk.magnitude, '\x3c/strong\x3e\n \x3cbutton type\x3d"button" class\x3d"map_head_button type_more _cnEqkDetailMoreBtn" data-index\x3d"').concat(index,'"\x3e\n \x3cspan class\x3d"blind"\x3e\uc0c1\uc138 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cspan class\x3d"map_item_detail"\x3e\n \x3cdl class\x3d"map_detail_description"\x3e\n \x3cdt class\x3d"map_description_title"\x3e').concat(regionLabelHtml, "\x3c/dt\x3e\n ").concat(datetime?'\x3cdd class\x3d"map_description_data"\x3e'.concat(datetime," \ubc1c\uc0dd\x3c/dd\x3e"):"","\n \x3c/dl\x3e\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}).join(""); $slideInner.html(cardsHtml)}}, {key:"hideEqkCardList",value:function hideEqkCardList(){this.element.find("._cnEqkCard .map_warning_list").addClass("hide")}}, {key:"hideEqkCard",value:function hideEqkCard(){this.element.find(".map_warning._cnEqkCard").addClass("hide")}}, {key:"handleCardClick",value:function handleCardClick(e){var $card=$(e.currentTarget);var eqkId=$card.data("eqkId");var eqk=this.eqkList.find(function(item){return item.id===eqkId}); if(!eqk)return;var $targetBtn=this.element.find('.map_tools_depth button[data-key\x3d"'.concat(eqk.id,'"]'));if($targetBtn.length>0)$targetBtn.trigger("click");oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(this.clickCode,"earthcard"))}}, {key:"handleMarkerLocationClick",value:function handleMarkerLocationClick(e){e.stopPropagation();var eqk=this.selectedEqk;if(!eqk)return;var index=this.eqkList.findIndex(function(item){return item.id=== eqk.id}); if(index<0)return;if(this.isDetailOpen())this.closeBottomSheet();else this.openBottomSheet(index);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"earthmrk"))}}, {key:"selectEarthquake",value:function selectEarthquake(eqk){var _this8=this;this.selectedEqk=eqk;this.drawEpicenterMarker(eqk);this.panToEpicenter(eqk);this.loadIntensityData(eqk.id).then(function(intensityData){var _this8$selectedEqk; if(((_this8$selectedEqk=_this8.selectedEqk)===null||_this8$selectedEqk===void 0?void 0:_this8$selectedEqk.id)!==eqk.id)return;if(!_.isEmpty(intensityData))_this8.drawEqkPolygon(intensityData);else _this8.clearEqkPolygon()})}}, {key:"panToEpicenter",value:function panToEpicenter(eqk){var _this9=this;if(!(eqk===null||eqk===void 0?void 0:eqk.latitude)||!(eqk===null||eqk===void 0?void 0:eqk.longitude)||!this.naverMap)return;setTimeout(function(){_this9.naverMap.panTo(new naver.maps.LatLng(eqk.latitude, eqk.longitude))},this.CONFIG.PAN_DELAY_MS)}}, {key:"drawEpicenterMarker",value:function drawEpicenterMarker(eqk){this.removeEpicenterMarker();if(!(eqk===null||eqk===void 0?void 0:eqk.latitude)||!(eqk===null||eqk===void 0?void 0:eqk.longitude))return; var datetime=eqk.epitime?eqk.epitime.substring(5,17):"";var regionLabel=this.getRegionLabel(eqk);var locationText=regionLabel?"".concat(regionLabel):eqk.epicenter;var markerHtml='\n \x3cdiv class\x3d"warning_marker type_earthquake"\x3e\n \x3cdiv class\x3d"warning_marker_inner"\x3e\n \x3cstrong class\x3d"warning_marker_data"\x3e'.concat(eqk.magnitude, '\x3c/strong\x3e\n \x3cbutton class\x3d"warning_marker_location _cnEqkMarkerLocation"\x3e').concat(locationText,"\x3c/button\x3e\n ").concat(datetime?'\x3cp class\x3d"warning_marker_date"\x3e'.concat(datetime, " \ubc1c\uc0dd\x3c/p\x3e"):"",'\n \x3c/div\x3e\n \x3cdiv class\x3d"warning_marker_ripple" aria-hidden\x3d"true"\x3e\n \x3cspan class\x3d"warning_ripple_dot _cnEpicenterDot"\x3e\x3c/span\x3e\n \x3cspan class\x3d"warning_ripple_wave"\x3e\x3c/span\x3e\n \x3cspan class\x3d"warning_ripple_wave"\x3e\x3c/span\x3e\n \x3cspan class\x3d"warning_ripple_wave"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); var $marker=$(markerHtml).css("visibility","hidden");this.element.append($marker);var sizeWidth=$marker.outerWidth();var sizeHeight=$marker.outerHeight();var $dot=$marker.find("._cnEpicenterDot");var anchorX= sizeWidth/2;var anchorY=sizeHeight;if($dot.length>0){var markerRect=$marker[0].getBoundingClientRect();var dotRect=$dot[0].getBoundingClientRect();anchorY=dotRect.top+dotRect.height/2-markerRect.top}$marker.remove(); this.epicenterMarker=new naver.maps.Marker({position:new naver.maps.LatLng(parseFloat(eqk.latitude),parseFloat(eqk.longitude)),map:this.naverMap,icon:{content:markerHtml,size:new naver.maps.Size(sizeWidth, sizeHeight),anchor:new naver.maps.Point(anchorX,anchorY)},visible:true,zIndex:200})}}, {key:"removeEpicenterMarker",value:function removeEpicenterMarker(){if(this.epicenterMarker){this.epicenterMarker.setMap(null);this.epicenterMarker=null}}}, {key:"renderEqkDetailBottomSheet",value:function renderEqkDetailBottomSheet(){return'\n \x3cdiv class\x3d"bottom_sheet _cnEqkBottomSheet type_warning--detail" id\x3d"warningDetail" role\x3d"dialog" aria-modal\x3d"true"\x3e\n \x3cdiv class\x3d"bottom_sheet_dimmed"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"bottom_sheet_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"handle_btn"\x3e\x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub3d9\uc791\x3c/span\x3e\x3c/button\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"warning_detail"\x3e\n \x3cdiv class\x3d"warning_detail_head"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"warning_detail_inner"\x3e\x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"warning_detail_button type_close btn_close"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"initBottomSheet",value:function initBottomSheet(){var _this$templateIndex;var $bottomSheet=this.element.find("._cnEqkBottomSheet");if($bottomSheet.length===0)return;this.eqkDetailBottomSheet=oBottomSheet.create($bottomSheet, {enableSnap:true,closeButtonSelector:".btn_close",dimmedClose:true,fullViewHeight:85,maxHeight:85});oBottomSheet.register("eqkDetailBottomSheet_".concat((_this$templateIndex=this.templateIndex)!==null&& _this$templateIndex!==void 0?_this$templateIndex:""),this.eqkDetailBottomSheet)}}, {key:"isDetailOpen",value:function isDetailOpen(){var _this$eqkDetailBottom4;return oCommon.fnGetResponsiveSizeType().deviceType==="Pc"?!!this.detailOverlayMarker:(_this$eqkDetailBottom4=this.eqkDetailBottomSheet)=== null||_this$eqkDetailBottom4===void 0?void 0:_this$eqkDetailBottom4.isOpen}}, {key:"openBottomSheet",value:function openBottomSheet(cardIndex){var eqk=this.eqkList[cardIndex];if(!eqk)return;var detailHeaderHtml=this.buildDetailHeaderHtml(eqk);var detailContentHtml=this.buildDetailContentHtml(eqk); if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")this.openMobileBottomSheet(detailHeaderHtml,detailContentHtml);else this.openPcDetailOverlay(eqk,detailHeaderHtml,detailContentHtml)}}, {key:"openMobileBottomSheet",value:function openMobileBottomSheet(detailHeaderHtml,detailContentHtml){var $bottomSheet=this.element.find("._cnEqkBottomSheet");$bottomSheet.find(".warning_detail_head").html(detailHeaderHtml); $bottomSheet.find(".warning_detail_inner").html(detailContentHtml);if(this.eqkDetailBottomSheet)this.eqkDetailBottomSheet.open()}}, {key:"openPcDetailOverlay",value:function openPcDetailOverlay(eqk,detailHeaderHtml,detailContentHtml){this.removeDetailOverlayMarker();if(!(eqk===null||eqk===void 0?void 0:eqk.latitude)||!(eqk===null|| eqk===void 0?void 0:eqk.longitude))return;var overlayHtml='\n \x3cdiv class\x3d"bottom_sheet _cnEqkDetailOverlay type_warning--detail type_earthquake is_open" id\x3d"warningDetailPc" role\x3d"dialog" style\x3d"transform: none;"\x3e\n \x3cdiv class\x3d"bottom_sheet_inner"\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"warning_detail"\x3e\n \x3cdiv class\x3d"warning_detail_head"\x3e'.concat(detailHeaderHtml, '\x3c/div\x3e\n \x3cdiv class\x3d"warning_detail_inner"\x3e').concat(detailContentHtml,'\x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"warning_detail_button type_close _cnEqkDetailOverlayClose btn_close"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); var $overlay=$(overlayHtml).css("visibility","hidden");this.element.append($overlay);var overlayWidth=$overlay.outerWidth();var overlayHeight=$overlay.outerHeight();$overlay.remove();this.detailOverlayMarker= new naver.maps.Marker({position:new naver.maps.LatLng(parseFloat(eqk.latitude),parseFloat(eqk.longitude)),map:this.naverMap,icon:{content:overlayHtml,size:new naver.maps.Size(overlayWidth,overlayHeight), anchor:new naver.maps.Point(overlayWidth/2,overlayHeight/2)},zIndex:300,clickable:true});var overlayEl=this.detailOverlayMarker.getElement();if(overlayEl){var scrollHandler=function scrollHandler(e){var scrollable= overlayEl.querySelector(".warning_detail_inner");if(!scrollable)return;var scrollTop=scrollable.scrollTop,scrollHeight=scrollable.scrollHeight,clientHeight=scrollable.clientHeight;var atTop=scrollTop=== 0&&e.deltaY<0;var atBottom=scrollTop+clientHeight>=scrollHeight&&e.deltaY>0;if(atTop||atBottom)e.preventDefault();e.stopPropagation()}; this._overlayScrollHandler=scrollHandler;this._overlayScrollEl=overlayEl;["mousewheel","wheel"].forEach(function(eventType){overlayEl.addEventListener(eventType,scrollHandler,{passive:false})})}}}, {key:"buildDetailHeaderHtml",value:function buildDetailHeaderHtml(eqk){var regionLabel=this.getRegionLabel(eqk);var regionLabelHtml=regionLabel?'\x3cspan class\x3d"warning_head_label"\x3e'.concat(regionLabel, "\x3c/span\x3e "):"";return'\n \x3cstrong class\x3d"warning_head_data"\x3e'.concat(eqk.magnitude,'\x3c/strong\x3e\n \x3cdiv class\x3d"warning_head_inner"\x3e\n \x3cem class\x3d"warning_head_title"\x3e').concat(regionLabelHtml, '\x3c/em\x3e\n \x3cp class\x3d"warning_head_text"\x3e').concat(eqk.epicenter,"\x3c/p\x3e\n \x3c/div\x3e\n ")}}, {key:"buildDetailContentHtml",value:function buildDetailContentHtml(eqk){var datetime=eqk.epitime?eqk.epitime.substring(0,17):"";var html='\n \x3cp class\x3d"warning_detail_text type_earthquake"\x3e\n '.concat(datetime? '\x3cstrong class\x3d"warning_text_ehmpasis"\x3e'.concat(datetime,"\x3c/strong\x3e \ubc1c\uc0dd"):"",'\n \x3cspan class\x3d"warning_text_dot" aria-hidden\x3d"true"\x3e\x3cspan class\x3d"blind"\x3e,\x3c/span\x3e\uae30\uc0c1\uccad \ubc1c\ud45c\x3c/span\x3e\n \x3c/p\x3e\n '); if(eqk.influenceArea)html+='\n \x3cdiv class\x3d"warning_detail_earthquake"\x3e\n \x3cdl class\x3d"wraning_earthquake_description type_loaction"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e'.concat(eqk.influenceArea, '\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(eqk.refer,"\x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n ");var impactRows= this.buildIntensityImpactRows(eqk);if(impactRows)html+='\n \x3cdiv class\x3d"warning_detail_earthquake"\x3e\n \x3cstrong class\x3d"warning_earthquake_title"\x3e\uc9c4\ub3c4 \uc601\ud5a5 \uc9c0\uc5ed\x3c/strong\x3e\n '.concat(impactRows, "\n \x3c/div\x3e\n ");return html}}, {key:"buildIntensityImpactRows",value:function buildIntensityImpactRows(eqk){var _this0=this;var intensityData=this.eqkIntensityCacheMap.get(eqk.id);if(_.isEmpty(intensityData))return"";var mmiGroupMap= new Map;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=intensityData[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion= true){var item=_step.value;if(!item.sidoNm)continue;if(!mmiGroupMap.has(item.mmi))mmiGroupMap.set(item.mmi,new Map);var sidoGroups=mmiGroupMap.get(item.mmi);if(!sidoGroups.has(item.sidoNm))sidoGroups.set(item.sidoNm, new Set);if(item.sigunguNm)sidoGroups.get(item.sidoNm).add(item.sigunguNm)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}var mmiRegions=_toConsumableArray(mmiGroupMap.entries()).map(function(_ref2){var _ref3=_slicedToArray(_ref2,2),mmi=_ref3[0],sidoGroups=_ref3[1];return{mmi:mmi,sidoGroups:sidoGroups}}).filter(function(_ref4){var sidoGroups= _ref4.sidoGroups; return sidoGroups.size>0}); if(_.isEmpty(mmiRegions))return"";return mmiRegions.sort(function(a,b){return a.mmi-b.mmi}).map(function(_ref5){var mmi=_ref5.mmi,sidoGroups=_ref5.sidoGroups; var roman=_this0.NUM_TO_ROMAN[mmi]||mmi;var regionText=_toConsumableArray(sidoGroups.entries()).map(function(_ref6){var _ref7=_slicedToArray(_ref6,2),sido=_ref7[0],sigungus=_ref7[1];return sigungus.size> 0?"".concat(sido,"(").concat(_toConsumableArray(sigungus).join(", "),")"):sido}).join(", "); var levelDesc=oEqkIntensityDescMap[roman]||"";return'\n \x3cdl class\x3d"wraning_earthquake_description type_impact type_level--'.concat(mmi,'"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e\uc9c4\ub3c4 ').concat(roman, " - ").concat(regionText,'\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(levelDesc,"\x3c/dd\x3e\n \x3c/dl\x3e\n ")}).join("")}}, {key:"closeBottomSheet",value:function closeBottomSheet(){var _this$eqkDetailBottom5;(_this$eqkDetailBottom5=this.eqkDetailBottomSheet)===null||_this$eqkDetailBottom5===void 0?void 0:_this$eqkDetailBottom5.close(); this.removeDetailOverlayMarker()}}, {key:"removeDetailOverlayMarker",value:function removeDetailOverlayMarker(){var _this1=this;if(this.detailOverlayMarker){if(this._overlayScrollEl&&this._overlayScrollHandler){["mousewheel","wheel"].forEach(function(eventType){_this1._overlayScrollEl.removeEventListener(eventType, _this1._overlayScrollHandler)}); this._overlayScrollHandler=null;this._overlayScrollEl=null}this.detailOverlayMarker.setMap(null);this.detailOverlayMarker=null}}}, {key:"toggleEqkColorGuide",value:function toggleEqkColorGuide(e){var $target=this.element.find("._cnEqkColorGuide");var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(!isOpen)oCommon.fnOpenInfoLayer($target); oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"earthinfo"))}}, {key:"hideEqkUI",value:function hideEqkUI(){this.closeBottomSheet();this.hideEqkCard();this.removeEpicenterMarker();this.clearEqkPolygon()}}, {key:"getRegionLabel",value:function getRegionLabel(eqk){if(!eqk)return"";var isLocal=eqk.kind==="k";var isSea=eqk.seaYn==="Y";if(isLocal&&!isSea)return[eqk.sidoNm,eqk.sigunguNm].filter(Boolean).join(" "); if(isLocal&&isSea)return"\uad6d\ub0b4 \ud574\uc5ed";if(!isLocal&&!isSea)return"\ud574\uc678\uc601\ud5a5 \uc9c0\uc5ed";if(!isLocal&&isSea)return"\ud574\uc678\uc601\ud5a5 \ud574\uc5ed";return""}}]); return earthquakeMapService}(); function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)this.$titleElement.html(this.imageTypeMap[this.imageType].name)}}, {key:"getDate",value:function getDate(str){var startStr,endStr,substr;switch(this.imageType){case "SAT":startStr="SAT_LIR_";endStr=".gif";substr=str.substring(str.indexOf(startStr),str.indexOf(endStr)).replace(startStr, "");return substr;case "RADAR":startStr="RDR_CMI2_";endStr=".png";substr=str.substring(str.indexOf(startStr),str.indexOf(endStr)).replace(startStr,"");return substr;default:return str.match(/\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])-(0[0-9]|1[0-9]|2[0-3])/).shift(0).replaceAll("-", "")+"0000"}}}, {key:"attachEvent",value:function attachEvent(){var _this=this;this.$rootElement.on("click",".btn_alert",$.proxy(function(e){oCommon.fnSendClick(e,_this.helpBtnClickCode);_this.clickVideoHelp()},this)); this.$rootElement.on("click",".ly_help .btn_close",$.proxy(function(e){oCommon.fnSendClick(e,_this.helpBtnClickCode);_this.clickVideoHelp()},this)); this.$rootElement.on("touchend click",".btn_play",$.proxy(function(e){oCommon.fnSendClick(e,_this.playBtnClickCode);var $target=$(e.currentTarget);if($target.hasClass("clicked"))$target.find("span.blind").html("\uc815\uc9c0"); else $target.find("span.blind").html("\uc7ac\uc0dd");if(!_this.checkAllImageLoad())_this.oSliderImagePlay.loadImages()},this)); this.$rootElement.on("click",".link_go",$.proxy(function(e){oCommon.fnSendClick(e,_this.offerLinkClickCode)},this)); this.oSliderImagePlay.slider.on("start",function(e){oCommon.fnSendClick(e,_this.sliderDragClickCode);if(!_this.checkAllImageLoad())_this.oSliderImagePlay.loadImages()}); $(document).on("keydown",function(event){if(document.activeElement===_this.oSliderImagePlay.playBtnEl)switch(event.which){case 13:case 32:_this.oSliderImagePlay.imagePlayer.togglePlay();break}})}}, {key:"checkAllImageLoad",value:function checkAllImageLoad(){var _this5=this;var isLoaded=true;this.oSliderImagePlay.imagePlayer.imageEls.forEach(function(el){if(!_this5.oSliderImagePlay.imagePlayer.checkImageLoad(el)){isLoaded= false;return false}}); return isLoaded}}, {key:"clickVideoHelp",value:function clickVideoHelp(){var $helpBtnElement=this.$rootElement.find(".btn_alert");var isOpen=oCommon.fnGetOpenOrNot($helpBtnElement);oCommon.fnCloseAllInfoLayer();if(isOpen=== false)oCommon.fnOpenInfoLayer($helpBtnElement)}}, {key:"loadImages",value:function loadImages(){if(!this.checkAllImageLoad())this.oSliderImagePlay.loadImages()}}]); return imagePlayService}(); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} var oMyRegionBriefParser=function(){var NATION_CODE="00000000";var MAX_REGIONS=11;var LIST_MIN_GRADE="class3";var GRADE_COLOR={class4:1,class3:2,class2:3,class1:4};var GRADE_LABEL={class4:"\ub192\uc740\uc704\ud5d8", class3:"\uc704\ud5d8",class2:"\uc8fc\uc758",class1:"\uad00\uc2ec"};var BADGE_COLOR_GROUPS=[[1,["\ub192\uc740\uc704\ud5d8","\ub354\uc704","\uc0b0\ubd88","\uc9c0\uc9c4"]],[2,["\uc704\ud5d8","\uacbd\uacc4"]], [3,["\uc8fc\uc758","\uc720\uc758","\ub300\uae30\uc9c8","\uc0b0\uc0ac\ud0dc","\uac74\uc870"]],[4,["\uad00\uc2ec"]],[20,["\ubc14\ub78c","\ud48d\ub791","\ud574\uc77c"]],[5,["\ud0dc\ud48d"]],[6,["\ube44","\ud64d\uc218"]], [7,["\ub208","\ucd94\uc704"]]];var DAY_KR=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"];var PICTO_URGENCY_COLOR={"\uae34\uae09":1,"\uae08\uc9c0":2,"\uc8fc\uc758":3,"\ub300\ube44":4}; var PICTO_ICON={EVAC_HIGH:"evac",EVAC_HIGH_A:"evac",EVAC_HIGH_B:"evac",EVAC_HIGH_C:"evac",EVAC_QUAKE:"evac",EVAC_DESCEND:"evac",AVD_STR_STOP:"avd",AVD_STR_B:"avd",AVD_STR_C:"avd",AVD_STR_D:"avd",AVD_MTN_STOP:"avd", AVD_MTN_C:"avd",AVD_LOW_STOP:"avd",AVD_LOW_A:"avd",AVD_LOW_E:"avd",AVD_LOW_F:"avd",SEA_STOP:"avd",SEA_STOP_B:"avd",AVD_COAST_STOP:"avd",AVD_COAST_B:"avd",AVD_STR_CARE:"avd",AVD_STR_E:"avd",AVD_STR_F:"avd", AVD_MTN_HOLD:"avd",AVD_LOW_CARE:"avd",SEA_CARE:"avd",AVD_COAST_CARE:"avd",DRV_NO_CHILD:"drv",DRV_STOP:"drv",DRV_FLOOD_STOP:"drv",DRV_FLOOD_A:"drv",DRV_FLOOD_C:"drv",DRV_FLOOD_D:"drv",DRV_FLOOD_E:"drv", DRV_FLOOD_F:"drv",DRV_SLOW:"drv",DRV_ICE:"drv",DRV_ICE_B:"drv",DRV_ICE_C:"drv",DRV_ICE_G:"drv",DRV_FLOOD_CARE:"drv",OUT_WORK_STOP:"out_hold",OUT_STOP:"out_hold",OUT_WALK_CARE:"out_walk_care",OUT_WORK_HOLD:"out_hold", OUT_HOLD:"out_hold",PRP_NO_FIRE:"prp_no_fire",PRP_KIT:"bdy_food",PRP_INFO:"prp",PRP_POWER:"prp",PRP_BASEMENT:"prp_basement",PRP_BASEMENT_E:"prp_basement",PRP_BASEMENT_F:"prp_basement",IND_AIR:"ind",IND_GAS:"ind", IND_FREEZE:"ind",IND_GLASS:"ind",IND_WINDOW:"ind",BDY_FOOD:"bdy_food",BDY_WARM:"bdy_warm",BDY_HEAT:"bdy_heat",BDY_MASK:"bdy_mask",CAR_VULNERABLE:"car_vulnerable",CAR_FARM_B:"car_protect",CAR_FARM_D:"car_protect", CAR_BOAT_B:"car_boat",CAR_MOVE:"drv",CAR_MOVE_A:"drv",CAR_MOVE_E:"drv",CAR_MOVE_F:"drv"};var PICTO_AREA_ICON={"\ub300\ud53c":"evac","\ud68c\ud53c":"avd","\uc6b4\uc804":"drv","\uc678\ucd9c":"out_hold","\uc2e4\ub0b4":"ind", "\uac74\uac15":"bdy_heat","\uac00\uc871\u00b7\uc7ac\uc0b0":"car_protect","\ub300\ube44":"prp"};var FEEDBACK_COOKIE="NV_SAFETY_REPORT_FEEDBACK";var FEEDBACK_DAYS=20;var DAY_MS=864E5;var CONTENT_TYPE_UI= {"\ube44":"\uac15\ud55c \ube44","\ub208":"\ub9ce\uc740 \ub208","\ubc14\ub78c":"\uac15\ud48d","\ub354\uc704":"\uace0\uc628","\ucd94\uc704":"\uc800\uc628"};function pad2(n){return n<10?"0"+n:""+n} function has(obj,key){return!!obj&&Object.prototype.hasOwnProperty.call(obj,key)} function safeParse(s){try{return JSON.parse(s)}catch(e){return null}} function isObject(v){return!!v&&_typeof(v)==="object"&&!Array.isArray(v)} function isDomesticCode(code){return typeof code==="string"&&/^\d{8}$/.test(code)&&code!==NATION_CODE} function isValidGrade(grade){return has(GRADE_COLOR,grade)} function gradeColorNo(grade){return GRADE_COLOR[grade]||0} function gradeLabel(grade){return GRADE_LABEL[grade]||""} function badgeColorNo(text){for(var i=0;i=nationGrade)return"my";return"nation"} function buildButtons(myRegions,grades){var out=[];var seen={};(Array.isArray(myRegions)?myRegions:[]).forEach(function(r){var code=r?r.naverRgnCd:"";if(!isDomesticCode(code)||seen[code]||!isValidGrade(grades? grades[code]:""))return;seen[code]=true;out.push({naverRgnCd:code,buttonName:String(r.buttonName==null?"":r.buttonName),grade:grades[code],colorNo:gradeColorNo(grades[code]),label:gradeLabel(grades[code])})}); return out} function cardNameFor(code,currentCode,pageRegionName,myRegions){if(code&&code===currentCode)return String(pageRegionName==null?"":pageRegionName);var list=Array.isArray(myRegions)?myRegions:[];for(var i= 0;i=0?s.slice(hashIdx):"";var rest=hashIdx>=0?s.slice(0,hashIdx):s;var qIdx=rest.indexOf("?");if(qIdx< 0)return s;var kept=rest.slice(qIdx+1).split("\x26").filter(function(p){return p!==""&&p.split("\x3d")[0]!=="brief"}); return rest.slice(0,qIdx)+(kept.length?"?"+kept.join("\x26"):"")+hash} function escapeText(s){return String(s==null?"":s).replace(/&/g,"\x26amp;").replace(//g,"\x26gt;")} function escapeAttr(s){return escapeText(s).replace(/"/g,"\x26quot;").replace(/'/g,"\x26#39;")} function toDate(ymdt){var s=String(ymdt||"");if(s.length<12)return null;return new Date(+s.slice(0,4),+s.slice(4,6)-1,+s.slice(6,8),+s.slice(8,10),+s.slice(10,12))} function timeAge(ymdt,nowMs){var d=toDateSec(ymdt);return d?homeTimeAge(d,nowMs,false):""} function buildLinks(extraInfo,regionCode,deviceTypeValue,servicePathValue){var links=isObject(extraInfo)&&Array.isArray(extraInfo.selectedLinks)?extraInfo.selectedLinks:[];var out=[];links.forEach(function(link){if(!isObject(link))return; var url=[deviceTypeValue==="pc"?link.pcUrl:link.mobileUrl,link.mobileUrl,link.pcUrl,"#"].filter(function(u){return!!u})[0]; var resolved=String(url).replace("\x3cnaverRgnCd\x3e",regionCode);if(typeof servicePathValue==="string")resolved=resolved.replace("\x3cservicePath\x3e",servicePathValue);out.push({label:String(link.label== null?"":link.label),url:resolved})}); return out} function talkLayerRegion(label,code){if(trimmedText(label)!=="\uc81c\ubcf4\ud1a1"||!isDomesticCode(code))return null;return{objectRegionCode:code.substring(0,2),categoryRegionCode:code.substring(0,5)}} function isPlainClick(e){if(!isObject(e))return false;if(e.button!==undefined&&e.button!==null&&e.button!==0)return false;return!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey} function talkBlockReady(instanceInfoList){if(!Array.isArray(instanceInfoList)||instanceInfoList.length===0)return false;return instanceInfoList.every(function(info){return isObject(info)&&isObject(info.instance)&& info.instance.isEnable===true})} function trimmedText(v){return typeof v==="string"?v.trim():""} function buildPictograms(extraInfo){var list=isObject(extraInfo)&&Array.isArray(extraInfo.pictograms)?extraInfo.pictograms:[];var out=[];list.forEach(function(p){if(!isObject(p))return;var id=trimmedText(p.id), area=trimmedText(p.area),urgency=trimmedText(p.urgency);if(!id||!area||!urgency||!trimmedText(p.text))return;if(!has(PICTO_URGENCY_COLOR,urgency))return;var icon=has(PICTO_ICON,id)?PICTO_ICON[id]:has(PICTO_AREA_ICON, area)?PICTO_AREA_ICON[area]:"";if(!icon)return;out.push({text:p.text,colorNo:PICTO_URGENCY_COLOR[urgency],icon:icon})}); return out} function toCard(row,code,name,deviceTypeValue,nowMs,servicePathValue){if(!isRenderableRow(row))return null;var contents=safeParse(row.contents);var extra=safeParse(row.extraInfo);var topic=String(row.contentType); return{naverRgnCd:code,name:String(name==null?"":name),grade:row.grade,colorNo:gradeColorNo(row.grade),gradeLabel:gradeLabel(row.grade),topic:topic,topicColorNo:badgeColorNo(topic),time:timeAge(row.insYmdt, nowMs),summary:typeof contents.summary_report==="string"?contents.summary_report:"",links:buildLinks(extra,code,deviceTypeValue,servicePathValue).slice(0,2),pictograms:buildPictograms(extra)}} function toTimelineGroups(rows,code,deviceTypeValue,nowMs,servicePathValue){var groups=[];var byKey={};(Array.isArray(rows)?rows:[]).forEach(function(row,index){if(!isObject(row))return;var d=toDate(row.insYmdt); if(!d)return;var contents=safeParse(row.contents);if(!isObject(contents))contents={};var vc=Array.isArray(contents.variable_contents)?contents.variable_contents:[];var extra=safeParse(row.extraInfo);var key= d.getFullYear()+pad2(d.getMonth()+1)+pad2(d.getDate());if(!byKey[key]){byKey[key]={date:pad2(d.getMonth()+1)+"."+pad2(d.getDate()),day:DAY_KR[d.getDay()],items:[]};groups.push(byKey[key])}var topic=String(row.contentType== null?"":row.contentType);byKey[key].items.push({time:timeAge(row.insYmdt,nowMs),topic:topic,topicColorNo:badgeColorNo(topic),gradeLabel:gradeLabel(row.grade),gradeColorNo:gradeColorNo(row.grade),summary:typeof contents.summary_report=== "string"?contents.summary_report:"",sentences:vc.slice(0,3).filter(function(s){return typeof s==="string"&&s.trim()!==""}), links:buildLinks(extra,code,deviceTypeValue,servicePathValue),pictograms:buildPictograms(extra),id:reportId(row),row:row,index:index})}); return groups} function buildTimelineRequest(code){return{segmentSafetyReportTimeline:{naverRgnCd:code,offsetHours:168,minGrade:"class1",limit:24}}} function parseTimelineResponse(choiceResult){var list=isObject(choiceResult)?choiceResult.segmentSafetyReportTimeline:undefined;return Array.isArray(list)?list:null} function parseCctvField(raw){if(!isObject(raw))return null;var m=raw.matrix;var matrix=typeof m==="number"&&isFinite(m)?String(m):typeof m==="string"&&m.trim()!==""?m:"";if(!matrix)return null;return{matrix:matrix, thumbnailUrl:typeof raw.thumbnailUrl==="string"?raw.thumbnailUrl:"",cctvName:typeof raw.cctvName==="string"?raw.cctvName:""}} function sheetRegionParams(code,name){var params={region_type:"domestic",region_id:code};if(name)params.region_name=name;return params} function buildShareUrl(origin,isPreview,code){return String(origin==null?"":origin)+(isPreview===true?"/preview":"")+"/safety/"+String(code==null?"":code)+"?brief\x3dmysheet"} function reportId(row){if(!isObject(row)||!trimmedText(row.naverRgnCd)||!trimmedText(row.reportType)||!trimmedText(row.aplYmdt))return"";return row.naverRgnCd+"-"+row.reportType+"-"+row.aplYmdt} function kstDatetime(nowMs){var d=new Date(nowMs+9*36E5);return d.getUTCFullYear()+pad2(d.getUTCMonth()+1)+pad2(d.getUTCDate())+pad2(d.getUTCHours())+pad2(d.getUTCMinutes())+pad2(d.getUTCSeconds())} function parseFeedbackList(raw){var list=safeParse(raw==null?"[]":raw);return Array.isArray(list)?list.filter(isObject):[]} function sameFeedback(data,id,type,value){return data.id===id&&data.type===type&&data.value===value} function addFeedback(list,id,type,value,nowMs){var src=Array.isArray(list)?list:[];for(var i=0;i=expire}); out.push({id:id,type:type,value:value,datetime:kstDatetime(nowMs)});return out} function removeFeedback(list,id,type,value){return(Array.isArray(list)?list:[]).filter(function(data){return!sameFeedback(data,id,type,value)})} function feedbackValues(list,id,type){return(Array.isArray(list)?list:[]).filter(function(data){return data.id===id&&data.type===type}).map(function(data){return data.value})} function parseOr(s,fallback){try{return JSON.parse(s)}catch(e){return fallback}} function toDateSec(ymdt){var s=String(ymdt||"");if(s.length<12)return null;return new Date(+s.slice(0,4),+s.slice(4,6)-1,+s.slice(6,8),+s.slice(8,10),+s.slice(10,12),s.length>=14?+s.slice(12,14):0)} function truncDiv(n,d){var q=n/d;return q<0?Math.ceil(q):Math.floor(q)} function homeTimeAge(d,nowMs,card){var diff=nowMs-d.getTime();var minutes=truncDiv(diff,6E4);var hours=truncDiv(diff,36E5);var days=truncDiv(diff,DAY_MS);if(minutes<=1)return"\uc9c0\uae08";if(minutes<60)return minutes+ "\ubd84 \uc804";if(hours<24&&card)return hours+"\uc2dc\uac04 \uc804";if(days<=7&&card)return days+"\uc77c \uc804";var hm=pad2(d.getHours())+":"+pad2(d.getMinutes());return card?pad2(d.getMonth()+1)+"."+ pad2(d.getDate())+" "+hm:hm} function toFeedbackReport(row,index,nowMs){if(!isObject(row))return null;var clone=parseOr(JSON.stringify(row),{});var d=toDateSec(row.insYmdt);clone.gradeCardUi=has(GRADE_LABEL,row.grade)?GRADE_LABEL[row.grade]: "";clone.gradeBadgeUi=clone.gradeCardUi;clone.contentTypeUi=has(CONTENT_TYPE_UI,row.contentType)?CONTENT_TYPE_UI[row.contentType]:row.contentType;clone.contentsUi=parseOr(row.contents||"{}",{});clone.cardTimeAge= d?homeTimeAge(d,nowMs,true):"";clone.bottomTimeAge=d?homeTimeAge(d,nowMs,false):"";clone.date=d?pad2(d.getMonth()+1)+"."+pad2(d.getDate()):"";clone.day=d?DAY_KR[d.getDay()]:"";clone.index=index;clone.id= reportId(row);clone.extraInfo=row.extraInfo?parseOr(row.extraInfo,{}):{};return clone} function buildFeedbackConfig(regionCode,id,report,feedbackType,extra){var parts=String(id).split("-");var config={myRegionCode:regionCode,safetyReportId:id,reportType:parts[1],reportAplYmdt:parts[2],feedbackType:feedbackType, report:report};Object.keys(extra||{}).forEach(function(k){config[k]=extra[k]}); return config} return{isDomesticCode:isDomesticCode,isValidGrade:isValidGrade,gradeColorNo:gradeColorNo,gradeLabel:gradeLabel,badgeColorNo:badgeColorNo,currentSlotCode:currentSlotCode,buildRequestCodes:buildRequestCodes, buildListRequest:buildListRequest,parseListResponse:parseListResponse,isRenderableRow:isRenderableRow,firstGradedCode:firstGradedCode,pickFirstCard:pickFirstCard,resolveSingle:resolveSingle,hasAnyGrade:hasAnyGrade, decideFirstTab:decideFirstTab,buildButtons:buildButtons,cardNameFor:cardNameFor,shouldApply:shouldApply,judgeLocation:judgeLocation,judgeSamePage:judgeSamePage,shouldShowEntryPopup:shouldShowEntryPopup, readBriefFlag:readBriefFlag,removeBriefParam:removeBriefParam,escapeText:escapeText,escapeAttr:escapeAttr,timeAge:timeAge,buildLinks:buildLinks,talkLayerRegion:talkLayerRegion,isPlainClick:isPlainClick, talkBlockReady:talkBlockReady,toCard:toCard,toTimelineGroups:toTimelineGroups,buildPictograms:buildPictograms,buildTimelineRequest:buildTimelineRequest,parseTimelineResponse:parseTimelineResponse,parseCctvField:parseCctvField, sheetRegionParams:sheetRegionParams,FEEDBACK_COOKIE:FEEDBACK_COOKIE,FEEDBACK_DAYS:FEEDBACK_DAYS,buildShareUrl:buildShareUrl,reportId:reportId,kstDatetime:kstDatetime,parseFeedbackList:parseFeedbackList, addFeedback:addFeedback,removeFeedback:removeFeedback,feedbackValues:feedbackValues,toFeedbackReport:toFeedbackReport,buildFeedbackConfig:buildFeedbackConfig}}(); var oNationBriefParser=function(){var GRADE_TYPE={class4:"type_high",class3:"type_caution",class2:"type_attention",class1:"type_favorite"};var GRADE_LABEL={class4:"\ub192\uc740\uc704\ud5d8",class3:"\uc704\ud5d8", class2:"\uc8fc\uc758",class1:"\uad00\uc2ec"};var GRADE_BADGE={class4:"type_color--15",class3:"type_color--16",class2:"type_color--17",class1:"type_color--18"};var TRIGGER_BADGE={"\ud0dc\ud48d":"type_color--9", "\uc9c0\uc9c4":"type_color--10","\ud3ed\uc5fc":"type_color--11","\ud638\uc6b0":"type_color--12","\ub300\uc124":"type_color--13","\ud55c\ud30c":"type_color--14"};var ICON_BY_KR={"\ud638\uc6b0":"type_rain", "\ub300\uc124":"type_snow","\ud3ed\uc5fc":"type_hot","\ud55c\ud30c":"type_cold","\uac15\ud48d":"type_storm","\ud48d\ub791":"type_wind","\ud48d\ub7c9":"type_wind","\ud669\uc0ac":"type_dust","\uac74\uc870":"type_dry", "\ud0dc\ud48d":"type_typhoon","\ud574\uc77c":"type_tsunami","\uc5f4\ub300\uc57c":"type_tropicalnight"};function safeParse(s){try{return JSON.parse(s)}catch(e){return{}}} function pad2(n){return n<10?"0"+n:""+n} function isNonEmptyStr(s){return typeof s==="string"&&s.trim().length>0} function has(v){return v!==null&&v!==undefined&&v!==""} function isValidGrade(grade){return!!GRADE_TYPE[grade]} function isValidContent(report){return!!report&&isNonEmptyStr(report.headline)&&isNonEmptyStr(report.briefing)} function isRenderableCurrent(report){return isValidContent(report)&&isValidGrade(report.grade)} function gradeToType(grade){return GRADE_TYPE[grade]||"type_ready"} function gradeToLabel(grade){return GRADE_LABEL[grade]||"\uc900\ube44\uc911"} function gradeToBadgeColor(grade){return GRADE_BADGE[grade]||""} function triggerToBadgeColor(contentType){return TRIGGER_BADGE[contentType]||"type_color--19"} function categoryToIcon(categoryKr){return ICON_BY_KR[categoryKr]||""} function parseReport(row){row=row||{};var extra=safeParse(row.extraInfo);var resp=extra&&extra.response||{};var isFallback=!!resp.is_fallback;var headline=isFallback?resp.fallback_headline||"":resp.headline|| "";var briefing=isFallback?resp.fallback_briefing||"":resp.briefing||"";return{aplYmdt:row.aplYmdt||"",insYmdt:row.insYmdt||"",grade:row.grade||"",contentType:row.contentType||"",level:resp.level,isFallback:isFallback, headline:headline,briefing:briefing,deltas:resp.deltas||{}}} function gradeDetail(grades){if(!grades)return"";var order=["\uc911\ub300\uacbd\ubcf4","\uacbd\ubcf4","\uc8fc\uc758\ubcf4"];var parts=[];order.forEach(function(g){if(grades[g])parts.push(g+" "+grades[g])}); Object.keys(grades).forEach(function(g){if(order.indexOf(g)===-1&&grades[g])parts.push(g+" "+grades[g])}); return parts.join(" \u00b7 ")} function typhoonCard(t){var status=t.curlocal_sea_yn==="Y"?"\ub3c4\ub2ec":t.curlocal_sea_yn==="N"?"\ubd81\uc0c1 \uc911":"";var sub=(status+" "+(t.position||"")).trim();return{icon:"type_typhoon",label:"NOW", title:"\ud0dc\ud48d "+(t.name||""),sub:sub,nav:{kind:"visualMap",type:"typn"}}} function earthquakeCard(e){var top=e.items&&e.items[0]||{};return{icon:"type_earthquake",label:top.label||"NOW",title:"\uc9c0\uc9c4 M"+(top.magnitude!=null?top.magnitude:""),sub:top.epicenter||"",nav:{kind:"visualMap", type:"earthquake"}}} function warnCard(w){return{icon:categoryToIcon(w.categoryKr),label:"NOW",title:(w.categoryKr||"")+"\ud2b9\ubcf4 "+(w.count||0)+"\uacf3",sub:gradeDetail(w.grades),nav:{kind:"visualMap",type:"warn"}}} function smsCard(s){return{icon:"type_sms",label:"\ucd5c\uadfc1\uc2dc\uac04",title:"\uc7ac\ub09c\ubb38\uc790 "+(s.count||0)+"\uac74",sub:s.label||"",nav:{kind:"disasterSms"}}} function talkCard(rt){var rgn=rt.regions&&rt.regions[0]||{};var word=rt.grade==="surge"?"\uae09\uc99d":rt.grade==="increase"?"\uc99d\uac00":"";var sub=rgn.short_name?rgn.short_name+(word?" "+word:""):""; return{icon:"type_talk",label:"\ucd5c\uadfc1\uc2dc\uac04",title:"\uc81c\ubcf4\ud1a1 "+(rt.count||0)+"\uac74",sub:sub,nav:{kind:"regionTalk"}}} function isPositive(v){return Number(v)>0} function validTyphoon(t){return!!t&&isNonEmptyStr(t.name)} function validEarthquake(e){return!!e&&Array.isArray(e.items)&&!!e.items[0]&&isPositive(e.items[0].magnitude)} function validWarn(w){return!!w&&isNonEmptyStr(w.categoryKr)&&isPositive(w.count)} function validSms(s){return!!s&&isPositive(s.count)} function validTalk(rt){return!!rt&&isPositive(rt.count)} function collect(arr,validator,builder){if(!Array.isArray(arr))return[];var out=[];arr.forEach(function(item){if(validator(item))out.push(builder(item))}); return out} function flattenDeltas(deltas){deltas=deltas||{};return[].concat(collect(deltas.typhoon_trend,validTyphoon,typhoonCard),collect(deltas.earthquake_trend,validEarthquake,earthquakeCard),collect(deltas.warn_trend, validWarn,warnCard),collect(deltas.sms_trend,validSms,smsCard),collect(deltas.report_talk_trend,validTalk,talkCard))} function toDate(aplYmdt){var s=String(aplYmdt||"");if(s.length<12)return null;return new Date(+s.slice(0,4),+s.slice(4,6)-1,+s.slice(6,8),+s.slice(8,10),+s.slice(10,12))} function timeAge(ymdt,nowMs){var d=toDate(ymdt);if(!d)return"";var now=nowMs||Date.now();var diffMin=Math.floor((now-d.getTime())/6E4);if(diffMin<60)return diffMin+"\ubd84 \uc804";return pad2(d.getHours())+ ":"+pad2(d.getMinutes())} var DAY_KR=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"];function groupByDate(reports,nowMs){var groups=[];var byKey={};(reports||[]).forEach(function(r){var d=toDate(r.insYmdt);if(!d)return; var key=d.getFullYear()+pad2(d.getMonth()+1)+pad2(d.getDate());if(!byKey[key]){byKey[key]={date:pad2(d.getMonth()+1)+"."+pad2(d.getDate()),day:DAY_KR[d.getDay()],reports:[]};groups.push(byKey[key])}byKey[key].reports.push(r)}); return groups} return{parseReport:parseReport,gradeToType:gradeToType,gradeToLabel:gradeToLabel,gradeToBadgeColor:gradeToBadgeColor,triggerToBadgeColor:triggerToBadgeColor,categoryToIcon:categoryToIcon,gradeDetail:gradeDetail, flattenDeltas:flattenDeltas,timeAge:timeAge,groupByDate:groupByDate,isValidGrade:isValidGrade,isValidContent:isValidContent,isRenderableCurrent:isRenderableCurrent}}(); function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i5&&arguments[5]!==undefined? arguments[5]:null;var slideEndCallback=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;var tickCallback=arguments.length>7&&arguments[7]!==undefined?arguments[7]:null;_classCallCheck(this, noUiSliderPlayerService);this.SliderPlayerConfig={playBtnSelector:"._playBtn",videoRootSelector:"._playerRoot",sliderSelector:"._slider",handleSelector:".noUi-handle",displayPerEach:displayPerEach!==null&& displayPerEach!==void 0?displayPerEach:500};this.slider=null;this.$target=$(element);this.$playBtn=this.$target.find(this.SliderPlayerConfig.playBtnSelector);this.$slider=this.$target.find(this.SliderPlayerConfig.sliderSelector); this.$handle=null;this.totalDataCount=this.$slider.data("duration");this.lastIndex=null;this.renderCallback=renderCallback;this.slideCallback=slideCallback;this.slideStartCallback=slideStartCallback;this.slideEndCallback= slideEndCallback;this.tickCallback=tickCallback;this.clickCode=clickCode;this.autoStartTimeoutId=null;this.timer=new timer({duration:this.getTotalDuration()});this.init()} _createClass(noUiSliderPlayerService,[{key:"init",value:function init(){this.initSlider();this.attachEvent()}}, {key:"initSlider",value:function initSlider(){var sliderElement=this.$target.find("._slider").get(0);this.slider=noUiSlider.create(sliderElement,{start:0,behaviour:"snap",connect:"lower",animate:false, range:{min:0,max:1}})}}, {key:"getTotalDuration",value:function getTotalDuration(){return this.totalDataCount*this.SliderPlayerConfig.displayPerEach}}, {key:"attachEvent",value:function attachEvent(){var _this2=this;var _this=this;this.$handle=this.$target.find(this.SliderPlayerConfig.handleSelector);this.$handle.prepend('\n \x3cdiv class\x3d"noUi-tooltip"\x3e\n \x3c!--\ud234\ud301\uc2dc\uac04\uc601\uc5ed--\x3e\n \x3c/div\x3e\n '); this.slideCallback(0,0);this.$playBtn.on("click",$.proxy(function(e){if(e.originalEvent)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"play"));_this.togglePlay()},this)); $.each({start:function start(e){_this2.onSlideStart(e)}, end:function end(e){_this2.onSlideEnd(e)}, slide:function slide(e){_this2.onSlide(e)}},function(eventName,listener){_this2.slider.on(eventName,listener)}); this.timer.on({tick:function tick(e){return _this2.onTick(e)}, started:function started(e){return _this2.updateBtn(e)}, paused:function paused(e){return _this2.updateBtn(e)}})}}, {key:"updateBtn",value:function updateBtn(){if(this.timer.isPaused){this.$playBtn.removeClass("clicked");this.$playBtn.find(".blind").text("\uc7ac\uc0dd")}else{this.$playBtn.addClass("clicked");this.$playBtn.find(".blind").text("\uc77c\uc2dc\uc815\uc9c0")}}}, {key:"render",value:function render(ratio){var force=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var index=this.getIndex(ratio);if(force||this.lastIndex!==index)this.renderCallback(index, ratio);if(typeof this.tickCallback==="function")this.tickCallback(index,ratio);this.lastIndex=index;this.slider.set(ratio)}}, {key:"getIndex",value:function getIndex(ratio){var elapsed=this.getTotalDuration()*ratio;return Math.min(Math.floor(elapsed/this.SliderPlayerConfig.displayPerEach),this.totalDataCount-1)}}, {key:"onTick",value:function onTick(e){this.render(e.ratio)}}, {key:"onSlideStart",value:function onSlideStart(e){this.isPlayingWhenSlideStart=!this.timer.isPaused;this.timer.pause();if(typeof this.slideStartCallback==="function")this.slideStartCallback()}}, {key:"onSlideEnd",value:function onSlideEnd(e){this.render(parseFloat(e[0]),true);if(this.isPlayingWhenSlideStart)this.timer.start();this.isPlayingWhenSlideStart=false;oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(this.clickCode,"playdrag"));if(typeof this.slideEndCallback==="function")this.slideEndCallback()}}, {key:"onSlide",value:function onSlide(e){this.timer.seek(parseFloat(e[0]));var index=this.getIndex(parseFloat(e[0]));if(this.lastIndex!==index)this.slideCallback(index,parseFloat(e[0]));this.lastIndex= index}}, {key:"setSeek",value:function setSeek(ratio){this.timer.seek(ratio)}}, {key:"getSlider",value:function getSlider(){return this.slider}}, {key:"togglePlay",value:function togglePlay(){this.timer.isPaused?this.timer.start():this.timer.pause()}}, {key:"updateTotalDataCount",value:function updateTotalDataCount(){this.totalDataCount=this.$slider.data("duration")}}, {key:"updateTotalDuration",value:function updateTotalDuration(){this.timer.duration=this.getTotalDuration()}}, {key:"updateRenderCallback",value:function updateRenderCallback(renderCallback){this.renderCallback=renderCallback}}, {key:"updateSlideCallback",value:function updateSlideCallback(slideCallback){this.slideCallback=slideCallback}}, {key:"updateDisplayPerEach",value:function updateDisplayPerEach(displayPerEach){this.SliderPlayerConfig.displayPerEach=displayPerEach}}, {key:"resetSlider",value:function resetSlider(isStart){var _this=this;if(this.autoStartTimeoutId)clearTimeout(this.autoStartTimeoutId);this.timer.pause();this.timer.seek(0);this.slider.reset();this.lastIndex= null;if(!this.$target.hasClass("hide")){this.renderCallback(0,0);if(typeof this.tickCallback==="function")this.tickCallback(0,0);if(isStart)this.autoStartTimeoutId=setTimeout(function(){_this.$playBtn.click()}, 1E3)}}}]); return noUiSliderPlayerService}(); var oAqfPhotoType={"PM10_9KM":{type:"pm10",srcResolution:"9km",limit:84},"PM10_27KM":{type:"pm10",srcResolution:"27km",limit:84},"PM25_9KM":{type:"pm25",srcResolution:"9km",limit:84},"PM25_27KM":{type:"pm25", srcResolution:"27km",limit:84}};var oSrmPhotoType={"SAT":{type:"sat",limit:12},"RDR":{type:"rdr",limit:12},"MAPLE":{type:"maple",limit:12}}; function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i=2&&_.isArray(coords[0])&&_.isArray(coords[1])&&_.isArray(coords[0][0])&&_.isArray(coords[1][0])&&_.isNumber(coords[0][0][0])&&_.isNumber(coords[1][0][0]);if(shouldConvert)return{type:"MultiPolygon", coordinates:coords.map(function(ring){return[ring]})}; return geometry}}, {key:"removeInvalidHoles",value:function removeInvalidHoles(geometry){if(!(geometry===null||geometry===void 0?void 0:geometry.coordinates))return geometry;var filterInvalidHoles=function filterInvalidHoles(rings){var invalidHoleCount= rings.filter(function(ring,i){return i>0&&ring.length<=4}).length; if(invalidHoleCount!==1)return rings;return rings.filter(function(ring,i){return i===0||ring.length>4})}; if(geometry.type==="Polygon")return _objectSpread({},geometry,{coordinates:filterInvalidHoles(geometry.coordinates)});else if(geometry.type==="MultiPolygon")return _objectSpread({},geometry,{coordinates:geometry.coordinates.map(filterInvalidHoles)}); return geometry}}, {key:"toLatLng",value:function toLatLng(coord){return new naver.maps.LatLng(coord[1],coord[0])}}, {key:"addGeoJsonOverlay",value:function addGeoJsonOverlay(geoJson){var _this=this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaultOptions={fillColor:"#f44336",fillOpacity:.3, strokeColor:"#f44336",strokeWeight:1,strokeOpacity:.6,strokeStyle:"solid",zIndex:2,clickable:false,visible:false};var mergedOptions=_objectSpread({},defaultOptions,{},options);if(!(geoJson===null||geoJson=== void 0?void 0:geoJson.geometry))return null;var geomType=geoJson.geometry.type;var coords=geoJson.geometry.coordinates;var result;if(geomType==="Polygon")result=new naver.maps.Polygon(_objectSpread({map:this.naverMap, paths:coords.map(function(ring){return ring.map(function(c){return _this.toLatLng(c)})})},mergedOptions)); else if(geomType==="MultiPolygon"){var polygons=coords.map(function(polygon){var paths=polygon.map(function(ring){return ring.map(function(c){return _this.toLatLng(c)})}); return new naver.maps.Polygon(_objectSpread({map:_this.naverMap,paths:paths},mergedOptions))}); result={polygons:polygons,setMap:function setMap(map){return polygons.forEach(function(p){return p.setMap(map)})}, setVisible:function setVisible(visible){return polygons.forEach(function(p){return p.setVisible(visible)})}, setOptions:function setOptions(opts){return polygons.forEach(function(p){return p.setOptions(opts)})}}}return result}}, {key:"removeOverlay",value:function removeOverlay(polygon){if(!polygon)return;polygon.setVisible(false);polygon.setMap(null)}}, {key:"fadeInOverlay",value:function fadeInOverlay(targets){var duration=arguments.length>1&&arguments[1]!==undefined?arguments[1]:200;var start=performance.now();targets.forEach(function(_ref){var _polygon$setOptions; var polygon=_ref.polygon;polygon===null||polygon===void 0?void 0:(_polygon$setOptions=polygon.setOptions)===null||_polygon$setOptions===void 0?void 0:_polygon$setOptions.call(polygon,{fillOpacity:0,strokeOpacity:0})}); var rafId=null;var tick=function tick(now){var t=Math.min(1,Math.max(0,(now-start)/duration));targets.forEach(function(_ref2){var _polygon$setOptions2;var polygon=_ref2.polygon,_ref2$fillOpacity=_ref2.fillOpacity, fillOpacity=_ref2$fillOpacity===void 0?.3:_ref2$fillOpacity,_ref2$strokeOpacity=_ref2.strokeOpacity,strokeOpacity=_ref2$strokeOpacity===void 0?.6:_ref2$strokeOpacity;if(!polygon)return;(_polygon$setOptions2= polygon.setOptions)===null||_polygon$setOptions2===void 0?void 0:_polygon$setOptions2.call(polygon,{fillOpacity:fillOpacity*t,strokeOpacity:strokeOpacity*t})}); if(t<1)rafId=requestAnimationFrame(tick)}; rafId=requestAnimationFrame(tick);return function(){return cancelAnimationFrame(rafId)}}}],[{key:"createLayer", value:function createLayer(naverMap,options){if(PolygonGlLayer.isSupported(naverMap))return new PolygonGlLayer(naverMap,options);return new PolygonDataLayer(naverMap,options)}}]); return PolygonService}(); function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i= _this.nStandardZoom)_this.clearMarker();else if(_this.nLastZoom>=_this.nStandardZoom&&intZoom<_this.nStandardZoom)_this.clearMarker();_this.nLastZoom=intZoom})}}, {key:"syncTalkMap",value:function syncTalkMap(zoom,center){var activeTemplateIndex=oBlockScriptService.callTemplateFunc("regionTalk","getEnabledVisualMapIndex")[0];if(this.checkTalkMapEnabled()&&activeTemplateIndex!== this.visualMapTemplateIndex){var visualMapList=oBlockScriptService.getTemplateInstanceInfoList("visualMap");for(var index in visualMapList){var templateIndex="".concat(Number(index)+1);if(templateIndex!== "".concat(this.visualMapTemplateIndex)){var activeTalkMap=oBlockScriptService.callTemplateFuncWithIndex("visualMap",templateIndex,"executeTalkMapServiceCheckTalkMapEnabled");if(activeTalkMap)oBlockScriptService.callTemplateFuncWithIndex("visualMap", templateIndex,"executeTalkMapServiceMoveImmediately",zoom,center.y,center.x,this.selectedRegion)}}}}}, {key:"clickTalkMapMaTime",value:function clickTalkMapMaTime(e){var $current=$(e.currentTarget);this.currentMaTime=$current.attr("value");this.element.find(".marker_talk").addClass("hide");this.element.find('.marker_talk[data-time\x3d"'.concat(this.currentMaTime, '"]')).removeClass("hide");oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"jebotime"))}}, {key:"clickMapTab",value:function clickMapTab(e){if(!$(e.currentTarget).hasClass("on"))this.enableTalkMap();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"jebobtn"))}}, {key:"enableTalkMap",value:function enableTalkMap(){var nation=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.visualMapTemplateIndex, "enableTalkMapMode");this.element.find("._cnTalkMapMaBtn").removeClass("hide");this.selectedRegion=oBlockScriptService.callTemplateFunc("regionTalk","getCurrentLowLevelRegionCode")[0]||"";this.element.find(".marker_talk").removeClass("on"); this.element.find("._cnTalkMap").addClass("on");this.isTalkMapEnabled=true;if(nation)this.focusNation();if(this.talkMapRegionInfoMap==null)this.ajaxTalkMapRegionInfo();this.ajaxTalkCount();if(this.fnOnCallback)this.fnOnCallback()}}, {key:"focusNation",value:function focusNation(){if(!this.checkTalkMapEnabled())return;this.selectedRegion="";this.moveImmediately(this.nMinZoom,35.767877,127.6193286)}}, {key:"moveImmediately",value:function moveImmediately(zoom,latitude,longitude){var selectedRegion=arguments.length>3&&arguments[3]!==undefined?arguments[3]:undefined;this.naverMap.setZoom(zoom);this.naverMap.setCenter(new naver.maps.LatLng(latitude, longitude));if(selectedRegion!==undefined)this.selectedRegion=selectedRegion}}, {key:"disableTalkMap",value:function disableTalkMap(targetInstance){this.element.find("._cnTalkMapMaBtn").addClass("hide");if(targetInstance){targetInstance.element.find("._cnTalkMap").removeClass("on"); if(this.element===targetInstance.element){this.isTalkMapEnabled=false;this.clearMarker()}}else{this.element.find("._cnTalkMap").removeClass("on");this.isTalkMapEnabled=false;this.clearMarker()}}}, {key:"ajaxTalkMapRegionInfo",value:function ajaxTalkMapRegionInfo(){if(this.commentKey===null)this.commentKey=oBlockScriptService.callTemplateFunc("regionTalk","getCommentKey")[0];var _this=this;var choiceQueryString= {"talkMapRegionInfo":{"commentKey":this.commentKey}};oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){if(result.talkMapRegionInfo!==undefined){_this.talkMapRegionInfoMap=result.talkMapRegionInfo; oBlockScriptService.setSingletonInstance("talkMapRegionInfoMap",_this.talkMapRegionInfoMap);var validRegionCode=_this.selectedRegion?sRegionCode:_this.selectedRegion;var validObjectRegionCode=validRegionCode.length>= 2?validRegionCode.substring(0,2):"00";var validCategoryRegionCode=validRegionCode.length>=5?validRegionCode.substring(0,5):validObjectRegionCode;if(validObjectRegionCode&&validCategoryRegionCode){if(validCategoryRegionCode=== "00")_this.focusNation();else _this.findSelectedRegionMarker(validCategoryRegionCode);if(!(talkRegionCode&&talkRegionCode!=="00"&&talkCategoryRegionCode&&talkCategoryRegionCode.length>=5))oBlockScriptService.callTemplateFunc("regionTalk", "initCommentWithTalkTab",validObjectRegionCode,validCategoryRegionCode,"city")}}})}}, {key:"countToTalkMapClass",value:function countToTalkMapClass(count){if(count<10)return"level0";else if(count<30)return"level1";else if(count<100)return"level2";else if(count<300)return"level3";else if(count< 500)return"level4";else if(count<1E3)return"level5";else return"level6"}}, {key:"makeTalkMapStatsParams",value:function makeTalkMapStatsParams(){if(!this.checkTalkMapEnabled())return null;var oLatLngBounds=this.naverMap.getBounds();if(!$.isEmptyObject(oLatLngBounds)){var nMinX= oLatLngBounds.minX();var nMinY=oLatLngBounds.minY();var nMaxX=oLatLngBounds.maxX();var nMaxY=oLatLngBounds.maxY();var sBbounds=nMinX+"#"+nMinY+"#"+nMaxX+"#"+nMaxY;var intZoom=Math.round(this.naverMap.getZoom()); this.isTalkMapEnabled=false;if(this.commentKey===null)this.commentKey=oBlockScriptService.callTemplateFunc("regionTalk","getCommentKey")[0];return{"visualMapTalkStats":{"zoomLevel":"".concat(intZoom),"bounds":sBbounds, "commentKey":this.commentKey},"visualMapCoordinate":{"visualMapType":"talk","bounds":sBbounds},"intZoom":intZoom}}return null}}, {key:"ajaxTalkCount",value:function ajaxTalkCount(){var _this=this;var params=this.makeTalkMapStatsParams();if(!params)return;var url;var intZoom=params["intZoom"]||0;delete params["intZoom"];if(phase=== "real"||phase==="staging")url="https://apis.naver.com/weather-v2/weather-v2/weather-api-v2-choice";else if(phase==="local")url="https://dev.apis.naver.com/weather-v2/weather-v2/weather-api-v2-choice";else url= "https://dev.apis.naver.com/weather-v2/weather-v2/weather-api-v2-choice";oBlockScriptService.ajaxChoiceApiWithUrl(url,params,function(result){_this.processMapTalkStats((result===null||result===void 0?void 0: result.visualMapTalkStats)||[],intZoom);_this.processMapCoordinate((result===null||result===void 0?void 0:result.visualMapCoordinate)||{})},function(){_this.talkMapAjaxAlwaysCallback()})}}, {key:"talkMapAjaxAlwaysCallback",value:function talkMapAjaxAlwaysCallback(){if(this.element.find("._cnTalkMap").hasClass("on"))this.isTalkMapEnabled=true}}, {key:"processMapCoordinate",value:function processMapCoordinate(visualMapCoordinate){var coordinateType=visualMapCoordinate.coordinateType||"";oBlockScriptService.callTemplateFuncWithIndex("visualMap", this.visualMapTemplateIndex,"changeMapBtnStatus",coordinateType)}}, {key:"processMapTalkStats",value:function processMapTalkStats(dataList,intZoom){if(!this.checkTalkMapEnabled())return;var _this=this;if(dataList!==undefined&&dataList.length>0&&intZoom==Math.round(_this.naverMap.getZoom())){if(!this.element.find("._cnTalkMap").hasClass("on"))return; var talkStatsList=dataList||[];var maTimeList=[];_this.element.find("._cnTalkMapMaTime").each(function(index,element){return maTimeList.push($(element).attr("value"))}); for(var i in talkStatsList){var templateName="_idTalkMapMarkerTemplate";var oTemplate=Handlebars.getTemplateSync(templateName);var talkStats=talkStatsList[i];var regionInfo=talkStats.regionInfo;var latitude= regionInfo.latitude;var longitude=regionInfo.longitude;var regionCode=regionInfo.regionCode;var countStats=talkStats.countStats;var stats=JSON.parse((countStats===null||countStats===void 0?void 0:countStats.stats)|| "{}");var eventGrade=(countStats===null||countStats===void 0?void 0:countStats.eventGrade)&&true;var currentRegion=_this.selectedRegion==regionCode;var markerHtml="";var _dataList=[];var currentMaCount= 0;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=maTimeList[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion= true){var _maStats$count;var maTime=_step.value;var maTimeKey="PT".concat(maTime,"H");var maStats=stats[maTimeKey]||{};var maCount=(_maStats$count=maStats===null||maStats===void 0?void 0:maStats.count)!== null&&_maStats$count!==void 0?_maStats$count:0;var maCountTalkClass=_this.countToTalkMapClass(maCount);var maCountStr=oTalkStatsUtils.formatCount(maCount);var currentMa="PT".concat(this.currentMaTime,"H")=== maTimeKey;var data={regionCode:regionCode,regionName:regionInfo.regionName,count:maCountStr,numCount:maCount,talkCountClass:maCountTalkClass,maTime:maTime,hide:currentMa?"":"hide",eventGrade:eventGrade, currentRegion:currentRegion?"on":""};_dataList.push(data);markerHtml+=oTemplate(data);if(currentMa)currentMaCount=maCount}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&& _iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}if(this.element.find('.marker_talk[data-region-code\x3d"'.concat(regionCode,'"]:not(.hide)')).length> 0)_this.updateMarker(_dataList);else{var marker=_this.addMarker(latitude,longitude,regionCode,markerHtml,currentMaCount);_this.markerList.push(marker)}}}else _this.clearMarker();_this.optimizeMarker(); _this.intersectsMarkerRemove()}}, {key:"updateMarker",value:function updateMarker(dataList){var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=dataList[Symbol.iterator](), _step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var data=_step2.value;var $marker=this.element.find('.marker_talk[data-region-code\x3d"'.concat(data.regionCode, '"][data-time\x3d"').concat(data.maTime,'"]'));$marker.find("._cnRegionName").html(data.regionName);$marker.find("._cnCount").html(data.count);if("".concat(this.currentMaTime)==="".concat(data.maTime))$marker.attr("class", "marker_talk ".concat(data.talkCountClass));else $marker.attr("class","marker_talk ".concat(data.talkCountClass," hide"));$marker.parent("div").parent("div").css("z-index",data.numCount);if(this.selectedRegion== data.regionCode){$marker.addClass("on");$marker.parent("div").parent("div").css("z-index",999999999)}else $marker.parent("div").parent("div").css("z-index",data.numCount)}}catch(err){_didIteratorError2= true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}}}, {key:"addMarker",value:function addMarker(latitude,longitude,id,elContent,count){var $element=$(elContent).filter('.marker_talk[data-time\x3d"'.concat(this.currentMaTime,'"]'));var width=$element.data("width"); var height=$element.data("height");if($element.data("regionCode")==this.selectedRegion)count=999999999;var marker=new naver.maps.Marker({position:new naver.maps.LatLng(latitude,longitude),map:this.naverMap, icon:{content:elContent,size:new naver.maps.Size(width,height),anchor:function anchor(){return function(elWidth,elHeight){return new naver.maps.Point(elWidth*.5,elHeight*.5)}}}, zIndex:count});naver.maps.Event.addListener(marker,"click",$.proxy(this.clickMarker,this));$(".marker_talk").parent().addClass("pin_wrap");return marker}}, {key:"clickMarker",value:function clickMarker(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"jebomrk"));var regionCode=encodeURIComponent($(e.overlay.eventTarget).find(".marker_talk:not(.hide)").data("regionCode")); this.element.find(".marker_talk").removeClass("on");this.element.find('.marker_talk[data-region-code\x3d"'.concat(regionCode,'"]')).addClass("on");var zoomLevel=this.nCategoryStartZoom;this.selectedRegion= regionCode;if(Math.round(this.naverMap.getZoom())2?regionCode:null;oBlockScriptService.callTemplateFunc("regionTalk","initCommentWithTalkTab", objectRegionCode,categoryRegionCode,"city");var $foldBtn=$("._cnTalkMapFoldBtn");if($foldBtn.attr("aria-selected")==="false")$foldBtn.click();else oBlockScriptService.callTemplateFunc("regionTalk","enableTalk"); this.intersectsMarkerSetTop(e.overlay)}}, {key:"findSelectedRegionMarker",value:function findSelectedRegionMarker(regionCode){var moveImmediately=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.checkTalkMapEnabled())return; if(this.talkMapRegionInfoMap==null||!this.talkMapRegionInfoMap[regionCode])return;var latitude=this.talkMapRegionInfoMap[regionCode].latitude;var longitude=this.talkMapRegionInfoMap[regionCode].longitude; var zoomLevel;if(regionCode.length===2)zoomLevel=this.nObjectStartZoom;else zoomLevel=this.nCategoryStartZoom;this.selectedRegion=regionCode;if(moveImmediately)this.moveImmediately(zoomLevel,latitude,longitude); else this.naverMap.morph(new naver.maps.LatLng(latitude,longitude),zoomLevel);this.element.find(".marker_talk").removeClass("on");this.element.find('.marker_talk[data-region-code\x3d"'.concat(regionCode, '"]')).addClass("on")}}, {key:"intersectsMarkerSetTop",value:function intersectsMarkerSetTop(selectedMarker){selectedMarker.setZIndex(++this.nLastZIndex)}}, {key:"intersectsMarkerRemove",value:function intersectsMarkerRemove(){if(Math.round(this.naverMap.getZoom())=after1HourYmdt}); if(_.isEmpty(this.airHourlyList)){this.element.addClass("hide");return}this.render()}}, {key:"initAfter",value:function initAfter(){if(_.isEmpty(this.airHourlyList))return;this.controlDay()}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll();var scrollName=this.element.find(".scroll_area").data("name");this.controlDay();oCommon.controlScrollButton(oCommon.oScroll[scrollName], oCommon.oScroll[scrollName].wrapper,true)}}, {key:"initScroll",value:function initScroll(){var _this=this;oCommon.initScroll(this.element.find(".scroll_area"),function(){_this.controlDay()})}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"scrollToElementByDay",value:function scrollToElementByDay(aplYmdt,timeout){var scrollName=this.element.find(".scroll_area").data("name");setTimeout(function(){if(oCommon.oScroll[scrollName]){var targetElement= $("#_idAirHourly-".concat(aplYmdt))[0]||oCommon.oScroll[scrollName].scroller.children[0];oCommon.scrollToCell(scrollName,targetElement,500,1)}},oCommon.oScroll[scrollName]?0:timeout)}}, {key:"render",value:function render(){this.renderAirHourlyFcast();this.renderOfferArea();this.initScroll()}}, {key:"renderAirHourlyFcast",value:function renderAirHourlyFcast(){var _this2=this;var combinedTimeHtml="";var combinedPm10Html="";var combinedPm25Html="";this.airHourlyList.forEach(function(data){var aplYmdt= "".concat(data.aplYmd).concat(data.aplTm);var date=moment(aplYmdt,"YYYYMMDDHH").utcOffset(9);var diffDays=moment(date.format("YYYYMMDD")).diff(_this2.nowMoment.format("YYYYMMDD"),"days");var dateHours= date.format("HH");var dayClass="_cnDay";var timeClass;var timeText;if(diffDays===1&&dateHours==="00"){timeClass="type_tomorrow _cnTomorrow";timeText="\ub0b4\uc77c"}else if(diffDays===2&&dateHours==="00"){timeClass= "type_after_tomorrow _cnAfterTomorrow";timeText="\ubaa8\ub808"}else if(diffDays===3&&dateHours==="00"){timeClass="type_after_tomorrow _cnTwoDaysAfterTomorrow";timeText="\uae00\ud53c"}else{dayClass="";timeClass= "";timeText=date.format("H\uc2dc")}var timeHtml='\n \x3cth class\x3d"'.concat(dayClass,'" id\x3d"_idAirHourly-').concat(aplYmdt,'"\x3e\n \x3cspan class\x3d"card_table_data ').concat(timeClass, '" data-day\x3d"').concat(timeText,'"\x3e').concat(timeText,"\x3c/span\x3e\n \x3c/th\x3e\n ");var pm10Html='\n \x3ctd\x3e\n \x3cspan class\x3d"card_table_data '.concat(data.pm10LevelClass, '"\x3e').concat(_this2.getPmGradeWithDefault(data.pm10LevelClass,_this2.getShortLegend(data.pm10,data.pm10Grade)),"\x3c/span\x3e\n \x3c/td\x3e\n ");var pm25Html='\n \x3ctd\x3e\n \x3cspan class\x3d"card_table_data '.concat(data.pm25LevelClass, '"\x3e').concat(_this2.getPmGradeWithDefault(data.pm25LevelClass,_this2.getShortLegend(data.pm25,data.pm25Grade)),"\x3c/span\x3e\n \x3c/td\x3e\n ");combinedTimeHtml+=timeHtml; combinedPm10Html+=pm10Html;combinedPm25Html+=pm25Html}); this.element.find("._cnAirTime").append(combinedTimeHtml);this.element.find("._cnPm10").append(combinedPm10Html);this.element.find("._cnPm25").append(combinedPm25Html)}}, {key:"controlDay",value:function controlDay(){var _this3=this;var dayElementArray=this.element.find("._cnDay").toArray();var beforeDayArray=dayElementArray.filter(function(item){var itemRight=item.getBoundingClientRect().right; var basePadding=_this3.element.find("._cnAirHourlyDay").get(0).getBoundingClientRect().right;return itemRight-basePadding<=$(item).width()}); this.element.find("._cnState").addClass("hide");this.element.find("._cnDay ._cnTomorrow").text("\ub0b4\uc77c");this.element.find("._cnDay ._cnAfterTomorrow").text("\ubaa8\ub808");this.element.find("._cnDay ._cnTwoDaysAfterTomorrow").text("\uae00\ud53c"); if(beforeDayArray.length>0){var lastBeforeDay=$(beforeDayArray.pop());switch(lastBeforeDay.children(0).data("day")){case "\ub0b4\uc77c":this.element.find("._cnState._cnTomorrow").removeClass("hide");break; case "\ubaa8\ub808":this.element.find("._cnState._cnAfterTomorrow").removeClass("hide");break;case "\uae00\ud53c":this.element.find("._cnState._cnTwoDaysAfterTomorrow").removeClass("hide");break}lastBeforeDay.children(0).text("0\uc2dc")}else this.element.find("._cnState._cnToday").removeClass("hide")}}, {key:"renderOfferArea",value:function renderOfferArea(){var _this$templateData2;if(_.isEmpty(this.airHourlyList))return;var offerMoment=moment((_this$templateData2=this.templateData)===null||_this$templateData2=== void 0?void 0:_this$templateData2.fcastYmdt,"YYYYMMDDHHmm").utcOffset(9);var html='\x3cspan class\x3d"card_provide_text"\x3e\x3ca href\x3d"https://www.kweather.co.kr" class\x3d"card_text_link" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'source\')" data-nlog-area\x3d"air_hourly_forecast.source_link" data-nlog-params\x3d\'{"weather_cp":"kweather"}\'\x3e\ucf00\uc774\uc6e8\ub354\x3c/a\x3e \uc2dc\uac04\ubcc4\uc608\ubcf4').concat(offerMoment.isValid()? ", "+offerMoment.format("HH:mm")+" \uc5c5\ub370\uc774\ud2b8":"","\x3c/span\x3e");this.element.find("._cnAirHourlyFcastOffer").html(html)}}, {key:"getPmGradeWithDefault",value:function getPmGradeWithDefault(pmLevelClass,pmGrade){return pmLevelClass===this.NONE_CLASS_NAME?"-":pmGrade||"-"}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){return{airHourlyData:{fields:["airHourlyList"],minLength:12}}}}, {key:"getShortLegend",value:function getShortLegend(value,legend){if(value===3)return"\ud55c\ub54c";else if(value===5)return"\ub9e4\uc6b0";else return legend}}]); return airHourlyFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0;if(isExisted)return;var buttonHtml="";var targetClassName="";if(targetDateType==="today")targetClassName="_cnAirNationTodayTime";else if(targetDateType==="tomorrow")targetClassName= "_cnAirNationTomorrowTime";this.getThreeHourSlot(targetDateType).forEach(function(slot,index){buttonHtml+='\n \x3cbutton type\x3d"button" class\x3d"time_list_item type_basic '.concat(targetClassName, ' _cnAirNationTimeButton" data-tab-name\x3d"').concat(targetDateType,'" data-hday\x3d"3h" data-hour\x3d"').concat(slot.start,'" ').concat(index===0?'aria-pressed\x3d"true"':""," onclick\x3d\"oCommon.fnSendClick(event, '").concat(blockPageNameEn, ".").concat(_this3.clickCode,'fortbut\')" data-nlog-area\x3d"air_nation.time_button" data-nlog-params\x3d\'{"date_type":"').concat(targetDateType,'","hour":"').concat(slot.start,"\"}'\x3e").concat(slot.label, "\x3c/button\x3e\n ")}); if(buttonHtml)timeArea.append(buttonHtml)}}, {key:"getCurrentTargetSelection",value:function getCurrentTargetSelection(){var dateInfo=this.getSelectedDateInfo();if(dateInfo["dateType"]==="today")if(this.element.find("input:radio[name\x3d'cnAirNationRadio']:checked").val()=== "now")return"._cnAirNationTodayCurrent";else return"._cnAirNationTodayForecast";else if(dateInfo["dateType"]==="tomorrow")return"._cnAirNationTomorrowForecast";else return"._cnAirNationAMPMForecast"}}, {key:"getThreeHourSlot",value:function getThreeHourSlot(dateType){var now=moment().utc().add(540,"minutes");var slots=[];var addSlots=function addSlots(startHour){for(var i=startHour;i<24;i+=3){var endHour= i===21?"24":moment({hour:i+3}).format("HH");slots.push({start:moment({hour:i}).format("HH"),end:endHour,label:moment({hour:i}).format("HH")+"~"+endHour+"\uc2dc"})}}; if(dateType==="tomorrow")addSlots(0);else{var currentHour=now.hour();var startHour=Math.floor(currentHour/3)*3;addSlots(startHour)}return slots}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return!sRegionCode.startsWith("WD")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"resetScrollTarget",value:function resetScrollTarget(targetSelector){if(!targetSelector)return;var target=this.element.find(targetSelector);if(target.length===0)return;oCommon.initScroll(target)}}, {key:"resetScroll",value:function resetScroll(){var _this4=this;var targets=this.element.find("._cnAirNationScroll");if(targets)targets.each(function(index,target){var selectorName=$(target).data("selector-name"); _this4.resetScrollTarget("._cnAirNationScroll."+selectorName)})}}]); return airNation}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)return;this.initCurrentTomorrowInfo();this.initDustInfo();this.initScroll();this.initUpdateTime(); this.initWhoTooltip();this.initNowTooltip()}}, {key:"toggleWhoTooltip",value:function toggleWhoTooltip(e){e.preventDefault();var $currentTarget=this.element.find(".type_who ._cnWhoTooltip");var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer(); if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"toggleNowTooltip",value:function toggleNowTooltip(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"info"));var $currentTarget=this.element.find(".card_dust_provide ._cnNowTooltip"); var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer();if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"toggleDelayTooltip",value:function toggleDelayTooltip(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"delay"));var $currentTarget=this.element.find(".card_dust_provide ._cnNowDelayTooltip"); var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer();if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"toggle",value:function toggle(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"flk"));var $currentTarget=$(e.currentTarget);var changed=false;if($currentTarget.hasClass("_cnShowCurrent")){this.element.find("._cnTomorrow").removeClass("is-active").end().find("._cnCurrent").addClass("is-active"); this.scrollToElementByDay(0);changed=true}else if($currentTarget.hasClass("_cnShowTomorrow")){this.element.find("._cnCurrent").removeClass("is-active").end().find("._cnTomorrow").addClass("is-active"); this.scrollToElementByDay(1);changed=true}if(changed){this.initCurrentTomorrowInfo();this.initWhoTooltip()}}}, {key:"scrollToElementByDay",value:function scrollToElementByDay(days){var aplYmdt=moment().add(days,"days").format("YYYYMMDD")+"00";oBlockScriptService.callTemplateFunc("airHourlyFcast","scrollToElementByDay", aplYmdt,500)}}, {key:"initCurrentTomorrowInfo",value:function initCurrentTomorrowInfo(){var _this$templateData,_this$templateData$ai,_this$templateData2,_this$templateData2$a,_this$templateData3,_this$templateData3$a, _this$templateData4,_this$templateData4$a,_this$templateData5,_this$templateData5$a,_this$templateData6,_this$templateData6$a,_this$templateData$ai2,_this$templateData7,_this$templateData7$a,_this$templateData8, _this$templateData8$a,_this$templateData9,_this$templateData9$a,_this$templateData$ai3,_this$templateData0,_this$templateData0$a,_this$templateData1,_this$templateData1$a,_this$templateData10,_this$templateData10$, _this$templateData11,_this$templateData11$,_this$templateData12,_this$templateData12$,_this$templateData13,_this$templateData13$,_this$templateData14,_this$templateData14$,_this$templateData15,_this$templateData15$, _this$templateData16,_this$templateData16$,_this$templateData17,_this$templateData17$,_this$templateData$ai4,_this$templateData18,_this$templateData18$,_this$templateData19,_this$templateData19$,_this$templateData20, _this$templateData20$,_this$templateData$ai5,_this$templateData21,_this$templateData21$,_this$templateData22,_this$templateData22$,_this$templateData23,_this$templateData23$,_this$templateData24,_this$templateData24$, _this$templateData25,_this$templateData25$,_this$templateData26,_this$templateData26$,_this$templateData27,_this$templateData27$,_this$templateData$ai6,_this$templateData28,_this$templateData28$,_this$templateData29, _this$templateData29$,_this$templateData30,_this$templateData30$,_this$templateData$ai7,_this$templateData31,_this$templateData31$,_this$templateData32,_this$templateData32$,_this$templateData33,_this$templateData33$; var today=moment().utc().add(540,"minutes");var currentPm10Value=oCommon.fnGetAirNumberValueWithDefault((_this$templateData=this.templateData)===null||_this$templateData===void 0?void 0:(_this$templateData$ai= _this$templateData.airNow)===null||_this$templateData$ai===void 0?void 0:_this$templateData$ai.stationPm10);var currentPm25Value=oCommon.fnGetAirNumberValueWithDefault((_this$templateData2=this.templateData)=== null||_this$templateData2===void 0?void 0:(_this$templateData2$a=_this$templateData2.airNow)===null||_this$templateData2$a===void 0?void 0:_this$templateData2$a.stationPm25);var currentPm10Class=((_this$templateData3= this.templateData)===null||_this$templateData3===void 0?void 0:(_this$templateData3$a=_this$templateData3.airNow)===null||_this$templateData3$a===void 0?void 0:_this$templateData3$a.stationPm10LevelClass)|| this.NONE_LEVEL_CLASS;var currentPm25Class=((_this$templateData4=this.templateData)===null||_this$templateData4===void 0?void 0:(_this$templateData4$a=_this$templateData4.airNow)===null||_this$templateData4$a=== void 0?void 0:_this$templateData4$a.stationPm25LevelClass)||this.NONE_LEVEL_CLASS;var currentPm10Legend=((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:(_this$templateData5$a= _this$templateData5.airNow)===null||_this$templateData5$a===void 0?void 0:_this$templateData5$a.stationPm10Legend)||this.PM_NO_DATA_TEXT;var currentPm25Legend=((_this$templateData6=this.templateData)=== null||_this$templateData6===void 0?void 0:(_this$templateData6$a=_this$templateData6.airNow)===null||_this$templateData6$a===void 0?void 0:_this$templateData6$a.stationPm25Legend)||this.PM_NO_DATA_TEXT; var currentPm10DonutDegree=(_this$templateData$ai2=(_this$templateData7=this.templateData)===null||_this$templateData7===void 0?void 0:(_this$templateData7$a=_this$templateData7.airNow)===null||_this$templateData7$a=== void 0?void 0:_this$templateData7$a.stationPm10DonutDegreeValue)!==null&&_this$templateData$ai2!==void 0?_this$templateData$ai2:0;var currentPm10DonutColor=((_this$templateData8=this.templateData)===null|| _this$templateData8===void 0?void 0:(_this$templateData8$a=_this$templateData8.airNow)===null||_this$templateData8$a===void 0?void 0:_this$templateData8$a.stationPm10DonutColor)||this.NONE_COLOR;var currentPm10DonutBgColor= ((_this$templateData9=this.templateData)===null||_this$templateData9===void 0?void 0:(_this$templateData9$a=_this$templateData9.airNow)===null||_this$templateData9$a===void 0?void 0:_this$templateData9$a.stationPm10DonutBgColor)|| this.NONE_COLOR;var currentPm25DonutDegree=(_this$templateData$ai3=(_this$templateData0=this.templateData)===null||_this$templateData0===void 0?void 0:(_this$templateData0$a=_this$templateData0.airNow)=== null||_this$templateData0$a===void 0?void 0:_this$templateData0$a.stationPm25DonutDegreeValue)!==null&&_this$templateData$ai3!==void 0?_this$templateData$ai3:0;var currentPm25DonutColor=((_this$templateData1= this.templateData)===null||_this$templateData1===void 0?void 0:(_this$templateData1$a=_this$templateData1.airNow)===null||_this$templateData1$a===void 0?void 0:_this$templateData1$a.stationPm25DonutColor)|| this.NONE_COLOR;var currentPm25DonutBgColor=((_this$templateData10=this.templateData)===null||_this$templateData10===void 0?void 0:(_this$templateData10$=_this$templateData10.airNow)===null||_this$templateData10$=== void 0?void 0:_this$templateData10$.stationPm25DonutBgColor)||this.NONE_COLOR;var currentPm10WhoIsInRecommendation=((_this$templateData11=this.templateData)===null||_this$templateData11===void 0?void 0: (_this$templateData11$=_this$templateData11.airNow)===null||_this$templateData11$===void 0?void 0:_this$templateData11$.stationPm10WhoIsInRecommendation)||"-";var currentPm25WhoIsInRecommendation=((_this$templateData12= this.templateData)===null||_this$templateData12===void 0?void 0:(_this$templateData12$=_this$templateData12.airNow)===null||_this$templateData12$===void 0?void 0:_this$templateData12$.stationPm25WhoIsInRecommendation)|| "-";var currentPm25ExistYn=(((_this$templateData13=this.templateData)===null||_this$templateData13===void 0?void 0:(_this$templateData13$=_this$templateData13.airNow)===null||_this$templateData13$===void 0? void 0:_this$templateData13$.pm25ExistYn)||"")==="Y";var currentPm25WithExistYn=currentPm25ExistYn?currentPm25Value:"-";var html="";html+='\n \x3cstrong class\x3d"card_data_value"\x3e\ud604\uc7ac \x3cspan class\x3d"card_value_date"\x3e'.concat(today.format("MM.DD"), '\x3c/span\x3e\x3c/strong\x3e\n \x3cdiv class\x3d"card_data_item ').concat(currentPm10Class,'"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnCurrentPm10" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(currentPm10DonutDegree, '" data-color\x3d"').concat(currentPm10DonutColor,'" data-back-color\x3d"').concat(currentPm10DonutBgColor,'"\x3e\n \x3csvg width\x3d"79" height\x3d"78" viewBox\x3d"0 0 79 78" focusable\x3d"false" fill\x3d"none"\x3e\n \x3c/svg\x3e\n \x3c!-- donut svg --\x3e\n \x3c!-- \uc218\uce58 --\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_item_inner"\x3e\n \x3cspan class\x3d"card_item_title"\x3e\ud604\uc7ac \ubbf8\uc138\uba3c\uc9c0\x3c/span\x3e\n\n \x3cstrong class\x3d"card_item_status"\x3e').concat(currentPm10Legend, '\x3c/strong\x3e\n\n \x3cem class\x3d"card_item_text type_who"\x3e\x3cem class\x3d"card_text_emphasis"\x3eWHO\x3c/em\x3e ').concat(currentPm10WhoIsInRecommendation,'\x3c/em\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_data_item ').concat(currentPm25Class, '"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnCurrentPm25" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(currentPm25DonutDegree,'" data-color\x3d"').concat(currentPm25DonutColor, '" data-back-color\x3d"').concat(currentPm25DonutBgColor,'"\x3e\n \x3csvg width\x3d"79" height\x3d"78" viewBox\x3d"0 0 79 78" focusable\x3d"false" fill\x3d"none"\x3e\n \x3c/svg\x3e\n \x3c!-- donut svg --\x3e\n \x3c!-- \uc218\uce58 --\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_item_inner"\x3e\n \x3cspan class\x3d"card_item_title"\x3e\ud604\uc7ac \ucd08\ubbf8\uc138\uba3c\uc9c0\x3c/span\x3e\n\n \x3cstrong class\x3d"card_item_status"\x3e').concat(currentPm25Legend, '\x3c/strong\x3e\n\n \x3cem class\x3d"card_item_text type_who"\x3e\n \x3cem class\x3d"card_text_emphasis"\x3eWHO\x3c/em\x3e ').concat(currentPm25WhoIsInRecommendation, '\n \x3cdiv class\x3d"card_text_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button _cnWhoTooltip _cnWeatherInfoLayer" data-type\x3d"who" aria-pressed\x3d"false" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'whoinfo\')" data-nlog-area\x3d"air_synthesis_forecast.help_button" data-nlog-params\x3d\'{"category":"who"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/em\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); this.element.find("._cnCurrent").html("").html(html);var tomorrow=today.add(1,"days");var tomorrowAmPm10Class=((_this$templateData14=this.templateData)===null||_this$templateData14===void 0?void 0:(_this$templateData14$= _this$templateData14.airTomorrowHday)===null||_this$templateData14$===void 0?void 0:_this$templateData14$.amPm10LevelClass)||this.NONE_LEVEL_CLASS;var tomorrowAmPm25Class=((_this$templateData15=this.templateData)=== null||_this$templateData15===void 0?void 0:(_this$templateData15$=_this$templateData15.airTomorrowHday)===null||_this$templateData15$===void 0?void 0:_this$templateData15$.amPm25LevelClass)||this.NONE_LEVEL_CLASS; var tomorrowAmPm10Legend=((_this$templateData16=this.templateData)===null||_this$templateData16===void 0?void 0:(_this$templateData16$=_this$templateData16.airTomorrowHday)===null||_this$templateData16$=== void 0?void 0:_this$templateData16$.amPm10Legend)||"-";var tomorrowAmPm25Legend=((_this$templateData17=this.templateData)===null||_this$templateData17===void 0?void 0:(_this$templateData17$=_this$templateData17.airTomorrowHday)=== null||_this$templateData17$===void 0?void 0:_this$templateData17$.amPm25Legend)||"-";var tomorrowAmPm10DonutDegree=((_this$templateData$ai4=(_this$templateData18=this.templateData)===null||_this$templateData18=== void 0?void 0:(_this$templateData18$=_this$templateData18.airTomorrowHday)===null||_this$templateData18$===void 0?void 0:_this$templateData18$.amPm10DonutDegreeValue)!==null&&_this$templateData$ai4!==void 0? _this$templateData$ai4:0)/100*360;var tomorrowAmPm10DonutColor=((_this$templateData19=this.templateData)===null||_this$templateData19===void 0?void 0:(_this$templateData19$=_this$templateData19.airTomorrowHday)=== null||_this$templateData19$===void 0?void 0:_this$templateData19$.amPm10DonutColor)||this.NONE_COLOR;var tomorrowAmPm10DonutBgColor=((_this$templateData20=this.templateData)===null||_this$templateData20=== void 0?void 0:(_this$templateData20$=_this$templateData20.airTomorrowHday)===null||_this$templateData20$===void 0?void 0:_this$templateData20$.amPm10DonutBgColor)||this.NONE_COLOR;var tomorrowAmPm25DonutDegree= ((_this$templateData$ai5=(_this$templateData21=this.templateData)===null||_this$templateData21===void 0?void 0:(_this$templateData21$=_this$templateData21.airTomorrowHday)===null||_this$templateData21$=== void 0?void 0:_this$templateData21$.amPm25DonutDegreeValue)!==null&&_this$templateData$ai5!==void 0?_this$templateData$ai5:0)/100*360;var tomorrowAmPm25DonutColor=((_this$templateData22=this.templateData)=== null||_this$templateData22===void 0?void 0:(_this$templateData22$=_this$templateData22.airTomorrowHday)===null||_this$templateData22$===void 0?void 0:_this$templateData22$.amPm25DonutColor)||this.NONE_COLOR; var tomorrowAmPm25DonutBgColor=((_this$templateData23=this.templateData)===null||_this$templateData23===void 0?void 0:(_this$templateData23$=_this$templateData23.airTomorrowHday)===null||_this$templateData23$=== void 0?void 0:_this$templateData23$.amPm25DonutBgColor)||this.NONE_COLOR;var tomorrowPmPm10Class=((_this$templateData24=this.templateData)===null||_this$templateData24===void 0?void 0:(_this$templateData24$= _this$templateData24.airTomorrowHday)===null||_this$templateData24$===void 0?void 0:_this$templateData24$.pmPm10LevelClass)||this.NONE_LEVEL_CLASS;var tomorrowPmPm25Class=((_this$templateData25=this.templateData)=== null||_this$templateData25===void 0?void 0:(_this$templateData25$=_this$templateData25.airTomorrowHday)===null||_this$templateData25$===void 0?void 0:_this$templateData25$.pmPm25LevelClass)||this.NONE_LEVEL_CLASS; var tomorrowPmPm10Legend=((_this$templateData26=this.templateData)===null||_this$templateData26===void 0?void 0:(_this$templateData26$=_this$templateData26.airTomorrowHday)===null||_this$templateData26$=== void 0?void 0:_this$templateData26$.pmPm10Legend)||"-";var tomorrowPmPm25Legend=((_this$templateData27=this.templateData)===null||_this$templateData27===void 0?void 0:(_this$templateData27$=_this$templateData27.airTomorrowHday)=== null||_this$templateData27$===void 0?void 0:_this$templateData27$.pmPm25Legend)||"-";var tomorrowPmPm10DonutDegree=((_this$templateData$ai6=(_this$templateData28=this.templateData)===null||_this$templateData28=== void 0?void 0:(_this$templateData28$=_this$templateData28.airTomorrowHday)===null||_this$templateData28$===void 0?void 0:_this$templateData28$.pmPm10DonutDegreeValue)!==null&&_this$templateData$ai6!==void 0? _this$templateData$ai6:0)/100*360;var tomorrowPmPm10DonutColor=((_this$templateData29=this.templateData)===null||_this$templateData29===void 0?void 0:(_this$templateData29$=_this$templateData29.airTomorrowHday)=== null||_this$templateData29$===void 0?void 0:_this$templateData29$.pmPm10DonutColor)||this.NONE_COLOR;var tomorrowPmPm10DonutBgColor=((_this$templateData30=this.templateData)===null||_this$templateData30=== void 0?void 0:(_this$templateData30$=_this$templateData30.airTomorrowHday)===null||_this$templateData30$===void 0?void 0:_this$templateData30$.pmPm10DonutBgColor)||this.NONE_COLOR;var tomorrowPmPm25DonutDegree= ((_this$templateData$ai7=(_this$templateData31=this.templateData)===null||_this$templateData31===void 0?void 0:(_this$templateData31$=_this$templateData31.airTomorrowHday)===null||_this$templateData31$=== void 0?void 0:_this$templateData31$.pmPm25DonutDegreeValue)!==null&&_this$templateData$ai7!==void 0?_this$templateData$ai7:0)/100*360;var tomorrowPmPm25DonutColor=((_this$templateData32=this.templateData)=== null||_this$templateData32===void 0?void 0:(_this$templateData32$=_this$templateData32.airTomorrowHday)===null||_this$templateData32$===void 0?void 0:_this$templateData32$.pmPm25DonutColor)||this.NONE_COLOR; var tomorrowPmPm25DonutBgColor=((_this$templateData33=this.templateData)===null||_this$templateData33===void 0?void 0:(_this$templateData33$=_this$templateData33.airTomorrowHday)===null||_this$templateData33$=== void 0?void 0:_this$templateData33$.pmPm25DonutBgColor)||this.NONE_COLOR;html='\n \x3cstrong class\x3d"card_data_value"\x3e\ub0b4\uc77c \x3cspan class\x3d"card_value_date"\x3e'.concat(tomorrow.format("MM.DD"), '\x3c/span\x3e\x3c/strong\x3e\n\n \x3cdiv class\x3d"card_date_item"\x3e\n \x3cspan class\x3d"card_item_title"\x3e\x3cspan class\x3d"card_title_time"\x3e\ub0b4\uc77c\x3c/span\x3e \uc624\uc804\x3c/span\x3e\n \x3cdiv class\x3d"card_item_data"\x3e\n \x3cdl class\x3d"card_data_description ').concat(tomorrowAmPm10Class, '"\x3e\n \x3cdt class\x3d"card_description_title"\x3e\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"card_description_data"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnTomorrowPm10" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(tomorrowAmPm10DonutDegree, '" data-color\x3d"').concat(tomorrowAmPm10DonutColor,'" data-back-color\x3d"').concat(tomorrowAmPm10DonutBgColor,'"\x3e\n \x3csvg width\x3d"56" height\x3d"56" viewBox\x3d"0 0 56 56" fill\x3d"none"\x3e\n \x3c/svg\x3e\n\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\ubbf8\uc138\x3c/strong\x3e\n \x3c/div\x3e\n \x3cem\x3e').concat(tomorrowAmPm10Legend.substring(0, 2),'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"card_data_description ').concat(tomorrowAmPm25Class,'"\x3e\n \x3cdt class\x3d"card_description_title"\x3e\ucd08\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"card_description_data"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnTomorrowPm25" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(tomorrowAmPm25DonutDegree, '" data-color\x3d"').concat(tomorrowAmPm25DonutColor,'" data-back-color\x3d"').concat(tomorrowAmPm25DonutBgColor,'"\x3e\n \x3csvg width\x3d"56" height\x3d"56" viewBox\x3d"0 0 56 56" fill\x3d"none"\x3e\n \x3c/svg\x3e\n\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\ubbf8\uc138\x3c/strong\x3e\n \x3c/div\x3e\n \x3cem\x3e').concat(tomorrowAmPm25Legend.substring(0, 2),'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_date_item"\x3e\n \x3cspan class\x3d"card_item_title"\x3e\x3cspan class\x3d"card_title_time"\x3e\ub0b4\uc77c\x3c/span\x3e \uc624\ud6c4\x3c/span\x3e\n \x3cdiv class\x3d"card_item_data"\x3e\n \x3cdl class\x3d"card_data_description ').concat(tomorrowPmPm10Class, '"\x3e\n \x3cdt class\x3d"card_description_title"\x3e\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"card_description_data"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnTomorrowPm10" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(tomorrowPmPm10DonutDegree, '" data-color\x3d"').concat(tomorrowPmPm10DonutColor,'" data-back-color\x3d"').concat(tomorrowPmPm10DonutBgColor,'"\x3e\n \x3csvg width\x3d"56" height\x3d"56" viewBox\x3d"0 0 56 56" fill\x3d"none"\x3e\n \x3c/svg\x3e\n\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\ubbf8\uc138\x3c/strong\x3e\n \x3c/div\x3e\n \x3cem\x3e').concat(tomorrowPmPm10Legend.substring(0, 2),'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"card_data_description ').concat(tomorrowPmPm25Class,'"\x3e\n \x3cdt class\x3d"card_description_title"\x3e\ucd08\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"card_description_data"\x3e\n \x3cdiv class\x3d"_cnDonutChart _cnTomorrowPm25" data-diameter\x3d"78" data-hole-diameter-offsets\x3d"14" data-degree-value\x3d"').concat(tomorrowPmPm25DonutDegree, '" data-color\x3d"').concat(tomorrowPmPm25DonutColor,'" data-back-color\x3d"').concat(tomorrowPmPm25DonutBgColor,'"\x3e\n \x3csvg width\x3d"56" height\x3d"56" viewBox\x3d"0 0 56 56" fill\x3d"none"\x3e\n \x3c/svg\x3e\n\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\ubbf8\uc138\x3c/strong\x3e\n \x3c/div\x3e\n \x3cem\x3e').concat(tomorrowPmPm25Legend.substring(0, 2),"\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n ");this.element.find("._cnTomorrow").children().not("._cnToggleBtn").remove().end().end().prepend(html); this.loadAndDrawDonutChart($.proxy(function(){this.element.find("._cnCurrentPm10").append('\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\n \x3cspan class\x3d"dount_value_title"\x3e\ubbf8\uc138\x3c/span\x3e\n \x3cspan class\x3d"dount_value_text"\x3e'.concat(currentPm10Value, "\x3c/span\x3e\n \x3c/strong\x3e")).end().find("._cnCurrentPm25").append('\n \x3cstrong class\x3d"_cnDountChart_value"\x3e\n \x3cspan class\x3d"dount_value_title"\x3e\ucd08\ubbf8\uc138\x3c/span\x3e\n \x3cspan class\x3d"dount_value_text"\x3e'.concat(currentPm25WithExistYn, "\x3c/span\x3e\n \x3c/strong\x3e")).end().find("._cnTomorrowPm10").append('\x3cstrong class\x3d"_cnDountChart_value"\x3e\ubbf8\uc138\x3c/strong\x3e').end().find("._cnTomorrowPm25").append(' \x3cstrong class\x3d"_cnDountChart_value"\x3e\ucd08\ubbf8\uc138\x3c/strong\x3e')}, this))}}, {key:"initDustInfo",value:function initDustInfo(){var _this$templateData34,_this$templateData34$,_this$templateData35,_this$templateData35$,_this$templateData36,_this$templateData36$,_this$templateData37, _this$templateData37$,_this$templateData38,_this$templateData38$,_this$templateData39,_this$templateData39$,_this$templateData40,_this$templateData40$,_this$templateData41,_this$templateData41$,_this$templateData42, _this$templateData42$,_this$templateData43,_this$templateData43$,_this$templateData44,_this$templateData44$,_this$templateData45,_this$templateData45$,_this$templateData46,_this$templateData46$,_this$templateData47, _this$templateData47$,_this$templateData48,_this$templateData48$,_this$templateData49,_this$templateData49$;var html="";var customGradeMap={"\ub098\uc068":1,"\ub9e4\uc6b0\ub098\uc068":2};var pm10Legend= ((_this$templateData34=this.templateData)===null||_this$templateData34===void 0?void 0:(_this$templateData34$=_this$templateData34.airNow)===null||_this$templateData34$===void 0?void 0:_this$templateData34$.stationPm10Legend)|| "";var pm10Class=((_this$templateData35=this.templateData)===null||_this$templateData35===void 0?void 0:(_this$templateData35$=_this$templateData35.airNow)===null||_this$templateData35$===void 0?void 0: _this$templateData35$.stationPm10LevelClass)||this.NONE_LEVEL_CLASS;var pm25Legend=((_this$templateData36=this.templateData)===null||_this$templateData36===void 0?void 0:(_this$templateData36$=_this$templateData36.airNow)=== null||_this$templateData36$===void 0?void 0:_this$templateData36$.stationPm25Legend)||"";var pm25Class=((_this$templateData37=this.templateData)===null||_this$templateData37===void 0?void 0:(_this$templateData37$= _this$templateData37.airNow)===null||_this$templateData37$===void 0?void 0:_this$templateData37$.stationPm25LevelClass)||this.NONE_LEVEL_CLASS;var pm10Grade=customGradeMap[pm10Legend]||0;var pm25Grade= customGradeMap[pm25Legend]||0;var textByClass={"level4_3":"\ubb34\ub9ac\ud55c \uc2e4\uc678 \ud65c\ub3d9\uc744 \uc790\uc81c\ud558\uc138\uc694!","level4_4":"\ubbfc\uac10\uad70\uc740 \uc2e4\ub0b4\uc5d0 \uba38\ubb34\uc138\uc694!"}; var pm10AdviceMap={"legend":pm10Legend,"class":pm10Class,"name":"\ubbf8\uc138","text":textByClass[pm10Class]};var pm25AdviceMap={"legend":pm25Legend,"class":pm25Class,"name":"\ucd08\ubbf8\uc138","text":textByClass[pm25Class]}; var airAdviceMap={};if(pm10Grade&&pm10Grade===pm25Grade)airAdviceMap=pm25AdviceMap;else if(pm25Grade>0&&pm10Grade>0)if(pm25Grade>pm10Grade)airAdviceMap=pm25AdviceMap;else airAdviceMap=pm10AdviceMap;else if(pm25Grade> 0)airAdviceMap=pm25AdviceMap;else if(pm10Grade>0)airAdviceMap=pm10AdviceMap;if(!_.isEmpty(airAdviceMap))html+='\n \x3cdiv class\x3d"card_slide_item type_advide '.concat(airAdviceMap["class"], '"\x3e\n \x3cdiv class\x3d"card_item_inner"\x3e\n \x3cstrong class\x3d"card_item_title"\x3e\n ').concat(airAdviceMap.name,' \x3cem class\x3d"card_title_emphasis"\x3e').concat(airAdviceMap.legend, '\x3c/em\x3e\n \x3c/strong\x3e\n \x3cspan class\x3d"card_item_text"\x3e\n ').concat(airAdviceMap.text,"\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n "); var airNowDataList=[{"krName":"\uc624\uc874","enName":"O3","value":((_this$templateData38=this.templateData)===null||_this$templateData38===void 0?void 0:(_this$templateData38$=_this$templateData38.airNow)=== null||_this$templateData38$===void 0?void 0:_this$templateData38$.stationO3Legend)?oCommon.fnGetAirNumberValueWithDefault((_this$templateData39=this.templateData)===null||_this$templateData39===void 0? void 0:(_this$templateData39$=_this$templateData39.airNow)===null||_this$templateData39$===void 0?void 0:_this$templateData39$.stationO3,this.AIR_NO_DATA_TEXT):this.AIR_NO_DATA_TEXT,"legend":((_this$templateData40= this.templateData)===null||_this$templateData40===void 0?void 0:(_this$templateData40$=_this$templateData40.airNow)===null||_this$templateData40$===void 0?void 0:_this$templateData40$.stationO3Legend)|| ""},{"krName":"\uc77c\uc0b0\ud654\ud0c4\uc18c","enName":"CO","value":((_this$templateData41=this.templateData)===null||_this$templateData41===void 0?void 0:(_this$templateData41$=_this$templateData41.airNow)=== null||_this$templateData41$===void 0?void 0:_this$templateData41$.stationCoLegend)?oCommon.fnGetAirNumberValueWithDefault((_this$templateData42=this.templateData)===null||_this$templateData42===void 0? void 0:(_this$templateData42$=_this$templateData42.airNow)===null||_this$templateData42$===void 0?void 0:_this$templateData42$.stationCo,this.AIR_NO_DATA_TEXT):this.AIR_NO_DATA_TEXT,"legend":((_this$templateData43= this.templateData)===null||_this$templateData43===void 0?void 0:(_this$templateData43$=_this$templateData43.airNow)===null||_this$templateData43$===void 0?void 0:_this$templateData43$.stationCoLegend)|| ""},{"krName":"\uc544\ud669\uc0b0\uac00\uc2a4","enName":"SO2","value":((_this$templateData44=this.templateData)===null||_this$templateData44===void 0?void 0:(_this$templateData44$=_this$templateData44.airNow)=== null||_this$templateData44$===void 0?void 0:_this$templateData44$.stationSo2Legend)?oCommon.fnGetAirNumberValueWithDefault((_this$templateData45=this.templateData)===null||_this$templateData45===void 0? void 0:(_this$templateData45$=_this$templateData45.airNow)===null||_this$templateData45$===void 0?void 0:_this$templateData45$.stationSo2,this.AIR_NO_DATA_TEXT):this.AIR_NO_DATA_TEXT,"legend":((_this$templateData46= this.templateData)===null||_this$templateData46===void 0?void 0:(_this$templateData46$=_this$templateData46.airNow)===null||_this$templateData46$===void 0?void 0:_this$templateData46$.stationSo2Legend)|| ""},{"krName":"\uc774\uc0b0\ud654\uc9c8\uc18c","enName":"NO2","value":((_this$templateData47=this.templateData)===null||_this$templateData47===void 0?void 0:(_this$templateData47$=_this$templateData47.airNow)=== null||_this$templateData47$===void 0?void 0:_this$templateData47$.stationNo2Legend)?oCommon.fnGetAirNumberValueWithDefault((_this$templateData48=this.templateData)===null||_this$templateData48===void 0? void 0:(_this$templateData48$=_this$templateData48.airNow)===null||_this$templateData48$===void 0?void 0:_this$templateData48$.stationNo2,this.AIR_NO_DATA_TEXT):this.AIR_NO_DATA_TEXT,"legend":((_this$templateData49= this.templateData)===null||_this$templateData49===void 0?void 0:(_this$templateData49$=_this$templateData49.airNow)===null||_this$templateData49$===void 0?void 0:_this$templateData49$.stationNo2Legend)|| ""}];for(var _i=0,_airNowDataList=airNowDataList;_i<_airNowDataList.length;_i++){var airNowData=_airNowDataList[_i];html+='\n \x3cdiv class\x3d"card_slide_item type_basic '.concat(airNowData.value=== this.AIR_NO_DATA_TEXT?this.NONE_LEVEL_CLASS:"",'"\x3e\n \x3cspan class\x3d"card_item_value"\x3e').concat(airNowData.enName,'\x3c/span\x3e\n\n \x3cdiv class\x3d"card_item_inner"\x3e\n \x3cdl class\x3d"card_item_description"\x3e\n \x3cdt class\x3d"card_description_title"\x3e').concat(airNowData.krName, '\x3c/dt\x3e\n \x3cdd class\x3d"card_description_data _cnNoData" data-validation-key\x3d"').concat(airNowData.enName,'Data"\x3e\n \x3cstrong class\x3d"card_data_emphasis"\x3e').concat(airNowData.value, "\x3c/strong\x3e \x3cspan\x3e").concat(airNowData.legend,"\x3c/span\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}this.element.find(".card_dust_info .card_slide_inner").append(html)}}, {key:"initUpdateTime",value:function initUpdateTime(){var _this$templateData50;var airNow=((_this$templateData50=this.templateData)===null||_this$templateData50===void 0?void 0:_this$templateData50.airNow)|| {};var stationName=airNow.stationName||"";var fcastYmdt=airNow.fcastYmdt||"";var convertedFcastYmdtMoment=moment(fcastYmdt,"YYYYMMDDHHmmss");if(fcastYmdt){var isOutdated=airNow.outdatedYn==="Y"||moment().utcOffset("+09:00").diff(moment(fcastYmdt, "YYYYMMDDHHmmss"),"hours")>=4;var html='\n \x3ca href\x3d"https://www.airkorea.or.kr" target\x3d"_blank" class\x3d"card_text_link" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'source\')" data-nlog-area\x3d"air_synthesis_forecast.source_link" data-nlog-params\x3d\'{"weather_cp":"airkorea"}\'\x3e\ud55c\uad6d\ud658\uacbd\uacf5\ub2e8 \uc5d0\uc5b4\ucf54\ub9ac\uc544\x3c/a\x3e \uc2e4\ud669, \n \x3ca href\x3d"https://www.kweather.co.kr" target\x3d"_blank" class\x3d"card_text_link" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'source\')" data-nlog-area\x3d"air_synthesis_forecast.source_link" data-nlog-params\x3d\'{"weather_cp":"kweather"}\'\x3e\ucf00\uc774\uc6e8\ub354\x3c/a\x3e \uc81c\uacf5').concat(!stationName&& convertedFcastYmdtMoment.isValid()===false?"":","," ").concat(stationName?" ".concat(stationName):""," ").concat(convertedFcastYmdtMoment.isValid()?" ".concat(convertedFcastYmdtMoment.format("MM.DD. "), '\x3cspan class\x3d"card_text_state"\x3e').concat(convertedFcastYmdtMoment.format("HH:mm")," \uae30\uc900\x3c/span\x3e"):"",'\n \x3cdiv class\x3d"card_text_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button _cnNowTooltip _cnWeatherInfoLayer" data-type\x3d"now" aria-pressed\x3d"false" data-nlog-area\x3d"air_synthesis_forecast.help_button" data-nlog-params\x3d\'{"category":"now"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n ').concat(isOutdated? '\n \x3cem class\x3d"card_state_emphasis type_exception"\x3e\uc9c0\uc5f0\ubc1c\uc0dd\x3c/em\x3e\n \x3cdiv class\x3d"card_text_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button _cnNowDelayTooltip _cnWeatherInfoLayer" data-type\x3d"delay" aria-pressed\x3d"false" data-nlog-area\x3d"air_synthesis_forecast.help_button" data-nlog-params\x3d\'{"category":"delay"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n \n \x3cdiv class\x3d"card_tooltip_inner"\x3e\n \x3cstrong class\x3d"card_tooltip_title"\x3e\n \ud55c\uad6d\ud658\uacbd\uacf5\ub2e8 \uc5d0\uc5b4\ucf54\ub9ac\uc544\uc758\x3cbr\x3e\n \ud574\ub2f9 \uce21\uc815\uc18c \uc5c5\ub370\uc774\ud2b8\uac00 \uc9c0\uc5f0\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4.\n \x3c/strong\x3e\n \n \x3cp class\x3d"card_tooltip_text"\x3e\n \uc5c5\ub370\uc774\ud2b8 \uc9c0\uc5f0\uc740 \uc77c\uc2dc\uc801\uc778 \uce21\uc815\uc18c \uc7a5\uc560\ub098 \uc810\uac80, \uce21\uc815\uc18c \ub370\uc774\ud130 \uc804\uc1a1\uc758 \ubb38\uc81c\uac00 \uc788\uc744 \uacbd\uc6b0 \ubc1c\uc0dd \uac00\ub2a5\ud569\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3cp class\x3d"card_tooltip_text"\x3e\n \uc5c5\ub370\uc774\ud2b8 \uc9c0\uc5f0 \uc2dc, \ucd5c\uadfc \ub370\uc774\ud130\ub97c \uc77c\uc815\uc2dc\uac04 \uac00\uc7a5 \ucd5c\uadfc\x3cbr\x3e\n \ub370\uc774\ud130\ub97c \uc720\uc9c0\ud574 \uc815\uc0c1\ud654 \ubaa8\ub2c8\ud130\ub9c1 \ud6c4, \uc9c0\uc5f0 \uc2dc\uac04\uc774\x3cbr\x3e\n \uae38\uc5b4\uc9c0\uba74 \ud574\ub2f9 \uc9c0\uc5ed\uc758 \ucc28\uc778\uc811 \uce21\uc815\uc18c\uc758 \uce21\uc815\uc815\ubcf4\ub97c\x3cbr\x3e\n \ub300\uccb4 \uc81c\uacf5\ud569\ub2c8\ub2e4.\n \x3c/p\x3e\n \n \x3cbutton type\x3d"button" class\x3d"btn_close _cnNowDelayTooltip" data-type\x3d"delay" data-nlog-area\x3d"air_synthesis_forecast.layer.close_button" data-nlog-params\x3d\'{"category":"delay"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ': "","\n ");this.element.find(".card_provide_text").html(html)}}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"initWhoTooltip",value:function initWhoTooltip(){var _this$templateData51,_this$templateData51$,_this$templateData52,_this$templateData52$,_this$templateData53,_this$templateData53$,_this$templateData54, _this$templateData54$,_this$templateData55,_this$templateData55$,_this$templateData56,_this$templateData56$;var $target=this.element.find(".type_who .card_text_tooltip");var currentPm10Value=oCommon.fnGetAirNumberValueWithDefault((_this$templateData51= this.templateData)===null||_this$templateData51===void 0?void 0:(_this$templateData51$=_this$templateData51.airNow)===null||_this$templateData51$===void 0?void 0:_this$templateData51$.stationPm10);var currentPm25Value= oCommon.fnGetAirNumberValueWithDefault((_this$templateData52=this.templateData)===null||_this$templateData52===void 0?void 0:(_this$templateData52$=_this$templateData52.airNow)===null||_this$templateData52$=== void 0?void 0:_this$templateData52$.stationPm25);var currentPm10WhoIsInRecommendation=((_this$templateData53=this.templateData)===null||_this$templateData53===void 0?void 0:(_this$templateData53$=_this$templateData53.airNow)=== null||_this$templateData53$===void 0?void 0:_this$templateData53$.stationPm10WhoIsInRecommendation)||"-";var currentPm25WhoIsInRecommendation=((_this$templateData54=this.templateData)===null||_this$templateData54=== void 0?void 0:(_this$templateData54$=_this$templateData54.airNow)===null||_this$templateData54$===void 0?void 0:_this$templateData54$.stationPm25WhoIsInRecommendation)||"-";var currentPm10WhoLevelClass= ((_this$templateData55=this.templateData)===null||_this$templateData55===void 0?void 0:(_this$templateData55$=_this$templateData55.airNow)===null||_this$templateData55$===void 0?void 0:_this$templateData55$.stationPm10WhoLevelClass)|| "level0";var currentPm25WhoLevelClass=((_this$templateData56=this.templateData)===null||_this$templateData56===void 0?void 0:(_this$templateData56$=_this$templateData56.airNow)===null||_this$templateData56$=== void 0?void 0:_this$templateData56$.stationPm25WhoLevelClass)||"level0";var templateName="_idAirNowWhoITooltip";var oTemplate=Handlebars.getTemplateSync(templateName);var contents=oTemplate({"pm10Value":currentPm10Value, "pm25Value":currentPm25Value,"pm10WhoIsInRecommendation":currentPm10WhoIsInRecommendation,"pm25WhoIsInRecommendation":currentPm25WhoIsInRecommendation,"pm10WhoLevelClass":currentPm10WhoLevelClass,"pm25WhoLevelClass":currentPm25WhoLevelClass}); $target.append(contents)}}, {key:"initNowTooltip",value:function initNowTooltip(){var $target=this.element.find("._cnNowTooltip");var templateName="_idAirNowTooltip";var oTemplate=Handlebars.getTemplateSync(templateName);var contents= oTemplate();$target.after(contents)}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){return{currentAirSynthesisData:{fields:["airNow.stationPm10","airNow.stationPm25"],operator:"AND"},tomorrowAirSynthesisData:{fields:["airTomorrowHday.amPm10Legend", "airTomorrowHday.amPm25Legend","airTomorrowHday.pmPm10Legend","airTomorrowHday.pmPm25Legend"],operator:"AND"},O3Data:{fields:["airNow.stationO3Legend"]},COData:{fields:["airNow.stationCoLegend"]},SO2Data:{fields:["airNow.stationSo2Legend"]}, NO2Data:{fields:["airNow.stationNo2Legend"]}}}}, {key:"loadAndDrawDonutChart",value:function loadAndDrawDonutChart(afterDraw){oCommon.fnLoadDonutWithRoundTip().done($.proxy(this.drawDonutChart,this)).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[airSynthesisFcast.js] donut script \ud638\ucd9c \uc2e4\ud328", jqXHR)}).always(function(){if(typeof afterDraw==="function")afterDraw()})}}, {key:"drawDonutChart",value:function drawDonutChart(){this.element.find("._cnDonutChart").each(function(index,element){var welChart=$(element);new window.DonutWithRoundTip({"el":welChart.get(0),"diameter":welChart.data("diameter"), "holeDiameter":welChart.data("diameter")-welChart.data("holeDiameterOffsets"),"endDegree":welChart.data("degreeValue"),"color":welChart.data("color"),"backColor":welChart.data("backColor")});welChart.find("svg").attr("focusable", "false").attr("viewBox","0 0 78 78")})}}]); return airSynthesisFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0}}, {key:"init",value:function init(){this.categories=this._getCategories();this.lsurRegion=typeof blockData!=="undefined"&&blockData?blockData["lsurRegion"]:null;this.selectedSpecies=this._getDefaultSpecies(); this.render();this._bindBottomSheet()}}, {key:"attachEvent",value:function attachEvent(){var _this2=this;this.element.on("click",".btn_scenery",function(e){if(_this2.bottomSheet){_this2.bottomSheet.toggle();$(e.currentTarget).attr("aria-pressed", _this2.bottomSheet.isOpen?"true":"false")}oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this2.clickCode))}); this.element.on("click",".btn_scenery_period",function(e){var species=$(e.currentTarget).data("species");if(species&&species!==_this2.selectedSpecies){_this2.selectedSpecies=species;_this2._renderSelectedCategory()}if(_this2.bottomSheet)_this2.bottomSheet.close(); oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this2.clickCode,"item"))}); this.element.on("click",".scenery_marker .marker_label",function(e){if(!_this2._isSelectedCategoryClickable())return;e.preventDefault();var $wrap=_this2.element.find(".scenery_marker_wrap");var $marker= $(e.currentTarget).closest(".scenery_marker");$wrap.find(".scenery_marker").removeClass("is_highlight");$marker.addClass("is_highlight").appendTo($wrap);$marker.find(".marker_card").trigger("focus")}); this.element.on("click",".scenery_map_area",function(e){if($(e.target).closest(".scenery_marker, .btn_scenery, .bottom_sheet").length>0||!_this2._isSelectedCategoryClickable())return;_this2.element.find(".scenery_marker_wrap").html(_this2._buildMarkersHtml(_this2._toViewModel(_this2._getSelectedCategory())))})}}, {key:"_isSelectedCategoryClickable",value:function _isSelectedCategoryClickable(){var category=this._getSelectedCategory();var meta=category?this.categoryMetaMap[category.speciesType]:null;return!!(meta&& meta.isClickable)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this$bottomSheet,_this$bottomSheet$han;(_this$bottomSheet=this.bottomSheet)===null||_this$bottomSheet===void 0? void 0:(_this$bottomSheet$han=_this$bottomSheet.handleResize)===null||_this$bottomSheet$han===void 0?void 0:_this$bottomSheet$han.call(_this$bottomSheet,lastResponsiveSizeType,isChanged)}}, {key:"render",value:function render(){var _this3=this;var current=this._toViewModel(this._getSelectedCategory());var periodListHtml=this._sortCategoriesForDisplay(this.categories.map(function(category){return _this3._toViewModel(category)})).map(function(viewModel){return _this3._buildPeriodItemHtml(viewModel)}).join(""); var isSelectable=this.categories.length>1;var html='\n \x3ch2 class\x3d"card_title"\x3e\uacc4\uc808 \ud48d\uacbd\x3c/h2\x3e\n \x3cdiv class\x3d"scenery_map_area '.concat(current.typeClass, '"\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_scenery" data-nlog\x3d"category_open" aria-pressed\x3d"false"').concat(isSelectable?"":" disabled",' data-nlog-area\x3d"bloom_season_forecast.category_open_button"\x3e\n ').concat(this._buildSceneryButtonInnerHtml(current), '\n \x3c/button\x3e\n \x3cdiv class\x3d"bottom_sheet"\x3e\n \x3cdiv class\x3d"bottom_sheet_dimmed"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"bottom_sheet_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"handle_btn" data-nlog-area\x3d"bloom_season_forecast.handle_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub3d9\uc791\x3c/span\x3e\n \x3c/button\x3e\n \x3cem class\x3d"title"\x3e\uacc4\uc808 \ud48d\uacbd\x3c/em\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"scenery_period_list"\x3e').concat(periodListHtml, '\x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-nlog-area\x3d"bloom_season_forecast.close_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"scenery_marker_wrap"\x3e').concat(this._buildMarkersHtml(current), '\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"offer_area"\x3e\n \x3ca href\x3d"https://www.weatheri.co.kr" class\x3d"link_go" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'ref\')" data-nlog-area\x3d"bloom_season_forecast.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e\n \x3cspan\x3e\uc81c\uacf5, \uac00\uc7a5 \uac00\uae4c\uc6b4 \uc8fc\uc694 \uc9c0\uc5ed\uc758 \uc608\uc0c1 \uc77c\uc790\ub97c \uc81c\uacf5\x3c/span\x3e\n \x3c/div\x3e\n '); this.element.html(html)}}, {key:"_renderSelectedCategory",value:function _renderSelectedCategory(){var current=this._toViewModel(this._getSelectedCategory());var $area=this.element.find(".scenery_map_area");Object.values(this.categoryMetaMap).forEach(function(meta){return $area.removeClass(meta.typeClass)}); $area.addClass(current.typeClass);this.element.find(".btn_scenery").html(this._buildSceneryButtonInnerHtml(current));this.element.find(".scenery_marker_wrap").html(this._buildMarkersHtml(current))}}, {key:"_buildSceneryButtonInnerHtml",value:function _buildSceneryButtonInnerHtml(viewModel){return'\n \x3cspan class\x3d"year"\x3e'.concat(this.escape(viewModel.yearLabel),'\x3c/span\x3e\n \x3cspan class\x3d"icon" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3cspan class\x3d"text"\x3e').concat(this.escape(viewModel.label), '\x3cspan class\x3d"hidden_text"\x3e\uc2dc\uae30\x3c/span\x3e\x3c/span\x3e\n ')}}, {key:"_buildPeriodItemHtml",value:function _buildPeriodItemHtml(viewModel){return'\n \x3cbutton type\x3d"button" class\x3d"btn_scenery_period" data-nlog\x3d"category" data-species\x3d"'.concat(viewModel.speciesType, '" data-nlog-area\x3d"bloom_season_forecast.category_button"\x3e\n \x3cspan class\x3d"year"\x3e').concat(this.escape(viewModel.yearLabel),'\x3c/span\x3e\n \x3cspan class\x3d"divider" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3cstrong class\x3d"status"\x3e').concat(this.escape(viewModel.label), "\x3c/strong\x3e\n ").concat(viewModel.isNew?'\x3cspan class\x3d"badge_new"\x3e\x3c/span\x3e':"","\n \x3c/button\x3e\n ")}}, {key:"_sortCategoriesForDisplay",value:function _sortCategoriesForDisplay(viewModels){var _this4=this;var priority=function priority(speciesType){var idx=_this4.NEW_PRIORITY.indexOf(speciesType);return idx=== -1?_this4.NEW_PRIORITY.length:idx}; return viewModels.map(function(viewModel,index){return{viewModel:viewModel,index:index}}).sort(function(a,b){if(a.viewModel.isNew!==b.viewModel.isNew)return a.viewModel.isNew?-1:1; if(a.viewModel.isNew){var diff=priority(a.viewModel.speciesType)-priority(b.viewModel.speciesType);if(diff!==0)return diff}return a.index-b.index}).map(function(item){return item.viewModel})}}, {key:"_buildMarkersHtml",value:function _buildMarkersHtml(viewModel){var _this5=this;var markers=_toConsumableArray(viewModel.markers).sort(function(a,b){return(a.isHighlight?1:0)-(b.isHighlight?1:0)}); return markers.map(function(marker){return'\n \x3cdiv class\x3d"scenery_marker '.concat(marker.slug).concat(marker.isHighlight?" is_highlight":"",'"\x3e\n ').concat(marker.isClickable? _this5._buildMapleLabelHtml(marker):_this5._buildBlossomLabelHtml(marker),"\n ").concat(marker.isClickable?_this5._buildMapleCardHtml(marker):_this5._buildBlossomCardHtml(marker),"\n \x3c/div\x3e\n ")}).join("")}}, {key:"_buildMapleLabelHtml",value:function _buildMapleLabelHtml(marker){return'\n \x3cbutton type\x3d"button" class\x3d"marker_label" data-region-code\x3d"'.concat(marker.regionCd,'" data-nlog-area\x3d"bloom_season_forecast.region_button" data-nlog-params\x3d\'{"region_id":"').concat(marker.regionCd, '"}\'\x3e\n \x3cspan class\x3d"name"\x3e').concat(this.escape(marker.name),'\x3c/span\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.escape(marker.dateText),"\x3c/span\x3e\n \x3c/button\x3e\n ")}}, {key:"_buildBlossomLabelHtml",value:function _buildBlossomLabelHtml(marker){return'\n \x3cspan class\x3d"marker_label"\x3e\n \x3cspan class\x3d"name"\x3e'.concat(this.escape(marker.name), '\x3c/span\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.escape(marker.dateText),"\x3c/span\x3e\n \x3c/span\x3e\n ")}}, {key:"_buildMapleCardHtml",value:function _buildMapleCardHtml(marker){var previewPath=isBlockPreview?"/preview":"";return'\n \x3ca class\x3d"marker_card" href\x3d"'.concat(previewPath,"/today/").concat(marker.regionCd, '" data-region-code\x3d"').concat(marker.regionCd,'" data-nlog-area\x3d"bloom_season_forecast.region_link" data-nlog-params\x3d\'{"region_id":"').concat(marker.regionCd,'"}\'\x3e\n \x3cspan class\x3d"marker_detail"\x3e\n \x3cspan class\x3d"name"\x3e').concat(this.escape(marker.name), '\x3c/span\x3e\n \x3cspan class\x3d"icon" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"marker_detail"\x3e\n \x3cspan class\x3d"status"\x3e').concat(this.escape(marker.firstStatus), '\x3c/span\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.escape(marker.firstDateText),'\x3c/span\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"marker_detail"\x3e\n \x3cspan class\x3d"status"\x3e').concat(this.escape(marker.status), '\x3c/span\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.escape(marker.dateText),"\x3c/span\x3e\n \x3c/span\x3e\n \x3c/a\x3e\n ")}}, {key:"_buildBlossomCardHtml",value:function _buildBlossomCardHtml(marker){return'\n \x3cdiv class\x3d"marker_card"\x3e\n \x3cspan class\x3d"marker_detail"\x3e\n \x3cspan class\x3d"name"\x3e'.concat(this.escape(marker.name), '\x3c/span\x3e\n \x3cspan class\x3d"icon" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"marker_detail"\x3e\n \x3cspan class\x3d"status"\x3e').concat(this.escape(marker.status), '\x3c/span\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.escape(marker.dateText),"\x3c/span\x3e\n \x3c/span\x3e\n \x3c/div\x3e\n ")}}, {key:"_bindBottomSheet",value:function _bindBottomSheet(){var _this6=this;var $sheet=this.element.find(".bottom_sheet");if($sheet.length===0)return;this.bottomSheet=oBottomSheet.create($sheet,{enableSnap:false, fitContent:true,minHeightPx:292,onClose:function onClose(){return _this6._resetSceneryButtonPressed()}}); oBottomSheet.register(this._sheetRegId(),this.bottomSheet)}}, {key:"_resetSceneryButtonPressed",value:function _resetSceneryButtonPressed(){var _this7=this;var reset=function reset(){return _this7.element.find(".btn_scenery").attr("aria-pressed","false")}; if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")reset();else setTimeout(reset,300)}}, {key:"_sheetRegId",value:function _sheetRegId(){var _this$templateInfo;var idx=(_this$templateInfo=this.templateInfo)===null||_this$templateInfo===void 0?void 0:_this$templateInfo.index;if(idx!=null&&idx!== "")return"bloomSeasonFcast_".concat(idx);bloomSeasonFcast._seq=(bloomSeasonFcast._seq||0)+1;return"bloomSeasonFcast_auto".concat(bloomSeasonFcast._seq)}}, {key:"_getCategories",value:function _getCategories(){var _this8=this;if(this._categories)return this._categories;var categories=this.templateData&&Array.isArray(this.templateData.categories)?this.templateData.categories: [];this._categories=categories.filter(function(category){return category&&_this8.categoryMetaMap[category.speciesType]&&_this8._toViewModel(category).markers.length>0}); return this._categories}}, {key:"_getSelectedCategory",value:function _getSelectedCategory(){var _this9=this;return this.categories.find(function(category){return category.speciesType===_this9.selectedSpecies})||this.categories[0]}}, {key:"_isInSeasonWindow",value:function _isInSeasonWindow(isPeak){var month=(new Date).getMonth()+1;return isPeak?month>=7:month<=6}}, {key:"_getDefaultSpecies",value:function _getDefaultSpecies(){var isBlossomSeason=this._isInSeasonWindow(false);if(isBlossomSeason){var blossoms=this.categories.filter(function(category){return category.speciesType!== "maple"}); if(blossoms.length>0)return blossoms[Math.floor(Math.random()*blossoms.length)].speciesType}else if(this.categories.some(function(category){return category.speciesType==="maple"}))return"maple"; return this.categories[0].speciesType}}, {key:"_toViewModel",value:function _toViewModel(category){var _this0=this;var meta=this.categoryMetaMap[category.speciesType];var isCurrentYear=category.seasonYear===String((new Date).getFullYear());var markers= (Array.isArray(category.regions)?category.regions:[]).map(function(region){var slug=_this0.regionSlugMap[region.naverRgnCd];var date=isCurrentYear?_this0._seasonDate(region.seasons,category.seasonYear, meta.isPeak):_this0._averageSeasonMmdd(region.seasons,meta.isPeak);if(!slug||!date||region.latitude==null||region.longitude==null)return null;var marker={slug:slug,regionCd:meta.isClickable?region.lsurRgnCd|| region.naverRgnCd:region.naverRgnCd,isClickable:!!meta.isClickable,name:region.regionName,status:meta.markerStatus,dateText:_this0._formatDate(date),latitude:region.latitude,longitude:region.longitude, isHighlight:false};if(meta.isPeak){var firstDate=isCurrentYear?_this0._seasonDate(region.seasons,category.seasonYear,false):_this0._averageSeasonMmdd(region.seasons,false);marker.firstStatus=meta.firstStatus; marker.firstDateText=firstDate?_this0._formatDate(firstDate):"-"}return marker}).filter(function(marker){return marker!==null}); this._markHighlight(markers);return{speciesType:category.speciesType,label:meta.label,typeClass:meta.typeClass,yearLabel:isCurrentYear?"".concat(category.seasonYear,"\ub144"):"\ucd5c\uadfc 5\ub144 \ud3c9\uade0", isNew:isCurrentYear&&this._isInSeasonWindow(meta.isPeak)&&this._isWithinNewBadgePeriod(category.firstInsYmdt),markers:markers}}}, {key:"_seasonDate",value:function _seasonDate(seasons,seasonYear,isPeak){var season=(Array.isArray(seasons)?seasons:[]).find(function(item){return item&&item.seasonYear===seasonYear}); return season?isPeak?season.fcastPeakYmd:season.fcastStartYmd:null}}, {key:"_averageSeasonMmdd",value:function _averageSeasonMmdd(seasons,isPeak){var REF_YEAR=2001;var DAY_MS=24*60*60*1E3;var refBase=(new Date(REF_YEAR,0,1)).getTime();var dayOffsets=(Array.isArray(seasons)? seasons:[]).map(function(season){var value=String(season&&(isPeak?season.fcastPeakYmd:season.fcastStartYmd)||"");if(!/^\d{8}$/.test(value))return null;var month=parseInt(value.substring(4,6),10);var day= parseInt(value.substring(6,8),10);return Math.round(((new Date(REF_YEAR,month-1,day)).getTime()-refBase)/DAY_MS)}).filter(function(offset){return offset!==null}); if(dayOffsets.length===0)return null;var avgOffset=Math.round(dayOffsets.reduce(function(sum,offset){return sum+offset},0)/dayOffsets.length); var avgDate=new Date(refBase+avgOffset*DAY_MS);return"".concat(String(avgDate.getMonth()+1).padStart(2,"0")).concat(String(avgDate.getDate()).padStart(2,"0"))}}, {key:"_markHighlight",value:function _markHighlight(markers){var _this1=this;if(!this.lsurRegion||this.lsurRegion.latitude==null||this.lsurRegion.longitude==null)return;var nearest=null;var minDistance= Infinity;markers.forEach(function(marker){var distance=_this1._distanceKm(_this1.lsurRegion.latitude,_this1.lsurRegion.longitude,marker.latitude,marker.longitude);if(distance=0&&elapsedDays< this.NEW_BADGE_DAYS}}, {key:"escape",value:function escape(s){return String(s==null?"":s).replace(/&/g,"\x26amp;").replace(//g,"\x26gt;")}}]); return bloomSeasonFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0}}, {key:"attachEvent",value:function attachEvent(){}}]); return compareCpDesc}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=before1HoursYmdt})}if(this.getCompareCpList().length<=1)this.enableNotSupportCompare(); else{this.initCompareCpList();this.initHourlyFcast();this.initUpdateTime()}oCommon._fnAttachIconAnimation();var lazyImages=[].slice.call($(document).find(".lazy"));oCommon.lazyLoadFunc(lazyImages);this.initScroll()}}, {key:"initAfter",value:function initAfter(){this.controlDay()}}, {key:"initScroll",value:function initScroll(){var _this=this;oCommon.initScroll(this.element.find(".scroll_area"),function(name){_this.controlDay()})}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll();this.controlDay()}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){var _this$templateData6,_this$templateData7;var validationConfig={};var isDomestic=(_this$templateData6=this.templateData)===null||_this$templateData6=== void 0?void 0:_this$templateData6.domestic;var mapKey=isDomestic?"domesticHourlyListMap":"overseasHourlyListMap";var hourlyListMap=((_this$templateData7=this.templateData)===null||_this$templateData7=== void 0?void 0:_this$templateData7[mapKey])||{};var cpList=isDomestic?["KMA","ACCUWEATHER","TWC","WEATHERNEWS"]:Object.keys(hourlyListMap);var _iteratorNormalCompletion=true;var _didIteratorError=false; var _iteratorError=undefined;try{for(var _iterator=cpList[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var cp=_step.value;validationConfig["".concat(cp, "HourlyFcastList")]={fields:["".concat(mapKey,".").concat(cp)],minLength:12}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}return validationConfig}}, {key:"attachEvent",value:function attachEvent(){$(document).on("click","._cnCompareHourlyFcastInfo",$.proxy(this.toggleInfo,this))}}, {key:"toggleInfo",value:function toggleInfo(e){e.preventDefault();var element=this.element.find(".button_layer._cnCompareHourlyFcastInfo");var isOpen=oCommon.fnGetOpenOrNot(element);oCommon.fnCloseAllInfoLayer(); if(isOpen)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"infox"));else{oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"info"));var weatherList=this.element.find(".weather_list"); if(weatherList.find("li").length===0){var iconMap={};this.element.find(".weather .ico").each(function(index,element){var thisElement=$(element);iconMap[thisElement.data("ico")]=thisElement.data("txt")}); for(var ico in iconMap)if(ico&&iconMap[ico])weatherList.append('\x3cli class\x3d"item"\x3e\x3ci class\x3d"ico '.concat(ico,'" data-tooltip\x3d"').concat(iconMap[ico],'"\x3e\x3c/i\x3e').concat(iconMap[ico], "\x3c/li\x3e"))}oCommon.fnOpenInfoLayer(element)}}}, {key:"initCompareCpList",value:function initCompareCpList(){var element=this.element.find("._cnCompareCpList");var cpList=this.getCompareCpList();var html="";for(var i in cpList){var cp=cpList[i];var cpClass= this.cpClassMap[cp]||null;var cpName=this.cpNameMap[cp]||null;if(cpClass&&cpName)html+='\x3cli class\x3d"'.concat(cpClass,'" data-cp\x3d"').concat(cp,'"\x3e\x3cspan class\x3d"text"\x3e').concat(cpName, "\x3c/span\x3e\x3c/li\x3e")}element.show().html(html)}}, {key:"getCompareCpList",value:function getCompareCpList(){if(this.domestic)return this.domesticCompareCpList();else return this.overseasCompareCpList()}}, {key:"domesticCompareCpList",value:function domesticCompareCpList(){return["KMA","ACCUWEATHER","TWC","WEATHERNEWS"]}}, {key:"overseasCompareCpList",value:function overseasCompareCpList(){var availableCp=[];if(this.hourlyListMap.hasOwnProperty("WEATHERNEWS"))availableCp.push("WEATHERNEWS");if(this.hourlyListMap.hasOwnProperty("ACCUWEATHER"))availableCp.push("ACCUWEATHER"); if(this.hourlyListMap.hasOwnProperty("TWC"))availableCp.push("TWC");return availableCp}}, {key:"initHourlyFcast",value:function initHourlyFcast(){var cpList=this.getCompareCpList();var nowDateTime=this.localDateTime.format("YYYYMMDDHH");var oneDayAfter=this.localDateTime.clone().add(1,"days").format("YYYYMMDD"); var twoDayAfter=this.localDateTime.clone().add(2,"days").format("YYYYMMDD");var threeDayAfter=this.localDateTime.clone().add(3,"days").format("YYYYMMDD");var aplYmdtCpHourlyFcastHtmlMapMap={};var timeHtmlMap= {};var timeClassMap={};var cpHourlyFcastHtml=Object.fromEntries(cpList.map(function(key){return[key,""]})); for(var i in cpList){var cp=cpList[i];var cpHourlyFcastList=this.hourlyListMap[cp]||[];for(var j in cpHourlyFcastList){var hourlyFcast=cpHourlyFcastList[j];var aplYmdt="".concat(hourlyFcast.aplYmd).concat(hourlyFcast.aplTm); if(!timeHtmlMap.hasOwnProperty(aplYmdt)){var _this$createHourlyTim=this.createHourlyTimeHtml(j,hourlyFcast.aplYmd,hourlyFcast.aplTm,nowDateTime,oneDayAfter,twoDayAfter,threeDayAfter);var _this$createHourlyTim2= _slicedToArray(_this$createHourlyTim,2);timeHtmlMap[aplYmdt]=_this$createHourlyTim2[0];timeClassMap[aplYmdt]=_this$createHourlyTim2[1]}if(!aplYmdtCpHourlyFcastHtmlMapMap.hasOwnProperty(aplYmdt))aplYmdtCpHourlyFcastHtmlMapMap[aplYmdt]= {};aplYmdtCpHourlyFcastHtmlMapMap[aplYmdt][cp]=this.domestic?this.createDomesticCompareHourlyHtml(cp,hourlyFcast,timeClassMap[aplYmdt]):this.createOverseasCompareHourlyHtml(cp,hourlyFcast,timeClassMap[aplYmdt])}}if(Object.keys(timeHtmlMap).length=== 0){var baseMoment=this.localDateTime.clone().add(1,"hours");for(var _i2=0;_i2<22;_i2++){var _this$createHourlyTim3=this.createHourlyTimeHtml(_i2,baseMoment.format("YYYYMMDD"),baseMoment.format("HH"),nowDateTime, oneDayAfter,twoDayAfter,threeDayAfter);var _this$createHourlyTim4=_slicedToArray(_this$createHourlyTim3,2);timeHtmlMap[baseMoment.format("YYYYMMDDHH")]=_this$createHourlyTim4[0];timeClassMap[baseMoment.format("YYYYMMDDHH")]= _this$createHourlyTim4[1];baseMoment.add(1,"hours")}}Object.keys(timeHtmlMap).sort().reduce(function(newObj,key){newObj[key]=timeHtmlMap[key];return newObj},{}); var timeHtml='\n \x3cth scope\x3d"col"\x3e\n \x3cspan class\x3d"blind"\x3e\ub0a0\uc528 \uc81c\uacf5\uc0ac\x3c/span\x3e\n \x3c/th\x3e';var hourlyFcastHtml="";for(var _aplYmdt in timeHtmlMap){timeHtml+= timeHtmlMap[_aplYmdt];var cpHourlyFcastHtmlMap=aplYmdtCpHourlyFcastHtmlMapMap[_aplYmdt]||{};for(var _i3 in cpList){var _cp=cpList[_i3];cpHourlyFcastHtml[_cp]+=cpHourlyFcastHtmlMap[_cp]||this.createEmptyHourlyFcastHtml(timeClassMap[_aplYmdt])}}this.element.find("._cnCompareTime").html(timeHtml); for(var _i4 in cpList){var _this$isDataValid;var _cp2=cpList[_i4];var validationKey="".concat(_cp2,"HourlyFcastList");if(((_this$isDataValid=this.isDataValid)===null||_this$isDataValid===void 0?void 0: _this$isDataValid[validationKey])===false)cpHourlyFcastHtml[_cp2]='\n \x3ctr\x3e\n \x3cth scope\x3d"row"\x3e\n \x3cspan class\x3d"blind"\x3e'.concat(this.cpNameMap[_cp2], '\x3c/span\x3e\n \x3c/th\x3e\n \x3ctd colspan\x3d"').concat(Object.keys(timeHtmlMap).length,'" class\x3d"error"\x3e\n \x3cdiv class\x3d"weather"\x3e\n \x3cdiv class\x3d"inner_error _cnNoData" data-validation-key\x3d"').concat(validationKey, '"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n \x3c/tr\x3e\n ');else cpHourlyFcastHtml[_cp2]='\n \x3ctr\x3e\n \x3cth scope\x3d"row"\x3e\n \x3cspan class\x3d"blind"\x3e'.concat(this.cpNameMap[_cp2], "\x3c/span\x3e\n \x3c/th\x3e\n ").concat(cpHourlyFcastHtml[_cp2],"\n \x3c/tr\x3e");hourlyFcastHtml+=cpHourlyFcastHtml[_cp2]}this.element.find("._cnCompareTime").after(hourlyFcastHtml)}}, {key:"initUpdateTime",value:function initUpdateTime(){var _kmaHourlyFcast;var cpList=this.getCompareCpList();for(var i in cpList){var cp=cpList[i];var lastElement=this.hourlyListMap[cp][this.hourlyListMap[cp].length- 1];var value="";if(cp==="KMA")value=(lastElement===null||lastElement===void 0?void 0:lastElement.lastUdtYmdt)||"";else value=(lastElement===null||lastElement===void 0?void 0:lastElement.fcastYmdt)||""; if(this.updateTime=0)rainfallHtml='\x3cspan class\x3d"text_rainfall"\x3e'.concat(rainProb,"%\x3c/span\x3e");if(!isNaN(Number(tmpr)))tmpr=tmpr+"\u00b0";return'\n \x3ctd\x3e\n \x3cdiv class\x3d"weather '.concat(tomorrowClass, '"\x3e\n \x3ci class\x3d"ico _cnLazy" data-ico\x3d"ico_wt').concat(wetrCd,'" data-txt\x3d"').concat(wetrTxt,'" data-tooltip\x3d"').concat(wetrTxt,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrTxt, '\x3c/span\x3e\x3c/i\x3e\n \x3cspan class\x3d"temperature"\x3e').concat(tmpr,'\x3c/span\x3e\n \x3cspan class\x3d"rainfall"\x3e\n ').concat(rainfallHtml, "\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n ")}}, {key:"createEmptyHourlyFcastHtml",value:function createEmptyHourlyFcastHtml(tomorrowClass){return'\n \x3ctd\x3e\n \x3cdiv class\x3d"weather '.concat(tomorrowClass,'"\x3e\n \x3cspan class\x3d"rainfall"\x3e\n -\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n ')}}, {key:"enableNotSupportCompare",value:function enableNotSupportCompare(){this.element.html('\n \x3cdiv class\x3d"box_error"\x3e\n \x3cp class\x3d"title_error"\x3e\n \uc774 \uc9c0\uc5ed\uc740 \uc608\ubcf4\ube44\uad50 \uc11c\ube44\uc2a4\uac00\x3cbr\x3e\n \uc81c\uacf5\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3cdiv class\x3d"button_area"\x3e\n \x3cbutton type\x3d"button" class\x3d"button_error" data-nlog\x3d"no_data_search" data-nlog-area\x3d"compare_hourly_forecast.no_data_search_button"\x3e\ub2e4\ub978 \uc9c0\uc5ed \uac80\uc0c9\ud558\uae30\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); $(document).on("click","._cnCompareHourlyFcast .button_error",$.proxy(function(e){$("._cnSearchPopup").click()},this))}}, {key:"onCp",value:function onCp(cpName){this.element.find(".".concat(this.cpClassMap[cpName])).addClass("on")}}, {key:"controlDay",value:function controlDay(){var _this2=this;var dayElementArray=this.element.find(".time._cnDay").toArray();var beforeDayArray=dayElementArray.filter(function(item){var itemRight=item.getBoundingClientRect().right; var basePadding=_this2.element.find("._cnCompareCpList").get(0).getBoundingClientRect().right;return itemRight-basePadding<$(item).width()}); var html="";if(beforeDayArray.length>0){var lastBeforeDay=$(beforeDayArray.pop());if(lastBeforeDay.hasClass("_cnTomorrow")){html='\n \x3cdiv class\x3d"time day tomorrow"\x3e\n \x3cspan class\x3d"text"\x3e\ub0b4\uc77c\x3c/span\x3e\n \x3c/div\x3e\n '; this.element.find("._cnAfterTomorrow .text").text("\ubaa8\ub808");this.element.find("._cnTwoAfterTomorrow .text").text("\uae00\ud53c")}else if(lastBeforeDay.hasClass("_cnAfterTomorrow")){html='\n \x3cdiv class\x3d"time day after_tomorrow"\x3e\n \x3cspan class\x3d"text"\x3e\ubaa8\ub808\x3c/span\x3e\n \x3c/div\x3e\n '; this.element.find("._cnTomorrow .text").text("\ub0b4\uc77c");this.element.find("._cnTwoAfterTomorrow .text").text("\uae00\ud53c")}else if(lastBeforeDay.hasClass("_cnTwoAfterTomorrow")){html='\n \x3cdiv class\x3d"time day after_tomorrow"\x3e\n \x3cspan class\x3d"text"\x3e\uae00\ud53c\x3c/span\x3e\n \x3c/div\x3e\n '; this.element.find("._cnTomorrow .text").text("\ub0b4\uc77c");this.element.find("._cnAfterTomorrow .text").text("\ubaa8\ub808")}lastBeforeDay.find(".text").html("0\uc2dc")}else{html='\n \x3cdiv class\x3d"time today now"\x3e\n \x3cspan class\x3d"text"\x3e\uc624\ub298\x3c/span\x3e\n \x3c/div\x3e\n '; this.element.find("._cnTomorrow .text").text("\ub0b4\uc77c");this.element.find("._cnAfterTomorrow .text").text("\ubaa8\ub808");this.element.find("._cnTwoAfterTomorrow .text").text("\uae00\ud53c")}this.element.find("._cnDayFixed").html(html)}}]); return compareHourlyFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i=todayYmd}); this.monthlyListMap[cp]=monthlyList.filter(function(data){return data.aplYmd>=todayYmd})}if(this.getCompareCpList().length<=1)this.enableNotSupportCompare(); else{this.initCompareCpList();this.initWeeklyFcast();this.initUpdateTime();this.initGuideLink()}oCommon._fnAttachIconAnimation();var lazyImages=[].slice.call($(document).find(".lazy"));oCommon.lazyLoadFunc(lazyImages); oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"initAfter",value:function initAfter(){}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){var _this$templateData7;var validationConfig={};var isDomestic=(_this$templateData7=this.templateData)===null||_this$templateData7===void 0? void 0:_this$templateData7.domestic;if(isDomestic){var _this$templateData8;var weeklyListMap=((_this$templateData8=this.templateData)===null||_this$templateData8===void 0?void 0:_this$templateData8.domesticWeeklyListMap)|| {};var cpList=["KMA","ACCUWEATHER","TWC","WEATHERNEWS"];for(var _i=0,_cpList=cpList;_i<_cpList.length;_i++){var cp=_cpList[_i];validationConfig["".concat(cp,"WeeklyFcastList")]={fields:["domesticWeeklyListMap.".concat(cp)], minLength:3}}}else{var _this$templateData9,_this$templateData0;var _weeklyListMap=((_this$templateData9=this.templateData)===null||_this$templateData9===void 0?void 0:_this$templateData9.overseasWeeklyListMap)|| {};var monthlyListMap=((_this$templateData0=this.templateData)===null||_this$templateData0===void 0?void 0:_this$templateData0.overseasMonthlyListMap)||{};var _cpList2=Object.keys(_objectSpread({},_weeklyListMap, {},monthlyListMap));for(var _i2=0,_cpList3=_cpList2;_i2<_cpList3.length;_i2++){var _cp=_cpList3[_i2];validationConfig["".concat(_cp,"WeeklyFcastList")]={fields:["overseasWeeklyListMap.".concat(_cp),"overseasMonthlyListMap.".concat(_cp)], operator:"OR",minLength:3}}}return validationConfig}}, {key:"attachEvent",value:function attachEvent(){$(document).on("click","._cnCompareWeeklyFcastInfo",$.proxy(this.toggleInfo,this))}}, {key:"toggleInfo",value:function toggleInfo(e){e.preventDefault();var element=this.element.find(".button_layer._cnCompareWeeklyFcastInfo");var isOpen=oCommon.fnGetOpenOrNot(element);oCommon.fnCloseAllInfoLayer(); if(isOpen)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"infox"));else{oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"info"));var weatherList=this.element.find(".weather_list"); if(weatherList.find("li").length===0){var iconMap={};this.element.find(".inner_weather .ico").each(function(index,element){var thisElement=$(element);iconMap[thisElement.data("ico")]=thisElement.data("txt")}); for(var ico in iconMap)if(ico&&iconMap[ico])weatherList.append('\x3cli class\x3d"item"\x3e\x3ci class\x3d"ico '.concat(ico,'" data-tooltip\x3d"').concat(iconMap[ico],'"\x3e\x3c/i\x3e').concat(iconMap[ico], "\x3c/li\x3e"))}oCommon.fnOpenInfoLayer(element)}}}, {key:"initCompareCpList",value:function initCompareCpList(){var element=this.element.find("._cnCompareCpList");var cpList=this.getCompareCpList();var html="";for(var i in cpList){var cp=cpList[i];var cpClass= this.cpClassMap[cp]||null;var cpName=this.cpNameMap[cp]||null;if(cpClass&&cpName)html+='\x3cli class\x3d"'.concat(cpClass,'" data-cp\x3d"').concat(cp,'"\x3e\x3cspan class\x3d"text"\x3e').concat(cpName, "\x3c/span\x3e\x3c/li\x3e")}element.show().html(html)}}, {key:"getCompareCpList",value:function getCompareCpList(){if(this.domestic)return this.domesticCompareCpList();else return this.overseasCompareCpList()}}, {key:"domesticCompareCpList",value:function domesticCompareCpList(){return["KMA","ACCUWEATHER","TWC","WEATHERNEWS"]}}, {key:"overseasCompareCpList",value:function overseasCompareCpList(){var availableCp=[];if(this.weeklyListMap.hasOwnProperty("WEATHERNEWS"))availableCp.push("WEATHERNEWS");if(this.weeklyListMap.hasOwnProperty("ACCUWEATHER"))availableCp.push("ACCUWEATHER"); if(this.weeklyListMap.hasOwnProperty("TWC"))availableCp.push("TWC");return availableCp}}, {key:"initWeeklyFcast",value:function initWeeklyFcast(){var cpList=this.getCompareCpList();var nowDate=this.localDateTime.format("YYYYMMDD");var aplYmdCpWeeklyFcastHtmlMapMap={};var aplYmdCpMonthlyFcastHtmlMapMap= {};var dayHtmlMap={};var cpWeeklyFcastHtml=Object.fromEntries(cpList.map(function(key){return[key,""]})); var sundayClassMap={};for(var i in cpList){var cp=cpList[i];var cpWeeklyFcastList=this.weeklyListMap[cp]||[];for(var j in cpWeeklyFcastList){var weeklyFcast=cpWeeklyFcastList[j];if(!dayHtmlMap.hasOwnProperty(weeklyFcast.aplYmd)){var _this$createDayTimeHt= this.createDayTimeHtml(weeklyFcast.aplYmd,nowDate,weeklyFcast.dayString);var _this$createDayTimeHt2=_slicedToArray(_this$createDayTimeHt,2);dayHtmlMap[weeklyFcast.aplYmd]=_this$createDayTimeHt2[0];sundayClassMap[weeklyFcast.aplYmd]= _this$createDayTimeHt2[1]}if(!aplYmdCpWeeklyFcastHtmlMapMap.hasOwnProperty(weeklyFcast.aplYmd))aplYmdCpWeeklyFcastHtmlMapMap[weeklyFcast.aplYmd]={};aplYmdCpWeeklyFcastHtmlMapMap[weeklyFcast.aplYmd][cp]= this.domestic?this.createDomesticCompareWeeklyHtml(cp,weeklyFcast,sundayClassMap[weeklyFcast.aplYmd]):this.createOverseasCompareWeeklyHtml(cp,weeklyFcast,sundayClassMap[weeklyFcast.aplYmd])}if(!this.domestic){var cpMonthlyFcastList= this.monthlyListMap[cp]||[];for(var _j in cpMonthlyFcastList){var monthlyFcast=cpMonthlyFcastList[_j];if(!dayHtmlMap.hasOwnProperty(monthlyFcast.aplYmd)){var _this$createDayTimeHt3=this.createDayTimeHtml(monthlyFcast.aplYmd, nowDate,monthlyFcast.dayString);var _this$createDayTimeHt4=_slicedToArray(_this$createDayTimeHt3,2);dayHtmlMap[monthlyFcast.aplYmd]=_this$createDayTimeHt4[0];sundayClassMap[monthlyFcast.aplYmd]=_this$createDayTimeHt4[1]}if(!aplYmdCpMonthlyFcastHtmlMapMap.hasOwnProperty(monthlyFcast.aplYmd))aplYmdCpMonthlyFcastHtmlMapMap[monthlyFcast.aplYmd]= {};aplYmdCpMonthlyFcastHtmlMapMap[monthlyFcast.aplYmd][cp]=this.createOverseasCompareMonthlyHtml(cp,monthlyFcast,sundayClassMap[monthlyFcast.aplYmd])}}}if(Object.keys(dayHtmlMap).length===0){var baseMoment= this.localDateTime.clone();var dayList=["","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0","\uc77c"];for(var _i3=0;_i3<10;_i3++){var _this$createDayTimeHt5=this.createDayTimeHtml(baseMoment.format("YYYYMMDD"), nowDate,dayList[baseMoment.format("E")]);var _this$createDayTimeHt6=_slicedToArray(_this$createDayTimeHt5,2);dayHtmlMap[baseMoment.format("YYYYMMDD")]=_this$createDayTimeHt6[0];sundayClassMap[baseMoment.format("YYYYMMDD")]= _this$createDayTimeHt6[1];baseMoment.add(1,"days")}}Object.keys(dayHtmlMap).sort().reduce(function(newObj,key){newObj[key]=dayHtmlMap[key];return newObj},{}); var dayHtml='\n \x3cth scope\x3d"col"\x3e\n \x3cspan class\x3d"blind"\x3e\ub0a0\uc528 \uc81c\uacf5\uc0ac\x3c/span\x3e\n \x3c/th\x3e';var weeklyFcastHtml="";for(var aplYmd in dayHtmlMap){dayHtml+= dayHtmlMap[aplYmd];var cpWeeklyFcastHtmlMap=aplYmdCpWeeklyFcastHtmlMapMap[aplYmd]||{};var cpMonthlyFcastHtmlMap=aplYmdCpMonthlyFcastHtmlMapMap[aplYmd]||{};for(var _i4 in cpList){var _cp2=cpList[_i4];if(cpWeeklyFcastHtmlMap.hasOwnProperty(_cp2))cpWeeklyFcastHtml[_cp2]+= cpWeeklyFcastHtmlMap[_cp2];else if(cpMonthlyFcastHtmlMap.hasOwnProperty(_cp2))cpWeeklyFcastHtml[_cp2]+=cpMonthlyFcastHtmlMap[_cp2];else cpWeeklyFcastHtml[_cp2]+=this.createEmptyWeeklyFcastHtml(sundayClassMap[aplYmd])}}this.element.find("._cnCompareDay").html(dayHtml); for(var _i5 in cpList){var _this$isDataValid;var _cp3=cpList[_i5];var validationKey="".concat(_cp3,"WeeklyFcastList");if(((_this$isDataValid=this.isDataValid)===null||_this$isDataValid===void 0?void 0: _this$isDataValid[validationKey])===false)cpWeeklyFcastHtml[_cp3]='\n \x3ctr\x3e\n \x3cth scope\x3d"row"\x3e\n \x3cspan class\x3d"blind"\x3e'.concat(this.cpNameMap[_cp3], '\x3c/span\x3e\n \x3c/th\x3e\n \x3ctd colspan\x3d"').concat(Object.keys(dayHtmlMap).length,'" class\x3d"error"\x3e\n \x3cdiv class\x3d"weather"\x3e\n \x3cdiv class\x3d"inner_error _cnNoData" data-validation-key\x3d"').concat(validationKey, '"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n \x3c/tr\x3e\n ');else cpWeeklyFcastHtml[_cp3]='\n \x3ctr\x3e\n \x3cth scope\x3d"row"\x3e\n \x3cspan class\x3d"blind"\x3e'.concat(this.cpNameMap[_cp3], "\x3c/span\x3e\n \x3c/th\x3e\n ").concat(cpWeeklyFcastHtml[_cp3],"\n \x3c/tr\x3e\n ");weeklyFcastHtml+=cpWeeklyFcastHtml[_cp3]}this.element.find("._cnCompareDay").after(weeklyFcastHtml)}}, {key:"initUpdateTime",value:function initUpdateTime(){var cpList=this.getCompareCpList();for(var i in cpList){var cp=cpList[i];var lastElement=this.weeklyListMap[cp][this.weeklyListMap[cp].length-1];var value= lastElement===null||lastElement===void 0?void 0:lastElement.fcastYmdt;if(this.updateTime0)pmRainfallHtml='\x3cspan class\x3d"rainfall"\x3e'.concat(pmRainfallHtml, "\x3c/span\x3e");pmWeather='\n \x3cdiv class\x3d"inner_weather"\x3e\n \x3cspan class\x3d"date"\x3e'.concat(this.domestic?"\uc624\ud6c4":"\ubc24",'\x3c/span\x3e\n \x3ci class\x3d"ico _cnLazy" data-ico\x3d"ico_wt').concat(pmWetrCd, '" data-txt\x3d"').concat(pmWetrTxt,'" data-tooltip\x3d"').concat(pmWetrTxt,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(pmWetrTxt,"\x3c/span\x3e\x3c/i\x3e\n ").concat(pmRainfallHtml,"\n \x3c/div\x3e\n ")}if(!isNaN(Number(minTmpr)))minTmpr= minTmpr+"\u00b0";if(!isNaN(Number(maxTmpr)))maxTmpr=maxTmpr+"\u00b0";if(amRainfallHtml.length>0)amRainfallHtml='\x3cspan class\x3d"rainfall"\x3e'.concat(amRainfallHtml,"\x3c/span\x3e");return'\n \x3ctd\x3e\n \x3cdiv class\x3d"weather '.concat(sundayClass, '"\x3e\n \x3cdiv class\x3d"inner_weather"\x3e\n \x3cspan class\x3d"date"\x3e').concat(this.domestic?"\uc624\uc804":"\ub0ae",'\x3c/span\x3e\n \x3ci class\x3d"ico _cnLazy" data-ico\x3d"ico_wt').concat(amWetrCd, '" data-txt\x3d"').concat(amWetrTxt,'" data-tooltip\x3d"').concat(amWetrTxt,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(amWetrTxt,"\x3c/span\x3e\x3c/i\x3e\n ").concat(amRainfallHtml, "\n \x3c/div\x3e\n ").concat(pmWeather,'\n \x3cdiv class\x3d"inner_weather"\x3e\n \x3cspan class\x3d"temperature lowest"\x3e').concat(minTmpr, '\x3c/span\x3e\n \x3cspan class\x3d"temperature"\x3e').concat(maxTmpr,"\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n ")}}, {key:"createEmptyWeeklyFcastHtml",value:function createEmptyWeeklyFcastHtml(sundayClass){return'\n \x3ctd\x3e\n \x3cdiv class\x3d"weather '.concat(sundayClass,'"\x3e\n \x3cdiv class\x3d"inner_weather"\x3e-\x3c/div\x3e\n \x3c/div\x3e\n \x3c/td\x3e\n ')}}, {key:"enableNotSupportCompare",value:function enableNotSupportCompare(){this.element.html("")}}, {key:"onCp",value:function onCp(cpName){this.element.find(".".concat(this.cpClassMap[cpName])).addClass("on")}}, {key:"initGuideLink",value:function initGuideLink(){var url="";if(deviceType==="pc")url="https://blog.naver.com/naver_weather/222199399966";else url="https://m.blog.naver.com/naver_weather/222199399966"; this.element.find("._cnInfoGuideLink").prop("href",url)}}]); return compareWeeklyFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0&&this.templateData.regionInfoList.length>0&&this.templateData.subRegionInfoList.length>0}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this$bottomSheet,_this$bottomSheet$han;this.reflowLocationList();(_this$bottomSheet=this.bottomSheet)===null|| _this$bottomSheet===void 0?void 0:(_this$bottomSheet$han=_this$bottomSheet.handleResize)===null||_this$bottomSheet$han===void 0?void 0:_this$bottomSheet$han.call(_this$bottomSheet,lastResponsiveSizeType, isChanged)}}, {key:"initData",value:function initData(){this.regionCodeKeySmsIdValueMap["00"]=[];var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=this.disasterSmsItemList[Symbol.iterator](), _step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _sms$id;var sms=_step.value;var smsId=(_sms$id=sms.id)!==null&&_sms$id!==void 0?_sms$id:"";if(!smsId)continue; this.smsIdMap[smsId]=sms;this.regionCodeKeySmsIdValueMap["00"].push(smsId);var addedRegionCodes=new Set;var addedSubRegionCodes=new Set;var _iteratorNormalCompletion2=true;var _didIteratorError2=false; var _iteratorError2=undefined;try{for(var _iterator2=(sms.areas||[])[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var area=_step2.value; var naverCd=area.naver_cd||"";if(naverCd.length<2)continue;var regionCodeKey=naverCd.substring(0,2);var subRegionCodeKey=naverCd.length>=5?naverCd.substring(0,5):"";if(regionCodeKey&&!addedRegionCodes.has(regionCodeKey)){addedRegionCodes.add(regionCodeKey); if(!this.regionCodeKeySmsIdValueMap.hasOwnProperty(regionCodeKey))this.regionCodeKeySmsIdValueMap[regionCodeKey]=[];this.regionCodeKeySmsIdValueMap[regionCodeKey].push(smsId)}if(subRegionCodeKey&&!addedSubRegionCodes.has(subRegionCodeKey)){addedSubRegionCodes.add(subRegionCodeKey); if(!this.regionCodeKeySmsIdValueMap.hasOwnProperty(subRegionCodeKey))this.regionCodeKeySmsIdValueMap[subRegionCodeKey]=[];this.regionCodeKeySmsIdValueMap[subRegionCodeKey].push(smsId)}}}catch(err){_didIteratorError2= true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}}}catch(err){_didIteratorError= true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}}}, {key:"initRegionFilterBtn",value:function initRegionFilterBtn(){var html='\x3cli class\x3d"group_item" role\x3d"presentation"\x3e\x3ca href\x3d"#" class\x3d"tab_link _cnRegionFilter" data-nlog\x3d"sido_tab" role\x3d"tab" data-region\x3d"00" data-region-code\x3d"00" aria-selected\x3d"true" data-nlog-area\x3d"disaster_sms.sido_tab_link" data-nlog-params\x3d\'{"region_id":"00"}\'\x3e\uc804\uad6d\x3c/a\x3e\x3c/li\x3e'; var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=this.regionInfoMap[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3= true){var _step3$value=_slicedToArray(_step3.value,2),key=_step3$value[0],regionInfo=_step3$value[1];html+='\n \x3cli class\x3d"group_item" role\x3d"presentation"\x3e\x3ca href\x3d"#" class\x3d"tab_link _cnRegionFilter" data-nlog\x3d"sido_tab" role\x3d"tab" data-region\x3d"'.concat(key, '" data-region-code\x3d"').concat(key,'" aria-selected\x3d"false" data-nlog-area\x3d"disaster_sms.sido_tab_link" data-nlog-params\x3d\'{"region_id":"').concat(key,"\"}'\x3e").concat(regionInfo.shortName, "\x3c/a\x3e\x3c/li\x3e\n ");var _allSubRegionHtml='\x3cli class\x3d"group_item" role\x3d"presentation"\x3e\x3ca href\x3d"#" class\x3d"tab_link _cnSubRegionFilter" data-nlog\x3d"sigungu_tab" role\x3d"tab" data-region\x3d"'.concat(key, '000" data-region-code\x3d"').concat(key,'000" aria-selected\x3d"true" data-nlog-area\x3d"disaster_sms.sigungu_tab_link" data-nlog-params\x3d\'{"region_id":"').concat(key,"000\"}'\x3e\uc804\uccb4\x3c/a\x3e\x3c/li\x3e"); if(!this.regionCodeKeySubRegionFilterValueMap.hasOwnProperty(key))this.regionCodeKeySubRegionFilterValueMap[key]=_allSubRegionHtml}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&& _iterator3["return"]!=null)_iterator3["return"]()}finally{if(_didIteratorError3)throw _iteratorError3;}}var allSubRegionHtml='\x3cli class\x3d"group_item" role\x3d"presentation"\x3e\x3ca href\x3d"#" class\x3d"tab_link _cnSubRegionFilter" data-nlog\x3d"sigungu_tab" role\x3d"tab" data-region\x3d"00000" data-region-code\x3d"00000" aria-selected\x3d"true" data-nlog-area\x3d"disaster_sms.sigungu_tab_link" data-nlog-params\x3d\'{"region_id":"00000"}\'\x3e\uc804\uccb4\x3c/a\x3e\x3c/li\x3e'; this.regionCodeKeySubRegionFilterValueMap["00"]=allSubRegionHtml;this.element.find("._cnRegionList").html(html);this.element.find("._cnSubRegionList").html(allSubRegionHtml);var _iteratorNormalCompletion4= true;var _didIteratorError4=false;var _iteratorError4=undefined;try{for(var _iterator4=this.subRegionInfoMap[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4= true){var _step4$value=_slicedToArray(_step4.value,2),_key=_step4$value[0],subRegionInfo=_step4$value[1];var regionCodeKey=(_key||"").substring(0,2);if(this.regionCodeKeySubRegionFilterValueMap.hasOwnProperty(regionCodeKey)){var subRegionFilterHtml= '\n \x3cli class\x3d"group_item" role\x3d"presentation"\x3e\x3ca href\x3d"#" class\x3d"tab_link _cnSubRegionFilter" data-nlog\x3d"sigungu_tab" role\x3d"tab" data-region\x3d"'.concat(_key, '" data-region-code\x3d"').concat(_key,'" aria-selected\x3d"false" data-nlog-area\x3d"disaster_sms.sigungu_tab_link" data-nlog-params\x3d\'{"region_id":"').concat(_key,"\"}'\x3e").concat(subRegionInfo.shortName, "\x3c/a\x3e\x3c/li\x3e\n ");this.regionCodeKeySubRegionFilterValueMap[regionCodeKey]+=subRegionFilterHtml}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&& _iterator4["return"]!=null)_iterator4["return"]()}finally{if(_didIteratorError4)throw _iteratorError4;}}}}, {key:"initDisasterTypeFilterBtn",value:function initDisasterTypeFilterBtn(){var disasterTypeSet=new Set;var html='\x3coption value\x3d"00"\x3e\uc804\uccb4\x3c/option\x3e';var _iteratorNormalCompletion5= true;var _didIteratorError5=false;var _iteratorError5=undefined;try{for(var _iterator5=this.currentDisasterSmsList[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5= true){var sms=_step5.value;if(!disasterTypeSet.has(sms.da_id)){disasterTypeSet.add(sms.da_id);html+='\x3coption value\x3d"'.concat(sms.da_id,'"\x3e').concat(sms.da_nm,"\x3c/option\x3e")}}}catch(err){_didIteratorError5= true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5["return"]!=null)_iterator5["return"]()}finally{if(_didIteratorError5)throw _iteratorError5;}}this.element.find("#disasterSelect").html(html); this.element.find("._cnDisasterTitle").text("\uc7ac\ub09c\uc885\ub958")}}, {key:"initDisasterSmsItemList",value:function initDisasterSmsItemList(){var changeDisasterType=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.element.find("._cnDisasterSmsList").html(""); this.element.find("._cnDisasterSmsMoreCountWrap").html("");this.currentDisasterSmsList=[];this.totalPages=0;this.loadDetailData(1,changeDisasterType)}}, {key:"listingDisasterSmsItem",value:function listingDisasterSmsItem(pageNo){var html="";var startIndex=(pageNo-1)*this.perPageCount;var endIndex=Math.min(startIndex+this.perPageCount,this.currentDisasterSmsList.length); var visibleList=this.currentDisasterSmsList.slice(startIndex,endIndex);for(var i=0;i=4&&((_className=className)===null||_className===void 0?void 0:_className.indexOf("category2"))<0)className+=" category2"; html+='\n \x3cli class\x3d"item _cnDisasterSmsItem" data-page\x3d"'.concat(pageNo,'"\x3e\n \x3cdiv class\x3d"inner_item"\x3e\n \x3cdiv class\x3d"title"\x3e\n \x3cem class\x3d"category ').concat(className, '"\x3e').concat(_disasterSms.da_nm,'\x3c/em\x3e\n \x3cstrong class\x3d"location"\x3e\n \x3cspan class\x3d"name"\x3e').concat(_disasterSms.gov_nm,'\x3c/span\x3e\n \x3cspan class\x3d"time"\x3e').concat(datetime, "\x3c/span\x3e\n \x3c/strong\x3e\n ").concat(actionHtml,'\n \x3c/div\x3e\n \x3cp class\x3d"summary"\x3e').concat(_disasterSms.msg, '\x3c/p\x3e\n \x3cdiv class\x3d"location_detail _cnLocationDetail"\x3e\n \x3cul class\x3d"location_list _cnLocationList"\x3e\n ').concat(this.generateLocationList(_disasterSms.areas), '\n \x3c/ul\x3e\n \x3cdiv class\x3d"location_more_layer _cnLocationMoreLayer" aria-hidden\x3d"true" role\x3d"listbox"\x3e\n \x3cul class\x3d"location_list _cnMoreLocationList"\x3e\n \x3c/ul\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close _cnMoreLocationCloseBtn" data-type\x3d"location" data-nlog-area\x3d"disaster_sms.layer.close_button" data-nlog-params\x3d\'{"category":"location"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub2eb\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/li\x3e\n ')}var pageHtml= '\x3cem class\x3d"card_count_emphasis _cnDisasterSmsMoreCount"\x3e'.concat(pageNo,"\x3c/em\x3e/").concat(this.totalPages);if(this.totalPages>1){this.element.find("._cnDisasterSmsMoreCountWrap").html(pageHtml); this.element.find("._cnDisasterSmsMore").removeClass("hide")}else this.element.find("._cnDisasterSmsMore").addClass("hide");this.element.find("._cnDisasterSmsList").html(html).removeClass("hide");this.element.find("._cnNoDisasterSms").addClass("hide"); this.reflowLocationList();if(visibleList.length===0){this.element.find("._cnDisasterSmsList").addClass("hide");this.element.find("._cnNoDisasterSms").removeClass("hide")}}}, {key:"generateLocationList",value:function generateLocationList(areas){if(_.isEmpty(areas))return"";var html="";var _iteratorNormalCompletion6=true;var _didIteratorError6=false;var _iteratorError6=undefined; try{for(var _iterator6=areas[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){var area=_step6.value;var naverCd=area.naver_cd||""; if(naverCd.length<2)continue;var region=this.regionInfoMap.get(naverCd.substring(0,2));var subRegion=this.subRegionInfoMap.get(naverCd.substring(0,5));var areaName=area.emd_name||area.sigungu_name||area.sido_name|| "";if(naverCd.length===2&&area.sido_name)html+='\x3cli\x3e\x3ca href\x3d"#" class\x3d"location_link _cnDisasterLocation" data-nlog\x3d"sent_region" data-region-code\x3d"'.concat(naverCd,'" data-region\x3d"').concat(naverCd, '" data-nlog-area\x3d"disaster_sms.sent_region_link" data-nlog-params\x3d\'{"region_id":"').concat(naverCd,"\"}'\x3e").concat(area.sido_name,"\x3c/a\x3e\x3c/li\x3e");else if(naverCd.length===5&&area.sido_name&& area.sigungu_name)html+='\x3cli\x3e\x3ca href\x3d"#" class\x3d"location_link _cnDisasterLocation" data-nlog\x3d"sent_region" data-region-code\x3d"'.concat(naverCd,'" data-region\x3d"').concat(naverCd,'" data-nlog-area\x3d"disaster_sms.sent_region_link" data-nlog-params\x3d\'{"region_id":"').concat(naverCd, "\"}'\x3e").concat((region===null||region===void 0?void 0:region.shortName)||area.sido_name," ").concat((subRegion===null||subRegion===void 0?void 0:subRegion.shortName)||area.sigungu_name,"\x3c/a\x3e\x3c/li\x3e"); else if(area.sido_name&&area.sigungu_name&&area.emd_name)html+='\x3cli\x3e\x3ca href\x3d"#" class\x3d"location_link _cnDisasterLocation" data-nlog\x3d"sent_region" data-region-code\x3d"'.concat(naverCd, '" data-region\x3d"').concat(naverCd,'" data-nlog-area\x3d"disaster_sms.sent_region_link" data-nlog-params\x3d\'{"region_id":"').concat(naverCd,"\"}'\x3e").concat((region===null||region===void 0?void 0: region.shortName)||area.sido_name," ").concat((subRegion===null||subRegion===void 0?void 0:subRegion.shortName)||area.sigungu_name," ").concat(area.emd_name,"\x3c/a\x3e\x3c/li\x3e");else if(areaName)html+= '\x3cli\x3e\x3ca href\x3d"#" class\x3d"location_link _cnDisasterLocation" data-nlog\x3d"sent_region" data-region-code\x3d"'.concat(naverCd,'" data-region\x3d"').concat(naverCd,'" data-nlog-area\x3d"disaster_sms.sent_region_link" data-nlog-params\x3d\'{"region_id":"').concat(naverCd, "\"}'\x3e").concat(areaName,"\x3c/a\x3e\x3c/li\x3e")}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6["return"]!=null)_iterator6["return"]()}finally{if(_didIteratorError6)throw _iteratorError6; }}html+='\x3cli\x3e\x3cbutton type\x3d"button" class\x3d"more_btn _cnMoreLocationBtn" data-nlog\x3d"location_more" aria-expanded\x3d"false" aria-haspopup\x3d"listbox" data-nlog-area\x3d"disaster_sms.location_more_button"\x3e\x3cspan class\x3d"blind"\x3e\uc1a1\ucd9c\uc9c0\uc5ed \ub354\ubcf4\uae30\x3c/span\x3e+0\x3c/button\x3e\x3c/li\x3e'; return html}}, {key:"splitLocationList",value:function splitLocationList($item){if(!$item.is(":visible"))return;var $locationDetail=$item.find("._cnLocationDetail");var $locationList=$locationDetail.find("._cnLocationList").first(); var $moreBtn=$locationList.find("._cnMoreLocationBtn");var $moreLi=$moreBtn.closest("li");var $moreLayer=$locationDetail.find("._cnLocationMoreLayer");var $moreLayerList=$moreLayer.find("._cnMoreLocationList"); $moreLayerList.children().detach().insertBefore($moreLi);$moreLi.addClass("hide");$locationList[0].offsetHeight;var items=$locationList.children().not($moreLi).toArray();var tops=Array.from(new Set(items.map(function(item){return item.offsetTop}))).sort(function(a, b){return a-b}); if(tops.length<=2){$moreLi.addClass("hide");$moreLayer.attr("aria-hidden","true");$moreBtn.attr("aria-expanded","false").html('\x3cspan class\x3d"blind"\x3e\uc1a1\ucd9c\uc9c0\uc5ed \ub354\ubcf4\uae30\x3c/span\x3e+0'); return}var secondTop=tops[1];$(items).filter(function(_,item){return item.offsetTop>secondTop}).detach().appendTo($moreLayerList); $moreLi.removeClass("hide");$locationList[0].offsetHeight;var all=$locationList.children().toArray();tops=Array.from(new Set(all.map(function(item){return item.offsetTop}))).sort(function(a,b){return a- b}); if(tops.length>2){var $last=$moreLi.prev("li");if($last.length)$last.detach().appendTo($moreLayerList)}var n=$moreLayerList.children().length;$moreBtn.html('\x3cspan class\x3d"blind"\x3e\uc1a1\ucd9c\uc9c0\uc5ed \ub354\ubcf4\uae30\x3c/span\x3e+'.concat(n)).attr("aria-expanded", "false");$moreLayer.attr("aria-hidden","true")}}, {key:"reflowLocationList",value:function reflowLocationList(){var _this4=this;this.element.find("._cnDisasterSmsItem:visible").each(function(_,item){return _this4.splitLocationList($(item))})}}, {key:"changeRegionFilter",value:function changeRegionFilter(regionCode){this.element.find("._cnCurrentPositionBtn").removeClass("is_active");if(regionCode.length===2)regionCode=regionCode+"000";else if(regionCode.length> 5)regionCode=regionCode.substring(0,5);var subRegionHtml=this.regionCodeKeySubRegionFilterValueMap[regionCode.substring(0,2)]||"";var selectedSubRegionText=$(subRegionHtml).find('[data-region\x3d"'.concat(regionCode, '"]')).text();var regionName=this.element.find('._cnRegionFilter[data-region\x3d"'.concat(regionCode.substring(0,2),'"]')).text();if(regionCode.substring(2,5)==="000")regionCode=regionCode.substring(0, 2);else regionName+=" ".concat(selectedSubRegionText);this.selectedRegionCode=regionCode;this.element.find(".location_btn._cnRegionFilterBtn").text(regionName);this.selectedDisasterId="00";this.initDisasterSmsItemList()}}, {key:"clickRegionFilterBtn",value:function clickRegionFilterBtn(e){var currentTarget=this.element.find(".location_btn._cnRegionFilterBtn");var isExpanded=currentTarget.attr("aria-expanded")==="true";this.bottomSheet.toggle(); currentTarget.attr("aria-expanded",!isExpanded);this.clickRegionFilterRefreshBtn();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"sortregion"))}}, {key:"clickRegionFilterBtnClose",value:function clickRegionFilterBtnClose(){var _this5=this;if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.element.find(".location_btn._cnRegionFilterBtn").attr("aria-expanded", "false");else setTimeout(function(){return _this5.element.find(".location_btn._cnRegionFilterBtn").attr("aria-expanded","false")},300)}}, {key:"clickRegionFilter",value:function clickRegionFilter(e){e.preventDefault();var current=$(e.currentTarget);var regionCode=current.data("region")||"";this.element.find("._cnRegionFilter").attr("aria-selected", "false");current.attr("aria-selected","true");this.element.find("._cnSubRegionList").html(this.regionCodeKeySubRegionFilterValueMap[regionCode]||"");this.element.find("._cnSubRegionScrollWrap").scrollTop(0)}}, {key:"clickSubRegionFilter",value:function clickSubRegionFilter(e){e.preventDefault();var current=$(e.currentTarget);this.element.find("._cnSubRegionFilter").attr("aria-selected","false");current.attr("aria-selected", "true")}}, {key:"clickRegionFilterApplyBtn",value:function clickRegionFilterApplyBtn(){if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.element.find(".location_btn._cnRegionFilterBtn").attr("aria-expanded", "false");this.bottomSheet.close();var selectedSubRegion=this.element.find('._cnSubRegionFilter[aria-selected\x3d"true"]');if(selectedSubRegion.length>0){var regionCode=selectedSubRegion.data("region")+ "";this.changeRegionFilter(regionCode)}}}, {key:"clickRegionFilterRefreshBtn",value:function clickRegionFilterRefreshBtn(){this.element.find("._cnSubRegionList").html(this.regionCodeKeySubRegionFilterValueMap[this.selectedRegionCode.substring(0, 2)]);this.element.find("._cnSubRegionScrollWrap").scrollTop(0);var regionFilter=this.element.find("._cnRegionFilter").attr("aria-selected","false");var subRegionFilter=this.element.find("._cnSubRegionFilter").attr("aria-selected", "false");var selectedRegionElement,selectedSubRegionElement;if(this.selectedRegionCode.length===2){selectedRegionElement=regionFilter.filter('[data-region\x3d"'.concat(this.selectedRegionCode,'"]')).attr("aria-selected", "true");selectedSubRegionElement=subRegionFilter.filter('[data-region\x3d"'.concat(this.selectedRegionCode,'000"]')).attr("aria-selected","true")}else if(this.selectedRegionCode.length===5){selectedRegionElement= regionFilter.filter('[data-region\x3d"'.concat(this.selectedRegionCode.substring(0,2),'"]')).attr("aria-selected","true");selectedSubRegionElement=subRegionFilter.filter('[data-region\x3d"'.concat(this.selectedRegionCode, '"]')).attr("aria-selected","true")}setTimeout(function(){var _selectedRegionElemen,_selectedRegionElemen2,_selectedSubRegionEle,_selectedSubRegionEle2;(_selectedRegionElemen=selectedRegionElement)===null|| _selectedRegionElemen===void 0?void 0:(_selectedRegionElemen2=_selectedRegionElemen[0])===null||_selectedRegionElemen2===void 0?void 0:_selectedRegionElemen2.scrollIntoView({behavior:"smooth",block:"nearest"}); (_selectedSubRegionEle=selectedSubRegionElement)===null||_selectedSubRegionEle===void 0?void 0:(_selectedSubRegionEle2=_selectedSubRegionEle[0])===null||_selectedSubRegionEle2===void 0?void 0:_selectedSubRegionEle2.scrollIntoView({behavior:"smooth", block:"nearest"})},300)}}, {key:"changeDisasterType",value:function changeDisasterType(e){var current=$(e.currentTarget);var value=current.val();var text=current.find("option:selected").text();this.element.find("._cnDisasterTitle").text(text); if(this.selectedDisasterId===value)return;this.selectedDisasterId=value;this.initDisasterSmsItemList(true)}}, {key:"clickMoreLocationBtn",value:function clickMoreLocationBtn(e){var current=$(e.currentTarget);var isExpanded=current.attr("aria-expanded")==="true";this.clickMoreLocationCloseBtn();var $moreLayer=current.closest("._cnLocationDetail").find("._cnLocationMoreLayer"); current.attr("aria-expanded",!isExpanded);$moreLayer.attr("aria-hidden",isExpanded);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"regionmore"))}}, {key:"clickMoreLocationCloseBtn",value:function clickMoreLocationCloseBtn(){var $locationDetail=this.element.find("._cnLocationDetail");var $moreLayer=$locationDetail.find("._cnLocationMoreLayer");var $moreBtn= $locationDetail.find("._cnMoreLocationBtn");$moreLayer.attr("aria-hidden","true");$moreBtn.attr("aria-expanded","false")}}, {key:"clickDisasterLocation",value:function clickDisasterLocation(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"region"));var current=$(e.currentTarget); var regionCode=current.data("region")||"";if(regionCode)this.changeRegionFilter(regionCode+"")}}, {key:"clickDisasterSmsHelp",value:function clickDisasterSmsHelp(){var currentTarget=this.element.find(".button_help._cnDisasterHelpBtn");var isOpen=oCommon.fnGetOpenOrNot(currentTarget);oCommon.fnCloseAllInfoLayer(); if(isOpen===false)oCommon.fnOpenInfoLayer(currentTarget)}}, {key:"clickDisasterSmsMore",value:function clickDisasterSmsMore(e){e.preventDefault();var nextPage=this.element.find("._cnDisasterSmsItem:visible").data("page")+1>this.totalPages?1:this.element.find("._cnDisasterSmsItem:visible").data("page")+ 1;this.loadDetailData(nextPage,true)}}, {key:"clickCurrentPositionBtn",value:function clickCurrentPositionBtn(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"myloc"));var target=$(e.currentTarget); var _this=this;var fnCallback=function fnCallback(oLocation){var aCoords=oLocation.split(",");var sURL="/api/naverRgnCatForCoords";$.ajax({method:"GET",url:sURL,data:{lat:aCoords[0],lng:aCoords[1]}}).done(function(response){_this.element.find(".location_btn._cnRegionFilterBtn").attr("aria-expanded", "false");_this.bottomSheet.close();if(response===null||response===void 0?void 0:response.regionCode){var regionCode=response.regionCode.startsWith("WD")?"00000":response.regionCode;_this.changeRegionFilter(regionCode); target.addClass("is_active")}else alert("\uc77c\uc2dc\uc801\uc73c\ub85c \ub0b4 \uc704\uce58\ub97c \ud655\uc778\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.")}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[disasterSms.js] \uc9c0\uc5ed\ucf54\ub4dc \uc870\ud68c API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}; var htOption={};htOption.callback=fnCallback;htOption.welButton=target;htOption.returnType="".concat(isBlockPreview?"preview":"").concat(pageJson.url);oCommonGeoLocation.fnInit(htOption)}}, {key:"getSmsItem",value:function getSmsItem(smsId){return this.smsIdMap[smsId]||null}}, {key:"loadDetailData",value:function loadDetailData(pageNo){var _this6=this;var skipDisasterTypeInit=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var disasterSmsIdList=this.regionCodeKeySmsIdValueMap[this.selectedRegionCode]|| [];disasterSmsIdList=this.selectedDisasterId!=="00"?disasterSmsIdList.filter(function(id){return _this6.getSmsItem(id).da_id===_this6.selectedDisasterId}):disasterSmsIdList; var startIndex=(pageNo-1)*this.perPageCount;var endIndex=Math.min(startIndex+this.perPageCount,disasterSmsIdList.length);var needLoadingIdList=[];for(var i=startIndex;i1){if(!this.isEnableAd()){setTimeout(function(){oCommon.fnMoveScrollToTarget(targetId,function(){return $("#wrap").addClass("scrolled down")})}, 300); return}var targetDiv=document.getElementById(this.adUnit);try{if(targetDiv){var config={childList:true};var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.type=== "childList")setTimeout(function(){oCommon.fnMoveScrollToTarget(targetId,function(){return $("#wrap").addClass("scrolled down")})},300)})}); observer.observe(targetDiv,config)}}catch(e){setTimeout(function(){oCommon.fnMoveScrollToTarget(targetId,function(){return $("#wrap").addClass("scrolled down")})},300)}}}}, {key:"render",value:function render(){var adSlotList=oBlockScriptService.callTemplateFunc(this.templateId,"getAdSlot").filter(function(adSlot){return adSlot}); var _this=this;if(!_.isEmpty(adSlotList))window.gladsdk.cmd.push(function(){_this.adDedupManager=window.gladsdk.setAdDeduplication(menu,adSlotList.length-1);_this.adDedupManager.displayAds(adSlotList)})}}, {key:"initAdSlot",value:function initAdSlot(){var _this=this;var $firstElementWithoutId=this.element.find("div:not([id])").eq(0);$firstElementWithoutId.attr("id",this.adUnit);var adSlotInfo={adUnitId:this.adUnit, adSlotElementId:this.adUnit,customParam:{menu:"weather_".concat(menu)}};window.gladsdk.cmd.push(function(){_this.adSlot=window.gladsdk.defineAdSlot(adSlotInfo);var markBlockOnNoAd=function markBlockOnNoAd(ad){if(ad.slot.getAdSlotElementId()=== _this.adUnit){_this.element.addClass("is-empty");_this.mergeNlogAdParams({})}}; window.gladsdk.addEventListener(window.gladsdk.event.EMPTY,markBlockOnNoAd);window.gladsdk.addEventListener(window.gladsdk.event.ERROR,markBlockOnNoAd);window.gladsdk.addEventListener(window.gladsdk.event.AD_LOADED, function(ad){if(ad.slot.getAdSlotElementId()!==_this.adUnit)return;_this.mergeNlogAdParams(_this.extractNlogAdMeta(ad))}); window.gladsdk.addEventListener(window.gladsdk.event.AD_CLICKED,function(ad){if(ad.slot.getAdSlotElementId()!==_this.adUnit)return;if(window.oNlog2)oNlog2.send(_this.element,"click")})})}}, {key:"mergeNlogAdParams",value:function mergeNlogAdParams(meta){var el=this.element[0];if(!el)return;var params={};try{params=JSON.parse(el.getAttribute("data-nlog-params")||"{}")}catch(e){}params.is_ad= true;params.ad_id=meta.ad_id||"";params.ad_provider_group_cd=meta.ad_provider_group_cd||"";el.setAttribute("data-nlog-params",JSON.stringify(params))}}, {key:"extractNlogAdMeta",value:function extractNlogAdMeta(ad){var ctx=ad&&ad.adContext;try{if(typeof ctx==="string")ctx=JSON.parse(ctx)}catch(e){ctx=null}ctx=ctx||{};var adId=ctx.adId||ctx.creativeId|| ctx.adCreativeId||"";var provider=ctx.adProviderName||ctx.providerType||ctx.dspType||"";return{ad_id:String(adId),ad_provider_group_cd:this.toProviderGroupCd(provider)}}}, {key:"toProviderGroupCd",value:function toProviderGroupCd(provider){var p=String(provider||"").toLowerCase();var cd=["GFA","NCC","NDP"].find(function(g){return p.includes(g.toLowerCase())}); return cd||""}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"getAdSlot",value:function getAdSlot(){if(this.isEnableAd()&&!this.isInitAd){this.isInitAd=true;return this.adSlot}else return null}}, {key:"isEnableTemplate",value:function isEnableTemplate(){var _this$templateInfo3,_this$templateInfo3$c;return!_.isEmpty((_this$templateInfo3=this.templateInfo)===null||_this$templateInfo3===void 0?void 0: (_this$templateInfo3$c=_this$templateInfo3.customInfo)===null||_this$templateInfo3$c===void 0?void 0:_this$templateInfo3$c.adUnit)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(isChanged){this.isEnableAd()?this.element.removeClass("hide"):this.element.addClass("hide");if(this.templateInfo.index=== "1")this.render()}}}, {key:"isEnableAd",value:function isEnableAd(){if(!this.isEnableTemplate())return false;var responsiveType=oCommon.fnGetResponsiveSizeType().deviceType;return(this.adOSType==="pc"?responsiveType==="Pc": responsiveType!=="Pc")&&deviceType===this.adOSType}}]); return displayAd}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=before1HoursYmdt}); this._hourlyDataMap=new Map;this.hourlyList.forEach(function(wetr){var key="".concat(wetr[_this3.fieldMap.aplYmd]).concat(wetr[_this3.fieldMap.aplTm]);_this3._hourlyDataMap.set(key,wetr)}); this.render();this.syncPoiThemeRadio()}}, {key:"getPoiThemeCookieKey",value:function getPoiThemeCookieKey(){var _hourlyFcast$POI_THEM;return(_hourlyFcast$POI_THEM=hourlyFcast.POI_THEME[this.lsurType])===null||_hourlyFcast$POI_THEM===void 0?void 0: _hourlyFcast$POI_THEM.cookieKey}}, {key:"hasPoiTheme",value:function hasPoiTheme(){return Boolean(this.getPoiThemeCookieKey())}}, {key:"syncPoiThemeRadio",value:function syncPoiThemeRadio(){if(!this.hasPoiTheme())return;var themeOn=this.isPoiThemeOn();this.element.find("._cnPoiThemeOn").prop("checked",themeOn);this.element.find("._cnPoiThemeOff").prop("checked", !themeOn)}}, {key:"initAfter",value:function initAfter(){this.renderChart()}}, {key:"renderChart",value:function renderChart(){if(!this.element.is(":visible"))return;var _this=this;oCommon.fnLoadChartLibraries().done(function(){_this.renderHourlyChart();_this.renderOfferArea();_this.initScroll()}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[billboard JS] script \ud638\ucd9c \uc2e4\ud328", jqXHR); _this.renderOfferArea();_this.initScroll()})}}, {key:"initScroll",value:function initScroll(){var _this4=this;var $target=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.element.find(".scroll_area");var scrollCallback=function scrollCallback(name){if(name!== hourlyFcast.SUN_SCROLL_NAME)_this4.controlDay()}; oCommon.initScroll($target,scrollCallback,null,scrollCallback)}}, {key:"controlDay",value:function controlDay(){var _this5=this;var dayElementArray=this.element.find("._cnItemTime._cnDay").toArray();var beforeDayArray=dayElementArray.filter(function(item){var itemRight= item.getBoundingClientRect().right;var basePadding=_this5.element.find("._cnTableHeader").get(0).getBoundingClientRect().right;return itemRight-basePadding<$(item).width()}); var html="";if(beforeDayArray.length>0){var lastBeforeDay=$(beforeDayArray.pop());lastBeforeDay.find("span.label").html("0\uc2dc");if(lastBeforeDay.hasClass("_cnTomorrow")){html='\n \x3cstrong class\x3d"card_item_state type_tomorrow"\x3e\ub0b4\uc77c\x3c/strong\x3e\n '; this.element.find("._cnOneAfterTomorrow span.label").html("\ubaa8\ub808");this.element.find("._cnTwoAfterTomorrow span.label").html("\uae00\ud53c")}else if(lastBeforeDay.hasClass("_cnOneAfterTomorrow")){html= '\n \x3cstrong class\x3d"card_item_state type_after_tomorrow"\x3e\ubaa8\ub808\x3c/strong\x3e\n ';this.element.find("._cnTwoAfterTomorrow span.label").html("\uae00\ud53c")}else if(lastBeforeDay.hasClass("_cnTwoAfterTomorrow"))html= '\n \x3cstrong class\x3d"card_item_state type_after_tomorrow"\x3e\uae00\ud53c\x3c/strong\x3e\n '}else{html='\n \x3cstrong class\x3d"card_item_state"\x3e\uc624\ub298\x3c/strong\x3e\n '; this.element.find("._cnTomorrow span.label").html("\ub0b4\uc77c");this.element.find("._cnOneAfterTomorrow span.label").html("\ubaa8\ub808");this.element.find("._cnTwoAfterTomorrow span.label").html("\uae00\ud53c")}this.element.find("._cnDayFixed").html(html)}}, {key:"resetScrollAndChart",value:function resetScrollAndChart(){var scrollName=this.getTableScrollArea().data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.renderChart();else oCommon.oScroll[scrollName].refresh()}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.refreshSunScrollAreaHeight();this.resetScroll();this.controlDay();this.element.find(".scroll_area").each(function(index, el){var scrollName=$(el).data("name");if(!_.isEmpty(oCommon.oScroll[scrollName]))oCommon.controlScrollButton(oCommon.oScroll[scrollName],oCommon.oScroll[scrollName].wrapper,true)})}}, {key:"refreshSunScrollAreaHeight",value:function refreshSunScrollAreaHeight(){var $sunArea=this.element.find('.scroll_area[data-name\x3d"'.concat(hourlyFcast.SUN_SCROLL_NAME,'"]'));var $sunScroll=$sunArea.children().first(); if($sunScroll.length)$sunArea.height($sunScroll.outerHeight())}}, {key:"resetScroll",value:function resetScroll(){var _this6=this;this.element.find(".scroll_area").each(function(index,el){var $el=$(el);var scrollName=$el.data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))_this6.initScroll($el); else oCommon.refreshScroll(scrollName)})}}, {key:"getTableScrollArea",value:function getTableScrollArea(){return this.element.find(".scroll_area").not('[data-name\x3d"'.concat(hourlyFcast.SUN_SCROLL_NAME,'"]')).first()}}, {key:"render",value:function render(){this.renderHourlyFcast();this.renderSunRiseSetArea()}}, {key:"renderHourlyFcast",value:function renderHourlyFcast(){var _this7=this;var combineTimeHtml="";var combineRainProbHtml="";var combineRainAmtHtml="";var combineSnowAmtHtml="";var combineWindHtml=""; var combineWindImpactHtml="";var combineHumdHtml="";var combineGrassHtml="";var combineKidsIndexHtml="";var combineOutfitHtml="";var snowColorClass="";var combineTmprHtml="";var showKidsIndex=this.shouldShowKidsIndex(); this.expandedHourlyList=this.buildHourlyListWithSunRiseSet();var localDateTimeMoment=moment(this.localDateTime,"YYYYMMDDHHmm");var dateMoments={local:localDateTimeMoment,tomorrow:localDateTimeMoment.clone().add(1, "day"),dayAfterTomorrow:localDateTimeMoment.clone().add(2,"day"),twoDaysAfterTomorrow:localDateTimeMoment.clone().add(3,"day")};this.expandedHourlyList.forEach(function(wetr,index){var aplYmdt="".concat(wetr[_this7.fieldMap.aplYmd]).concat(wetr[_this7.fieldMap.aplTm]); var isSunEvent=wetr.isSunEvent===true;var sunEventType=isSunEvent?wetr.sunEventType:"";if(isSunEvent)combineTimeHtml+=_this7.buildSunEventTimeCellHtml(wetr);else{var date=moment(aplYmdt,"YYYYMMDDHH");var timeInfo= _this7.getTimeDisplayInfo(date,aplYmdt,index,dateMoments);if(timeInfo.needsFirstDayUpdate)_this7.element.find("._cnTime .today").removeClass("today").addClass("tomorrow").text("\ub0b4\uc77c");combineTimeHtml+= _this7.buildTimeCellHtml(wetr,aplYmdt,timeInfo)}combineTmprHtml+=_this7.buildTmprCellHtml(wetr,aplYmdt,sunEventType);combineRainProbHtml+=_this7.buildRainProbCellHtml(wetr,aplYmdt,sunEventType);combineRainAmtHtml+= _this7.buildRainAmtCellHtml(wetr,aplYmdt,sunEventType);var snowAmtCell=_this7.buildSnowAmtCellHtml(wetr,aplYmdt,sunEventType);combineSnowAmtHtml+=snowAmtCell.html;if(snowAmtCell.colorClass==="color")snowColorClass= "color";combineWindHtml+=_this7.buildWindCellHtml(wetr,aplYmdt,sunEventType);combineHumdHtml+=_this7.buildHumdCellHtml(wetr,sunEventType);if(_this7.hasPoiTheme())combineOutfitHtml+=_this7.buildOutfitCellHtml(wetr, aplYmdt,sunEventType);if(_this7.lsurType==="GF"){combineWindImpactHtml+=_this7.buildWindImpactCellHtml(wetr,aplYmdt,sunEventType);combineGrassHtml+=_this7.buildGrassCellHtml(wetr,sunEventType)}if(showKidsIndex)combineKidsIndexHtml+= _this7.buildKidsIndexCellHtml(wetr,sunEventType)}); var $cnSnowAmt=this.element.find("._cnSnowAmt");this.element.find("._cnTime").append(combineTimeHtml);this.element.find("._cnChart td").attr("colspan",this.expandedHourlyList.length+1);this.element.find("._cnTmpr").append(combineTmprHtml); this.element.find("._cnRainProb").append(combineRainProbHtml);this.element.find("._cnRainAmt").append(combineRainAmtHtml);$cnSnowAmt.append(combineSnowAmtHtml);if(snowColorClass==="color"){$cnSnowAmt.removeClass("hide"); this.element.find("._cnTableHeader .type_state--snow").removeClass("hide")}this.element.find("._cnWind").append(combineWindHtml);this.element.find("._cnHumd").append(combineHumdHtml);if(showKidsIndex){var $cnKidsIndex= this.element.find("._cnKidsIndex");$cnKidsIndex.append(combineKidsIndexHtml).removeClass("hide");this.element.find(".type_state--kids").removeClass("hide")}if(this.hasPoiTheme()){this.element.find("._cnOutfit").append(combineOutfitHtml); if(this.lsurType==="GF"){this.element.find("._cnGolfGrass").append(combineGrassHtml);this.element.find("._cnGolfWindImpact").append(combineWindImpactHtml)}this.applyPoiThemeVisibility(this.isPoiThemeOn())}if(this.shouldShowGameSchedule()){var combineGameScheduleHtml= this.buildGameScheduleRowHtml();if(combineGameScheduleHtml){var $cnGameSchedule=this.element.find("._cnGameSchedule");$cnGameSchedule.append(combineGameScheduleHtml).removeClass("hide");this.element.find(".type_state--sports").removeClass("hide")}}if(this.shouldShowGolfRound()){var combineGolfRoundHtml= this.buildGolfRoundRowHtml();if(combineGolfRoundHtml){var _$cnGameSchedule=this.element.find("._cnGameSchedule");_$cnGameSchedule.append(combineGolfRoundHtml).removeClass("hide");this.element.find(".type_state--sports").removeClass("hide")}}}}, {key:"sunEventAttr",value:function sunEventAttr(sunEventType){return sunEventType?' data-sun-event\x3d"'.concat(sunEventType,'"'):""}}, {key:"buildWindCellHtml",value:function buildWindCellHtml(wetr,aplYmdt){var _wetr$this$fieldMap$w;var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var windDrctnLower=((_wetr$this$fieldMap$w= wetr[this.fieldMap.windDrctn])===null||_wetr$this$fieldMap$w===void 0?void 0:_wetr$this$fieldMap$w.toLowerCase())||"";var windDrctnName=wetr[this.fieldMap.windDrctnName];return'\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"blind value"\x3e').concat(windDrctnName,'\x3c/span\x3e\n \x3cspan class\x3d"unit_value color"\x3e\x3cem\x3e').concat(oCommon.fnMathRound(wetr[this.fieldMap.windSpd], false),'\x3c/em\x3e\x3c/span\x3e\n \x3cspan class\x3d"ico_wind_arr wind_').concat(windDrctnLower,'"\x3e\x3c/span\x3e\n \x3c/td\x3e\n ')}}, {key:"buildWindImpactCellHtml",value:function buildWindImpactCellHtml(wetr,aplYmdt){var _wetr$this$fieldMap$w2;var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var windDrctnLower= ((_wetr$this$fieldMap$w2=wetr[this.fieldMap.windDrctn])===null||_wetr$this$fieldMap$w2===void 0?void 0:_wetr$this$fieldMap$w2.toLowerCase())||"";var windDrctnName=wetr[this.fieldMap.windDrctnName];var windImpact= this.getWindImpact(wetr[this.fieldMap.windSpd]);var windImpactExtraClass=windImpact.extraClass?" ".concat(windImpact.extraClass):"";return'\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"blind value"\x3e').concat(windDrctnName,'\x3c/span\x3e\n \x3cspan class\x3d"unit_value color').concat(windImpactExtraClass, '"\x3e\x3cem\x3e').concat(windImpact.text,'\x3c/em\x3e\x3c/span\x3e\n \x3cspan class\x3d"ico_wind_arr wind_').concat(windDrctnLower,'"\x3e\x3c/span\x3e\n \x3c/td\x3e\n ')}}, {key:"buildHumdCellHtml",value:function buildHumdCellHtml(wetr){var sunEventType=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return'\n \x3ctd class\x3d"data"'.concat(this.sunEventAttr(sunEventType), '\x3e\n \x3cspan class\x3d"unit_value color"\x3e\x3cem\x3e').concat(wetr[this.fieldMap.humd],"\x3c/em\x3e\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildGrassCellHtml",value:function buildGrassCellHtml(wetr){var sunEventType=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var grass=this.getGrass(wetr[this.fieldMap.humd]);return'\n \x3ctd class\x3d"data"'.concat(this.sunEventAttr(sunEventType), '\x3e\n \x3cspan class\x3d"unit_value color"\x3e\x3cem\x3e').concat(grass.text,"\x3c/em\x3e\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildOutfitCellHtml",value:function buildOutfitCellHtml(wetr,aplYmdt){var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var outfit=this.getOutfit(wetr[this.fieldMap.tmpr]); var outfitTooltipAttr=outfit.text?' data-tooltip\x3d"'.concat(outfit.text,'"'):"";var poiDataClass=hourlyFcast.POI_THEME[this.lsurType].outfitDataClass;return'\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"').concat(poiDataClass," type_data--").concat(outfit.level,'"').concat(outfitTooltipAttr,'\x3e\n \x3cspan class\x3d"blind"\x3e').concat(outfit.text, "\x3c/span\x3e\n \x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildTimeCellHtml",value:function buildTimeCellHtml(wetr,aplYmdt,timeInfo){var timeClass=timeInfo.timeClass,timeText=timeInfo.timeText,tomorrowClass=timeInfo.tomorrowClass;return'\n \x3cth id\x3d"_idHourly-'.concat(aplYmdt, '" class\x3d"data top ').concat(tomorrowClass,' _cnItemTime " data-ymdt\x3d"').concat(aplYmdt,'" data-tmpr\x3d"').concat(wetr[this.fieldMap.tmpr],'" data-wetr-cd\x3d"').concat(wetr[this.fieldMap.wetrCd], '" data-wetr-txt\x3d"').concat(wetr[this.fieldMap.wetrTxt],'"\x3e\n \x3cspan class\x3d"').concat(timeClass,'"\x3e').concat(timeText,'\x3c/span\x3e\n \x3ci class\x3d"ico ico_wt').concat(wetr[this.fieldMap.wetrCd], '" data-tooltip\x3d"').concat(wetr[this.fieldMap.wetrTxt],'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetr[this.fieldMap.wetrTxt],"\x3c/span\x3e\x3c/i\x3e\n \x3c/th\x3e\n ")}}, {key:"buildSunEventTimeCellHtml",value:function buildSunEventTimeCellHtml(wetr){var sunEventType=wetr.sunEventType;var sunEventTime=wetr.sunEventTime;var sunEventId=wetr.sunEventId;var aplYmdt="".concat(wetr[this.fieldMap.aplYmd]).concat(wetr[this.fieldMap.aplTm]); var sunIconClass=sunEventType==="sunrise"?"poi_sun--rise":"poi_sun--set";var sunEventLabel=sunEventType==="sunrise"?"\uc77c\ucd9c":"\uc77c\ubab0";return'\n \x3cth id\x3d"_idHourly-'.concat(sunEventId, '" class\x3d"data top _cnItemTime _cnSunEvent" data-ymdt\x3d"').concat(aplYmdt,'" data-sun-event\x3d"').concat(sunEventType,'" data-tmpr\x3d"').concat(wetr[this.fieldMap.tmpr],'" data-wetr-cd\x3d"').concat(wetr[this.fieldMap.wetrCd], '" data-wetr-txt\x3d"').concat(wetr[this.fieldMap.wetrTxt],'"\x3e\n \x3cspan class\x3d"time"\x3e').concat(sunEventTime,'\x3c/span\x3e\n \x3cspan class\x3d"').concat(sunIconClass, '"\x3e\n ').concat(sunEventLabel,"\n \x3c/span\x3e\n \x3c/th\x3e\n ")}}, {key:"buildTmprCellHtml",value:function buildTmprCellHtml(wetr,aplYmdt){var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var colorClass=this.getColorClass(wetr[this.fieldMap.tmpr], "numeric");var displayTmpr=$.isNumeric(wetr[this.fieldMap.tmpr])?wetr[this.fieldMap.tmpr]:"-";return'\n \x3ctd data-ymdt\x3d"'.concat(aplYmdt,'"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"unit_value ').concat(colorClass, '"\x3e').concat(displayTmpr,"\u00b0\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildRainProbCellHtml",value:function buildRainProbCellHtml(wetr,aplYmdt){var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var colorClass=this.getColorClass(wetr[this.fieldMap.rainProb], "numeric");var rainProb=wetr[this.fieldMap.rainProb];var displayValue=$.isNumeric(rainProb)?"".concat(rainProb,'\x3cspan class\x3d"unit_value_more"\x3e%\x3c/span\x3e'):rainProb;return'\n \x3ctd data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"unit_value ').concat(colorClass,'"\x3e').concat(displayValue,"\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildRainAmtCellHtml",value:function buildRainAmtCellHtml(wetr,aplYmdt){var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var colorClass=this.getColorClass(wetr[this.fieldMap.rainAmt], "positiveNumeric");var rainAmt=$.isNumeric(wetr[this.fieldMap.rainAmt])?Number(wetr[this.fieldMap.rainAmt]):wetr[this.fieldMap.rainAmt];return'\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"unit_value ').concat(colorClass,'"\x3e\x3cem\x3e').concat(rainAmt,"\x3c/em\x3e\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"buildSnowAmtCellHtml",value:function buildSnowAmtCellHtml(wetr,aplYmdt){var sunEventType=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var colorClass=this.getColorClass(wetr[this.fieldMap.snowAmt], "snowAmt");var snowAmt=$.isNumeric(wetr[this.fieldMap.snowAmt])?Number(wetr[this.fieldMap.snowAmt]):wetr[this.fieldMap.snowAmt];var html='\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '"').concat(this.sunEventAttr(sunEventType),'\x3e\n \x3cspan class\x3d"unit_value ').concat(colorClass,'"\x3e\x3cem\x3e').concat(snowAmt,"\x3c/em\x3e\x3c/span\x3e\n \x3c/td\x3e\n "); return{html:html,colorClass:colorClass}}}, {key:"buildKidsIndexCellHtml",value:function buildKidsIndexCellHtml(wetr){var sunEventType=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var stmpr=wetr[this.fieldMap.stmpr];var kidsIndex= this.getKidsIndexLevel(stmpr);var extraClass=kidsIndex.isEmpty?" type_empty":kidsIndex.isWarning?" type_warning":"";var text=kidsIndex.isEmpty?"":kidsIndex.text;return'\n \x3ctd class\x3d"data"'.concat(this.sunEventAttr(sunEventType), '\x3e\n \x3cspan class\x3d"poi_data_kids').concat(extraClass,'"\x3e').concat(text,"\x3c/span\x3e\n \x3c/td\x3e\n ")}}, {key:"renderOfferArea",value:function renderOfferArea(){var updateHtml,descHtml1,descHtml2,offerHtml;var weeklyFcastYmdt=oBlockScriptService.callTemplateFunc("weeklyFcast","getWeeklyFcastYmdt")[0];if(_.isEmpty(this.hourlyList))return; var dateFormat="YYYYMMDDHHmmss";var displayFormat="YYYY.MM.DD. HH:mm";var firstFcastYmdt=moment(this.hourlyList[0][this.fieldMap.fcastYmdt],dateFormat).format(displayFormat);var lastFcastYmdt=moment(this.hourlyList[this.hourlyList.length- 1][this.fieldMap.fcastYmdt],dateFormat).format(displayFormat);var weeklyFcastFormatted=moment(weeklyFcastYmdt,dateFormat).format(displayFormat);if("KMA"===this.cpName){var lastUdtYmdt=moment(this.hourlyList[0][this.fieldMap.lastUdtYmdt], dateFormat).format(displayFormat);updateHtml="\n \ud604\uc7ac\ub0a0\uc528 \ubc0f 1\uc2dc\uac04 \uc608\ubcf4 ".concat(firstFcastYmdt,", \uc2dc\uac04\ubcc4 \uc608\ubcf4 ").concat(lastFcastYmdt, ", \uc8fc\uac04\uc608\ubcf4 ").concat(weeklyFcastFormatted,"\n ");descHtml1="\n \x3cdt\x3e\ub0a0\uc528 : \uc774\uc804 1\uc2dc\uac04\x3c/dt\x3e\n \x3cdd\x3e\uc608) 19\uc2dc\ub294 18\uc2dc 01\ubd84~19\uc2dc 00\ubd84\x3c/dd\x3e\n "; descHtml2="\n \x3cdt\x3e\uac15\uc218\ub7c9, \uac15\uc218\ud655\ub960: \uc774\uc804 1\uc2dc\uac04\x3c/dt\x3e\n \x3cdd\x3e\uc608) 19\uc2dc\ub294 18\uc2dc 01\ubd84~19\uc2dc 00\ubd84\x3c/dd\x3e\n "; offerHtml='\n \x3cspan class\x3d"offer_update"\x3e'.concat(lastUdtYmdt," \uc5c5\ub370\uc774\ud2b8\x3c/span\x3e\n ")}else{updateHtml="\n \ud604\uc7ac\ub0a0\uc528 ".concat(firstFcastYmdt, ", \uc2dc\uac04\ubcc4 \uc608\ubcf4 ").concat(lastFcastYmdt,", \uc8fc\uac04\uc608\ubcf4 ").concat(weeklyFcastFormatted,"\n ");descHtml1="\n \x3cdt\x3e\ub0a0\uc528 : \uc774\ud6c4 1\uc2dc\uac04\x3c/dt\x3e\n \x3cdd\x3e\uc608) 19\uc2dc\ub294 19\uc2dc 00\ubd84~19\uc2dc 59\ubd84\x3c/dd\x3e\n "; descHtml2="\n \x3cdt\x3e\uac15\uc218\ub7c9, \uac15\uc218\ud655\ub960: \uc774\ud6c4 1\uc2dc\uac04\x3c/dt\x3e\n \x3cdd\x3e\uc608) 19\uc2dc\ub294 19\uc2dc 00\ubd84~19\uc2dc 59\ubd84\x3c/dd\x3e\n "; offerHtml='\n \x3cspan class\x3d"offer_update"\x3e'.concat(firstFcastYmdt," \uc5c5\ub370\uc774\ud2b8\x3c/span\x3e\n ")}this.element.find(".offer_area .update_time").html(updateHtml); this.element.find(".offer_area .ly_list dl").eq(0).html(descHtml1);this.element.find(".offer_area .ly_list dl").eq(2).html(descHtml2);this.element.find(".offer_area .offer_update").html(offerHtml)}}, {key:"renderHourlyChart",value:function renderHourlyChart(){var data=["tmpr"];var welData=this.element.find(".weather_graph ._cnItemTime");if(welData.length===0)return;data.push(welData.eq(0).data("tmpr")); data.push(null);welData.each(function(index,element){var tmpr=$(element).data("tmpr");data.push(tmpr)}); data.push(data[data.length-1]);this.oChart=bb.generate({"bindto":".weather_graph .chart_area","data":{"columns":[data],"type":"area","labels":false,"colors":{tmpr:"rgba(80, 183, 255, 0.8)"}},"size":{"width":$(".weather_graph .chart_area").width()}, "clipPath":false,"padding":{"top":15,"right":0,"bottom":0,"left":0},"area":{"linearGradient":true,"below":true},"line":{"connectNull":true,"classes":["hide"]},"axis":{"x":{"show":false,"padding":{"left":-.25, "right":-.5}},"y":{"show":false}},"point":{"show":false},"tooltip":{"show":false},"legend":{"show":false}})}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".ico_help",$.proxy(this.clickHourlyFcastHelp,this));this.element.on("click",".btn_close",$.proxy(this.closeAllLayer,this));this.element.on("change", ".weather_select_input",$.proxy(this.onPoiThemeChange,this));this.element.on("click",".weather_head_select",$.proxy(this.onPoiThemeSwitchClick,this))}}, {key:"clickHourlyFcastHelp",value:function clickHourlyFcastHelp(e){var isOpen=oCommon.fnGetOpenOrNot($(e.currentTarget));oCommon.fnCloseAllInfoLayer();if(isOpen===false){if(this.element.find(".ly_help .weather_list li").length=== 0){var iconMap=new Map;this.element.find("._cnItemTime").each(function(){var wetrCd=$(this).data("wetrCd");var wetrTxt=$(this).data("wetrTxt");var obj={wetrCd:wetrCd,wetrTxt:wetrTxt};iconMap.set(wetrCd, obj)}); var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=iconMap.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion= true){var value=_step.value;var html='\n \x3cli class\x3d"item"\x3e\x3ci class\x3d"ico ico_wt'.concat(value.wetrCd,'"\x3e\x3c/i\x3e').concat(value.wetrTxt,"\x3c/li\x3e\n "); this.element.find(".weather_list").append(html)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}}oCommon.fnOpenInfoLayer($(e.currentTarget))}}}, {key:"scrollToElementByDay",value:function scrollToElementByDay(aplYmdt,timeout,resetToFirst){var scrollName=this.element.find(".scroll_area").data("name");setTimeout(function(){if(oCommon.oScroll[scrollName]){if(resetToFirst=== true){oCommon.scrollToCell(scrollName,null,500);return}var $targetElement=$("#_idHourly-".concat(aplYmdt));if($targetElement.length>0){var targetElement=$targetElement.prev()[0]||$targetElement[0];oCommon.scrollToCell(scrollName, targetElement,500,-14)}}},oCommon.oScroll[scrollName]?0:timeout)}}, {key:"closeAllLayer",value:function closeAllLayer(){oCommon.fnCloseAllInfoLayer()}}, {key:"getSunRiseSetMap",value:function getSunRiseSetMap(){var sunRiseSetMap={};if(!this.sunRiseSetList||this.sunRiseSetList.length===0)return sunRiseSetMap;this.sunRiseSetList.forEach(function(data){var aplYmd= data.aplYmd;var sriseTm=data.sriseTm;var ssetTm=data.ssetTm;if(aplYmd&&sriseTm&&ssetTm){var sunriseHour=sriseTm.substring(0,2);var sunriseMinute=parseInt(sriseTm.substring(2,4),10);var sunsetHour=ssetTm.substring(0, 2);var sunsetMinute=parseInt(ssetTm.substring(2,4),10);sunRiseSetMap[aplYmd]={sunrise:sunriseHour,sunset:sunsetHour,sunriseMinute:sunriseMinute,sunsetMinute:sunsetMinute,sunriseTime:moment(sriseTm,"HHmmss").format("HH:mm"), sunsetTime:moment(ssetTm,"HHmmss").format("HH:mm")}}}); return sunRiseSetMap}}, {key:"buildHourlyListWithSunRiseSet",value:function buildHourlyListWithSunRiseSet(){var sunRiseSetMap=this.getSunRiseSetMap();if(Object.keys(sunRiseSetMap).length===0)return this.hourlyList;var expandedList= [];var insertedSunEvents=new Set;for(var i=0;i0)return"\uc57d ".concat(hour,"\uc2dc\uac04 ").concat(String(min).padStart(2, "0"),"\ubd84");return"\uc57d ".concat(min,"\ubd84")}}, {key:"isValidSunRiseSetData",value:function isValidSunRiseSetData(target){return!_.isEmpty(target===null||target===void 0?void 0:target.aplYmd)&&!_.isEmpty(target===null||target===void 0?void 0:target.sriseTm)&& !_.isEmpty(target===null||target===void 0?void 0:target.ssetTm)}}, {key:"getSpecialTimeDisplayForLsur",value:function getSpecialTimeDisplayForLsur(aplYmdt){var _this9=this;if(oCodeUtil.isBaseball(sRegionCode)){if(!this._gameStartDateTimes){this._gameStartDateTimes=[]; if(this.templateData.sportGameList)this.templateData.sportGameList.forEach(function(game){if(game.gameDateTime){var gameDateTime=moment(game.gameDateTime);var gameDateTimeStr=gameDateTime.format("YYYYMMDDHH"); _this9._gameStartDateTimes.push(gameDateTimeStr)}})}if(this._gameStartDateTimes.includes(aplYmdt))return{timeText:"\uacbd\uae30\uc2dc\uc791", timeClass:"poi_start"}}return null}}, {key:"getHourlyForecastOption",value:function getHourlyForecastOption(){var _this$templateInfo,_this$templateInfo$cu;return(_this$templateInfo=this.templateInfo)===null||_this$templateInfo===void 0?void 0: (_this$templateInfo$cu=_this$templateInfo.customInfo)===null||_this$templateInfo$cu===void 0?void 0:_this$templateInfo$cu.hourlyForecastOption}}, {key:"isHourlyForecastOption",value:function isHourlyForecastOption(optionValue){return this.getHourlyForecastOption()===optionValue}}, {key:"shouldShowGameSchedule",value:function shouldShowGameSchedule(){return this.isHourlyForecastOption(hourlyFcast.HOURLY_FORECAST_OPTIONS.SPORTS_MATCH_SCHEDULE)}}, {key:"shouldShowKidsIndex",value:function shouldShowKidsIndex(){return this.isHourlyForecastOption(hourlyFcast.HOURLY_FORECAST_OPTIONS.KIDS_INDEX)}}, {key:"shouldShowGolfRound",value:function shouldShowGolfRound(){return this.isHourlyForecastOption(hourlyFcast.HOURLY_FORECAST_OPTIONS.GOLF_ROUND)}}, {key:"shouldShowSunRiseSet",value:function shouldShowSunRiseSet(){var _this$templateInfo2,_this$templateInfo2$c;var optionValue=(_this$templateInfo2=this.templateInfo)===null||_this$templateInfo2===void 0? void 0:(_this$templateInfo2$c=_this$templateInfo2.customInfo)===null||_this$templateInfo2$c===void 0?void 0:_this$templateInfo2$c.enableSunRiseSet;if(optionValue==null||String(optionValue).trim()==="")return false; return optionValue==="true"}}, {key:"isPoiThemeOn",value:function isPoiThemeOn(){var cookieKey=this.getPoiThemeCookieKey();if(!cookieKey)return false;return oCommon.fnGetCookie(cookieKey)!=="off"}}, {key:"onPoiThemeChange",value:function onPoiThemeChange(e){var targetOn=$(e.currentTarget).hasClass("_cnPoiThemeOn");oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"toggle"), true);oCommon.fnSetCookie(this.getPoiThemeCookieKey(),targetOn?"on":"off",365);this.applyPoiThemeVisibility(targetOn);if(!targetOn)this.element.find('._cnGolfInfoHelp[aria-pressed\x3d"true"]').attr("aria-pressed", "false");this.refreshScrollAreaHeight();this.resetScroll()}}, {key:"onPoiThemeSwitchClick",value:function onPoiThemeSwitchClick(e){var oe=e.originalEvent;if(oe&&oe.detail===0)return;var $target=$(e.target);var currentOn=this.element.find("._cnPoiThemeOn").is(":checked"); var targetOn;if($target.hasClass("weather_select_indicator"))targetOn=!currentOn;else{var clickedIsOn;if($target.hasClass("weather_select_input"))clickedIsOn=$target.hasClass("_cnPoiThemeOn");else if($target.is("label.weather_select_label"))clickedIsOn= $target.attr("for")==="_idPoiThemeOn";else return;targetOn=clickedIsOn===currentOn?!currentOn:clickedIsOn}e.preventDefault();this.element.find(targetOn?"._cnPoiThemeOn":"._cnPoiThemeOff").prop("checked", true).trigger("change")}}, {key:"refreshScrollAreaHeight",value:function refreshScrollAreaHeight(){var $scrollArea=this.getTableScrollArea();var $tableWrap=$scrollArea.children().first();if($tableWrap.length)$scrollArea.height($tableWrap.outerHeight())}}, {key:"applyPoiThemeVisibility",value:function applyPoiThemeVisibility(isThemeOn){this.toggleOutfitRow(isThemeOn);this.toggleKidsIndexRow(isThemeOn);if(this.lsurType==="GF"){this.toggleGolfThemeRows(isThemeOn); this.updateWindLabel(isThemeOn)}}}, {key:"toggleOutfitRow",value:function toggleOutfitRow(isThemeOn){this.element.find(".type_state--clothes").toggleClass("hide",!isThemeOn);this.element.find("._cnOutfit").toggleClass("hide",!isThemeOn)}}, {key:"toggleKidsIndexRow",value:function toggleKidsIndexRow(isThemeOn){if(!this.shouldShowKidsIndex())return;this.element.find(".type_state--kids").toggleClass("hide",!isThemeOn);this.element.find("._cnKidsIndex").toggleClass("hide", !isThemeOn);this.element.find("._cnKidsIndexHelp").toggleClass("hide",!isThemeOn)}}, {key:"toggleGolfThemeRows",value:function toggleGolfThemeRows(isThemeOn){var $el=this.element;$el.find(".type_state--grass").toggleClass("hide",!isThemeOn);$el.find(".type_state--humidity").toggleClass("hide", isThemeOn);$el.find("._cnGolfGrass").toggleClass("hide",!isThemeOn);$el.find("._cnGolfWindImpact").toggleClass("hide",!isThemeOn);$el.find("._cnHumd").toggleClass("hide",isThemeOn);$el.find("._cnWind").toggleClass("hide", isThemeOn);$el.find("._cnGolfInfoHelp").toggleClass("hide",!isThemeOn)}}, {key:"updateWindLabel",value:function updateWindLabel(isThemeOn){var $wind=this.element.find(".type_state--wind");$wind.find(".card_item_title").text(isThemeOn?"\ubc14\ub78c \uc601\ud5a5":"\ubc14\ub78c"); $wind.find(".card_item_unit").toggleClass("hide",isThemeOn)}}, {key:"findThemeLevel",value:function findThemeLevel(levels,value){if(!$.isNumeric(value))return hourlyFcast.THEME_LEVEL_EMPTY;var v=Number(value);var matched=levels.find(function(l){return v<=l.max}); if(!matched)return hourlyFcast.THEME_LEVEL_EMPTY;return{level:matched.level||0,text:matched.text||"",extraClass:matched.extraClass||""}}}, {key:"getOutfit",value:function getOutfit(tmpr){return this.findThemeLevel(hourlyFcast.OUTFIT_LEVELS,tmpr)}}, {key:"getWindImpact",value:function getWindImpact(windSpd){return this.findThemeLevel(hourlyFcast.GOLF_THEME.WIND_IMPACT_LEVELS,windSpd)}}, {key:"getGrass",value:function getGrass(humd){return this.findThemeLevel(hourlyFcast.GOLF_THEME.GRASS_LEVELS,humd)}}, {key:"buildGolfRoundRowHtml",value:function buildGolfRoundRowHtml(){var _this0=this;if(!this.expandedHourlyList||this.expandedHourlyList.length===0)return null;var groups=[];var currentGroup=null;this.expandedHourlyList.forEach(function(wetr){var roundInfo= null;if(!wetr.isSunEvent){var hour=parseInt(wetr[_this0.fieldMap.aplTm],10);roundInfo=hourlyFcast.GOLF_ROUND_TIMES.find(function(r){return hour>=r.startHour&&hour=3?group.roundInfo.name:group.roundInfo.shortName;var colspanAttr=group.colspan>1?' colspan\x3d"'.concat(group.colspan, '"'):"";html+='\x3ctd class\x3d"data"'.concat(colspanAttr,"\x3e");html+='\x3cspan class\x3d"poi_sports_timeline '.concat(group.roundInfo.cssClass,'"\x3e');html+='\x3cstrong class\x3d"poi_timeline_text"\x3e'.concat(label, "\x3c/strong\x3e");html+="\x3c/span\x3e\x3c/td\x3e"}else for(var i=0;i0}); if(!hasVisibleGameTime)return null;return this.buildGameScheduleHtml(hourlyGameMap)}}, {key:"filterDisplayableGames",value:function filterDisplayableGames(sportGameList){return sportGameList.filter(function(game){return game&&game.gameDateTime})}}, {key:"buildHourlyGameMap",value:function buildHourlyGameMap(games){var hourlyGameMap={};var validGames=games.filter(function(game){return game&&game.gameDateTime}); if(validGames.length===0)return hourlyGameMap;var timeMap=new Map(validGames.map(function(game){return[game,moment(game.gameDateTime).valueOf()]})); var sortedGames=_toConsumableArray(validGames).sort(function(a,b){return timeMap.get(a)-timeMap.get(b)}); var gameOverlapInfo=this.calculateGameOverlapInfo(sortedGames);sortedGames.forEach(function(game){if(!game.gameDateTime)return;var gameStart=moment(game.gameDateTime);var gameStartHour=gameStart.hour(); var gameStartMinute=gameStart.minute();var gameDate=gameStart.format("YYYYMMDD");var isHalfHourStart=gameStartMinute>=hourlyFcast.HALF_HOUR_THRESHOLD;var startOffset=isHalfHourStart?1:0;var overlapInfo= gameOverlapInfo[game.gameId]||{};var isTruncatedByNextGame=overlapInfo.isTruncated||false;var truncatedEndTime=overlapInfo.truncatedEndTime||null;var displayHours=hourlyFcast.getGameDurationHours(sRegionCode)- startOffset;if(isTruncatedByNextGame&&truncatedEndTime){var truncatedEnd=moment(truncatedEndTime);var displayStartTime=moment(gameStart).add(startOffset,"hours").startOf("hour");displayHours=Math.max(1, truncatedEnd.diff(displayStartTime,"hours"))}for(var i=0;i=24? moment(gameDate,"YYYYMMDD").add(1,"day").format("YYYYMMDD"):gameDate;var aplYmdt="".concat(date).concat(String(hour).padStart(2,"0"));if(!hourlyGameMap[aplYmdt])hourlyGameMap[aplYmdt]=[];hourlyGameMap[aplYmdt].push({game:game, isStartHour:i===0,isHalfHourStart:isHalfHourStart,startMinute:gameStartMinute,hourIndex:i,displayHours:displayHours,isTruncatedByNextGame:isTruncatedByNextGame,truncatedEndTime:truncatedEndTime,isLastHourOfTruncated:isTruncatedByNextGame&& i===displayHours-1})}}); return hourlyGameMap}}, {key:"calculateGameOverlapInfo",value:function calculateGameOverlapInfo(sortedGames){var overlapInfo={};var gameStartMap=new Map;var gameEndMap=new Map;sortedGames.forEach(function(game){if(game.gameDateTime){var startMoment= moment(game.gameDateTime);gameStartMap.set(game,startMoment);gameEndMap.set(game,startMoment.clone().add(hourlyFcast.getGameDurationHours(sRegionCode),"hours"))}}); for(var i=0;i0){skipCount--;continue}var wetr=listToUse[i];var aplYmdt="".concat(wetr[this.fieldMap.aplYmd]).concat(wetr[this.fieldMap.aplTm]);var isSunEvent=wetr.isSunEvent=== true;if(isSunEvent){var sunEventType=wetr.sunEventType;var _gameInfos=hourlyGameMap[aplYmdt]||[];var ongoingGames=_gameInfos.filter(function(info){return info.hourIndex>0&&!info.isTruncatedByNextGame}); var halfHourStartGames=_gameInfos.filter(function(info){return info.hourIndex===0&&info.isHalfHourStart&&!processedStartGames.has(info.game.gameId)}); var nextHourHalfHourStartGame=this.findNextHourHalfHourStartGame(wetr,hourlyGameMap,processedStartGames);if(nextHourHalfHourStartGame){var cellInfo=this.buildSingleGameCellWithActiveState(nextHourHalfHourStartGame, i,hourlyGameMap,processedStartGames,aplYmdt,false);html+=cellInfo.html.replace("data-ymdt\x3d",'data-sun-event\x3d"'.concat(sunEventType,'" data-ymdt\x3d'));skipCount=cellInfo.colspan-1}else if(halfHourStartGames.length> 0){var gameInfo=halfHourStartGames[0];var _cellInfo=this.buildSingleGameCellWithActiveState(gameInfo,i,hourlyGameMap,processedStartGames,aplYmdt,false);html+=_cellInfo.html.replace("data-ymdt\x3d",'data-sun-event\x3d"'.concat(sunEventType, '" data-ymdt\x3d'));skipCount=_cellInfo.colspan-1}else if(ongoingGames.length>0){var activeGameInfo=ongoingGames[0];var statusInfo=this.getGameStatusInfo(activeGameInfo.game);html+='\n \x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt, '" data-sun-event\x3d"').concat(sunEventType,'"\x3e\n \x3cspan class\x3d"poi_sports_timeline ').concat(statusInfo.statusClass,'"\x3e\n \x3cstrong class\x3d"poi_timeline_text"\x3e').concat(statusInfo.text, "\x3c/strong\x3e\n \x3c/span\x3e\n \x3c/td\x3e\n ")}else html+='\x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt,'" data-sun-event\x3d"').concat(sunEventType, '"\x3e\x3c/td\x3e');continue}var gameInfos=hourlyGameMap[aplYmdt]||[];var newGameInfos=gameInfos.filter(function(info){return!processedStartGames.has(info.game.gameId)&&info.hourIndex===0}); var ongoingGameInfos=gameInfos.filter(function(info){return info.hourIndex>0}); var hasOngoingGame=gameInfos.some(function(info){return info.hourIndex>0&&!info.isTruncatedByNextGame}); if(gameInfos.length===0)html+='\x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt,'"\x3e\x3c/td\x3e');else if(newGameInfos.length>=2){var _cellInfo2=this.buildDoubleHeaderCell(newGameInfos,i,hourlyGameMap, processedStartGames,aplYmdt);html+=_cellInfo2.html;skipCount=_cellInfo2.colspan-1}else if(newGameInfos.length===1&&hasOngoingGame){var _gameInfo=newGameInfos[0];var _cellInfo3=this.buildSingleGameCellWithActiveState(_gameInfo, i,hourlyGameMap,processedStartGames,aplYmdt,true);html+=_cellInfo3.html;skipCount=_cellInfo3.colspan-1}else if(newGameInfos.length===1){var _gameInfo2=newGameInfos[0];var _cellInfo4=this.buildSingleGameCellWithActiveState(_gameInfo2, i,hourlyGameMap,processedStartGames,aplYmdt,false);html+=_cellInfo4.html;skipCount=_cellInfo4.colspan-1}else if(ongoingGameInfos.length>0&&!processedStartGames.has(ongoingGameInfos[0].game.gameId)){var _gameInfo3= ongoingGameInfos[0];var _cellInfo5=this.buildSingleGameCellWithActiveState(_gameInfo3,i,hourlyGameMap,processedStartGames,aplYmdt,false);html+=_cellInfo5.html;skipCount=_cellInfo5.colspan-1}else html+= '\x3ctd class\x3d"data" data-ymdt\x3d"'.concat(aplYmdt,'"\x3e\x3c/td\x3e')}return html}}, {key:"findNextHourHalfHourStartGame",value:function findNextHourHalfHourStartGame(sunEventWetr,hourlyGameMap,processedStartGames){var currentHour=parseInt(sunEventWetr[this.fieldMap.aplTm],10);var currentDate= sunEventWetr[this.fieldMap.aplYmd];var sunEventTime=sunEventWetr.sunEventTime;var nextHour=(currentHour+1)%24;var nextDate=nextHour===0?moment(currentDate,"YYYYMMDD").add(1,"day").format("YYYYMMDD"):currentDate; var nextAplYmdt="".concat(nextDate).concat(String(nextHour).padStart(2,"0"));var nextGameInfos=hourlyGameMap[nextAplYmdt]||[];var halfHourStartGame=nextGameInfos.find(function(info){if(info.hourIndex!== 0||!info.isHalfHourStart)return false;if(processedStartGames.has(info.game.gameId))return false;if(sunEventTime&&info.game.gameDateTime){var sunEventMoment=moment(sunEventTime,"HH:mm");var gameStartMoment= moment(info.game.gameDateTime);var gameStartTimeOnly=moment(gameStartMoment.format("HH:mm"),"HH:mm");if(sunEventMoment.isBefore(gameStartTimeOnly))return false}return true}); return halfHourStartGame||null}}, {key:"buildSingleGameCellWithActiveState",value:function buildSingleGameCellWithActiveState(gameInfo,listIndex,hourlyGameMap,processedStartGames,aplYmdt){var isOverlapStart=arguments.length>5&&arguments[5]!== undefined?arguments[5]:false;var game=gameInfo.game,isHalfHourStart=gameInfo.isHalfHourStart,hourIndex=gameInfo.hourIndex,displayHours=gameInfo.displayHours,isTruncatedByNextGame=gameInfo.isTruncatedByNextGame, truncatedEndTime=gameInfo.truncatedEndTime;var statusInfo=this.getGameStatusInfo(game);var listToUse=this.expandedHourlyList||this.hourlyList;var colspan=0;var hasOverlap=false;var actualHourCount=0;var maxHourCount= displayHours-hourIndex;for(var j=listIndex;j=maxHourCount)break; var hourAplYmdt="".concat(wetr[this.fieldMap.aplYmd]).concat(wetr[this.fieldMap.aplTm]);var gamesAtHour=hourlyGameMap[hourAplYmdt]||[];var hasThisGame=gamesAtHour.some(function(g){return g.game.gameId=== game.gameId}); if(!hasThisGame)break;var hasOtherNewGame=gamesAtHour.some(function(g){return g.game.gameId!==game.gameId&&g.hourIndex===0&&!processedStartGames.has(g.game.gameId)}); if(hasOtherNewGame&&colspan>0){hasOverlap=true;break}colspan++;actualHourCount++}colspan=Math.max(1,colspan);if(hourIndex===0)processedStartGames.add(game.gameId);var startHalfClass="";var endHalfClass= "";if(isOverlapStart)startHalfClass="type_half--left";if(isHalfHourStart&&hourIndex===0&&!isOverlapStart)startHalfClass="type_half--left";if(hasOverlap)endHalfClass="type_half--right";else if(isTruncatedByNextGame&& truncatedEndTime){var nextGameStartMinute=moment(truncatedEndTime).minute();if(nextGameStartMinute>=hourlyFcast.HALF_HOUR_THRESHOLD)endHalfClass="type_half--right"}else if(isHalfHourStart&&hourIndex+actualHourCount>= displayHours)endHalfClass="type_half--right";var combinedClass=[startHalfClass,endHalfClass].filter(function(c){return c}).join(" "); var colspanAttr=colspan>1?' colspan\x3d"'.concat(colspan,'"'):"";var classAttr=combinedClass?" ".concat(combinedClass):"";var html='\n \x3ctd class\x3d"data'.concat(classAttr,'" data-ymdt\x3d"').concat(aplYmdt, '"').concat(colspanAttr,'\x3e\n \x3cspan class\x3d"poi_sports_timeline ').concat(statusInfo.statusClass,'"\x3e\n \x3cstrong class\x3d"poi_timeline_text"\x3e').concat(statusInfo.text, "\x3c/strong\x3e\n \x3c/span\x3e\n \x3c/td\x3e\n ");return{html:html,colspan:colspan,activeState:null}}}, {key:"buildDoubleHeaderCell",value:function buildDoubleHeaderCell(gameInfos,listIndex,hourlyGameMap,processedGames,aplYmdt){var firstGameInfo=gameInfos[0];var firstStatus=this.getGameStatusInfo(firstGameInfo.game); processedGames.add(firstGameInfo.game.gameId);var secondGameInfo=gameInfos[1];var secondStatus=this.getGameStatusInfo(secondGameInfo.game);processedGames.add(secondGameInfo.game.gameId);var html='\n \x3ctd class\x3d"data type_half--right type_half--left" data-ymdt\x3d"'.concat(aplYmdt, '"\x3e\n \x3cspan class\x3d"poi_sports_timeline ').concat(firstStatus.statusClass,'"\x3e\n \x3cstrong class\x3d"poi_timeline_text"\x3e').concat(firstStatus.text,'\x3c/strong\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"poi_sports_timeline ').concat(secondStatus.statusClass, '"\x3e\n \x3cstrong class\x3d"poi_timeline_text"\x3e').concat(secondStatus.text,"\x3c/strong\x3e\n \x3c/span\x3e\n \x3c/td\x3e\n ");return{html:html, colspan:1}}}, {key:"getGameStatusInfo",value:function getGameStatusInfo(game){var _game$statusCode;var STATUS_CODES=hourlyFcast.STATUS_CODES,STATUS_CLASSES=hourlyFcast.STATUS_CLASSES;var statusCode=(_game$statusCode= game.statusCode)===null||_game$statusCode===void 0?void 0:_game$statusCode.toUpperCase();var isBeforeOrReady=statusCode===STATUS_CODES.BEFORE||statusCode===STATUS_CODES.READY;if(isBeforeOrReady&&game.cancel=== true)return{statusClass:STATUS_CLASSES.INACTIVE,text:"\ucde8\uc18c"};if(isBeforeOrReady&&game.suspended===true)return{statusClass:STATUS_CLASSES.INACTIVE,text:"\uc911\ub2e8"};if(statusCode===STATUS_CODES.END|| statusCode===STATUS_CODES.RESULT)return{statusClass:STATUS_CLASSES.INACTIVE,text:"\uc885\ub8cc"};if(statusCode===STATUS_CODES.STARTED)return{statusClass:STATUS_CLASSES.LIVE,text:"\uacbd\uae30\uc911"};var gameTime= moment(game.gameDateTime).format("HH:mm");return{statusClass:STATUS_CLASSES.SCHEDULED,text:"".concat(gameTime," \uacbd\uae30\uc608\uc815")}}}, {key:"getKidsIndexLevel",value:function getKidsIndexLevel(stmpr){if(!$.isNumeric(stmpr))return{level:6,text:"\ub370\uc774\ud130 \uc5c6\uc74c",isEmpty:true,isWarning:false};var grade=this.getKidsIndexGrade(Number(stmpr)); return _objectSpread({},grade,{isEmpty:false,isWarning:grade.level>=hourlyFcast.KIDS_INDEX_WARNING_MIN_LEVEL})}}, {key:"getKidsIndexGrade",value:function getKidsIndexGrade(temp){if(temp>=37)return{level:5,text:"\uc704\ud5d8"};else if(temp>=34)return{level:4,text:"\uacbd\uace0"};else if(temp>=31)return{level:3,text:"\uc8fc\uc758"}; else if(temp>=29)return{level:2,text:"\uad00\uc2ec"};else if(temp>=1)return{level:1,text:"\ubcf4\ud1b5"};else if(temp>=0)return{level:2,text:"\uad00\uc2ec"};else if(temp>=-3)return{level:2,text:"\uad00\uc2ec"}; else if(temp>=-10)return{level:3,text:"\uc8fc\uc758"};else if(temp>=-15)return{level:4,text:"\uacbd\uace0"};else return{level:5,text:"\uc704\ud5d8"}}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){var _this$templateData9;var domestic=(_this$templateData9=this.templateData)===null||_this$templateData9===void 0?void 0:_this$templateData9.domestic; if(domestic)return{hourlyCardData:{fields:["domesticHourlyFcastList"],minLength:12}};else return{hourlyCardData:{fields:["overseasHourlyFcastList"],minLength:12}}}}, {key:"getColorClass",value:function getColorClass(value){var type=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"numeric";if(type==="numeric")return $.isNumeric(value)?"color":"";if(type=== "positiveNumeric")return $.isNumeric(value)?Number(value)>0?"color":"":"color";if(type==="snowAmt")return $.isNumeric(value)?Number(value)>0?"color":"":value==="-"||value===null?"":"color";return""}}, {key:"getTimeDisplayInfo",value:function getTimeDisplayInfo(date,aplYmdt,index,dateMoments){var local=dateMoments.local,tomorrow=dateMoments.tomorrow,dayAfterTomorrow=dateMoments.dayAfterTomorrow,twoDaysAfterTomorrow= dateMoments.twoDaysAfterTomorrow;var hourStr=date.format("H\uc2dc");var isMidnight=date.format("HH")==="00";var timeClass,timeText,tomorrowClass="";var needsFirstDayUpdate=false;if(date.isSame(local,"day")){timeClass= "time";timeText=hourStr}else if(date.isSame(tomorrow,"day")){if(isMidnight){if(index===0){needsFirstDayUpdate=true;timeClass="time tomorrow";timeText="0\uc2dc";tomorrowClass="_cnDay _cnTomorrow"}else{timeClass= "label tomorrow";timeText="\ub0b4\uc77c";tomorrowClass="tomorrow _cnDay _cnTomorrow"}return{timeClass:timeClass,timeText:timeText,tomorrowClass:tomorrowClass,needsFirstDayUpdate:needsFirstDayUpdate}}timeClass= "time tomorrow";timeText=hourStr}else if(date.isSame(dayAfterTomorrow,"day")){if(isMidnight)return{timeClass:"label after_tomorrow",timeText:"\ubaa8\ub808",tomorrowClass:"after_tomorrow _cnDay _cnOneAfterTomorrow", needsFirstDayUpdate:false};timeClass="time after_tomorrow";timeText=hourStr}else if(date.isSame(twoDaysAfterTomorrow,"day")){if(isMidnight)return{timeClass:"label after_tomorrow",timeText:"\uae00\ud53c", tomorrowClass:"after_tomorrow _cnDay _cnTwoAfterTomorrow",needsFirstDayUpdate:false};timeClass="time after_tomorrow";timeText=hourStr}else{timeClass="time after_tomorrow";timeText=hourStr}var specialTime= this.getSpecialTimeDisplayForLsur(aplYmdt);if(specialTime){timeText=specialTime.timeText;timeClass=specialTime.timeClass}return{timeClass:timeClass,timeText:timeText,tomorrowClass:tomorrowClass,needsFirstDayUpdate:needsFirstDayUpdate}}}]); return hourlyFcast}(BlockTemplate); _defineProperty(hourlyFcast,"HOURLY_FORECAST_OPTIONS",{NONE:"none",SPORTS_MATCH_SCHEDULE:"sportsMatchSchedule",KIDS_INDEX:"kidsIndex",GOLF_ROUND:"golfRound"}); _defineProperty(hourlyFcast,"GOLF_ROUND_TIMES",[{name:"\uc0c8\ubcbd \ub77c\uc6b4\ub4dc",shortName:"\uc0c8\ubcbd",startHour:5,endHour:7,cssClass:"is-dawn"},{name:"\uc624\uc804 \ub77c\uc6b4\ub4dc",shortName:"\uc624\uc804", startHour:7,endHour:12,cssClass:"is-morning"},{name:"\uc624\ud6c4 \ub77c\uc6b4\ub4dc",shortName:"\uc624\ud6c4",startHour:12,endHour:16,cssClass:"is-afternoon"},{name:"\uc57c\uac04 \ub77c\uc6b4\ub4dc",shortName:"\uc57c\uac04", startHour:16,endHour:21,cssClass:"is-night"}]);_defineProperty(hourlyFcast,"POI_THEME",{GF:{cookieKey:"golfHourlyTheme",outfitDataClass:"poi_data_golf"},TP:{cookieKey:"amusementHourlyTheme",outfitDataClass:"poi_data_themepark"}}); _defineProperty(hourlyFcast,"OUTFIT_LEVELS",[{max:4.9,level:1,text:"\ub9e4\uc6b0 \ub530\ub73b\ud55c \uc637"},{max:9.9,level:2,text:"\ub530\ub73b\ud55c \uc637"},{max:14.9,level:3,text:"\uc801\ub2f9\ud788 \ub530\ub73b\ud55c \uc637"}, {max:19.9,level:4,text:"\uc801\ub2f9\ud788 \uac00\ubcbc\uc6b4 \uc637"},{max:24.9,level:5,text:"\uac00\ubcbc\uc6b4 \uc637"},{max:Infinity,level:6,text:"\ub9e4\uc6b0 \uac00\ubcbc\uc6b4 \uc637"}]); _defineProperty(hourlyFcast,"GOLF_THEME",{WIND_IMPACT_LEVELS:[{max:3,level:1,text:"\uc5c6\uc74c"},{max:7,level:2,text:"1\ud074\ub7fd"},{max:9.9,level:3,text:"2\ud074\ub7fd"},{max:Infinity,level:4,text:"\uac15\ud568", extraClass:"type_wind"}],GRASS_LEVELS:[{max:79,level:1,text:"\uc591\ud638"},{max:Infinity,level:2,text:"\uc2b5\ud568"}]});_defineProperty(hourlyFcast,"THEME_LEVEL_EMPTY",{level:0,text:"",extraClass:""}); _defineProperty(hourlyFcast,"KIDS_INDEX_WARNING_MIN_LEVEL",5);_defineProperty(hourlyFcast,"SUN_CHART_DIVISION_COUNT",16);_defineProperty(hourlyFcast,"SUN_SCROLL_NAME","hourlySun"); _defineProperty(hourlyFcast,"GAME_DURATION_HOURS_BASEBALL",4);_defineProperty(hourlyFcast,"GAME_DURATION_HOURS_FOOTBALL",3);_defineProperty(hourlyFcast,"HALF_HOUR_THRESHOLD",30); _defineProperty(hourlyFcast,"STATUS_CODES",{BEFORE:"BEFORE",READY:"READY",STARTED:"STARTED",END:"END",RESULT:"RESULT"}); _defineProperty(hourlyFcast,"STATUS_CLASSES",{SCHEDULED:"is-scheduled",LIVE:"is-live",INACTIVE:"is-inactive"}); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0})}}, {key:"init",value:function init(){this[this.typeConfig.initMethod]()}}, {key:"initGolf",value:function initGolf(){var _timeSlots$;var timeSlots=this.templateData.timeSlots||[];this.defaultSlotKey=((_timeSlots$=timeSlots[0])===null||_timeSlots$===void 0?void 0:_timeSlots$.key)|| null;this.baseDate=moment().utc().add(540,"minutes").format("YYYYMMDD");this.renderCard(timeSlots,this.templateData);this.initScroll()}}, {key:"initGeneral",value:function initGeneral(){this.isTomorrowBadgeVisible=null;this.tomorrowBadgeThresholdX=null;var isOverseas=(this.lsurRgnCd||"").startsWith("WD");var orderedCpTypes=isOverseas?["WEATHERNEWS", "ACCUWEATHER","TWC"]:["KMA","ACCUWEATHER","TWC","WEATHERNEWS"];var hf=this.templateData.hourlyForecast||{};var cpByType={};this.cpOrder.forEach(function(cp){cpByType[cp.cpType]=cp}); this.generalCps=orderedCpTypes.map(function(cpType){return cpByType[cpType]}).filter(function(cp){return cp&&Array.isArray(hf[cp.cpType])&&hf[cp.cpType].length>0}); this.renderGeneralCard(this.templateData);this.initGeneralScroll()}}, {key:"isTomorrow",value:function isTomorrow(targetDate){if(!this.baseDate||!targetDate)return false;return Number(targetDate)>Number(this.baseDate)}}, {key:"dayPartLabel",value:function dayPartLabel(name,targetDate){var base=name||"";if(this.isTomorrow(targetDate))return"\ub0b4\uc77c ".concat(base);return base}}, {key:"renderCard",value:function renderCard(timeSlots,slot){var html='\n \x3cdiv class\x3d"card_header"\x3e\n \x3ch2 class\x3d"card_title"\x3e\uace8\ud504 \uc608\ubcf4\ube44\uad50\x3c/h2\x3e\n \x3cul class\x3d"tab_list _cnLsurCompareTabs" role\x3d"tablist" aria-label\x3d"\uace8\ud504 \uc608\ubcf4\ube44\uad50 \ud0ed"\x3e\n '.concat(this.renderTabs(timeSlots, slot.key),'\n \x3c/ul\x3e\n \x3ca href\x3d"').concat(this.compareUrl,'" class\x3d"link_card_more" onclick\x3d"oCommon.fnSendClick(event, \'').concat(this.clickCode,'.comparemore\')" data-nlog-area\x3d"leisure_compare_forecast.more_link"\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_body"\x3e\n ').concat(this.renderCpLegend(), '\n \x3cdiv class\x3d"compare_tabpanel_wrap _cnLsurCompareContent"\x3e\n ').concat(this.renderSlot(slot,true),"\n \x3c/div\x3e\n \x3c/div\x3e\n ").concat(this.renderOfferArea()); this.element.html(html)}}, {key:"renderOfferArea",value:function renderOfferArea(){var rainCriteriaHtml=this.type==="GOLF"?"\n \x3cdt\x3e\ube44 \uc608\ubcf4 \uae30\uc900\x3c/dt\x3e\n \x3cdd\x3e4\uac1c\uc758 \uc81c\uacf5\uc0ac \uc911\uc5d0\uc11c \ud558\ub098\ub77c\ub3c4 \uac15\uc218\ub85c \uc608\ubcf4\ud55c \uacbd\uc6b0\x3c/dd\x3e": "";return'\n \x3cdiv class\x3d"offer_area"\x3e\n \x3cdiv class\x3d"offer_wrap"\x3e\n \x3cspan class\x3d"offer"\x3e\ub0a0\uc528\uc544\uc774\ucf58\x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"ico_help help_icon _cnWeatherInfoLayer" data-type\x3d"icon" aria-pressed\x3d"false" data-nlog-area\x3d"leisure_compare_forecast.help_button" data-nlog-params\x3d\'{"category":"icon"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\ub9d0\x3c/span\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"ly_help"\x3e\n \x3cstrong class\x3d"ly_ttl"\x3e\ub0a0\uc528\uc544\uc774\ucf58\x3c/strong\x3e\n \x3cspan class\x3d"desc"\x3e\uae30\uc628\ub2e8\uc704 (\u2103)\x3c/span\x3e\n \x3cul class\x3d"weather_list _cnLsurCompareWeatherList"\x3e\x3c/ul\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-type\x3d"icon" data-nlog-area\x3d"leisure_compare_forecast.layer.close_button" data-nlog-params\x3d\'{"category":"icon"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\ub9d0 \ub2eb\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3cspan class\x3d"offer"\x3e\uc608\ubcf4\ube44\uad50 \uae30\uc900\x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"ico_help help_icon _cnWeatherInfoLayer" data-type\x3d"criteria" aria-pressed\x3d"false" data-nlog-area\x3d"leisure_compare_forecast.help_button" data-nlog-params\x3d\'{"category":"criteria"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\ub9d0\x3c/span\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"ly_help"\x3e\n \x3cdl class\x3d"desc_creteria"\x3e'.concat(rainCriteriaHtml, '\n \x3cdt\x3e\uc81c\uacf5\uc0ac \ubcc4 \ucc28\uc774\x3c/dt\x3e\n \x3cdd\x3e\uae30\uc0c1\uccad : \ud574\ub2f9 \uc7a5\uc18c\uc758 \uc704\u00b7\uacbd\ub3c4 \x3cbr /\x3e\ud574\uc678 CP : \ud574\ub2f9 \uc7a5\uc18c\uc758 \ud589\uc815\ub3d9\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-type\x3d"criteria" data-nlog-area\x3d"leisure_compare_forecast.layer.close_button" data-nlog-params\x3d\'{"category":"criteria"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e')}}, {key:"renderTabs",value:function renderTabs(timeSlots,activeKey){var _this2=this;return(timeSlots||[]).map(function(s){var on=s.key===activeKey;return'\n \x3cli class\x3d"item" role\x3d"presentation"\x3e\n \x3cbutton type\x3d"button" role\x3d"tab" class\x3d"btn_tab _cnLsurCompareTab'.concat(on? " is_on":"",'"\n aria-selected\x3d"').concat(on,'" data-tab-name\x3d"').concat(s.key,'" data-key\x3d"').concat(s.key,'" data-target-date\x3d"').concat(s.targetDate,'" data-nlog-area\x3d"leisure_compare_forecast.tab_button" data-nlog-params\x3d\'{"tab":"').concat(s.key, "\"}'\x3e").concat(_this2.dayPartLabel(s.name,s.targetDate),"\x3c/button\x3e\n \x3c/li\x3e")}).join("")}}, {key:"renderCpLegend",value:function renderCpLegend(){var cpList=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.cpOrder;var items=cpList.map(function(cp){return'\x3cli class\x3d"item_'.concat(cp.cpType.toLowerCase(), '"\x3e\x3cspan class\x3d"text"\x3e').concat(cp.cpName,"\x3c/span\x3e\x3c/li\x3e")}).join(""); return'\x3cul class\x3d"list_cp" aria-hidden\x3d"true"\x3e'.concat(items,"\x3c/ul\x3e")}}, {key:"renderSlot",value:function renderSlot(slot){var isDefault=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!slot||!slot.hourlyForecast)return'\x3cdiv class\x3d"compare_tabpanel" role\x3d"tabpanel"\x3e\x3c/div\x3e'; var tomorrowClass=this.isTomorrow(slot.targetDate)?" tomorrow":"";return'\n \x3cdiv class\x3d"compare_tabpanel'.concat(tomorrowClass,'" role\x3d"tabpanel"\x3e\n ').concat(this.renderSummary(slot), "\n ").concat(this.renderTable(slot,isDefault),"\n \x3c/div\x3e")}}, {key:"renderSummary",value:function renderSummary(slot){var fs=slot.forecastSummary;if(!fs)return"";var levelMap={GOOD:"level_1",NORMAL:"level_2",CAUTION:"level_3"};var level=levelMap[fs.grade]||"level_1"; var text=[fs.rainExpectedText,fs.rainProbText].filter(Boolean).join(" \u00b7 ");return'\n \x3cdiv class\x3d"compare_summary '.concat(level,'"\x3e\n \x3cspan class\x3d"badge"\x3e').concat(fs.gradeName|| "",'\x3c/span\x3e\n \x3cspan class\x3d"daypart"\x3e').concat(this.dayPartLabel(slot.name,slot.targetDate),'\x3c/span\x3e\n \x3cspan class\x3d"text"\x3e').concat(text,"\x3c/span\x3e\n \x3c/div\x3e")}}, {key:"getPastByHour",value:function getPastByHour(hourlyForecast){var pastByHour={};this.cpOrder.forEach(function(cp){(hourlyForecast[cp.cpType]||[]).forEach(function(item){if(pastByHour[item.aplTm]=== undefined)pastByHour[item.aplTm]=!!item.past})}); return pastByHour}}, {key:"renderTable",value:function renderTable(slot){var _this3=this;var isDefault=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var hours=slot.hours||[];var hf=slot.hourlyForecast||{}; var pastByHour=this.getPastByHour(hf);var nowHour=isDefault?hours.find(function(h){return pastByHour[h]===false})||null:null; var headCols=hours.map(function(h){var cls="";if(h===nowHour)cls=' class\x3d"now"';else if(pastByHour[h]===false)cls=' class\x3d"later"';return'\x3cth scope\x3d"col"'.concat(cls,'\x3e\x3cspan class\x3d"text"\x3e').concat(h, "\uc2dc\x3c/span\x3e\x3c/th\x3e")}).join(""); var rows=this.cpOrder.map(function(cp){var list=Array.isArray(hf[cp.cpType])?hf[cp.cpType]:[];var byHour={};list.forEach(function(item){byHour[item.aplTm]=item}); var cells=hours.map(function(h){return byHour[h]?_this3.renderWeatherCell(byHour[h]):_this3.renderEmptyCell()}).join(""); return'\n \x3ctr\x3e\n \x3cth scope\x3d"row" class\x3d"blind"\x3e'.concat(cp.cpName,"\x3c/th\x3e\n ").concat(cells,"\n \x3c/tr\x3e")}).join(""); return'\n \x3cdiv class\x3d"scroll_control end_left end_right"\x3e\n \x3cdiv class\x3d"scroll_area" data-name\x3d"lsurCompareFcast" data-click\x3d"false" data-gesture-scroll\x3d"true" data-snap-selector\x3d".compare_table thead th:not(.blind)" data-bounce\x3d"false" data-end-focus\x3d"user" data-nlog-area\x3d"leisure_compare_forecast.scroll"\x3e\n \x3cdiv class\x3d"compare_table_wrap" style\x3d"transform: translateX(0);"\x3e\n \x3ctable class\x3d"compare_table"\x3e\n \x3ccaption class\x3d"blind"\x3e'.concat(slot.name|| "",' \uace8\ud504 \uc608\ubcf4 \ube44\uad50\x3c/caption\x3e\n \x3cthead\x3e\n \x3ctr\x3e\n \x3cth scope\x3d"col" class\x3d"blind"\x3e\uc81c\uacf5\uc0ac\x3c/th\x3e\n ').concat(headCols, "\n \x3c/tr\x3e\n \x3c/thead\x3e\n \x3ctbody\x3e").concat(rows,'\x3c/tbody\x3e\n \x3c/table\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_prev" data-nlog-area\x3d"leisure_compare_forecast.scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_next" data-nlog-area\x3d"leisure_compare_forecast.scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e')}}, {key:"renderWeatherCell",value:function renderWeatherCell(item){var prob=item.rainProb;var isNum=prob!=="-"&&prob!==null&&prob!==undefined&&!isNaN(Number(prob));var rainfallText=isNum?"".concat(prob,"%"): "-";var rainfallClass=isNum&&Number(prob)>0?"rainfall highlight":"rainfall";var wt=item.wetrTxt||"";var wetrCd=item.wetrCd||"";var temp=item.tmpr;if(!isNaN(Number(temp)))temp="".concat(temp,"\u00b0");return'\n \x3ctd\x3e\n \x3cdiv class\x3d"weather"\x3e\n \x3ci class\x3d"ico ico_wt'.concat(wetrCd, '" data-tooltip\x3d"').concat(wt,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wt,'\x3c/span\x3e\x3c/i\x3e\n \x3cspan class\x3d"temperature"\x3e').concat(temp,'\x3c/span\x3e\n \x3cspan class\x3d"').concat(rainfallClass, '"\x3e').concat(rainfallText,"\x3c/span\x3e\n \x3c/div\x3e\n \x3c/td\x3e")}}, {key:"renderEmptyCell",value:function renderEmptyCell(){return'\x3ctd\x3e\x3cdiv class\x3d"weather"\x3e\x3cspan class\x3d"rainfall"\x3e-\x3c/span\x3e\x3c/div\x3e\x3c/td\x3e'}}, {key:"renderGeneralCard",value:function renderGeneralCard(data){var html='\n \x3cdiv class\x3d"card_header"\x3e\n \x3ch2 class\x3d"card_title"\x3e\uc608\ubcf4\ube44\uad50\x3c/h2\x3e\n \x3ca href\x3d"'.concat(this.compareUrl, '" class\x3d"link_card_more" onclick\x3d"oCommon.fnSendClick(event, \'').concat(this.clickCode,'.comparemore\')" data-nlog-area\x3d"leisure_compare_forecast.more_link"\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_body"\x3e\n \x3cspan class\x3d"badge_tomorrow hide _cnLsurTomorrowBadge"\x3e\ub0b4\uc77c\x3c/span\x3e\n ').concat(this.renderCpLegend(this.generalCps), "\n ").concat(this.renderGeneralTable(data),"\n \x3c/div\x3e\n ").concat(this.renderOfferArea());this.element.html(html)}}, {key:"renderGeneralTable",value:function renderGeneralTable(data){var _this4=this;var timeline=data.timeline||[];var hf=data.hourlyForecast||{};var isAfterDayBreak=false;var headCols=timeline.map(function(slot){if(slot.dayBreak){isAfterDayBreak= true;return'\x3cth scope\x3d"col" class\x3d"tomorrow _cnLsurTomorrow"\x3e\x3cspan class\x3d"text"\x3e\ub0b4\uc77c\x3c/span\x3e\x3c/th\x3e'}var cls=isAfterDayBreak?' class\x3d"later"':"";return'\x3cth scope\x3d"col"'.concat(cls, '\x3e\x3cspan class\x3d"text"\x3e').concat(Number(slot.aplTm),"\uc2dc\x3c/span\x3e\x3c/th\x3e")}).join(""); var rows=this.generalCps.map(function(cp){var list=hf[cp.cpType];var byTime={};list.forEach(function(item){byTime["".concat(item.aplYmd).concat(item.aplTm)]=item}); var cells=timeline.map(function(slot){var item=byTime["".concat(slot.aplYmd).concat(slot.aplTm)];return item?_this4.renderWeatherCell(item):_this4.renderEmptyCell()}).join(""); return'\n \x3ctr\x3e\n \x3cth scope\x3d"row" class\x3d"blind"\x3e'.concat(cp.cpName,"\x3c/th\x3e\n ").concat(cells,"\n \x3c/tr\x3e")}).join(""); return'\n \x3cdiv class\x3d"scroll_control end_left end_right"\x3e\n \x3cdiv class\x3d"scroll_area" data-name\x3d"lsurCompareFcast" data-click\x3d"false" data-gesture-scroll\x3d"true" data-snap-selector\x3d".compare_table thead th:not(.blind)" data-bounce\x3d"false" data-end-focus\x3d"user" data-nlog-area\x3d"leisure_compare_forecast.scroll"\x3e\n \x3cdiv class\x3d"compare_table_wrap" style\x3d"transform: translateX(0);"\x3e\n \x3ctable class\x3d"compare_table"\x3e\n \x3ccaption class\x3d"blind"\x3e\uc608\ubcf4 \ube44\uad50\x3c/caption\x3e\n \x3cthead\x3e\n \x3ctr\x3e\n \x3cth scope\x3d"col" class\x3d"blind"\x3e\uc81c\uacf5\uc0ac\x3c/th\x3e\n '.concat(headCols, "\n \x3c/tr\x3e\n \x3c/thead\x3e\n \x3ctbody\x3e").concat(rows,'\x3c/tbody\x3e\n \x3c/table\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_prev" data-nlog-area\x3d"leisure_compare_forecast.scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_next" data-nlog-area\x3d"leisure_compare_forecast.scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e')}}, {key:"initGeneralScroll",value:function initGeneralScroll(){var _this5=this;oCommon.initScroll(this.element.find(".scroll_area"),function(){return _this5.updateTomorrowBadge()}); this.refreshScrollAreaHeight();this.cacheTomorrowBadgeMetrics();this.updateTomorrowBadge()}}, {key:"cacheTomorrowBadgeMetrics",value:function cacheTomorrowBadgeMetrics(){this.$tomorrowTh=this.element.find("._cnLsurTomorrow");this.$tomorrowBadge=this.element.find("._cnLsurTomorrowBadge");this.tomorrowBadgeThresholdX= null;var $scrollArea=this.element.find(".scroll_area");if(this.$tomorrowTh.length===0||this.$tomorrowBadge.length===0||$scrollArea.length===0)return;this.scrollName=$scrollArea.data("name");var scroll= oCommon.oScroll[this.scrollName];var currentX=scroll?scroll.x:0;var edgeOffset=1;this.tomorrowBadgeThresholdX=this.$tomorrowTh.get(0).getBoundingClientRect().left-$scrollArea.get(0).getBoundingClientRect().left- currentX-edgeOffset}}, {key:"updateTomorrowBadge",value:function updateTomorrowBadge(){if(this.tomorrowBadgeThresholdX===null)return;var scroll=oCommon.oScroll[this.scrollName];var scrolledX=scroll?-scroll.x:0;var isBadgeVisible= scrolledX>=this.tomorrowBadgeThresholdX;if(isBadgeVisible===this.isTomorrowBadgeVisible)return;this.isTomorrowBadgeVisible=isBadgeVisible;this.$tomorrowBadge.toggleClass("hide",!isBadgeVisible);this.$tomorrowTh.toggleClass("tomorrow", !isBadgeVisible).toggleClass("later",isBadgeVisible);this.$tomorrowTh.find(".text").text(isBadgeVisible?"0\uc2dc":"\ub0b4\uc77c")}}, {key:"attachEvent",value:function attachEvent(){if(this.type==="GOLF")this.element.on("click","._cnLsurCompareTab",$.proxy(this.onClickTab,this));this.element.on("click",".offer_area ._cnWeatherInfoLayer", $.proxy(this.openInfoLayer,this));this.element.on("click",".offer_area .btn_close",$.proxy(this.closeAllLayer,this))}}, {key:"openInfoLayer",value:function openInfoLayer(e){var $target=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(isOpen===false){oCommon.fnSendClick(e,"".concat(this.clickCode, ".compareinfo"));var $list=$target.next(".ly_help").find("._cnLsurCompareWeatherList");if($list.length)this.fillWeatherList($list);oCommon.fnOpenInfoLayer($target)}}}, {key:"closeAllLayer",value:function closeAllLayer(){oCommon.fnCloseAllInfoLayer()}}, {key:"fillWeatherList",value:function fillWeatherList($list){var iconMap={};this.element.find(".compare_table .weather .ico").each(function(i,el){var ico=(el.className.match(/ico_wt\d+/)||[])[0];var txt= $(el).attr("data-tooltip");if(ico&&txt)iconMap[ico]=txt}); var html=Object.keys(iconMap).map(function(ico){return'\x3cli class\x3d"item"\x3e\x3ci class\x3d"ico '.concat(ico,'"\x3e\x3c/i\x3e').concat(iconMap[ico],"\x3c/li\x3e")}).join(""); $list.html(html)}}, {key:"onClickTab",value:function onClickTab(e){var _this6=this;var $btn=$(e.currentTarget);if($btn.hasClass("is_on"))return;var timeSlot=$btn.data("key");var targetDate=String($btn.data("target-date")); oCommon.fnSendClick(e,"".concat(this.clickCode,".comparetab"));var choiceQuery={lsurCompareFcast:{lsurRgnCd:this.lsurRgnCd,timeSlot:timeSlot,targetDate:targetDate,type:this.type}};var commonQuery={lsurRegion:{lsurRgnCd:this.lsurRgnCd}}; oBlockScriptService.ajaxChoiceApiWithCommon(choiceQuery,commonQuery,function(result){var slot=result===null||result===void 0?void 0:result.lsurCompareFcast;_this6.element.find("._cnLsurCompareContent").html(_this6.renderSlot(slot, timeSlot===_this6.defaultSlotKey));_this6.setActiveTab(timeSlot);_this6.initScroll()})}}, {key:"setActiveTab",value:function setActiveTab(activeKey){this.element.find("._cnLsurCompareTab").each(function(i,el){var $el=$(el);var on=$el.data("key")===activeKey;$el.toggleClass("is_on",on).attr("aria-selected", on)})}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"));this.scrollToNow()}}, {key:"scrollToNow",value:function scrollToNow(){var scrollName=this.element.find(".scroll_area").data("name");var scroll=oCommon.oScroll[scrollName];var nowTh=this.element.find(".compare_table thead th.now").get(0); if(!scroll||!nowTh)return;oCommon.scrollToCell(scrollName,nowTh,300,0)}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))if(this.type==="GENERAL")this.initGeneralScroll(); else this.initScroll();else{this.refreshScrollAreaHeight();oCommon.refreshScroll(scrollName);this.scrollToNow()}}}, {key:"refreshScrollAreaHeight",value:function refreshScrollAreaHeight(){var $scrollArea=this.element.find(".scroll_area");var $tableWrap=$scrollArea.children().first();if($tableWrap.length)$scrollArea.height($tableWrap.outerHeight())}}, {key:"resizeTemplate",value:function resizeTemplate(sizeType,isChanged){if(this.element.find(".scroll_area").length===0)return;this.resetScroll();if(this.type==="GENERAL"){this.cacheTomorrowBadgeMetrics(); this.updateTomorrowBadge()}}}]); return lsurCompareFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=lsurHikingCourse.WIDE_BREAKPOINT;this.initCourseSheet()}}, {key:"createInfoTooltip",value:function createInfoTooltip(){return'\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button _cnWeatherInfoLayer" aria-pressed\x3d"false" data-nlog-area\x3d"leisure_hiking_course.help_button"\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n \x3cspan class\x3d"card_tooltip_inner"\x3e\n \x3cem class\x3d"card_tooltip_title"\x3e\ub4f1\uc0b0\ucf54\uc2a4 \ub0a0\uc528 \uae30\uc900\x3c/em\x3e\n \x3cul class\x3d"card_tooltip_list"\x3e\n \x3cli class\x3d"card_tooltip_item"\x3e\ucf54\uc2a4 \uc815\ubcf4\ub294 \uc9c0\uc790\uccb4 \ub4f1 \uc6d0 \uc81c\uacf5\ucc98\uc5d0 \ub530\ub77c \ud604\uc7a5\uacfc \ub2e4\ub97c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\x3c/li\x3e\n \x3cli class\x3d"card_tooltip_item"\x3e\uc9c0\uc810\ubcc4 \uc608\uc0c1 \ub3c4\ucc29 \uc2dc\uac04\uc740 \uac1c\uc778\uc758 \uccb4\ub825\uc5d0 \ub530\ub77c \ucc28\uc774\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\x3c/li\x3e\n \x3cli class\x3d"card_tooltip_item"\x3e\uc0b0\uc545 \uc9c0\uc5ed\uc740 \ub0a0\uc528\uac00 \ube60\ub974\uac8c \ubcc0\ud558\ubbc0\ub85c, \uc9c0\uc810\ubcc4 \ub0a0\uc528 \uc608\ubcf4\ub294 \ucc38\uace0\ub9cc \ud574\uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.\x3c/li\x3e\n \x3c/ul\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-nlog-area\x3d"leisure_hiking_course.layer.close_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/span\x3e\n '}}, {key:"createCourseOpenButton",value:function createCourseOpenButton(){var course=this.getSelectedCourse();if(!course)return"";return'\n \x3cbutton type\x3d"button" class\x3d"btn_course_open" data-nlog\x3d"course_sheet_open" aria-pressed\x3d"false" data-nlog-area\x3d"leisure_hiking_course.course_sheet_open_button"\x3e\n '.concat(this.createCourseInfo(course), "\n \x3c/button\x3e\n ")}}, {key:"createCourseItem",value:function createCourseItem(course){var selected=course.lsurRgnCd===this.selectedCourseCd;return'\n \x3cli class\x3d"course_item"\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_course_option" data-nlog\x3d"course_option" aria-pressed\x3d"'.concat(selected, '" data-course-cd\x3d"').concat(_.escape(course.lsurRgnCd),'" data-nlog-area\x3d"leisure_hiking_course.course_option_button"\x3e\n ').concat(this.createCourseInfo(course),"\n \x3c/button\x3e\n \x3c/li\x3e\n ")}}, {key:"createCourseInfo",value:function createCourseInfo(course){return'\n \x3cspan class\x3d"option_title"\x3e\n \x3cspan class\x3d"badge_difficulty level_'.concat(course.difficulty, '"\x3e').concat(_.escape(course.difficultyLabel),'\x3c/span\x3e\n \x3cstrong class\x3d"name"\x3e').concat(_.escape(course.courseName),'\x3c/strong\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"option_info"\x3e\n \x3cspan class\x3d"start"\x3e').concat(_.escape(course.startName), '\x3c/span\x3e\n \x3cspan class\x3d"range_arrow" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3cspan class\x3d"end"\x3e').concat(_.escape(course.endName),'\x3c/span\x3e\n \x3cspan class\x3d"distance"\x3e').concat(_.escape(course.distanceText), '\x3c/span\x3e\n \x3cspan class\x3d"duration"\x3e').concat(_.escape(course.durationText)," \uc18c\uc694\x3c/span\x3e\n \x3c/span\x3e\n ")}}, {key:"showWeatherLoading",value:function showWeatherLoading(){this.element.find(".course_weather").removeClass("common_nodata").html('\n \x3cdiv class\x3d"loading_box" aria-label\x3d"\ub85c\ub529\uc911"\x3e\n \x3cspan class\x3d"item item1"\x3e\x3c/span\x3e\n \x3cspan class\x3d"item item2"\x3e\x3c/span\x3e\n \x3cspan class\x3d"item item3"\x3e\x3c/span\x3e\n \x3cspan class\x3d"item item4"\x3e\x3c/span\x3e\n \x3cspan class\x3d"item item5"\x3e\x3c/span\x3e\n \x3cspan class\x3d"item item6"\x3e\x3c/span\x3e\n \x3c/div\x3e\n ')}}, {key:"createGraphLoading",value:function createGraphLoading(){return'\n \x3cdiv class\x3d"loading_box" aria-label\x3d"\ub85c\ub529\uc911"\x3e\n \x3cspan class\x3d"item item4"\x3e\x3c/span\x3e\n \x3c/div\x3e\n '}}, {key:"hideGraphLoading",value:function hideGraphLoading(){this.element.find(".weather_graph \x3e .loading_box").remove()}}, {key:"createNodataOverlay",value:function createNodataOverlay(){return'\n \x3cdiv class\x3d"common_nodata_wrap"\x3e\n \x3cdiv class\x3d"common_nodata_inner"\x3e\n \x3cp class\x3d"common_nodata_text"\x3e\n \uc815\ubcf4\ub97c \ubd88\ub7ec\uc624\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4.\x3cbr /\x3e\uc7a0\uc2dc \ud6c4 \ub2e4\uc2dc \uc2dc\ub3c4\ud574 \uc8fc\uc138\uc694.\n \x3c/p\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_nodata_reload" data-nlog\x3d"retry" data-nlog-area\x3d"leisure_hiking_course.retry_button"\x3e\ub2e4\uc2dc \ubd88\ub7ec\uc624\uae30\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"getSelectedCourse",value:function getSelectedCourse(){var _this$courseList,_this5=this;return(((_this$courseList=this.courseList)===null||_this$courseList===void 0?void 0:_this$courseList.courses)|| []).find(function(course){return course.lsurRgnCd===_this5.selectedCourseCd})}}, {key:"renderCourseWeather",value:function renderCourseWeather(){var departure=this.waypointData.departure;this.departureYmdt=departure.selectedYmdt;this.waypointIndex=this.waypointData.selectedWaypointIndex; this.element.find(".course_weather").html('\n \x3cdiv class\x3d"weather_option"\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_course_time" data-nlog\x3d"time_sheet_open" aria-pressed\x3d"false" data-nlog-area\x3d"leisure_hiking_course.time_sheet_open_button"\x3e\n \x3cspan class\x3d"time"\x3e'.concat(this.formatHourText(departure.selectedYmdt), '\x3c/span\x3e\n \x3cspan class\x3d"text"\x3e\ucd9c\ubc1c\x3c/span\x3e\n \x3c/button\x3e\n ').concat(this.createTimeSheet(departure),"\n ").concat(this.createSpotSlider(), "\n \x3c/div\x3e\n ").concat(this.createWeatherSummary(),"\n ").concat(this.createGraphArea(),"\n "));this.initTimeSheet();this.initSpotScroll();this.renderGraph()}}, {key:"createGraphArea",value:function createGraphArea(){return'\n \x3cdiv class\x3d"weather_graph"\x3e\n '.concat(this.createGraphLoading(),'\n \x3cdiv class\x3d"scroll_control" data-nlog\x3d"graph_scroll"\x3e\n \x3cdiv class\x3d"scroll_area" data-nlog-area\x3d"leisure_hiking_course.graph_scroll"\x3e\n \x3cdiv class\x3d"course_graph_area"\x3e\n \x3cdiv class\x3d"course_graph_chart" id\x3d"courseGraphChart"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"course_graph_custom"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_prev" data-nlog-area\x3d"leisure_hiking_course.graph_scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_next" data-nlog-area\x3d"leisure_hiking_course.graph_scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c!--\n \uace0\ub3c4 \ucd95 \uace0\uc815 \ub808\uc774\uc5b4. \ub9c8\ud06c\uc5c5\uc5d0 \ub300\uc751 \uc694\uc18c\uac00 \uc5c6\uc5b4 JS \uac00 \ub9cc\ub4e4\uace0 \uc778\ub77c\uc778\uc73c\ub85c \ubc30\uce58\ud55c\ub2e4.\n \uac00\ub85c \uc2a4\ud06c\ub864\uc740 \ucc28\ud2b8 SVG \ub97c \ud1b5\uc9f8\ub85c \uc6c0\uc9c1\uc774\ubbc0\ub85c \ucd95\uc774 \uadf8 \uc548\uc5d0 \uc788\uc73c\uba74 \ud568\uaed8 \ubc00\ub824\ub09c\ub2e4.\n \uc2a4\ud06c\ub864 \uc601\uc5ed \'\ubc16\'\uc5d0 \ucd95 \uc0ac\ubcf8\uc744 \uc5b9\uc5b4 \uc2a4\ud06c\ub864\uacfc \ubb34\uad00\ud558\uac8c \ub9cc\ub4e0\ub2e4 -\x3e setupGraphYAxis()\n --\x3e\n \x3cdiv class\x3d"course_graph_axis"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"weather_legend"\x3e\n \x3cspan class\x3d"legend_item type_altitude"\x3e\uace0\ub3c4\x3c/span\x3e\n \x3cspan class\x3d"legend_item type_temperature"\x3e\uae30\uc628\x3c/span\x3e\n \x3cspan class\x3d"legend_item type_rain"\x3e\uac15\uc218\x3c/span\x3e\n \x3c/div\x3e\n ')}}, {key:"renderGraph",value:function renderGraph(){var _this6=this;var series=this.createGraphSeries();var $weather=this.element.find(".course_weather");if(!series){this.hideGraphLoading();$weather.addClass("common_nodata"); if(!$weather.children(".common_nodata_wrap").length)$weather.prepend(this.createNodataOverlay());return}$weather.removeClass("common_nodata").children(".common_nodata_wrap").remove();oCommon.fnLoadChartLibraries().done(function(){_this6.drawGraph(series)}).fail(function(){_this6.hideGraphLoading()})}}, {key:"resampleProfile",value:function resampleProfile(profile,duration){var inner=this.getPlotInnerWidth(this.getGraphWidth(duration));var target=Math.floor(inner*lsurHikingCourse.PROFILE_POINTS_PER_PX); if(inner<=0||target<2||profile.length<=target)return profile;var first=profile[0];var last=profile[profile.length-1];var span=last[0]-first[0];if(span<=0)return profile;var buckets=[];profile.forEach(function(_ref){var _ref2= _slicedToArray(_ref,2),minutes=_ref2[0],altitude=_ref2[1];var index=Math.min(target-1,Math.floor((minutes-first[0])/span*target));if(!buckets[index])buckets[index]={x:0,y:0,count:0};buckets[index].x+=minutes; buckets[index].y+=altitude;buckets[index].count+=1}); var sampled=buckets.filter(function(bucket){return bucket}).map(function(bucket){return[Math.round(bucket.x/bucket.count*10)/10, Math.round(bucket.y/bucket.count)]}); var keep=[first,last];var highest=profile.reduce(function(max,item){return item[1]>max[1]?item:max},profile[0]); var lowest=profile.reduce(function(min,item){return item[1]axisEnd)return;pointX.push(minutes);pointY.push(value)}); var groundTemperature=this.createGroundTemperatureLookup(hourly);var tempX=[];var tempY=[];var pushTemperature=function pushTemperature(minutes,altitude){var value=_this7.getAdjustedTemperature(groundTemperature(minutes), altitude);if(value==null)return;tempX.push(minutes);tempY.push(value)}; sampled.forEach(function(_ref5){var _ref6=_slicedToArray(_ref5,2),minutes=_ref6[0],altitude=_ref6[1];return pushTemperature(minutes,altitude)}); if(sampled.length&&tempX.length&&tempX[tempX.length-1]0&& lowest<100?lowest:Math.floor(lowest/100)*100;var max=Math.ceil(highest/100)*100;var step=(max-min)/2;return{min:min-step,max:max,ticks:[min,min+step,max]}}}, {key:"getTemperatureRange",value:function getTemperatureRange(values){if(!values.length)return{min:0,max:1};var lowest=Math.min.apply(Math,_toConsumableArray(values))-2;var highest=Math.max.apply(Math, _toConsumableArray(values))+2;var step=(highest-lowest)/2;return{min:lowest-step,max:highest}}}, {key:"getTickInterval",value:function getTickInterval(duration){return duration<=30?10:duration<=120?30:60}}, {key:"getAxisEnd",value:function getAxisEnd(duration){if(duration<=30)return 30;if(duration<=60)return 60;if(duration<=120)return 120;return Math.ceil(duration/60)*60}}, {key:"getDimRainMinutes",value:function getDimRainMinutes(axisEnd){return Math.floor(axisEnd/60)*60+60}}, {key:"getXAxisTicks",value:function getXAxisTicks(duration){var interval=this.getTickInterval(duration);var axisEnd=this.getAxisEnd(duration);var ticks=[];for(var minutes=0;minutes<=axisEnd;minutes+=interval)ticks.push(minutes); return ticks}}, {key:"isHourLabelOnly",value:function isHourLabelOnly(duration){return duration>30&&duration<=120}}, {key:"formatTickLabel",value:function formatTickLabel(minutes,duration){if(this.isHourLabelOnly(duration)&&minutes%60!==0)return"";var date=this.toDate(this.departureYmdt);date.setMinutes(date.getMinutes()+ minutes);var hour=String(date.getHours()).padStart(2,"0");var minute=String(date.getMinutes()).padStart(2,"0");return"".concat(hour,":").concat(minute)}}, {key:"drawGraph",value:function drawGraph(series){var _this9=this;var container=this.element.find(".course_graph_chart").get(0);if(!container||(typeof bb==="undefined"?"undefined":_typeof(bb))!=="object"){this.hideGraphLoading(); return}var altitudeRange=this.getAltitudeRange(series.altitudeY);var temperatureRange=this.getTemperatureRange(series.tempY);var ticks=this.getXAxisTicks(series.duration);var graphWidth=this.getGraphWidth(series.duration); var xDomain=this.getXDomain(series.duration,graphWidth);this.prepareGraphScroll(graphWidth);if(this.chart)this.chart.destroy();this.chart=bb.generate({bindto:container,size:{height:151,width:graphWidth}, data:{xs:{altitude:"altitudeX",temperature:"temperatureX",temperaturePoint:"temperaturePointX"},columns:[["temperatureX"].concat(_toConsumableArray(series.tempX)),["temperature"].concat(_toConsumableArray(series.tempY)), ["temperaturePointX"].concat(_toConsumableArray(series.pointX)),["temperaturePoint"].concat(_toConsumableArray(series.pointY)),["altitudeX"].concat(_toConsumableArray(series.altitudeX)),["altitude"].concat(_toConsumableArray(series.altitudeY))], types:{altitude:"spline",temperature:"area-spline",temperaturePoint:"scatter"},axes:{altitude:"y",temperature:"y2",temperaturePoint:"y2"},order:null},line:{point:["temperaturePoint"]},spline:{interpolation:{type:"monotone-x"}}, area:{below:true,linearGradient:{x:[0,0],y:[0,1],stops:[[.2,"#74cc7f",.2],[.802885,"#fff",.2]]}},point:{show:true,r:1.5,focus:{expand:{enabled:false}}},axis:{x:{min:xDomain.min,max:xDomain.max,padding:{left:0, right:0},tick:{values:ticks,format:function format(value){return _this9.formatTickLabel(value,series.duration)}, multiline:false,culling:false,outer:false},height:lsurHikingCourse.X_AXIS_HEIGHT},y:{min:altitudeRange.min,max:altitudeRange.max,tick:{values:altitudeRange.ticks,format:function format(value){return"".concat(_this9.formatNumber(mathRound(value, 0)),"m")}}, padding:{top:0,bottom:0}},y2:{show:true,min:temperatureRange.min,max:temperatureRange.max,tick:{show:false,text:{show:false}},padding:{top:0,bottom:0}}},grid:{y:{lines:altitudeRange.ticks.map(function(value){return{value:value}})}, lines:{front:false}},legend:{show:false},tooltip:{show:false},padding:{top:lsurHikingCourse.CHART_PADDING_TOP,bottom:0,left:lsurHikingCourse.CHART_PADDING_LEFT,right:lsurHikingCourse.CHART_PADDING_RIGHT}, onrendered:function onrendered(){_this9.hideGraphLoading();_this9.setupGraphYAxis(container);_this9.markMinuteTicks(container);_this9.shortenAxisTicks(container);_this9.placeTemperaturePoints(container); _this9.updateGraphScrollState();clearTimeout(_this9.overlayTimer);_this9.overlayTimer=setTimeout(function(){return _this9.renderGraphOverlay(series,altitudeRange,temperatureRange,xDomain)},50)}})}}, {key:"placeTemperaturePoints",value:function placeTemperaturePoints(container){var chart=container.querySelector(".bb-chart");var circles=chart===null||chart===void 0?void 0:chart.querySelector(".bb-chart-circles"); var lines=chart===null||chart===void 0?void 0:chart.querySelector(".bb-chart-lines");var altitude=lines===null||lines===void 0?void 0:lines.querySelector(".bb-target-altitude");if(!circles||!lines||!altitude)return; lines.insertBefore(circles,altitude)}}, {key:"markMinuteTicks",value:function markMinuteTicks(container){container.querySelectorAll(".bb-axis-x .tick").forEach(function(tick){var _tick$querySelector;var label=(((_tick$querySelector=tick.querySelector("text"))=== null||_tick$querySelector===void 0?void 0:_tick$querySelector.textContent)||"").trim();tick.classList.toggle("text_minute",!label.endsWith(":00"))})}}, {key:"shortenAxisTicks",value:function shortenAxisTicks(container){container.querySelectorAll(".bb-axis-x .tick line").forEach(function(line){line.setAttribute("y1",lsurHikingCourse.X_TICK_Y1);line.setAttribute("y2", lsurHikingCourse.X_TICK_Y2)})}}, {key:"getGraphWidth",value:function getGraphWidth(duration){var graph=this.element.find(".weather_graph").get(0);var available=graph?graph.clientWidth:0;if(!duration||duration<=lsurHikingCourse.FIXED_SCALE_DURATION)return available; var paddingX=lsurHikingCourse.CHART_PADDING_LEFT+lsurHikingCourse.CHART_PADDING_RIGHT+lsurHikingCourse.SIDE_PADDING*2;var fixedScale=Math.ceil(this.getAxisEnd(duration)/60*lsurHikingCourse.HOUR_WIDTH)+ paddingX;if(fixedScale<=available+lsurHikingCourse.MIN_SCROLL_GAIN)return available;return fixedScale}}, {key:"getPlotInnerWidth",value:function getPlotInnerWidth(graphWidth){return graphWidth-lsurHikingCourse.CHART_PADDING_LEFT-lsurHikingCourse.CHART_PADDING_RIGHT-lsurHikingCourse.SIDE_PADDING*2}}, {key:"getXDomain",value:function getXDomain(duration,graphWidth){var axisEnd=this.getAxisEnd(duration);var inner=this.getPlotInnerWidth(graphWidth);if(!duration||inner<=0)return{min:0,max:axisEnd};var margin= lsurHikingCourse.SIDE_PADDING/inner*axisEnd;var rightMargin=(lsurHikingCourse.SIDE_PADDING+1)/inner*axisEnd;return{min:-margin,max:axisEnd+rightMargin}}}, {key:"prepareGraphScroll",value:function prepareGraphScroll(width){var _this0=this;var $area=this.element.find(".weather_graph .scroll_area");var $graphArea=this.element.find(".course_graph_area");var graph= this.element.find(".weather_graph").get(0);if(!$area.length||!graph)return;$graphArea.css("width","".concat(width,"px"));this.graphScrollable=width>graph.clientWidth;$area.css({"overflow-x":this.graphScrollable? "scroll":"hidden","touch-action":this.graphScrollable?"pan-x pan-y":""});$area.scrollLeft(0);$area.off("scroll.hikingGraph").on("scroll.hikingGraph",function(){if(_this0.scrollFrame)return;_this0.scrollFrame= requestAnimationFrame(function(){_this0.scrollFrame=null;_this0.updateGraphScrollState()})}); this.bindGraphDragScroll($area);this.updateGraphScrollState()}}, {key:"bindGraphDragScroll",value:function bindGraphDragScroll($area){var _this1=this;var area=$area.get(0);$area.off(".hikingDrag");if(!area||!this.graphScrollable)return;var dragging=false;var captured= false;var startX=0;var startScroll=0;var moved=0;$area.on("pointerdown.hikingDrag",function(e){var event=e.originalEvent;if(event.pointerType!=="mouse"||event.button!==0)return;dragging=true;captured=false; moved=0;startX=event.clientX;startScroll=area.scrollLeft}); $area.on("pointermove.hikingDrag",function(e){if(!dragging)return;var delta=e.originalEvent.clientX-startX;moved=Math.max(moved,Math.abs(delta));if(moved=lsurHikingCourse.DRAG_THRESHOLD; if(_this1.draggedGraph)setTimeout(function(){_this1.draggedGraph=false},0); if(area.hasPointerCapture(e.originalEvent.pointerId))area.releasePointerCapture(e.originalEvent.pointerId)})}}, {key:"consumeGraphDrag",value:function consumeGraphDrag(){var dragged=this.draggedGraph===true;this.draggedGraph=false;return dragged}}, {key:"updateGraphScrollState",value:function updateGraphScrollState(){var area=this.element.find(".weather_graph .scroll_area").get(0);var $control=this.element.find(".weather_graph .scroll_control");if(!area|| !$control.length)return;var maxScroll=area.scrollWidth-area.clientWidth;var scrollLeft=Math.round(area.scrollLeft);if(!this.graphScrollable||maxScroll<=0)$control.removeClass("end_left end_right");else if(scrollLeft<= 0)$control.addClass("end_left").removeClass("end_right");else if(scrollLeft>=maxScroll-1)$control.addClass("end_right").removeClass("end_left");else $control.addClass("end_left end_right");this.updateGraphAxisLayer(); this.updateOverlayVisibility()}}, {key:"readMainTranslateTop",value:function readMainTranslateTop(container){var _container$querySelec;var transform=((_container$querySelec=container.querySelector(".bb-main"))===null||_container$querySelec=== void 0?void 0:_container$querySelec.getAttribute("transform"))||"";var matched=transform.match(/translate\(\s*[-\d.]+[\s,]+([-\d.]+)/);return matched?parseFloat(matched[1]):lsurHikingCourse.CHART_PADDING_TOP}}, {key:"setupGraphYAxis",value:function setupGraphYAxis(container){var axis=container.querySelector(".bb-axis-y");var plot=container.querySelector(".bb-event-rect");var layer=this.element.find(".course_graph_axis").get(0); var graph=this.element.find(".weather_graph").get(0);if(!axis||!plot||!layer||!graph)return;this.chartOffsetTop=Math.round(container.getBoundingClientRect().top-graph.getBoundingClientRect().top);this.plotHeight= plot.getBBox().height;this.chartPaddingTop=this.readMainTranslateTop(container);axis.style.visibility="hidden";var svgNs="http://www.w3.org/2000/svg";var svg=document.createElementNS(svgNs,"svg");var clone= axis.cloneNode(true);clone.style.visibility="visible";clone.setAttribute("transform","translate(".concat(lsurHikingCourse.CHART_PADDING_LEFT,",").concat(this.chartPaddingTop+this.chartOffsetTop,")"));svg.setAttribute("width", lsurHikingCourse.CHART_PADDING_LEFT);svg.style.overflow="visible";svg.appendChild(clone);layer.innerHTML="";layer.appendChild(svg);clone.querySelectorAll(".tick").forEach(function(tick){var text=tick.querySelector("text"); if(!text)return;var box=text.getBBox();var background=document.createElementNS(svgNs,"rect");background.setAttribute("x",box.x-2);background.setAttribute("y",box.y-1);background.setAttribute("width",box.width+ 4);background.setAttribute("height",box.height+2);background.setAttribute("fill","#fff");tick.insertBefore(background,text)}); $(layer).css({position:"absolute",left:0,top:0,width:"".concat(lsurHikingCourse.CHART_PADDING_LEFT,"px"),"z-index":3,"pointer-events":"none"});this.updateGraphAxisLayer()}}, {key:"updateGraphAxisLayer",value:function updateGraphAxisLayer(){var _this$chartPaddingTop;var layer=this.element.find(".course_graph_axis").get(0);var area=this.element.find(".weather_graph .scroll_area").get(0); if(!layer||!area||!this.plotHeight)return;var scrolled=area.scrollLeft>0;var axisRow=scrolled?lsurHikingCourse.X_AXIS_HEIGHT:0;var paddingTop=(_this$chartPaddingTop=this.chartPaddingTop)!==null&&_this$chartPaddingTop!== void 0?_this$chartPaddingTop:lsurHikingCourse.CHART_PADDING_TOP;var height=Math.round(this.chartOffsetTop+paddingTop+this.plotHeight+axisRow);layer.style.height="".concat(height,"px");layer.style.backgroundColor= scrolled?"#fff":"transparent";var svg=layer.querySelector("svg");if(svg)svg.setAttribute("height",height)}}, {key:"scrollGraph",value:function scrollGraph(direction){var area=this.element.find(".weather_graph .scroll_area").get(0);if(!area||!this.graphScrollable)return;area.scrollLeft+=direction*lsurHikingCourse.HOUR_WIDTH}}, {key:"updateOverlayVisibility",value:function updateOverlayVisibility(){var area=this.element.find(".weather_graph .scroll_area").get(0);var $custom=this.element.find(".course_graph_custom");if(!area|| !$custom.length)return;var $targets=$custom.children().not(".tooltip_tmpr").add($custom.find(".tooltip_tmpr").children());if(area.scrollLeft<=0){$targets.each(function(index,element){element.style.visibility= ""}); return}var boundary=area.getBoundingClientRect().left+lsurHikingCourse.CHART_PADDING_LEFT;$targets.each(function(index,element){var rect=element.getBoundingClientRect();element.style.visibility=rect.left+ rect.width/2=visibleLeft&&spotRect.right<=visibleRight)return;var spotCenter=spotRect.left+spotRect.width/2;var visibleCenter=(visibleLeft+visibleRight)/2;area.scrollLeft+= spotCenter-visibleCenter}}, {key:"positionGroundTooltip",value:function positionGroundTooltip(){var inner=this.element.find(".course_graph_custom .tooltip_inner").get(0);var line=this.element.find(".course_graph_custom .tooltip_line").get(0); var geometry=this.getPlotGeometry();if(!inner||!line||!geometry)return;var innerWidth=inner.getBoundingClientRect().width;if(!geometry.width||!innerWidth)return;var bounds={left:geometry.left,right:geometry.left+ geometry.plotWidth};var center=parseFloat(line.style.left)/100*geometry.width;var limit=Math.max(bounds.right-innerWidth,bounds.left);var raw=center-innerWidth/2;var clamped=Math.min(Math.max(raw,bounds.left), limit);inner.style.left="".concat((clamped/geometry.width*100).toFixed(2),"%");inner.style.marginLeft=raw>limit&&limit>bounds.left?"-4px":""}}, {key:"getPlotGeometry",value:function getPlotGeometry(){var container=this.element.find(".course_graph_chart").get(0);var overlay=this.element.find(".course_graph_custom").get(0);var plot=container===null|| container===void 0?void 0:container.querySelector(".bb-event-rect");if(!plot||!overlay)return null;var overlayRect=overlay.getBoundingClientRect();var plotRect=plot.getBoundingClientRect();return{width:overlayRect.width, left:plotRect.left-overlayRect.left,top:plotRect.top-overlayRect.top,plotWidth:plotRect.width,plotHeight:plotRect.height}}}, {key:"renderGraphOverlay",value:function renderGraphOverlay(series,altitudeRange,temperatureRange,xDomain){var geometry=this.getPlotGeometry();var $custom=this.element.find(".course_graph_custom");if(!geometry|| !$custom.length)return;var xSpan=xDomain.max-xDomain.min;var toLeft=function toLeft(minutes){return(geometry.left+(minutes-xDomain.min)/xSpan*geometry.plotWidth)/geometry.width*100}; var toTop=function toTop(value,range){return geometry.top+(1-(value-range.min)/(range.max-range.min))*geometry.plotHeight}; $custom.html([this.createGroundTooltip(series,altitudeRange,toLeft),this.createSunLabels(series,toLeft),this.createTemperatureLabels(series,temperatureRange,toLeft,toTop),this.createSpotLabels(series,altitudeRange, toLeft,toTop),this.createRainLabels(series,toLeft)].join(""));this.positionGroundTooltip();this.updateOverlayVisibility()}}, {key:"createTemperatureLabels",value:function createTemperatureLabels(series,range,toLeft,toTop){var LABEL_OFFSET=18;return series.pointX.map(function(minutes,index){var value=series.pointY[index];return'\x3cspan class\x3d"label_tmpr" style\x3d"left:'.concat(toLeft(minutes).toFixed(2), "%; top:").concat((toTop(value,range)-LABEL_OFFSET).toFixed(1),'px"\x3e').concat(oCommon.fnMathRound(value),"\u00b0\x3c/span\x3e")}).join("")}}, {key:"createRainLabels",value:function createRainLabels(series,toLeft){var _this10=this;var hourly=this.waypointData.hourlyList||[];var dimMinutes=this.getDimRainMinutes(series.axisEnd);var html="";hourly.forEach(function(item){var minutes= _this10.getMinutesFromDeparture(item.aplYmdt);var amount=item.oneHourRainAmt;if(minutes==null||amount==null||amount==="")return;var numeric=parseFloat(amount);if(!isNaN(numeric)&&numeric===0)return;if(minutes<= series.axisEnd)html+='\x3cspan class\x3d"label_rain" style\x3d"left:'.concat(toLeft(minutes).toFixed(2),'%"\x3e\x3cstrong class\x3d"value"\x3e').concat(_.escape(amount),"\x3c/strong\x3e\x3c/span\x3e"); else if(minutes===dimMinutes)html+='\x3cspan class\x3d"label_rain dim"\x3e\x3c/span\x3e'}); return html}}, {key:"createSunLabels",value:function createSunLabels(series,toLeft){var _this11=this;var sunRiseSet=this.waypointData.sunRiseSet||[];var html="";sunRiseSet.forEach(function(item){[["sunrise",item.sriseTm, "\uc77c\ucd9c"],["sunset",item.ssetTm,"\uc77c\ubab0"]].forEach(function(_ref7){var _ref8=_slicedToArray(_ref7,3),type=_ref8[0],time=_ref8[1],text=_ref8[2];if(!time)return;var minutes=_this11.getSunMinutes(item.aplYmd, time);if(minutes==null||minutes<0||minutes>series.axisEnd)return;html+='\x3cspan class\x3d"label_'.concat(type,'" style\x3d"left:').concat(toLeft(minutes).toFixed(2),'%"\x3e\x3cspan class\x3d"text"\x3e').concat(text, "\x3c/span\x3e\x3c/span\x3e")})}); return html}}, {key:"getSunMinutes",value:function getSunMinutes(ymd,hhmm){if(!ymd||!hhmm||hhmm.length<4)return null;var base=this.getMinutesFromDeparture("".concat(ymd).concat(hhmm.substring(0,2)));return base==null? null:base+Number(hhmm.substring(2,4))}}, {key:"createSpotLabels",value:function createSpotLabels(series,range,toLeft,toTop){var _this12=this;var waypoints=this.waypointData.waypoints||[];var LABEL_OFFSET=14;var positioned=waypoints.filter(function(waypoint){return waypoint.elapsedMinutes!= null}).map(function(waypoint){return{index:waypoint.index, left:toLeft(waypoint.elapsedMinutes),top:toTop(waypoint.altitude,range)-LABEL_OFFSET}}); if(!positioned.length)return"";this.spreadSpotLabels(positioned,this.getGraphWidth(series.duration));return positioned.slice().reverse().map(function(spot){var size=spot.index===_this12.waypointIndex?"large": "small";return'\x3cspan class\x3d"spot_group" style\x3d"left:'.concat(spot.left.toFixed(2),"%; top:").concat(spot.top.toFixed(1),'px"\x3e')+'\x3cbutton type\x3d"button" class\x3d"label_spot '.concat(size, '" data-nlog\x3d"spot" data-waypoint-index\x3d"').concat(spot.index,'" data-nlog-area\x3d"leisure_hiking_course.spot_button" data-nlog-params\x3d\'{"waypoint":"').concat(spot.index,"\"}'\x3e").concat(spot.index, "\x3c/button\x3e")+"\x3c/span\x3e"}).join("")}}, {key:"spreadSpotLabels",value:function spreadSpotLabels(spots,graphWidth){if(!graphWidth||spots.length<2)return;var toPercent=function toPercent(px){return px/graphWidth*100}; var sorted=spots.slice().sort(function(a,b){return a.left-b.left}); var threshold=toPercent(lsurHikingCourse.SPOT_MIN_GAP);var clusters=[];sorted.forEach(function(spot){var last=clusters[clusters.length-1];if(last&&spot.left-last[last.length-1].left=lsurHikingCourse.SPOT_DENSE_COUNT?lsurHikingCourse.SPOT_DENSE_GAP:lsurHikingCourse.SPOT_MIN_GAP);var center= (cluster[0].left+cluster[cluster.length-1].left)/2;var start=center-gap*(cluster.length-1)/2;cluster.forEach(function(spot,order){spot.left=start+gap*order})})}}, {key:"createGroundTooltip",value:function createGroundTooltip(series,range,toLeft){var fcast=this.waypointData.fcast||{};if(!series.altitudeY.length||fcast.tmprAdjusted==null)return"";var peakIndex=0;series.altitudeY.forEach(function(altitude, index){if(altitude>series.altitudeY[peakIndex])peakIndex=index}); var adjust=series.altitudeY[peakIndex]*.01*.6;var left=toLeft(series.altitudeX[peakIndex]).toFixed(2);return'\n \x3cspan class\x3d"tooltip_tmpr"\x3e\n \x3cspan class\x3d"tooltip_inner" style\x3d"left:'.concat(left, '%"\x3e\n \x3cspan class\x3d"ico ico_wt').concat(fcast.wetrCd,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(_.escape(fcast.wetrTxt||""),'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"text"\x3e\uc9c0\uc0c1\ubcf4\ub2e4 -').concat(mathRound(adjust, 0),'\u00b0\x3c/span\x3e\n \x3c/span\x3e\n \x3cspan class\x3d"tooltip_line" aria-hidden\x3d"true" style\x3d"left:').concat(left,'%"\x3e\x3c/span\x3e\n \x3c/span\x3e\n ')}}, {key:"createSpotSlider",value:function createSpotSlider(){var waypoints=this.waypointData.waypoints||[];var items=waypoints.map(function(waypoint){return'\n \x3cli class\x3d"spot_item" data-waypoint-index\x3d"'.concat(waypoint.index, '"\x3e\n \x3cspan class\x3d"number"\x3e').concat(waypoint.index,'\x3c/span\x3e\n \x3cstrong class\x3d"name"\x3e').concat(_.escape(waypoint.name),"\x3c/strong\x3e\n \x3c/li\x3e\n ")}).join(""); return'\n \x3cdiv class\x3d"course_spot"\x3e\n \x3cdiv class\x3d"scroll_control" data-nlog\x3d"spot_scroll"\x3e\n \x3cdiv class\x3d"scroll_area" data-nlog-area\x3d"leisure_hiking_course.spot_scroll"\x3e\n \x3cul class\x3d"spot_list"\x3e'.concat(items, '\x3c/ul\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_prev" data-nlog-area\x3d"leisure_hiking_course.spot_scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_next" data-nlog-area\x3d"leisure_hiking_course.spot_scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ')}}, {key:"createWeatherSummary",value:function createWeatherSummary(){var fcast=this.waypointData.fcast||{};var tmpr=fcast.tmprAdjusted!=null?fcast.tmprAdjusted:fcast.tmpr;return'\n \x3cdiv class\x3d"weather_summary"\x3e\n '.concat(this.createSummaryItem("\uace0\ub3c4", this.formatNumber(fcast.altitude),"m"),"\n ").concat(this.createSummaryItem("\uc628\ub3c4",tmpr!=null?"".concat(oCommon.fnMathRound(tmpr),"\u00b0"):"-"),"\n ").concat(this.createSummaryItem("\uac15\uc218\ud655\ub960", fcast.rainProb!=null?fcast.rainProb:"-","%"),"\n ").concat(this.createSummaryItem("\uac15\uc218\ub7c9",fcast.oneHourRainAmt!=null?fcast.oneHourRainAmt:"-","mm"),"\n ").concat(this.createSummaryItem("\ubc14\ub78c", fcast.windSpd!=null?fcast.windSpd:"-","m/s"),"\n \x3c/div\x3e\n ")}}, {key:"createSummaryItem",value:function createSummaryItem(label,value,unit){return'\n \x3cdl class\x3d"summary_item"\x3e\n \x3cdt class\x3d"label"\x3e'.concat(label,'\x3c/dt\x3e\n \x3cdd\x3e\n \x3cspan class\x3d"value"\x3e').concat(value, "\x3c/span\x3e\n ").concat(unit?'\x3cspan class\x3d"unit"\x3e'.concat(unit,"\x3c/span\x3e"):"","\n \x3c/dd\x3e\n \x3c/dl\x3e\n ")}}, {key:"formatNumber",value:function formatNumber(value){return value!=null?Number(value).toLocaleString():"-"}}, {key:"initSpotScroll",value:function initSpotScroll(){this.moveSpotSlider();this.updateSpotArrowState()}}, {key:"moveSpotSlider",value:function moveSpotSlider(){var $list=this.element.find(".course_spot .spot_list");if(!$list.length)return;var index=Math.max(0,(this.waypointIndex||1)-1);$list.css({"transition":"none", "transform":"translateX(-".concat(index*100,"%)")})}}, {key:"updateSpotArrowState",value:function updateSpotArrowState(){var waypoints=this.waypointData.waypoints||[];var $control=this.element.find(".course_spot .scroll_control");$control.toggleClass("end_left", this.waypointIndex<=1);$control.toggleClass("end_right",this.waypointIndex>=waypoints.length)}}, {key:"createTimeSheet",value:function createTimeSheet(departure){var _dates$;var available=this.getSelectableYmdtSet(departure);var dates=this.getDepartureDates(_toConsumableArray(available));var selectedYmd= departure.selectedYmdt.substring(0,8);var activeYmd=dates.some(function(date){return date.ymd===selectedYmd})?selectedYmd:(_dates$=dates[0])===null||_dates$===void 0?void 0:_dates$.ymd; var dateHtml=dates.map(function(date,index){return'\n \x3cinput type\x3d"radio" class\x3d"blind" id\x3d"courseDate'.concat(index,'" name\x3d"courseDate"\n value\x3d"').concat(date.ymd, '" ').concat(date.ymd===activeYmd?"checked":"",' data-nlog-area\x3d"leisure_hiking_course.course_date_input" data-nlog-params\x3d\'{"date":"').concat(date.ymd,'"}\'/\x3e\n \x3clabel class\x3d"course_date" for\x3d"courseDate').concat(index, '"\x3e\n \x3cspan\x3e').concat(date.label,"\x3c/span\x3e\n \x3cspan\x3e").concat(date.dateText,"\x3c/span\x3e\n \x3c/label\x3e\n ")}).join(""); return'\n \x3cdiv class\x3d"bottom_sheet"\x3e\n \x3cdiv class\x3d"bottom_sheet_dimmed"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"bottom_sheet_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"handle_btn" data-nlog\x3d"time_sheet_handle" data-nlog-area\x3d"leisure_hiking_course.time_sheet_handle_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub3d9\uc791\x3c/span\x3e\n \x3c/button\x3e\n \x3cem class\x3d"title"\x3e\ucd9c\ubc1c \uc2dc\uac04\x3c/em\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"course_time_selector"\x3e\n \x3cdiv class\x3d"course_dates"\x3e'.concat(dateHtml, '\x3c/div\x3e\n \x3cem class\x3d"hour_title"\x3e\uc2dc\uac04\x3c/em\x3e\n \x3cdiv class\x3d"course_hours"\x3e').concat(this.createHourGrid(activeYmd, available,departure.selectedYmdt),'\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"course_time_apply"\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_apply" data-nlog-area\x3d"leisure_hiking_course.apply_button"\x3e\uc801\uc6a9\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-nlog\x3d"time_sheet_close" data-nlog-area\x3d"leisure_hiking_course.time_sheet_close_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ')}}, {key:"createHourGrid",value:function createHourGrid(ymd,available,selectedYmdt){var html="";for(var hour=0;hour<24;hour++){var hourText=String(hour).padStart(2,"0");var ymdt="".concat(ymd).concat(hourText); var disabled=available.has(ymdt)?"":"disabled";var checked=ymdt===selectedYmdt?"checked":"";html+='\n \x3cinput type\x3d"radio" class\x3d"blind" id\x3d"courseTime'.concat(hour,'" name\x3d"courseTime"\n value\x3d"').concat(ymdt, '" ').concat(disabled," ").concat(checked,' data-nlog-area\x3d"leisure_hiking_course.course_time_input" data-nlog-params\x3d\'{"date":"').concat(ymd,'","hour":"').concat(hourText,'"}\'/\x3e\n \x3clabel class\x3d"course_hour" for\x3d"courseTime').concat(hour, '"\x3e').concat(hourText,":00\x3c/label\x3e\n ")}return html}}, {key:"getSelectableYmdtSet",value:function getSelectableYmdtSet(departure){var _this13=this;var list=(departure===null||departure===void 0?void 0:departure.availableYmdtList)||[];if(!list.length)return new Set; var limit=this.toDate(list[0]).getTime()+lsurHikingCourse.MAX_DEPARTURE_HOURS*60*60*1E3;return new Set(list.filter(function(ymdt){return _this13.toDate(ymdt).getTime()waypoints.length)return;this.selectWaypoint(next)}}, {key:"selectWaypoint",value:function selectWaypoint(index){var _this16=this;if(!index||index===this.waypointIndex)return;var seq=++this.waypointRequestSeq;var applied=false;this.waypointIndex=index;var waypointParam= {"lsurRgnCd":this.selectedCourseCd,"waypointIndex":index};if(this.departureYmdt)waypointParam.departureYmdt=this.departureYmdt;oBlockScriptService.ajaxChoiceApi({"hikingCourseWaypoint":waypointParam},function(result){if(seq!== _this16.waypointRequestSeq)return;var waypointData=result===null||result===void 0?void 0:result.hikingCourseWaypoint;if(_.isEmpty(waypointData))return;applied=true;_this16.waypointData=waypointData;_this16.waypointIndex= waypointData.selectedWaypointIndex;_this16.element.find(".weather_summary").replaceWith(_this16.createWeatherSummary());_this16.updateSpotSelection()},function(){var _this16$waypointData; if(seq!==_this16.waypointRequestSeq||applied)return;_this16.waypointIndex=(_this16$waypointData=_this16.waypointData)===null||_this16$waypointData===void 0?void 0:_this16$waypointData.selectedWaypointIndex})}}, {key:"updateSpotSelection",value:function updateSpotSelection(){var _this17=this;this.element.find(".course_spot .spot_item").each(function(index,element){var $item=$(element);$item.toggleClass("on",$item.data("waypoint-index")=== _this17.waypointIndex)}); this.scrollGraphToWaypoint(this.waypointIndex);this.moveSpotSlider();this.element.find(".course_graph_custom .label_spot").each(function(index,element){var $spot=$(element);var selected=$spot.data("waypoint-index")=== _this17.waypointIndex;$spot.toggleClass("large",selected).toggleClass("small",!selected)}); this.updateSpotArrowState()}}, {key:"renderHourGrid",value:function renderHourGrid(ymd){if(!ymd)return;var available=this.getSelectableYmdtSet(this.waypointData.departure);this.element.find(".course_hours").html(this.createHourGrid(ymd, available,this.departureYmdt))}}, {key:"applyDeparture",value:function applyDeparture(){var selected=this.element.find('input[name\x3d"courseTime"]:checked').val();this.closeTimeSheet();if(!selected||selected===this.departureYmdt)return; this.departureYmdt=selected;this.ajaxWaypoint()}}, {key:"initCourseSheet",value:function initCourseSheet(){var _this18=this,_this$templateInfo$in,_this$templateInfo;var $sheet=this.element.find(".course_list .bottom_sheet");if(!$sheet.length||(typeof oBottomSheet=== "undefined"?"undefined":_typeof(oBottomSheet))!=="object")return;this.courseSheet=oBottomSheet.create($sheet,{halfViewHeight:60,halfViewMaxHeightPx:480,minHeightPx:lsurHikingCourse.SHEET_MIN_HEIGHT,fitContent:true, onClose:function onClose(){var _this18$courseSheet;clearTimeout(_this18.courseSheetCloseTimer);var hide=function hide(){_this18.element.find(".course_list .btn_course_open").attr("aria-pressed",false); _this18.syncBodyScrollLock()}; if(!((_this18$courseSheet=_this18.courseSheet)===null||_this18$courseSheet===void 0?void 0:_this18$courseSheet.isMobile())){hide();return}_this18.courseSheetCloseTimer=setTimeout(hide,lsurHikingCourse.SHEET_ANIMATION_MS)}}); this.courseSheet.disableScroll=function(){}; this.courseSheet.enableScroll=function(){}; oBottomSheet.register("hikingCourseSheet_".concat((_this$templateInfo$in=(_this$templateInfo=this.templateInfo)===null||_this$templateInfo===void 0?void 0:_this$templateInfo.index)!==null&&_this$templateInfo$in!== void 0?_this$templateInfo$in:""),this.courseSheet)}}, {key:"isCourseSheetOpen",value:function isCourseSheetOpen(){return this.element.find(".course_list .btn_course_open").attr("aria-pressed")==="true"}}, {key:"syncBodyScrollLock",value:function syncBodyScrollLock(){var width=window.innerWidth;var courseLocked=width=lsurHikingCourse.WIDE_BREAKPOINT; var crossedBreakpoint=this.lastIsWide!==undefined&&this.lastIsWide!==isWide;var graphWidth=(_this$element$find$ge=this.element.find(".weather_graph").get(0))===null||_this$element$find$ge===void 0?void 0: _this$element$find$ge.clientWidth;this.lastIsWide=isWide;if(graphWidth!==this.lastGraphWidth){this.lastGraphWidth=graphWidth;this.redrawGraphDebounced()}if(crossedBreakpoint)this.closeCourseSheet();(_this$timeSheet3= this.timeSheet)===null||_this$timeSheet3===void 0?void 0:_this$timeSheet3.handleResize(sizeType,isChanged);(_this$courseSheet3=this.courseSheet)===null||_this$courseSheet3===void 0?void 0:_this$courseSheet3.handleResize({deviceType:isWide? "Pc":"Tablet"},crossedBreakpoint);this.syncBodyScrollLock();this.initSpotScroll()}}, {key:"redrawGraphDebounced",value:function redrawGraphDebounced(){var _this21=this;clearTimeout(this.redrawTimer);this.redrawTimer=setTimeout(function(){return _this21.renderGraph()},200)}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"destroy",value:function destroy(){clearTimeout(this.overlayTimer);clearTimeout(this.redrawTimer);if(this.scrollFrame){cancelAnimationFrame(this.scrollFrame);this.scrollFrame=null}if(this.chart){this.chart.destroy(); this.chart=null}$(document).off(".hikingTimeSheet");clearTimeout(this.courseSheetCloseTimer);clearTimeout(this.timeSheetCloseTimer);if(this.courseSheet){this.courseSheet.destroy();this.courseSheet=null}if(this.timeSheet){this.timeSheet.destroy(); this.timeSheet=null}this.closeTimeSheet();this.closeCourseSheet();if(_get(_getPrototypeOf(lsurHikingCourse.prototype),"destroy",this))_get(_getPrototypeOf(lsurHikingCourse.prototype),"destroy",this).call(this)}}]); return lsurHikingCourse}(BlockTemplate); lsurHikingCourse.WIDE_BREAKPOINT=840;lsurHikingCourse.POPUP_BREAKPOINT=1200;lsurHikingCourse.HOUR_WIDTH=115;lsurHikingCourse.FIXED_SCALE_DURATION=120;lsurHikingCourse.CHART_PADDING_LEFT=46; lsurHikingCourse.CHART_PADDING_RIGHT=14;lsurHikingCourse.CHART_PADDING_TOP=10;lsurHikingCourse.X_AXIS_HEIGHT=21;lsurHikingCourse.X_TICK_Y1=.5;lsurHikingCourse.X_TICK_Y2=4.5; lsurHikingCourse.SIDE_PADDING=26;lsurHikingCourse.SPOT_MIN_GAP=10;lsurHikingCourse.SPOT_DENSE_COUNT=4;lsurHikingCourse.SPOT_DENSE_GAP=3;lsurHikingCourse.MIN_SCROLL_GAIN=10; lsurHikingCourse.DRAG_THRESHOLD=5;lsurHikingCourse.SCROLL_LOCK_CLASS="_cnNotScrollHikingCourse";lsurHikingCourse.PROFILE_POINTS_PER_PX=.2;lsurHikingCourse.SHEET_ANIMATION_MS=300; lsurHikingCourse.MAX_DEPARTURE_HOURS=48;lsurHikingCourse.SHEET_MIN_HEIGHT=292;lsurHikingCourse.TIME_SHEET_HEIGHT=543;lsurHikingCourse.DATE_LABELS=["\uc624\ub298","\ub0b4\uc77c","\ubaa8\ub808"]; lsurHikingCourse.DAY_MS=24*60*60*1E3;function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i0}}, {key:"getBloomSeasonElement",value:function getBloomSeasonElement(){return $('[data-template\x3d"'.concat(lsurNowSynthesisFcast.BLOOM_SEASON_TEMPLATE,'"]'))}}, {key:"moveToBloomSeason",value:function moveToBloomSeason(){if(!this.isBloomSeasonLandable())return;this.getBloomSeasonElement()[0].scrollIntoView({behavior:"smooth",block:"start"})}}, {key:"getLifeIndexDataWithLevelClass",value:function getLifeIndexDataWithLevelClass(){var _this$templateData3;var lifeIndexData=(_this$templateData3=this.templateData)===null||_this$templateData3===void 0? void 0:_this$templateData3.lifeIndexData;if(!(lifeIndexData===null||lifeIndexData===void 0?void 0:lifeIndexData.labelText))return lifeIndexData;var labelText=lifeIndexData.labelText;var uvGrade=Object.values(this.UVGradeInfo).find(function(grade){return grade.legend=== labelText}); return _objectSpread({},lifeIndexData,{levelClass:uvGrade?uvGrade.levelClass:"level5_1"})}}, {key:"getLsurThemeSummary",value:function getLsurThemeSummary(nowFcast){var lsurRgnCd=(nowFcast===null||nowFcast===void 0?void 0:nowFcast.lsurRgnCd)||sRegionCode;if(!lsurRgnCd)return null;if(oCodeUtil.isBaseball(lsurRgnCd))return this.getSportGameSummary(nowFcast); if(oCodeUtil.isFootball(lsurRgnCd))return this.getSportGameSummary(nowFcast);if(oCodeUtil.isThemePark(lsurRgnCd))return this.getThemeParkSummary(nowFcast);if(oCodeUtil.isSkiResort(lsurRgnCd))return this.getSkiResortSummary(nowFcast); if(oCodeUtil.isGolf(lsurRgnCd))return this.getGolfSummary(nowFcast);if(oCodeUtil.isMountain(lsurRgnCd))return this.getHikingSummary(nowFcast);return null}}, {key:"getSportGameSummary",value:function getSportGameSummary(nowFcast){var _this$templateData4;var sportGameList=((_this$templateData4=this.templateData)===null||_this$templateData4===void 0?void 0:_this$templateData4.sportGameList)|| [];var selectedGame=this.selectGame(sportGameList);var gameStatus=this.makeGameStatus(selectedGame);var gameMsg=this.makeGameMsg(selectedGame,nowFcast,gameStatus);var lsurRgnCd=(nowFcast===null||nowFcast=== void 0?void 0:nowFcast.lsurRgnCd)||sRegionCode;return{lsurType:oCodeUtil.getLsurTypeKey(sRegionCode),gameStatus:gameStatus,gameMsg:gameMsg,isDomeStadium:oCodeUtil.isBaseball(lsurRgnCd)?this.isDomeStadium(selectedGame): false}}}, {key:"getThemeParkSummary",value:function getThemeParkSummary(nowFcast){var _this$templateData5,_lsurRegion$externalS;var themeMsg=this.makeThemeParkMsg(nowFcast);var lsurRegion=(_this$templateData5=this.templateData)=== null||_this$templateData5===void 0?void 0:_this$templateData5.lsurRegion;var targetURLs=lsurRegion===null||lsurRegion===void 0?void 0:(_lsurRegion$externalS=lsurRegion.externalServiceInfo)===null||_lsurRegion$externalS=== void 0?void 0:_lsurRegion$externalS.targetURL;var targetURL=deviceType==="pc"?targetURLs===null||targetURLs===void 0?void 0:targetURLs.pc:targetURLs===null||targetURLs===void 0?void 0:targetURLs.mobile; return{lsurType:oCodeUtil.getLsurTypeKey(sRegionCode),lsurRgnCd:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurRgnCd)||null,lsurNm:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurNm)|| null,cardMsg:(themeMsg===null||themeMsg===void 0?void 0:themeMsg.cardMsg)||null,targetURL:targetURL||null}}}, {key:"isDomeStadium",value:function isDomeStadium(selectedGame){try{var _this$templateInfo$cu2;if(!selectedGame||!selectedGame.stadium)return false;var domedStadiumList=(_this$templateInfo$cu2=this.templateInfo.customInfo)=== null||_this$templateInfo$cu2===void 0?void 0:_this$templateInfo$cu2.domedStadiumList;if(!domedStadiumList||!Array.isArray(domedStadiumList))return false;return domedStadiumList.includes(selectedGame.stadium)}catch(error){return false}}}, {key:"selectGame",value:function selectGame(sportGameList){try{if(!sportGameList||!Array.isArray(sportGameList)||sportGameList.length===0)return null;if(sportGameList.length===1){var _sportGameList=_slicedToArray(sportGameList, 1),firstGame=_sportGameList[0];return firstGame||null}var _sportGameList2=_slicedToArray(sportGameList,2),firstRoundGame=_sportGameList2[0],secondRoundGame=_sportGameList2[1];if(!firstRoundGame)return secondRoundGame|| null;return this.selectGameByStatus(firstRoundGame,secondRoundGame)}catch(error){var _firstGame=sportGameList===null||sportGameList===void 0?void 0:sportGameList[0];return _firstGame||null}}}, {key:"selectGameByStatus",value:function selectGameByStatus(firstRoundGame,secondRoundGame){if(!firstRoundGame)return secondRoundGame||null;var firstRoundStatus=firstRoundGame.statusCode;var isFirstRoundSuspended= firstRoundGame.suspended===true;var isFirstRoundCancelled=firstRoundGame.cancel===true;if(isFirstRoundCancelled)return secondRoundGame||firstRoundGame;if(isFirstRoundSuspended)return firstRoundGame;if(["BEFORE", "READY","STARTED"].includes(firstRoundStatus))return firstRoundGame;if(["ENDED","RESULT"].includes(firstRoundStatus))return secondRoundGame||firstRoundGame;return firstRoundGame}}, {key:"getPM10Grade",value:function getPM10Grade(value){if(value===0)return this.AirGradeInfo.NONE;if(value<=30)return this.AirGradeInfo.GOOD;else if(value<=80)return this.AirGradeInfo.NORMAL;else if(value<= 150)return this.AirGradeInfo.BAD;else return this.AirGradeInfo.VERY_BAD}}, {key:"getPM25Grade",value:function getPM25Grade(value){if(value===0)return this.AirGradeInfo.NONE;if(value<=15)return this.AirGradeInfo.GOOD;else if(value<=35)return this.AirGradeInfo.NORMAL;else if(value<= 75)return this.AirGradeInfo.BAD;else return this.AirGradeInfo.VERY_BAD}}, {key:"sortCardInfo",value:function sortCardInfo(customInfo,nowFcast){var visibleCards=[];if(!customInfo||Object.keys(customInfo).length===0)customInfo={rainCard:"conditional",rainScore:"7",stmprCard:"on", stmprScore:"10",windCard:"on",windScore:"9",uvCard:"conditional",uvScore:"8",visibilityCard:"on",visibilityScore:"4",humdCard:"on",humdScore:"7",pm10Card:"on",pm10Score:"6",pm25Card:"on",pm25Score:"5"}; for(var key in customInfo)if(key.endsWith("Card")){var cardName=key.replace("Card","");var status=this.checkVisibleCard(cardName,customInfo[key],nowFcast);var scoreKey="".concat(cardName,"Score");var score= this.calcAdditionalScore(cardName,parseInt(customInfo[scoreKey],10),nowFcast);if(status==="on")visibleCards.push({name:cardName,score:score})}visibleCards.sort(function(a,b){return b.score-a.score}); return visibleCards}}, {key:"checkVisibleCard",value:function checkVisibleCard(cardName,status,nowFcast){var visibleStatus=status;if(status==="conditional"){var rainAmt=nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt; switch(cardName){case "rain":visibleStatus=parseFloat(rainAmt)>0?"on":"off";break;case "uv":visibleStatus=parseFloat(rainAmt)>0?"off":"on";break;default:break}}return visibleStatus}}, {key:"calcAdditionalScore",value:function calcAdditionalScore(cardName,score,nowFcast){var _this$templateData7;var defaultScores={"rain":7,"stmpr":10,"wind":9,"uv":8,"humd":7,"pm10":6,"pm25":5};var cardScore= isNaN(score)?defaultScores[cardName]||0:score;try{var _this$templateData6;var airFcast=(_this$templateData6=this.templateData)===null||_this$templateData6===void 0?void 0:_this$templateData6.airFcast;switch(cardName){case "rain":var rainAmt= parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt);if(!isNaN(rainAmt)){var additionalScore=0;if(rainAmt>0)additionalScore=10;cardScore=isNaN(score)?(defaultScores[cardName]|| 0)+additionalScore:score+additionalScore}break;case "uv":var lifeIndexData=((_this$templateData7=this.templateData)===null||_this$templateData7===void 0?void 0:_this$templateData7.lifeIndexData)||{};var uvFigure= parseFloat(lifeIndexData===null||lifeIndexData===void 0?void 0:lifeIndexData.figure);if(!isNaN(uvFigure)){var _additionalScore=0;if(uvFigure>=6)_additionalScore=10;cardScore=isNaN(score)?(defaultScores[cardName]|| 0)+_additionalScore:score+_additionalScore}break;case "pm10":if(airFcast&&(airFcast.stationPM10!=null||airFcast.stationPM25!=null)){var pm10Grade=airFcast.stationPM10!=null?this.getPM10Grade(airFcast.stationPM10): null;var _additionalScore2=0;if(pm10Grade&&pm10Grade===this.AirGradeInfo.VERY_BAD||pm10Grade&&pm10Grade===this.AirGradeInfo.BAD)_additionalScore2=20;cardScore=isNaN(score)?(defaultScores[cardName]||0)+ _additionalScore2:score+_additionalScore2}break;case "pm25":if(airFcast&&(airFcast.stationPM10!=null||airFcast.stationPM25!=null)){var pm25Grade=airFcast.stationPM25!=null?this.getPM25Grade(airFcast.stationPM25): null;var _additionalScore3=0;if(pm25Grade&&pm25Grade===this.AirGradeInfo.VERY_BAD||pm25Grade&&pm25Grade===this.AirGradeInfo.BAD)_additionalScore3=30;cardScore=isNaN(score)?(defaultScores[cardName]||0)+ _additionalScore3:score+_additionalScore3}break;default:break}}catch(e){return cardScore}return cardScore}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".main_card_bottom ._cnWeatherInfoLayer",$.proxy(this.openInfoLayer,this));this.element.on("click",".main_card_bottom .btn_close", $.proxy(this.closeAllLayer,this));this.element.on("click",".sub_card ._cnWeatherInfoLayer",$.proxy(this.openInfoLayer,this));this.element.on("click",".sub_card .btn_close",$.proxy(this.closeAllLayer,this)); this.element.on("click","._cnBloomSeasonLanding",$.proxy(this.moveToBloomSeason,this))}}, {key:"openInfoLayer",value:function openInfoLayer(e){var $target=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(isOpen===false)oCommon.fnOpenInfoLayer($target)}}, {key:"closeAllLayer",value:function closeAllLayer(){oCommon.fnCloseAllInfoLayer()}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"initAfter",value:function initAfter(){this.initScroll()}}, {key:"scrollToElementByDay",value:function scrollToElementByDay(days){var localDateTime=moment();var aplYmdt=localDateTime.add(days,"days").format("YYYYMMDD")+"00";oBlockScriptService.callTemplateFunc("hourlyFcast", "scrollToElementByDay",aplYmdt,500,false)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(this.element.css("display")!=="none")this.resetScroll()}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){return{hasMainCardData:{fields:["nowFcastList.0.tmpr","nowFcastList.0.wetrCd","nowFcastList.0.wetrTxt","nowFcastList.0.ytmpr","weeklyFcastList.0.minTmpr", "weeklyFcastList.0.maxTmpr"],operator:"AND"},stmprData:{fields:["nowFcastList.0.stmpr"]},windData:{fields:["nowFcastList.0.windSpd"]},uvData:{fields:["lifeIndexData.figure","lifeIndexData.labelText"],operator:"AND"}, humdData:{fields:["nowFcastList.0.humd"]},pm10Data:{fields:["airFcast.stationPM10"]},pm25Data:{fields:["airFcast.stationPM25"]},rainData:{fields:["nowFcastList.0.oneHourRainAmt"]}}}}, {key:"makeGameStatus",value:function makeGameStatus(selectedGame){try{if(!selectedGame)return this.GameStatus.NO_GAME;var statusCode=selectedGame.statusCode,cancel=selectedGame.cancel,suspended=selectedGame.suspended; if(cancel===true)return this.GameStatus.CANCELLED;if(suspended===true)return this.GameStatus.SUSPENDED;switch(statusCode){case "BEFORE":case "READY":return this.GameStatus.BEFORE;case "STARTED":return this.GameStatus.PLAYING; case "ENDED":case "RESULT":return this.GameStatus.FINISHED;default:return this.GameStatus.NO_GAME}}catch(error){return this.GameStatus.NO_GAME}}}, {key:"makeGameMsg",value:function makeGameMsg(selectedGame,nowFcast,gameStatus){var lsurRgnCd=(nowFcast===null||nowFcast===void 0?void 0:nowFcast.lsurRgnCd)||sRegionCode;var isFootball=oCodeUtil.isFootball(lsurRgnCd); try{switch(gameStatus){case this.GameStatus.FINISHED:return isFootball?this.FootballGameMsg.FINISHED:this.BaseballGameMsg.FINISHED;case this.GameStatus.CANCELLED:return isFootball?this.FootballGameMsg.CANCELLED: this.BaseballGameMsg.CANCELLED;case this.GameStatus.SUSPENDED:return isFootball?this.FootballGameMsg.SUSPENDED:this.BaseballGameMsg.SUSPENDED;case this.GameStatus.NO_GAME:return isFootball?this.FootballGameMsg.NO_GAME: this.BaseballGameMsg.NO_GAME}if(gameStatus===this.GameStatus.BEFORE)return isFootball?this.getBeforeFootballGameMsg(selectedGame):this.getBeforeBaseballGameMsg(selectedGame);if(gameStatus===this.GameStatus.PLAYING)return isFootball? this.FootballGameMsg.PLAYING:this.getPlayingBaseballGameMsg(nowFcast);return isFootball?this.FootballGameMsg.NO_GAME:this.BaseballGameMsg.NO_GAME}catch(error){return isFootball?this.FootballGameMsg.NO_GAME: this.BaseballGameMsg.NO_GAME}}}, {key:"getBeforeBaseballGameMsg",value:function getBeforeBaseballGameMsg(selectedGame){var _this$templateData8,_nowFcastList$,_nowFcastList$2;if(!selectedGame||!selectedGame.gameDateTime)return this.BaseballGameMsg.BEFORE_SIX; var now=moment();var gameDateTime=moment(selectedGame.gameDateTime);var hoursUntilGame=gameDateTime.diff(now,"hours",true);if(hoursUntilGame>6)return this.BaseballGameMsg.BEFORE_SIX;var nowFcastList=((_this$templateData8= this.templateData)===null||_this$templateData8===void 0?void 0:_this$templateData8.nowFcastList)||[];var currentRainAmt=parseFloat((_nowFcastList$=nowFcastList[0])===null||_nowFcastList$===void 0?void 0: _nowFcastList$.oneHourRainAmt)||0;var nextHourRainAmt=parseFloat((_nowFcastList$2=nowFcastList[1])===null||_nowFcastList$2===void 0?void 0:_nowFcastList$2.oneHourRainAmt)||0;var rainAmt=currentRainAmt+ nextHourRainAmt;if(rainAmt<3)return this.BaseballGameMsg.BEFORE_START;else if(rainAmt>=3&&rainAmt<7.5)return this.BaseballGameMsg.BEFORE_START_RAIN_LOW;else if(rainAmt>=7.5&&rainAmt<15)return this.BaseballGameMsg.BEFORE_START_RAIN_MEDIUM; else return this.BaseballGameMsg.BEFORE_START_RAIN_HIGH}}, {key:"getBeforeFootballGameMsg",value:function getBeforeFootballGameMsg(selectedGame){var _this$templateData9,_nowFcastList$3,_nowFcastList$4;if(!selectedGame||!selectedGame.gameDateTime)return this.FootballGameMsg.BEFORE_TWO; var now=moment();var gameDateTime=moment(selectedGame.gameDateTime);var hoursUntilGame=gameDateTime.diff(now,"hours",true);if(hoursUntilGame>2)return this.FootballGameMsg.BEFORE_TWO;var nowFcastList=((_this$templateData9= this.templateData)===null||_this$templateData9===void 0?void 0:_this$templateData9.nowFcastList)||[];var currentRainAmt=parseFloat((_nowFcastList$3=nowFcastList[0])===null||_nowFcastList$3===void 0?void 0: _nowFcastList$3.oneHourRainAmt)||0;var nextHourRainAmt=parseFloat((_nowFcastList$4=nowFcastList[1])===null||_nowFcastList$4===void 0?void 0:_nowFcastList$4.oneHourRainAmt)||0;var rainAmt=currentRainAmt+ nextHourRainAmt;if(rainAmt<3)return this.FootballGameMsg.BEFORE_START;else return this.FootballGameMsg.BEFORE_START_RAIN}}, {key:"getPlayingBaseballGameMsg",value:function getPlayingBaseballGameMsg(nowFcast){var rainAmt=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt)||0;if(rainAmt<3)return this.BaseballGameMsg.PLAYING; else return this.BaseballGameMsg.PLAYING_RAIN}}, {key:"getGolfSummary",value:function getGolfSummary(nowFcast){var _this$templateData0;var lsurRgnCd=(nowFcast===null||nowFcast===void 0?void 0:nowFcast.lsurRgnCd)||sRegionCode;var golfMsg=this.makeGolfMsg(nowFcast); var lsurRegion=(_this$templateData0=this.templateData)===null||_this$templateData0===void 0?void 0:_this$templateData0.lsurRegion;var visibilityData=this.getGolfVisibilityData(nowFcast);return{lsurType:oCodeUtil.getLsurTypeKey(lsurRgnCd), lsurRgnCd:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurRgnCd)||null,lsurNm:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurNm)||null,cardMsg:(golfMsg===null||golfMsg===void 0? void 0:golfMsg.cardMsg)||null,visibility:visibilityData}}}, {key:"getGolfVisibilityData",value:function getGolfVisibilityData(nowFcast){var _visibilitySource;var visibility=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.visibility);var visibilitySource= nowFcast;if(isNaN(visibility)||visibility<0){var _this$templateData1;var nowFcastList=((_this$templateData1=this.templateData)===null||_this$templateData1===void 0?void 0:_this$templateData1.nowFcastList)|| [];var found=nowFcastList.find(function(f){return!isNaN(parseFloat(f===null||f===void 0?void 0:f.visibility))&&parseFloat(f===null||f===void 0?void 0:f.visibility)>=0}); if(found){visibility=parseFloat(found.visibility);visibilitySource=found}else return null}var accuweatherUdtYmdt=(_visibilitySource=visibilitySource)===null||_visibilitySource===void 0?void 0:_visibilitySource.accuweatherUdtYmdt; if(accuweatherUdtYmdt){var updateMoment=moment(accuweatherUdtYmdt,"YYYYMMDDHHmmss").utcOffset("+09:00",true);var sixHoursAgo=moment.utc().utcOffset("+09:00").subtract(6,"hours");if(updateMoment.isBefore(sixHoursAgo))return null}var gradeInfo= this.GolfVisibilityGrade.find(function(g){return visibility<=g.max}); return{value:visibility.toFixed(1),grade:gradeInfo.grade,label:gradeInfo.label,message:gradeInfo.message,detail:gradeInfo.detail,defaultOpen:gradeInfo.grade>=5,updateTime:accuweatherUdtYmdt?moment(accuweatherUdtYmdt, "YYYYMMDDHHmmss").format("YYYY.MM.DD. HH:mm"):""}}}, {key:"makeGolfMsg",value:function makeGolfMsg(nowFcast){var rainAmt=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt)||0;if(rainAmt>=3)return this.GolfMsg.HEAVY_RAIN;var wetrCd= String((nowFcast===null||nowFcast===void 0?void 0:nowFcast.wetrCd)||"");if(wetrCd==="18")return this.GolfMsg.THUNDER;var windSpd=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.windSpd)|| 0;if(windSpd>=10)return this.GolfMsg.STRONG_WIND;if(rainAmt>=.1)return this.GolfMsg.LIGHT_RAIN;if(windSpd>=5)return this.GolfMsg.MODERATE_WIND;var humd=parseFloat(nowFcast===null||nowFcast===void 0?void 0: nowFcast.humd)||0;if(humd>=80)return this.GolfMsg.HIGH_HUMIDITY;return this.GolfMsg.DEFAULT}}, {key:"makeThemeParkMsg",value:function makeThemeParkMsg(nowFcast){var _this$templateData10,_this$templateData10$,_this$templateData11;var rainAmt=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt)|| 0;var wetrCd=String((nowFcast===null||nowFcast===void 0?void 0:nowFcast.wetrCd)||"");if(rainAmt>=.1||lsurNowSynthesisFcast.WEATHER_CODES.RAIN.includes(wetrCd)||lsurNowSynthesisFcast.WEATHER_CODES.SNOW.includes(wetrCd))return this.ThemeParkMsg.RAIN; var windSpd=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.windSpd)||0;if(windSpd>=10)return this.ThemeParkMsg.STRONG_WIND;var uvFigure=parseFloat((_this$templateData10=this.templateData)=== null||_this$templateData10===void 0?void 0:(_this$templateData10$=_this$templateData10.lifeIndexData)===null||_this$templateData10$===void 0?void 0:_this$templateData10$.figure)||0;if(uvFigure>=6)return this.ThemeParkMsg.HIGH_UV; var airFcast=(_this$templateData11=this.templateData)===null||_this$templateData11===void 0?void 0:_this$templateData11.airFcast;if(airFcast){var pm10Grade=airFcast.stationPM10!=null?this.getPM10Grade(airFcast.stationPM10): null;var pm25Grade=airFcast.stationPM25!=null?this.getPM25Grade(airFcast.stationPM25):null;if(pm10Grade&&(pm10Grade===this.AirGradeInfo.BAD||pm10Grade===this.AirGradeInfo.VERY_BAD)||pm25Grade&&(pm25Grade=== this.AirGradeInfo.BAD||pm25Grade===this.AirGradeInfo.VERY_BAD))return this.ThemeParkMsg.BAD_AIR}return this.ThemeParkMsg.GOOD_WEATHER}}, {key:"getSkiResortSummary",value:function getSkiResortSummary(nowFcast){var _this$templateData12;var skiResortMsg=this.makeSkiResortMsg(nowFcast);var lsurRegion=(_this$templateData12=this.templateData)=== null||_this$templateData12===void 0?void 0:_this$templateData12.lsurRegion;return{lsurType:oCodeUtil.getLsurTypeKey(sRegionCode),lsurRgnCd:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurRgnCd)|| null,lsurNm:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurNm)||null,cardMsg:(skiResortMsg===null||skiResortMsg===void 0?void 0:skiResortMsg.cardMsg)||null}}}, {key:"isSkiSeason",value:function isSkiSeason(){var currentMonth=moment().month()+1;return currentMonth===12||currentMonth<=3}}, {key:"makeSkiResortMsg",value:function makeSkiResortMsg(nowFcast){var _this$templateData13,_this$templateData13$;if(!this.isSkiSeason())return this.SkiResortMsg.DEFAULT_OFF_SEASON;var windSpd=parseFloat(nowFcast=== null||nowFcast===void 0?void 0:nowFcast.windSpd)||0;if(windSpd>=10)return this.SkiResortMsg.STRONG_WIND;var stmpr=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.stmpr);if(!isNaN(stmpr)&& stmpr<=-10)return this.SkiResortMsg.COLD_WAVE;var oneHourRainAmt=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt)||0;var wetrCd=String((nowFcast===null||nowFcast===void 0?void 0: nowFcast.wetrCd)||"");if(oneHourRainAmt>=1&&lsurNowSynthesisFcast.WEATHER_CODES.SNOW.includes(wetrCd))return this.SkiResortMsg.GOOD_SNOW;var uvFigure=parseFloat((_this$templateData13=this.templateData)=== null||_this$templateData13===void 0?void 0:(_this$templateData13$=_this$templateData13.lifeIndexData)===null||_this$templateData13$===void 0?void 0:_this$templateData13$.figure)||0;if(uvFigure>=4)return this.SkiResortMsg.HIGH_UV; return this.SkiResortMsg.DEFAULT_SEASON}}, {key:"getHikingSummary",value:function getHikingSummary(nowFcast){var _this$templateData14;var lsurRgnCd=(nowFcast===null||nowFcast===void 0?void 0:nowFcast.lsurRgnCd)||sRegionCode;var hikingMsg=this.makeHikingMsg(nowFcast); var lsurRegion=(_this$templateData14=this.templateData)===null||_this$templateData14===void 0?void 0:_this$templateData14.lsurRegion;return{lsurType:oCodeUtil.getLsurTypeKey(lsurRgnCd),lsurRgnCd:(lsurRegion=== null||lsurRegion===void 0?void 0:lsurRegion.lsurRgnCd)||null,lsurNm:(lsurRegion===null||lsurRegion===void 0?void 0:lsurRegion.lsurNm)||null,cardMsg:(hikingMsg===null||hikingMsg===void 0?void 0:hikingMsg.cardMsg)|| null}}}, {key:"makeHikingMsg",value:function makeHikingMsg(nowFcast){var _this$templateData15,_this$templateData16;var warnTypeList=(((_this$templateData15=this.templateData)===null||_this$templateData15===void 0? void 0:_this$templateData15.warnList)||[]).map(function(warn){return warn===null||warn===void 0?void 0:warn.stypeEnNm}).filter(function(stypeEnNm){return stypeEnNm}); var warnPriority=[{stypeEnNm:"rain",hikingMsg:this.HikingMsg.WARN_RAIN},{stypeEnNm:"snow",hikingMsg:this.HikingMsg.WARN_SNOW},{stypeEnNm:"wind",hikingMsg:this.HikingMsg.WARN_WIND},{stypeEnNm:"dry",hikingMsg:this.HikingMsg.WARN_DRY}]; var matchedWarn=warnPriority.find(function(warn){return warnTypeList.includes(warn.stypeEnNm)}); if(matchedWarn)return matchedWarn.hikingMsg;var oneHourRainAmt=parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.oneHourRainAmt)||0;if(oneHourRainAmt>=3)return this.HikingMsg.HEAVY_RAIN;var windSpd= parseFloat(nowFcast===null||nowFcast===void 0?void 0:nowFcast.windSpd)||0;if(windSpd>=10)return this.HikingMsg.STRONG_WIND;var airFcast=(_this$templateData16=this.templateData)===null||_this$templateData16=== void 0?void 0:_this$templateData16.airFcast;var pm10Grade=(airFcast===null||airFcast===void 0?void 0:airFcast.stationPM10)!=null?this.getPM10Grade(airFcast.stationPM10):null;var pm25Grade=(airFcast===null|| airFcast===void 0?void 0:airFcast.stationPM25)!=null?this.getPM25Grade(airFcast.stationPM25):null;var badGradeList=[this.AirGradeInfo.BAD,this.AirGradeInfo.VERY_BAD];if(badGradeList.includes(pm10Grade)&& badGradeList.includes(pm25Grade))return this.HikingMsg.BAD_AIR;return this.HikingMsg.DEFAULT}}]); return lsurNowSynthesisFcast}(BlockTemplate); _defineProperty(lsurNowSynthesisFcast,"WEATHER_CODES",{RAIN:["8","9","10","15","42","18","21","22","31","24","33","26","35","27","36","29","38"],SNOW:["11","12","13","14","16","19","23","32","28","37", "30","39"]});_defineProperty(lsurNowSynthesisFcast,"BLOOM_SEASON_TEMPLATE","bloomSeasonFcast"); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i8)forecastList.length=8;var displayData=isGolf?this.getGolfDisplayData(initialData, todayMoment):this.getDisplayDataFromWeather(initialData,todayMoment);var titleMap={"THEME_PARK":"\ub180\uc774\uacf5\uc6d0 \uc5b8\uc81c \uac08\uae4c","GOLF":"\uace8\ud504\ub9ac\ud3ec\ud2b8"};var cardTitle= titleMap[lsurTypeKey]||"\uc5b8\uc81c \uac08\uae4c";var template="_idLsurVisitSummaryTemplate";var oTemplate=Handlebars.getTemplateSync(template);var elContent=oTemplate(_objectSpread({blockPageNameEn:blockPageNameEn, clickCode:this.clickCode,isPartialUpdate:false,dayForecastList:forecastList,cardTitle:cardTitle,isGolf:isGolf},displayData));this.element.html(elContent);if(isGolf)this.element.find(".card_data_exception").toggleClass("hide", !displayData.isReportNoData);this.attachEvent()}}, {key:"attachEvent",value:function attachEvent(){this.element.off("click",".card_slide_item");this.element.off("click","._cnWeatherInfoLayer");this.element.off("click",".btn_close");this.element.on("click", ".card_slide_item",$.proxy(this.onDayClick,this));this.element.on("click","._cnWeatherInfoLayer",$.proxy(this.openInfoLayer,this));this.element.on("click",".btn_close",$.proxy(this.closeAllLayer,this))}}, {key:"openInfoLayer",value:function openInfoLayer(e){var $target=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(isOpen===false)oCommon.fnOpenInfoLayer($target)}}, {key:"closeAllLayer",value:function closeAllLayer(){oCommon.fnCloseAllInfoLayer()}}, {key:"getDisplayDataFromWeather",value:function getDisplayDataFromWeather(weatherData,todayMoment){var suitability=this.calculateSuitability(weatherData);var suitabilityDescription=this.getSuitabilityDescription(weatherData, suitability,todayMoment);var clothingRecommendation=this.getClothingRecommendation(weatherData.minTmpr,weatherData.maxTmpr);var morningWeatherBadge=this.getWeatherBadgeIcon(weatherData.amWetrCd,weatherData.amRainProb, clothingRecommendation.morning.temperature);var afternoonWeatherBadge=this.getWeatherBadgeIcon(weatherData.pmWetrCd,weatherData.pmRainProb,clothingRecommendation.afternoon.temperature);var kidsIndexLevel= this.getKidsIndexLevel(weatherData.aplYmd);var crowdLevelDisplayText=lsurVisitSummary.CROWD_LEVEL_DISPLAY_TEXT[suitability.crowdLevel]||null;var cautionLevel=kidsIndexLevel.level||"\ubcf4\ud1b5";var cautionLevelWarning= cautionLevel==="\uacbd\uace0"||cautionLevel==="\uc704\ud5d8";return{todayData:{amWetrCd:weatherData.amWetrCd||"1",amWetrTxt:weatherData.amWetrTxt||"\ub9d1\uc74c",pmWetrCd:weatherData.pmWetrCd||"1",pmWetrTxt:weatherData.pmWetrTxt|| "\ub9d1\uc74c"},suitabilityText:suitability.text,suitabilityDescription:suitabilityDescription,morning:{temperature:clothingRecommendation.morning.temperature,clothing:clothingRecommendation.morning.clothing, weatherBadgeIcon:morningWeatherBadge},afternoon:{temperature:clothingRecommendation.afternoon.temperature,clothing:clothingRecommendation.afternoon.clothing,weatherBadgeIcon:afternoonWeatherBadge},crowdLevel:crowdLevelDisplayText, needsCaution:kidsIndexLevel.needsCaution,cautionLevelText:cautionLevel,cautionLevelWarning:cautionLevelWarning}}}, {key:"getMaxRainProb",value:function getMaxRainProb(weatherData){return Math.max((weatherData===null||weatherData===void 0?void 0:weatherData.amRainProb)||0,(weatherData===null||weatherData===void 0?void 0: weatherData.pmRainProb)||0)}}, {key:"calculateSuitability",value:function calculateSuitability(weatherData){var _this$templateData3;var _lsurVisitSummary$SUI=lsurVisitSummary.SUITABILITY,HIGH=_lsurVisitSummary$SUI.HIGH,NORMAL=_lsurVisitSummary$SUI.NORMAL, LOW=_lsurVisitSummary$SUI.LOW;if(!weatherData)return _objectSpread({},this.getLevelObject(NORMAL.level),{crowdLevel:this.getCrowdLevel(null)});var totalScore=0;var maxRainProb=this.getMaxRainProb(weatherData); totalScore+=this.getRainScore(maxRainProb);var crowdLevel=this.getCrowdLevel(weatherData.aplYmd);totalScore+=this.getCrowdScore(crowdLevel);totalScore+=this.getTemperatureScore(weatherData.minTmpr,true); totalScore+=this.getTemperatureScore(weatherData.maxTmpr,false);var primaryLevel;if(totalScore<=HIGH.maxScore)primaryLevel=HIGH.level;else if(totalScore<=NORMAL.maxScore)primaryLevel=NORMAL.level;else primaryLevel= LOW.level;var secondaryLevel=primaryLevel;var airWeeklyList=((_this$templateData3=this.templateData)===null||_this$templateData3===void 0?void 0:_this$templateData3.airWeeklyList)||[];var airData=airWeeklyList.find(function(item){return item.aplYmd=== weatherData.aplYmd}); if(airData){var pm10Grades=[airData.amPm10,airData.pmPm10].filter(function(grade){return grade}); var worstPm10=pm10Grades.length>0?Math.max.apply(Math,_toConsumableArray(pm10Grades.map(function(g){return parseInt(g)}))):null; var pm25Grades=[airData.amPm25,airData.pmPm25].filter(function(grade){return grade}); var worstPm25=pm25Grades.length>0?Math.max.apply(Math,_toConsumableArray(pm25Grades.map(function(g){return parseInt(g)}))):null; if(worstPm10&&worstPm25){var airQualityLevel=this.getAirQualityLevel(worstPm10,worstPm25);if(airQualityLevel)secondaryLevel=airQualityLevel}}var finalLevel=this.getLowerLevel(primaryLevel,secondaryLevel); return _objectSpread({},this.getLevelObject(finalLevel),{crowdLevel:crowdLevel})}}, {key:"getRainScore",value:function getRainScore(rainProb){var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=lsurVisitSummary.THRESHOLDS.RAIN_SCORE[Symbol.iterator](), _step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step$value=_step.value,threshold=_step$value.threshold,score=_step$value.score;if(rainProb>threshold)return score}}catch(err){_didIteratorError= true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}return 0}}, {key:"getCrowdScore",value:function getCrowdScore(crowdLevel){var _scoreMap$crowdLevel;var scores=lsurVisitSummary.THRESHOLDS.CROWD_SCORE;var scoreMap={"low":scores.LOW,"medium":scores.MEDIUM,"high":scores.HIGH, "veryhigh":scores.VERY_HIGH};return(_scoreMap$crowdLevel=scoreMap[crowdLevel])!==null&&_scoreMap$crowdLevel!==void 0?_scoreMap$crowdLevel:scores.MEDIUM}}, {key:"getTemperatureScore",value:function getTemperatureScore(tmpr,isMin){if(tmpr==null)return 0;if(isMin){if(tmpr<=0)return 3;if(tmpr<=10)return 2;if(tmpr<=15)return 1;if(tmpr<=20)return 0;if(tmpr<=25)return 2; return 3}else{if(tmpr<=9)return 3;if(tmpr<=15)return 2;if(tmpr<=20)return 1;if(tmpr<=25)return 0;if(tmpr<=30)return 2;return 3}}}, {key:"getAirQualityLevel",value:function getAirQualityLevel(pm10Grade,pm25Grade){var _matrix$pm25Grade$pm,_matrix$pm25Grade;var _lsurVisitSummary$SUI2=lsurVisitSummary.SUITABILITY,NORMAL=_lsurVisitSummary$SUI2.NORMAL, LOW=_lsurVisitSummary$SUI2.LOW;var matrix={1:{1:null,2:null,3:null,4:NORMAL.level,5:LOW.level},2:{1:null,2:null,3:null,4:NORMAL.level,5:LOW.level},3:{1:null,2:null,3:null,4:LOW.level,5:LOW.level},4:{1:NORMAL.level, 2:NORMAL.level,3:LOW.level,4:LOW.level,5:LOW.level},5:{1:LOW.level,2:LOW.level,3:LOW.level,4:LOW.level,5:LOW.level}};return(_matrix$pm25Grade$pm=(_matrix$pm25Grade=matrix[pm25Grade])===null||_matrix$pm25Grade=== void 0?void 0:_matrix$pm25Grade[pm10Grade])!==null&&_matrix$pm25Grade$pm!==void 0?_matrix$pm25Grade$pm:null}}, {key:"getLowerLevel",value:function getLowerLevel(level1,level2){var _config1$priority,_config2$priority;var SUITABILITY=lsurVisitSummary.SUITABILITY;var config1=Object.values(SUITABILITY).find(function(s){return s.level=== level1}); var config2=Object.values(SUITABILITY).find(function(s){return s.level===level2}); var priority1=(_config1$priority=config1===null||config1===void 0?void 0:config1.priority)!==null&&_config1$priority!==void 0?_config1$priority:0;var priority2=(_config2$priority=config2===null||config2=== void 0?void 0:config2.priority)!==null&&_config2$priority!==void 0?_config2$priority:0;return priority1=RAIN_PROB_MIN&&lsurVisitSummary.WEATHER_CODES.SNOW.includes(wetrCd))return{type:"snow",text:"\ub208"};if(rainProb>= RAIN_PROB_MIN&&lsurVisitSummary.WEATHER_CODES.RAIN.includes(wetrCd))return{type:"rain",text:"\ube44"};if(temperature!=null&&temperature>=HOT_TEMP)return{type:"hot",text:"\ub354\uc704"};if(temperature!= null&&temperature<=COLD_TEMP)return{type:"cold",text:"\ucd94\uc704"};return null}}, {key:"getCrowdLevel",value:function getCrowdLevel(aplYmd){var _this$templateData4;if(!aplYmd)return null;var crowdLevelList=((_this$templateData4=this.templateData)===null||_this$templateData4===void 0? void 0:_this$templateData4.crowdLevelList)||[];var crowdData=crowdLevelList.find(function(item){return item.aplYmd===aplYmd}); return(crowdData===null||crowdData===void 0?void 0:crowdData.level)||null}}, {key:"getKidsIndexLevel",value:function getKidsIndexLevel(aplYmd){var OPERATING_HOURS={START:10,END:17};try{var _this$templateData5;if(!aplYmd)return{needsCaution:false,level:"\ubcf4\ud1b5",type:"normal", message:""};var townFcastList=((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:_this$templateData5.townFcastList)||[];var aplYmdStr=String(aplYmd);var now=moment();var todayYmd= now.format("YYYYMMDD");var isToday=aplYmdStr===todayYmd;var currentHour=now.hour();var dayTempData=this.extractDayTempData(townFcastList,aplYmdStr,isToday,currentHour,OPERATING_HOURS);if(dayTempData.length=== 0)return{needsCaution:false,level:"\ubcf4\ud1b5",type:"normal",message:""};var temps=dayTempData.map(function(item){return item.stmpr||0}); var maxTemp=Math.max.apply(Math,_toConsumableArray(temps));var minTemp=Math.min.apply(Math,_toConsumableArray(temps));var hotLevel=this.getKidsLevelByTemp(maxTemp,"HOT");var coldLevel=this.getKidsLevelByTemp(minTemp, "COLD");var priorityMap=lsurVisitSummary.KIDS_INDEX_THRESHOLDS.PRIORITY_MAP;var hotPriority=priorityMap[hotLevel.level]||0;var coldPriority=priorityMap[coldLevel.level]||0;if(hotPriority>=coldPriority)return _objectSpread({needsCaution:true}, hotLevel);else return _objectSpread({needsCaution:true},coldLevel)}catch(error){console.error("[lsurVisitSummary] [\uc544\uc774\u00b7\ub178\uc57d\uc790] \uc5d0\ub7ec \ubc1c\uc0dd:",error);return{needsCaution:false, level:"\ubcf4\ud1b5",type:"normal",message:""}}}}, {key:"extractDayTempData",value:function extractDayTempData(townFcastList,aplYmdStr,isToday,currentHour,operatingHours){if(isToday&¤tHour>=operatingHours.START){var firstItem=townFcastList[0];if(firstItem&& firstItem.aplYmdt&&firstItem.aplYmdt.substring(0,8)===aplYmdStr)return[firstItem];return[]}return townFcastList.filter(function(item){if(!item.aplYmdt)return false;var itemDate=item.aplYmdt.substring(0, 8);var itemHour=parseInt(item.aplYmdt.substring(8,10),10);return itemDate===aplYmdStr&&itemHour>=operatingHours.START&&itemHour<=operatingHours.END})}}, {key:"getKidsLevelByTemp",value:function getKidsLevelByTemp(temp,type){var thresholds=lsurVisitSummary.KIDS_INDEX_THRESHOLDS[type];if(type==="HOT"){var matched=thresholds.find(function(t){return temp>= t.min}); return matched?{level:matched.level,type:"hot",message:matched.message}:{level:"\ubcf4\ud1b5",type:"hot",message:""}}else{var _matched=thresholds.find(function(t){return temp<=t.max}); return _matched?{level:_matched.level,type:"cold",message:_matched.message}:{level:"\ubcf4\ud1b5",type:"cold",message:""}}}}, {key:"getSuitabilityDescription",value:function getSuitabilityDescription(weatherData,suitability,todayMoment){if(!weatherData||!weatherData.aplYmd)return"";var dateText=this.getDateText(weatherData.aplYmd, todayMoment);var minTmpr=weatherData.minTmpr!=null?weatherData.minTmpr:0;var maxTmpr=weatherData.maxTmpr!=null?weatherData.maxTmpr:0;var temperatureText="\uc608\uc0c1\uae30\uc628\uc740 ".concat(minTmpr, "~").concat(maxTmpr,"\ub3c4 \uc0ac\uc774\uba70");var summaryText=this.getSummaryText(weatherData);return"".concat(dateText," ").concat(temperatureText,", ").concat(summaryText)}}, {key:"getDateText",value:function getDateText(aplYmd,todayMoment){var targetMoment=moment(aplYmd,"YYYYMMDD");if(!todayMoment)todayMoment=moment().startOf("day");var tomorrowMoment=todayMoment.clone().add(1, "day");var dayAfterTomorrowMoment=todayMoment.clone().add(2,"days");var dateStr=targetMoment.format("M.D");if(targetMoment.isSame(todayMoment,"day"))return"\uc624\ub298(".concat(dateStr,")");else if(targetMoment.isSame(tomorrowMoment, "day"))return"\ub0b4\uc77c(".concat(dateStr,")");else if(targetMoment.isSame(dayAfterTomorrowMoment,"day"))return"\ubaa8\ub808(".concat(dateStr,")");else{var dayOfWeek=["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c", "\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"][targetMoment.day()];return"".concat(dayOfWeek,"(").concat(dateStr,")")}}}, {key:"getSummaryText",value:function getSummaryText(weatherData){var maxRainProb=this.getMaxRainProb(weatherData);var minTmpr=weatherData.minTmpr!=null?weatherData.minTmpr:0;var maxTmpr=weatherData.maxTmpr!= null?weatherData.maxTmpr:0;var tempDiff=maxTmpr-minTmpr;var _lsurVisitSummary$THR2=lsurVisitSummary.THRESHOLDS.SUMMARY,RAIN_PROB_MIN=_lsurVisitSummary$THR2.RAIN_PROB_MIN,TEMP_DIFF_MIN=_lsurVisitSummary$THR2.TEMP_DIFF_MIN, MAX_TEMP_HOT=_lsurVisitSummary$THR2.MAX_TEMP_HOT,MIN_TEMP_COLD=_lsurVisitSummary$THR2.MIN_TEMP_COLD;if(maxRainProb>=RAIN_PROB_MIN)return"\uc6b4\uc601\uc2dc\uac04 \uc911\uc5d0 \ube44\uac00 \uc62c \uc218\ub3c4 \uc788\uc5b4\uc694."; if(tempDiff>=TEMP_DIFF_MIN)return"\uc885\uc77c \ubc29\ubb38\ud55c\ub2e4\uba74 \uc77c\uad50\ucc28\uc5d0 \uc720\uc758\ud558\uc138\uc694.";if(maxTmpr>=MAX_TEMP_HOT)return"\ub354\uc704\ub54c\ubb38\uc5d0 \uc7a5\uc2dc\uac04 \ub300\uae30\uc904\uc740 \ud798\ub4e4\uc5b4\uc694."; if(minTmpr<=MIN_TEMP_COLD)return"\ucd94\uc704\ub97c \ud53c\ud574 \uc2e4\ub0b4\uae30\uad6c \uc704\uc8fc\ub85c \ucd94\ucc9c\ud574\uc694.";return"\ud63c\uc7a1\ub3c4\ub97c \ucc38\uace0\ud574 \ubc29\ubb38\uc744 \uacc4\ud68d\ud574 \ubcf4\uc138\uc694."}}, {key:"getClothingRecommendation",value:function getClothingRecommendation(minTmpr,maxTmpr){var morningTemp=minTmpr!=null&&maxTmpr!=null?(minTmpr+maxTmpr)/2:minTmpr;var afternoonTemp=maxTmpr;var morningClothing= this.getClothingByTemperature(morningTemp);var afternoonClothing=this.getClothingByTemperature(afternoonTemp);return{morning:{clothing:morningClothing,temperature:morningTemp},afternoon:{clothing:afternoonClothing, temperature:afternoonTemp}}}}, {key:"getClothingByTemperature",value:function getClothingByTemperature(temperature){if(temperature==null||isNaN(temperature))return null;var temp=Math.floor(parseFloat(temperature));var range=lsurVisitSummary.TEMPERATURE_RANGES.find(function(r){return temp<= r.max}); return range?lsurVisitSummary.CLOTHING_TYPE[range.type]:null}}, {key:"onDayClick",value:function onDayClick(e){e.preventDefault();var $target=$(e.currentTarget);if($target.attr("aria-selected")==="true")return;oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode, "select"),true);this.element.find(".card_slide_item").attr("aria-selected","false");$target.attr("aria-selected","true");var aplYmd=String($target.data("apl-ymd"));if(!aplYmd||aplYmd==="undefined"){console.warn("[lsurVisitSummary] Invalid data-apl-ymd:", aplYmd);return}this.updateDayData(aplYmd);this.scrollToHourlyFcast(aplYmd)}}, {key:"scrollToHourlyFcast",value:function scrollToHourlyFcast(aplYmd){var todayYmd=moment().format("YYYYMMDD");if(aplYmd===todayYmd)oBlockScriptService.callTemplateFunc("hourlyFcast","scrollToElementByDay", null,500,true);else{var aplYmdt=aplYmd+"00";oBlockScriptService.callTemplateFunc("hourlyFcast","scrollToElementByDay",aplYmdt,500,false)}}}, {key:"updateDayData",value:function updateDayData(aplYmd){var _this$templateData6;var weeklyFcastList=((_this$templateData6=this.templateData)===null||_this$templateData6===void 0?void 0:_this$templateData6.weeklyFcastList)|| [];var selectedDayData=weeklyFcastList.find(function(item){return String(item.aplYmd)===String(aplYmd)}); if(!selectedDayData){console.warn("[lsurVisitSummary] No data found for aplYmd:",aplYmd);return}var isGolf=oCodeUtil.isGolf(sRegionCode);var displayData=isGolf?this.getGolfDisplayData(selectedDayData): this.getDisplayDataFromWeather(selectedDayData);var template="_idLsurVisitSummaryTemplate";var oTemplate=Handlebars.getTemplateSync(template);var detailContent=oTemplate(_objectSpread({blockPageNameEn:blockPageNameEn, clickCode:this.clickCode,isPartialUpdate:true,isGolf:isGolf},displayData));this.element.find(".card_place_data").html(detailContent);if(isGolf)this.element.find(".card_data_exception").toggleClass("hide", !displayData.isReportNoData)}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"initAfter",value:function initAfter(){this.initScroll();this.attachEvent()}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(this.element.css("display")!=="none"){var scrollName=this.element.find(".scroll_area").data("name");if(scrollName&& oCommon.oScroll[scrollName])oCommon.refreshScroll(scrollName);else this.initScroll()}}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){return{weeklyFcastData:{fields:["weeklyFcastList"],minLength:3},weeklyFcastFirstData:{fields:["weeklyFcastList.0.aplYmd","weeklyFcastList.0.minTmpr", "weeklyFcastList.0.maxTmpr","weeklyFcastList.0.amWetrCd","weeklyFcastList.0.pmWetrCd","weeklyFcastList.0.amRainProb","weeklyFcastList.0.pmRainProb"],operator:"AND"}}}}, {key:"getGolfDisplayData",value:function getGolfDisplayData(weatherData,todayMoment){var aplYmd=weatherData===null||weatherData===void 0?void 0:weatherData.aplYmd;var today=todayMoment||moment().startOf("day"); var targetMoment=aplYmd?moment(aplYmd,"YYYYMMDD"):today;var diffDays=targetMoment.diff(today,"days");var isNearbyDay=diffDays<=1;var hourlyData=isNearbyDay?this.getGolfHourlyForDay(aplYmd):[];var sunRiseSet= this.getGolfSunRiseSet(aplYmd);var golfWeatherItems=isNearbyDay&&hourlyData.length>0?this.getGolfWeatherItemsNearby(hourlyData):this.getGolfWeatherItemsLater(weatherData);var reportEntry=this.findReportEntry(aplYmd); var _this$getGolfReportDa=this.getGolfReportData(reportEntry),golfClubStatus=_this$getGolfReportDa.golfClubStatus,golfDescription=_this$getGolfReportDa.golfDescription;var isReportNoData=this.isGolfReportExpired(reportEntry)|| !(golfClubStatus===null||golfClubStatus===void 0?void 0:golfClubStatus.trim())||!(golfDescription===null||golfDescription===void 0?void 0:golfDescription.trim());return{golfClubStatus:golfClubStatus,golfDescription:golfDescription, isReportNoData:isReportNoData,sunRiseSet:sunRiseSet,golfWeatherItems:golfWeatherItems}}}, {key:"findReportEntry",value:function findReportEntry(aplYmd){var _this$templateData7;if(!aplYmd)return null;var lsurReport=((_this$templateData7=this.templateData)===null||_this$templateData7===void 0? void 0:_this$templateData7.lsurReport)||[];return lsurReport.find(function(item){return item.aplYmdt&&item.aplYmdt.startsWith(aplYmd)})||null}}, {key:"isGolfReportExpired",value:function isGolfReportExpired(entry){if(!entry)return true;var insYmdt=entry.insYmdt;if(!insYmdt)return true;var insTime=moment(insYmdt,"YYYYMMDDHHmmss").utcOffset(9);if(!insTime.isValid())return true; var hoursDiff=moment().utcOffset(9).diff(insTime,"hours",true);return hoursDiff>13}}, {key:"getGolfReportData",value:function getGolfReportData(entry){var defaultResult={golfClubStatus:"",golfDescription:""};if(!(entry===null||entry===void 0?void 0:entry.contents))return defaultResult;try{var _parsed$report; var parsed=typeof entry.contents==="string"?JSON.parse(entry.contents):entry.contents;var reportContents=parsed===null||parsed===void 0?void 0:(_parsed$report=parsed.report)===null||_parsed$report===void 0? void 0:_parsed$report.contents;if(reportContents)return{golfClubStatus:reportContents.title||"",golfDescription:reportContents.summary_report||""};return{golfClubStatus:(parsed===null||parsed===void 0? void 0:parsed.title)||"",golfDescription:(parsed===null||parsed===void 0?void 0:parsed.summary)||""}}catch(e){console.warn("[lsurVisitSummary] Failed to parse lsurReport contents:",e);return defaultResult}}}, {key:"getGolfHourlyForDay",value:function getGolfHourlyForDay(aplYmd){var _this$templateData8;var townFcastList=((_this$templateData8=this.templateData)===null||_this$templateData8===void 0?void 0:_this$templateData8.townFcastList)|| [];return townFcastList.filter(function(item){if(!item.aplYmdt)return false;var itemDate=item.aplYmdt.substring(0,8);if(itemDate!==aplYmd)return false;var hour=parseInt(item.aplYmdt.substring(8,10),10); return hour>=6&&hour<=18})}}, {key:"getGolfSunRiseSet",value:function getGolfSunRiseSet(aplYmd){var _this$templateData9;var sunRiseSetList=((_this$templateData9=this.templateData)===null||_this$templateData9===void 0?void 0:_this$templateData9.sunRiseSetList)|| [];var entry=sunRiseSetList.find(function(s){return s.aplYmd===aplYmd}); if(!entry)return null;var formatTime=function formatTime(tmStr){if(!tmStr||tmStr.length<4)return"";return"".concat(tmStr.substring(0,2),":").concat(tmStr.substring(2,4))}; var formatRawDate=function formatRawDate(ymd,tmStr){if(!ymd||!tmStr)return"";var y=ymd.substring(0,4);var m=ymd.substring(4,6);var d=ymd.substring(6,8);var hh=tmStr.substring(0,2);var mm=tmStr.substring(2, 4);var ss=tmStr.length>=6?tmStr.substring(4,6):"00";return"".concat(y,"-").concat(m,"-").concat(d,"T").concat(hh,":").concat(mm,":").concat(ss)}; return{sunRise:formatTime(entry.sriseTm),sunSet:formatTime(entry.ssetTm),sunRiseRawDate:formatRawDate(aplYmd,entry.sriseTm),sunSetRawDate:formatRawDate(aplYmd,entry.ssetTm)}}}, {key:"getGolfWeatherItemsNearby",value:function getGolfWeatherItemsNearby(hourlyData){if(!hourlyData||hourlyData.length===0)return null;var items=[];items.push(this.getGolfRainMessage(hourlyData));items.push(this.getGolfWindMessage(hourlyData)); return items}}, {key:"getGolfWeatherItemsLater",value:function getGolfWeatherItemsLater(weatherData){if(!weatherData)return null;var items=[];var amTxt=weatherData.amWetrTxt||"";var pmTxt=weatherData.pmWetrTxt||"";if(amTxt)items.push("\uc624\uc804 ".concat(amTxt)); if(pmTxt)items.push("\uc624\ud6c4 ".concat(pmTxt));var minTmpr=weatherData.minTmpr!=null?Math.round(weatherData.minTmpr):null;var maxTmpr=weatherData.maxTmpr!=null?Math.round(weatherData.maxTmpr):null; if(minTmpr!=null)items.push("\ucd5c\uc800 ".concat(minTmpr,"\u00b0"));if(maxTmpr!=null)items.push("\ucd5c\uace0 ".concat(maxTmpr,"\u00b0"));return items.length>0?items:null}}, {key:"getGolfRainMessage",value:function getGolfRainMessage(hourlyData){var _this2=this;var maxHourlyRain=0;var totalRain=0;hourlyData.forEach(function(h){var rain=_this2.parseRainAmt(h.oneHourRainAmt); if(rain>maxHourlyRain)maxHourlyRain=rain;totalRain+=rain}); if(maxHourlyRain>=3)return"\uc2dc\uac04\ub2f9 ".concat(maxHourlyRain.toFixed(1),"mm");if(totalRain>0)return"\ub204\uc801 ".concat(totalRain.toFixed(1),"mm");return"\ub208\u00b7\ube44 \uc5c6\uc74c"}}, {key:"getGolfWindMessage",value:function getGolfWindMessage(hourlyData){var maxWind=this.getGolfMaxWind(hourlyData);if(maxWind>=10)return"\uac15\ud48d ".concat(maxWind,"m/s");if(maxWind>=5)return"\ucd5c\ub300 ".concat(maxWind, "m/s");return"\ubc14\ub78c \uc57d\ud568"}}, {key:"getGolfMaxWind",value:function getGolfMaxWind(hourlyData){return hourlyData.reduce(function(max,h){var wind=parseFloat(h.windSpd)||0;return wind>max?wind:max},0)}}, {key:"getGolfMaxHourlyRain",value:function getGolfMaxHourlyRain(hourlyData){var _this3=this;return hourlyData.reduce(function(max,h){var rain=_this3.parseRainAmt(h.oneHourRainAmt);return rain>max?rain: max},0)}}, {key:"parseRainAmt",value:function parseRainAmt(value){if(!value)return 0;var str=String(value).trim();if(str==="0"||str==="0.0")return 0;if(str.startsWith("~"))return parseFloat(str.substring(1))*.5;return parseFloat(str)|| 0}}]); return lsurVisitSummary}(BlockTemplate); _defineProperty(lsurVisitSummary,"CLOTHING_TYPE",{LONG_PADDING:{description:"\ub9e4\uc6b0 \ub530\ub4ef\ud55c \uc637",iconClass:"type_data--1"},PADDING:{description:"\ub530\ub4ef\ud55c \uc637",iconClass:"type_data--2"}, COAT:{description:"\uc57d\uac04 \ub450\ud130\uc6b4 \uc637",iconClass:"type_data--3"},CARDIGAN:{description:"\uc801\ub2f9\ud788 \uac00\ubcbc\uc6b4 \uc637",iconClass:"type_data--4"},LONG_SLEEVE:{description:"\uac00\ubcbc\uc6b4 \uc637", iconClass:"type_data--5"},SHORT_SLEEVE:{description:"\ub9e4\uc6b0 \uac00\ubcbc\uc6b4 \uc637",iconClass:"type_data--6"}}); _defineProperty(lsurVisitSummary,"SUITABILITY",{HIGH:{level:"high",text:"\ub192\uc74c",priority:3,maxScore:3},NORMAL:{level:"normal",text:"\uc911\uac04",priority:2,maxScore:6},LOW:{level:"low",text:"\ub0ae\uc74c", priority:1,maxScore:Infinity}}); _defineProperty(lsurVisitSummary,"WEATHER_CODES",{RAIN:["8","9","10","15","42","18","21","22","31","24","33","26","35","27","36","29","38"],SNOW:["11","12","13","14","16","19","23","32","28","37","30", "39"]}); _defineProperty(lsurVisitSummary,"THRESHOLDS",{RAIN_SCORE:[{threshold:60,score:7},{threshold:40,score:4},{threshold:20,score:1},{threshold:0,score:0}],CROWD_SCORE:{LOW:0,MEDIUM:1,HIGH:2,VERY_HIGH:4},WEATHER_BADGE:{RAIN_PROB_MIN:40, HOT_TEMP:27,COLD_TEMP:4},SUMMARY:{RAIN_PROB_MIN:40,TEMP_DIFF_MIN:11,MAX_TEMP_HOT:33,MIN_TEMP_COLD:-12}}); _defineProperty(lsurVisitSummary,"TEMPERATURE_RANGES",[{max:-4,type:"LONG_PADDING"},{max:4,type:"PADDING"},{max:12,type:"COAT"},{max:19,type:"CARDIGAN"},{max:26,type:"LONG_SLEEVE"},{max:Infinity,type:"SHORT_SLEEVE"}]); _defineProperty(lsurVisitSummary,"CROWD_LEVEL_DISPLAY_TEXT",{"low":"\ud3c9\uc18c\ubcf4\ub2e4 \uc801\uc74c","medium":"\ud3c9\uc18c \uc218\uc900","high":"\ud3c9\uc18c\ubcf4\ub2e4 \ub9ce\uc74c","veryhigh":"\ud3c9\uc18c\ubcf4\ub2e4 \ud63c\uc7a1"}); _defineProperty(lsurVisitSummary,"KIDS_INDEX_THRESHOLDS",{HOT:[{min:37,level:"\uc704\ud5d8",message:"37\u00b0 \uc774\uc0c1 \ub9e4\uc6b0 \ub354\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc678\ubd80 \ud65c\ub3d9\uc744 \uc790\uc81c\ud558\uace0 \uc2e4\ub0b4\uc5d0\uc11c \ud65c\ub3d9\ud558\uc138\uc694."}, {min:34,level:"\uacbd\uace0",message:"34~36\u00b0 \ub354\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc57c\uc678 \ud65c\ub3d9 \uc2dc \uccb4\uc628 \uad00\ub9ac\uc5d0 \uc8fc\uc758\ud558\uc138\uc694."}, {min:31,level:"\uc8fc\uc758",message:"31~33\u00b0 \uc57d\uac04 \ub354\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \ucda9\ubd84\ud55c \uc218\ubd84 \uc12d\ucde8\uac00 \ud544\uc694\ud574\uc694."}, {min:29,level:"\uad00\uc2ec",message:"29~30\u00b0 \ub354\uc6cc\uc9c8 \uc218 \uc788\uc5b4\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc678\ubd80 \ud65c\ub3d9 \uc2dc \uc8fc\uc758\ud558\uc138\uc694."}], COLD:[{max:-16,level:"\uc704\ud5d8",message:"-16\u00b0 \uc774\ud558 \ub9e4\uc6b0 \ucd94\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc678\ubd80 \ud65c\ub3d9\uc744 \uc790\uc81c\ud558\uace0 \uc2e4\ub0b4\uc5d0\uc11c \ud65c\ub3d9\ud558\uc138\uc694."}, {max:-11,level:"\uacbd\uace0",message:"-11~-15\u00b0 \ucd94\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc57c\uc678 \ud65c\ub3d9 \uc2dc \uccb4\uc628 \uad00\ub9ac\uc5d0 \uc8fc\uc758\ud558\uc138\uc694."}, {max:-4,level:"\uc8fc\uc758",message:"-4~-10\u00b0 \uc57d\uac04 \ucd94\uc6cc\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \ub530\ub73b\ud558\uac8c \uc785\uace0 \uc678\ucd9c\ud558\uc138\uc694."}, {max:0,level:"\uad00\uc2ec",message:"0~-3\u00b0 \ucd94\uc6cc\uc9c8 \uc218 \uc788\uc5b4\uc694. \uc5b4\ub9b0\uc774\uc640 \ub178\uc57d\uc790\ub294 \uc678\ubd80 \ud65c\ub3d9 \uc2dc \uc8fc\uc758\ud558\uc138\uc694."}], PRIORITY_MAP:{"\uc704\ud5d8":4,"\uacbd\uace0":3,"\uc8fc\uc758":2,"\uad00\uc2ec":1,"\ubcf4\ud1b5":0}}); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0}}, {key:"init",value:function init(){var data=this.templateData||{};this.list=Array.isArray(data.hourlyFcastList)?data.hourlyFcastList:[];this.cur=data.nowFcast||{};this.lsurRegion=this._getLsurRegion();this._renderCard()}}, {key:"initAfter",value:function initAfter(){this._initMapArea()}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".poi_map_scale button",$.proxy(this._changeZoom,this));this.element.on("click",".poi_map_location button",$.proxy(this._clickCurrentPosition, this))}}, {key:"_renderCard",value:function _renderCard(){var cur=this.cur;this.element.find("._cnCurWindSpd").text(this._round1(cur.windSpd));this.element.find("._cnCurWindDrctn").text(this._windDrctnName(cur)); this.element.find("._cnDescMap").html(this._buildDescHtml());this.element.find("._cnLastUpdate").text(this._formatUpdate(cur.lastUdtYmdt))}}, {key:"_buildDescHtml",value:function _buildDescHtml(){var _this3=this;var cur=this.cur;var basis=this.list.filter(function(h){if(!h.aplYmdt)return false;var hh=parseInt(h.aplYmdt.substring(8,10),10);return hh>= _this3.ROUND_START&&hh<=_this3.ROUND_END}); if(!basis.length)basis=cur.windSpd!=null?[cur]:[];if(!basis.length)return"";var maxWind=Math.max.apply(null,basis.map(function(h){return Number(h.windSpd)||0})); var peak=basis.find(function(h){return(Number(h.windSpd)||0)===maxWind}); var peakStr=peak&&peak.aplYmdt?"(".concat(parseInt(peak.aplYmdt.substring(8,10),10),"\uc2dc \ubb34\ub835)"):"";var stmpr=this._round(cur.stmpr);return"\uc624\ub298\uc758 \ucd5c\ub300\ud48d\uc18d\uc740 ".concat(this._round1(maxWind), "m/s").concat(peakStr,"\uc774\uba70, ")+"".concat(this._windMsg(maxWind)," \uccb4\uac10\uc628\ub3c4\ub294 ").concat(stmpr,"\u2103 \uc785\ub2c8\ub2e4.")}}, {key:"_windMsg",value:function _windMsg(spd){for(var i=0;i=this.maxZoom);$out.prop("disabled", zoom<=this.minZoom)}}, {key:"_clickCurrentPosition",value:function _clickCurrentPosition(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"loc"));var _this=this;var target=e.currentTarget;if($(target).hasClass("on")){$(target).removeClass("on"); if(this.naverMap)this.naverMap.setCenter(this.basePosition);return}var fnCallback=function fnCallback(oLocation){if(!_this.naverMap||!oLocation)return;var a=String(oLocation).split(",");var lat=parseFloat(a[0]); var lng=parseFloat(a[1]);if(isNaN(lat)||isNaN(lng))return;var pos=new naver.maps.LatLng(lat,lng);if(typeof oMapsUtils!=="undefined"&&oMapsUtils.getDistance(_this.basePosition,pos)>_this.MAX_DISTANCE_METER){alert("\ud604\uc7ac \uc704\uce58\uac00 \uace8\ud504\uc7a5\uc5d0\uc11c \uba40\ub9ac \ub5a8\uc5b4\uc838 \uc788\uc2b5\ub2c8\ub2e4."); return}_this.naverMap.setCenter(pos);$(target).addClass("on")}; if(typeof oCommonGeoLocation==="undefined")return;oCommonGeoLocation.fnInit({callback:fnCallback,welButton:this.element.find(".poi_map_location button"),returnType:"origin",originRegionCode:sRegionCode, originPath:"today"})}}, {key:"_windDrctnName",value:function _windDrctnName(item){if(item&&item.windDrctnName)return item.windDrctnName;if(item&&item.windDrctn!=null&&typeof oWindDrctnInfo!=="undefined"&&oWindDrctnInfo[item.windDrctn])return oWindDrctnInfo[item.windDrctn]; return"-"}}, {key:"_round",value:function _round(v){if(v==null||isNaN(Number(v)))return"-";if(typeof oCommon!=="undefined"&&typeof oCommon.fnMathRound==="function")return oCommon.fnMathRound(v,false);return Math.round(Number(v))}}, {key:"_round1",value:function _round1(v){if(v==null||isNaN(Number(v)))return"-";return(Math.round(Number(v)*10)/10).toFixed(1)}}, {key:"_formatUpdate",value:function _formatUpdate(ymdt){if(!ymdt||String(ymdt).length<12)return"";var s=String(ymdt);return"\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 ".concat(s.substring(0,4),".").concat(s.substring(4, 6),".").concat(s.substring(6,8),". ")+"".concat(s.substring(8,10),":").concat(s.substring(10,12))}}]); return lsurWindMap}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i1)oBlockScriptService.callTemplateFunc("meetTalk","disableAutoUpdate")}, loadList:function loadList(oEvent){$("._cnTalkLoadingArea").removeClass("hide")}, afterList:function afterList(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","setFixedTalkBtnCountBadge",oEvent)}, beforeLogTransfer:function beforeLogTransfer(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","sendClickCode",oEvent)}, initialized:function initialized(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","initCustomCommentInputBox");oBlockScriptService.callTemplateFunc("meetTalk","initRegionSelectBox");oBlockScriptService.callTemplateFunc("meetTalk", "initTalkRegionBtn");oBlockScriptService.callTemplateFunc("meetTalk","initCommentInputBoxSetUp");oBlockScriptService.callTemplateFunc("meetTalk","initTalkPersist");if(_this.isDisableAutoUpdate===true)setTimeout(function(){return oBlockScriptService.callTemplateFunc("meetTalk", "disableAutoUpdate")},500)}, beforeOpenReference:function beforeOpenReference(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","openReferenceComment",oEvent)}, afterCreate:function afterCreate(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","afterCommentWrite",oEvent)}, afterCloseReference:function afterCloseReference(){oBlockScriptService.callTemplateFunc("meetTalk","cancelWriteReferenceComment")}, afterMoveToFirstComment:function afterMoveToFirstComment(){oBlockScriptService.callTemplateFunc("meetTalk","moveTopComment")}, beforeCreate:function beforeCreate(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","beforeCreateComment",oEvent)}, afterOpenReference:function afterOpenReference(oEvent){oBlockScriptService.callTemplateFunc("meetTalk","afteOpenReferenceComment",oEvent)}}, sSort:"NEW",aSortTypes:["NEW"],sTemplateId:"",sCategoryImage:"",sHelp:"up",sLanguage:"ko",sCountry:"KR",nPageSize:20,nIndexSize:5,nReplyPageSize:5,sCssId:"meet",sLangForTranslation:"",sCssUrl:"",bByCountry:false, bManager:false,sCommentNo:"",bSortCookie:false,sCountType:"total",aExcludeCountry:[],sAreaCodePrefix:"",sAuthType:"naver",bIncludeAllComments:"",bShowReply:false,bSupportAudioScheme:false,bUseInfiniteScrolling:false, nListSizeToShowMoveToFirst:10,sDateFormat:"m-d H:i",sTestUserIp:"",nUserCommentPageSize:10,nUserCommentReplyPageSize:5,sLocale:""};if(this.darkModeType.indexOf("force")>-1)if(this.darkModeType.indexOf("dark")> -1)this.darkModeValue="on";else this.darkModeValue="off";else this.darkModeValue="auto";this.commentOption["sMediaViewerDarkMode"]=this.darkModeValue;$(".section_right").addClass("talk").removeClass("no_sticky"); this.initFixedTalkBtn();this.commentRegionConfigInfoList=Object.values(this.templateData);this.commentRegionConfigInfoOrderNumList=Object.values(this.templateData).sort(function(a,b){return a.orderNum- b.orderNum}); this.isSwitchRegionByElement=talkRegionCode!=="00";if(talkRegionCode.length>2)talkRegionCode=talkRegionCode.substring(0,2);if(talkCategoryRegionCode.length>5)talkCategoryRegionCode=talkCategoryRegionCode.substring(0, 5);var _this$setUpTalkPersis=this.setUpTalkPersist(talkRegionCode,talkCategoryRegionCode),objectRegionCode=_this$setUpTalkPersis.objectRegionCode,categoryRegionCode=_this$setUpTalkPersis.categoryRegionCode; this.talkRegionCode=objectRegionCode+"";this.talkCategoryRegionCode=categoryRegionCode+"";if(this.talkTab!=="keep"&&this.talkRegionCode!=="00")this.isSpreadObject=true;var _this$splitRegionCode=this.splitRegionCodeToObjectAndCategory(mLocRegionCode), mLocObjectRegionCode=_this$splitRegionCode["objectRegionCode"],mLocCategoryRegionCode=_this$splitRegionCode["categoryRegionCode"];if(mLocObjectRegionCode&&mLocCategoryRegionCode){this.currentLocationObjectRegionCode= mLocObjectRegionCode;this.currentLocationCategoryRegionCode=mLocCategoryRegionCode}if(this.talkTab==="keep"){this.keepLastObjectRegionCode=this.talkRegionCode;this.keepLastCategoryRegionCode=this.talkCategoryRegionCode}else{this.talkTab= "city";this.cityLastObjectRegionCode=this.talkRegionCode;this.cityLastCategoryRegionCode=this.talkCategoryRegionCode}this.router=Router(function(_ref){var _currentInfo$state,_prevInfo$state;var currentInfo= _ref.currentInfo,prevInfo=_ref.prevInfo;var currentPath=(_currentInfo$state=currentInfo.state)===null||_currentInfo$state===void 0?void 0:_currentInfo$state.path;var prevPath=prevInfo===null||prevInfo=== void 0?void 0:(_prevInfo$state=prevInfo.state)===null||_prevInfo$state===void 0?void 0:_prevInfo$state.path;if(prevPath===currentPath)return;switch(currentPath){case "talk":_this2.openTalk();break;case "talk/region-search":_this2.openKeepSearch(); break;case "talk/mediaViewer/list":__mediaViewer.list.show();break;case "talk/mediaViewer/viewer":__mediaViewer.viewer.show();break}switch(prevPath){case "talk":if((currentPath===null||currentPath===void 0? void 0:currentPath.indexOf("talk/"))===0)return;_this2.closeTalk();break;case "talk/region-search":_this2.closeKeepSearch();break;case "talk/mediaViewer/list":if((currentPath===null||currentPath===void 0? void 0:currentPath.indexOf("talk/mediaViewer/"))===0)__mediaViewer.list.hide();else __mediaViewer.list.hide(true);break;case "talk/mediaViewer/viewer":__mediaViewer.viewer.hide();break}}); if(isInitTalk==="true")this.enableTalk();else this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click","._cnObjectRegionBtn",$.proxy(this.clickObjectRegionBtn,this));this.element.on("click","._cnCategoryRegionBtn",$.proxy(this.clickCategoryRegionBtn, this));this.element.on("change","._cnTalkRegionSelect",$.proxy(this.clickRegionSelect,this));this.element.on("click","._cnCommentInputBox",$.proxy(this.clickCurrentLocation,this));this.element.on("click", "._cnPrivacyLocationPopup .btn_popup",$.proxy(this.clickPrivacyLocationAllow,this));this.element.on("click","._cnPrivacyLocationPopup .btn_close",$.proxy(this.openClosePrivacyLocationPopup,this,false)); this.element.on("click",".u_cbox_comment_box .u_cbox_article_link",$.proxy(this.clickCommentBoxLink,this));this.element.on("click",".u_cbox_image_link,.u_cbox_area_thumbnail_link",$.proxy(this.clickCommentImage, this));this.element.on("click","._cnObjectSpreadBtn",$.proxy(this.spreadObjectBtn,this));this.element.on("click","._cnTalkTab .tab",$.proxy(this.clickTalkTab,this));this.element.on("click","._cnKeepSearch", $.proxy(this.clickKeepSearch,this));this.element.on("input","._cnSearchInput",$.proxy(this.inputKeepSearch,this));this.element.on("click",".search_area ._cnAutoCompleteResult,._cnLatelyResult,._cnHotResult", $.proxy(this.clickSearchResult,this));this.element.on("click","._cnKeepRegionBtn",$.proxy(this.clickKeepRegionBtn,this));this.element.on("click","._cnSearchChangeRegion",$.proxy(this.clickSearchChangeRegion, this));this.element.on("click","._cnCancelSearchBtn",$.proxy(this.clickKeepSearchCancel,this));this.element.on("click",".talk_cmt_box",$.proxy(this.clickSearchOutside,this));this.element.on("click","._cnTalkCurrentLocation", $.proxy(this.clickCurrentLocation,this));this.element.on("click","._cnAttachmentMore",$.proxy(this.clickAttachmentMore,this));this.element.on("click","._cnAttachmentElement",$.proxy(this.clickAttachmentElement, this));this.element.on("click",".u_cbox_area_quotecomment",$.proxy(this.clickMoveToOriginComment,this));this.element.on("click","._cnCustomTalkArea ._cnTalkInfoOpen,._cnTalkInfoClose",$.proxy(this.clickToggleTalkInfo, this));$(document).on("click",".section_right_inner .btn_back",$.proxy(this.clickTalkBackBtn,this));$(document).on("click",".fixed_btn_wrap ._cnGoToTalkWrite",$.proxy(this.clickGoToTalkWrite,this));oCommon.fnGetPageScrollEventTarget(document).on("scroll", $.proxy(this.controlWindowScroll,this))}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"initLnb",value:function initLnb(){$("._cnTalkBtn").removeClass("hide")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(isChanged){if(lastResponsiveSizeType.deviceType==="Pc")$("._cnGoToTalkWrite").hide();this.initTalkScroll(this.element.find("._cnAttachmentScrollArea .scroll_area")); this.initTalkScroll(this.element.find("._cnTalkRegionBtn .scroll_area"));this.initTalkScroll(this.element.find("._cnTalkCityRegionBtn .scroll_area"))}}}, {key:"enableTalk",value:function enableTalk(){this.openTalk()}}, {key:"openTalk",value:function openTalk(){if(oCommon.fnGetScrollTop()!==0)oCommon.fnMoveScrollToTarget("#container");$(".fixed_btn_wrap ._cnTalkBtn").addClass("hide");$(".section_center").addClass("talk"); $("#wrap").addClass("wrap_talk");if(this.isEnabled===false){this.initComment(this.talkRegionCode,this.talkCategoryRegionCode);this.isEnabled=true}}}, {key:"initShare",value:function initShare(){var element=$(".naver-splugin.btn_sns_share");element.attr("data-url",this.getCurrentShareRegionUrl())}}, {key:"getCurrentShareRegionUrl",value:function getCurrentShareRegionUrl(){var objectRegionCode=this.talkRegionCode;var categoryRegionCode=this.talkCategoryRegionCode==="00"||this.talkRegionCode===this.talkCategoryRegionCode? "":"/".concat(this.talkCategoryRegionCode);return"".concat(spluginURL,"/talk/").concat(objectRegionCode).concat(categoryRegionCode)}}, {key:"setUpTalkPersist",value:function setUpTalkPersist(objectRegionCode,categoryRegionCode){this.talkPersist=new eg.Persist(this.talkPersistName);var oData=this.talkPersist.get("");if(oData){if(oData.isTalkOn=== true){$(".fixed_btn_wrap ._cnTalkBtn").addClass("hide");$(".section_center").addClass("talk");$("#wrap").addClass("wrap_talk")}this.isPrivacyLocation=oData.isPrivacyLocation;objectRegionCode=oData.talkRegionCode; categoryRegionCode=oData.talkCategoryRegionCode;this.isSwitchRegionByElement=oData.isSwitchRegionByElement}return{objectRegionCode:objectRegionCode,categoryRegionCode:categoryRegionCode}}}, {key:"initCommentWithTalkTab",value:function initCommentWithTalkTab(talkRegionCode,talkCategoryRegionCode,talkTab){var categoryRegionCode="00",objectRegionCode="00";if(talkTab&&(talkTab==="city"||talkTab=== "keep"))this.talkTab=talkTab;if(talkRegionCode){talkRegionCode=encodeURIComponent(talkRegionCode);if(talkRegionCode.length===2)objectRegionCode=talkRegionCode}if(talkCategoryRegionCode){talkCategoryRegionCode= encodeURIComponent(talkCategoryRegionCode);if(talkCategoryRegionCode.length===5)categoryRegionCode=talkCategoryRegionCode}else categoryRegionCode=objectRegionCode;this.isSpreadObject=true;this.setLastRegionCode(objectRegionCode, categoryRegionCode);if(this.talkTab!=="keep")this.initScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(objectRegionCode,categoryRegionCode)}}, {key:"initComment",value:function initComment(talkRegionCode,talkCategoryRegionCode){talkRegionCode=encodeURIComponent(talkRegionCode);talkCategoryRegionCode=encodeURIComponent(talkCategoryRegionCode); this.initCommentConfig(talkRegionCode,talkCategoryRegionCode);window.__htCboxOption=this.commentOption;var s=document.createElement("script");s.type="text/javascript";s.charset="utf-8";s.src=this.commentOption.sDomain+ "/js/cbox.core.js?v\x3d"+Math.floor((new Date).getTime()/12E5);(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}}, {key:"initCommentConfig",value:function initCommentConfig(talkRegionCode,talkCategoryRegionCode){var staticDomain="https://alpha-static-cbox.naver.net";var apiDomain="https://dev.apis.naver.com/commentBox/cbox12"; var cssUrlPath="/uit-weather/preview/branches/".concat(devCssBranch,"/css/comment_meet_talktalk_w.css");var cssUrl="".concat(baseURL).concat(cssUrlPath);if(phase==="real"||phase==="staging"){staticDomain= "https://ssl.pstatic.net/static.cbox";apiDomain="https://apis.naver.com/commentBox/cbox12";cssUrl=""}else if(phase==="local")cssUrl="https://pages.navercorp.com".concat(cssUrlPath);var isWrite=true;this.talkRegionCode= talkRegionCode;this.talkCategoryRegionCode=talkCategoryRegionCode;var _this$getCommentRegio=this.getCommentRegionConfigInfoByRegionCode(talkRegionCode,talkCategoryRegionCode),objectRegionInfo=_this$getCommentRegio.objectRegionInfo, categoryRegionInfo=_this$getCommentRegio.categoryRegionInfo;this.currentCommentObjectRegionConfigInfo=objectRegionInfo;this.currentCommentCategoryRegionConfigInfo=categoryRegionInfo;this.commentOption.sCategoryId= "";if(this.talkRegionCode==="00"&&this.talkType==="region-category"){isWrite=false;this.commentOption.sListType="group";this.commentOption.sLikeItId=this.currentCommentObjectRegionConfigInfo.objectId;if(this.isForceKeepCommentNone()=== true)this.commentOption.sListType="object"}else if(this.currentCommentObjectRegionConfigInfo&&!this.currentCommentCategoryRegionConfigInfo&&this.talkType==="region-category"){isWrite=false;this.commentOption.sLikeItId= this.currentCommentObjectRegionConfigInfo.objectId;this.commentOption.sListType="object"}else if(this.currentCommentObjectRegionConfigInfo&&this.currentCommentCategoryRegionConfigInfo&&this.talkType=== "region-category"){this.commentOption.sListType="category";this.commentOption.sCategoryId=this.currentCommentCategoryRegionConfigInfo.categoryId;this.commentOption.sLikeItId=this.currentCommentCategoryRegionConfigInfo.categoryId}else if(this.talkType!== "region-category")this.commentOption.sListType="object";else{this.talkTab="city";this.setLastRegionCode("00","00");this.initComment("00","00");return}if(this.isPrivacyLocation===false)isWrite=true;if(this.isNotAllowLocationAndEntire())this.commentOption.htMessage.template.write_placeholder= "\uc9c0\uc5ed \uc120\ud0dd \ud6c4 \uba54\uc2dc\uc9c0\ub97c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.";else this.commentOption.htMessage.template.write_placeholder="\uba54\uc2dc\uc9c0\ub97c \uc785\ub825\ud574\uc8fc\uc138\uc694."; this.initShare();this.setCommentFormation(isWrite);this.commentOption.sGroupId=this.currentCommentObjectRegionConfigInfo.groupId;this.commentOption.sObjectId=this.currentCommentObjectRegionConfigInfo.objectId; this.commentOption.sDomain=staticDomain;this.commentOption.sApiDomain=apiDomain;this.commentOption.sCssUrl=cssUrl;this.commentOption.sTemplateId=this.commentTemplateId;if(this.initCommentNo)this.isDisableAutoUpdate= true}}, {key:"getCommentApiDomain",value:function getCommentApiDomain(){var apiDomain="https://dev.apis.naver.com";if(phase==="real"||phase==="staging")apiDomain="https://apis.naver.com";return apiDomain}}, {key:"initAttachmentArea",value:function initAttachmentArea(){var _this3=this;if(this.mediaViewerType==="NONE")return;var template="_idTalkAttachment";var oTemplate=Handlebars.getTemplateSync(template); var elContent=oTemplate({"blockPageNameEn":blockPageNameEn,"clickCode":this.clickCode});if(this.talkType==="region-category")$(elContent).insertAfter("._cnCustomTalkArea");else if(this.element.find(".u_cbox_paginate .u_cbox_btn_more_pre").length=== 0)$(elContent).insertBefore(".u_cbox_content_wrap");else $(elContent).insertBefore($(".u_cbox_paginate .u_cbox_btn_more_pre").parent());var _this=this;var minViewSize=7;var attachmentArea=this.element.find("._cnAttachmentArea"); var ticket=this.commentOption.sTicket;var groupId=this.commentOption.sGroupId?this.commentOption.sGroupId:"";var objectId=this.commentOption.sObjectId?this.commentOption.sObjectId:"";var categoryId=this.commentOption.sCategoryId? this.commentOption.sCategoryId:"";var listType=this.commentOption.sListType;var apiDomain=this.getCommentApiDomain();var mediaViewerConfigApi="".concat(apiDomain,"/commentBox/cbox/web_naver_config_info_json.json?pool\x3dcbox12\x26ticket\x3d").concat(ticket, "\x26type\x3dmediaviewer\x26lang\x3dko");var param="";var callMediaViewerConfigFunc=new Promise(function(resolve,reject){return new $.ajax({method:"GET",url:mediaViewerConfigApi,success:function success(data){var _data$result; resolve((data===null||data===void 0?void 0:(_data$result=data.result)===null||_data$result===void 0?void 0:_data$result.type)||"NONE")}, error:function error(xhr,status,_error){reject({"error":_error,"url":mediaViewerConfigApi})}})}); callMediaViewerConfigFunc.then(function(mediaViewerType){var listApi="".concat(apiDomain,"/commentBox/cbox/web_naver_attachment_list_json.json?viewType\x3d").concat(mediaViewerType,"\x26pool\x3dcbox12\x26ticket\x3d").concat(ticket); var countApi="".concat(apiDomain,"/commentBox/cbox/web_naver_attachment_count_json.json?pool\x3dcbox12\x26ticket\x3d").concat(ticket);switch(listType){case "group":param+="\x26groupId\x3d".concat(groupId); param+="\x26listType\x3dgroup";attachmentArea.data("groupId",groupId);break;case "object":param+="\x26objectId\x3d".concat(objectId);param+="\x26listType\x3dobject";attachmentArea.data("objectId",objectId); break;case "category":param+="\x26objectId\x3d".concat(objectId,"\x26categoryId\x3d").concat(categoryId);param+="\x26listType\x3dcategory";attachmentArea.data("objectId",objectId);attachmentArea.data("categoryId", categoryId);break}listApi+=param;countApi+=param;if(mediaViewerType==="NONE"){_this.element.find("._cnAttachmentAreaLoading").removeClass("active");return null}else return Promise.all([_this.attachmentCountApi(countApi, mediaViewerType),_this.attachmentListApi(listApi,minViewSize)])}).then(function(result){_this.element.find("._cnAttachmentAreaLoading").removeClass("active"); if(result&&result.length===2&&result[0]>=minViewSize&&result[1]===true){_this.element.find("._cnAttachmentArea").addClass("active");_this.initTalkScroll(_this3.element.find("._cnAttachmentScrollArea .scroll_area")); var lazyImages=[].slice.call(_this.element.find("._cnImageLazy"));_this.lazyLoadFunc(lazyImages)}})["catch"](function(error){_this.element.find("._cnAttachmentAreaLoading").removeClass("active"); oCommon.fnSendErrorToNelo("[regionTalk.js] \ubaa8\uc544\ubcf4\uae30 API \ud638\ucd9c\uc2e4\ud328 ".concat(error===null||error===void 0?void 0:error.url),null)})}}, {key:"attachmentCountApi",value:function attachmentCountApi(url,mediaViewerType){var _this=this;return new Promise(function(resolve,reject){return new $.ajax({method:"GET",url:url,success:function success(data){var imageCount= 0;var videoCount=0;var totalCount=0;try{imageCount=Number(data.result.imageCount);videoCount=Number(data.result.videoCount);_this.element.find("._cnAttachmentImageCount").html(imageCount);_this.element.find("._cnAttachmentVideoCount").html(videoCount); totalCount=imageCount+videoCount;if(mediaViewerType==="IMAGE"){totalCount-=videoCount;_this.element.find("._cnAttachmentVideoCountLi").remove()}else if(mediaViewerType==="VIDEO"){totalCount-=imageCount; _this.element.find("._cnAttachmentImageCountLi").remove()}}catch(error){reject({"error":error,"url":url})}resolve(totalCount)}, error:function error(xhr,status,_error2){reject({"error":_error2,"url":url})}})})}}, {key:"attachmentListApi",value:function attachmentListApi(url,minViewSize){var _this=this;return new Promise(function(resolve,reject){return $.ajax({method:"GET",url:url,xhrFields:{withCredentials:true}, success:function success(data){try{if(data&&data.result&&data.result.attachmentList){var list=data.result.attachmentList.filter(function(data){return data.commentInfo.userReport===false&&data.commentInfo.hiddenByCleanbot=== false}).slice(0,minViewSize); var html="";for(var i in list){var attachmentInfo=list[i];try{attachmentInfo.commentInfo.regDate=cbox.Date.ago(attachmentInfo.commentInfo.regDate,data.date)}catch(e){attachmentInfo.commentInfo.regDate= null}var type=attachmentInfo.attachment.type;var thumbnail=attachmentInfo.attachment.thumbnail;var filename=attachmentInfo.attachment.fileName;var metaInfoTitle=attachmentInfo.metaInfo.title;var videoClass= type==="VIDEO"?" video":"";var attachmentInfoStr=encodeURIComponent(JSON.stringify(attachmentInfo));if(metaInfoTitle.split(" ").length>1)metaInfoTitle=metaInfoTitle.replace(" ","\x3cbr\x3e");var metaInfoHtml= _this.talkType==="region-category"?'\x3cspan class\x3d"area"\x3e'.concat(metaInfoTitle,"\x3c/span\x3e"):"";html+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"attachment_link'.concat(videoClass, ' _cnAttachmentElement" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this.clickCode,'roundup\')" data-info\x3d"').concat(attachmentInfoStr,'"\x3e\n \x3cimg class\x3d"_cnImageLazy" src\x3d"https://ssl.pstatic.net/static/m/weather/2011/im/bl4.png" data-src\x3d"').concat(thumbnail, '" onerror\x3d"this.parentNode.className +\x3d \' thumb_ready\';" width\x3d"100" height\x3d"145" alt\x3d"').concat(filename,'"\x3e\n ').concat(metaInfoHtml,"\n \x3c/a\x3e\n \x3c/li\x3e\n ")}_this.element.find("._cnAttachmentList").html(html); resolve(true)}else resolve(false)}catch(error){reject({"error":error,"url":url})}}, error:function error(xhr,status,_error3){reject({"error":_error3,"url":url})}})})}}, {key:"lazyLoadFunc",value:function lazyLoadFunc(lazyImages){var _this=this;setTimeout(function(){lazyImages.forEach(function(lazyImage){lazyImage.src=$(lazyImage).data("src");lazyImage.classList.remove("_cnImageLazy"); lazyImage.onload=function(){var thumbnailClass=this.height>this.width?" wide":" long";$(this).parent("._cnAttachmentElement").addClass(thumbnailClass)}; lazyImages=lazyImages.filter(function(image){return image!==lazyImage})})},200)}}, {key:"initMediaViewer",value:function initMediaViewer(selectAttachment,usePushHistory){var _this4=this;var _this=this;var attachmentArea=this.element.find("._cnAttachmentArea");var groupId=attachmentArea.data("groupId"); var objectId=attachmentArea.data("objectId");var categoryId=attachmentArea.data("categoryId");var snsShareStyle="standard";var title="";var apiDomain=this.getCommentApiDomain();var apiInfo={domain:apiDomain, staticParam:{"pool":"cbox12","ticket":this.commentOption.sTicket},pageSize:20};if(groupId)apiInfo.staticParam.groupId=groupId;if(objectId)apiInfo.staticParam.objectId=objectId;if(categoryId)apiInfo.staticParam.categoryId= categoryId;if(deviceType==="pc")snsShareStyle="unity-v2";var viewerType="IMAGE";if(selectAttachment&&selectAttachment.attachment&&selectAttachment.attachment.type)viewerType=selectAttachment.attachment.type; if(this.mediaViewerTitle)title=this.mediaViewerTitle;var mediaViewerList={defaultType:viewerType};if(this.mediaViewerType!=="ALL")if(this.mediaViewerType==="IMAGE"){mediaViewerList.hiddenType="VIDEO";mediaViewerList.defaultType= "IMAGE"}else if(this.mediaViewerType==="VIDEO"){mediaViewerList.hiddenType="IMAGE";mediaViewerList.defaultType="VIDEO"}var shareTitle="\uc774\uc288\uc5d0 \ub300\ud55c \ub2e4\uc591\ud55c \uc758\uacac\uc744 \ub0a8\uaca8\uc8fc\uc138\uc694!"; var shareSourceName="";if(typeof snsShareInfoTitle!=="undefined")shareTitle=snsShareInfoTitle;if(typeof snsShareInfoSourceName!=="undefined")shareSourceName=snsShareInfoSourceName;var isShowArea=this.talkType=== "region-category";__mediaViewer.init({wrapper:document.querySelector("._media_viewer"),useHistoryBackOnCloseButton:deviceType==="mobile",list:mediaViewerList,apiInfo:apiInfo,viewer:{titles:{badge:"\uc624\ud508\ud1a1", title:title},commentWrapperId:"cbox_module",firstData:selectAttachment||null,onInitShareButton:function onInitShareButton(shareButton,data){$(shareButton).addClass("naver-splugin").attr({"data-style":snsShareStyle, "data-url":"".concat(_this.getCurrentShareRegionUrl(),"?commentNo\x3d").concat(data.commentInfo.commentNo),"data-source-name":shareSourceName,"data-title":shareTitle,"data-cafe-source-form":"2"});window.__splugin.init()}, showCommentBtn:this.isReferenceComment==="true"},showArea:isShowArea,onClickUIElement:function onClickUIElement(event,currentUIName){switch(currentUIName){case "list-item":_this4.pushHistory({state:{path:"talk/mediaViewer/viewer"}}); break;case "viewer-original-btn":case "viewer-comment-btn":_this4.pushHistory({state:{path:"talk"}});break}var clickCodeMap={"tab-photo":"".concat(blockPageNameEn,".").concat(_this.clickCode,"ruptap"), "tab-video":"".concat(blockPageNameEn,".").concat(_this.clickCode,"ruptab"),"list-back-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"rupback"),"list-item":"".concat(blockPageNameEn,".").concat(_this.clickCode, "rupcontent"),"viewer-back-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewclose"),"viewer-prev-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewnavi"),"viewer-next-btn":"".concat(blockPageNameEn, ".").concat(_this.clickCode,"viewnavi"),"viewer-original-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"vieworigin"),"viewer-share-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode, "viewshare"),"viewer-comment-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewreply")};var clickCode=clickCodeMap[currentUIName];if(clickCode)oCommon.fnSendClick(event,clickCode)}}).then(function(_ref2){var initModuleName= _ref2.initModuleName; if(!usePushHistory)return;switch(initModuleName){case "list":_this4.pushHistory({state:{path:"talk/mediaViewer/list"}});break;case "viewer":_this4.pushHistory({state:{path:"talk/mediaViewer/viewer"}}); break}})}}, {key:"clickAttachmentMore",value:function clickAttachmentMore(e){e.preventDefault();cbox.Interface.openMediaViewer({darkMode:this.darkModeValue})}}, {key:"clickAttachmentElement",value:function clickAttachmentElement(e){e.preventDefault();var current=$(e.currentTarget);var attachmentInfoStr=current.data("info");var attachmentInfo=null;if(attachmentInfoStr)attachmentInfo= JSON.parse(decodeURIComponent(attachmentInfoStr));if(attachmentInfo)cbox.Interface.openMediaViewer({attachmentId:attachmentInfo.attachment.attachmentId,darkMode:this.darkModeValue})}}, {key:"setScrollPositionInfo",value:function setScrollPositionInfo(names){for(var i in names){var name=names[i];if(oCommon.oScroll.hasOwnProperty(name)){var talkRegionBtnScroll=oCommon.oScroll[name];if(talkRegionBtnScroll!== undefined){this.talkRegionBtnScrollPositionInfo[name].x=talkRegionBtnScroll.x;if(talkRegionBtnScroll.options.snap===true)this.talkRegionBtnScrollPositionInfo[name].pageX=talkRegionBtnScroll.currentPage.pageX}}}}}, {key:"initScrollPositionInfo",value:function initScrollPositionInfo(names){for(var i in names){var name=names[i];this.talkRegionBtnScrollPositionInfo[name]={x:null,pageX:null}}}}, {key:"getCommentRegionConfigInfoByRegionCode",value:function getCommentRegionConfigInfoByRegionCode(objectRegionCode,categoryRegionCode){var objectRegionInfo=null,categoryRegionInfo=null;if(objectRegionCode){var key= "cd_".concat(objectRegionCode);objectRegionInfo=this.templateData[key];if(objectRegionInfo===undefined){objectRegionInfo=this.templateData["cd_00"];if(objectRegionInfo===undefined)oCommon.fnSendErrorToNelo("[regionTalk.js] \uc774\uc288 \uc9c0\uc5ed\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ".concat(objectRegionCode), null);else this.talkRegionCode="00"}}if(objectRegionInfo&&categoryRegionCode&&objectRegionCode!==categoryRegionCode){var _key="cd_".concat(categoryRegionCode);categoryRegionInfo=objectRegionInfo.subInfoMap[_key]; if(categoryRegionInfo===undefined){this.talkCategoryRegionCode=this.talkRegionCode;this.setLastRegionCode(this.talkRegionCode,this.talkCategoryRegionCode)}}return{objectRegionInfo:objectRegionInfo,categoryRegionInfo:categoryRegionInfo}}}, {key:"isNotAllowLocationAndEntire",value:function isNotAllowLocationAndEntire(){return this.isPrivacyLocation===false&&this.currentCommentObjectRegionConfigInfo.regionCode==="00"}}, {key:"setCommentFormation",value:function setCommentFormation(isWrite){var formation=[];formation.push("count");if(isWrite||this.isReferenceWrite)formation.push("write");formation.push("list");formation.push("page"); this.commentOption.aFormation=formation;return formation}}, {key:"isAutoUpdateEnable",value:function isAutoUpdateEnable(){var autoIco=$("#cbox_module .u_cbox_ico_refresh_auto");return autoIco&&autoIco.html()==="ON"}}, {key:"disableAutoUpdate",value:function disableAutoUpdate(){var refresh=cbox.Interface.refresh("cbox_module");if(refresh.running()){refresh.toggle();this.isDisableAutoUpdate=false}}}, {key:"initFixedTalkBtn",value:function initFixedTalkBtn(){var element=$(".fixed_btn_wrap");var userAgent=navigator.userAgent;if(userAgent.indexOf("NAVER")>=0)element.addClass("fixed_btn_app");element.append('\n \x3cbutton type\x3d"button" class\x3d"btn_float_talk _cnTalkBtn" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'floating\')"\x3e\n \x3cspan class\x3d"blind"\x3e\uc81c\ubcf4\ud1a1\x3c/span\x3e\n \x3c/button\x3e\n '));element.append('\n \x3ca href\x3d"#" class\x3d"btn_upload _cnGoToTalkWrite" style\x3d"display:none"\x3e\n \x3cspan class\x3d"text_upload"\x3e\uc81c\ubcf4\ud558\uae30\x3c/span\x3e\n \x3c/a\x3e\n '); this.controlScrollGoToWriteFloating(oCommon.fnGetScrollTop())}}, {key:"setFixedTalkBtnCountBadge",value:function setFixedTalkBtnCountBadge(e){var badgeElement=$("._cnTalkBtn .talk_number");var count=e.oJson.result.count.total;if(count>0){var countWithComma=String(count).replace(/(.)(?=(\d{3})+$)/g, "$1,");if(badgeElement.length===0){var siblingElement=$("._cnTalkBtn .blind");siblingElement.after('\x3cspan class\x3d"talk_number"\x3e'.concat(countWithComma,"\x3c/span\x3e"))}else badgeElement.html(countWithComma)}else if(badgeElement.length> 0)badgeElement.remove();this.setCustomCommentNone();if(this.persistCommentNo!==null){cbox.Interface.move("cbox_module",this.persistCommentNo);this.persistCommentNo=null}}}, {key:"sendClickCode",value:function sendClickCode(e){var clickActionCode=null;switch(e.clickCode){case "RPO.refresh":clickActionCode="refresh";break;case "RPO.autooff":case "RPO.autoon":clickActionCode= "autoup";break;case "RPC.input":clickActionCode="write";break}if(clickActionCode)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(clickActionCode))}}, {key:"initTalkPersist",value:function initTalkPersist(){var _this5=this;var oData=this.talkPersist.get("");if(oData&&oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")if(oData.isAutoUpdate===true)$(".u_cbox_btn_refresh").click(); else{if(oData.commentNo&&cbox){$(".u_cbox_btn_refresh").click();this.moveTopComment();this.persistCommentNo=oData.commentNo}setTimeout(function(){return _this5.disableAutoUpdate()},500)}this.talkPersist.remove("")}}, {key:"initCustomCommentInputBox",value:function initCustomCommentInputBox(isForce){if(this.talkType==="region-category"){if(!this.isCommentWrite()||isForce===true){var elContent='\n \x3cdiv class\x3d"before_write _cnCommentInputBox" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'jointlk\',false, true)"\x3e\n \x3cspan class\x3d"before_write_text"\x3e\n \uba54\uc2dc\uc9c0\ub97c \uc785\ub825\ud574\uc8fc\uc138\uc694.\n \x3c/span\x3e\n \x3cdiv class\x3d"btn_sticker"\x3e\x26nbsp;\x3c/div\x3e\n \x3cdiv class\x3d"btn_image"\x3e\x26nbsp;\x3c/div\x3e\n \x3cdiv class\x3d"btn_video"\x3e\x26nbsp;\x3c/div\x3e\n \x3cdiv class\x3d"btn_upload"\x3e\ub4f1\ub85d\x3c/div\x3e\n \x3c/div\x3e'); $(elContent).insertAfter(".u_cbox_head")}}else this.element.find(".talk_cmt_box").addClass("select_none")}}, {key:"initRegionSelectBox",value:function initRegionSelectBox(){if(this.isReferenceWrite===true){this.isReferenceWrite=false;if(cbox){this.isDisableAutoUpdate=true;cbox.Interface.openReference("cbox_module", this.forceOpenReferenceInfo.commentNo)}}if(this.isCommentWrite()&&this.talkType==="region-category"){var name="".concat(this.currentCommentObjectRegionConfigInfo.shortName);if("".concat(this.currentCommentObjectRegionConfigInfo.regionCode)!== "17")name+=" ".concat(this.currentCommentCategoryRegionConfigInfo.shortName);var html='\n \x3cdiv class\x3d"area_select_wrap _cnCommentWriteRegionBox" style\x3d""\x3e\n \x3c!-- [D] \ud68c\uc0c9 \uc544\uc774\ucf58 \ub178\ucd9c\uc2dc none \ud074\ub798\uc2a4 \ucd94\uac00 --\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_location_info _cnTalkCurrentLocation" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'myloc\', false, true)"\x3e\n \x3cspan class\x3d"blind"\x3e\ud604\uc704\uce58\ub85c\x3c/span\x3e\n \x3c/button\x3e\n \x3cspan class\x3d"area_text"\x3e').concat(name, '\x3c/span\x3e\n \x3ca href\x3d"#" class\x3d"area_change _cnSearchChangeRegion" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,"locedit')\"\x3e\ud1a1 \uc9c0\uc5ed \ubcc0\uacbd\x3c/a\x3e\n \x3c/div\x3e\n "); if(this.element.find("._cnCommentWriteRegionBox").length===0)$(".u_cbox_write_wrap").prepend(html);else this.element.find("._cnCommentWriteRegionBox").removeClass("hide")}}}, {key:"initTalkRegionBtn",value:function initTalkRegionBtn(){if(this.talkType==="region-category"){var locationSelectArea=this.element.find(".location_select_area");var template="_idTalkCategoryRegionBtnTemplate"; var oTemplate=Handlebars.getTemplateSync(template);var elContent=oTemplate({"blockPageNameEn":blockPageNameEn,"clickCode":this.clickCode,"type":"meetTalk"});if(this.element.find(".u_cbox_paginate .u_cbox_btn_more_pre").length=== 0)$(elContent).insertBefore(".u_cbox_content_wrap");else $(elContent).insertBefore($(".u_cbox_paginate .u_cbox_btn_more_pre").parent());if(this.talkTab==="keep"){var keepShowType=this.initKeepTab(this.keepLastObjectRegionCode, this.keepLastCategoryRegionCode);this.element.find("._cnCustomTalkArea").removeClass("city").removeClass("district").addClass(keepShowType);this.element.find("._cnCityTab").removeClass("on");this.element.find("._cnKeepTab").addClass("on"); this.initTalkScroll(this.element.find("._cnTalkRegionKeepBtn .scroll_area"));this.scrollToRegionBtn(this.element.find("._cnTalkRegionKeepBtnScroll").data("name"));locationSelectArea.removeClass("city").removeClass("district").addClass("keep")}else{var cityShowType= this.initCityTab();this.element.find("._cnCustomTalkArea").removeClass("keep").addClass(cityShowType);this.element.find("._cnCityTab").addClass("on");this.element.find("._cnKeepTab").removeClass("on"); this.initTalkScroll(this.element.find("._cnTalkRegionBtn .scroll_area"));this.initTalkScroll(this.element.find("._cnTalkCityRegionBtn .scroll_area"));if(this.element.find("._cnCustomTalkArea").hasClass("district"))this.scrollToRegionBtn(this.element.find("._cnTalkRegionBtnScroll").data("name")); this.scrollToRegionBtn(this.element.find("._cnTalkCityRegionBtnScroll").data("name"));locationSelectArea.removeClass("keep").addClass(this.lastShowTypeList.join(" "))}}this.initAttachmentArea();if(this.initCommentNo){cbox.Interface.move("cbox_module", this.initCommentNo);this.initCommentNo=""}else if(this.beforeActiveRegionBtnFloating){this.moveTopComment();this.beforeActiveRegionBtnFloating=false}}}, {key:"initCityTab",value:function initCityTab(){var _this6=this;var _this=this;var objectConfigInfoToTemplateDataFunc=function objectConfigInfoToTemplateDataFunc(info,idx){var isOn="".concat(info.regionCode)=== "".concat(_this.cityLastObjectRegionCode)?" on":"";var clickCode="".concat(blockPageNameEn,".").concat(_this.clickCode,"sidobtn");var isNew=false;if(!isOn&&info.regionCode!=="00"&&idx<4&&info.hourlyCount> 0)isNew=true;isNew=isNew?" new":"";return'\n \x3cli id\x3d"_idCityRegionBtnLi-'.concat(info.regionCode,'"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(info.regionCode, '" class\x3d"area_link').concat(isOn).concat(isNew,' _cnObjectRegionBtn" data-region-code\x3d"').concat(info.regionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(clickCode,"')\"\x3e\n ").concat(info.shortName, '\n \x3cspan class\x3d"blind new_text"\x3e\uc0c8 \ub313\uae00 \uc788\uc74c\x3c/span\x3e\n \x3c/a\x3e\n \x3c/li\x3e\n ')}; var showType="city";var objectDataList=this.commentRegionConfigInfoList.map(objectConfigInfoToTemplateDataFunc);var categoryDataList=[];var spread=this.isSpreadObject?"spread":"";var objectConfigInfo=this.templateData["cd_".concat(this.cityLastObjectRegionCode)]; var categoryConfigInfoToTemplateDataFunc=function categoryConfigInfoToTemplateDataFunc(info,idx){var isOn="".concat(_this.cityLastCategoryRegionCode)==="".concat(info.regionCode)?" on":"";return'\n \x3cli id\x3d"_idRegionBtnLi-'.concat(info.regionCode, '"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(info.regionCode,'" class\x3d"area_link').concat(isOn,' _cnCategoryRegionBtn" data-region-code\x3d"').concat(info.regionCode,'" data-upper-region-code\x3d"').concat(objectConfigInfo.regionCode, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this6.clickCode,"sigunbtn')\"\x3e\n ").concat(info.shortName,"\n \x3c/a\x3e\n \x3c/li\x3e\n ")}; if(objectConfigInfo&&objectConfigInfo.regionCode!=="00"){var categoryList=Object.values(objectConfigInfo.subInfoMap);categoryList.unshift({"shortName":"\uc804\uccb4","regionCode":objectConfigInfo.regionCode}); categoryDataList=categoryList.map(categoryConfigInfoToTemplateDataFunc);if(categoryDataList.length>0)showType="".concat(showType," district")}this.element.find("._cnObjectBtnArea").addClass(spread);this.element.find("._cnObjectRegionList").html(objectDataList.join("")); this.element.find("._cnObjectSpreadBtn").addClass(spread);this.element.find("._cnCategoryRegionList").html(categoryDataList.join(""));return showType}}, {key:"initKeepTab",value:function initKeepTab(initObjectRegionCode,initCategoryRegionCode){var _this7=this;var keepList=this.getKeepList();var showType="search keep";var resultHtml="";if(this.currentLocationCategoryRegionCode&& this.currentLocationCategoryRegionCode.length===5){keepList=keepList.filter(function(v){return"".concat(v)!=="".concat(_this7.currentLocationCategoryRegionCode)}); keepList.unshift(this.currentLocationCategoryRegionCode)}else{resultHtml='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"area_link _cnTalkCurrentLocation my" data-region-code\x3d"" data-upper-region-code\x3d"" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,"myloc')\"\x3e\n \ub0b4\uc704\uce58\n \x3c/a\x3e\n \x3c/li\x3e\n ");if(!keepList.find(function(e){return"".concat(e)=== "".concat(initCategoryRegionCode)})){var latelyRegionCode=keepList[0]; if(latelyRegionCode&&latelyRegionCode!==initCategoryRegionCode){var _this$splitRegionCode2=this.splitRegionCodeToObjectAndCategory(latelyRegionCode),objectRegionCode=_this$splitRegionCode2.objectRegionCode, categoryRegionCode=_this$splitRegionCode2.categoryRegionCode;this.setLastRegionCode(objectRegionCode,categoryRegionCode);this.initComment(objectRegionCode,categoryRegionCode);return}}}if(initObjectRegionCode=== "00"&&initObjectRegionCode===initCategoryRegionCode){initObjectRegionCode=this.keepLastObjectRegionCode;initCategoryRegionCode=this.keepLastCategoryRegionCode}if(initCategoryRegionCode!=="00"&&!keepList.find(function(v){return"".concat(v)=== "".concat(initCategoryRegionCode)}))keepList.push(initCategoryRegionCode); for(var i in keepList){var regionCode=keepList[i];var _this$splitRegionCode3=this.splitRegionCodeToObjectAndCategory(regionCode),_objectRegionCode=_this$splitRegionCode3.objectRegionCode,_categoryRegionCode= _this$splitRegionCode3.categoryRegionCode;var objectRegionInfo=this.getRegionInfo(_objectRegionCode);var categoryRegionInfo=this.getRegionInfo(_categoryRegionCode);var isOn="".concat(_objectRegionCode)=== "".concat(initObjectRegionCode)&&"".concat(_categoryRegionCode)==="".concat(initCategoryRegionCode)?" on":"";var isCurrentLocation="".concat(_categoryRegionCode)==="".concat(this.currentLocationCategoryRegionCode)? " recent":"";var recentHtml="";if(isCurrentLocation===" recent")recentHtml='\n \x3cbutton type\x3d"button" class\x3d"btn_location_now _cnTalkCurrentLocation" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'myloc\', false, true)""\x3e\n \x3cspan class\x3d"blind"\x3e\ud604 \uc704\uce58 \ucc3e\uae30\x3c/span\x3e\n \x3c/button\x3e\n '); if(objectRegionInfo&&categoryRegionInfo){var name="".concat(objectRegionInfo.shortName);if("".concat(objectRegionInfo.regionCode)!=="17")name+=" ".concat(categoryRegionInfo.shortName);resultHtml+='\n \x3cli id\x3d"_idRegionBtnLi-'.concat(_categoryRegionCode, '"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(_categoryRegionCode,'" class\x3d"area_link _cnKeepRegionBtn').concat(isOn).concat(isCurrentLocation,'" data-region-code\x3d"').concat(_categoryRegionCode, '" data-upper-region-code\x3d"').concat(_objectRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,"flwbtn')\"\x3e\n ").concat(name, "\n \x3c/a\x3e\n ").concat(recentHtml,"\n \x3c/li\x3e")}}this.element.find("._cnKeepList").html(resultHtml);return showType}}, {key:"initCommentInputBoxSetUp",value:function initCommentInputBoxSetUp(){var dimmed='\x3cdiv class\x3d"talk_unable_wrap"\x3e\x26nbsp;\x3c/div\x3e';var prependClassName=".u_cbox_write_wrap";if(this.commentOption.aFormation.indexOf("write")>= 0&&$(prependClassName)[0]){$(".u_cbox_write_wrap .u_cbox_profile_area").hide();if(this.isNotAllowLocationAndEntire())$(prependClassName).prepend(dimmed)}}}, {key:"isTalkMapEnabled",value:function isTalkMapEnabled(){return oBlockScriptService.callSingletonFuncById("talkMapService","checkTalkMapEnabled")}}, {key:"clickObjectRegionBtn",value:function clickObjectRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="city";var changeRegionCode=element.data("region-code");this.setLastRegionCode(changeRegionCode, changeRegionCode);this.setScrollPositionInfo([this.element.find("._cnTalkCityRegionBtnScroll").data("name")]);this.initScrollPositionInfo([this.element.find("._cnTalkRegionBtnScroll").data("name")]);this.initComment(changeRegionCode, changeRegionCode);if(this.isTalkMapEnabled())if(changeRegionCode==="00")oBlockScriptService.callSingletonFuncById("talkMapService","enableTalkMap");else oBlockScriptService.callSingletonFuncById("talkMapService", "findSelectedRegionMarker","".concat(changeRegionCode))}}, {key:"clickCategoryRegionBtn",value:function clickCategoryRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="city";var changeRegionCode=element.data("region-code");var upperChangeRegionCode= element.data("upper-region-code");this.setLastRegionCode(upperChangeRegionCode,changeRegionCode);this.setScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(upperChangeRegionCode,changeRegionCode); if(this.isTalkMapEnabled())oBlockScriptService.callSingletonFuncById("talkMapService","findSelectedRegionMarker","".concat(changeRegionCode))}}, {key:"clickKeepRegionBtn",value:function clickKeepRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="keep";var changeRegionCode=element.data("region-code");var upperChangeRegionCode= element.data("upper-region-code");this.setLastRegionCode(upperChangeRegionCode,changeRegionCode);this.setScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(upperChangeRegionCode,changeRegionCode)}}, {key:"clickRegionSelect",value:function clickRegionSelect(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"sysloc"));var element=$(e.currentTarget);var changeRegionCode=element.val(); this.isSwitchRegionByElement=true;this.talkTab="city";this.setLastRegionCode(changeRegionCode,changeRegionCode);this.initComment(changeRegionCode,changeRegionCode)}}, {key:"getCurrentLocation",value:function getCurrentLocation(initTalkTab){var _this=this;var previewPath=isBlockPreview?"/preview":"";var path="".concat(previewPath).concat(pageJson.url);$(".section_right_inner ._cnCurrentLocationLoading").removeClass("hide"); oCommonGeoLocation.fnInit({welButton:$(event.toElement),returnType:"".concat(path,"/talk/objRegionCode/categoryRegionCode?talkTab\x3d").concat(initTalkTab),originPath:"".concat(path,"/talk"),callback:function callback(sNaverRgnCd){var aCoords= sNaverRgnCd.split(",");var sURL="/api/naverRgnCatForCoords";$.ajax({method:"GET",url:sURL,data:{lat:aCoords[0],lng:aCoords[1]}}).done(function(resp){var objectRgn=resp.regionCode.substring(0,2);var categoryRgn= resp.regionCode.substring(0,5);_this.currentLocationObjectRegionCode=objectRgn;_this.currentLocationCategoryRegionCode=categoryRgn;_this.isPrivacyLocation=true;_this.isSwitchRegionByElement=true;if(initTalkTab=== "init")_this.initComment(_this.talkRegionCode,_this.talkCategoryRegionCode);else{_this.talkTab=initTalkTab;_this.setLastRegionCode(objectRgn,categoryRgn);_this.initComment(objectRgn,categoryRgn)}$(".section_right_inner ._cnCurrentLocationLoading").addClass("hide")}).fail(function(jqXHR){$(".section_right_inner ._cnCurrentLocationLoading").addClass("hide"); oCommon.fnSendErrorToNelo("[regionTalk.js] \uc9c0\uc5ed\ucf54\ub4dc \uc870\ud68c API \ud638\ucd9c\uc2e4\ud328",jqXHR)})}})}}, {key:"openClosePrivacyLocationPopup",value:function openClosePrivacyLocationPopup(isOpen){if(isOpen){$("._cnPrivacyLocationPopup").removeClass("hide");$(".popup_dimmed").removeClass("hide")}else{$("._cnPrivacyLocationPopup").addClass("hide"); $(".popup_dimmed").addClass("hide")}}}, {key:"persistSetting",value:function persistSetting(isTalkOn,isAutoUpdate,commentNo){var elParentList=$("#content .section_right");var commentList=null;elParentList.addClass("NO_TAP_HIGHLIGHT");this.talkPersist.set("", {"talkRegionCode":this.talkRegionCode,"talkCategoryRegionCode":this.talkCategoryRegionCode,"isPrivacyLocation":this.isPrivacyLocation,"isSwitchRegionByElement":true,"isTalkOn":isTalkOn,"isAutoUpdate":isAutoUpdate!== false,"commentNo":commentNo})}}, {key:"clickPrivacyLocationAllow",value:function clickPrivacyLocationAllow(e){var element=$(e.currentTarget);var isAllow=!element.hasClass("cancel");this.openClosePrivacyLocationPopup(false);if(isAllow){this.persistSetting(true); this.getCurrentLocation()}else{this.isPrivacyLocation=false;this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}}}, {key:"clickCommentBoxLink",value:function clickCommentBoxLink(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"source"));var element=$(e.currentTarget);var newUrl=element.attr("href"); var previewPath="";var originUrl=new URL(element.attr("href"));var port=phase==="local"?"":"";var previewPathName="/preview";if(phase==="staging"||phase==="beta"||phase==="local")previewPath=window.location.pathname.includes(previewPathName)? previewPathName:"";var currentPath=pageJson.url;var pathname=originUrl.pathname;pathname=pathname.replace("/customPagePath","".concat(currentPath));newUrl="".concat(baseURL).concat(port).concat(previewPath).concat(pathname); element.attr("href",newUrl)}}, {key:"initTalkScroll",value:function initTalkScroll($targetElement){var _this8=this;oCommon.initScroll($targetElement,null,null,function(name){if(!_this8.talkRegionBtnScrollPositionInfo[name])_this8.initScrollPositionInfo([name])})}}, {key:"getTalkRegionScrollName",value:function getTalkRegionScrollName(){if(this.talkTab==="keep")return[$("._cnTalkRegionKeepBtnScroll").data("name")];else return[$("._cnTalkRegionBtnScroll").data("name"), $("._cnTalkCityRegionBtnScroll").data("name")]}}, {key:"scrollToRegionBtn",value:function scrollToRegionBtn(scrollName){var talkRegionBtnScroll=oCommon.oScroll[scrollName];if(talkRegionBtnScroll===undefined||talkRegionBtnScroll===null)return;talkRegionBtnScroll.refresh(); if(this.currentCommentCategoryRegionConfigInfo&&(scrollName==="talkRegionBtn"||scrollName==="talkRegionKeepBtn"))this.regionBtnScrollById(talkRegionBtnScroll,scrollName,"#_idRegionBtnLi-".concat(this.currentCommentCategoryRegionConfigInfo.regionCode)); else if(this.currentCommentObjectRegionConfigInfo&&scrollName==="talkCityRegionBtn")this.regionBtnScrollById(talkRegionBtnScroll,scrollName,"#_idCityRegionBtnLi-".concat(this.currentCommentObjectRegionConfigInfo.regionCode)); else if(talkRegionBtnScroll.options.snap===true)talkRegionBtnScroll.goToPage(0,0,0);else talkRegionBtnScroll.scrollTo(0,0);this.isSwitchRegionByElement=false;oCommon.controlScrollButton(talkRegionBtnScroll, oCommon.scrollElements[scrollName])}}, {key:"regionBtnScrollById",value:function regionBtnScrollById(talkRegionBtnScroll,scrollName,id){var positionX,pageX;talkRegionBtnScroll.scrollToElement(id,0,-20);if(talkRegionBtnScroll.options.snap=== true){var page=-1;var btnElement=this.element.find(id);var btnElementPositionX=btnElement.position().left+btnElement.width()/2;for(var pageNum in talkRegionBtnScroll.pages){var pageIndex=Number(pageNum); var pageInfo=talkRegionBtnScroll.pages[pageIndex][0];if(btnElementPositionX<=Math.abs(pageInfo.x)){page=pageIndex-1;break}}if(page===-1)page=talkRegionBtnScroll.pages.length-1;pageX=page}else positionX= talkRegionBtnScroll.x;if(talkRegionBtnScroll.options.snap===true)if(this.talkRegionBtnScrollPositionInfo[scrollName].x!==null)talkRegionBtnScroll.scrollTo(this.talkRegionBtnScrollPositionInfo[scrollName].x, 0);else talkRegionBtnScroll.goToPage(pageX,0,0);else if(this.talkRegionBtnScrollPositionInfo[scrollName].x!==null)talkRegionBtnScroll.scrollTo(this.talkRegionBtnScrollPositionInfo[scrollName].x,0);else talkRegionBtnScroll.scrollTo(positionX, 0)}}, {key:"clickTalkBackBtn",value:function clickTalkBackBtn(e){e&&e.preventDefault();if(deviceType==="mobile")history.back();else this.closeTalk()}}, {key:"closeTalk",value:function closeTalk(){$(".section_center").removeClass("talk");$("#wrap").removeClass("wrap_talk");$(".fixed_btn_wrap ._cnTalkBtn").removeClass("hide");var gotoTalkWriteBtn=$("._cnGoToTalkWrite"); gotoTalkWriteBtn.removeClass("fadein");gotoTalkWriteBtn.hide();if(!this.isLoadSectionCenter)this.isLoadSectionCenter=true}}, {key:"clickCommentImage",value:function clickCommentImage(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"content"));this.disableAutoUpdate()}}, {key:"spreadObjectBtn",value:function spreadObjectBtn(e){var currentBtn=$(e.currentTarget);var objectBtnArea=this.element.find("._cnObjectBtnArea");if(currentBtn.hasClass("spread")){this.isSpreadObject= false;currentBtn.removeClass("spread");objectBtnArea.removeClass("spread")}else{this.isSpreadObject=true;currentBtn.addClass("spread");objectBtnArea.addClass("spread")}}}, {key:"clickTalkTab",value:function clickTalkTab(e){e.preventDefault();var currentElement=$(e.currentTarget);var locationSelectArea=this.element.find(".location_select_area");if(currentElement.hasClass("_cnCityTab")){this.talkTab= "city";oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"tap1"));if(!this.cityLastObjectRegionCode||!this.cityLastCategoryRegionCode){this.cityLastObjectRegionCode="00";this.cityLastCategoryRegionCode= "00"}this.initComment(this.cityLastObjectRegionCode,this.cityLastCategoryRegionCode)}else{this.talkTab="keep";oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"tap2"));this.lastShowTypeList= [];if(locationSelectArea.hasClass("city"))this.lastShowTypeList.push("city");if(locationSelectArea.hasClass("district"))this.lastShowTypeList.push("district");if(!this.keepLastCategoryRegionCode)this.setLastRegionCode(this.currentLocationObjectRegionCode, this.currentLocationCategoryRegionCode);if(this.keepLastCategoryRegionCode.length<5&&this.currentLocationCategoryRegionCode&&this.currentLocationCategoryRegionCode.length>=5)this.setLastRegionCode(this.currentLocationObjectRegionCode, this.currentLocationCategoryRegionCode);else if(this.isForceKeepCommentNone()===true)this.setLastRegionCode("00","00");this.initComment(this.keepLastObjectRegionCode,this.keepLastCategoryRegionCode)}}}, {key:"getCommentKey",value:function getCommentKey(){return"".concat(this.commentKeyType,"_").concat(this.commentKey)}}, {key:"clickKeepSearch",value:function clickKeepSearch(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"search"));this.openKeepSearch();this.pushHistory({state:{path:"talk/region-search"}})}}, {key:"openKeepSearch",value:function openKeepSearch(){if(this.element.find("._cnKeepSearchArea").hasClass("active"))return;this.element.find("._cnKeepSearchArea").addClass("active");this.element.find("._cnKeepKeywordAutoComplete").addClass("hide"); this.element.find("._cnSearchHot").addClass("hide");this.element.find("._cnSearchResult").addClass("hide");this.element.find("._cnSearchRecent").removeClass("hide");var recentSearchList=this.getRecentSearchList(); var latelyListElement=this.element.find("._cnLatelyList");var searchRecentElement=this.element.find("._cnSearchRecent");var html="";for(var i in recentSearchList){var regionCode=recentSearchList[i];var _this$splitRegionCode4= this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode4.objectRegionCode,categoryRegionCode=_this$splitRegionCode4.categoryRegionCode;var objectRegionInfo=this.getRegionInfo(objectRegionCode); var categoryRegionInfo=this.getRegionInfo(categoryRegionCode);var name="".concat(objectRegionInfo.shortName);if("".concat(objectRegionInfo.regionCode)!=="17")name+=" ".concat(categoryRegionInfo.shortName); html+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"lately_link _cnLatelyResult" data-region-code\x3d"'.concat(categoryRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'history\')""\x3e').concat(name,"\x3c/a\x3e\n \x3c/li\x3e\n ")}if(recentSearchList.length===0)searchRecentElement.addClass("none");else{searchRecentElement.removeClass("none"); latelyListElement.html(html)}var searchHotElement=this.element.find("._cnSearchHot");var hotListElement=this.element.find("._cnHotList");var topList=this.getTopCategoryRegion(5);var searchHotHtml="";for(var _i in topList){var _regionCode= topList[_i];var _this$splitRegionCode5=this.splitRegionCodeToObjectAndCategory(_regionCode),_objectRegionCode2=_this$splitRegionCode5.objectRegionCode,_categoryRegionCode2=_this$splitRegionCode5.categoryRegionCode; var _objectRegionInfo=this.getRegionInfo(_objectRegionCode2);var _categoryRegionInfo=this.getRegionInfo(_categoryRegionCode2);var _name="".concat(_objectRegionInfo.shortName);if("".concat(_objectRegionInfo.regionCode)!== "17")_name+=" ".concat(_categoryRegionInfo.shortName);searchHotHtml+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"a_lot_link _cnHotResult" data-region-code\x3d"'.concat(_categoryRegionCode2, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'hotcity\')""\x3e').concat(_name,"\x3c/a\x3e\n \x3c/li\x3e\n ")}if(topList.length=== 0)searchHotElement.addClass("hide");else{searchHotElement.removeClass("hide");hotListElement.html(searchHotHtml)}var searchInput=this.element.find("._cnSearchInput");searchInput.val("");searchInput.focus(); this.element.find("._cnKeepSearch").removeClass("typing")}}, {key:"clickKeepSearchCancel",value:function clickKeepSearchCancel(e){if(deviceType==="mobile")history.back();else this.closeKeepSearch()}}, {key:"closeKeepSearch",value:function closeKeepSearch(){this.element.find("._cnSearchInput").val("");this.element.find("._cnSearchInput").blur();this.element.find("._cnSearchHot").addClass("hide");this.element.find("._cnKeepKeywordAutoComplete").addClass("hide"); this.element.find("._cnSearchRecent").removeClass("hide");this.element.find("._cnKeepSearchArea").removeClass("active");if(this.talkTab!=="keep")this.element.find(".location_select_area").removeClass("search")}}, {key:"clickSearchChangeRegion",value:function clickSearchChangeRegion(e){e.preventDefault();this.element.find(".location_select_area").addClass("search");this.clickKeepSearch(e)}}, {key:"inputKeepSearch",value:function inputKeepSearch(e){var inputValue=e.currentTarget.value;if(inputValue.length<=0){this.element.find(".form_wrap").removeClass("typing");this.element.find(".form_wrap_pc").removeClass("typing")}else{this.element.find(".form_wrap").addClass("typing"); this.element.find(".form_wrap_pc").addClass("typing")}this.updateContent(inputValue)}}, {key:"updateContent",value:function updateContent(query){var regexQuery=query.replace(new RegExp("(".concat(searchExclude,").*")),"");var acHost=phase==="local"||phase==="alpha"||phase==="beta"?"https://alpha-ac.weather.naver.com": "https://ac.weather.naver.com";var sURL=acHost+"/ac?q_enc\x3dutf-8\x26r_format\x3djson\x26r_enc\x3dutf-8\x26r_lt\x3d1\x26st\x3d1\x26q\x3d"+encodeURIComponent(regexQuery);var keepKeywordAutoComplete=this.element.find("._cnKeepKeywordAutoComplete"); var searchRecent=this.element.find("._cnSearchRecent");var searchHot=this.element.find("._cnSearchHot");var searchResult=this.element.find("._cnSearchResult");$.ajax(sURL).done(function(oResp){try{var oItems= oResp.items;if(oItems.length>0&&oItems[0].length>0){var welAutoCompleted=keepKeywordAutoComplete.find(".keyword_list");var html="";var txt="";for(var i=0;i=0;j--){var temp=txtArray[j].replace(new RegExp("("+regexQuery+")","i"),'\x3cspan class\x3d"mark"\x3e$1\x3c/span\x3e');if(temp!== txtArray[j]){txtArray[j]=temp;bReplace=true;break}}txt=txtArray.join(" ");if(!bReplace)txt=txt.replace(new RegExp("("+regexQuery+")","i"),'\x3cspan class\x3d"mark"\x3e$1\x3c/span\x3e');var regionCode=oItems[0][i][1][0]; if(!regionCode.startsWith("WD"))html+='\x3cli class\x3d"list_item"\x3e\n \x3ca href\x3d"#" data-region-code\x3d"'.concat(oItems[0][i][1],'" role\x3d"button" class\x3d"link _cnAutoCompleteResult" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'searchout\')"\x3e\n \x3ci class\x3d"ico_autocomplete"\x3e\x3c/i\x3e\n \x3cdiv class\x3d"text_area"\x3e\n \x3cspan class\x3d"main"\x3e').concat(txt, "\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3c/li\x3e")}if(html!==""){welAutoCompleted.html(html); searchRecent.addClass("hide");searchResult.addClass("hide");keepKeywordAutoComplete.removeClass("hide");$("._cnSearchResult:visible .list_item").hover(function(){$(".list_item").removeClass("over");$(this).addClass("over")}, function(){$(this).removeClass("over")})}}else if(regexQuery.length==0){searchResult.addClass("hide"); keepKeywordAutoComplete.addClass("hide");searchRecent.removeClass("hide")}}catch(e){oCommon.fnSendErrorToNelo("[regionTalk.js] \uc790\ub3d9\uc644\uc131 \ubaa9\ub85d parsing \uc624\ub958",e.description)}}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[regionTalk.js] \uc790\ub3d9\uc644\uc131 API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}}, {key:"clickSearchResult",value:function clickSearchResult(e){e.preventDefault();var current=$(e.currentTarget);var regionCode="".concat(current.data("regionCode"));if(regionCode.length>=5){var _this$splitRegionCode6= this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode6.objectRegionCode,categoryRegionCode=_this$splitRegionCode6.categoryRegionCode;var keepKeywordAutoComplete=this.element.find("._cnKeepKeywordAutoComplete"); var searchRecent=this.element.find("._cnSearchRecent");var searchHot=this.element.find("._cnSearchHot");var searchResult=this.element.find("._cnSearchResult");keepKeywordAutoComplete.addClass("hide");searchRecent.addClass("hide"); searchResult.addClass("hide");this.element.find(".layer_search_area").removeClass("active");this.element.find(".form_wrap_pc").removeClass("active");this.setLastRegionCode(objectRegionCode,categoryRegionCode); this.addKeepList(categoryRegionCode);this.addRecentSearchList(categoryRegionCode);if(this.talkTab!=="keep")this.isSpreadObject=true;this.initScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(objectRegionCode, categoryRegionCode)}}}, {key:"splitRegionCodeToObjectAndCategory",value:function splitRegionCodeToObjectAndCategory(regionCode){regionCode=encodeURIComponent(regionCode);var objectRegionCode=null;var categoryRegionCode=null;if(!regionCode.startsWith("WD")){if(regionCode.length>= 2)objectRegionCode=regionCode.substring(0,2);if(regionCode.length>=5)categoryRegionCode=regionCode.substring(0,5)}return{objectRegionCode:objectRegionCode,categoryRegionCode:categoryRegionCode}}}, {key:"getRegionInfo",value:function getRegionInfo(regionCode){var _this$splitRegionCode7=this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode7.objectRegionCode,categoryRegionCode= _this$splitRegionCode7.categoryRegionCode;var regionInfo=null;if(objectRegionCode){regionInfo=this.templateData["cd_".concat(objectRegionCode)];if(regionInfo&&categoryRegionCode)regionInfo=regionInfo.subInfoMap["cd_".concat(categoryRegionCode)]}return regionInfo}}, {key:"addRecentSearchList",value:function addRecentSearchList(regionCode){var recentResultList=this.getRecentSearchList();if(recentResultList.find(function(e){return"".concat(e)==="".concat(regionCode)}))return; if(recentResultList.length>=10)recentResultList.pop();recentResultList.unshift(regionCode);this.setCookie("NV_TLK_KEEP_RGN",recentResultList.join(","),365)}}, {key:"getRecentSearchList",value:function getRecentSearchList(){var recentSearchCookie=this.getCookie("NV_TLK_KEEP_RGN");var recentResultList=[];if(recentSearchCookie)recentResultList=recentSearchCookie.split(","); return recentResultList}}, {key:"addKeepList",value:function addKeepList(regionCode){var keepList=this.getKeepList();if(keepList.find(function(e){return"".concat(e)==="".concat(regionCode)}))return; if(keepList.length>=10)keepList.pop();keepList.unshift(regionCode);this.setCookie("NV_TLK_KEEP_RGN",keepList.join(","),365)}}, {key:"getKeepList",value:function getKeepList(){var keepCookie=this.getCookie("NV_TLK_KEEP_RGN");var keepList=[];if(keepCookie)keepList=keepCookie.split(",");return keepList}}, {key:"setLastRegionCode",value:function setLastRegionCode(objectRegionCode,categoryRegionCode){if(this.talkTab==="keep"){this.keepLastObjectRegionCode=encodeURIComponent(objectRegionCode);this.keepLastCategoryRegionCode= encodeURIComponent(categoryRegionCode)}else{this.cityLastObjectRegionCode=encodeURIComponent(objectRegionCode);this.cityLastCategoryRegionCode=encodeURIComponent(categoryRegionCode)}}}, {key:"getTopCategoryRegion",value:function getTopCategoryRegion(topN){if(!this.templateData)return[];var mergeList=Object.values(this.templateData).reduce(function(acc,cur,idx){return acc.concat(Object.values(cur.subInfoMap).filter(function(v){return v.hourlyCount> 0}))},[]); mergeList.sort(function(v1,v2){return v2.hourlyCount-v1.hourlyCount}); return mergeList.slice(0,topN).map(function(v){return v.regionCode})}}, {key:"clickSearchOutside",value:function clickSearchOutside(e){var current=$(e.target);if(this.element.find(".form_wrap_pc._cnKeepSearchArea").hasClass("active"))if(!current.hasClass("_cnSearchChangeRegion")&& !current.parents().hasClass("_cnKeepSearch")&&!current.parents().hasClass("layer_search_area")&&!current.parents().hasClass("layer_search_area_pc")&&!current.hasClass("_cnKeepSearch")){this.element.find("._cnKeepSearchArea").removeClass("active"); if(this.talkTab!=="keep")this.element.find(".location_select_area").removeClass("search")}}}, {key:"openReferenceComment",value:function openReferenceComment(e){var isCommentWrite=this.isCommentWrite();if(this.talkCategoryRegionCode.length<5&&!isCommentWrite){this.isReferenceWrite=true;this.forceOpenReferenceInfo= e;this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}if(isCommentWrite)this.element.find("._cnCommentWriteRegionBox").addClass("hide")}}, {key:"clickCurrentLocation",value:function clickCurrentLocation(e){e.preventDefault();this.getCurrentLocation(this.talkTab)}}, {key:"isCommentWrite",value:function isCommentWrite(){return this.commentOption.aFormation.find(function(v){return v==="write"})}}, {key:"afterCommentWrite",value:function afterCommentWrite(e){if(this.talkCategoryRegionCode.length<5)this.doneReferenceComment();else if(this.element.find("._cnCommentWriteRegionBox").hasClass("hide"))this.element.find("._cnCommentWriteRegionBox").removeClass("hide")}}, {key:"cancelWriteReferenceComment",value:function cancelWriteReferenceComment(){if(this.talkCategoryRegionCode.length<5)this.doneReferenceComment();else this.initRegionSelectBox()}}, {key:"doneReferenceComment",value:function doneReferenceComment(){this.isReferenceWrite=false;this.element.find(".u_cbox_write_wrap").addClass("hide");this.initCustomCommentInputBox(true);this.initComment(this.talkRegionCode, this.talkCategoryRegionCode)}}, {key:"setCustomCommentNone",value:function setCustomCommentNone(){var html='\n \x3ch6 class\x3d"u_vc"\x3e\ub313\uae00 \uc548\ub0b4\x3c/h6\x3e\n \x3cdiv class\x3d"u_cbox_con_inform"\x3e\n \x3cspan class\x3d"u_cbox_ico_comment_none"\x3e\x3c/span\x3e\n \x3cspan class\x3d"u_cbox_contents_none"\x3e\n \uc0ac\uc6a9\uc790 \uc704\uce58 \uc815\ubcf4 \uc0ac\uc6a9\uc5d0 \ub3d9\uc758\ud558\uc9c0 \uc54a\uc544,\n \x3cbr\x3e\n \ud604\uc704\uce58 \uc2dc\u00b7\uad70\u00b7\uad6c \uc81c\ubcf4\uac8c\uc2dc\ud310\uc744 \ubd88\ub7ec \uc62c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\n \x3c/span\x3e\n \x3cspan class\x3d"u_cbox_contents_none_more"\x3e\n \uc9c0\uc5ed \uac80\uc0c9\uc744 \ud1b5\ud574 \uad00\uc2ec \uc9c0\uc5ed\uc758 \uc81c\ubcf4 \uc0c1\ud669\uc744\n \x3cbr\x3e\n \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4\n \x3c/span\x3e\n \x3c/div\x3e\n '; if(this.element.find(".u_cbox_comment_none").length===1&&this.isForceKeepCommentNone()===true)this.element.find(".u_cbox_comment_none").html(html)}}, {key:"isForceKeepCommentNone",value:function isForceKeepCommentNone(){return this.talkTab==="keep"&&this.getKeepList().length===0&&(!this.currentLocationCategoryRegionCode||this.currentLocationCategoryRegionCode.length< 5)}}, {key:"moveTopComment",value:function moveTopComment(){if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.element.find(".u_cbox_content_wrap").scrollTop(0);var targetClass="";if(this.talkType=== "region-category")targetClass="._cnTalkRegionBtn";else targetClass=".u_cbox_cleanbot";oCommon.fnSetScrollTop(oCommon.fnGetScrollOffsetTop($(targetClass))-50)}}, {key:"beforeCreateComment",value:function beforeCreateComment(e){if(this.isReferenceWrite===true&&("".concat(this.talkRegionCode)==="00"||"".concat(this.talkRegionCode)==="".concat(this.talkCategoryRegionCode))){e.stop(); this.talkTab="city";this.setLastRegionCode("00","00");this.initComment("00","00")}}}, {key:"clickMoveToOriginComment",value:function clickMoveToOriginComment(e){this.disableAutoUpdate()}}, {key:"pushHistory",value:function pushHistory(param){if(deviceType==="mobile"){var _param$state;if(((_param$state=param.state)===null||_param$state===void 0?void 0:_param$state.path)!==undefined&¶m.state.path=== this.router.getCurrentPath())return;this.router.push(param)}}}, {key:"clickToggleTalkInfo",value:function clickToggleTalkInfo(e){e.preventDefault();this.element.find("._cnTalkInfoOpen").toggleClass("on")}}, {key:"clickGoToTalkWrite",value:function clickGoToTalkWrite(e){e.preventDefault();oCommon.fnSetScrollTop(oCommon.fnGetScrollOffsetTop(this.element));if(this.element.find("#cbox_module__write_textarea").length> 0)setTimeout(function(){$("#cbox_module__write_textarea").focus()},50)}}, {key:"controlScrollRegionBtnFloating",value:function controlScrollRegionBtnFloating(scrollTop){if(!$(".section_center").hasClass("talk"))return;var floatingStartTargetElement=this.element.find(".location_select_area._cnCustomTalkArea"); var floatingEndTargetElement=null;if(this.talkTab==="keep")floatingEndTargetElement=this.element.find(".district_area.keep_area");else if(this.talkTab==="city")floatingEndTargetElement=this.element.find(".district_area.city_area"); if(!floatingStartTargetElement||floatingStartTargetElement.length<=0||!floatingEndTargetElement||floatingEndTargetElement.length<=0)return;var floatingStartBottom=oCommon.fnGetScrollOffsetTop(floatingStartTargetElement)+ floatingStartTargetElement.outerHeight(true)/1.5;var floatingEndTop=oCommon.fnGetScrollOffsetTop(floatingEndTargetElement);var activeTargetClass=this.element.find(".district_area");if(scrollTopfloatingStartBottom)if(scrollTop>this.lastScrollTop){activeTargetClass.addClass("floating_out");this.beforeActiveRegionBtnFloating=false}else{activeTargetClass.removeClass("floating_out").addClass("floating_in"); this.beforeActiveRegionBtnFloating=true}this.lastScrollTop=scrollTop}}, {key:"controlScrollGoToWriteFloating",value:function controlScrollGoToWriteFloating(scrollTop){var targetClass=$("._cnGoToTalkWrite");if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc"||!$(".section_center").hasClass("talk")){targetClass.hide(); return}var scrollTargetElement=null;var listType=this.commentOption.sListType;if(listType==="category"||this.talkType!=="region-category")scrollTargetElement=this.element.find(".u_cbox_write_box");else scrollTargetElement= this.element.find("._cnCommentInputBox");if(scrollTargetElement.length<=0)return;var scrollTargetTop=scrollTargetElement.offset().top;if(scrollTop0?this.reports[0]:null;this.current=oNationBriefParser.isRenderableCurrent(first)?first:null;this._timelineHtml=this.current?this.buildTimelineHtml():"";this._activeTab="nation"; this._interacted=false;this.element.html(this.buildShellHtml());this.renderCurrentCard();this.startDeltaRolling();this.bindTimelineBottomSheet();this.initMyRegion()}}, {key:"attachEvent",value:function attachEvent(){var _this=this;this.element.on("click","._cnWeatherInfoLayer",function(e){_this._interacted=true;oCommon.fnOpenInfoLayer($(e.currentTarget))}); this.element.on("click",".card_tooltip_inner .btn_close",function(){return oCommon.fnCloseAllInfoLayer()}); this.element.on("click",".card_safety_timeline",function(e){_this._interacted=true;if(_this.bottomSheet)_this.bottomSheet.toggle();var $btn=$(e.currentTarget);$btn.attr("aria-pressed",$btn.attr("aria-pressed")=== "true"?"false":"true");oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"timeline"))}); this.element.on("click",".card_now_item[data-nav-kind]",$.proxy(this.onClickDelta,this));this.element.on("click",".tab_list_wrap .tab_link",function(e){return _this.onClickTab(e)}); this.element.on("click",".btn_safety_expand",function(e){return _this.onClickExpand(e)}); this.element.on("click","._cnMyRegionBtn",function(e){return _this.onClickMyRegion(e)}); this.element.on("click","._cnMyLink",function(e){return _this.onClickMyLink(e)}); this.element.on("click","._cnMyLocation",function(e){return _this.onClickMyLocation(e)}); this.element.on("click","._cnMyAlertOk",function(e){return _this.onClickAlertOk(e)}); this.element.on("click","._cnMyCctvBtn",function(e){return _this.onClickMyCctv(e)}); this.element.on("click","._cnMyTimeline",function(e){return _this.onClickMyTimeline(e)}); this.element.on("click","._cnMyItemFold",function(e){return _this.onClickMyItemFold(e)}); this.element.on("click","._cnMyShare",function(e){return _this.onClickMyShare(e)}); this.element.on("click","._cnMyRefresh",function(e){return _this.onClickMyRefresh(e)}); this.element.on("click","._cnMyBinaryFeedback",function(e){return _this.onClickMyBinaryFeedback(e)}); this.element.on("click","._cnMyFeedbackMore",function(e){return _this.onClickMyFeedbackMore(e)}); this.element.on("click","._cnMyFeedbackLayerBtn",function(e){return _this.onClickMyFeedbackLayer(e)}); this.element.on("change",'._cnMyFeedbackList input[type\x3d"checkbox"]',function(e){return _this.onChangeMyFeedbackCheck(e)}); this.element.on("click","._cnMyFeedbackSend",function(e){return _this.onClickMyFeedbackSend(e)})}}, {key:"onClickDelta",value:function onClickDelta(e){var $item=$(e.currentTarget);var kind=$item.data("navKind");if(!kind)return;oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode, "delta"));if(kind==="visualMap"){var type=$item.data("navType");var avail=oBlockScriptService.callTemplateFunc("visualMap","hasMapType",type);var idx=avail.findIndex(function(v){return v===true}); if(idx>=0)oBlockScriptService.callTemplateFuncWithIndex("visualMap",idx+1,"focusMapType",type)}else if(kind==="disasterSms")oCommon.fnMoveScrollToTarget("#disasterSms");else if(kind==="regionTalk"){oBlockScriptService.callTemplateFunc("regionTalk", "initCommentWithTalkTab","00","00","city");oBlockScriptService.callTemplateFunc("regionTalk","enableTalk")}}}, {key:"onClickMyLink",value:function onClickMyLink(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"mylink"));var P=oMyRegionBriefParser;var region=P.talkLayerRegion($(e.currentTarget).text(), this._shownCode);if(!region||!P.isPlainClick(e)||!P.talkBlockReady(oBlockScriptService.getTemplateInstanceInfoList("regionTalk")))return;e.preventDefault();setTimeout(function(){oBlockScriptService.callTemplateFunc("regionTalk", "initCommentWithTalkTab",region.objectRegionCode,region.categoryRegionCode,"city");oBlockScriptService.callTemplateFunc("regionTalk","enableTalk")},0)}}, {key:"onClickTab",value:function onClickTab(e){e.preventDefault();var tab=$(e.currentTarget).attr("data-tab")==="my"?"my":"nation";this._interacted=true;oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(this.clickCode,"tab").concat(tab));this.selectTab(tab)}}, {key:"selectTab",value:function selectTab(tab,auto){var _this2=this;if(tab===this._activeTab)return;if(tab==="my"&&this.element.children(".card_safety_panel_my").length===0)return;var from=this._activeTab; if(from==="my")this.safeMyRegion(function(){return _this2.closeOpenLayers("my",auto===true)}); else this.closeOpenLayers(from,auto===true);this._activeTab=tab;this.element.find(".tab_list_wrap .tab_link").each(function(i,el){$(el).toggleClass("is_on",$(el).attr("data-tab")===tab)}); this.element.children(".card_safety_panel").toggleClass("hide",tab!=="nation");this.element.children(".card_safety_panel_my").toggleClass("hide",tab!=="my");if(tab==="my")this.safeMyRegion(function(){return _this2.refreshMyScroll()})}}, {key:"closeOpenLayers",value:function closeOpenLayers(panel,keepInfoLayers){if(panel==="nation"&&this.bottomSheet&&this.bottomSheet.isOpen)this.bottomSheet.close();if(panel==="my"){if(this.myBottomSheet&& this.myBottomSheet.isOpen)this.myBottomSheet.close();if(this.myCctvService&&this.element.children(".card_safety_panel_my").find("._cnCctvLayer").length)this.myCctvService.fnHideCctv()}if(!keepInfoLayers)oCommon.fnCloseAllInfoLayer()}}, {key:"onClickExpand",value:function onClickExpand(e){var $btn=$(e.currentTarget);$btn.attr("aria-expanded",$btn.attr("aria-expanded")==="true"?"false":"true");this._interacted=true;oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(this.clickCode,"expand"))}}, {key:"_infoLayerHtml",value:function _infoLayerHtml(linkClass,category){var isPc=deviceType==="pc";var blogUrl="https://".concat(isPc?"":"m.","blog.naver.com/naver_weather/224332815506");return'\n \x3cp class\x3d"card_tooltip_text"\x3e\ub124\uc774\ubc84\uc758 AI \uae30\uc220\uc744 \ud65c\uc6a9\ud558\uc5ec, \uc804\uad6d\uc801 \uc545\ucc9c\ud6c4 \ubc1c\uc0dd \uc815\ubcf4\ub97c \uc694\uc57d \uc81c\uacf5\ud569\ub2c8\ub2e4.\x3c/p\x3e\n \x3cp class\x3d"card_tooltip_text"\x3e\ube0c\ub9ac\ud551 \uc0dd\uc131\uc5d0\ub294 \uae30\uc0c1\uccad \uc608\ubcf4 \ubc0f \ud2b9\ubcf4, \uacf5\uacf5 \uc7ac\ub09c \uc548\uc804 \uc815\ubcf4, \ub124\uc774\ubc84 \uc81c\ubcf4\ud1a1 \ud1b5\uacc4\uac00 \ud65c\uc6a9\ub429\ub2c8\ub2e4. \ub2e4\uc591\ud55c \ub370\uc774\ud130\uac00 AI \ubaa8\ub378\uc744 \ud1b5\ud574 \ubd84\uc11d\u00b7\uc694\uc57d\ub418\ub294 \uacfc\uc815\uc5d0\uc11c \ubd80\uc815\ud655\ud558\uac70\ub098 \ubd80\uc801\uc808\ud55c \ud45c\ud604\uc774 \ud3ec\ud568\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\x3c/p\x3e\n \x3cp class\x3d"card_tooltip_text"\x3e\ubcf4\ub2e4 \uc0c1\uc138\ud55c \uc11c\ube44\uc2a4 \uc548\ub0b4\ub294 \x3ca href\x3d"'.concat(blogUrl, '" class\x3d"').concat(linkClass,' type_more" target\x3d"_blank" data-nlog\x3d"blog" data-nlog-area\x3d"nation_brief.layer.blog_link" data-nlog-params\x3d\'{"category":"').concat(category,"\"}'\x3e\ub124\uc774\ubc84 \ub0a0\uc528 \uacf5\uc2dd \ube14\ub85c\uadf8\x3c/a\x3e\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\x3c/p\x3e")}}, {key:"buildShellHtml",value:function buildShellHtml(){return'\n \x3cdiv class\x3d"tab_list_wrap"\x3e\n \x3cul class\x3d"tab_list"\x3e\n \x3cli\x3e\x3ca href\x3d"#" class\x3d"tab_link is_on" data-tab\x3d"nation" data-nlog\x3d"nation_tab" data-nlog-area\x3d"nation_brief.nation_tab_link"\x3e\uc804\uad6d \ube0c\ub9ac\ud551\x3c/a\x3e\x3c/li\x3e\n \x3c/ul\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_safety_panel"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"common_alert hide" role\x3d"alertdialog" aria-modal\x3d"true"\x3e\n \x3cdiv class\x3d"common_alert_inner"\x3e\n \x3cp class\x3d"common_alert_text"\x3e\x3c/p\x3e\n \x3cdiv class\x3d"common_alert_actions"\x3e\n \x3cbutton type\x3d"button" class\x3d"common_alert_button _cnMyAlertOk" data-nlog\x3d"alert_confirm" data-nlog-area\x3d"nation_brief.alert_confirm_button"\x3e\ud655\uc778\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"renderCurrentCard",value:function renderCurrentCard(){var $panel=this.element.children(".card_safety_panel");if(!this.current){this.element.removeClass("type_high type_caution type_attention type_favorite").addClass("type_ready"); $panel.html(this.buildReadyHtml());return}var c=this.current;this.element.removeClass("type_high type_caution type_attention type_favorite type_ready").addClass(oNationBriefParser.gradeToType(c.grade)); $panel.html(this.buildPanelHtml(c))}}, {key:"buildPanelHtml",value:function buildPanelHtml(c){var cards=oNationBriefParser.flattenDeltas(c.deltas);var metaTime=oNationBriefParser.timeAge(c.insYmdt);return'\n \x3cdiv class\x3d"card_safety_panel_head"\x3e\n \x3cem class\x3d"card_safety_badge"\x3e'.concat(this.escape(oNationBriefParser.gradeToLabel(c.grade)), '\x3c/em\x3e\n \x3cstrong class\x3d"card_safety_subject"\x3e').concat(this.escape(c.headline),'\x3c/strong\x3e\n \x3cspan class\x3d"card_safety_meta"\x3e').concat(this.escape(metaTime), "\x3c/span\x3e\n \x3c/div\x3e\n ").concat(this.buildExpandHtml(cards.length),"\n ").concat(this.buildNowHtml(cards,c.grade),"\n ").concat(this.buildContentHtml(this.escape(c.briefing)), "\n ")}}, {key:"buildExpandHtml",value:function buildExpandHtml(chipCount){if(chipCount<=1)return"";return'\n \x3cbutton type\x3d"button" class\x3d"btn_safety_expand" aria-expanded\x3d"false" data-nlog\x3d"expand" data-nlog-area\x3d"nation_brief.expand_button"\x3e\x3cspan class\x3d"blind"\x3e\uc804\uad6d\ube0c\ub9ac\ud551 \ubaa9\ub85d \ud3bc\uce58\uae30/\uc811\uae30\x3c/span\x3e\x3c/button\x3e\n '}}, {key:"buildContentHtml",value:function buildContentHtml(summaryHtml){return'\n \x3cdiv class\x3d"card_safety_content"\x3e\n \x3cp class\x3d"card_safety_summary"\x3e'.concat(summaryHtml, '\x3c/p\x3e\n \x3cdiv class\x3d"card_safety_tooltip"\x3e\n \x3cspan class\x3d"card_safety_meta"\x3e\x3cspan class\x3d"icon_ai" aria-hidden\x3d"true"\x3e\x3c/span\x3eAI\uac00 \uc0dd\uc131\ud55c \uc694\uc57d\x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button _cnWeatherInfoLayer" aria-pressed\x3d"false" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'info\')" data-type\x3d"card" data-nlog-area\x3d"nation_brief.help_button" data-nlog-params\x3d\'{"category":"card"}\'\x3e\x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\x3c/button\x3e\n \x3cdiv class\x3d"card_tooltip_inner"\x3e').concat(this._infoLayerHtml("card_tooltip_link", "card"),'\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-type\x3d"card" data-nlog-area\x3d"nation_brief.layer.close_button" data-nlog-params\x3d\'{"category":"card"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton class\x3d"card_safety_timeline" aria-pressed\x3d"false" data-nlog\x3d"timeline" data-nlog-area\x3d"nation_brief.timeline_button"\x3e\ud0c0\uc784\ub77c\uc778\x3c/button\x3e\n ').concat(this._timelineHtml|| "","\n \x3c/div\x3e\n ")}}, {key:"buildReadyHtml",value:function buildReadyHtml(){return'\n \x3cdiv class\x3d"card_safety_panel_head"\x3e\n \x3cem class\x3d"card_safety_badge"\x3e\uc900\ube44\uc911\x3c/em\x3e\n \x3cstrong class\x3d"card_safety_subject"\x3e\uc804\uad6d \uc0c1\ud669 \uc815\ubcf4 \uc900\ube44\uc911\x3c/strong\x3e\n \x3c/div\x3e\n '.concat(this._readyNowHtml(), "\n ").concat(this.buildContentHtml("\ub370\uc774\ud130 \uc218\uc9d1 \uc694\uc57d\uc911\uc785\ub2c8\ub2e4. \uc7a0\uc2dc \ud6c4 \ub2e4\uc2dc \ud45c\uc2dc \ub429\ub2c8\ub2e4. \ud65c\uc131 \ud2b9\ubcf4 \uc815\ubcf4\ub294 \uc544\ub798 \uc2dc\uac01\ud654 \uc9c0\ub3c4\uc5d0\uc11c \ud655\uc778 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."), "\n ")}}, {key:"buildNowHtml",value:function buildNowHtml(cards,grade){var _this3=this;if(!cards||cards.length===0)return grade==="class1"?this._noChangeNowHtml():this._readyNowHtml();var items=cards.map(function(c, i){return'\n \x3cdiv class\x3d"card_now_item'.concat(i===0?" is-active":"",'"').concat(c.nav?' data-nav-kind\x3d"'.concat(c.nav.kind,'"').concat(c.nav.type?' data-nav-type\x3d"'.concat(c.nav.type, '"'):""):"",'\x3e\n \x3cspan class\x3d"card_item_icon ').concat(c.icon,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(_this3.escape(c.title),'\x3c/span\x3e\x3c/span\x3e\n \x3cdiv class\x3d"card_item_body"\x3e\n \x3cspan class\x3d"card_body_label"\x3e').concat(_this3.escape(c.label), '\x3c/span\x3e\n \x3cspan class\x3d"card_body_row"\x3e\n \x3cstrong class\x3d"card_row_title"\x3e').concat(_this3.escape(c.title),"\x3c/strong\x3e\n ").concat(c.sub? '\x3cspan class\x3d"card_row_sub"\x3e'.concat(_this3.escape(c.sub),"\x3c/span\x3e"):"","\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}).join(""); return'\x3cdiv class\x3d"card_safety_now"\x3e'.concat(items,"\x3c/div\x3e")}}, {key:"_readyNowHtml",value:function _readyNowHtml(){return'\n \x3cdiv class\x3d"card_safety_now"\x3e\n \x3cdiv class\x3d"card_now_item"\x3e\n \x3cspan class\x3d"card_item_icon type_ready"\x3e\x3cspan class\x3d"blind"\x3e\uc900\ube44\uc911\x3c/span\x3e\x3c/span\x3e\n \x3cdiv class\x3d"card_item_body"\x3e\n \x3cspan class\x3d"card_body_row"\x3e\n \x3cstrong class\x3d"card_row_title"\x3e\ub370\uc774\ud130 \uc900\ube44\uc911\x3c/strong\x3e\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"_noChangeNowHtml",value:function _noChangeNowHtml(){return'\n \x3cdiv class\x3d"card_safety_now"\x3e\n \x3cdiv class\x3d"card_now_item is-active"\x3e\n \x3cspan class\x3d"card_item_icon type_normal"\x3e\x3cspan class\x3d"blind"\x3e\uc0c1\ud669 \ubcc0\ud654 \uc5c6\uc74c\x3c/span\x3e\x3c/span\x3e\n \x3cdiv class\x3d"card_item_body"\x3e\n \x3cspan class\x3d"card_body_label"\x3e\ucd5c\uadfc1\uc2dc\uac04\x3c/span\x3e\n \x3cspan class\x3d"card_body_row"\x3e\x3cstrong class\x3d"card_row_title"\x3e\uc0c8\ub85c \uac10\uc9c0\ub41c \uc0c1\ud669 \ubcc0\ud654 \uc5c6\uc74c\x3c/strong\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"startDeltaRolling",value:function startDeltaRolling(){if(this._rollingTimer)clearInterval(this._rollingTimer);var $now=this.element.find(".card_safety_now");var $items=$now.find(".card_now_item"); if($items.length<=1)return;var self=this;this._rollingTimer=setInterval(function(){var $list=self.element.find(".card_safety_now .card_now_item");var len=$list.length;var idx=$list.index(self.element.find(".card_safety_now .card_now_item.is-active")); $list.removeClass("is-active");$list.eq(idx 2)$cb.prop("checked",false)})}}, {key:"onClickMyFeedbackSend",value:function onClickMyFeedbackSend(e){var _this21=this;this.safeMyRegion(function(){var P=oMyRegionBriefParser;var $fb=$(e.currentTarget).closest(".safety_data_feedback"); var $checked=$fb.find('._cnMyFeedbackList input[type\x3d"checkbox"]:checked');if($checked.length===0)return;var id=String($fb.attr("data-id")||"");var values=[];var contents=[];$checked.each(function(i, el){values.push(String($(el).attr("data-number")));contents.push($(el).next("label").text().trim())}); var now=Date.now();_this21.writeMyFeedback(function(list){var out=list;["1","2","3","4","5","6"].forEach(function(v){out=P.removeFeedback(out,id,"detail",v)}); values.forEach(function(v){out=P.addFeedback(out,id,"detail",v,now)}); return out}); _this21.sendMyFeedbackLog(id,Number($fb.attr("data-index")),"detail","feedback-detail-".concat(id),{detailFeedbackCount:values.length,detailFeedbackValues:values,detailFeedbackContents:contents});oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(_this21.clickCode,"myfeedbackmore"));_this21.closeMyFeedbackLayers();oCommon.fnShowAlert("\uc18c\uc911\ud55c \uc758\uacac \uac10\uc0ac\ud569\ub2c8\ub2e4.")})}}, {key:"onClickMyRefresh",value:function onClickMyRefresh(e){var _this22=this;this.safeMyRegion(function(){var seq=_this22._cardSeq;if(_this22._myRefreshSeq===seq)return;oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(_this22.clickCode,"myrefresh"));var code=_this22._shownCode;var $btn=$(e.currentTarget);_this22._myRefreshSeq=seq;var left=2;var done=function done(){left-=1;if(left===0&&_this22._myRefreshSeq=== seq)_this22._myRefreshSeq=null}; _this22.element.children(".card_safety_panel_my").find("._cnMySheetList .safety_day_item").addClass("common_loading");$btn.addClass("is-selected");setTimeout(function(){return $btn.removeClass("is-selected")}, 500); _this22.loadMyTimeline(code,done);_this22.refreshMyCard(code,seq,done)})}}, {key:"refreshMyCard",value:function refreshMyCard(code,seq,onAlways){var _this23=this;var P=oMyRegionBriefParser;oBlockScriptService.ajaxChoiceApi(P.buildListRequest([code]),function(result){_this23.safeMyRegion(function(){if(seq!== _this23._cardSeq)return;var single=P.resolveSingle(result,code);if(single.status!=="ok")return;var card=P.toCard(single.row,code,_this23._shownName,deviceType,Date.now(),_this23.pageServicePath());if(!card)return; _this23._rows[code]=single.row;_this23.applyMyCardParts(card)})},function(){return onAlways()})}}, {key:"onClickMyLocation",value:function onClickMyLocation(e){var _this24=this;e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"mycurloc"));var $btn=$(e.currentTarget); $btn.addClass("loading");this.safeMyRegion(function(){oCommonGeoLocation.fnInit({welButton:$btn,returnType:"safety",originRegionCode:sRegionCode,originPath:"safety",callback:function callback(coords){return _this24.onLocationCoords($btn, coords)}})})}}, {key:"onLocationCoords",value:function onLocationCoords($btn,coords){var _this25=this;var aCoords=String(coords||"").split(",");$btn.addClass("loading");$.ajax({method:"GET",url:"/api/naverRgnCatForCoords", data:{lat:aCoords[0],lng:aCoords[1]}}).done(function(resp){$btn.removeClass("loading");_this25.safeMyRegion(function(){return _this25.onLocationCode(resp?resp.regionCode:"")})}).fail(function(jqXHR){$btn.removeClass("loading"); oCommon.fnSendErrorToNelo("[nationBrief.js] \uc9c0\uc5ed\ucf54\ub4dc \uc870\ud68c API \ud638\ucd9c\uc2e4\ud328",jqXHR)})}}, {key:"onLocationCode",value:function onLocationCode(regionCode){var judged=oMyRegionBriefParser.judgeLocation(regionCode,typeof sRegionCode==="string"?sRegionCode:"",typeof isBlockPreview!=="undefined"&& isBlockPreview===true);if(judged.action==="empty"){if(confirm("\ud604\uc7ac \uc704\uce58\uac00 \ud655\uc778\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n\uac80\uc0c9\uc73c\ub85c \uc774\ub3d9 \ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?"))$(".button_group .btn_search").trigger("click")}else if(judged.action=== "notDomestic")this.showNoReportPopup("");else if(judged.action==="samePage")this.applySamePageLocation();else location.href=judged.url}}, {key:"applySamePageLocation",value:function applySamePageLocation(){var action=oMyRegionBriefParser.judgeSamePage(this._listState,this.hasCurrentReport());if(action==="wait")this._pendingSamePage=true; else if(action==="showCurrent"){this.selectTab("my");this.selectMyRegion(this._currentCode,true)}else if(action==="popup")this.showNoReportPopup(this.pageRegionName())}}, {key:"hasCurrentReport",value:function hasCurrentReport(){return!!this._currentCode&&oMyRegionBriefParser.isValidGrade(this._grades[this._currentCode])}}, {key:"afterListSettled",value:function afterListSettled(){if(oMyRegionBriefParser.shouldShowEntryPopup(this._flag,this._listState==="ok",this.hasCurrentReport()))this.showNoReportPopup(this.pageRegionName()); if(this._pendingSamePage){this._pendingSamePage=false;this.applySamePageLocation()}}}, {key:"showNoReportPopup",value:function showNoReportPopup(name){var $alert=this.element.children(".common_alert");$alert.find(".common_alert_text").html(this.noReportHtml(name));$alert.removeClass("hide")}}, {key:"noReportHtml",value:function noReportHtml(name){if(!name)return"\x3cstrong\x3e\ud604\uc7ac \uc704\uce58\x3c/strong\x3e\uc5d0\x3cbr/\x3e\uc900\ube44\ub41c \ube0c\ub9ac\ud551\uc774 \uc5c6\uc2b5\ub2c8\ub2e4."; return"\ud604\uc7ac \x3cstrong\x3e".concat(oMyRegionBriefParser.escapeText(name),"\x3c/strong\x3e\uc5d0\x3cbr/\x3e\uc900\ube44\ub41c \ube0c\ub9ac\ud551\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.")}}, {key:"onClickAlertOk",value:function onClickAlertOk(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"myalertok"));this.element.children(".common_alert").addClass("hide")}}, {key:"pageRegionName",value:function pageRegionName(){return typeof regionName==="string"?regionName:""}}, {key:"pageServicePath",value:function pageServicePath(){return typeof menu==="string"?menu:""}}, {key:"escape",value:function escape(s){return String(s==null?"":s).replace(/&/g,"\x26amp;").replace(//g,"\x26gt;")}}]); return nationBrief}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0?" highlight":"";return'\n \x3cli class\x3d"nearby_item"\x3e\n \x3ca href\x3d"'.concat(targetUrl, '" class\x3d"nearby_link" data-region-code\x3d"').concat(region.lsurRgnCd,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'clk\')" data-nlog-area\x3d"nearby_leisure_regions.region_link" data-nlog-params\x3d\'{"region_id":"').concat(region.lsurRgnCd, '"}\'\x3e\n \x3cdiv class\x3d"nearby_thumb"\x3e\n ').concat(thumbInner,'\n \x3c/div\x3e\n \x3cdiv class\x3d"nearby_info"\x3e\n \x3cstrong class\x3d"nearby_name"\x3e').concat(region.lsurNm, '\x3c/strong\x3e\n \x3cdiv class\x3d"nearby_weather"\x3e\n \x3cspan class\x3d"text"\x3e').concat(tmpr,'\u00b0\x3c/span\x3e\n \x3cspan class\x3d"text"\x3e').concat(windSpd, 'm/s\x3c/span\x3e\n \x3cspan class\x3d"text').concat(rainHighlight,'"\x3e\uac15\uc218').concat(rainAmt,'mm\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cspan class\x3d"ico ico_wt').concat(region.wetrCd, '" role\x3d"img" aria-label\x3d"').concat(region.wetrTxt,'"\x3e\x3c/span\x3e\n \x3c/a\x3e\n \x3c/li\x3e\n ')}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}]); return nearbyLsurRegions}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=6)display="display: none;";var pageNumber=Math.floor(i/itemsPerPage)+1;var announceTime=moment(newsInfo.regDatetime,"YYYYMMDDHHmmss").fromNow();var html='\n \x3ca href\x3d"'.concat(url, '" class\x3d"card_list_item _news" role\x3d"listitem" style\x3d"').concat(display,'" data-page\x3d"').concat(pageNumber,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'clk\')" target\x3d"_blank" data-nlog\x3d"article" data-nlog-area\x3d"news_search.article_link"\x3e\n ').concat(thumbHtml,'\n \x3cdiv class\x3d"card_item_data"\x3e\n \x3cstrong class\x3d"card_data_title"\x3e').concat(newsInfo.title, '\x3c/strong\x3e\n \n \x3cdiv class\x3d"card_data_info"\x3e\n \x3cspan class\x3d"card_info_item"\x3e').concat(newsInfo.officeName,'\x3c/span\x3e\n \x3cspan class\x3d"card_info_item"\x3e').concat(announceTime.replace("\ud55c \uc2dc\uac04 \uc804", "1\uc2dc\uac04 \uc804"),"\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n ");newsArea.append(html);this.totalPages=Math.ceil(this.templateData.length/ itemsPerPage);var pageHtml='\n \x3cem class\x3d"card_count_emphasis"\x3e1\x3c/em\x3e/'.concat(this.totalPages,"\n ");if(this.totalPages>1)this.element.find(".card_button_count").html(pageHtml); else this.element.find(".card_news_button").remove()}}}, {key:"clickNewsMore",value:function clickNewsMore(e){e.preventDefault();var nextPage=this.element.find("._news:visible").data("page")+1>this.totalPages?1:this.element.find("._news:visible").data("page")+ 1;this.element.find("._news").hide();this.element.find("._news[data-page\x3d".concat(nextPage,"]")).show();this.element.find(".card_count_emphasis").html(nextPage);oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(this.clickCode,"more"))}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return Array.isArray(this.templateData)&&this.templateData.length>0&&!sRegionCode.startsWith("WD")}}]); return newsSearch}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i1)setInterval(function(){var $banner=_this.element.find(".common_alarm_item");var length=$banner.length;var index= $banner.index(_this.element.find(".common_alarm_item.on"));$banner.removeClass("on");if(index0?"on":"off";break;default:break}return visibleStatus}}, {key:"calcAdditionalScore",value:function calcAdditionalScore(cardName,score){var _this$templateData9,_this$templateData0;var defaultScores={"safetyReport":200,"rain":80,"stmpr":10,"wind":9,"humd":8,"uv":7, "air":6,"sunRiseSet":5};var cardScore=isNaN(score)?defaultScores[cardName]||0:score;try{switch(cardName){case "wind":var nowFcast=((_this$templateData9=this.templateData)===null||_this$templateData9=== void 0?void 0:_this$templateData9.nowFcast)||{};var windSpdStr=nowFcast===null||nowFcast===void 0?void 0:nowFcast.windSpd;var windSpd=parseFloat(windSpdStr);if(!isNaN(windSpd)){var additionalScore=0;if(windSpd>= 14)additionalScore=30;else if(windSpd>=9)additionalScore=20;else if(windSpd>=4)additionalScore=10;cardScore=isNaN(score)?(defaultScores[cardName]||0)+additionalScore:score+additionalScore}break;case "air":var airFcast= (_this$templateData0=this.templateData)===null||_this$templateData0===void 0?void 0:_this$templateData0.airFcast;if(airFcast&&(airFcast.stationPM10!=null||airFcast.stationPM25!=null)){var pm10Grade=airFcast.stationPM10!= null?this.getPM10Grade(airFcast.stationPM10):null;var pm25Grade=airFcast.stationPM25!=null?this.getPM25Grade(airFcast.stationPM25):null;var _additionalScore=0;if(pm10Grade&&pm10Grade===this.AirGradeInfo.VERY_BAD|| pm25Grade&&pm25Grade===this.AirGradeInfo.VERY_BAD)_additionalScore=40;else if(pm10Grade&&pm10Grade===this.AirGradeInfo.BAD||pm25Grade&&pm25Grade===this.AirGradeInfo.BAD)_additionalScore=30;cardScore=isNaN(score)? (defaultScores[cardName]||0)+_additionalScore:score+_additionalScore}break;default:break}}catch(e){return cardScore}return cardScore}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click","._cnToggleBtn",$.proxy(this.toggle,this));this.element.on("click","._cnSafetyReportMoreBtn",$.proxy(this.clickSafetyReportMore,this)); this.element.on("click","._cnSafetyReportExpandBtn",$.proxy(this.clickSafetyReportExpand,this));this.element.on("click","._cnSafetyReportItemFoldBtn",$.proxy(this.clickSafetyReportItemFold,this));this.element.on("click", "._cnSafetyReportFeedBackLayerBtn",$.proxy(this.clickSafetyReportFeedBackLayerBtn,this));this.element.on("click","._cnSafetyReportFeedBackMoreBtn",$.proxy(this.clickSafetyReportFeedBackMoreBtn,this));this.element.on("click", "._cnSafetyReportBinaryFeedback",$.proxy(this.clickSafetyReportBinaryFeedback,this));this.element.on("change","._cnSafetyReportDetailFeedbackList input[type\x3d'checkbox']",$.proxy(this.clickSafetyReportDetailFeedback, this));this.element.on("click","._cnSafetyReportDetailFeedbackSendBtn",$.proxy(this.clickSafetyReportDetailFeedbackSendBtn,this));this.element.on("click","._cnSafetyReportRefreshBtn",$.proxy(_.debounce(this.clickSafetyReportRefreshBtn, 500),this));this.element.on("click","._cnSafetyReportInfoLayer",$.proxy(this.clickSafetyReportInfoLayer,this));this.element.on("click",".safety_help_item",$.proxy(this.clickSafetyReportLink,this))}}, {key:"clickSafetyReportLink",value:function clickSafetyReportLink(e){var P=oMyRegionBriefParser;var region=P.talkLayerRegion($(e.currentTarget).text(),sRegionCode);if(!region||!P.isPlainClick(e)||!P.talkBlockReady(oBlockScriptService.getTemplateInstanceInfoList("regionTalk")))return; e.preventDefault();setTimeout(function(){oBlockScriptService.callTemplateFunc("regionTalk","initCommentWithTalkTab",region.objectRegionCode,region.categoryRegionCode,"city");oBlockScriptService.callTemplateFunc("regionTalk", "enableTalk")},0)}}, {key:"toggle",value:function toggle(e){e.preventDefault();var $currentTarget=$(e.currentTarget);if($currentTarget.hasClass("_cnShowCurrent"))this.setActiveTab("TODAY");else if($currentTarget.hasClass("_cnShowTomorrow"))this.setActiveTab("TOMORROW")}}, {key:"scrollToElementByDay",value:function scrollToElementByDay(days){var _this$templateData$ov2,_this$templateData1,_this$templateData1$o;var tzMin=(_this$templateData$ov2=(_this$templateData1=this.templateData)=== null||_this$templateData1===void 0?void 0:(_this$templateData1$o=_this$templateData1.overseasRegion)===null||_this$templateData1$o===void 0?void 0:_this$templateData1$o.tzMin)!==null&&_this$templateData$ov2!== void 0?_this$templateData$ov2:540;var localDateTime=moment().utc().add(tzMin,"minutes");var aplYmdt=localDateTime.add(days,"days").format("YYYYMMDD")+"00";oBlockScriptService.callTemplateFunc("hourlyFcast", "scrollToElementByDay",aplYmdt,500,false)}}, {key:"getPM10Grade",value:function getPM10Grade(value){if(value===0)return this.AirGradeInfo.NONE;if(value<=30)return this.AirGradeInfo.GOOD;else if(value<=80)return this.AirGradeInfo.NORMAL;else if(value<= 150)return this.AirGradeInfo.BAD;else return this.AirGradeInfo.VERY_BAD}}, {key:"getPM25Grade",value:function getPM25Grade(value){if(value===0)return this.AirGradeInfo.NONE;if(value<=15)return this.AirGradeInfo.GOOD;else if(value<=35)return this.AirGradeInfo.NORMAL;else if(value<= 75)return this.AirGradeInfo.BAD;else return this.AirGradeInfo.VERY_BAD}}, {key:"getAirHdayPM10ValueByGrade",value:function getAirHdayPM10ValueByGrade(grade){var result=Object.values(this.AirHdayGradeInfo).find(function(type){return type.grade===grade}); return result?result.pm10Value:this.AirHdayGradeInfo.NONE.pm10Value}}, {key:"getAirHdayPM25ValueByGrade",value:function getAirHdayPM25ValueByGrade(grade){var result=Object.values(this.AirHdayGradeInfo).find(function(type){return type.grade===grade}); return result?result.pm25Value:this.AirHdayGradeInfo.NONE.pm25Value}}, {key:"validateSunRiseSetData",value:function validateSunRiseSetData(localDateTime){var _this$templateData10,_this$templateData11,_todaySunRiseSet$aplY,_todaySunRiseSet$aplY2;var sunRiseSetData=this.domestic? (_this$templateData10=this.templateData)===null||_this$templateData10===void 0?void 0:_this$templateData10.sunRiseSetList:(_this$templateData11=this.templateData)===null||_this$templateData11===void 0? void 0:_this$templateData11.overseasSunRiseSetList;var todaySunRiseSet=sunRiseSetData===null||sunRiseSetData===void 0?void 0:sunRiseSetData[0];var today=localDateTime.format("MMDD");if((todaySunRiseSet=== null||todaySunRiseSet===void 0?void 0:(_todaySunRiseSet$aplY=todaySunRiseSet.aplYmd)===null||_todaySunRiseSet$aplY===void 0?void 0:(_todaySunRiseSet$aplY2=_todaySunRiseSet$aplY.substring)===null||_todaySunRiseSet$aplY2=== void 0?void 0:_todaySunRiseSet$aplY2.call(_todaySunRiseSet$aplY,4))!==today)return[];if(!moment(todaySunRiseSet===null||todaySunRiseSet===void 0?void 0:todaySunRiseSet.sriseTm,"HHmmss").isValid()||!moment(todaySunRiseSet=== null||todaySunRiseSet===void 0?void 0:todaySunRiseSet.ssetTm,"HHmmss").isValid())return[];return sunRiseSetData}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this$bottomSheet,_this$bottomSheet$han;if(this.element.css("display")!=="none")this.resetScroll();(_this$bottomSheet= this.bottomSheet)===null||_this$bottomSheet===void 0?void 0:(_this$bottomSheet$han=_this$bottomSheet.handleResize)===null||_this$bottomSheet$han===void 0?void 0:_this$bottomSheet$han.call(_this$bottomSheet, lastResponsiveSizeType,isChanged)}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"safetyReportCardSource",value:function safetyReportCardSource(){var cardGrades=["class3","class4"];var realtime=this.segmentSafetyReportList.filter(function(report){return cardGrades.includes(report.grade)}); return realtime.length?realtime:this.safetyReportList.filter(function(report){return cardGrades.includes(report.grade)})}}, {key:"renderSafetyReportCard",value:function renderSafetyReportCard(list){var localDateTime=moment.utc().utcOffset("+09:00");var safetyReportCardMinYmdt=localDateTime.subtract(36,"minutes").format("YYYYMMDDHHmm"); var safetyReport=list.find(function(report){return report.aplYmdt>=safetyReportCardMinYmdt}); var $card=this.element.find("._cnSafetyReportCard");var $expandAndBottom=this.element.find("._cnSafetyReport");try{if(safetyReport&&safetyReport.contents&&safetyReport.grade&&safetyReport.contentType){var class4= safetyReport.grade==="class4";var gradeCardClass=class4?"type_safety--reportRisk":"type_safety--reportWarning";var gradeCardRemoveClass=class4?"type_safety--reportWarning":"type_safety--reportRisk";var cardExpand= class4?"true":"false";$card.removeClass(gradeCardRemoveClass).addClass(gradeCardClass).find("._cnSafetyReportExpandBtn").attr("aria-pressed",cardExpand);$card.find("._cnSafetyReportCardText").html("".concat(safetyReport.contentTypeUi, " ").concat(safetyReport.gradeCardUi));$card.removeClass("hide");var gradeExpandClass=class4?"type_risk":"type_warning";var gradeExpandRemoveClass=class4?"type_warning":"type_risk";$expandAndBottom.removeClass(gradeExpandRemoveClass).addClass(gradeExpandClass); $expandAndBottom.find("._cnSafetyReportExpandAge").html(safetyReport.cardTimeAge);$expandAndBottom.find("._cnSafetyReportExpandSummary").html(safetyReport.contentsUi.summary_report);if(class4){$expandAndBottom.removeClass("hide").addClass("is-show"); oBlockScriptService.callTemplateFunc("selectedRegion","showDangerIcon")}}else{$card.addClass("hide");$expandAndBottom.addClass("hide").removeClass("is-show")}}catch(e){$card.addClass("hide");$expandAndBottom.addClass("hide").removeClass("is-show")}this.syncSafetyReportAlertVisibility()}}, {key:"renderSafetyReportBottomSheet",value:function renderSafetyReportBottomSheet(list){var _this5=this;this.element.find("._cnSafetyReportMoreRegionName").html(regionName);var $listContainer=this.element.find("._cnSafetyReportMoreList"); var groupByDate=Object.groupBy(list,function(_ref){var date=_ref.date;return date}); var html="";var folded=false;var getBadgeColor=function getBadgeColor(text){var groups={1:["\ub192\uc740\uc704\ud5d8","\ub354\uc704","\uc0b0\ubd88","\uc9c0\uc9c4"],2:["\uc704\ud5d8","\uacbd\uacc4"],3:["\uc8fc\uc758", "\uc720\uc758","\ub300\uae30\uc9c8","\uc0b0\uc0ac\ud0dc","\uac74\uc870"],4:["\uad00\uc2ec","\ubc14\ub78c","\ud48d\ub791","\ud574\uc77c"],5:["\ud0dc\ud48d"],6:["\ube44","\ud64d\uc218"],7:["\ub208","\ucd94\uc704"]}; var found=Object.entries(groups).find(function(_ref2){var _ref3=_slicedToArray(_ref2,2),key=_ref3[0],keywords=_ref3[1];return keywords.includes(text)}); var colorNumber=found?found[0]:8;return'\x3cem class\x3d"safety_badge_item type_color--'.concat(colorNumber,'"\x3e').concat(text,"\x3c/em\x3e")}; var preview=isBlockPreview?"/preview":"";if(deviceType==="pc")this.element.find(".btn_sns_share").replaceWith('\n \x3ca href\x3d"#" class\x3d"naver-splugin btn_sns_share _cnSafetyReportShare" role\x3d"button"\n data-style\x3d"unity-v2"\n data-option\x3d"{baseElement:\'spiButton2\', layerPosition:\'outside-bottom\', align:\'right\', top:4, left:0, marginLeft:8, marginTop:10}"\n data-url\x3d"'.concat(location.origin).concat(preview, "/").concat(menu,"/").concat(sRegionCode,'?safetyReport\x3dtrue"\n data-source-name\x3d"AI \uc548\uc804\ub9ac\ud3ec\ud2b8"\n data-title\x3d"\ub3d9\ub124\ubcc4 \uae30\uc0c1 \uc704\ud5d8 \uc815\ubcf4\ub97c \ud655\uc778\ud558\uc138\uc694!"\n onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'safetyshare\')" data-nlog-area\x3d"now_synthesis_forecast.share_link"\x3e\n \x3cspan class\x3d"blind"\x3e\uacf5\uc720\ud558\uae30\x3c/span\x3e\n \x3c/a\x3e\n ')); else this.element.find(".btn_sns_share").replaceWith('\n \x3ca href\x3d"#" class\x3d"naver-splugin btn_sns_share _cnSafetyReportShare" role\x3d"button"\n data-style\x3d"standard"\n data-url\x3d"'.concat(location.origin).concat(preview, "/").concat(menu,"/").concat(sRegionCode,'?safetyReport\x3dtrue"\n data-source-name\x3d"AI \uc548\uc804\ub9ac\ud3ec\ud2b8"\n data-title\x3d"\ub3d9\ub124\ubcc4 \uae30\uc0c1 \uc704\ud5d8 \uc815\ubcf4\ub97c \ud655\uc778\ud558\uc138\uc694!"\n data-cafe-source-form\x3d"2"\n onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'safetyshare\')" data-nlog-area\x3d"now_synthesis_forecast.share_link"\x3e\n \x3cspan class\x3d"blind"\x3e\uacf5\uc720\ud558\uae30\x3c/span\x3e\n \x3c/a\x3e\n ')); var feedbackData=this.getSafetyReportFeedbackCookie();for(var date in groupByDate){var reports=groupByDate[date];var dayLatest=reports[0];html+='\n \x3cdiv class\x3d"safety_day_item"\x3e\n \x3cstrong class\x3d"safety_day_title"\x3e'.concat(dayLatest.date, '\x3cspan class\x3d"safety_title_day"\x3e(').concat(dayLatest.day,")\x3c/span\x3e\x3c/strong\x3e\n ");var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined; try{var _loop=function _loop(){var _report$extraInfo,_report$contentsUi;var report=_step.value;var foldClass=folded?"is-fold":"";folded=true;var liked=feedbackData.find(function(data){return data.id=== report.id&&data.type==="binary"&&data.value==="like"})?"true":"false"; var disliked=feedbackData.find(function(data){return data.id===report.id&&data.type==="binary"&&data.value==="dislike"})?"true":"false"; var snowInfoHtml=report.contentType==="\ub208"?'\x3cp class\x3d"safety_data_text type_explain"\x3e\uc2dc\uac04\ub2f9 \uc801\uc124\ub7c9 \uc2e4\ud669 \ubc0f \uc608\ubcf4 \uc815\ubcf4\ub294 \uae30\uc0c1\uccad \uc678 \ubbfc\uac04 \uae30\uc0c1 \uc0ac\uc5c5\uc790 \ub370\uc774\ud130\ub97c \ud65c\uc6a9\ud569\ub2c8\ub2e4.\x3c/p\x3e': "";var pictogramHtml=_this5.buildSafetyReportPictogramHtml(report===null||report===void 0?void 0:report.extraInfo);var linkHtml=((report===null||report===void 0?void 0:(_report$extraInfo=report.extraInfo)=== null||_report$extraInfo===void 0?void 0:_report$extraInfo.selectedLinks)||[]).map(function(link){var url=[deviceType==="pc"?link.pcUrl:link.mobileUrl,link.mobileUrl,link.pcUrl,"#"].find(function(u){return u}); url=url.replace("\x3cnaverRgnCd\x3e",sRegionCode).replace("\x3cservicePath\x3e",menu);return'\x3ca href\x3d"'.concat(url,'" class\x3d"safety_help_item" target\x3d"_blank" data-nlog\x3d"agency" data-type\x3d"').concat(link.label, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this5.clickCode,'safetylinkclk\')" data-nlog-area\x3d"now_synthesis_forecast.agency_link" data-nlog-params\x3d\'{"agency":"').concat(link.label, "\"}'\x3e").concat(link.label,"\x3c/a\x3e")}).join(""); var vc=Array.isArray(report===null||report===void 0?void 0:(_report$contentsUi=report.contentsUi)===null||_report$contentsUi===void 0?void 0:_report$contentsUi.variable_contents)?report.contentsUi.variable_contents: [];var sentence=function sentence(i){return typeof vc[i]==="string"?vc[i]:""}; var hasThird=sentence(2).trim()!=="";html+='\n \x3cdiv class\x3d"safety_item_inner '.concat(foldClass,'" data-id\x3d"').concat(report.id,'" data-index\x3d"').concat(report.index,'"\x3e\n \x3cdiv class\x3d"safety_item_head"\x3e\n \x3cstrong class\x3d"safety_head_title"\x3e').concat(report.bottomTimeAge, '\x3c/strong\x3e\n\n \x3cdiv class\x3d"safety_head_badge"\x3e\n ').concat(getBadgeColor(report.contentType),"\n ").concat(getBadgeColor(report.gradeBadgeUi), '\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"safety_item_data"\x3e\n \x3cp class\x3d"safety_data_text type_view"\x3e\n ').concat(report.contentsUi.summary_report, '\x3cbr\x3e\n \x3c/p\x3e\n \x3cul class\x3d"safety_data_list"\x3e\n \x3cli class\x3d"safety_list_item"\x3e\n ').concat(sentence(0), '\n \x3c/li\x3e\n \x3cli class\x3d"safety_list_item"\x3e\n ').concat(sentence(1),'\n \x3c/li\x3e\n \x3cli class\x3d"safety_list_item ').concat(hasThird? "":"hide",'"\x3e\n ').concat(sentence(2),"\n \x3c/li\x3e\n \x3c/ul\x3e\n \n ").concat(snowInfoHtml, "\n \n ").concat(pictogramHtml,'\n\n \x3cdiv class\x3d"safety_data_help ').concat(linkHtml?"":"hide",'"\x3e\n ').concat(linkHtml, '\n \x3c/div\x3e\n\n \x3cdiv class\x3d"safety_data_feedback"\x3e\n \x3cdiv class\x3d"safety_feedback_list"\x3e\n \x3cbutton type\x3d"button" class\x3d"safety_list_item type_like _cnSafetyReportBinaryFeedback" aria-pressed\x3d"').concat(liked, '" data-nlog-area\x3d"now_synthesis_forecast.reaction_button" data-nlog-params\x3d\'{"reaction":"like"}\'\x3e\n \ub3c4\uc6c0\uc774 \ub410\uc5b4\uc694\x3cspan class\x3d"safety_item_count blind"\x3e\uce74\uc6b4\ud130 \uc22b\uc790(\uac1c\ubc1c\uc6a9)\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"safety_list_item type_dislike _cnSafetyReportBinaryFeedback" aria-pressed\x3d"').concat(disliked, '" data-nlog-area\x3d"now_synthesis_forecast.reaction_button" data-nlog-params\x3d\'{"reaction":"dislike"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\uc774 \ub418\uc9c0 \uc54a\uc558\uc5b4\uc694\x3c/span\x3e\n \x3cspan class\x3d"safety_item_count blind"\x3e\uce74\uc6b4\ud130 \uc22b\uc790(\uac1c\ubc1c\uc6a9)\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"safety_feedback_tools"\x3e\n \x3cdiv class\x3d"safety_tools_item"\x3e\n \x3cbutton type\x3d"button" class\x3d"safety_item_button _cnSafetyReportFeedBackMoreBtn" data-nlog\x3d"feedback_more" aria-pressed\x3d"false" data-nlog-area\x3d"now_synthesis_forecast.feedback_more_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub354 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n\n \x3cdiv class\x3d"safety_item_list"\x3e\n \x3cbutton type\x3d"button" class\x3d"safety_list_item _cnSafetyReportFeedBackLayerPressed _cnSafetyReportFeedBackLayerBtn" aria-pressed\x3d"false" data-nlog-area\x3d"now_synthesis_forecast.feedback_button"\x3e\uc758\uacac \ub0a8\uae30\uae30\x3c/button\x3e\n\n \x3cdiv class\x3d"card_info_feedback"\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"safety_item_button type_fold _cnSafetyReportItemFoldBtn" data-nlog\x3d"safety_report_fold" data-nlog-area\x3d"now_synthesis_forecast.safety_report_fold_button"\x3e\n \x3cspan class\x3d"blind"\x3e\uc811\uae30 / \ud3bc\uce58\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n ')}; for(var _iterator=reports[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&& _iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}html+="\x3c/div\x3e"}if(list.length===0)$listContainer.html('\n \x3cdiv class\x3d"safety_day_empty"\x3e\n \x3cp class\x3d"safety_empty_text"\x3e\n \ucd5c\uadfc 7\uc77c\uac04 \uc0dd\uc131\ub41c \ub9ac\ud3ec\ud2b8\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n '); else $listContainer.html(html);oCommon.fnSpluginInit()}}, {key:"buildSafetyReportPictogramHtml",value:function buildSafetyReportPictogramHtml(extraInfo){if(typeof oMyRegionBriefParser==="undefined"||!oMyRegionBriefParser||typeof oMyRegionBriefParser.buildPictograms!== "function"||typeof oMyRegionBriefParser.escapeText!=="function")return"";try{var P=oMyRegionBriefParser;var list=P.buildPictograms(extraInfo);if(!Array.isArray(list)||list.length===0)return"";return'\x3cdiv class\x3d"pictogram_area"\x3e'.concat(list.map(function(p){return'\x3cdiv class\x3d"pictogram_item type_color--'.concat(p.colorNo, '"\x3e\x3cspan class\x3d"pictogram_icon type_').concat(p.icon,'" aria-hidden\x3d"true"\x3e\x3c/span\x3e\x3cspan class\x3d"pictogram_text"\x3e').concat(P.escapeText(p.text),"\x3c/span\x3e\x3c/div\x3e")}).join(""), "\x3c/div\x3e")}catch(e){return""}}}, {key:"clickSafetyReportMore",value:function clickSafetyReportMore(e){var $target=this.element.find("._cnSafetyReportMoreBtn.card_alert_link");var pressed=$target.attr("aria-pressed")==="true";this.bottomSheet.toggle(); $target.attr("aria-pressed",!pressed);if(!pressed){this.renderSafetyReportBottomSheet(this.safetyReportList);this.loadSafetyReportTimeline()}if(pressed)this.element.find(".card_info_alert").removeClass("is-hidden"); else{oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetymore"));this.element.find(".card_info_alert").addClass("is-hidden");$("body").addClass("_cnNotScrollSafetyReport")}this.syncSafetyReportAlertVisibility()}}, {key:"closeSafeReportBottom",value:function closeSafeReportBottom(){var _this6=this;oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetydimmed"),true);if(oCommon.fnGetResponsiveSizeType().deviceType=== "Pc"){this.element.find("._cnSafetyReportMoreBtn.card_alert_link").attr("aria-pressed","false");this.element.find(".card_info_alert").removeClass("is-hidden");$("body").removeClass("_cnNotScrollSafetyReport"); this.syncSafetyReportAlertVisibility()}else setTimeout(function(){_this6.element.find("._cnSafetyReportMoreBtn.card_alert_link").attr("aria-pressed","false");_this6.element.find(".card_info_alert").removeClass("is-hidden"); $("body").removeClass("_cnNotScrollSafetyReport");_this6.syncSafetyReportAlertVisibility()},300)}}, {key:"syncSafetyReportAlertVisibility",value:function syncSafetyReportAlertVisibility(){var $alert=this.element.find("._cnSafetyReport");var collapsed=$alert.hasClass("hide")&&$alert.hasClass("is-hidden"); $alert.find(".card_alert_head, .card_alert_text, .card_alert_link.type_more").add($alert.children(".btn_close")).toggleClass("hide",collapsed)}}, {key:"requestSafetyReportTimeline",value:function requestSafetyReportTimeline(onSuccess,alwaysCallback){var _this=this;oBlockScriptService.ajaxChoiceApi({"segmentSafetyReportTimeline":{"naverRgnCd":sRegionCode, "offsetHours":7*24,"minGrade":"class1","limit":24}},function(result){var raw=result&&result.segmentSafetyReportTimeline;if(!Array.isArray(raw))return;var previousList=_this.safetyReportList;var previousRealtime= _this.segmentSafetyReportList;try{_this.safetyReportList=raw.map(function(report,index){return _this.transformSafetyReport(report,index)}); _this.segmentSafetyReportList=_this.safetyReportList.filter(function(report){return report.realtime}); _this.renderSafetyReportBottomSheet(_this.safetyReportList)}catch(err){_this.safetyReportList=previousList;_this.segmentSafetyReportList=previousRealtime;return}if(typeof onSuccess==="function")onSuccess()}, alwaysCallback)}}, {key:"loadSafetyReportTimeline",value:function loadSafetyReportTimeline(){var $listContainer=this.element.find("._cnSafetyReportMoreList");$listContainer.addClass("common_loading");this.requestSafetyReportTimeline(null, function(){$listContainer.removeClass("common_loading")})}}, {key:"clickSafetyReportExpand",value:function clickSafetyReportExpand(e){var $target=this.element.find("._cnSafetyReportExpandBtn.card_item_inner");var pressed=$target.attr("aria-pressed")==="true";this.element.find("._cnSafetyReport").toggleClass("hide").toggleClass("is-show"); $target.attr("aria-pressed",!pressed);this.syncSafetyReportAlertVisibility();if(!pressed)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safety"));else oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(this.clickCode,"safetyclose"))}}, {key:"clickSafetyReportItemFold",value:function clickSafetyReportItemFold(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetyfold"));var $currentTarget=$(e.currentTarget); var $target=$currentTarget.parents(".safety_item_inner");$target.toggleClass("is-fold")}}, {key:"clickSafetyReportFeedBackLayerBtn",value:function clickSafetyReportFeedBackLayerBtn(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetyfeedbackmore"));var $currentTarget= $(e.currentTarget);var $target=$currentTarget.parents(".safety_feedback_tools").find("._cnSafetyReportFeedBackLayerPressed");var pressed=$target.attr("aria-pressed")==="true";this.element.find("._cnSafetyReportFeedBackLayerPressed").attr("aria-pressed", false);$target.attr("aria-pressed",!pressed);if(!pressed){var feedbackData=this.getSafetyReportFeedbackCookie();var safetyReportId=$currentTarget.parents(".safety_item_inner").data("id");var existingDetailFeedback= feedbackData.filter(function(data){return data.id===safetyReportId&&data.type==="detail"}); var getChecked=function getChecked(number){return existingDetailFeedback.find(function(data){return data.value===number})?"checked":""}; $currentTarget.parents(".safety_feedback_tools").find(".card_info_feedback").replaceWith(' \n \x3cdiv class\x3d"card_info_feedback"\x3e\n \x3cdiv class\x3d"card_feedback_head"\x3e\n \x3cstrong class\x3d"card_head_title"\x3e\uc758\uacac \ub0a8\uae30\uae30\x3c/strong\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"card_feedback_inner"\x3e\n \x3cdiv class\x3d"card_feedback_report"\x3e\n \x3cem class\x3d"card_report_title"\x3eAI \uc548\uc804\ub9ac\ud3ec\ud2b8\uac00 \ub3c4\uc6c0\uc774 \ub418\uc5c8\ub098\uc694?\x3c/em\x3e\n \x3cp class\x3d"card_report_text"\x3e\ud574\ub2f9\ub418\ub294 \uc758\uacac\uc744 \uc120\ud0dd\ud574 \uc8fc\uc138\uc694. (\ucd5c\ub300 2\uac1c)\x3c/p\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"card_feedback_list _cnSafetyReportDetailFeedbackList"\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-1" data-number\x3d"1" class\x3d"blind" '.concat(getChecked("1"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"1"}\'\x3e\n \x3clabel for\x3d"test-1" class\x3d"card_item_label"\x3e\n \uc2e4\uc81c \uc548\uc804 \ud655\ubcf4\uc5d0 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-2" data-number\x3d"2" class\x3d"blind" ').concat(getChecked("2"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"2"}\'\x3e\n \x3clabel for\x3d"test-2" class\x3d"card_item_label"\x3e\n \uc74d\uba74\ub3d9\ubcc4\ub85c \uc54c\ub824\uc918\uc11c \ud3b8\ub9ac\ud588\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-3" data-number\x3d"3" class\x3d"blind" ').concat(getChecked("3"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"3"}\'\x3e\n \x3clabel for\x3d"test-3" class\x3d"card_item_label"\x3e\n \uc774\ud574\ud558\uae30 \uc26c\uc6b4 \ud45c\ud604\uc774\ub77c \ud3b8\ub9ac\ud588\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-4" data-number\x3d"4" class\x3d"blind" ').concat(getChecked("4"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"4"}\'\x3e\n \x3clabel for\x3d"test-4" class\x3d"card_item_label"\x3e\n \ubd88\ud544\uc694\ud55c \uc815\ubcf4\uc600\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-5" data-number\x3d"5" class\x3d"blind" ').concat(getChecked("5"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"5"}\'\x3e\n \x3clabel for\x3d"test-5" class\x3d"card_item_label"\x3e\n \uae30\uc0c1 \uc815\ubcf4\uac00 \uc815\ud655\ud558\uc9c0 \uc54a\uc558\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"card_list_item"\x3e\n \x3cinput type\x3d"checkbox" id\x3d"test-6" data-number\x3d"6" class\x3d"blind" ').concat(getChecked("6"), ' data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_input" data-nlog-params\x3d\'{"feedback_no":"6"}\'\x3e\n \x3clabel for\x3d"test-6" class\x3d"card_item_label"\x3e\n \uacfc\uc7a5\ub418\uac70\ub098 \ubd80\uc801\uc808\ud55c \ud45c\ud604\uc774 \ub9ce\uc558\uc5b4\uc694.\n \x3c/label\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"card_feedback_confirm"\x3e\n \x3cbutton type\x3d"button" class\x3d"card_confirm_button _cnSafetyReportDetailFeedbackSendBtn" aria-controls\x3d"commonFeedback" data-nlog\x3d"feedback_submit" data-nlog-area\x3d"now_synthesis_forecast.layer.feedback_submit_button"\x3e\uc758\uacac \ub0a8\uae30\uae30\x3c/button\x3e\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"btn_close _cnSafetyReportFeedBackLayerBtn" data-type\x3d"feedback" data-nlog-area\x3d"now_synthesis_forecast.layer.close_button" data-nlog-params\x3d\'{"category":"feedback"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e'))}else $currentTarget.parents(".safety_feedback_tools").find(".card_info_feedback").replaceWith('\n \x3cdiv class\x3d"card_info_feedback"\x3e\n \x3c/div\x3e\n '); this.element.find("._cnBottomSheet").toggleClass(".is-feedback")}}, {key:"sendSafetyReportFeedbackLog",value:function sendSafetyReportFeedbackLog(safetyReportId,feedbackType,body){var feedbackValueMap=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var splitsId= safetyReportId.split("-");var $reportTarget=this.element.find(".safety_item_inner[data-id\x3d'".concat(safetyReportId,"']"));var index=$reportTarget.data("index");var safetyReport=this.safetyReportList[index]; var config={"regionCode":sRegionCode,"safetyReportId":safetyReportId,"reportType":splitsId[1],"reportAplYmdt":splitsId[2],"feedbackType":feedbackType,"report":safetyReport};config=_objectSpread({},config, {},feedbackValueMap);oCommon.fnSendInfoMonitor("safetyReportFeedback",body,config)}}, {key:"clickSafetyReportFeedBackMoreBtn",value:function clickSafetyReportFeedBackMoreBtn(e){var $currentTarget=$(e.currentTarget);var pressed=$currentTarget.attr("aria-pressed")==="true";this.element.find("._cnSafetyReportFeedBackMoreBtn").attr("aria-pressed", false);$currentTarget.attr("aria-pressed",!pressed);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetythreedot"))}}, {key:"clickSafetyReportBinaryFeedback",value:function clickSafetyReportBinaryFeedback(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetyfeedback"));var $currentTarget= $(e.currentTarget);var pressed=$currentTarget.attr("aria-pressed")==="true";$currentTarget.parents(".safety_data_feedback").find("._cnSafetyReportBinaryFeedback").attr("aria-pressed",false);$currentTarget.attr("aria-pressed", !pressed);var feedbackValue=$currentTarget.hasClass("type_like")?"like":"dislike";var safetyReportId=$currentTarget.parents(".safety_item_inner").data("id");var current=moment.utc().utcOffset("+09:00"); var datetime=current.format("YYYYMMDDHHmmss");if(!pressed){this.setSafetyReportFeedbackCookie(safetyReportId,"binary",feedbackValue,datetime);if(feedbackValue==="like"){this.sendSafetyReportFeedbackLog(safetyReportId, "binary","feedback-like-".concat(safetyReportId),{"binaryFeedback":"like"});this.deleteSafetyReportFeedbackCookie(safetyReportId,"binary","dislike")}else{this.sendSafetyReportFeedbackLog(safetyReportId, "binary","feedback-dislike-".concat(safetyReportId),{"binaryFeedback":"dislike"});this.deleteSafetyReportFeedbackCookie(safetyReportId,"binary","like")}}else this.deleteSafetyReportFeedbackCookie(safetyReportId, "binary",feedbackValue)}}, {key:"clickSafetyReportDetailFeedback",value:function clickSafetyReportDetailFeedback(e){var $currentTarget=$(e.currentTarget);var minCount=2;var checkedCount=$currentTarget.parents("._cnSafetyReportDetailFeedbackList").find('input[type\x3d"checkbox"]:checked').length; var checked=$currentTarget.prop("checked");if(checked){if(checkedCount>minCount){$currentTarget.prop("checked",false);$currentTarget.removeAttr("checked",false)}$currentTarget.attr("checked","")}else $currentTarget.removeAttr("checked")}}, {key:"clickSafetyReportDetailFeedbackSendBtn",value:function clickSafetyReportDetailFeedbackSendBtn(e){var $currentTarget=$(e.currentTarget);var checkedList=$currentTarget.parents(".safety_feedback_tools").find('._cnSafetyReportDetailFeedbackList input[type\x3d"checkbox"]:checked'); var checkedCount=checkedList.length;if(checkedCount>0){var current=moment.utc().utcOffset("+09:00");var datetime=current.format("YYYYMMDDHHmmss");var safetyReportId=$currentTarget.parents(".safety_item_inner").data("id"); for(var i=0;i<6;i++){var feedbackValue=(i+1).toString();this.deleteSafetyReportFeedbackCookie(safetyReportId,"detail",feedbackValue)}var feedbackValues=[];var feedbackContents=[];for(var _i2=0;_i2= expireTime}); feedbackData.push({id:safetyReportId,type:feedbackType,value:feedbackValue,datetime:datetime});this.saveSafetyReportFeedbackCookie(feedbackData)}}, {key:"deleteSafetyReportFeedbackCookie",value:function deleteSafetyReportFeedbackCookie(safetyReportId,feedbackType,feedbackValue){var feedbackData=this.getSafetyReportFeedbackCookie();feedbackData=feedbackData.filter(function(data){return!(data.id=== safetyReportId&&data.type===feedbackType&&data.value===feedbackValue)}); this.saveSafetyReportFeedbackCookie(feedbackData)}}, {key:"clickSafetyReportRefreshBtn",value:function clickSafetyReportRefreshBtn(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetyrefresh"));var $currentTarget=$(e.currentTarget); this.element.find(".safety_day_item").addClass("common_loading");$currentTarget.addClass("is-selected");setTimeout(function(){return $currentTarget.removeClass("is-selected")},500); var _this=this;this.requestSafetyReportTimeline(function(){_this.renderSafetyReportCard(_this.safetyReportCardSource())},function(){_this.element.find(".safety_day_item").removeClass("common_loading")})}}, {key:"clickSafetyReportInfoLayer",value:function clickSafetyReportInfoLayer(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"safetyinfo"));var $currentTarget= $(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer();if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"transformSafetyReport",value:function transformSafetyReport(safetyReport,index){var gradeCardMap={"class1":"\uad00\uc2ec","class2":"\uc8fc\uc758","class3":"\uc704\ud5d8","class4":"\ub192\uc740\uc704\ud5d8"}; var gradeBadgeMap={"class1":"\uad00\uc2ec","class2":"\uc8fc\uc758","class3":"\uc704\ud5d8","class4":"\ub192\uc740\uc704\ud5d8"};var contentTypeMap={"\ube44":"\uac15\ud55c \ube44","\ub208":"\ub9ce\uc740 \ub208", "\ubc14\ub78c":"\uac15\ud48d","\ub354\uc704":"\uace0\uc628","\ucd94\uc704":"\uc800\uc628"};var dayList=["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"];var clone=_.cloneDeep(safetyReport); var getTimeAge=function getTimeAge(current,dataMoment,card){var minutesDiff=current.diff(dataMoment,"minutes");var hoursDiff=current.diff(dataMoment,"hours");var daysDiff=current.diff(dataMoment,"days"); if(minutesDiff<=1)return"\uc9c0\uae08";else if(minutesDiff<60)return"".concat(minutesDiff,"\ubd84 \uc804");else if(hoursDiff<24&&card)return"".concat(hoursDiff,"\uc2dc\uac04 \uc804");else if(daysDiff<= 7&&card)return"".concat(daysDiff,"\uc77c \uc804");else if(card)return dataMoment.format("MM.DD HH:mm");else return dataMoment.format("HH:mm")}; var insYmdtMoment=moment(clone["insYmdt"],"YYYYMMDDHHmmss");clone["gradeCardUi"]=gradeCardMap[clone["grade"]]||"";clone["gradeBadgeUi"]=gradeBadgeMap[clone["grade"]]||"";clone["contentTypeUi"]=contentTypeMap[clone["contentType"]]|| clone["contentType"];clone["contentsUi"]=JSON.parse(clone["contents"]||"{}");clone["cardTimeAge"]=getTimeAge(moment.utc().utcOffset("+09:00"),insYmdtMoment,true);clone["bottomTimeAge"]=getTimeAge(moment.utc().utcOffset("+09:00"), insYmdtMoment,false);clone["date"]=insYmdtMoment.format("MM.DD");clone["day"]=dayList[insYmdtMoment.day()];clone["index"]=index;clone["id"]="".concat(clone["naverRgnCd"],"-").concat(clone["reportType"], "-").concat(clone["aplYmdt"]);clone["extraInfo"]=clone["extraInfo"]?JSON.parse(clone["extraInfo"]):{};return clone}}, {key:"getValidationConfig",value:function getValidationConfig(){var _this$templateData12;var domestic=(_this$templateData12=this.templateData)===null||_this$templateData12===void 0?void 0:_this$templateData12.domestic; if(domestic)return{currentWeatherData:{fields:["nowFcast.tmpr","nowFcast.wetrCd","nowFcast.wetrTxt","weeklyFcastList.0.minTmpr","weeklyFcastList.0.maxTmpr"],operator:"AND",customValidate:function customValidate(data){var _data$nowFcast; var tmpr=(_data$nowFcast=data.nowFcast)===null||_data$nowFcast===void 0?void 0:_data$nowFcast.tmpr;return tmpr>=-100&&tmpr<=100}}, tomorrowWeatherData:{fields:["weeklyFcastList.1.minTmpr","weeklyFcastList.1.maxTmpr","weeklyFcastList.1.amWetrCd","weeklyFcastList.1.amWetrTxt","weeklyFcastList.1.amRainProb","weeklyFcastList.1.pmWetrCd", "weeklyFcastList.1.pmWetrTxt","weeklyFcastList.1.pmRainProb"],operator:"AND"},rainData:{fields:["nowFcast.oneHourRainAmt"]},stmprData:{fields:["nowFcast.stmpr"]},windData:{fields:["nowFcast.windSpd"]}, humdData:{fields:["nowFcast.humd"]},uvData:{fields:["lifeIndexData.figure","lifeIndexData.labelText"],operator:"AND"},pm10Data:{fields:["airFcast.stationPM10Legend1"]},pm25Data:{fields:["airFcast.stationPM25Legend1"]}, sunriseData:{fields:["sunRiseSetList.0.sriseTm"]},sunsetData:{fields:["sunRiseSetList.0.ssetTm"]}};else return{currentWeatherData:{fields:["overseasCrntWetr.tmpr","overseasCrntWetr.wetrCdNew","overseasCrntWetr.wetrTxtNew", "overseasWeeklyFcastList.0.minTmpr","overseasWeeklyFcastList.0.maxTmpr"],operator:"AND"},tomorrowWeatherData:{fields:["overseasWeeklyFcastList.1.minTmpr","overseasWeeklyFcastList.1.maxTmpr","overseasWeeklyFcastList.1.dayWetrCd2", "overseasWeeklyFcastList.1.dayWetrTxt2","overseasWeeklyFcastList.1.rainProbDay","overseasWeeklyFcastList.1.nightWetrCd2","overseasWeeklyFcastList.1.nightWetrTxt2","overseasWeeklyFcastList.1.rainProbNight"], operator:"AND"},rainData:{fields:["overseasCrntWetr.rainAmt"]},stmprData:{fields:["overseasCrntWetr.stmpr"]},windData:{fields:["overseasCrntWetr.windSpd"]},humdData:{fields:["overseasCrntWetr.humd"]},uvData:{fields:["overseasCrntWetr.uv", "overseasCrntWetr.uvDescription"],operator:"AND"},sunriseData:{fields:["overseasSunRiseSetList.0.sriseTm"]},sunsetData:{fields:["overseasSunRiseSetList.0.ssetTm"]}}}}]); return nowSynthesisFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i0}}]); return pastWetr}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0){var etcHtml="";etcList.forEach(function(item){if(!(item===null||item===void 0?void 0:item.type)||!(item===null||item===void 0?void 0:item.landingUrl))return; etcHtml+='\n \x3cspan class\x3d"btn_wrapper"\x3e\x3ca href\x3d"'.concat(item.landingUrl,'" target\x3d"_blank" class\x3d"link" data-type\x3d"etc" data-nlog\x3d"url" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(_this3.clickCode,'url\')" data-nlog-area\x3d"place_info.url_link" data-nlog-params\x3d\'{"category":"etc"}\'\x3e').concat(item.type,"\x3c/a\x3e\x3c/span\x3e\n ")}); if(etcHtml)html+='\x3cdiv class\x3d"btn_area"\x3e'.concat(etcHtml,"\x3c/div\x3e")}html+="\n \x3c/div\x3e\n ";this.element.find("._placeInfoUrls").html(html);this.element.find("._placeInfoUrls").removeClass("hide")}}, {key:"renderConveniences",value:function renderConveniences(){var _this$templateData5;if(!((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:_this$templateData5.conveniences)|| this.templateData.conveniences.length===0)return;var conveniencesString=this.templateData.conveniences.join(", ");var html='\n \x3cstrong class\x3d"info_title"\x3e\x3cspan class\x3d"blind"\x3e\ud3b8\uc758\x3c/span\x3e\x3c/strong\x3e\n \x3cdiv class\x3d"info_area"\x3e\n \x3cdiv class\x3d"info_inner"\x3e'.concat(conveniencesString, "\x3c/div\x3e\n \x3c/div\x3e\n ");this.element.find("._placeInfoOptions").html(html);this.element.find("._placeInfoOptions").removeClass("hide")}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"attachEventAfter",value:function attachEventAfter(){this.element.on("click","._btnAddressMore",$.proxy(this.clickAddressToggle,this));this.element.on("click","._btnAddressClose",$.proxy(this.clickAddressToggle, this));this.element.on("click",".copy_btn",$.proxy(this.clickCopyButton,this))}}, {key:"clickAddressToggle",value:function clickAddressToggle(event){event.preventDefault();var $target=this.element.find("._btnAddressMore");var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer(); if(isOpen===true){$target.attr("aria-pressed","false");$target.removeClass("on")}else{oCommon.fnOpenInfoLayer($target);$target.addClass("on")}}}, {key:"clickCopyButton",value:function clickCopyButton(event){event.preventDefault();var target=$(event.currentTarget);var targetClass=target.data("target");var targetTitle=target.data("title");var textToCopy= this.element.find(".".concat(targetClass)).text().trim();this.copyTextToClipboard(textToCopy);var message='\x3cstrong class\x3d"common_text_emphasis"\x3e'.concat(targetTitle,"\x3c/strong\x3e\uac00 \ubcf5\uc0ac\ub418\uc5c8\uc2b5\ub2c8\ub2e4."); var element=$("._cnCommonToast .common_text_inner").html(message);oToast.toast(function(){return $("._cnCommonToast").removeClass("hide")},function(){return $("._cnCommonToast").addClass("hide")},2E3)}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"copyTextToClipboard",value:function copyTextToClipboard(text){var _this4=this;if(navigator.clipboard)navigator.clipboard.writeText(text).then(function(){})["catch"](function(){_this4.fallbackCopyTextToClipboard(text)}); else this.fallbackCopyTextToClipboard(text)}}, {key:"fallbackCopyTextToClipboard",value:function fallbackCopyTextToClipboard(text){var textarea=document.createElement("textarea");textarea.value=text;textarea.style.width="0";textarea.style.height="0"; textarea.style.position="absolute";textarea.style.top="-1000px";textarea.style.left="-1000px";document.body.appendChild(textarea);textarea.focus();textarea.select();try{document.execCommand("copy")}catch(err){}document.body.removeChild(textarea)}}]); return placeInfo}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i= 0}); this.past=this.items.filter(function(it){return it.offsetMin<0}); this.hasRain=this._hasRain(this.future);this._renderBaseTime();this._removeGolfOnlySection();this.currentIndex=Math.max(0,this.items.findIndex(function(it){return it.offsetMin===0})); this.activeIndex=Math.min(this.currentIndex+1,this.items.length-1);if(this.hasRain)this._renderMessage();else this.element.find("._cnEmptyBanner").removeClass("hide")}}, {key:"initAfter",value:function initAfter(){if(!this.isEnable)return;if(!this.hasRain)return;this._renderChart();this._initMapArea()}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".card_tooltip_button",$.proxy(this._toggleInfo,this));this.element.on("click",".card_tooltip_inner .btn_close",$.proxy(this._closeInfo, this));this.element.on("click","._cnEmptyBanner",$.proxy(this._toggleEmptyBanner,this))}}, {key:"isEnableTemplate",value:function isEnableTemplate(){var items=this.templateData&&Array.isArray(this.templateData.items)?this.templateData.items:[];var future=items.filter(function(it){return it.offsetMin>= 0}); if(future.length=_this3.ANALYSIS_FROM&&_this3._p(it)>=_this3.RAIN_CUT})}}, {key:"_removeGolfOnlySection",value:function _removeGolfOnlySection(){if(this._isGolf())return;this.element.find("._cnGolfOnly").remove()}}, {key:"_isGolf",value:function _isGolf(){var _this$_getLsurRegion;return oCodeUtil.isGolf((_this$_getLsurRegion=this._getLsurRegion())===null||_this$_getLsurRegion===void 0?void 0:_this$_getLsurRegion.lsurRgnCd)}}, {key:"_toggleEmptyBanner",value:function _toggleEmptyBanner(e){var $btn=$(e.currentTarget);var expanded=$btn.attr("aria-pressed")==="true";$btn.attr("aria-pressed",String(!expanded));if(expanded){if(this.noUiSliderPlayerService&& this.noUiSliderPlayerService.timer&&!this.noUiSliderPlayerService.timer.isPaused)this.noUiSliderPlayerService.timer.pause();return}if(!this.naverMap){this._initMapArea();return}if(typeof this.naverMap.refresh=== "function")this.naverMap.refresh()}}, {key:"_p",value:function _p(it){var v=parseFloat(it&&it.precipitation);return isNaN(v)?0:Math.min(v,this.RAIN_MAX)}}, {key:"_renderMessage",value:function _renderMessage(){var _this4=this;var analysis=this.future.filter(function(it){return it.offsetMin>=_this4.ANALYSIS_FROM}); var first=analysis.find(function(it){return _this4._p(it)>=_this4.RAIN_CUT}); if(!first)return;var x=this._fmt(this._p(first));var xmax=this._fmt(Math.max.apply(Math,_toConsumableArray(analysis.map(function(it){return _this4._p(it)})))); var tmax=analysis[analysis.length-1].offsetMin;var sub="".concat(first.offsetMin,"\ubd84 \ud6c4 \uc2dc\uac04\ub2f9 ").concat(x,"mm");if(xmax!==x)sub+=" \u00b7 ".concat(tmax,"\ubd84 \uc774\ub0b4 \ucd5c\ub300 \uac15\uc218\ub7c9 \uc2dc\uac04\ub2f9 ").concat(xmax, "mm");this.element.find("._cnMsgMain").text("\ube44\uac00 \uc608\uce21\ub429\ub2c8\ub2e4.");this.element.find("._cnMsgSub").text(sub)}}, {key:"_fmt",value:function _fmt(v){return String(Math.round(v*10)/10)}}, {key:"_renderBaseTime",value:function _renderBaseTime(){if(!this.baseYmdt)return;var text=moment(this.baseYmdt,"YYYYMMDDHHmmss").format("HH:mm \uae30\uc900");this.element.find("._cnBaseTime").text(text)}}, {key:"_toggleInfo",value:function _toggleInfo(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"info"));var $btn=$(e.currentTarget);var open=$btn.attr("aria-pressed")==="true"; $btn.attr("aria-pressed",String(!open));$btn.closest(".card_time_tooltip").toggleClass("on",!open)}}, {key:"_closeInfo",value:function _closeInfo(e){var $tooltip=$(e.currentTarget).closest(".card_time_tooltip");$tooltip.find(".card_tooltip_button").attr("aria-pressed","false");$tooltip.removeClass("on")}}, {key:"_renderChart",value:function _renderChart(){var $container=this.element.find("._cnRainChart");if(!$container.length)return;var _this=this;oCommon.fnLoadChartLibraries().done(function(){_this._drawChart($container)}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[rainPrecipitation billboard] script \ud638\ucd9c \uc2e4\ud328", jqXHR)})}}, {key:"_drawChart",value:function _drawChart($container){var _this5=this;if(!$container.length||!$container.is(":visible"))return;var values=this.items.map(function(it){return _this5._p(it)}); if(!values.length)return;var currentIndex=this.currentIndex;var activeIndex=this.activeIndex;var intervalMin=10;var BAR_MIN_HEIGHT=1;var BAR_WIDTH=7;var BAR_GAP=6;var BAR_STEP=BAR_WIDTH+BAR_GAP+1;var CHART_BAR_AREA_HEIGHT= 46;var CHART_X_AXIS_HEIGHT=17;var CHART_HEIGHT=63;var CHART_END_LABEL_PADDING=16;var AXIS_TICK_LINE_HEIGHT=5;var prevChart=$container.data("expectation-chart");if(prevChart&&typeof prevChart.destroy=== "function")prevChart.destroy();$container.html("");var plotWidth=values.length*BAR_STEP+BAR_WIDTH;var chartWidth=plotWidth+CHART_END_LABEL_PADDING*2;var chartPadding=BAR_WIDTH/2;var $plot=$('\x3cdiv class\x3d"card_expectation_chart_plot"\x3e\x3c/div\x3e').css({width:"".concat(chartWidth, "px"),height:"".concat(CHART_HEIGHT,"px")});var plotEl=$plot[0];$container.append($plot);var dataMax=Math.max.apply(Math,_toConsumableArray(values).concat([.1]));var maxValue=[3,15,30].find(function(b){return dataMax<= b})||dataMax; var minChartValue=maxValue*(BAR_MIN_HEIGHT/CHART_BAR_AREA_HEIGHT);var chartValues=values.map(function(v){return v===0?minChartValue:v}); var categories=values.map(function(v,i){var minutesFromNow=(i-currentIndex)*intervalMin;if(minutesFromNow===-30)return"30\ubd84 \uc804";if(minutesFromNow===10)return"10\ubd84 \ud6c4";if(minutesFromNow> 0&&minutesFromNow%30===0)return String(minutesFromNow);return""}); for(var i=categories.length-1;i>currentIndex;i--)if(categories[i]){if(!categories[i].endsWith("\ubd84 \ud6c4"))categories[i]="".concat(categories[i],"\ubd84 \ud6c4");break}var tickLabelIndices=categories.reduce(function(acc, label,i){if(label)acc.push(i);return acc},[]); var chart=bb.generate({bindto:plotEl,size:{height:CHART_HEIGHT,width:chartWidth},padding:{top:0,right:chartPadding+CHART_END_LABEL_PADDING,left:chartPadding+CHART_END_LABEL_PADDING,bottom:0},data:{columns:[["precipitation"].concat(_toConsumableArray(chartValues))], type:"bar"},bar:{width:BAR_WIDTH,radius:2},axis:{x:{type:"category",categories:categories,height:CHART_X_AXIS_HEIGHT,tick:{multiline:false,values:tickLabelIndices}},y:{show:false,min:0,max:maxValue,padding:{top:0, bottom:0}}},legend:{show:false},tooltip:{show:false},onrendered:function onrendered(){var internal=this.internal;var y0=internal.scale.y(0);var $chart=d3.select(plotEl);$chart.select(".bb").style("overflow", "visible");$chart.select(".bb-axis-x").attr("clip-path",null);$chart.selectAll(".bb-axis-x .tick line").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",AXIS_TICK_LINE_HEIGHT);$chart.selectAll(".bb-axis-x .tick text").attr("y", AXIS_TICK_LINE_HEIGHT);$chart.selectAll(".bb-bars-precipitation .bb-bar").each(function(d){var index=typeof d.index!=="undefined"?d.index:parseInt((this.className.baseVal.match(/bb-bar-(\d+)/)||[])[1], 10);var hasValue=values[index]!=null;var $bar=d3.select(this);$bar.classed("is-active",hasValue&&index===activeIndex).classed("is-start",hasValue&&index>activeIndex);if(values[index]!==0)return;var bbox= this.getBBox();var y=y0-BAR_MIN_HEIGHT;$bar.attr("d","M".concat(bbox.x,",").concat(y0," L").concat(bbox.x,",").concat(y," L").concat(bbox.x+bbox.width,",").concat(y," L").concat(bbox.x+bbox.width,",").concat(y0, " Z"))}); $chart.selectAll(".bb-axis-x .tick text").classed("is-active",function(){return d3.select(this).text()==="10\ubd84 \ud6c4"}).classed("is-start",function(){return d3.select(this).text()!=="10\ubd84 \ud6c4"}); $chart.selectAll(".bb-axis-x .tick text").filter(function(){return d3.select(this).text()==="10\ubd84 \ud6c4"}).style("font-weight","700"); var svgNode=plotEl.querySelector("svg");var mainNode=plotEl.querySelector(".bb-main");var bbNode=plotEl.querySelector(".bb");if(svgNode&&mainNode&&typeof mainNode.getBBox==="function")try{var mainBox=mainNode.getBBox(); var contentWidth=Math.ceil(mainBox.x+mainBox.width);var syncedWidth=Math.max(chartWidth,contentWidth);plotEl.style.width="".concat(syncedWidth,"px");if(bbNode)bbNode.style.width="".concat(syncedWidth,"px"); svgNode.setAttribute("width",syncedWidth);svgNode.style.width="".concat(syncedWidth,"px");svgNode.style.overflow="visible"}catch(e){}}}); $container.data("expectation-chart",chart)}}, {key:"_initMapArea",value:function _initMapArea(){this.lsurRegion=this._getLsurRegion();if(!this.lsurRegion||this.lsurRegion.latitude==null||this.lsurRegion.longitude==null){this.element.find(".poi_map_wrap").addClass("hide"); return}if(typeof naver==="undefined"||!naver.maps){this.element.find(".poi_map_wrap").addClass("hide");return}this.element.find(".poi_map_wrap").removeClass("hide");this._initMap();this._initSlider();this._overlayMaple(); this._drawMarker()}}, {key:"_getLsurRegion",value:function _getLsurRegion(){try{return typeof blockData!=="undefined"&&blockData?blockData["lsurRegion"]:null}catch(e){return null}}}, {key:"_initMap",value:function _initMap(){if(this.naverMap)return;this.basePosition=new naver.maps.LatLng(this.lsurRegion.latitude,this.lsurRegion.longitude);this.naverMap=new naver.maps.Map("_idRainPrecipMap-".concat(this.templateInfo.index), {gl:true,glType:naver.maps.Util.glSupported()?naver.maps.GLType.HYBRID:null,logoControl:false,scaleControl:false,mapDataControl:false,center:this.basePosition,zoom:this.nStartZoom,minZoom:this.nMinZoom, maxZoom:this.nMaxZoom,zoomControl:false,draggable:false,disableDoubleClickZoom:true,disableDoubleTapZoom:true,pinchZoom:false,scrollWheel:false,weather:true});this.naverMap.setMapTypeId("grayscale")}}, {key:"_overlayMaple",value:function _overlayMaple(){var _this6=this;var photo=typeof oSrmPhotoType!=="undefined"?oSrmPhotoType["MAPLE"]:null;if(!photo)return;var limit=this.past.length+12;var choiceQueryString= {visualMapSrmImage:{photoType:photo.type,limit:limit}};oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){var list=result&&result.visualMapSrmImage||[];_this6.srmUrlList=list.map(function(o){return"".concat(staticDomain, "/srmImage/").concat(o.photoNm)}); _this6.srmTimeSeriesList=list.map(function(o){return o.photoYmdt}); if(!_this6.srmUrlList.length)return;_this6._drawGroundOverlay()})}}, {key:"_drawGroundOverlay",value:function _drawGroundOverlay(){var b=oPhotoBounds["MAPLE"];var idx=this._matchMapleIndex(this._activeItem().aplYmdt);var url=this.srmUrlList[idx>=0?idx:0];this.groundOverlay= new naver.maps.GroundOverlay(url,new naver.maps.LatLngBounds(new naver.maps.LatLng(b.southWestLat,b.southWestLng),new naver.maps.LatLng(b.northEastLat,b.northEastLng)),{opacity:this.MAP_OPACITY,clickable:false, crossOrigin:"anonymous"});this.groundOverlay.customSetUrl=function(imgUrl){var newImg=this._img.cloneNode();var oldImg=this._img;var overlay=this;newImg.style.display="none";this._wrapper.appendChild(newImg); this._img=newImg;this.setUrl(imgUrl);this._img=oldImg;newImg.decode().then(function(){showNewImg()})["catch"](function(){showNewImg()}); function showNewImg(){var _oldImg$parentNode,_overlay$_wrapper;newImg.style.display="";overlay._img=newImg;(_oldImg$parentNode=oldImg.parentNode)===null||_oldImg$parentNode===void 0?void 0:_oldImg$parentNode.removeChild(oldImg); (_overlay$_wrapper=overlay._wrapper)===null||_overlay$_wrapper===void 0?void 0:_overlay$_wrapper.replaceChildren(newImg)} }; if(this.groundOverlay._wrapper)this.groundOverlay._wrapper.style.pointerEvents="none";this.groundOverlay.setMap(this.naverMap)}}, {key:"_initSlider",value:function _initSlider(){if(typeof noUiSliderPlayerService==="undefined"||!_.isEmpty(this.oSlider))return;this.timeSeriesList=this.items.map(function(it){return it.aplYmdt}); this.element.find("._slider").data("duration",this.timeSeriesList.length);this._renderSliderDate(this.timeSeriesList);var _this=this;this.noUiSliderPlayerService=new noUiSliderPlayerService(this.element.find("._playerRoot"), function(index,ratio){_this._updateBySlider(index,ratio)},function(index,ratio){_this._updateBySlider(index,ratio)},this.clickCode,this.displayPerEach,null,null,function(index,ratio){_this._updateSliderTooltipDisplayClass(ratio)}); this.oSlider=this.noUiSliderPlayerService.getSlider();this.noUiSliderPlayerService.updateTotalDataCount();this.noUiSliderPlayerService.updateTotalDuration();var len=this.timeSeriesList.length;var startRatio= len>1?this.activeIndex/(len-1):0;this.noUiSliderPlayerService.resetSlider(false);this.noUiSliderPlayerService.setSeek(startRatio);this.oSlider.set(startRatio);this._updateBySlider(this.activeIndex,startRatio)}}, {key:"_updateBySlider",value:function _updateBySlider(index,ratio){var item=this.items[index];if(!item)return;if(this.groundOverlay&&this.srmTimeSeriesList&&this.srmTimeSeriesList.length){var mIdx=this._matchMapleIndex(item.aplYmdt); if(mIdx>=0)this.groundOverlay.customSetUrl(this.srmUrlList[mIdx])}this._updateMarkerValue(this._p(item));this._highlightChartBar(index);this._updateToolTip(index);this._updateSliderTooltipDisplayClass(ratio)}}, {key:"_highlightChartBar",value:function _highlightChartBar(index){var $bars=this.element.find(".card_expectation_chart_plot .bb-bars-precipitation .bb-bar");if(!$bars.length)return;var activeIndex=this.activeIndex; $bars.each(function(){var matched=(this.className.baseVal||"").match(/bb-bar-(\d+)/);var barIndex=matched?parseInt(matched[1],10):-1;var focused=barIndex===index;$(this).toggleClass("is-active",focused).toggleClass("is-start", !focused&&barIndex>=activeIndex)})}}, {key:"_matchMapleIndex",value:function _matchMapleIndex(aplYmdt){if(!this.srmTimeSeriesList||!aplYmdt)return-1;var key=String(aplYmdt).substring(0,12);return this.srmTimeSeriesList.findIndex(function(p){return String(p).substring(0, 12)===key})}}, {key:"_drawMarker",value:function _drawMarker(){this._updateMarkerValue(this._p(this._activeItem()))}}, {key:"_updateMarkerValue",value:function _updateMarkerValue(mmh){this.element.find("._cnMarkerData").text(this._fmt(mmh))}}, {key:"_renderSliderDate",value:function _renderSliderDate(timeSeries){if(!timeSeries.length)return;var totalLength=timeSeries.length;var keyIndices=[Math.floor(totalLength*.25),Math.floor(totalLength*.5), Math.floor(totalLength*.75)];var dateMap=new Map;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=timeSeries.entries()[Symbol.iterator](), _step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step$value=_slicedToArray(_step.value,2),i=_step$value[0],ts=_step$value[1];if(keyIndices.includes(i))dateMap.set(ts, i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}var html= "";var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=dateMap.entries()[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2= _iterator2.next()).done);_iteratorNormalCompletion2=true){var _step2$value=_slicedToArray(_step2.value,2),key=_step2$value[0],value=_step2$value[1];if(dateMap.size>1&&value===0)continue;var time=moment(key, "YYYYMMDDHHmmss").format("HH:mm");var left=value/(timeSeries.length-1)*100;html+='\x3cspan class\x3d"date" style\x3d"left: '.concat(left,'%;"\x3e\x3cem class\x3d"date_text"\x3e').concat(time,"\x3c/em\x3e\x3c/span\x3e")}}catch(err){_didIteratorError2= true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}this.element.find(".noUi-date").html(html); this._updateSliderTextDisplayClass()}}, {key:"_updateToolTip",value:function _updateToolTip(index){var item=this.items[index];if(!item||!item.aplYmdt)return;var m=moment(item.aplYmdt,"YYYYMMDDHHmmss");var html='\x3cspan class\x3d"day"\x3e'.concat(this.dayNames[m.day()], "\x3c/span\x3e").concat(m.format("HH:mm"));this.element.find(".noUi-tooltip").html(html)}}, {key:"_getSliderWidth",value:function _getSliderWidth(){var $slider=this.element.find("._slider");if(!$slider.length)return 0;return $slider.get(0).getBoundingClientRect().width}}, {key:"_updateSliderTextDisplayClass",value:function _updateSliderTextDisplayClass(){var sliderWidth=this._getSliderWidth();if(!sliderWidth)return;this.element.find("._playerRoot .noUi-date .date_text").each(function(index, date){var $parent=$(date).parent();var leftPx=parseFloat($parent.css("left"))||0;var halfWidth=date.getBoundingClientRect().width/2;var isLeftEdge=leftPx<=halfWidth;$parent.toggleClass("left",isLeftEdge); $parent.toggleClass("start",isLeftEdge&&leftPx===0);var isRightEdge=leftPx>=sliderWidth-halfWidth;$parent.toggleClass("right",isRightEdge);$parent.toggleClass("end",isRightEdge&&leftPx===sliderWidth)})}}, {key:"_updateSliderTooltipDisplayClass",value:function _updateSliderTooltipDisplayClass(ratio){var sliderWidth=this._getSliderWidth();if(!sliderWidth)return;var $player=this.element.find("._playerRoot"); var $tooltip=$player.find(".noUi-tooltip");var $handle=$player.find(".noUi-handle");if(!$tooltip.length||!$handle.length)return;var tooltipWidthHalf=$tooltip.get(0).getBoundingClientRect().width/2;var $connect= this.element.find("._slider .noUi-connect");var fillWidth=ratio!=null?sliderWidth*ratio:$connect.length?$connect.get(0).getBoundingClientRect().width:0;var isLeftEdge=fillWidth<=tooltipWidthHalf;$handle.toggleClass("left", isLeftEdge);$handle.toggleClass("start",isLeftEdge&&fillWidth===0);var isRightEdge=fillWidth>=sliderWidth-tooltipWidthHalf;$handle.toggleClass("right",isRightEdge);$handle.toggleClass("end",isRightEdge&& fillWidth===sliderWidth)}}, {key:"_activeItem",value:function _activeItem(){return this.items[this.activeIndex]||{}}}]); return rainPrecipitation}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0){var dthumbImageUrl="https://dthumb-phinf.pstatic.net/?src\x3d".concat(encodeURIComponent(place.source.imageUrls[0].url),"\x26type\x3dweather_l356_280"); imageUrlHtml='\n \x3ca href\x3d"'.concat(placeUrl,'" target\x3d"_blank" class\x3d"list_item_link" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'select\')" data-nlog\x3d"place" data-nlog-area\x3d"recommended_places.place_link" data-nlog-params\x3d\'{"category":"').concat(category,'"}\'\x3e\n \x3cdiv class\x3d"thumb_area"\x3e\n \x3cdiv class\x3d"place_thumb"\x3e\n \x3cimg src\x3d"').concat(dthumbImageUrl, '" class\x3d"image" width\x3d"100%" height\x3d"100%" alt\x3d""\n onerror\x3d"oCommon.thumbReady(this);" referrerpolicy\x3d"no-referrer"\n \x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n ')}html= '\n \x3cli class\x3d"list_item"\x3e\n '.concat(imageUrlHtml,'\n \x3cdiv class\x3d"info_area"\x3e\n \x3ca href\x3d"').concat(placeUrl,'" target\x3d"_blank" class\x3d"list_item_link" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'select\')" data-nlog\x3d"place" data-nlog-area\x3d"recommended_places.place_link" data-nlog-params\x3d\'{"category":"').concat(category,'"}\'\x3e\n \x3cdiv class\x3d"title_area"\x3e\n \x3cdiv class\x3d"title_inner"\x3e\n \x3cspan class\x3d"name"\x3e').concat(place.source.poiName, '\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"text_area"\x3e\n \x3cspan class\x3d"item"\x3e').concat(place.source.poiCategoryName, '\x3c/span\x3e\n \x3cspan class\x3d"item"\x3e').concat(place.source.address,'\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"text_area"\x3e\n \x3cspan class\x3d"item"\x3e\uc774 \uc7a5\uc18c\uc5d0\uc11c ').concat((_place$distanceMeter= place.distanceMeter)===null||_place$distanceMeter===void 0?void 0:_place$distanceMeter.toLocaleString("ko-KR"),'m\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"text_area"\x3e\n \x3cspan class\x3d"item"\x3e\ub9ac\ubdf0 ').concat((_place$source$reviewC= place.source.reviewCount)===null||_place$source$reviewC===void 0?void 0:_place$source$reviewC.toLocaleString("ko-KR"),"\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3c/div\x3e\n \x3c/li\x3e\n "); return html}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"attachEventAfter",value:function attachEventAfter(){this.element.on("click","._recommendedTabButton",$.proxy(this.changeTab,this))}}, {key:"changeTab",value:function changeTab(e){e.preventDefault();var $target=$(e.currentTarget);var tabName=$target.data("type");if(this.typeCafes===tabName){this.element.find("._recommendedRestaurantsButton").attr("aria-selected", "false");this.element.find("._recommendedCafesButton").attr("aria-selected","true");this.element.find("._recommendedRestaurantsArea").addClass("hide");this.element.find("._recommendedCafesArea").removeClass("hide"); this.resetScrollTarget("._recommendedPlacesScrollCafes")}else if(this.typeRestaurants===tabName){this.element.find("._recommendedCafesButton").attr("aria-selected","false");this.element.find("._recommendedRestaurantsButton").attr("aria-selected", "true");this.element.find("._recommendedCafesArea").addClass("hide");this.element.find("._recommendedRestaurantsArea").removeClass("hide");this.resetScrollTarget("._recommendedPlacesScrollRestaurants")}}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"resetScrollTarget",value:function resetScrollTarget(targetSelector){if(!targetSelector)return;var target=this.element.find(targetSelector);if(target.length===0)return;var scrollName=target.data("name"); if(_.isEmpty(oCommon.oScroll[scrollName]))oCommon.initScroll(target);else oCommon.refreshScroll(scrollName)}}, {key:"resetScroll",value:function resetScroll(){var _this4=this;var targets=this.element.find("._recommendedPlacesScroll");if(targets)targets.each(function(index,target){var selectorName=$(target).data("selector-name"); _this4.resetScrollTarget("._recommendedPlacesScroll"+selectorName)})}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}]); return recommendedPlaces}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)this.renderFollowingsSort();else this.renderFollowingsEmpty(); this.disableAllBtn();if(this.followingChannelMap.size>0&&this.followingChannelMap.size<10)this.enableAddFollowRegionBtn()}}, {key:"renderFollowingCount",value:function renderFollowingCount(){this.element.find(".interest_registration_head").removeClass("hide");this.element.find("._cnFollowingCount").html(this.followingChannelMap.size)}}, {key:"renderFollowingsEmpty",value:function renderFollowingsEmpty(){this.element.find(".interest_detail_init").removeClass("hide")}}, {key:"renderFollowingsSort",value:function renderFollowingsSort(){var _this3=this;this.element.find(".interest_detail_sort").removeClass("hide");this.element.find(".interest_sort_inner").empty();var element= this.element.find("._cnFollowingList");var _this=this;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=this.followingChannelMap[Symbol.iterator](), _step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step$value=_slicedToArray(_step.value,2),channelId=_step$value[0],channel=_step$value[1];var alarm= this.getAlarmStatusByChannelId(channelId);var overseas=this.checkOverseasChannelId(channelId);var alarmAttribute=overseas?"disabled":'aria-label\x3d"\uc54c\ub9bc '.concat(alarm?"\uc124\uc815":"\ubbf8\uc124\uc815", ' \uc0c1\ud0dc"');var liHtml='\n \x3cli class\x3d"interest_sort_item" data-channel-id\x3d"'.concat(channel.id,'" data-channel-alarm\x3d"').concat(alarm,'"\x3e\n \x3cdiv class\x3d"interest_item_inner ui-state-default ui-sortable-handle"\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_item_button" aria-label\x3d"\uad00\uc2ec\uc9c0\uc5ed \uc0ad\uc81c" data-region-code\x3d"').concat(channel.id, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'addbt\')" data-nlog-area\x3d"region_follow_config.delete_button" data-nlog-params\x3d\'{"region_id":"').concat(channel.id, '"}\'\x3e\x3c/button\x3e\n \x3cem class\x3d"interest_item_title"\x3e').concat(channel.fullAreaNm,'\x3c/em\x3e\n \x3cspan class\x3d"interest_item_alarm"\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_alarm_button" ').concat(alarmAttribute, ' data-region-code\x3d"').concat(channel.id,'" data-nlog\x3d"alarm" data-nlog-area\x3d"region_follow_config.alarm_button" data-nlog-params\x3d\'{"region_id":"').concat(channel.id,'"}\'\x3e\x3c/button\x3e\n \x3c/span\x3e\n \x3cbutton class\x3d"interest_item_image type_drag" data-nlog\x3d"drag" aria-hidden\x3d"true" data-region-code\x3d"').concat(channel.id, '" data-nlog-area\x3d"region_follow_config.drag_button" data-nlog-params\x3d\'{"region_id":"').concat(channel.id,'"}\'\x3e\x3c/button\x3e\n \x3cbutton class\x3d"interest_item_button" aria-label\x3d"\uad00\uc2ec\uc9c0\uc5ed \uc21c\uc11c \uc774\ub3d9" data-region-code\x3d"').concat(channel.id, '" data-nlog-area\x3d"region_follow_config.drag_button" data-nlog-params\x3d\'{"region_id":"').concat(channel.id,"\"}'\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3c/li\x3e\n "); element.append(liHtml)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}setTimeout(function(){_this3.element.find(".interest_alarm_tooltip").remove();_this3.showAlarmTooltip=false},4500); $("#sortable").sortable({handle:".interest_item_button[aria-label\x3d'\uad00\uc2ec\uc9c0\uc5ed \uc21c\uc11c \uc774\ub3d9']",helper:"clone",cancel:"",zIndex:9999,containment:".is_interest",placeholder:"type_placeholder", tolerance:"pointer",opacity:.6,change:function change(event,ui){$(".ui-sortable-placeholder").addClass("is-active")}, start:function start(event,ui){oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(this.clickCode,"drag"),true);if(window.oNlog2)oNlog2.send(ui.item.find('[data-nlog-area$\x3d"drag_button"]'), "click")}, update:function update(event,ui){var beforeOrderList=Array.from(_this.followingChannelMap.keys());var afterOrderList=_this.getCurrentChannelElementList();var enableSave=false;if(beforeOrderList.length!== afterOrderList.length)enableSave=true;else for(var i in beforeOrderList)if(beforeOrderList[i]!==afterOrderList[i]){enableSave=true;break}if(enableSave){_this.disableAllBtn();_this.enableSaveBtn();_this.enableResetBtn()}else{_this.disableOrderDiv(); _this.controlByFollowingCount()}}, stop:function stop(event,ui){if(!_this.showAlarmTooltip)_this.element.find(".interest_alarm_tooltip").remove()}}); if(this.followingChannelMap.size<=1)$("#sortable").sortable("disable");else $("#sortable").sortable("enable")}}, {key:"clickChangeAlarmStatus",value:function clickChangeAlarmStatus(e){if(!this.clickableAlarm)return;var current=$(e.currentTarget);var parentLi=current.parents(".interest_sort_item");var channelId=parentLi.data("channelId"); channelId="".concat(channelId);var alarm=parentLi.data("channelAlarm")!==true;var channel=this.followingChannelMap.get(channelId);var _this=this;if(this.checkOverseasChannelId(channelId))return;if(channel){oFollow.ajaxRegionAlarm(channel, alarm,function(data){if(data!=null)_this.changeChannelAlarmStatus(channelId,data,e)}); this.clickableAlarm=false;setTimeout(function(){return _this.clickableAlarm=true},250)}}}, {key:"changeChannelAlarmStatus",value:function changeChannelAlarmStatus(channelId,channel,event){this.followingChannelMap.set(channelId,channel);var element=this.element.find('.interest_sort_item[data-channel-id\x3d"'.concat(channelId, '"]'));var alarm=this.getAlarmStatusByChannelId(channelId);if(alarm){this.setAlarmCoachMarkCookie();oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(this.clickCode,"alerton"))}else oCommon.fnSendClick(event, "".concat(blockPageNameEn,".").concat(this.clickCode,"alertoff"));this.toastFollowRegionAlarm(channelId,alarm);element.data("channelAlarm",alarm);element.find(".interest_alarm_button").attr("aria-label", "\uc54c\ub9bc ".concat(alarm?"\uc124\uc815":"\ubbf8\uc124\uc815"," \uc0c1\ud0dc"))}}, {key:"checkOverseasChannelId",value:function checkOverseasChannelId(channelId){return channelId.startsWith("WD")}}, {key:"getRegionMetaByChannelId",value:function getRegionMetaByChannelId(channelId){var channel=this.followingChannelMap.get(channelId);var regionMetaStr=(channel===null||channel===void 0?void 0:channel.metaData)|| "{}";return JSON.parse(regionMetaStr)}}, {key:"getAlarmStatusByChannelId",value:function getAlarmStatusByChannelId(channelId){var _regionMeta$noti;var regionMeta=this.getRegionMetaByChannelId(channelId);return(regionMeta===null||regionMeta=== void 0?void 0:(_regionMeta$noti=regionMeta.noti)===null||_regionMeta$noti===void 0?void 0:_regionMeta$noti.region)===undefined?true:regionMeta.noti.region}}, {key:"getCurrentChannelElementList",value:function getCurrentChannelElementList(){var orderList=[];this.element.find(".interest_sort_item").each(function(i,e){orderList.push("".concat($(e).data("channelId")))}); return orderList}}, {key:"enableAddFollowRegionBtn",value:function enableAddFollowRegionBtn(){this.enableBtnDiv();this.element.find("._cnAddFollowRegionDiv").removeClass("hide")}}, {key:"disableAddFollowRegionBtn",value:function disableAddFollowRegionBtn(){this.element.find("._cnAddFollowRegionDiv").addClass("hide")}}, {key:"enableSaveBtn",value:function enableSaveBtn(){this.enableBtnDiv();this.element.find("._cnOrderDiv").removeClass("hide");this.element.find(".type_confirm").removeClass("hide")}}, {key:"disableSaveBtn",value:function disableSaveBtn(){this.element.find(".type_confirm").addClass("hide")}}, {key:"enableResetBtn",value:function enableResetBtn(){this.enableBtnDiv();this.element.find("._cnOrderDiv").removeClass("hide");this.element.find(".type_reset").removeClass("hide")}}, {key:"disableResetBtn",value:function disableResetBtn(){this.element.find(".type_reset").addClass("hide")}}, {key:"disableOrderDiv",value:function disableOrderDiv(){this.element.find("._cnOrderDiv").addClass("hide")}}, {key:"enableBtnDiv",value:function enableBtnDiv(){this.element.find(".interest_detail_confirm").removeClass("hide")}}, {key:"disableBtnDiv",value:function disableBtnDiv(){this.element.find(".interest_detail_confirm").addClass("hide")}}, {key:"disableAllBtn",value:function disableAllBtn(){this.disableOrderDiv();this.disableAddFollowRegionBtn();this.disableBtnDiv()}}, {key:"toastFollowRegionAlarm",value:function toastFollowRegionAlarm(channelId,on){var _this=this;var element=this.element.find("._cnToastSetAlarm");var nameText=this.followingChannelMap.get(channelId).fullAreaNm; var onOffText="";if(on)onOffText=" \ub0a0\uc528\uc54c\ub9bc\uc774 \uc124\uc815\ub418\uc5c8\uc2b5\ub2c8\ub2e4.";else onOffText=" \ub0a0\uc528\uc54c\ub9bc\uc774 \ud574\uc9c0\ub418\uc5c8\uc2b5\ub2c8\ub2e4."; var html='\x3cstrong class\x3d"interest_text_emphasis"\x3e'.concat(nameText,"\x3c/strong\x3e").concat(onOffText);element.find(".interest_tooltip_text").html(html);oToast.toast(function(){return element.removeClass("hide")}, function(){return element.addClass("hide")},2E3)}}, {key:"toastRemove",value:function toastRemove(channelId){var _this=this;var element=this.element.find("._cnToastRemove");var nameText=this.followingChannelMap.get(channelId).fullAreaNm;element.find(".interest_text_emphasis").html(nameText); oToast.toast(function(){return element.removeClass("hide")},function(){return element.addClass("hide")},2E3)}}, {key:"toastSaveFollow",value:function toastSaveFollow(){var _this=this;oToast.toast(function(){return _this.element.find("._cnToastSaveFollow").removeClass("hide")},function(){return _this.element.find("._cnToastSaveFollow").addClass("hide")}, 2E3)}}, {key:"getChannelList",value:function getChannelList(){return Array.from(this.followingChannelMap.values())}}, {key:"clickAddFollowRegion",value:function clickAddFollowRegion(e){e.preventDefault();oCommon.fnSetScrollTop(0);$("._cnSearchPopup").click()}}, {key:"clickOrderSave",value:function clickOrderSave(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"save"));var html='\n \x3cdiv class\x3d"interest_popup type_basic" tabindex\x3d"0" aria-hidden\x3d"false" style\x3d""\x3e\n \x3cdiv class\x3d"interest_popup_inner"\x3e\n \x3cstrong class\x3d"interest_popup_title"\x3e\n \ubcc0\uacbd\ub41c \ub0b4\uc6a9\uc744\x3cbr\x3e\n \uc800\uc7a5\ud560\uae4c\uc694?\n \x3c/strong\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"interest_popup_confirm"\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_confirm_button type_cancel _cnRegionFollowConfigSaveCancel" data-type\x3d"save" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'popreset\')" data-nlog-area\x3d"region_follow_config.layer.cancel_button" data-nlog-params\x3d\'{"target":"save"}\'\x3e\ucde8\uc18c\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_confirm_button type_confirm _cnRegionFollowConfigSaveConfirm" data-type\x3d"save" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'popsave\')" data-nlog-area\x3d"region_follow_config.layer.confirm_button" data-nlog-params\x3d\'{"target":"save"}\'\x3e\ud655\uc778\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); oPopup.showPopup(html)}}, {key:"clickOrderSaveCancel",value:function clickOrderSaveCancel(e){oPopup.hidePopup()}}, {key:"clickOrderSaveConfirm",value:function clickOrderSaveConfirm(e){var _this=this;var newOrderList=this.getCurrentChannelElementList();var newChannelList=[];for(var i in newOrderList)newChannelList.push(this.followingChannelMap.get(newOrderList[i])); oFollow.ajaxPatchRegion(newChannelList,function(data){if(data)_this.saveFollowRegion(data)})}}, {key:"clickOrderReset",value:function clickOrderReset(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"reset"));this.controlByFollowingCount()}}, {key:"saveFollowRegion",value:function saveFollowRegion(channelList){oPopup.hidePopup();this.initChannelToMap(channelList);this.renderFollowingsSort();this.toastSaveFollow();this.controlByFollowingCount()}}, {key:"clickFollowConfigInfo",value:function clickFollowConfigInfo(e){var $currentTarget=$("._cnFollowConfigInfo");var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer();if(isOpen)oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(this.clickCode,"infopcls"));else{oCommon.fnOpenInfoLayer($currentTarget);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"infopen"))}}}, {key:"removeFollowRegion",value:function removeFollowRegion(channelId){this.toastRemove(channelId);this.followingChannelMap["delete"](channelId);this.renderFollowingsSort();this.renderFollowingCount(); this.controlByFollowingCount()}}, {key:"updateRegionFollow",value:function updateRegionFollow(followings,changedType){var followingChannelList=(followings===null||followings===void 0?void 0:followings.channels)||[];this.followingChannelMap= new Map;this.initChannelToMap(followingChannelList);this.renderFollowingCount();this.controlByFollowingCount()}}, {key:"clickRemoveFollowRegion",value:function clickRemoveFollowRegion(e){if(!this.clickableRemoveRegion)return;var current=$(e.currentTarget);var parentLi=current.parents(".interest_sort_item");var channelId= parentLi.data("channelId");channelId="".concat(channelId);var channel=this.followingChannelMap.get(channelId);var html='\n \x3cdiv class\x3d"interest_popup type_basic" tabindex\x3d"0" aria-hidden\x3d"false" style\x3d"" data-channel-id\x3d"'.concat(channelId, '"\x3e\n \x3cdiv class\x3d"interest_popup_inner"\x3e\n \x3cstrong class\x3d"interest_popup_title"\x3e').concat(channel.fullAreaNm,'\x3c/strong\x3e\n \x3cdiv class\x3d"interest_popup_contents"\x3e\n \x3cp class\x3d"interest_popup_text type_basic"\x3e\n \uad00\uc2ec\uc9c0\uc5ed \uc0ad\uc81c\ud560\uae4c\uc694?\n \x3c/p\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \n \x3cdiv class\x3d"interest_popup_confirm"\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_confirm_button type_cancel _cnCancelRemoveFollowRegion" data-type\x3d"delete" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'cancel\')" data-nlog-area\x3d"region_follow_config.layer.cancel_button" data-nlog-params\x3d\'{"target":"delete"}\'\x3e\ucde8\uc18c\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"interest_confirm_button type_confirm _cnConfirmRemoveFollowRegion" data-type\x3d"delete" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'delok\')" data-nlog-area\x3d"region_follow_config.layer.confirm_button" data-nlog-params\x3d\'{"target":"delete"}\'\x3e\ud655\uc778\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); oPopup.showPopup(html);var _this=this;this.clickableRemoveRegion=false;setTimeout(function(){return _this.clickableRemoveRegion=true},250)}}, {key:"clickCancelRemoveFollowRegion",value:function clickCancelRemoveFollowRegion(e){oPopup.hidePopup()}}, {key:"clickConfirmRemoveFollowRegion",value:function clickConfirmRemoveFollowRegion(e){oPopup.hidePopup();var current=$(e.currentTarget);var parentLi=current.parents(".interest_popup");var channelId=parentLi.data("channelId"); channelId="".concat(channelId);var _this=this;oFollow.ajaxRegionUnFollow(channelId,function(data){if(data)_this.removeFollowRegion(channelId)})}}, {key:"setAlarmCoachMarkCookie",value:function setAlarmCoachMarkCookie(){this.setCookie("NV_WETR_REGION_FOLLOW_ALARM_COACH_MARK","CHECKED",9999999)}}, {key:"getAlarmCoachMarkCookie",value:function getAlarmCoachMarkCookie(){return this.getCookie("NV_WETR_REGION_FOLLOW_ALARM_COACH_MARK")}}, {key:"clickCloseAlarmCoachMark",value:function clickCloseAlarmCoachMark(e){this.setAlarmCoachMarkCookie();var current=$(e.currentTarget);current.parents(".interest_alarm_tooltip").addClass("hide")}}, {key:"setPopupReorganizationCookie",value:function setPopupReorganizationCookie(){this.setCookie("NV_WETR_REGION_FOLLOW_POPUP_REORGAN","CHECKED",9999999)}}, {key:"getPopupReorganizationCookie",value:function getPopupReorganizationCookie(){return this.getCookie("NV_WETR_REGION_FOLLOW_POPUP_REORGAN")}}, {key:"showPopupReorganization",value:function showPopupReorganization(){if(this.getPopupReorganizationCookie())return;var linkUrl="https://".concat(oCommon.fnGetResponsiveSizeType().deviceType==="Pc"?"": "m.","blog.naver.com/naver_weather/223278056302");var html='\n \x3cdiv class\x3d"interest_popup type_migration" tabindex\x3d"0" aria-hidden\x3d"false" style\x3d""\x3e\n \x3cdiv class\x3d"interest_popup_inner"\x3e\n \x3cspan class\x3d"interest_popup_title"\x3e\n \x3cstrong class\x3d"intreset_title_emphasis" aria-label\x3d"NEW"\x3e\x3c/strong\x3e\n \x3cspan class\x3d"blind"\x3e\n \ub0a0\uc528\uc54c\ub9bc \uc9c0\uc5ed\uc124\uc815\uc774 \x3cstrong\x3e\uad00\uc2ec\uc9c0\uc5ed\u00b7\uc54c\ub9bc\uc124\uc815\uc73c\ub85c \ud1b5\ud569 \uac1c\ud3b8\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\x3c/strong\x3e\n \x3c/span\x3e\n\n \x3ca href\x3d"'.concat(linkUrl, '" class\x3d"interest_title_link" aria-label\x3d"\uc790\uc138\ud788 \ubcf4\uae30" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'notpmore\')" data-nlog-area\x3d"region_follow_config.layer.migration_link"\x3e\x3c/a\x3e\n \x3c/span\x3e\n \x3cdiv class\x3d"interest_popup_contents"\x3e\n \x3cdiv class\x3d"interest_popup_visual type_set" aria-hidden\x3d"true"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"interest_popup_button _cnCloseMigrationPopup" aria-label\x3d"\ub2eb\uae30" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'notpclick\')" data-nlog\x3d"migration_close" data-nlog-area\x3d"region_follow_config.layer.migration_close_button"\x3e\x3c/button\x3e\n \x3c/div\x3e\n ');oPopup.showPopup(html)}}, {key:"closePopupReorganization",value:function closePopupReorganization(e){this.setPopupReorganizationCookie();$("#wrap").off("scroll touchmove mousewheel").removeClass("is-popup");oPopup.hidePopup()}}, {key:"setClosePopupCookie",value:function setClosePopupCookie(e){var target=$(e.target);if(target.hasClass("popup_dimmed"))if(target.children().hasClass("type_migration"))this.closePopupReorganization(); else oPopup.hidePopup()}}]); return regionFollowConfig}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i0&&arguments[0]!==undefined?arguments[0]:null;oCommon.initScroll(this.element.find(".scroll_area"),null,null,initCallback)}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName)}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"showRegionFollowAddTooltip",value:function showRegionFollowAddTooltip(){this.closeRegionFollowAddTooltip();var html='\n \x3cspan class\x3d"current_link_toast is-hidden _cnRegionFollowConfigTooltip"\x3e\n \x3cstrong class\x3d"current_toast_emphasis"\x3e\uad00\uc2ec\uc9c0\uc5ed \u00b7 \uc54c\ub9bc\x3c/strong\x3e \uc124\uc815\ud558\uc138\uc694\n \x3c/span\x3e\n '; this.element.find("._cnGoRegionFollowConfig").append(html);this.element.find("._cnGoRegionFollowConfig").find("._cnRegionFollowConfigTooltip").focus()}}, {key:"closeRegionFollowAddTooltip",value:function closeRegionFollowAddTooltip(){this.element.find("._cnRegionFollowConfigTooltip").remove()}}, {key:"updateRegionFollow",value:function updateRegionFollow(followings,changedType){var previewUrl=isBlockPreview?"/preview":"";var html="";followings.channels.forEach(function(channel){var isSelected= sRegionCode===channel.id;html+='\n \x3ca href\x3d"'.concat(previewUrl,"/today/").concat(channel.id,'" class\x3d"current_list_item type_basic" data-region-code\x3d"').concat(channel.id,'" aria-selected\x3d"').concat(isSelected, '" data-nlog-area\x3d"region_follow_list.scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(channel.id,"\"}'\x3e").concat(channel.sareaNm,"\x3c/a\x3e\n ")}); html+='\n \x3cspan class\x3d"current_list_item type_set" data-nlog\x3d"scroll"\x3e\n \x3ca href\x3d"#" class\x3d"current_item_link _cnGoRegionFollowConfig" data-nlog-area\x3d"region_follow_list.scroll.config_link"\x3e\uc9c0\uc5ed\uc124\uc815\x3c/a\x3e\n \x3c/span\x3e\n '; $(".current_list_inner").html(html);if(oCommon.oScroll["regionFollow"])oCommon.refreshScroll("regionFollow");else this.initScroll()}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".current_cp_button",$.proxy(this.clickCpSelectBox,this));this.element.on("click",".current_item_link._cnRegionFollowCpBtn",$.proxy(this.clickCpSelect, this))}}, {key:"clickCpSelectBox",value:function clickCpSelectBox(e){var $target=$(e.currentTarget);if($target.attr("aria-expanded")==="true")$target.attr("aria-expanded",false);else{oCommon.fnCloseAllVerticalLayers(); $target.attr("aria-expanded",true)}}}, {key:"clickCpSelect",value:function clickCpSelect(e){e.preventDefault();var previewUrl=isBlockPreview?"/preview":"";var cpName=$(e.currentTarget).data("cpName");this.ajaxCpFollow(sRegionCode,$(e.currentTarget).data("cpName"), function(data){location.href="".concat(previewUrl,"/today/").concat(sRegionCode,"?cpName\x3d").concat(cpName)})}}, {key:"ajaxCpFollow",value:function ajaxCpFollow(naverRgnCd,cpName,callback){var sURL="/follow/api/cp";$.ajax({type:"POST",url:sURL,data:{naverRgnCd:naverRgnCd,cpName:cpName},dataType:"json",success:function success(data){callback(data)}}).done(function(data){}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[blockTemplate.js] CP \uad6c\ub3c5 API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}}, {key:"checkFollowRegion",value:function checkFollowRegion(regionCode){var _this$templateData,_this$templateData$re;return(_this$templateData=this.templateData)===null||_this$templateData===void 0?void 0: (_this$templateData$re=_this$templateData.regionFollow)===null||_this$templateData$re===void 0?void 0:_this$templateData$re.channels.some(function(o){return o.id===regionCode})}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}]); return regionFollowList}(BlockTemplate); function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1)oBlockScriptService.callTemplateFunc("regionTalk","disableAutoUpdate")}, loadList:function loadList(oEvent){oEvent.oJson.result.pickedCommentList=[];$("._cnTalkLoadingArea").removeClass("hide");oBlockScriptService.callTemplateFunc("regionTalk","setFixedTalkBtn",oEvent);oBlockScriptService.callTemplateFunc("talkRecentPosts", "updatePosts",{commentList:oEvent.oJson.result.commentList||[]})}, loadCreate:function loadCreate(oEvent){oEvent.oJson.result.pickedCommentList=[]}, afterList:function afterList(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","movePersistCommentNo",oEvent);if(_this.goToTalkWrite)oBlockScriptService.callTemplateFunc("regionTalk","goAndFocusTalkWrite"); oBlockScriptService.callTemplateFunc("regionTalk","setCustomCommentNone");oBlockScriptService.callTemplateFunc("regionTalk","ajaxTalkStatsCount",["regionTalkStatsByKey","visualMapTalkStats"])}, beforeLogTransfer:function beforeLogTransfer(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","sendClickCode",oEvent)}, initialized:function initialized(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","renderStructure");oBlockScriptService.callTemplateFunc("regionTalk","initCustomCommentInputBox");oBlockScriptService.callTemplateFunc("regionTalk", "initRegionSelectBox");oBlockScriptService.callTemplateFunc("regionTalk","forceOpenReferenceComment");oBlockScriptService.callTemplateFunc("regionTalk","initTalkRegionBtn");oBlockScriptService.callTemplateFunc("regionTalk", "initCommentInputBoxSetUp");oBlockScriptService.callTemplateFunc("regionTalk","initTalkPersist");oBlockScriptService.callTemplateFunc("regionTalk","controlWindowScroll");oBlockScriptService.callTemplateFunc("regionTalk", "addReferenceCommentAlarmConfigLink");if(_this.isDisableAutoUpdate===true)setTimeout(function(){return oBlockScriptService.callTemplateFunc("regionTalk","disableAutoUpdate")},500); oBlockScriptService.callTemplateFunc("regionTalk","observeCommentInputHeightBox");oBlockScriptService.callTemplateFunc("regionTalk","windowScrollCommentInputFloating");oBlockScriptService.callTemplateFunc("regionTalk", "initTalkStatsCount");oBlockScriptService.callTemplateFunc("regionTalk","initTalkStatsGraph");if(_this.beforeActiveRegionBtnFloating){oBlockScriptService.callTemplateFunc("regionTalk","goScrollTalkVertical", 0);_this.beforeActiveRegionBtnFloating=false}oBlockScriptService.callTemplateFunc("regionTalk","updateTalkHeaderByRegion")}, beforeOpenReference:function beforeOpenReference(oEvent){oCommon.fnSendClick(oEvent,"".concat(blockPageNameEn,".").concat(_this.clickCode,"reply"));oBlockScriptService.callTemplateFunc("regionTalk","openReferenceComment", oEvent)}, afterCreate:function afterCreate(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","afterCommentWrite",oEvent);oBlockScriptService.callTemplateFunc("regionTalk","ajaxTalkStatsCount",["regionTalkStatsByKey", "visualMapTalkStats"])}, afterCloseReference:function afterCloseReference(){oBlockScriptService.callTemplateFunc("regionTalk","cancelWriteReferenceComment")}, afterMoveToFirstComment:function afterMoveToFirstComment(){oBlockScriptService.callTemplateFunc("regionTalk","moveTopComment");oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(_this.clickCode, "gotop"))}, beforeCreate:function beforeCreate(oEvent){var _oEvent$htParams;oBlockScriptService.callTemplateFunc("regionTalk","beforeCreateComment",oEvent);_this.focusDisableUpdate=!oBlockScriptService.callTemplateFunc("regionTalk", "isAutoUpdateEnable")[0];var contents=(oEvent===null||oEvent===void 0?void 0:(_oEvent$htParams=oEvent.htParams)===null||_oEvent$htParams===void 0?void 0:_oEvent$htParams.contents)||"";if(contents){contents= oCommon.fnWrapLinksWithAnchor(contents);oEvent.htParams.contents=contents}oBlockScriptService.callTemplateFunc("regionTalk","sendClickCode",oEvent,"RPC.write")}, afterOpenReference:function afterOpenReference(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","afterOpenReferenceComment",oEvent)}, beforeFocusComment:function beforeFocusComment(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","controlAutoUpdate",!_this.focusDisableUpdate)}, afterFocusComment:function afterFocusComment(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","moveAfterFocusComment")}, beforeAutoRefreshToggle:function beforeAutoRefreshToggle(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","sendClickCode",oEvent,"RPO.autoon")}, afterRemove:function afterRemove(oEvent){oBlockScriptService.callTemplateFunc("regionTalk","ajaxTalkStatsCount",["regionTalkStatsByKey","visualMapTalkStats"])}}, sSort:"NEW",aSortTypes:["NEW"],sTemplateId:this.isWindowScroll()?"disaster":"",sCategoryImage:"",sHelp:"up",sLanguage:"ko",sCountry:"KR",nPageSize:20,nIndexSize:5,nReplyPageSize:5,sCssId:"weather_talktalk_251127_w", sLangForTranslation:"",sCssUrl:"",bByCountry:false,bManager:false,sCommentNo:"",bSortCookie:false,sCountType:"total",aExcludeCountry:[],sAreaCodePrefix:"",sAuthType:"naver",bIncludeAllComments:"",bShowReply:false, bSupportAudioScheme:false,bUseInfiniteScrolling:false,nListSizeToShowMoveToFirst:10,sDateFormat:"m-d H:i",sTestUserIp:"",nUserCommentPageSize:10,nUserCommentReplyPageSize:5,sLocale:"",sMediaViewerDarkMode:"off"}; this.initFixedTalkBtn();this.commentRegionConfigInfoList=Object.values(this.getCommentRegionWithStats());this.commentRegionConfigInfoOrderNumList=Object.values(this.getCommentRegionWithStats()).sort(function(a, b){return a.orderNum-b.orderNum}); this.isSwitchRegionByElement=talkRegionCode!=="00";if(!this.isWindowScroll()&&this.pageRegionCode!=="00")if(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(this.pageRegionCode)){talkRegionCode=this.regionCodeToParentMap[this.pageRegionCode]|| "00";talkCategoryRegionCode=this.pageRegionCode}else{talkRegionCode=this.pageRegionCode.substring(0,2);talkCategoryRegionCode=this.pageRegionCode.substring(0,6)}if(talkRegionCode.length>2&&!(this.isLeisureTalkEnabled()&& oCodeUtil.isLsur(talkRegionCode)))talkRegionCode=talkRegionCode.substring(0,2);if(talkCategoryRegionCode.length>5&&!(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(talkCategoryRegionCode)))talkCategoryRegionCode= talkCategoryRegionCode.substring(0,5);var _this$setUpTalkPersis=this.setUpTalkPersist(talkRegionCode,talkCategoryRegionCode),objectRegionCode=_this$setUpTalkPersis.objectRegionCode,categoryRegionCode=_this$setUpTalkPersis.categoryRegionCode; this.talkRegionCode=objectRegionCode+"";this.talkCategoryRegionCode=categoryRegionCode+"";if(this.talkTab!=="keep"&&this.talkRegionCode!=="00")this.isSpreadObject=true;var _this$splitRegionCode=this.splitRegionCodeToObjectAndCategory(mLocRegionCode), mLocObjectRegionCode=_this$splitRegionCode["objectRegionCode"],mLocCategoryRegionCode=_this$splitRegionCode["categoryRegionCode"];if(mLocObjectRegionCode&&mLocCategoryRegionCode){this.currentLocationObjectRegionCode= mLocObjectRegionCode;this.currentLocationCategoryRegionCode=mLocCategoryRegionCode}if(this.talkTab==="keep"){this.keepLastObjectRegionCode=this.talkRegionCode;this.keepLastCategoryRegionCode=this.talkCategoryRegionCode; this.followLastRegionCode=this.pageRegionCode}else{this.talkTab="city";this.cityLastObjectRegionCode=this.talkRegionCode;this.cityLastCategoryRegionCode=this.talkCategoryRegionCode}this.router=Router(function(_ref){var _currentInfo$state, _prevInfo$state;var currentInfo=_ref.currentInfo,prevInfo=_ref.prevInfo;var currentPath=(_currentInfo$state=currentInfo.state)===null||_currentInfo$state===void 0?void 0:_currentInfo$state.path;var prevPath= prevInfo===null||prevInfo===void 0?void 0:(_prevInfo$state=prevInfo.state)===null||_prevInfo$state===void 0?void 0:_prevInfo$state.path;if(prevPath===currentPath)return;switch(currentPath){case "talk":_this3.openTalk(true); break;case "talk/region-search":break;case "talk/mediaViewer/list":__mediaViewer.list.show();break;case "talk/mediaViewer/viewer":__mediaViewer.viewer.show();break}switch(prevPath){case "talk":if((currentPath=== null||currentPath===void 0?void 0:currentPath.indexOf("talk/"))===0)return;_this3.clickTalkBackBtn();break;case "talk/region-search":_this3.closeKeepSearch();break;case "talk/mediaViewer/list":if((currentPath=== null||currentPath===void 0?void 0:currentPath.indexOf("talk/mediaViewer/"))===0)__mediaViewer.list.hide();else __mediaViewer.list.hide(true);break;case "talk/mediaViewer/viewer":__mediaViewer.viewer.hide(); break}}); if(this.isEnableInitTalk())this.enableTalk();else this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}}, {key:"renderStructure",value:function renderStructure(){var $baseElement=this.element.find(".u_cbox_cleanbot");$baseElement.after('\n \x3cdiv class\x3d"_cnStructureNoticeAlarm hide"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"_cnStructureTalkGraph hide"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"_cnStructureTalkRegionButton hide"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"_cnStructureTalkAttachment hide"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"_cnStructureTalkPublicInfo hide"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"_cnStructureTalkTalkStats hide"\x3e\x3c/div\x3e\n ')}}, {key:"getCommentRegionWithStats",value:function getCommentRegionWithStats(){var _this$templateData;return((_this$templateData=this.templateData)===null||_this$templateData===void 0?void 0:_this$templateData.commentRegionWithStatsMap)|| {}}}, {key:"buildRegionCodeToParentMap",value:function buildRegionCodeToParentMap(stats){var map={};if(!stats||_typeof(stats)!=="object")return map;for(var _i=0,_Object$entries=Object.entries(stats);_i<_Object$entries.length;_i++){var _Object$entries$_i= _slicedToArray(_Object$entries[_i],2),parentKey=_Object$entries$_i[0],parentInfo=_Object$entries$_i[1];if(!parentInfo||!parentInfo.subInfoMap)continue;for(var _i2=0,_Object$keys=Object.keys(parentInfo.subInfoMap);_i2< _Object$keys.length;_i2++){var childKey=_Object$keys[_i2];var childCode=childKey.replace(/^cd_/,"");var parentCode=parentKey.replace(/^cd_/,"");map[childCode]=parentCode}}return map}}, {key:"setCommentRegionWithStats",value:function setCommentRegionWithStats(data){if(data){this.templateData.commentRegionWithStatsMap=data;this.regionCodeToParentMap=this.buildRegionCodeToParentMap(data)}}}, {key:"getFollowLsurRegionInfo",value:function getFollowLsurRegionInfo(){var _this$templateData2;return((_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:_this$templateData2.followLsurInfoMap)|| {}}}, {key:"getFollowLsurRegionInfoByRegionCode",value:function getFollowLsurRegionInfoByRegionCode(regionCode){return this.getFollowLsurRegionInfo()[regionCode]||{}}}, {key:"getFollowLsurRegionInfoByNaverRgnCd",value:function getFollowLsurRegionInfoByNaverRgnCd(naverRgnCd){var lsurRegion=Object.values(this.getFollowLsurRegionInfo()).find(function(info){return"".concat(info.naverRgnCd)=== "".concat(naverRgnCd)})||{}; if(_.isEmpty(lsurRegion)){var tmp=oBlockScriptService.getBlockDataByKey("lsurRegion");if(tmp&&"".concat(tmp.naverRgnCd)==="".concat(naverRgnCd))lsurRegion=tmp}return lsurRegion||{}}}, {key:"getPageRegionCode",value:function getPageRegionCode(){return sRegionCode||"00"}}, {key:"_resolveCommentKeyType",value:function _resolveCommentKeyType(){var LSUR_TYPE_TO_TALK_KEY_TYPE={BB:"baseball",FB:"football",GF:"golf",MT:"mountain",SK:"ski",TP:"themepark"};var configType=this.templateInfo.customInfo.talkKeyType; var isTargetPage=["compare","air"].includes(blockPageNameEn);if(isTargetPage&&oCodeUtil.isLsur(sRegionCode)&&sRegionCode.length>=4){var mapped=LSUR_TYPE_TO_TALK_KEY_TYPE[sRegionCode.substring(2,4)];if(mapped)return mapped}return configType}}, {key:"isLeisureTalkEnabled",value:function isLeisureTalkEnabled(){return this.commentKeyType!=="warn"}}, {key:"getCurrentTalkLabelInfo",value:function getCurrentTalkLabelInfo(){var regionCode="".concat(this._currentTalkHeaderRegionCode||sRegionCode||"00");var leisureName=this._currentTalkHeaderLeisureName|| null;var level;if(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(regionCode)||this.talkTab==="keep")level="category3level";else if(regionCode==="00")level="group";else if(regionCode.length>=5)level="category"; else level="object";var pageLsurType=this.isLeisureTalkEnabled()?oCodeUtil.getLsurType(sRegionCode):null;var lsurKor=pageLsurType?oCodeUtil.getLsurTypeKor(pageLsurType):null;return{level:level,leisureName:leisureName, lsurKor:lsurKor}}}, {key:"attachEvent",value:function attachEvent(){var _this4=this;this.element.on("click","._cnObjectRegionBtn",$.proxy(this.clickObjectRegionBtn,this));this.element.on("click","._cnCategoryRegionBtn",$.proxy(this.clickCategoryRegionBtn, this));this.element.on("change","._cnTalkRegionSelect",$.proxy(this.clickRegionSelect,this));this.element.on("click","._cnCommentInputBox",$.proxy(this.clickCurrentLocation,this));this.element.on("click", "._cnPrivacyLocationPopup .btn_popup",$.proxy(this.clickPrivacyLocationAllow,this));this.element.on("click","._cnPrivacyLocationPopup .btn_close",$.proxy(this.openClosePrivacyLocationPopup,this,false)); this.element.on("click",".u_cbox_comment_box .u_cbox_article_link",$.proxy(this.clickCommentBoxLink,this));this.element.on("click",".u_cbox_image_link,.u_cbox_area_thumbnail_link",$.proxy(this.clickCommentImage, this));this.element.on("click","._cnObjectSpreadBtn",$.proxy(this.spreadObjectBtn,this));this.element.on("click","._cnTalkTab .tab",$.proxy(this.clickTalkTab,this));this.element.on("input","._cnSearchInput", $.proxy(this.inputKeepSearch,this));this.element.on("click",".search_area ._cnAutoCompleteResult,._cnLatelyResult,._cnHotResult",$.proxy(this.clickSearchResult,this));this.element.on("click","._cnKeepRegionBtn", $.proxy(this.clickKeepRegionBtn,this));this.element.on("click","._cnFollowRegionBtn",$.proxy(this.clickFollowRegionBtn,this));this.element.on("click","._cnSearchChangeRegion",$.proxy(this.clickSearchChangeRegion, this));if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.element.on("click",$.proxy(this.clickSearchOutside,this));else this.element.on("click",".talk_cmt_box",$.proxy(this.clickSearchOutside, this));this.element.on("click","._cnTalkCurrentLocation",$.proxy(this.clickCurrentLocation,this));this.element.on("click","._cnAttachmentMore",$.proxy(this.clickAttachmentMore,this));this.element.on("click", "._cnAttachmentElement",$.proxy(this.clickAttachmentElement,this));this.element.on("click",".u_cbox_area_quotecomment",$.proxy(this.clickMoveToOriginComment,this));this.element.on("click","._cnCustomTalkArea ._cnTalkInfoOpen,._cnTalkInfoClose", $.proxy(this.clickToggleTalkInfo,this));this.element.on("click","._cnTalkStatsGraphFold",$.proxy(this.foldTalkStatsGraph,this));this.element.on("click","._cnTalkTooltip",$.proxy(this.toggleTalkStatsCountTooltip, this));this.element.on("click",".talk_tab_item",$.proxy(this.clickTalkStatsGraphTab,this));this.element.on("click","._cnTalkStatsGraphInfoBtn",$.proxy(this.clickTalkStatsGraphInfoBtn,this));this.element.on("click", "._cnBtnPickFold",$.proxy(this.pickFold,this));this.element.on("click","._cnGoToPickComment",$.proxy(this.goToPickComment,this));$(document).on("click",".section_right_inner ._cnTalkBack,._cnTalkClose", $.proxy(this.clickTalkBackBtn,this));$(document).on("click","._cnTalkBtn",$.proxy(this.enableTalk,this));$(document).on("click",".fixed_btn_wrap .common_talk_button._cnTalkClose",$.proxy(this.closeFloatingComment, this));$(document).on("click","._cnTalkMapFoldBtn",$.proxy(this.foldVisualMapTalk,this));oCommon.fnGetPageScrollEventTarget(window).on("scroll",$.proxy(this.windowScrollCommentInputFloating,this));this.element.on("click", ".u_cbox_btn_more",$.proxy(function(e){return oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this4.clickCode,"readmore"))},this)); this.element.on("click",".u_cbox_upload_video_wrap",$.proxy(function(e){return oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this4.clickCode,"attachmov"))},this)); this.element.on("click",".u_cbox_upload_photo_wrap",$.proxy(function(e){return oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this4.clickCode,"attachimg"))},this)); if(deviceType==="mobile"){if(osName==="android"){var $meta=$('meta[name\x3d"viewport"]');if($meta.length){var content=$meta.attr("content")||"";if(!/interactive-widget\s*=/.test(content)){content=content.trim(); if(content.length>0&&!content.endsWith(","))content+=", ";content+="interactive-widget\x3dresizes-content";$meta.attr("content",content)}}}else $(document).on("scroll",$.proxy(_.debounce(function(e){if(_this4.isKeyboardVisible)$("html, body").animate({scrollTop:0}, 1,"swing")},50,{maxWait:50}),this)); $(window.visualViewport).on("resize",$.proxy(this.detectKeyboard,this))}this.detectCommentLayer()}}, {key:"attachScrollEvent",value:function attachScrollEvent(){if(this.isWindowScroll())$(document).off("scroll").on("scroll",$.proxy(this.controlWindowScroll,this));else $(".section_right_inner").off("scroll").on("scroll", $.proxy(this.controlWindowScroll,this));this.attachedScrollEvent=true}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return this.isWindowScroll()||!sRegionCode.startsWith("WD")}}, {key:"initLnb",value:function initLnb(){$("._cnTalkBtn").removeClass("hide")}}, {key:"isEnableInitTalk",value:function isEnableInitTalk(){return isInitTalk==="true"}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(isChanged){if(lastResponsiveSizeType.deviceType==="Pc"){$("._cnGoToTalkWrite").css("display: none");this.element.find(".district_area").removeClass("floating_in").removeClass("floating_out")}var $shareBtn= $(".section_right_inner .naver-splugin");if($shareBtn.length>0)window.__splugin.hide($shareBtn)}this.resetAllTalkScroll();this.talkLayerHeightControl();this.windowScrollCommentInputFloating()}}, {key:"enableTalk",value:function enableTalk(){oCommon.fnCloseAllVerticalLayers();this.openTalk();if(!this.attachedScrollEvent)this.attachScrollEvent();if(!(new URL(document.location)).searchParams.has("ref"))this.pushHistory({state:{path:"talk"}}); var $commentTalkBtn=$(".fixed_btn_wrap .common_talk");$commentTalkBtn.removeClass("is-active")}}, {key:"openTalk",value:function openTalk(fixPosition){$(".fixed_btn_wrap ._cnTalkBtn").addClass("hide");$(".section_center").addClass("talk");$("#wrap").addClass("wrap_talk");$("#container").addClass("is_talk--show"); $(".section_single").addClass("talk");$("._cnTalkMapFoldBtn").attr("aria-selected",true);this.resetAllTalkScroll();if(this.getTalkVerticalScrollElement().scrollTop()!==0&&!fixPosition)this.goScrollTalkVertical(0); this.initComment(this.talkRegionCode,this.talkCategoryRegionCode);if(!this._nlogTalkPushed&&window.oNlog2){var talkPageCode=$(".section_right[data-nlog-page-layer]").attr("data-nlog-page-layer");if(talkPageCode){oNlog2.pushPage(talkPageCode, this.talkRegionCode?{region_id:"".concat(this.talkRegionCode)}:{},"regionTalk");this._nlogTalkPushed=true}}}}, {key:"foldVisualMapTalk",value:function foldVisualMapTalk(e){e.preventDefault();var $current=$(e.currentTarget);if($current.attr("aria-selected")==="true")this.closeTalk();else this.enableTalk()}}, {key:"initShare",value:function initShare(){var element=$(".section_right_inner .btn_sns_share");element.attr("data-url",this.getCurrentShareRegionUrl())}}, {key:"getCurrentShareRegionUrl",value:function getCurrentShareRegionUrl(){var objectRegionCode=this.talkRegionCode;var categoryRegionCode=this.talkCategoryRegionCode==="00"||this.talkRegionCode===this.talkCategoryRegionCode? "":"/".concat(this.talkCategoryRegionCode);return"".concat(spluginURL,"/").concat(objectRegionCode).concat(categoryRegionCode)}}, {key:"setUpTalkPersist",value:function setUpTalkPersist(objectRegionCode,categoryRegionCode){this.talkPersist=new eg.Persist(this.talkPersistName);var oData=this.talkPersist.get("");if(oData){if(oData.isTalkOn=== true){$(".fixed_btn_wrap ._cnTalkBtn").addClass("hide");$(".section_center").addClass("talk");$("#wrap").addClass("wrap_talk")}this.isPrivacyLocation=oData.isPrivacyLocation;objectRegionCode=oData.talkRegionCode; categoryRegionCode=oData.talkCategoryRegionCode;this.isSwitchRegionByElement=oData.isSwitchRegionByElement}return{objectRegionCode:objectRegionCode,categoryRegionCode:categoryRegionCode}}}, {key:"initCommentWithTalkTab",value:function initCommentWithTalkTab(talkRegionCode,talkCategoryRegionCode,talkTab){var categoryRegionCode="00",objectRegionCode="00";if(talkTab&&(talkTab==="city"||talkTab=== "keep"))this.talkTab=talkTab;if(talkRegionCode){talkRegionCode=encodeURIComponent(talkRegionCode);if(talkRegionCode.length===2)objectRegionCode=talkRegionCode}if(talkCategoryRegionCode){talkCategoryRegionCode= encodeURIComponent(talkCategoryRegionCode);if(talkCategoryRegionCode.length===5||this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(talkCategoryRegionCode))categoryRegionCode=talkCategoryRegionCode}else categoryRegionCode= objectRegionCode;this.isSpreadObject=true;this.setLastRegionCode(objectRegionCode,categoryRegionCode);if(this.talkTab!=="keep")this.initScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(objectRegionCode, categoryRegionCode)}}, {key:"_loadCboxScript",value:function _loadCboxScript(){window.__htCboxOption=this.commentOption;var s=document.createElement("script");s.type="text/javascript";s.charset="utf-8";s.src=this.commentOption.sDomain+ "/js/cbox.core.js?v\x3d"+Math.floor((new Date).getTime()/12E5);(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}}, {key:"initComment",value:function initComment(talkRegionCode,talkCategoryRegionCode){if(this.lastRegionInfoAndCountWithStats&&Object.keys(this.lastRegionInfoAndCountWithStats).length>0)this.setCommentRegionWithStats(this.lastRegionInfoAndCountWithStats); this.inputPaddingOffset=0;talkRegionCode=encodeURIComponent(talkRegionCode);talkCategoryRegionCode=encodeURIComponent(talkCategoryRegionCode);this.initCommentConfig(talkRegionCode,talkCategoryRegionCode); this._loadCboxScript()}}, {key:"initCommentConfig",value:function initCommentConfig(talkRegionCode,talkCategoryRegionCode){var staticDomain="https://alpha-static-cbox.naver.net";var apiDomain="https://dev.apis.naver.com/commentBox/cbox12"; var cssUrlPath="/uit-weather/preview/branches/".concat(devCssBranch,"/css/comment_weather_talktalk_w.css");var cssUrl="".concat(baseURL).concat(cssUrlPath);if(phase==="real"||phase==="staging"){staticDomain= "https://ssl.pstatic.net/static.cbox";apiDomain="https://apis.naver.com/commentBox/cbox12";cssUrl=""}else if(phase==="local")cssUrl="https://pages.navercorp.com".concat(cssUrlPath);var isWrite=true;this.talkRegionCode= talkRegionCode;this.talkCategoryRegionCode=talkCategoryRegionCode;var followStats=null;if(this.talkTab==="keep"&&this.followLastRegionCode){var _this$templateData3,_this$templateData3$f;var candidate=(_this$templateData3= this.templateData)===null||_this$templateData3===void 0?void 0:(_this$templateData3$f=_this$templateData3.followStatsMap)===null||_this$templateData3$f===void 0?void 0:_this$templateData3$f[this.followLastRegionCode]; if(candidate&&candidate.categoryId&&candidate.objectId&&candidate.groupId)followStats=candidate}if(followStats){var parsedParent=String(followStats.objectId).split("_").pop();if(parsedParent){this.talkRegionCode= parsedParent;talkRegionCode=parsedParent}this.talkCategoryRegionCode=followStats.regionCode||talkCategoryRegionCode;talkCategoryRegionCode=this.talkCategoryRegionCode;this.currentCommentObjectRegionConfigInfo= {regionCode:this.talkRegionCode,shortName:"",objectId:followStats.objectId,groupId:followStats.groupId};this.currentCommentCategoryRegionConfigInfo={regionCode:followStats.regionCode,shortName:followStats.shortName|| "",categoryId:followStats.categoryId,groupId:followStats.groupId,h3Count:followStats.h3Count,hourlyCount:followStats.hourlyCount};this.commentOption.sListType="category";this.commentOption.sCategoryId= followStats.categoryId;this.commentOption.sLikeItId=followStats.categoryId;this.commentOption.sGroupId=followStats.groupId;this.commentOption.sObjectId=followStats.objectId}else{var _this$getCommentRegio= this.getCommentRegionConfigInfoByRegionCode(talkRegionCode,talkCategoryRegionCode),objectRegionInfo=_this$getCommentRegio.objectRegionInfo,categoryRegionInfo=_this$getCommentRegio.categoryRegionInfo;this.currentCommentObjectRegionConfigInfo= objectRegionInfo;this.currentCommentCategoryRegionConfigInfo=categoryRegionInfo;this.commentOption.sCategoryId="";if(this.talkRegionCode==="00"){isWrite=false;this.commentOption.sListType="group";this.commentOption.sLikeItId= this.currentCommentObjectRegionConfigInfo.objectId;if(this.isForceKeepCommentNone()===true)this.commentOption.sListType="object"}else if(this.currentCommentObjectRegionConfigInfo&&!this.currentCommentCategoryRegionConfigInfo){isWrite= false;this.commentOption.sLikeItId=this.currentCommentObjectRegionConfigInfo.objectId;this.commentOption.sListType="object"}else if(this.currentCommentObjectRegionConfigInfo&&this.currentCommentCategoryRegionConfigInfo){this.commentOption.sListType= "category";this.commentOption.sCategoryId=this.currentCommentCategoryRegionConfigInfo.categoryId;this.commentOption.sLikeItId=this.currentCommentCategoryRegionConfigInfo.categoryId}else{this.talkTab="city"; this.setLastRegionCode("00","00");this.initComment("00","00");return}this.commentOption.sGroupId=this.currentCommentObjectRegionConfigInfo.groupId;this.commentOption.sObjectId=this.currentCommentObjectRegionConfigInfo.objectId}if(this.isPrivacyLocation=== false)isWrite=true;if(this.isNotAllowLocationAndEntire())this.commentOption.htMessage.template.write_placeholder="\uc9c0\uc5ed \uc120\ud0dd \ud6c4 \uba54\uc2dc\uc9c0\ub97c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."; else this.commentOption.htMessage.template.write_placeholder="\uc9c0\uae08 \ub0a0\uc528\uac00 \uc5b4\ub5a4\uac00\uc694?";this.initShare();this.setCommentFormation(isWrite);this.commentOption.sDomain=staticDomain; this.commentOption.sApiDomain=apiDomain;this.commentOption.sCssUrl=cssUrl;if(this.initCommentNo)this.isDisableAutoUpdate=true}}, {key:"getCommentApiDomain",value:function getCommentApiDomain(){var apiDomain="https://dev.apis.naver.com";if(phase==="real"||phase==="staging")apiDomain="https://apis.naver.com";return apiDomain}}, {key:"initAttachmentArea",value:function initAttachmentArea(){var _this5=this;if(this.mediaViewerType==="NONE")return;if(this.isForceKeepCommentNone())return;var template="_idTalkAttachment";var oTemplate= Handlebars.getTemplateSync(template);var elContent=oTemplate({"blockPageNameEn":blockPageNameEn,"clickCode":this.clickCode,"_nlogArea1":"region_talk"});this.element.find("._cnStructureTalkAttachment").replaceWith(elContent); var _this=this;var minViewSize=7;var timeoutMinutes=1440;var attachmentArea=this.element.find("._cnAttachmentArea");var ticket=this.commentOption.sTicket;var groupId=this.commentOption.sGroupId?this.commentOption.sGroupId: "";var objectId=this.commentOption.sObjectId?this.commentOption.sObjectId:"";var categoryId=this.commentOption.sCategoryId?this.commentOption.sCategoryId:"";var listType=this.commentOption.sListType;var apiDomain= this.getCommentApiDomain();var mediaViewerConfigApi="".concat(apiDomain,"/commentBox/cbox/web_naver_config_info_json.json?pool\x3dcbox12\x26ticket\x3d").concat(ticket,"\x26type\x3dmediaviewer\x26lang\x3dko"); var param="";var callMediaViewerConfigFunc=new Promise(function(resolve,reject){return new $.ajax({method:"GET",url:mediaViewerConfigApi,success:function success(data){var _data$result;resolve((data=== null||data===void 0?void 0:(_data$result=data.result)===null||_data$result===void 0?void 0:_data$result.type)||"NONE")}, error:function error(xhr,status,_error){reject({"error":_error,"url":mediaViewerConfigApi,"xhr":xhr,"status":status})}})}); callMediaViewerConfigFunc.then(function(mediaViewerType){var listApi="".concat(apiDomain,"/commentBox/cbox/web_naver_attachment_list_json.json?viewType\x3d").concat(mediaViewerType,"\x26pool\x3dcbox12\x26ticket\x3d").concat(ticket); var countApi="".concat(apiDomain,"/commentBox/cbox/web_naver_attachment_count_json.json?pool\x3dcbox12\x26ticket\x3d").concat(ticket);switch(listType){case "group":param+="\x26groupId\x3d".concat(groupId); param+="\x26listType\x3dgroup";attachmentArea.data("groupId",groupId);break;case "object":param+="\x26objectId\x3d".concat(objectId);param+="\x26listType\x3dobject";attachmentArea.data("objectId",objectId); break;case "category":param+="\x26objectId\x3d".concat(objectId,"\x26categoryId\x3d").concat(categoryId);param+="\x26listType\x3dcategory";attachmentArea.data("objectId",objectId);attachmentArea.data("categoryId", categoryId);break}listApi+=param;countApi+=param;if(mediaViewerType==="NONE"){_this.element.find("._cnAttachmentAreaLoading").removeClass("active");return null}else return Promise.all([_this.attachmentCountApi(countApi, mediaViewerType),_this.attachmentListApi(listApi,minViewSize,timeoutMinutes)])}).then(function(result){_this.element.find("._cnAttachmentAreaLoading").removeClass("active"); if(result&&result.length===2&&result[0]>=minViewSize&&result[1]>=minViewSize){_this.element.find("._cnAttachmentArea").addClass("active");_this.initTalkScroll(_this5.element.find("._cnAttachmentScrollArea .scroll_area")); var lazyImages=[].slice.call(_this.element.find("._cnImageLazy"));_this.lazyLoadFunc(lazyImages)}})["catch"](function(error){var _error$xhr,_error$xhr2; _this.element.find("._cnAttachmentAreaLoading").removeClass("active");oCommon.fnSendErrorToNelo("[regionTalk.js] \ubaa8\uc544\ubcf4\uae30 API \ud638\ucd9c\uc2e4\ud328 error : ".concat(error===null||error=== void 0?void 0:error.error,", status : ").concat(error===null||error===void 0?void 0:(_error$xhr=error.xhr)===null||_error$xhr===void 0?void 0:_error$xhr.status,", textStatus : ").concat(error===null||error=== void 0?void 0:error.status,", url : ").concat(error===null||error===void 0?void 0:error.url,", response : ").concat(error===null||error===void 0?void 0:(_error$xhr2=error.xhr)===null||_error$xhr2===void 0? void 0:_error$xhr2.responseText),error===null||error===void 0?void 0:error.xhr)})}}, {key:"attachmentCountApi",value:function attachmentCountApi(url,mediaViewerType){var _this=this;return new Promise(function(resolve,reject){return new $.ajax({method:"GET",url:url,success:function success(data){var imageCount= 0;var videoCount=0;var totalCount=0;try{imageCount=Number(data.result.imageCount);videoCount=Number(data.result.videoCount);_this.element.find("._cnAttachmentImageCount").html(imageCount);_this.element.find("._cnAttachmentVideoCount").html(videoCount); totalCount=imageCount+videoCount;if(mediaViewerType==="IMAGE"){totalCount-=videoCount;_this.element.find("._cnAttachmentVideoCountLi").remove()}else if(mediaViewerType==="VIDEO"){totalCount-=imageCount; _this.element.find("._cnAttachmentImageCountLi").remove()}}catch(error){reject({"error":error,"url":url})}resolve(totalCount)}, error:function error(xhr,status,_error2){reject({"error":_error2,"url":url,"xhr":xhr,"status":status})}})})}}, {key:"attachmentListApi",value:function attachmentListApi(url,minViewSize,timeoutMinutes){var _this=this;return new Promise(function(resolve,reject){return $.ajax({method:"GET",url:url,xhrFields:{withCredentials:true}, success:function success(data){try{if(data&&data.result&&data.result.attachmentList){var current=moment.utc().utcOffset("+09:00");var list=data.result.attachmentList.filter(function(data){return data.commentInfo.userReport=== false&&data.commentInfo.hiddenByCleanbot===false}).slice(0,minViewSize); var hasRecent=list.filter(function(data){return current.diff(moment(data.commentInfo.regDate),"minutes")<=timeoutMinutes}).length>0; if(!hasRecent)list=[];var html="";for(var i=0;ithis.width?" wide":" long";$(this).parent("._cnAttachmentElement").addClass(thumbnailClass)}; lazyImages=lazyImages.filter(function(image){return image!==lazyImage})})},200)}}, {key:"initMediaViewer",value:function initMediaViewer(selectAttachment,usePushHistory){var _this6=this;var _this=this;var attachmentArea=this.element.find("._cnAttachmentArea");var groupId=attachmentArea.data("groupId"); var objectId=attachmentArea.data("objectId");var categoryId=attachmentArea.data("categoryId");var snsShareStyle="standard";var title="";var apiDomain=this.getCommentApiDomain();var apiInfo={domain:apiDomain, staticParam:{"pool":"cbox12","ticket":this.commentOption.sTicket},pageSize:20};if(groupId)apiInfo.staticParam.groupId=groupId;if(objectId)apiInfo.staticParam.objectId=objectId;if(categoryId)apiInfo.staticParam.categoryId= categoryId;if(deviceType==="pc")snsShareStyle="unity-v2";var viewerType="IMAGE";if(selectAttachment&&selectAttachment.attachment&&selectAttachment.attachment.type)viewerType=selectAttachment.attachment.type; if(this.mediaViewerTitle)title=this.mediaViewerTitle;var mediaViewerList={defaultType:viewerType};if(this.mediaViewerType!=="ALL")if(this.mediaViewerType==="IMAGE"){mediaViewerList.hiddenType="VIDEO";mediaViewerList.defaultType= "IMAGE"}else if(this.mediaViewerType==="VIDEO"){mediaViewerList.hiddenType="IMAGE";mediaViewerList.defaultType="VIDEO"}__mediaViewer.init({wrapper:document.querySelector("._media_viewer"),useHistoryBackOnCloseButton:deviceType=== "mobile",list:mediaViewerList,apiInfo:apiInfo,viewer:{titles:{badge:"\uc81c\ubcf4 \uc624\ud508\ud1a1",title:title},commentWrapperId:"cbox_module",firstData:selectAttachment||null,onInitShareButton:function onInitShareButton(shareButton, data){$(shareButton).addClass("naver-splugin").attr({"data-style":snsShareStyle,"data-url":"".concat(_this.getCurrentShareRegionUrl(),"?commentNo\x3d").concat(data.commentInfo.commentNo),"data-source-name":"\uc81c\ubcf4 \uc624\ud508\ud1a1", "data-title":"\uc8fc\ubcc0 \uc0c1\ud669\uc744 \uc81c\ubcf4\ud574\uc8fc\uc138\uc694!","data-cafe-source-form":"2"});window.__splugin.init()}, showCommentBtn:true},showArea:true,onClickUIElement:function onClickUIElement(event,currentUIName){switch(currentUIName){case "list-item":_this6.pushHistory({state:{path:"talk/mediaViewer/viewer"}});break; case "viewer-original-btn":case "viewer-comment-btn":_this6.pushHistory({state:{path:"talk"}});break}var clickCodeMap={"tab-photo":"".concat(blockPageNameEn,".").concat(_this.clickCode,"ruptap"),"tab-video":"".concat(blockPageNameEn, ".").concat(_this.clickCode,"ruptab"),"list-back-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"rupback"),"list-item":"".concat(blockPageNameEn,".").concat(_this.clickCode,"rupcontent"),"viewer-back-btn":"".concat(blockPageNameEn, ".").concat(_this.clickCode,"viewclose"),"viewer-prev-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewnavi"),"viewer-next-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewnavi"), "viewer-original-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"vieworigin"),"viewer-share-btn":"".concat(blockPageNameEn,".").concat(_this.clickCode,"viewshare"),"viewer-comment-btn":"".concat(blockPageNameEn, ".").concat(_this.clickCode,"viewreply")};var clickCode=clickCodeMap[currentUIName];if(clickCode)oCommon.fnSendClick(event,clickCode)}}).then(function(_ref2){var initModuleName=_ref2.initModuleName; if(!usePushHistory)return;switch(initModuleName){case "list":_this6.pushHistory({state:{path:"talk/mediaViewer/list"}});break;case "viewer":_this6.pushHistory({state:{path:"talk/mediaViewer/viewer"}}); break}})}}, {key:"clickAttachmentMore",value:function clickAttachmentMore(e){e.preventDefault();cbox.Interface.openMediaViewer({darkMode:"off"})}}, {key:"clickAttachmentElement",value:function clickAttachmentElement(e){e.preventDefault();var current=$(e.currentTarget);var attachmentInfoStr=current.data("info");var attachmentInfo=null;if(attachmentInfoStr)attachmentInfo= JSON.parse(decodeURIComponent(attachmentInfoStr));if(attachmentInfo)cbox.Interface.openMediaViewer({attachmentId:attachmentInfo.attachment.attachmentId,darkMode:"off"})}}, {key:"setScrollPositionInfo",value:function setScrollPositionInfo(names){for(var i in names){var name=names[i];if(oCommon.oScroll.hasOwnProperty(name)){var talkRegionBtnScroll=oCommon.oScroll[name];if(talkRegionBtnScroll!== undefined){this.talkRegionBtnScrollPositionInfo[name].x=talkRegionBtnScroll.x;if(talkRegionBtnScroll.options.snap===true)this.talkRegionBtnScrollPositionInfo[name].pageX=talkRegionBtnScroll.currentPage.pageX}}}}}, {key:"initScrollPositionInfo",value:function initScrollPositionInfo(names){for(var i in names){var name=names[i];this.talkRegionBtnScrollPositionInfo[name]={x:null,pageX:null}}}}, {key:"getCommentRegionConfigInfoByRegionCode",value:function getCommentRegionConfigInfoByRegionCode(objectRegionCode,categoryRegionCode){var objectRegionInfo=null,categoryRegionInfo=null;if(objectRegionCode){var key= "cd_".concat(objectRegionCode);objectRegionInfo=this.getCommentRegionWithStats()[key];if(objectRegionInfo===undefined){objectRegionInfo=this.getCommentRegionWithStats()["cd_00"];if(objectRegionInfo===undefined)oCommon.fnSendErrorToNelo("[regionTalk.js] \uc81c\ubcf4\ud1a1 \uc9c0\uc5ed\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ".concat(objectRegionCode), null);else this.talkRegionCode="00"}}if(objectRegionInfo&&categoryRegionCode&&objectRegionCode!==categoryRegionCode){var _key="cd_".concat(categoryRegionCode);categoryRegionInfo=objectRegionInfo.subInfoMap[_key]; if(categoryRegionInfo===undefined){this.talkCategoryRegionCode=this.talkRegionCode;this.setLastRegionCode(this.talkRegionCode,this.talkCategoryRegionCode)}}return{objectRegionInfo:objectRegionInfo,categoryRegionInfo:categoryRegionInfo}}}, {key:"isNotAllowLocationAndEntire",value:function isNotAllowLocationAndEntire(){return this.isPrivacyLocation===false&&this.currentCommentObjectRegionConfigInfo.regionCode==="00"}}, {key:"setCommentFormation",value:function setCommentFormation(isWrite){var formation=[];formation.push("count");if((isWrite||this.isReferenceWrite)&&pageIsOn&&(this.isReferenceWrite||!(this.commentOption.sObjectId|| "").endsWith("_00")))formation.push("write");formation.push("list");formation.push("page");this.commentOption.aFormation=formation;return formation}}, {key:"isAutoUpdateEnable",value:function isAutoUpdateEnable(){var refresh=cbox.Interface.refresh("cbox_module");return refresh.running()}}, {key:"controlAutoUpdate",value:function controlAutoUpdate(on){var localOn=on===undefined?!this.isDisableAutoUpdate:on;if(localOn)this.enableAutoUpdate();else this.disableAutoUpdate();this.isDisableAutoUpdate= false}}, {key:"disableAutoUpdate",value:function disableAutoUpdate(){var refresh=cbox.Interface.refresh("cbox_module");if(refresh.running()){refresh.toggle();this.isDisableAutoUpdate=false}}}, {key:"enableAutoUpdate",value:function enableAutoUpdate(){var refresh=cbox.Interface.refresh("cbox_module");if(!refresh.running()){refresh.toggle();this.isDisableAutoUpdate=false}}}, {key:"initFixedTalkBtn",value:function initFixedTalkBtn(){var element=$(".fixed_btn_wrap");var userAgent=navigator.userAgent;if(userAgent.indexOf("NAVER")>=0)element.addClass("fixed_btn_app");element.append('\n \x3cdiv class\x3d"fixed_btn_wrap fixed_btn_app"\x3e\n \x3cdiv class\x3d"common_talk"\x3e\n \x3cdiv class\x3d"common_talk_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"common_talk_button type_talk _cnTalkBtn" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'floating\')" data-nlog-area\x3d"region_talk.talk_button"\x3e\n \x3cspan class\x3d"blind"\x3e\uc81c\ubcf4 \ud1a1\x3c/span\x3e\n \x3c/button\x3e\n\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"common_talk_button type_close _cnTalkClose" data-nlog\x3d"floating_close" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'floatingx\')" data-nlog-area\x3d"region_talk.floating_close_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '))}}, {key:"setFixedTalkBtn",value:function setFixedTalkBtn(e){var $commentTalkBtn=$(".fixed_btn_wrap .common_talk");var upHtml='\n \x3cstrong class\x3d"common_button_emphasis type_recent _cnFloatingTalkUp"\x3e\n \x3cspan class\x3d"blind"\x3eUP\x3c/span\x3e\n \x3c/strong\x3e\n '; var h3Count=0;if(this.talkCategoryRegionCode&&this.talkCategoryRegionCode.length>=5){var _this$getCommentRegio2,_this$getCommentRegio3;h3Count=((_this$getCommentRegio2=this.getCommentRegionWithStats()["cd_".concat(this.talkRegionCode)])=== null||_this$getCommentRegio2===void 0?void 0:(_this$getCommentRegio3=_this$getCommentRegio2.subInfoMap["cd_".concat(this.talkCategoryRegionCode)])===null||_this$getCommentRegio3===void 0?void 0:_this$getCommentRegio3.hourlyCount)|| 0}else{var _this$getCommentRegio4;h3Count=((_this$getCommentRegio4=this.getCommentRegionWithStats()["cd_".concat(this.talkRegionCode)])===null||_this$getCommentRegio4===void 0?void 0:_this$getCommentRegio4.hourlyCount)|| 0}if($commentTalkBtn.find("._cnFloatingTalkUp").length===0){var _e$oJson,_e$oJson$result;var commentList=((e===null||e===void 0?void 0:(_e$oJson=e.oJson)===null||_e$oJson===void 0?void 0:(_e$oJson$result= _e$oJson.result)===null||_e$oJson$result===void 0?void 0:_e$oJson$result.commentList)||[]).find(function(item){var regTime=(item===null||item===void 0?void 0:item.regTime)||"";var regTimeMoment=moment(regTime, "YYYY-MM-DDTHH:mm:ssZ");var now=moment().utc().add(540,"minutes").startOf("day");var nowYmdt=now.format("YYYYMMDDHHmmss");var regTimeYmdt=regTimeMoment.format("YYYYMMDDHHmmss");return nowYmdt<=regTimeYmdt}); if(h3Count>0)$commentTalkBtn.find(".common_talk_button").append(upHtml)}var talkMapUpOn=false;for(var _i3=0,_Object$entries2=Object.entries(this.getCommentRegionWithStats());_i3<_Object$entries2.length;_i3++){var _Object$entries2$_i= _slicedToArray(_Object$entries2[_i3],2),key=_Object$entries2$_i[0],value=_Object$entries2$_i[1];if(key==="cd_00")continue;if(value===null||value===void 0?void 0:value.eventGrade){talkMapUpOn=true;break}for(var _i4= 0,_Object$entries3=Object.entries((value===null||value===void 0?void 0:value.subInfoMap)||{});_i4<_Object$entries3.length;_i4++){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i4],2),key2=_Object$entries3$_i[0], value2=_Object$entries3$_i[1];if(value2===null||value2===void 0?void 0:value2.eventGrade){talkMapUpOn=true;break}}}if(talkMapUpOn)oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(), "addTalkMapUp");else oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(),"removeTalkMapUp");var commentImageHtml=this.talkBtnImage?'\n \x3cdiv class\x3d"common_comment_photo"\x3e\n \x3cimg src\x3d"'.concat(this.talkBtnImage, '" class\x3d"common_photo_image" alt\x3d"\uc81c\ubcf4\ud1a1 \ubc30\ub108 \uc774\ubbf8\uc9c0"\x3e\n \x3c/div\x3e\n '):"";var commentHtml='\n \x3cdiv class\x3d"common_talk_comment"\x3e\n '.concat(commentImageHtml, '\n \x3cp class\x3d"common_comment_text type_recent"\x3e').concat(this.talkBtnText,'\x3c/p\x3e\n \x3cspan class\x3d"common_comment_text type_time"\x3e\x3c/span\x3e\n \x3c/div\x3e\n '); var activeCookieCheck=!this.getCookie("NV_TLK_FLOATING_BTN_EXTEND_CLOSED");if($commentTalkBtn.find(".common_talk_comment").length===0&&this.talkBtnText&&activeCookieCheck)$commentTalkBtn.addClass("is-active").find(".common_talk_inner").append(commentHtml)}}, {key:"closeFloatingComment",value:function closeFloatingComment(e){var $commentTalkBtn=$(".fixed_btn_wrap .common_talk");$commentTalkBtn.removeClass("is-active");var now=new Date;var tomorrowMidnight=new Date(now); tomorrowMidnight.setDate(now.getDate()+1);tomorrowMidnight.setHours(0,0,0,0);this.setCooKieByDateTime("NV_TLK_FLOATING_BTN_EXTEND_CLOSED","CLOSED",tomorrowMidnight)}}, {key:"setFixedTalkBtnCountBadge",value:function setFixedTalkBtnCountBadge(e){var badgeElement=$("._cnTalkBtn .talk_number");var count=e.oJson.result.count.total}}, {key:"movePersistCommentNo",value:function movePersistCommentNo(e){if(this.persistCommentNo!==null){cbox.Interface.move("cbox_module",this.persistCommentNo);this.persistCommentNo=null}}}, {key:"sendClickCode",value:function sendClickCode(e){var cc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;var clickActionCode=null;var clickCode=(e===null||e===void 0?void 0:e.clickCode)|| cc;switch(clickCode){case "RPO.refresh":clickActionCode="refresh";break;case "RPO.autooff":case "RPO.autoon":clickActionCode="autoup";break;case "RPC.write":clickActionCode="attach";break}if(clickActionCode)oCommon.fnSendClick(e, "".concat(blockPageNameEn,".").concat(this.clickCode).concat(clickActionCode),true)}}, {key:"initTalkPersist",value:function initTalkPersist(){var _this7=this;var oData=this.talkPersist.get("");if(oData&&oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")if(oData.isAutoUpdate===true)this.element.find(".u_cbox_btn_refresh").click(); else{if(oData.commentNo&&cbox){this.element.find(".u_cbox_btn_refresh").click();this.moveTopComment();this.persistCommentNo=oData.commentNo}setTimeout(function(){return _this7.disableAutoUpdate()},500)}this.talkPersist.remove("")}}, {key:"initCustomCommentInputBox",value:function initCustomCommentInputBox(isForce){$(".section_right").removeClass("common_loading");var isDisabledClass=pageIsOn?"":"is-disabled";if(!this.isCommentWrite()|| isForce===true){var elContent='\n \x3cdiv class\x3d"before_write _cnCommentInputBox '.concat(isDisabledClass,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'jointlk\', true)"\x3e\n \x3cdiv class\x3d"before_write_inner"\x3e\n \x3cspan class\x3d"before_write_text"\x3e\n \uc9c0\uae08 \ub0a0\uc528\uac00 \uc5b4\ub5a4\uac00\uc694?\n \x3c/span\x3e\n \x3cdiv class\x3d"btn_sticker"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"btn_image"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"btn_video"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"btn_camera"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"btn_upload"\x3e\n \x3cspan class\x3d"blind"\x3e\ub4f1\ub85d\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e'); $(elContent).insertAfter(".u_cbox_head")}}}, {key:"getCurrentCommentRegionShortName",value:function getCurrentCommentRegionShortName(){var _this$currentCommentC;var name="".concat(this.currentCommentObjectRegionConfigInfo.shortName);if(((_this$currentCommentC= this.currentCommentCategoryRegionConfigInfo)===null||_this$currentCommentC===void 0?void 0:_this$currentCommentC.shortName)&&"".concat(this.currentCommentObjectRegionConfigInfo.regionCode)!=="17")name= " ".concat(this.currentCommentCategoryRegionConfigInfo.shortName);return name}}, {key:"initRegionSelectBox",value:function initRegionSelectBox(){this.forceOpenReferenceComment();if(this.isCommentWrite()){var name=this.getCurrentCommentRegionShortName();var changeRegionBtnHtml='\x3ca href\x3d"#" class\x3d"area_change _cnSearchChangeRegion" data-nlog\x3d"change" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'locedit\')" data-nlog-area\x3d"region_talk.change_link"\x3e\uc81c\ubcf4 \uc9c0\uc5ed \ubcc0\uacbd\x3c/a\x3e');var locationBtnHtml='\n \x3cbutton type\x3d"button" class\x3d"btn_location_info _cnTalkCurrentLocation" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'myloc\', false, true)" data-type\x3d"write" data-nlog-area\x3d"region_talk.location_button" data-nlog-params\x3d\'{"category":"write"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ud604\uc704\uce58\ub85c\x3c/span\x3e\n \x3c/button\x3e\n '); var html='\n \x3cdiv class\x3d"area_select_wrap _cnCommentWriteRegionBox" style\x3d""\x3e\n '.concat(locationBtnHtml,'\n \x3cspan class\x3d"area_text"\x3e').concat(name, "\x3c/span\x3e\n ").concat(changeRegionBtnHtml,"\n \x3c/div\x3e\n ");if(this.element.find("._cnCommentWriteRegionBox").length===0)this.element.find(".u_cbox_guide").attr("data-region-name", name);else this.element.find("._cnCommentWriteRegionBox").removeClass("hide")}}}, {key:"initTalkRegionBtn",value:function initTalkRegionBtn(){var locationSelectArea=this.element.find(".location_select_area");var template="_idTalkCategoryRegionBtnTemplate";var oTemplate=Handlebars.getTemplateSync(template); var pageLsurType=this.isLeisureTalkEnabled()?oCodeUtil.getLsurType(sRegionCode):null;var lsurKor=pageLsurType?oCodeUtil.getLsurTypeKor(pageLsurType):null;var nationwideLabel=lsurKor?"\uc804\uad6d ".concat(lsurKor): "\uc804\uad6d";var elContent=oTemplate({"blockPageNameEn":blockPageNameEn,"clickCode":this.clickCode,"type":"regionTalk","hide":"","nationwideLabel":nationwideLabel,"isLeisure":!!lsurKor,"leisureKor":lsurKor|| "","_nlogArea1":"region_talk"});$("._cnCustomTalkArea").remove();this.element.find("._cnStructureTalkRegionButton").replaceWith(elContent);if(this.talkTab==="keep"){this.followLastRegionCode=this.followLastRegionCode|| this.pageRegionCode;var keepShowType=this.initFollowTab(this.followLastRegionCode,false);this.element.find("._cnCustomTalkArea").removeClass("city").removeClass("district").addClass(keepShowType);this.element.find("._cnCityTab").removeClass("on"); this.element.find("._cnKeepTab").addClass("on");this.initTalkScroll(this.element.find("._cnTalkRegionKeepBtn .scroll_area"));this.scrollToRegionBtn(this.element.find("._cnTalkRegionKeepBtnScroll").data("name")); locationSelectArea.removeClass("city").removeClass("district").addClass("keep")}else{var cityShowType=this.initCityTab();this.element.find("._cnCustomTalkArea").removeClass("keep").addClass(cityShowType); this.element.find("._cnCityTab").addClass("on");this.element.find("._cnKeepTab").removeClass("on");this.initTalkScroll(this.element.find("._cnTalkRegionBtn .scroll_area"));this.initTalkScroll(this.element.find("._cnTalkCityRegionBtn .scroll_area")); if(this.element.find("._cnCustomTalkArea").hasClass("district"))this.scrollToRegionBtn(this.element.find("._cnTalkRegionBtnScroll").data("name"));this.scrollToRegionBtn(this.element.find("._cnTalkCityRegionBtnScroll").data("name")); locationSelectArea.removeClass("keep").addClass(this.lastShowTypeList.join(" "))}this.initAttachmentArea();if(this.initCommentNo){cbox.Interface.move("cbox_module",this.initCommentNo);this.initCommentNo= ""}}}, {key:"setInitCommentNo",value:function setInitCommentNo(initCommentNo){this.initCommentNo=initCommentNo}}, {key:"setInitRegionCode",value:function setInitRegionCode(talkRegionCode,talkCategoryRegionCode){var talkTab=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"city";this.talkTab=talkTab;this.talkRegionCode= talkRegionCode;this.talkCategoryRegionCode=talkCategoryRegionCode;this.setLastRegionCode(talkRegionCode,talkCategoryRegionCode)}}, {key:"setInitHighlightCommentNo",value:function setInitHighlightCommentNo(commentNo){this.initHighlightCommentNo=commentNo}}, {key:"initCityTab",value:function initCityTab(){var _this8=this;var _this=this;var objectConfigInfoToTemplateDataFunc=function objectConfigInfoToTemplateDataFunc(info,idx){var isOn="".concat(info.regionCode)=== "".concat(_this.cityLastObjectRegionCode)?" on":"";var clickCode="".concat(blockPageNameEn,".").concat(_this.clickCode,"sidobtn");var isNew=false;if(info.regionCode!=="00"&&(info===null||info===void 0? void 0:info.eventGrade))isNew=true;isNew=isNew?" new":"";return'\n \x3cli id\x3d"_idCityRegionBtnLi-'.concat(info.regionCode,'"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(info.regionCode, '" class\x3d"area_link').concat(isOn).concat(isNew,' _cnObjectRegionBtn" data-region-code\x3d"').concat(info.regionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(clickCode,'\')" data-nlog-area\x3d"region_talk.city_scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(info.regionCode, "\"}'\x3e\n ").concat(info.shortName,'\n \x3cspan class\x3d"blind new_text"\x3e\uc0c8 \ub313\uae00 \uc788\uc74c\x3c/span\x3e\n \x3c/a\x3e\n \x3c/li\x3e\n ')}; var showType="city";this.commentRegionConfigInfoList=Object.values(this.getCommentRegionWithStats());var objectDataList=this.commentRegionConfigInfoList.map(objectConfigInfoToTemplateDataFunc);var categoryDataList= [];var spread=this.isSpreadObject?"spread":"";var objectConfigInfo=this.getCommentRegionWithStats()["cd_".concat(this.cityLastObjectRegionCode)];var categoryConfigInfoToTemplateDataFunc=function categoryConfigInfoToTemplateDataFunc(info, idx){var isOn="".concat(_this.cityLastCategoryRegionCode)==="".concat(info.regionCode)?" on":"";var newClass=(info===null||info===void 0?void 0:info.eventGrade)?" new":"";return'\n \x3cli id\x3d"_idRegionBtnLi-'.concat(info.regionCode, '"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(info.regionCode,'" class\x3d"area_link').concat(isOn," _cnCategoryRegionBtn").concat(newClass,'" data-region-code\x3d"').concat(info.regionCode, '" data-upper-region-code\x3d"').concat(objectConfigInfo.regionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this8.clickCode,'sigunbtn\')" data-nlog-area\x3d"region_talk.region_scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(info.regionCode, "\"}'\x3e\n ").concat(info.shortName,"\n \x3c/a\x3e\n \x3c/li\x3e\n ")}; if(objectConfigInfo&&objectConfigInfo.regionCode!=="00"){var categoryList=Object.values(objectConfigInfo.subInfoMap);categoryList.unshift({"shortName":"\uc804\uccb4","regionCode":objectConfigInfo.regionCode}); categoryDataList=categoryList.map(categoryConfigInfoToTemplateDataFunc);if(categoryDataList.length>0)showType="".concat(showType," district")}this.element.find("._cnObjectBtnArea").addClass(spread);this.element.find("._cnObjectRegionList").html(objectDataList.join("")); this.element.find("._cnObjectSpreadBtn").addClass(spread);this.element.find("._cnCategoryRegionList").html(categoryDataList.join(""));return showType}}, {key:"initKeepTab",value:function initKeepTab(initObjectRegionCode,initCategoryRegionCode){var _this9=this;var keepList=this.getKeepList();var showType="search keep";var resultHtml="";if(this.currentLocationCategoryRegionCode&& this.currentLocationCategoryRegionCode.length===5){keepList=keepList.filter(function(v){return"".concat(v)!=="".concat(_this9.currentLocationCategoryRegionCode)}); keepList.unshift(this.currentLocationCategoryRegionCode)}else{resultHtml='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"area_link _cnTalkCurrentLocation my" data-region-code\x3d"" data-upper-region-code\x3d"" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'myloc\')" data-nlog\x3d"current_location" data-nlog-area\x3d"region_talk.current_location_link"\x3e\n \ub0b4\uc704\uce58\n \x3c/a\x3e\n \x3c/li\x3e\n '); if(!keepList.find(function(e){return"".concat(e)==="".concat(initCategoryRegionCode)})){var latelyRegionCode=keepList[0]; if(latelyRegionCode&&latelyRegionCode!==initCategoryRegionCode){var _this$splitRegionCode2=this.splitRegionCodeToObjectAndCategory(latelyRegionCode),objectRegionCode=_this$splitRegionCode2.objectRegionCode, categoryRegionCode=_this$splitRegionCode2.categoryRegionCode;this.setLastRegionCode(objectRegionCode,categoryRegionCode);this.initComment(objectRegionCode,categoryRegionCode);return}}}if(initObjectRegionCode=== "00"&&initObjectRegionCode===initCategoryRegionCode){initObjectRegionCode=this.keepLastObjectRegionCode;initCategoryRegionCode=this.keepLastCategoryRegionCode}if(initCategoryRegionCode!=="00"&&!keepList.find(function(v){return"".concat(v)=== "".concat(initCategoryRegionCode)}))keepList.push(initCategoryRegionCode); for(var i in keepList){var regionCode=keepList[i];var _this$splitRegionCode3=this.splitRegionCodeToObjectAndCategory(regionCode),_objectRegionCode=_this$splitRegionCode3.objectRegionCode,_categoryRegionCode= _this$splitRegionCode3.categoryRegionCode;var objectRegionInfo=this.getRegionInfo(_objectRegionCode);var categoryRegionInfo=this.getRegionInfo(_categoryRegionCode);var isOn="".concat(_objectRegionCode)=== "".concat(initObjectRegionCode)&&"".concat(_categoryRegionCode)==="".concat(initCategoryRegionCode)?" on":"";var isCurrentLocation="".concat(_categoryRegionCode)==="".concat(this.currentLocationCategoryRegionCode)? " recent":"";var recentHtml="";if(isCurrentLocation===" recent")recentHtml='\n \x3cbutton type\x3d"button" class\x3d"btn_location_now _cnTalkCurrentLocation" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'myloc\', false, true)"" data-type\x3d"select" data-nlog-area\x3d"region_talk.location_button" data-nlog-params\x3d\'{"category":"select"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ud604 \uc704\uce58 \ucc3e\uae30\x3c/span\x3e\n \x3c/button\x3e\n '); if(objectRegionInfo&&categoryRegionInfo){var name="".concat(objectRegionInfo.shortName);if("".concat(objectRegionInfo.regionCode)!=="17")name+=" ".concat(categoryRegionInfo.shortName);resultHtml+='\n \x3cli id\x3d"_idRegionBtnLi-'.concat(_categoryRegionCode, '"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(_categoryRegionCode,'" class\x3d"area_link _cnKeepRegionBtn').concat(isOn).concat(isCurrentLocation,'" data-region-code\x3d"').concat(_categoryRegionCode, '" data-upper-region-code\x3d"').concat(_objectRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'flwbtn\')" data-nlog-area\x3d"region_talk.keep_scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(_categoryRegionCode, "\"}'\x3e\n ").concat(name,"\n \x3c/a\x3e\n ").concat(recentHtml,"\n \x3c/li\x3e")}}this.element.find("._cnKeepList").html(resultHtml); return showType}}, {key:"initFollowTab",value:function initFollowTab(initFollowRegion){var _this$templateData4;var showDistrict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var showType="search keep";var resultHtml= "";if(!initFollowRegion||initFollowRegion.length<5&&initFollowRegion!=="00")return;if(showDistrict)this.element.find(".district_region").removeClass("hide");else this.element.find(".district_region").addClass("hide"); var followList=_toConsumableArray(this.getRegionFollowingList());var followStatsMap=((_this$templateData4=this.templateData)===null||_this$templateData4===void 0?void 0:_this$templateData4.followStatsMap)|| {};var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=followList[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion= true){var _stats$h3Count,_this$getFollowLsurRe;var regionFollow=_step.value;var followRegionCode=regionFollow.id;var stats=followStatsMap[followRegionCode]||{};var newClass=((_stats$h3Count=stats.h3Count)!== null&&_stats$h3Count!==void 0?_stats$h3Count:0)>0?"new":"";var shortName=regionFollow.sareaNm||stats.shortName||"";var initFollowRegionCodeWithLsur=((_this$getFollowLsurRe=this.getFollowLsurRegionInfoByNaverRgnCd(initFollowRegion))=== null||_this$getFollowLsurRe===void 0?void 0:_this$getFollowLsurRe.lsurRgnCd)||initFollowRegion;var on="".concat(initFollowRegionCodeWithLsur)==="".concat(followRegionCode)?"on":"";var _this$splitRegionCode4= this.splitRegionCodeToObjectAndCategory(followRegionCode),objectRegionCode=_this$splitRegionCode4.objectRegionCode,categoryRegionCode=_this$splitRegionCode4.categoryRegionCode;resultHtml+='\n \x3cli id\x3d"_idRegionBtnLi-'.concat(followRegionCode, '"\x3e\n \x3ca href\x3d"#" id\x3d"_idTalkRegionBtn-').concat(categoryRegionCode,'" class\x3d"area_link _cnFollowRegionBtn ').concat(on," ").concat(newClass,'" data-region-code\x3d"').concat(categoryRegionCode, '" data-upper-region-code\x3d"').concat(objectRegionCode,'" data-full-region-code\x3d"').concat(followRegionCode,'" data-follow-region-code\x3d"').concat(followRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'flwbtn\')" data-nlog-area\x3d"region_talk.keep_scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(categoryRegionCode,"\"}'\x3e\n ").concat(shortName, "\n \x3c/a\x3e\n \x3c/li\x3e")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError; }}resultHtml+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"area_link type_favorite _cnGoRegionFollowConfig" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn,".").concat(this.clickCode, 'flwbtn\')" data-nlog-area\x3d"region_talk.config_link"\x3e\n \uc9c0\uc5ed \uc124\uc815\n \x3c/a\x3e\n \x3c/li\x3e\n ');this.element.find("._cnKeepList").html(resultHtml); if(this.getSumAllHourlyCount()>0)this.element.find(".district_region .area_link").addClass("new");if(initFollowRegion==="00")this.element.find(".district_region .area_link").addClass("on");var followBtnRegionTypeClass= initFollowRegion==="00"?"type_region":"";this.element.find(".district_area.keep_area").addClass(followBtnRegionTypeClass);return showType}}, {key:"getSumAllHourlyCount",value:function getSumAllHourlyCount(){return Object.values(this.getCommentRegionWithStats()).reduce(function(acc,cur){var _cur$hourlyCount;return acc+((_cur$hourlyCount=cur=== null||cur===void 0?void 0:cur.hourlyCount)!==null&&_cur$hourlyCount!==void 0?_cur$hourlyCount:0)},0)}}, {key:"initCommentInputBoxSetUp",value:function initCommentInputBoxSetUp(){var dimmed='\x3cdiv class\x3d"talk_unable_wrap"\x3e\x26nbsp;\x3c/div\x3e';var prependClassName=".u_cbox_write_wrap";if(this.commentOption.aFormation.indexOf("write")>= 0&&$(prependClassName)[0]){this.element.find(".u_cbox_write_wrap .u_cbox_profile_area").hide();if(this.isNotAllowLocationAndEntire())$(prependClassName).prepend(dimmed)}}}, {key:"isTalkMapEnabled",value:function isTalkMapEnabled(){return oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(),"executeTalkMapServiceCheckTalkMapEnabled")}}, {key:"updateTalkHeaderByRegion",value:function updateTalkHeaderByRegion(){if(this.isWindowScroll()||!oBlockScriptService.checkExistsTemplate("talkHeader"))return;var regionCode;if(this.talkTab==="keep"){var _this$getFollowLsurRe2; var lsurRgnCd=(_this$getFollowLsurRe2=this.getFollowLsurRegionInfoByNaverRgnCd(this.followLastRegionCode))===null||_this$getFollowLsurRe2===void 0?void 0:_this$getFollowLsurRe2.lsurRgnCd;regionCode=lsurRgnCd|| this.followLastRegionCode}else regionCode=this.cityLastCategoryRegionCode;this.changeFollowRegionInfo(regionCode)}}, {key:"clickObjectRegionBtn",value:function clickObjectRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="city";var changeRegionCode=element.data("region-code");this.setLastRegionCode(changeRegionCode, changeRegionCode);this.setScrollPositionInfo([this.element.find("._cnTalkCityRegionBtnScroll").data("name")]);this.initScrollPositionInfo([this.element.find("._cnTalkRegionBtnScroll").data("name")]);if(this.beforeActiveRegionBtnFloating){this.goScrollTalkVertical(0); this.beforeActiveRegionBtnFloating=false}this.initComment(changeRegionCode,changeRegionCode);if(this.isTalkMapEnabled())if(changeRegionCode==="00")oBlockScriptService.callTemplateFuncWithIndex("visualMap", this.getEnabledVisualMapIndex(),"executeTalkMapServiceFocusNation");else oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(),"executeTalkMapServiceFindSelectedRegionMarker", "".concat(changeRegionCode))}}, {key:"clickCategoryRegionBtn",value:function clickCategoryRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="city";var changeRegionCode=element.data("region-code");var upperChangeRegionCode= element.data("upper-region-code");this.setLastRegionCode(upperChangeRegionCode,changeRegionCode);this.setScrollPositionInfo(this.getTalkRegionScrollName());if(this.beforeActiveRegionBtnFloating){this.goScrollTalkVertical(0); this.beforeActiveRegionBtnFloating=false}this.initComment(upperChangeRegionCode,changeRegionCode);if(this.isTalkMapEnabled())oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(), "executeTalkMapServiceFindSelectedRegionMarker","".concat(changeRegionCode))}}, {key:"clickKeepRegionBtn",value:function clickKeepRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);this.talkTab="keep";var changeRegionCode=element.data("region-code");var upperChangeRegionCode= element.data("upper-region-code");this.setLastRegionCode(upperChangeRegionCode,changeRegionCode);this.setScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(upperChangeRegionCode,changeRegionCode)}}, {key:"clickFollowRegionBtn",value:function clickFollowRegionBtn(e){e.preventDefault();var element=$(e.currentTarget);var fullRegionCode="".concat(element.data("full-region-code"));this.changeTalkRegionByFollowRegion(fullRegionCode, true)}}, {key:"clickRegionSelect",value:function clickRegionSelect(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"sysloc"));var element=$(e.currentTarget);var changeRegionCode=element.val(); this.isSwitchRegionByElement=true;this.talkTab="city";this.setLastRegionCode(changeRegionCode,changeRegionCode);this.initComment(changeRegionCode,changeRegionCode)}}, {key:"changeTalkRegionByFollowRegion",value:function changeTalkRegionByFollowRegion(fullRegionCode,setScrollPosition){var _this$splitRegionCode5=this.splitRegionCodeToObjectAndCategory(fullRegionCode), objectRegionCode=_this$splitRegionCode5.objectRegionCode,categoryRegionCode=_this$splitRegionCode5.categoryRegionCode;this.talkTab="keep";this.followLastRegionCode=fullRegionCode;if(setScrollPosition)this.setScrollPositionInfo(this.getTalkRegionScrollName()); this.initComment(objectRegionCode,categoryRegionCode)}}, {key:"changeFollowRegionInfo",value:function changeFollowRegionInfo(regionCode){regionCode="".concat(regionCode);var choiceQueryString={"slimWarn":{"naverRgnCd":regionCode}};if(regionCode==="00")choiceQueryString["nationFcast"]= {"aplYmd":moment().format("YYYYMMDD"),"hdayType":"now"};else choiceQueryString["talkHeader"]={"naverRgnCd":regionCode};var commonQueryString={};if(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(regionCode))commonQueryString["lsurRegion"]= {"lsurRgnCd":regionCode};var leisureName=null;if(oCodeUtil.isLsur(regionCode)){var _this$templateData5,_this$templateData5$f,_this$templateData5$f2,_this$currentCommentC2,_oBlockScriptService$;leisureName= ((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:(_this$templateData5$f=_this$templateData5.followStatsMap)===null||_this$templateData5$f===void 0?void 0:(_this$templateData5$f2= _this$templateData5$f[regionCode])===null||_this$templateData5$f2===void 0?void 0:_this$templateData5$f2.fullName)||((_this$currentCommentC2=this.currentCommentCategoryRegionConfigInfo)===null||_this$currentCommentC2=== void 0?void 0:_this$currentCommentC2.fullName)||((_oBlockScriptService$=oBlockScriptService.getBlockDataByKey("lsurRegion"))===null||_oBlockScriptService$===void 0?void 0:_oBlockScriptService$.lsurNm)|| null}this._currentTalkHeaderRegionCode=regionCode;this._currentTalkHeaderLeisureName=leisureName;oBlockScriptService.ajaxChoiceApiWithCommon(choiceQueryString,commonQueryString,function(result){if(regionCode=== "00"){var slimWarnResult=(result===null||result===void 0?void 0:result.slimWarn)||{};var nationFcastResult=(result===null||result===void 0?void 0:result.nationFcast)||{};oBlockScriptService.callTemplateFunc("slimWarn", "render",slimWarnResult);oBlockScriptService.callTemplateFunc("talkHeader","render",nationFcastResult,"nationFcast")}else{var _slimWarnResult=(result===null||result===void 0?void 0:result.slimWarn)||{}; var talkHeaderResult=(result===null||result===void 0?void 0:result.talkHeader)||{};oBlockScriptService.callTemplateFunc("slimWarn","render",_slimWarnResult);oBlockScriptService.callTemplateFunc("talkHeader", "render",talkHeaderResult,"nowFcast","".concat(regionCode).length>2?2:1)}})}}, {key:"getCurrentLocation",value:function getCurrentLocation(initTalkTab){var _this=this;var previewPath=isBlockPreview?"/preview":"";var path="".concat(previewPath).concat(pageJson.url);$(".section_right_inner ._cnCurrentLocationLoading").removeClass("hide"); oCommonGeoLocation.fnInit({welButton:$(event.toElement),returnType:"".concat(path,"/talk/objRegionCode/categoryRegionCode?talkTab\x3d").concat(initTalkTab),originPath:"".concat(path,"/talk"),callback:function callback(sNaverRgnCd){var aCoords= sNaverRgnCd.split(",");var sURL="/api/naverRgnCatForCoords";$.ajax({method:"GET",url:sURL,data:{lat:aCoords[0],lng:aCoords[1]}}).done(function(resp){var objectRgn=resp.regionCode.substring(0,2);var categoryRgn= resp.regionCode.substring(0,5);_this.currentLocationObjectRegionCode=objectRgn;_this.currentLocationCategoryRegionCode=categoryRgn;_this.isPrivacyLocation=true;_this.isSwitchRegionByElement=true;if(initTalkTab=== "init")_this.initComment(_this.talkRegionCode,_this.talkCategoryRegionCode);else{_this.talkTab=initTalkTab;_this.setLastRegionCode(objectRgn,categoryRgn);_this.initComment(objectRgn,categoryRgn)}$(".section_right_inner ._cnCurrentLocationLoading").addClass("hide")}).fail(function(jqXHR){$(".section_right_inner ._cnCurrentLocationLoading").addClass("hide"); oCommon.fnSendErrorToNelo("[regionTalk.js] \uc9c0\uc5ed\ucf54\ub4dc \uc870\ud68c API \ud638\ucd9c\uc2e4\ud328",jqXHR)})}})}}, {key:"openClosePrivacyLocationPopup",value:function openClosePrivacyLocationPopup(isOpen){if(isOpen){$("._cnPrivacyLocationPopup").removeClass("hide");$(".popup_dimmed").removeClass("hide")}else{$("._cnPrivacyLocationPopup").addClass("hide"); $(".popup_dimmed").addClass("hide")}}}, {key:"persistSetting",value:function persistSetting(isTalkOn,isAutoUpdate,commentNo){var elParentList=$("#content .section_right");var commentList=null;elParentList.addClass("NO_TAP_HIGHLIGHT");this.talkPersist.set("", {"talkRegionCode":this.talkRegionCode,"talkCategoryRegionCode":this.talkCategoryRegionCode,"isPrivacyLocation":this.isPrivacyLocation,"isSwitchRegionByElement":true,"isTalkOn":isTalkOn,"isAutoUpdate":isAutoUpdate!== false,"commentNo":commentNo})}}, {key:"clickPrivacyLocationAllow",value:function clickPrivacyLocationAllow(e){var element=$(e.currentTarget);var isAllow=!element.hasClass("cancel");this.openClosePrivacyLocationPopup(false);if(isAllow){this.persistSetting(true); this.getCurrentLocation()}else{this.isPrivacyLocation=false;this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}}}, {key:"clickCommentBoxLink",value:function clickCommentBoxLink(e){var _oBlockScriptService$2;oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"source"));var element=$(e.currentTarget); var newUrl=element.attr("href");var previewPath="";var originUrl=new URL(newUrl);var port=phase==="local"?":9030":"";var previewPathName="/preview";if(phase==="staging"||phase==="beta"||phase==="local")previewPath= window.location.pathname.includes(previewPathName)?previewPathName:"";var currentPath=((_oBlockScriptService$2=oBlockScriptService.getGnbInfoByPageId(basePageId))===null||_oBlockScriptService$2===void 0? void 0:_oBlockScriptService$2.url)||"/today";var level1Cd=originUrl.searchParams.get("level1Cd")||"";var level2Cd=originUrl.searchParams.get("level2Cd")||"";var level3Cd=originUrl.searchParams.get("level3Cd")|| "";var pathname="".concat(currentPath,"/").concat(level3Cd,"/talk/").concat(level1Cd,"/").concat(level2Cd);newUrl="".concat(baseURL).concat(port).concat(pathname);element.attr("href",newUrl)}}, {key:"initTalkScroll",value:function initTalkScroll($targetElement){var _this0=this;oCommon.initScroll($targetElement,null,null,function(name){if(!_this0.talkRegionBtnScrollPositionInfo[name])_this0.initScrollPositionInfo([name])})}}, {key:"resetTalkScroll",value:function resetTalkScroll($targetElement){var scrollName=$targetElement.data("name");var talkScroll=oCommon.oScroll[scrollName];if(_.isEmpty(talkScroll))this.initTalkScroll($targetElement); else oCommon.refreshScroll(scrollName)}}, {key:"resetAllTalkScroll",value:function resetAllTalkScroll(){this.resetTalkScroll(this.element.find("._cnAttachmentScrollArea .scroll_area"));this.resetTalkScroll(this.element.find("._cnTalkRegionBtn .scroll_area")); this.resetTalkScroll(this.element.find("._cnTalkCityRegionBtn .scroll_area"));this.resetTalkScroll(this.element.find("._cnTalkRegionKeepBtn .scroll_area"));this.resetTalkScroll(this.element.find('.scroll_area[data-name\x3d"talkPublicInfo"]')); if(this.lastChartTab==="trend_tab"){var _this$drawTalkStatsHo,_this$drawTalkStatsHo2;(_this$drawTalkStatsHo=this.drawTalkStatsHourlyGraph(this.lastRegionTalkStatsByKeyAndHours))===null||_this$drawTalkStatsHo=== void 0?void 0:(_this$drawTalkStatsHo2=_this$drawTalkStatsHo.render)===null||_this$drawTalkStatsHo2===void 0?void 0:_this$drawTalkStatsHo2.call(_this$drawTalkStatsHo)}else if(this.lastChartTab==="regions_tab"){var _this$drawTalkStatsEv, _this$drawTalkStatsEv2;(_this$drawTalkStatsEv=this.drawTalkStatsEventGraph(this.lastRegionTalkSurgeStatsByKey))===null||_this$drawTalkStatsEv===void 0?void 0:(_this$drawTalkStatsEv2=_this$drawTalkStatsEv.render)=== null||_this$drawTalkStatsEv2===void 0?void 0:_this$drawTalkStatsEv2.call(_this$drawTalkStatsEv)}}}, {key:"getTalkRegionScrollName",value:function getTalkRegionScrollName(){if(this.talkTab==="keep")return[$("._cnTalkRegionKeepBtnScroll").data("name")];else return[$("._cnTalkRegionBtnScroll").data("name"), $("._cnTalkCityRegionBtnScroll").data("name")]}}, {key:"scrollToRegionBtn",value:function scrollToRegionBtn(scrollName){var talkRegionBtnScroll=oCommon.oScroll[scrollName];if(talkRegionBtnScroll===undefined||talkRegionBtnScroll===null)return;talkRegionBtnScroll.refresh(); if(talkRegionBtnScroll.options.snap===true&&talkRegionBtnScroll.pages.length<1)return;var $targetElement=this.element.find(".scroll_area[data-name\x3d".concat(scrollName,"]")).find(".on");if($targetElement.length=== 0)return;var targetId="#"+$targetElement.parent("li").attr("id");if(this.currentCommentCategoryRegionConfigInfo&&(scrollName==="talkRegionBtn"||scrollName==="talkRegionKeepBtn"))this.regionBtnScrollById(talkRegionBtnScroll, scrollName,targetId);else if(this.currentCommentObjectRegionConfigInfo&&scrollName==="talkCityRegionBtn")this.regionBtnScrollById(talkRegionBtnScroll,scrollName,targetId);else if(talkRegionBtnScroll.options.snap=== true)talkRegionBtnScroll.goToPage(0,0,0);else talkRegionBtnScroll.scrollTo(0,0);this.isSwitchRegionByElement=false;oCommon.controlScrollButton(talkRegionBtnScroll,oCommon.scrollElements[scrollName])}}, {key:"regionBtnScrollById",value:function regionBtnScrollById(talkRegionBtnScroll,scrollName,id){var positionX,pageX;talkRegionBtnScroll.scrollToElement(id,0,-20);if(talkRegionBtnScroll.options.snap=== true){var page=-1;var btnElement=this.element.find(id);var btnElementPositionX=btnElement.position().left+btnElement.width()/2;for(var pageNum in talkRegionBtnScroll.pages){var pageIndex=Number(pageNum); var pageInfo=talkRegionBtnScroll.pages[pageIndex][0];if(btnElementPositionX<=Math.abs(pageInfo.x)){page=pageIndex-1;break}}if(page===-1)page=talkRegionBtnScroll.pages.length-1;pageX=page}else positionX= talkRegionBtnScroll.x;if(talkRegionBtnScroll.options.snap===true)if(this.talkRegionBtnScrollPositionInfo[scrollName].x!==null)talkRegionBtnScroll.scrollTo(this.talkRegionBtnScrollPositionInfo[scrollName].x, 0);else talkRegionBtnScroll.goToPage(pageX,0,0);else if(this.talkRegionBtnScrollPositionInfo[scrollName].x!==null)talkRegionBtnScroll.scrollTo(this.talkRegionBtnScrollPositionInfo[scrollName].x,0);else talkRegionBtnScroll.scrollTo(positionX, 0)}}, {key:"clickTalkBackBtn",value:function clickTalkBackBtn(e){e&&e.preventDefault();this.closeTalk();if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")setTimeout(function(){oBlockScriptService.callTemplateFunc("hourlyFcast", "resetScrollAndChart");oBlockScriptService.callTemplateFunc("regionFollowList","resetScroll");oBlockScriptService.callTemplateFunc("nowSynthesisFcast","resetScroll");oBlockScriptService.callTemplateFunc("lifeIndex", "resetScroll");oBlockScriptService.callTemplateFunc("compareHourlyFcast","resetScroll");oBlockScriptService.callTemplateFunc("compareWeeklyFcast","resetScroll");oBlockScriptService.callTemplateFunc("airSynthesisFcast", "render");oBlockScriptService.callTemplateFunc("airHourlyFcast","resetScroll");oBlockScriptService.callTemplateFunc("airWeeklyFcast","resetScroll");oBlockScriptService.callTemplateFunc("airNation","resetScroll")}, 500)}}, {key:"closeTalk",value:function closeTalk(){if(this._nlogTalkPushed&&window.oNlog2){this._nlogTalkPushed=false;setTimeout(function(){return oNlog2.popPage("regionTalk")},0)}$(".section_center").removeClass("talk"); $("#wrap").removeClass("wrap_talk");$(".fixed_btn_wrap ._cnTalkBtn").removeClass("hide");$("._cnTalkMapFoldBtn").attr("aria-selected","false");$("#container").removeClass("is_talk--show");$(".section_single").removeClass("talk"); var gotoTalkWriteBtn=$("._cnGoToTalkWrite");gotoTalkWriteBtn.removeClass("fadein");gotoTalkWriteBtn.hide();if(!this.isLoadSectionCenter)this.isLoadSectionCenter=true}}, {key:"clickCommentImage",value:function clickCommentImage(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"content"));this.disableAutoUpdate()}}, {key:"spreadObjectBtn",value:function spreadObjectBtn(e){var currentBtn=$(e.currentTarget);var objectBtnArea=this.element.find("._cnObjectBtnArea");if(currentBtn.hasClass("spread")){this.isSpreadObject= false;currentBtn.removeClass("spread");objectBtnArea.removeClass("spread")}else{this.isSpreadObject=true;currentBtn.addClass("spread");objectBtnArea.addClass("spread")}}}, {key:"clickTalkTab",value:function clickTalkTab(e){e.preventDefault();var currentElement=$(e.currentTarget);var locationSelectArea=this.element.find(".location_select_area");var isCityTab=currentElement.hasClass("_cnCityTab"); this.talkTab=isCityTab?"city":"keep";var clickCodeSuffix=isCityTab?"tap1":"tap2";oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(clickCodeSuffix));if(isCityTab){if(!this.cityLastObjectRegionCode|| !this.cityLastCategoryRegionCode){this.cityLastObjectRegionCode="00";this.cityLastCategoryRegionCode="00"}this.initComment(this.cityLastObjectRegionCode,this.cityLastCategoryRegionCode)}else{this.lastShowTypeList= ["city","district"].filter(function(type){return locationSelectArea.hasClass(type)}); if(!this.followLastRegionCode)this.followLastRegionCode=this.getPageRegionCode();var _this$splitRegionCode6=this.splitRegionCodeToObjectAndCategory(this.followLastRegionCode),objectRegionCode=_this$splitRegionCode6.objectRegionCode, categoryRegionCode=_this$splitRegionCode6.categoryRegionCode;this.initComment(objectRegionCode,categoryRegionCode)}}}, {key:"getCommentKey",value:function getCommentKey(){if(this.commentKeyType&&this.commentKey)return"".concat(this.commentKeyType,"_").concat(this.commentKey);else return"".concat(this.templateInfo.customInfo.talkKeyType, "_").concat(this.templateInfo.customInfo.talkKey)}}, {key:"clickKeepSearch",value:function clickKeepSearch(e){e.preventDefault();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"search"));this.openKeepSearch();this.pushHistory({state:{path:"talk/region-search"}})}}, {key:"openKeepSearch",value:function openKeepSearch(){if(this.element.find("._cnKeepSearchArea").hasClass("active"))return;this.element.find("._cnKeepSearchArea").addClass("active");this.element.find("._cnKeepKeywordAutoComplete").addClass("hide"); this.element.find("._cnSearchHot").addClass("hide");this.element.find("._cnSearchResult").addClass("hide");this.element.find("._cnSearchRecent").removeClass("hide");var recentSearchList=this.getRecentSearchList(); var latelyListElement=this.element.find("._cnLatelyList");var searchRecentElement=this.element.find("._cnSearchRecent");var html="";for(var i in recentSearchList){var regionCode=recentSearchList[i];var _this$splitRegionCode7= this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode7.objectRegionCode,categoryRegionCode=_this$splitRegionCode7.categoryRegionCode;var objectRegionInfo=this.getRegionInfo(objectRegionCode); var categoryRegionInfo=this.getRegionInfo(categoryRegionCode);var name="".concat(objectRegionInfo.shortName);if("".concat(objectRegionInfo.regionCode)!=="17")name+=" ".concat(categoryRegionInfo.shortName); html+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"lately_link _cnLatelyResult" data-region-code\x3d"'.concat(categoryRegionCode,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'history\')"" data-nlog-area\x3d"region_talk.recent_link" data-nlog-params\x3d\'{"region_id":"').concat(categoryRegionCode,"\"}'\x3e").concat(name,"\x3c/a\x3e\n \x3c/li\x3e\n ")}if(recentSearchList.length=== 0)searchRecentElement.addClass("none");else{searchRecentElement.removeClass("none");latelyListElement.html(html)}var searchHotElement=this.element.find("._cnSearchHot");var hotListElement=this.element.find("._cnHotList"); var topList=this.getTopCategoryRegion(5);var searchHotHtml="";for(var _i5 in topList){var _regionCode=topList[_i5];var _this$splitRegionCode8=this.splitRegionCodeToObjectAndCategory(_regionCode),_objectRegionCode2= _this$splitRegionCode8.objectRegionCode,_categoryRegionCode2=_this$splitRegionCode8.categoryRegionCode;var _objectRegionInfo=this.getRegionInfo(_objectRegionCode2);var _categoryRegionInfo=this.getRegionInfo(_categoryRegionCode2); var _name="".concat(_objectRegionInfo.shortName);if("".concat(_objectRegionInfo.regionCode)!=="17")_name+=" ".concat(_categoryRegionInfo.shortName);searchHotHtml+='\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"a_lot_link _cnHotResult" data-region-code\x3d"'.concat(_categoryRegionCode2, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'hotcity\')"" data-nlog-area\x3d"region_talk.hot_link" data-nlog-params\x3d\'{"region_id":"').concat(_categoryRegionCode2, "\"}'\x3e").concat(_name,"\x3c/a\x3e\n \x3c/li\x3e\n ")}if(topList.length===0)searchHotElement.addClass("hide");else{searchHotElement.removeClass("hide");hotListElement.html(searchHotHtml)}var searchInput= this.element.find("._cnSearchInput");searchInput.val("");searchInput.focus();this.element.find("._cnKeepSearch").removeClass("typing")}}, {key:"clickKeepSearchCancel",value:function clickKeepSearchCancel(e){if(deviceType==="mobile")history.back();else this.closeKeepSearch()}}, {key:"closeKeepSearch",value:function closeKeepSearch(){this.element.find("._cnSearchInput").val("");this.element.find("._cnSearchInput").blur();this.element.find("._cnSearchHot").addClass("hide");this.element.find("._cnKeepKeywordAutoComplete").addClass("hide"); this.element.find("._cnSearchRecent").removeClass("hide");this.element.find("._cnKeepSearchArea").removeClass("active");if(this.talkTab!=="keep")this.element.find(".location_select_area").removeClass("search")}}, {key:"clickSearchChangeRegion",value:function clickSearchChangeRegion(e){e.preventDefault();this.element.find(".location_select_area").addClass("search");this.clickKeepSearch(e)}}, {key:"inputKeepSearch",value:function inputKeepSearch(e){var inputValue=e.currentTarget.value;if(inputValue.length<=0){this.element.find(".form_wrap").removeClass("typing");this.element.find(".form_wrap_pc").removeClass("typing")}else{this.element.find(".form_wrap").addClass("typing"); this.element.find(".form_wrap_pc").addClass("typing")}this.updateContent(inputValue)}}, {key:"updateContent",value:function updateContent(query){var _this=this;var regexQuery=query.replace(new RegExp("(".concat(searchExclude,").*")),"");var acHost=phase==="local"||phase==="alpha"||phase=== "beta"?"https://alpha-ac.weather.naver.com":"https://ac.weather.naver.com";var sURL=acHost+"/ac?q_enc\x3dutf-8\x26r_format\x3djson\x26r_enc\x3dutf-8\x26r_lt\x3d1\x26st\x3d1\x26q\x3d"+encodeURIComponent(regexQuery); var keepKeywordAutoComplete=this.element.find("._cnKeepKeywordAutoComplete");var searchRecent=this.element.find("._cnSearchRecent");var searchHot=this.element.find("._cnSearchHot");var searchResult=this.element.find("._cnSearchResult"); $.ajax(sURL).done(function(oResp){try{var oItems=oResp.items;if(oItems.length>0&&oItems[0].length>0){var welAutoCompleted=keepKeywordAutoComplete.find(".keyword_list");var html="";var txt="";for(var i= 0;i=0;j--){var temp=txtArray[j].replace(new RegExp("("+regexQuery+")","i"),'\x3cspan class\x3d"mark"\x3e$1\x3c/span\x3e'); if(temp!==txtArray[j]){txtArray[j]=temp;bReplace=true;break}}txt=txtArray.join(" ");if(!bReplace)txt=txt.replace(new RegExp("("+regexQuery+")","i"),'\x3cspan class\x3d"mark"\x3e$1\x3c/span\x3e');var regionCode= oItems[0][i][1][0];if(!regionCode.startsWith("WD"))html+='\x3cli class\x3d"list_item"\x3e\n \x3ca href\x3d"#" data-region-code\x3d"'.concat(oItems[0][i][1],'" role\x3d"button" class\x3d"link _cnAutoCompleteResult" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(_this.clickCode,'searchout\')" data-nlog-area\x3d"region_talk.autocomplete_link" data-nlog-params\x3d\'{"region_id":"').concat(oItems[0][i][1],'"}\'\x3e\n \x3ci class\x3d"ico_autocomplete"\x3e\x3c/i\x3e\n \x3cdiv class\x3d"text_area"\x3e\n \x3cspan class\x3d"main"\x3e').concat(txt, "\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3c/li\x3e")}if(html!==""){welAutoCompleted.html(html); searchRecent.addClass("hide");searchResult.addClass("hide");keepKeywordAutoComplete.removeClass("hide");$("._cnSearchResult:visible .list_item").hover(function(){$(".list_item").removeClass("over");$(this).addClass("over")}, function(){$(this).removeClass("over")})}}else if(regexQuery.length==0){searchResult.addClass("hide"); keepKeywordAutoComplete.addClass("hide");searchRecent.removeClass("hide")}}catch(e){oCommon.fnSendErrorToNelo("[regionTalk.js] \uc790\ub3d9\uc644\uc131 \ubaa9\ub85d parsing \uc624\ub958",e.description)}}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[regionTalk.js] \uc790\ub3d9\uc644\uc131 API \ud638\ucd9c\uc2e4\ud328", jqXHR)})}}, {key:"clickSearchResult",value:function clickSearchResult(e){e.preventDefault();var current=$(e.currentTarget);var regionCode="".concat(current.data("regionCode"));if(regionCode.length>=5){var _this$splitRegionCode9= this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode9.objectRegionCode,categoryRegionCode=_this$splitRegionCode9.categoryRegionCode;var keepKeywordAutoComplete=this.element.find("._cnKeepKeywordAutoComplete"); var searchRecent=this.element.find("._cnSearchRecent");var searchHot=this.element.find("._cnSearchHot");var searchResult=this.element.find("._cnSearchResult");keepKeywordAutoComplete.addClass("hide");searchRecent.addClass("hide"); searchResult.addClass("hide");this.element.find(".layer_search_area").removeClass("active");this.element.find(".form_wrap_pc").removeClass("active");this.setLastRegionCode(objectRegionCode,categoryRegionCode); this.addKeepList(categoryRegionCode);this.addRecentSearchList(categoryRegionCode);if(this.talkTab!=="keep")this.isSpreadObject=true;this.initScrollPositionInfo(this.getTalkRegionScrollName());this.initComment(objectRegionCode, categoryRegionCode)}}}, {key:"splitRegionCodeToObjectAndCategory",value:function splitRegionCodeToObjectAndCategory(regionCode){regionCode=encodeURIComponent(regionCode);var objectRegionCode=null;var categoryRegionCode=null;if(regionCode.startsWith("WD"))return{objectRegionCode:objectRegionCode, categoryRegionCode:categoryRegionCode};if(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(regionCode)){var parentMap=this.regionCodeToParentMap&&Object.keys(this.regionCodeToParentMap).length?this.regionCodeToParentMap: this.buildRegionCodeToParentMap(this.getCommentRegionWithStats());var parent=parentMap[regionCode]||null;if(!parent){var _this$getFollowLsurRe3;var naverRgnCd=(_this$getFollowLsurRe3=this.getFollowLsurRegionInfoByRegionCode(regionCode))=== null||_this$getFollowLsurRe3===void 0?void 0:_this$getFollowLsurRe3.naverRgnCd;parent=naverRgnCd?naverRgnCd.substring(0,2):null}objectRegionCode=parent;categoryRegionCode=regionCode;return{objectRegionCode:objectRegionCode, categoryRegionCode:categoryRegionCode}}if(regionCode.length>=2)objectRegionCode=regionCode.substring(0,2);if(regionCode.length>=5)categoryRegionCode=regionCode.substring(0,5);return{objectRegionCode:objectRegionCode, categoryRegionCode:categoryRegionCode}}}, {key:"getRegionInfo",value:function getRegionInfo(regionCode){var _this$splitRegionCode0=this.splitRegionCodeToObjectAndCategory(regionCode),objectRegionCode=_this$splitRegionCode0.objectRegionCode,categoryRegionCode= _this$splitRegionCode0.categoryRegionCode;var regionInfo=null;if(objectRegionCode){regionInfo=this.getCommentRegionWithStats()["cd_".concat(objectRegionCode)];if(regionInfo&&categoryRegionCode)regionInfo= regionInfo.subInfoMap["cd_".concat(categoryRegionCode)]}return regionInfo}}, {key:"addRecentSearchList",value:function addRecentSearchList(regionCode){var recentResultList=this.getRecentSearchList();if(recentResultList.find(function(e){return"".concat(e)==="".concat(regionCode)}))return; if(recentResultList.length>=10)recentResultList.pop();recentResultList.unshift(regionCode);this.setCookie("NV_TLK_KEEP_RGN",recentResultList.join(","),365)}}, {key:"getRecentSearchList",value:function getRecentSearchList(){var recentSearchCookie=this.getCookie("NV_TLK_KEEP_RGN");var recentResultList=[];if(recentSearchCookie)recentResultList=recentSearchCookie.split(","); return recentResultList}}, {key:"addKeepList",value:function addKeepList(regionCode){var keepList=this.getKeepList();if(keepList.find(function(e){return"".concat(e)==="".concat(regionCode)}))return; if(keepList.length>=10)keepList.pop();keepList.unshift(regionCode);this.setCookie("NV_TLK_KEEP_RGN",keepList.join(","),365)}}, {key:"getKeepList",value:function getKeepList(){var keepCookie=this.getCookie("NV_TLK_KEEP_RGN");var keepList=[];if(keepCookie)keepList=keepCookie.split(",");return keepList}}, {key:"getRegionFollowingList",value:function getRegionFollowingList(){var validFollowGroup=["sarea","leisure"];if(this.regionFollowingList.length===0){var _talkRegionFollow;this.regionFollowingList=(((_talkRegionFollow= talkRegionFollow)===null||_talkRegionFollow===void 0?void 0:_talkRegionFollow.channels)||[]).filter(function(item){return validFollowGroup.includes((item===null||item===void 0?void 0:item.group)||"")})}return this.regionFollowingList}}, {key:"setLastRegionCode",value:function setLastRegionCode(objectRegionCode,categoryRegionCode){if(this.talkTab==="keep"){this.keepLastObjectRegionCode=encodeURIComponent(objectRegionCode);this.keepLastCategoryRegionCode= encodeURIComponent(categoryRegionCode)}else{this.cityLastObjectRegionCode=encodeURIComponent(objectRegionCode);this.cityLastCategoryRegionCode=encodeURIComponent(categoryRegionCode)}}}, {key:"getTopCategoryRegion",value:function getTopCategoryRegion(topN){if(!this.getCommentRegionWithStats())return[];var mergeList=Object.values(this.getCommentRegionWithStats()).reduce(function(acc,cur, idx){return acc.concat(Object.values(cur.subInfoMap).filter(function(v){return v.hourlyCount>0}))},[]); mergeList.sort(function(v1,v2){return v2.hourlyCount-v1.hourlyCount}); return mergeList.slice(0,topN).map(function(v){return v.regionCode})}}, {key:"clickSearchOutside",value:function clickSearchOutside(e){var current=$(e.target);if(this.element.find(".form_wrap_pc._cnKeepSearchArea").hasClass("active"))if(!current.hasClass("_cnSearchChangeRegion")&& !current.parents().hasClass("_cnKeepSearch")&&!current.parents().hasClass("layer_search_area")&&!current.parents().hasClass("layer_search_area_pc")&&!current.hasClass("_cnKeepSearch")){this.element.find("._cnKeepSearchArea").removeClass("active"); if(this.talkTab!=="keep")this.element.find(".location_select_area").removeClass("search")}}}, {key:"openReferenceComment",value:function openReferenceComment(e){if(!pageIsOn)return;var isCommentWrite=this.isCommentWrite();if(this.talkCategoryRegionCode.length<5&&!isCommentWrite){this.isReferenceWrite= true;this.forceOpenReferenceInfo=e;this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}else this.disableAutoUpdate();if(isCommentWrite)this.element.find("._cnCommentWriteRegionBox").addClass("hide")}}, {key:"clickCurrentLocation",value:function clickCurrentLocation(e){e.preventDefault();if(!pageIsOn)return;if(this.isLeisureTalkEnabled()&&oCodeUtil.isLsur(this.pageRegionCode)){var _this$splitRegionCode1= this.splitRegionCodeToObjectAndCategory(this.pageRegionCode),objectRegionCode=_this$splitRegionCode1.objectRegionCode,categoryRegionCode=_this$splitRegionCode1.categoryRegionCode;if(objectRegionCode&&categoryRegionCode){this.isSwitchRegionByElement= true;this.setLastRegionCode(objectRegionCode,categoryRegionCode);this.initComment(objectRegionCode,categoryRegionCode);return}}this.getCurrentLocation(this.talkTab)}}, {key:"isCommentWrite",value:function isCommentWrite(){return this.commentOption.aFormation.find(function(v){return v==="write"})}}, {key:"afterCommentWrite",value:function afterCommentWrite(e){if(this.talkCategoryRegionCode.length<5)this.doneReferenceComment();else if(this.element.find("._cnCommentWriteRegionBox").hasClass("hide"))this.element.find("._cnCommentWriteRegionBox").removeClass("hide")}}, {key:"cancelWriteReferenceComment",value:function cancelWriteReferenceComment(){if(this.talkCategoryRegionCode.length<5)this.doneReferenceComment();else this.initRegionSelectBox()}}, {key:"doneReferenceComment",value:function doneReferenceComment(){this.isReferenceWrite=false;this.element.find(".u_cbox_write_wrap").addClass("hide");this.initCustomCommentInputBox(true);this.initComment(this.talkRegionCode, this.talkCategoryRegionCode)}}, {key:"setCustomCommentNone",value:function setCustomCommentNone(){var html='\n \x3cdiv class\x3d"u_cbox_comment_none" style\x3d"display: ;"\x3e\n \x3ch6 class\x3d"u_vc"\x3e\ub313\uae00 \uc548\ub0b4\x3c/h6\x3e\n \x3cdiv class\x3d"u_cbox_con_inform"\x3e\n \x3cspan class\x3d"u_cbox_ico_comment_none"\x3e\x3c/span\x3e\n \x3cspan class\x3d"u_cbox_contents_none"\x3e\n \ub4f1\ub85d\ub41c \uad00\uc2ec \uc9c0\uc5ed\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.\x3cbr /\x3e\n \uc9c0\uc5ed\uc124\uc815 \ubc84\ud2bc\uc744 \ub20c\ub7ec \uad00\uc2ec \uc9c0\uc5ed\uc744 \ub4f1\ub85d\ud558\uc138\uc694.\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; if(this.isForceKeepCommentNone()){this.element.find(".u_cbox_content_wrap").html(html);this.element.find(".u_cbox_write_wrap").addClass("hide");this.element.find("._cnStructureTalkAttachment").addClass("hide"); this.element.find(".u_cbox_paginate").addClass("hide");this.element.find(".u_cbox_first_comment").addClass("hide")}}}, {key:"isForceKeepCommentNone",value:function isForceKeepCommentNone(){return this.talkTab==="keep"&&this.getRegionFollowingList().length===0}}, {key:"moveTopComment",value:function moveTopComment(){var $customTalkArea=this.element.find("._cnCustomTalkArea");if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")if(this.isWindowScroll())this.element.find(".u_cbox_content_wrap").scrollTop(0); else this.goScrollTalkVertical($customTalkArea.position().top);if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc")this.goScrollTalkVertical($customTalkArea.position().top)}}, {key:"beforeCreateComment",value:function beforeCreateComment(e){if(this.isReferenceWrite===true&&("".concat(this.talkRegionCode)==="00"||"".concat(this.talkRegionCode)==="".concat(this.talkCategoryRegionCode))){e.stop(); this.talkTab="city";this.setLastRegionCode("00","00");this.initComment("00","00")}}}, {key:"clickMoveToOriginComment",value:function clickMoveToOriginComment(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"origin"));this.disableAutoUpdate()}}, {key:"pushHistory",value:function pushHistory(param){if(deviceType==="mobile"){var _param$state;if(((_param$state=param.state)===null||_param$state===void 0?void 0:_param$state.path)!==undefined&¶m.state.path=== this.router.getCurrentPath())return;this.router.push(param)}}}, {key:"clickToggleTalkInfo",value:function clickToggleTalkInfo(e){e.preventDefault();var currentTarget=this.element.find("._cnTalkInfoOpen");var isOpen=oCommon.fnGetOpenOrNot(currentTarget);oCommon.fnCloseAllInfoLayer(); if(isOpen===false)oCommon.fnOpenInfoLayer(currentTarget)}}, {key:"clickGoToTalkWrite",value:function clickGoToTalkWrite(e){e&&e.preventDefault();this.goAndFocusTalkWrite()}}, {key:"goAndFocusTalkWrite",value:function goAndFocusTalkWrite(){this.goToTalkWrite=false;if(this.isWindowScroll())this.goScrollTalkVertical(oCommon.fnGetScrollOffsetTop(this.element));else{var $scrollElement= this.getTalkVerticalScrollElement();this.goScrollTalkVertical($scrollElement.scrollTop()+this.element.offset().top-60)}if(this.element.find("#cbox_module__write_textarea").length>0)setTimeout(function(){$("#cbox_module__write_textarea").focus()}, 50)}}, {key:"controlScrollRegionBtnFloating",value:function controlScrollRegionBtnFloating(scrollTop){var floatingStartTargetElement=this.element.find(".location_select_area._cnCustomTalkArea");var floatingEndTargetElement= null;if(this.isWindowScroll()&&oCommon.fnGetResponsiveSizeType().deviceType==="Pc"&&menu!=="map")return;if(this.talkTab==="keep")floatingEndTargetElement=this.element.find(".district_area.keep_area");else if(this.talkTab=== "city")floatingEndTargetElement=this.element.find(".district_area.city_area");if(!floatingStartTargetElement||floatingStartTargetElement.length<=0||!floatingEndTargetElement||floatingEndTargetElement.length<= 0)return;var activeTargetClass=this.element.find(".district_area");var floatingStartPosition=floatingStartTargetElement.offset().top+floatingStartTargetElement.outerHeight(true);var floatingEndPosition= floatingEndTargetElement.offset().top+floatingEndTargetElement.outerHeight(true);var endFloating=!this.isInScrollAreaByElementPosition(floatingStartPosition,this.getTalkVerticalScrollElement());var startFloating= this.isInScrollAreaByElementPosition(floatingEndPosition,this.getTalkVerticalScrollElement());if(scrollTop>this.lastScrollTop)if(!endFloating&&startFloating)activeTargetClass.addClass("floating_out");else activeTargetClass.removeClass("floating_out").removeClass("floating_in"); else if(!endFloating||startFloating)activeTargetClass.removeClass("floating_out").addClass("floating_in");else activeTargetClass.removeClass("floating_out").removeClass("floating_in");this.beforeActiveRegionBtnFloating= activeTargetClass.hasClass("floating_in");this.lastScrollTop=scrollTop}}, {key:"isInScrollAreaByElementPosition",value:function isInScrollAreaByElementPosition(elementPosition,$scroll){var scrollTop=this.isWindowScroll()?$scroll.scrollTop():$scroll.offset().top;return elementPosition< scrollTop}}, {key:"controlScrollGoToWriteFloating",value:function controlScrollGoToWriteFloating(scrollTop){var _this1=this;var targetClass=$("._cnGoToTalkWrite");if(this.isWindowScroll()&&oCommon.fnGetResponsiveSizeType().deviceType=== "Pc"||!$("#wrap").hasClass("wrap_talk")){targetClass.hide();return}var scrollTargetElement=null;var listType=this.commentOption.sListType;if(listType==="category")scrollTargetElement=this.element.find(".u_cbox_write_box"); else scrollTargetElement=this.element.find("._cnCommentInputBox");if(scrollTargetElement.length<=0)return;var floatingPosition=scrollTargetElement.offset().top+scrollTargetElement.outerHeight(true)*.5; if(this.isInScrollAreaByElementPosition(floatingPosition,this.getTalkVerticalScrollElement())){if(!targetClass.hasClass("fadein")){this.activeGotoTalkBtn=true;targetClass.show();targetClass.addClass("fadein")}}else if(targetClass.hasClass("fadein")){this.activeGotoTalkBtn= false;targetClass.removeClass("fadein");setTimeout(function(){if(!_this1.activeGotoTalkBtn)targetClass.hide()},300)}}}, {key:"controlWindowScroll",value:function controlWindowScroll(e){var scrollTop=this.getTalkVerticalScrollElement().scrollTop();this.controlScrollRegionBtnFloating(scrollTop);this.talkLayerHeightControl(); this.lastScrollTop=scrollTop}}, {key:"afterOpenReferenceComment",value:function afterOpenReferenceComment(e){if(oCommon.fnGetResponsiveSizeType().deviceType!=="Pc"){var _this=this;setTimeout(function(){var _oBlockScriptService$3;var $comment= _this.element.find(".cbox_module__comment_".concat(e.commentNo));var top=_this.getTalkVerticalScrollElement().scrollTop()+$comment.offset().top;top-=(_oBlockScriptService$3=oBlockScriptService.callTemplateFunc("talkHeader", "getTalkHeaderHeight")[0])!==null&&_oBlockScriptService$3!==void 0?_oBlockScriptService$3:0;top-=_this.element.find(".district_area.keep_area").hasClass("floating_in")?_this.element.find(".district_area.keep_area").outerHeight(true): 0;_this.getTalkVerticalScrollElement().scrollTop(top)},300)}}}, {key:"addReferenceCommentAlarmConfigLink",value:function addReferenceCommentAlarmConfigLink(){var url="".concat(window.location.origin).concat(isBlockPreview?"/preview":"","/notiConfig");var html='\n \x3cdiv class\x3d"talk_notice_alarm"\x3e\n \x3ca href\x3d"'.concat(url, '" class\x3d"talk_alarm_link" data-nlog-area\x3d"region_talk.alarm_link"\x3e\n \ub2f5\uae00 \uc54c\ub9bc\x3cspan class\x3d"talk_link_emphasis"\x3e*\ub124\uc774\ubc84\uc571\ud478\uc2dc\x3c/span\x3e\n \x3c/a\x3e\n \x3c/div\x3e\n '); this.element.find("._cnStructureNoticeAlarm").replaceWith(html)}}, {key:"forceOpenReferenceComment",value:function forceOpenReferenceComment(){if(this.isReferenceWrite===true){this.isReferenceWrite=false;if(cbox){this.isDisableAutoUpdate=true;cbox.Interface.openReference("cbox_module", this.forceOpenReferenceInfo.commentNo)}}}}, {key:"isWindowScroll",value:function isWindowScroll(){var scrollParent=this.element.scrollParent()[0];return scrollParent===document||scrollParent===document.body}}, {key:"getTalkVerticalScrollElement",value:function getTalkVerticalScrollElement(){return this.element.scrollParent()}}, {key:"goScrollTalkVertical",value:function goScrollTalkVertical(scrollPosition){var $scrollElement=this.getTalkVerticalScrollElement();$scrollElement.scrollTop(scrollPosition)}}, {key:"checkAndForceDisableWrite",value:function checkAndForceDisableWrite(){var $referenceArea=this.element.find(".u_cbox_write_quotecomment");var enabledReferenceWrite=$referenceArea.length>0;if(enabledReferenceWrite){this.isReferenceWrite= false;$referenceArea.remove();this.initComment(this.talkRegionCode,this.talkCategoryRegionCode)}}}, {key:"talkLayerHeightControl",value:function talkLayerHeightControl(){if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc"&&!this.isWindowScroll()){var _oBlockScriptService$4;var talkHeaderHeight=(_oBlockScriptService$4= oBlockScriptService.callTemplateFunc("talkHeader","getTalkHeaderPositionTopAndOuterHeight")[0])!==null&&_oBlockScriptService$4!==void 0?_oBlockScriptService$4:0;var $target=this.element.find(".district_area.keep_area"); var floatingIn=$target.hasClass("floating_in");if(floatingIn){$target.find(".district_region").css("top",talkHeaderHeight);$target.find(".scroll_control").css("top",talkHeaderHeight)}else{$target.find(".district_region").css("top", "initial");$target.find(".scroll_control").css("top","initial")}}else{this.element.find(".district_region").removeAttr("style");this.element.find(".scroll_control").removeAttr("style")}}}, {key:"observeCommentInputHeightBox",value:function observeCommentInputHeightBox(){var _this10=this;var $target=this.element.find(".u_cbox_write_wrap").length>0?this.element.find(".u_cbox_write_wrap"):this.element.find(".before_write"); if(!$target.length){this.element.find("#cbox_module").css("padding-bottom",0);return}if(this.cboxWriteWrapHeightObserver)this.cboxWriteWrapHeightObserver.disconnect();this.updateCommentInputPadding();this.cboxWriteWrapHeightObserver= new MutationObserver(_.debounce(function(){_this10.updateCommentInputPadding()},100,{maxWait:500})); this.cboxWriteWrapHeightObserver.observe($target[0],{attributes:true,childList:true,subtree:true})}}, {key:"updateCommentInputPadding",value:function updateCommentInputPadding(){var _$cboxModule$css;var $target=this.isCommentWrite()?this.element.find(".u_cbox_write_wrap"):this.element.find(".before_write"); if(!$target.length){this.element.find("#cbox_module").css("padding-bottom",0);return}var newHeight=$target.outerHeight()+this.inputPaddingOffset;var $cboxModule=this.element.find("#cbox_module");var lastHeight= (_$cboxModule$css=$cboxModule.css("padding-bottom"))!==null&&_$cboxModule$css!==void 0?_$cboxModule$css:0;if(lastHeight!==newHeight)$cboxModule.css("padding-bottom",newHeight)}}, {key:"windowScrollCommentInputFloating",value:function windowScrollCommentInputFloating(){if(!this.isWindowScroll())return;var triggerTopInitial=-1;var triggerElement=$(".location_select_area");var headerH= $("#header").outerHeight()||0;var layerH=$(".layer_ie").outerHeight()||0;if(triggerElement.length>0)triggerTopInitial=oCommon.fnGetScrollOffsetTop(triggerElement)-(headerH+layerH);if(triggerTopInitial>= 0){var target=$(".section_right.talk");var targetHeight=target.outerHeight();var scrollBottom=($("#footer").length>0?$("#footer").offset().top-(parseFloat(target.css("margin-bottom"))||0):$(document).height())- ($(window).scrollTop()+$(window).height());if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")if(scrollBottom<=0){target.addClass("is-active");target.css({"height":targetHeight,"position":"absolute", "top":"auto","margin-top":"initial"})}else{target.removeClass("is-active");target.removeAttr("style")}else{target.removeClass("is-active");target.removeAttr("style")}}}}, {key:"onKeyboard",value:function onKeyboard(e){var $input=this.element.find(".u_cbox_write_wrap");var $cboxModule=this.element.find("#cbox_module");var currentHeight=window.visualViewport?window.visualViewport.height: window.innerHeight;var screenHeight=window.screen.height;var keyboardHeight=screenHeight-currentHeight;this.inputPaddingOffset=keyboardHeight;var inputTop=currentHeight-$input.outerHeight();if(keyboardHeight> 150){$input.css({top:"".concat(inputTop,"px")});$("html").addClass("is-keyboard");$cboxModule.css("padding-bottom",0)}}}, {key:"offKeyboard",value:function offKeyboard(e){var $input=this.element.find(".u_cbox_write_wrap");var $cboxModule=this.element.find("#cbox_module");$("html").removeClass("is-keyboard");$input.removeAttr("style"); $cboxModule.css("padding-bottom",$input.outerHeight())}}, {key:"detectKeyboard",value:function detectKeyboard(e){var _this=this;var $input=this.element.find(".u_cbox_write_wrap");var $cboxModule=this.element.find("#cbox_module");var currentHeight=window.visualViewport? window.visualViewport.height:window.innerHeight;var keyboardHeight=_this.originHeight-currentHeight;var inputTop=currentHeight-$input.outerHeight();if(osName==="ios")_this.inputPaddingOffset=keyboardHeight; if(keyboardHeight>150&&$input.find(".u_cbox_text").is(":focus")){$("html").addClass("is-keyboard");if(osName==="android")this.applyAndroidLayout();else if(!_this.isKeyboardVisible){$input.css({top:"".concat(inputTop, "px")});$cboxModule.css("padding-bottom",0);document.body.style.overscrollBehavior="none";_this.touchMoveHandler=function(e){var $target=$(e.target);if($target.closest(".u_cbox_write_wrap").length>0){if($target.attr("id")=== "cbox_module__write_notice"||$target.hasClass("u_cbox_write_notice_checkbox")||$target.hasClass("u_cbox_write_notice_checklabel"))return;if($target.is("input, textarea, select, button"))return;if($target.closest("label").length> 0)return;e.preventDefault()}}; document.addEventListener("touchmove",_this.touchMoveHandler,{passive:false})}_this.isKeyboardVisible=true}else if(keyboardHeight<=150&&_this.isKeyboardVisible){$("html").removeClass("is-keyboard");if(osName=== "ios"){$cboxModule.css("padding-bottom",$input.outerHeight());_this.originHeight=window.visualViewport.height;document.body.style.overscrollBehavior="";if(_this.touchMoveHandler){document.removeEventListener("touchmove", _this.touchMoveHandler);_this.touchMoveHandler=null}}$input.removeAttr("style");_this.isKeyboardVisible=false}}}, {key:"initTalkStatsGraph",value:function initTalkStatsGraph(){if(this.isForceKeepCommentNone())return;var regionName=this.getCurrentCommentRegionShortName();var isLsurPage=this.isLeisureTalkEnabled()&& oCodeUtil.isLsur(sRegionCode);var trendTabLabel=isLsurPage?"\uc774 \uc9c0\uc810 \uc81c\ubcf4 \ucd94\uc774":"\uc774 \uc9c0\uc5ed \uc81c\ubcf4 \ucd94\uc774";var surgeTabSuffix=isLsurPage?"\uc9c0\uc810":"\uc9c0\uc5ed"; var html='\n \x3cdiv class\x3d"talk_report hide"\x3e\n \x3cdiv class\x3d"talk_report_inner"\x3e\n \x3cdiv class\x3d"talk_report_tab" role\x3d"tablist"\x3e\n \x3cbutton class\x3d"talk_tab_item" role\x3d"tab" id\x3d"trend_tab" aria-selected\x3d"true" aria-controls\x3d"trend_panel" type\x3d"button" data-nlog\x3d"tab" data-tab-name\x3d"trend" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'chart1\')" data-nlog-area\x3d"region_talk.tab_button" data-nlog-params\x3d\'{"tab":"trend"}\'\x3e\n ').concat(trendTabLabel,'\n \x3c/button\x3e\n \x3cbutton class\x3d"talk_tab_item hide" role\x3d"tab" id\x3d"regions_tab" aria-selected\x3d"false" aria-controls\x3d"regions_panel" type\x3d"button" data-nlog\x3d"tab" data-tab-name\x3d"surge" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'chart2\')" data-nlog-area\x3d"region_talk.tab_button" data-nlog-params\x3d\'{"tab":"surge"}\'\x3e\n \x3cem class\x3d"talk_item_emphasis"\x3e\uc804\uad6d\x3c/em\x3e \uc81c\ubcf4 \uae09\uc99d ').concat(surgeTabSuffix, '\n \x3c/button\x3e\n \x3cbutton class\x3d"talk_tab_info _cnTalkStatsGraphInfoBtn _cnExcludeTalkLayer" type\x3d"button" data-nlog\x3d"help" aria-describedby\x3d"reportInfo" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'countinfo\')" data-type\x3d"chart" data-nlog-area\x3d"region_talk.help_button" data-nlog-params\x3d\'{"category":"chart"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_tab_fold _cnTalkStatsGraphFold" data-nlog\x3d"chart_fold" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'chartfold\')" data-nlog-area\x3d"region_talk.chart_fold_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ucc28\ud2b8 \uc601\uc5ed \uc5f4\uae30 / \ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_report_chart _cnTalkStataGraphArea talk_report_trend scroll_control" data-nlog\x3d"chart_scroll" role\x3d"tabpanel" id\x3d"trend_panel" aria-labelledby\x3d"trend_tab"\x3e\n \x3col class\x3d"talk_slide_data--y"\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3c/ol\x3e\n \x3cdiv class\x3d"talk_trend_slide scroll_area" data-name\x3d"talkStatsHourlyGraph" data-nclk\x3d"').concat(blockPageNameEn, ".").concat(this.clickCode,'chartscr" data-gesture-scroll\x3d"true" data-nlog-area\x3d"region_talk.chart_scroll"\x3e\n \x3cdiv class\x3d"talk_slide_inner" id\x3d"trendSlide"\x3e\n \x3cdiv class\x3d"talk_slide_item" id\x3d"chartTrend"\x3e\n\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_slide_button btn_prev" data-nlog-area\x3d"region_talk.chart_scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_slide_button btn_next" data-nlog-area\x3d"region_talk.chart_scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_report_chart _cnTalkStataGraphArea talk_report_regions scroll_control" data-nlog\x3d"chart_scroll" role\x3d"tabpanel" id\x3d"regions_panel" aria-labelledby\x3d"regions_tab"\x3e\n \x3col class\x3d"talk_slide_data--y"\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3cli class\x3d"talk_data_item"\x3e\x3c/li\x3e\n \x3c/ol\x3e\n \x3cdiv class\x3d"talk_regions_slide scroll_area" data-name\x3d"talkStatsEventGraph" data-nclk\x3d"').concat(blockPageNameEn, ".").concat(this.clickCode,'chartscr" data-gesture-scroll\x3d"true" data-nlog-area\x3d"region_talk.chart_scroll"\x3e\n \x3cdiv class\x3d"talk_slide_inner" id\x3d"regionsSlide"\x3e\n \x3cdiv class\x3d"talk_slide_item" id\x3d"chartRegions"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_slide_button btn_prev" data-nlog-area\x3d"region_talk.chart_scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_slide_button btn_next" data-nlog-area\x3d"region_talk.chart_scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"talk_report_tooltip _cnTalkStataGraphInfo" role\x3d"tooltip" id\x3d"reportInfo" style\x3d"display: none;"\x3e\n \x3cdiv class\x3d"talk_tooltip_inner"\x3e\n \x3cdl class\x3d"talk_tooltip_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\uc9c0\uc5ed\ubcc4 \uc81c\ubcf4 \ucd94\uc774 \ucc28\ud2b8\x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \ud604\uc7ac \ucc38\uc5ec \uc911\uc778 \uc9c0\uc5ed\uc758 \uc81c\ubcf4 \uc218\ub7c9 \ucd94\uc774\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucc28\ud2b8\ub294 1\uc2dc\uac04 \ub2e8\uc704\ub85c \uc81c\uacf5\ud558\uba70, \uac01 \uc218\uce58\ub294 \u2018\ub9e4 \uc815\uc2dc \uae30\uc900 1\uc2dc\uac04 \ub204\uc801 \uc81c\ubcf4 \uc218\ub7c9\u2019\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \uacfc\uac70 24\uc2dc\uac04\uc5d0 \ud574\ub2f9\ud558\ub294 \uc815\ubcf4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_tooltip_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\uc804\uad6d \uc81c\ubcf4 \uae09\uc99d \uc9c0\uc5ed \ucc28\ud2b8\x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \ud604\uc7ac \uc81c\ubcf4 \uc218\ub7c9\uc774 \uae09\uc99d\ud558\uace0 \uc788\ub294 \uc9c0\uc5ed(\uc2dc\u00b7\uad70\u00b7\uad6c) \ubaa9\ub85d\uc744 \ucc28\ud2b8 \ud615\ud0dc\ub85c \uc81c\uacf5\ud569\ub2c8\ub2e4. \ucc28\ud2b8\ub294 \ub9e4 10\ubd84\ub9c8\ub2e4 \uc5c5\ub370\uc774\ud2b8 \ub418\uba70, \uac01 \ub9c9\ub300\ub294 \u2018\ucd5c\uadfc 1\uc2dc\uac04 \ub204\uc801 \uc81c\ubcf4 \uc218\ub7c9\u2019\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \ucd5c\ub300 12\uac1c \uc9c0\uc5ed \ubaa9\ub85d\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.\n \x3c/dd\x3e\n \x3c/dl\x3e\n \n \x3cbutton type\x3d"button" class\x3d"talk_tooltip_button btn_close _cnTalkStatsGraphInfoBtn" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'countinfo\')" data-type\x3d"chart" data-nlog-area\x3d"region_talk.layer.close_button" data-nlog-params\x3d\'{"category":"chart"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n\n \x3c/div\x3e\n \x3c/div\x3e\n '); this.element.find("._cnStructureTalkGraph").replaceWith(html);this.ajaxTalkStatsCount(["regionTalkStatsByKeyAndHours","regionTalkSurgeStatsByKey","regionTalk","regionTalkPublicInfo","regionTalkStatsByKey"])}}, {key:"clickTalkStatsGraphInfoBtn",value:function clickTalkStatsGraphInfoBtn(e){e.preventDefault();var $currentTarget=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer(); if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"clickTalkStatsGraphTab",value:function clickTalkStatsGraphTab(e){e.preventDefault();var $current=$(e.currentTarget);this.element.find(".talk_tab_item").attr("aria-selected",false);$current.attr("aria-selected", true);if($current.is("#trend_tab")){this.element.find("#trend_panel").removeClass("hide");this.element.find("#regions_panel").addClass("hide");var $scrollArea=this.element.find('.talk_trend_slide[data-name\x3d"talkStatsHourlyGraph"]'); if(this.element.find("#trend_panel").find("svg").length<=0||$scrollArea.width()!==$scrollArea.find("svg").width()){var _this$drawTalkStatsHo3,_this$drawTalkStatsHo4;(_this$drawTalkStatsHo3=this.drawTalkStatsHourlyGraph(this.lastRegionTalkStatsByKeyAndHours))=== null||_this$drawTalkStatsHo3===void 0?void 0:(_this$drawTalkStatsHo4=_this$drawTalkStatsHo3.render)===null||_this$drawTalkStatsHo4===void 0?void 0:_this$drawTalkStatsHo4.call(_this$drawTalkStatsHo3)}this.lastChartTab= "trend_tab"}else{this.element.find("#regions_panel").removeClass("hide");this.element.find("#trend_panel").addClass("hide");var _$scrollArea=this.element.find('.talk_regions_slide[data-name\x3d"talkStatsEventGraph"]'); if(this.element.find("#regions_panel").find("svg").length<=0||_$scrollArea.width()!==_$scrollArea.find("svg").width()){var _this$drawTalkStatsEv3,_this$drawTalkStatsEv4;(_this$drawTalkStatsEv3=this.drawTalkStatsEventGraph(this.lastRegionTalkSurgeStatsByKey))=== null||_this$drawTalkStatsEv3===void 0?void 0:(_this$drawTalkStatsEv4=_this$drawTalkStatsEv3.render)===null||_this$drawTalkStatsEv4===void 0?void 0:_this$drawTalkStatsEv4.call(_this$drawTalkStatsEv3)}this.lastChartTab= "regions_tab"}if(this.element.find("._cnTalkStatsGraphFold").hasClass("type_fold"))this.element.find("._cnTalkStatsGraphFold").removeClass("type_fold");this.lastChartFold=false}}, {key:"foldTalkStatsGraph",value:function foldTalkStatsGraph(e){e.preventDefault();var $current=$(e.currentTarget);var $showChartTab=this.element.find("#".concat(this.lastChartTab));if($current.hasClass("type_fold")){this.element.find("#".concat($showChartTab.attr("aria-controls"))).removeClass("hide"); $current.removeClass("type_fold");$showChartTab.click()}else{this.element.find("._cnTalkStataGraphArea").addClass("hide");$current.addClass("type_fold");this.lastChartFold=true}}}, {key:"initTalkStatsCount",value:function initTalkStatsCount(){if(this.element.find(".talk_title").length>0)return;var titleHtml='\n \x3cspan class\x3d"talk_title"\x3e\n \x3cstrong class\x3d"talk_title_main"\x3e\uc81c\ubcf4\ud1a1\x3c/strong\x3e\n \x3c/span\x3e\n '; this.element.find(".u_cbox_count").after(titleHtml)}}, {key:"drawTalkStatsCount",value:function drawTalkStatsCount(talkStats){var _h24Stats$count;this.initTalkStatsCount();if(this.isForceKeepCommentNone())return;var resultText="";var eventGrade=(talkStats=== null||talkStats===void 0?void 0:talkStats.eventGrade)||"";switch(eventGrade){case "surge":resultText='\ucd5c\uc2e0 \uc81c\ubcf4\uac00 \x3cstrong class\x3d"report_emphasis"\x3e\uae09\uc99d\x3c/strong\x3e\ud588\uc2b5\ub2c8\ub2e4.'; break;case "increase":resultText="\ud3c9\uc18c\ubcf4\ub2e4 \ub9ce\uc740 \uc81c\ubcf4\uac00 \uc788\uc2b5\ub2c8\ub2e4.";break;default:var stats=JSON.parse((talkStats===null||talkStats===void 0?void 0:talkStats.stats)|| "{}");var h24Stats=(stats===null||stats===void 0?void 0:stats.PT24H)||{};var h24Count=(_h24Stats$count=h24Stats===null||h24Stats===void 0?void 0:h24Stats.count)!==null&&_h24Stats$count!==void 0?_h24Stats$count: 0;resultText='\ucd5c\uadfc \x3cstrong class\x3d"report_count_num"\x3e'.concat(oTalkStatsUtils.formatCount(h24Count),"\x3c/strong\x3e\uac74\uc758 \uc81c\ubcf4\uac00 \ub4f1\ub85d\ub418\uc5c8\uc2b5\ub2c8\ub2e4.")}var statsHtml= '\n \x3cdiv class\x3d"report_area _cnStructureTalkTalkStats"\x3e\n \x3cdiv class\x3d"report_area_box"\x3e\n '.concat(resultText,'\n \x3c!-- \ud234\ud301 --\x3e\n \x3cdiv class\x3d"talk_report_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_tooltip_button type_tooltip _cnWeatherInfoLayer _cnExcludeTalkLayer _cnTalkTooltip" data-nlog\x3d"help" aria-pressed\x3d"false" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'countinfo\')" data-type\x3d"count" data-nlog-area\x3d"region_talk.layer.help_button" data-nlog-params\x3d\'{"category":"count"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ud234\ud301\x3c/span\x3e\n \x3c/button\x3e\n \n \x3cdiv class\x3d"talk_tooltip_inner"\x3e\n \x3cdl class\x3d"talk_tooltip_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\ucd5c\uc2e0 \uc81c\ubcf4 \uae09\uc99d\x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \uc870\ud68c \uc911\uc778 \uc9c0\uc5ed\uc758 \ud3c9\uc0c1\uc2dc \uc81c\ubcf4 \uc218\ub7c9\uacfc \ube44\uad50\ud574, \ucd5c\uc2e0 \uc81c\ubcf4 \uc218\ub7c9\uc774 \uae09\uc99d\ud55c \uc2dc\uc810\uc5d0 \ud45c\ucd9c\ub418\ub294 \ubb38\uad6c\uc785\ub2c8\ub2e4.\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_tooltip_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\ud3c9\uc18c\ubcf4\ub2e4 \ub9ce\uc740 \uc81c\ubcf4\x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \uc870\ud68c \uc911\uc778 \uc9c0\uc5ed\uc758 \ucd5c\uc2e0 \uc81c\ubcf4 \uc218\ub7c9\uc774, \ud3c9\uc0c1\uc2dc\uc640 \ube44\uad50\ud574 \uc6d4\ub4f1\ud788 \ub9ce\uc740 \uc0c1\ud0dc\uac00 \uc9c0\uc18d\ub420\ub54c \ub178\ucd9c\ub418\ub294 \ubb38\uad6c\uc785\ub2c8\ub2e4.\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_tooltip_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\ucd5c\uadfc N\uac74\uc758 \uc81c\ubcf4\x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \ucd5c\uadfc 24\uc2dc\uac04 \uc774\ub0b4\uc5d0 \uc870\ud68c \uc911\uc778 \uc9c0\uc5ed\uc5d0 \ub4f1\ub85d\ub41c \uc81c\ubcf4\uc758 \ub204\uc801 \uc218\ub7c9 \uc815\ubcf4\uc785\ub2c8\ub2e4.\n \x3c/dd\x3e\n \x3c/dl\x3e\n \n \x3cbutton type\x3d"button" class\x3d"talk_tooltip_button btn_close _cnTalkTooltip" data-type\x3d"count" data-nlog-area\x3d"region_talk.layer.close_button" data-nlog-params\x3d\'{"category":"count"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c!-- //\ud234\ud301 --\x3e\n \x3c/div\x3e\n \x3c/div\x3e'); this.element.find("._cnStructureTalkTalkStats").replaceWith(statsHtml)}}, {key:"drawTalkStatsHourlyGraph",value:function drawTalkStatsHourlyGraph(talkStatsList){var _this=this;var now=moment().utcOffset(9);var maxPast=now.clone().subtract(24,"hours");var allAplYmdt=[];var valueList= [];var maxValue=0;var hasEvent=false;var _loop=function _loop(i){var aplYmdt=now.clone().subtract(i,"hours").format("YYYYMMDDHH");var talkStats=talkStatsList.find(function(v){return(v===null||v===void 0? void 0:v.aplYmdt)===aplYmdt}); allAplYmdt.push(aplYmdt);var count=0;if(talkStats&&(talkStats===null||talkStats===void 0?void 0:talkStats.stats)){var _h1Stats$count;var stats=JSON.parse((talkStats===null||talkStats===void 0?void 0:talkStats.stats)|| "{}");var h1Stats=(stats===null||stats===void 0?void 0:stats.PT1H)||{};count=(_h1Stats$count=h1Stats===null||h1Stats===void 0?void 0:h1Stats.count)!==null&&_h1Stats$count!==void 0?_h1Stats$count:0}maxValue= Math.max(maxValue,count);var info={"count":count,"eventGrade":(talkStats===null||talkStats===void 0?void 0:talkStats.eventGrade)||"","maxEventGrade":(talkStats===null||talkStats===void 0?void 0:talkStats.maxEventGrade)|| ""};hasEvent=hasEvent||!!info.maxEventGrade;valueList.push(info)}; for(var i=23;i>=0;i--)_loop(i);if(maxValue>0)return{tabFold:!hasEvent,render:function render(){oCommon.fnLoadChartLibraries().done(function(){if(_this.trendChart)_this.trendChart.destroy();_this.renderTrendChart("#chartTrend", 3,allAplYmdt,valueList,maxValue);var $scrollElement=_this.element.find('._cnTalkStataGraphArea .scroll_area[data-name\x3d"talkStatsHourlyGraph"]');oCommon.initScroll($scrollElement,null,null,function(){var scroll= oCommon.oScroll[$scrollElement.data("name")];scroll.scrollTo(scroll.maxScrollX,0,0)})}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[talk chart JS] script \ud638\ucd9c \uc2e4\ud328",jqXHR)})}}; else return null}}, {key:"syncSlideInnerWidth",value:function syncSlideInnerWidth(selector,chartWidth){var $inner=this.element.find(selector).parent();var scrollAreaWidth=$inner.parent().width();if(!scrollAreaWidth)return; if(chartWidth>scrollAreaWidth)$inner.css("width","".concat(chartWidth,"px"));else $inner.css("width","")}}, {key:"renderTrendChart",value:function renderTrendChart(selector){var barCountPerRange=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var hourRanges=arguments.length>2?arguments[2]:undefined; var values=arguments.length>3?arguments[3]:undefined;var maxValue=arguments.length>4?arguments[4]:undefined;var makeHourLabels=function makeHourLabels(ranges,per){var labels=[];for(var i=0;i0?eventGradeOnIndexList[eventGradeOnIndexList.length-1]:-1;var now=moment().utcOffset(9).format("YYYYMMDDHH");var axisXValues=hourRanges.map(function(v){if(now=== v)return"\ucd5c\uadfc1H";else return moment(v,"YYYYMMDDHH").format("HH\uc2dc")}); var tickValues=hourRanges.map(function(_,i){return i}).filter(function(i){return i%barCountPerRange===barCountPerRange-1&&i!==0}); this.element.find("#trend_panel .talk_data_item").each(function(i,el){return $(el).text(axisYValues[i])}); var totalWidth=(barWidth+leftMargin)*values.length;var chartWidth=Math.max(totalWidth,this.element.find(".talk_report_inner").width());var showTooltipFunc=function showTooltipFunc(index,value,event){_this.element.find("".concat(selector, " .custom-bb-label")).remove();container.querySelectorAll("clipPath").forEach(function(el){return el.remove()}); container.querySelectorAll("[clip-path]").forEach(function(el){return el.removeAttribute("clip-path")}); var $svg=_this.element.find("".concat(selector," svg"));var svgOffset=$svg.offset();var parentOffset=_this.element.find(selector).offset();if(index>=0){var $lastBar=_this.element.find("".concat(selector, " circle.bb-shape")).eq(index);if($lastBar.length){var rect=$lastBar[0].getBBox();var left=rect.x;var top=rect.y+(svgOffset.top-parentOffset.top);var isEnd=index>=values.length-5;var endClass=isEnd?" is-end": "";var containerWidth=_this.element.find(selector).parent().width();var circleCenterX=CHART_PADDING_LEFT+rect.x+rect.width/2+2;var position=isEnd?"right:".concat(containerWidth-circleCenterX+TOOLTIP_GAP, "px; transform:none;"):"left:".concat(left+52,"px;");var displayValue=Number(value).toLocaleString("ko-KR");if(event)_this.element.find(selector).append('\n \x3cdiv class\x3d"custom-bb-label type_emphasis" style\x3d"\n position:absolute;\n top:'.concat(top- 2,"px;\n ").concat(position,'\n z-index:10;\n "\x3e\n \x3cstrong class\x3d"talk_trend_tooltip').concat(endClass, '"\x3e\n \x3cspan class\x3d"talk_tooltip_image"\x3e\x3cspan class\x3d"blind"\x3e\uae09\uc99d\x3c/span\x3e\x3c/span\x3e\n +').concat(displayValue,"\x3c/strong\x3e\n \x3c/div\x3e\n ")); else _this.element.find(selector).append('\n \x3cdiv class\x3d"custom-bb-label" style\x3d"\n position:absolute;\n top:'.concat(top- 2,"px;\n ").concat(position,'\n z-index:10;\n "\x3e\n \x3cstrong class\x3d"talk_trend_tooltip').concat(endClass, '"\x3e\n ').concat(displayValue,"\x3c/strong\x3e\n \x3c/div\x3e\n "))}}}; this.trendChart=bb.generate({bindto:selector,size:{height:138,width:chartWidth},data:{columns:[["report"].concat(_toConsumableArray(values.map(function(map){return map.count})))], type:"area-spline",types:{report:"area-spline"}},spline:{interpolation:{type:"monotone-x"}},point:{show:true,r:3,focus:{expand:{enabled:false}}},axis:{x:{type:"category",categories:axisXValues,tick:{values:tickValues, multiline:false,rotate:0},height:36},y:{show:false,min:0,max:yAxis.max,tick:{values:axisYValues},padding:{bottom:0}}},grid:{y:{lines:gridYLines},lines:{front:false}},legend:{show:false},tooltip:{show:true, contents:function contents(d){var val=d[0].value;showTooltipFunc(d[0].index,val,eventGradeFlagList[d[0].index])}}, padding:{top:0,right:3,left:CHART_PADDING_LEFT,bottom:10},onrendered:function onrendered(){setTimeout(function(){if(tooltipIndex>=0)showTooltipFunc(tooltipIndex,values[tooltipIndex].count,true);else{container.querySelectorAll("clipPath").forEach(function(el){return el.remove()}); container.querySelectorAll("[clip-path]").forEach(function(el){return el.removeAttribute("clip-path")})}_this.element.find("".concat(selector," circle.bb-shape")).each(function(i,el){if(increaseGradeFlagList[i]){$(el).addClass("bb-increase"); if((i+1)%3===0)_this.element.find("#chartTrend .bb-axis-x .tick").eq(Math.max(0,(i+1)/3-1)).find("tspan").css("font-weight","bold")}else if(surgeGradeFlagList[i]){$(el).addClass("bb-surge");if((i+1)%3=== 0)_this.element.find("#chartTrend .bb-axis-x .tick").eq(Math.max(0,(i+1)/3)-1).find("tspan").css("font-weight","bold")}else $(el).addClass("bb-basic")})},50)}}); this.syncSlideInnerWidth(selector,chartWidth);setTimeout(function(){var p=document.querySelector("".concat(selector," .bb-axis-x path.domain"));if(p){var w=p.getBBox().width;p.setAttribute("d","M0,0H".concat(w))}var $ticks= _this.element.find("".concat(selector," .bb-axis-x .tick"));var lastTick=$ticks.last()[0];if(!p||!lastTick)return;$ticks.removeClass("is-last-tick");lastTick.classList.add("is-last-tick");var lastTickText= lastTick.querySelector("text");if(lastTickText){lastTickText.style.removeProperty("transform");var offsetX=Math.max(0,Math.round(p.getBoundingClientRect().right-lastTickText.getBoundingClientRect().right)); lastTickText.style.transform="translateX(".concat(offsetX,"px)")}},350)}}, {key:"drawTalkStatsEventGraph",value:function drawTalkStatsEventGraph(talkStatsList){var values=[];var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2= talkStatsList[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var talkStats=_step2.value;var regionInfo=(talkStats===null||talkStats=== void 0?void 0:talkStats.regionInfo)||{};var countStats=talkStats===null||talkStats===void 0?void 0:talkStats.countStats;var name="".concat((regionInfo===null||regionInfo===void 0?void 0:regionInfo.cd1Name)|| ""," ").concat((regionInfo===null||regionInfo===void 0?void 0:regionInfo.cd2Name)||"");if(((regionInfo===null||regionInfo===void 0?void 0:regionInfo.regionCode)||"").startsWith("17"))name=(regionInfo=== null||regionInfo===void 0?void 0:regionInfo.cd2Name)||"";var count=0;if(countStats&&(countStats===null||countStats===void 0?void 0:countStats.stats)){var _h1Stats$count2;var stats=JSON.parse((countStats=== null||countStats===void 0?void 0:countStats.stats)||"{}");var h1Stats=(stats===null||stats===void 0?void 0:stats.PT1H)||{};count=(_h1Stats$count2=h1Stats===null||h1Stats===void 0?void 0:h1Stats.count)!== null&&_h1Stats$count2!==void 0?_h1Stats$count2:0}if(name!=="\n"&&count!==0)values.push({name:name,value:count,regionCode:regionInfo===null||regionInfo===void 0?void 0:regionInfo.regionCode})}}catch(err){_didIteratorError2= true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}values=values.sort(function(a, b){return b.value-a.value}); var hasItem=values.length>0;var _this=this;if(values.length>0)return{tabFold:!hasItem,render:function render(){oCommon.fnLoadChartLibraries().done(function(){if(_this.regionChart)_this.regionChart.destroy(); _this.renderRegionChart("#chartRegions",values);oCommon.initScroll(_this.element.find('._cnTalkStataGraphArea .scroll_area[data-name\x3d"talkStatsEventGraph"]'))}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[talk chart JS] script \ud638\ucd9c \uc2e4\ud328", jqXHR)})}}; else return null}}, {key:"renderRegionChart",value:function renderRegionChart(selector,regionData){var categories=regionData.map(function(d){var parts=d.name.split(" ");return parts.map(function(str){return str.length>4?str.slice(0, 3)+"..":str}).join("\n")}); var values=regionData.map(function(d){return d.value}); var barWidth=12,sideMargin=20,innerMargin=26,N=regionData.length;var totalWidth=sideMargin*2+barWidth*N+innerMargin*(N-1);var chartWidth=Math.max(totalWidth,this.element.find(".talk_report_inner").width()); var ratio=barWidth/(barWidth+innerMargin);var selectedIndex=null;var yAxis=oTalkStatsUtils.calcChartAxis(regionData[0].value,3);var axisYValues=yAxis.ticks;var gridYLines=axisYValues.map(function(v){return{value:v, "class":"guide-line"}}); this.element.find("#regions_panel .talk_data_item").each(function(i,el){return $(el).text(axisYValues[i])}); var lastEventGraphValues=regionData;var _this=this;var showTooltipFunc=function showTooltipFunc(index,value,first){var xAxisList=_this.element.find("#regionsSlide .bb-axis .tick");xAxisList.find("tspan").css("font-weight", "");d3.selectAll(".bb-bar-highlight-rect").remove();_this.element.find("".concat(selector," .talk_region_tooltip")).remove();var $bar=_this.element.find("".concat(selector," .bb-bar")).eq(index);var rect= $bar[0].getBBox();var $svg=_this.element.find("".concat(selector," svg"));var svgOffset=$svg.offset();var parentOffset=_this.element.find(selector).offset();var sideMargin=20;var left=rect.x+rect.width/ 2+(svgOffset.left-parentOffset.left)+sideMargin+(first?-5:38);var top=-10;if(first){if(_this.element.find(".talk_region_top").length<=0)_this.element.find(selector).append('\x3cdiv class\x3d"talk_region_top" style\x3d"\n position:absolute;\n left:'.concat(left, "px;\n top:").concat(top,'px;\n z-index:20;\n pointer-events:none;"\x3e\n \x3cstrong class\x3d"talk_top_emphasis"\x3e').concat(value, "\x3c/strong\x3e\n \x3c/div\x3e"))}else{_this.element.find(selector).append('\x3cdiv class\x3d"talk_region_tooltip" style\x3d"\n position:absolute;\n left:'.concat(left, "px;\n top:").concat(top,'px;\n z-index:20;\n pointer-events:none;"\x3e\x3cstrong class\x3d"talk_tooltip_emphasis"\x3e').concat(value, "\x3c/strong\x3e\x3c/div\x3e"));var barNode=$bar[0];var bbox=barNode.getBBox();var group=d3.select(barNode.parentNode);var panelHeight=_this.element.find(".talk_regions_slide").height();var tooltipHeight= _this.element.find(".talk_regions_slide .talk_region_top").height();group.insert("rect",":first-child").attr("class","bb-bar-highlight-rect").attr("x",bbox.x-13).attr("y",8).attr("width",bbox.width+26).attr("height", panelHeight-tooltipHeight).attr("fill","rgba(58, 80, 112, 0.08)").attr("pointer-events","none");var $xAxisTarget=xAxisList.eq(index);$xAxisTarget.find("tspan").css("font-weight","bold")}}; this.regionChart=bb.generate({bindto:selector,size:{height:164,width:chartWidth},data:{columns:[["regions"].concat(_toConsumableArray(values))],type:"bar",onclick:function onclick(d,element){var value= lastEventGraphValues[d.index];var _this$splitRegionCode10=_this.splitRegionCodeToObjectAndCategory(value.regionCode),objectRegionCode=_this$splitRegionCode10.objectRegionCode,categoryRegionCode=_this$splitRegionCode10.categoryRegionCode; _this.talkTab="city";_this.setLastRegionCode(objectRegionCode,categoryRegionCode);_this.setScrollPositionInfo(_this.getTalkRegionScrollName());_this.initComment(objectRegionCode,categoryRegionCode);if(_this.isTalkMapEnabled())oBlockScriptService.callTemplateFuncWithIndex("visualMap", _this.getEnabledVisualMapIndex(),"executeTalkMapServiceFindSelectedRegionMarker","".concat(categoryRegionCode));oCommon.fnSendClick(event,"".concat(blockPageNameEn,".").concat(this.clickCode,"chartclk"))}, onout:function onout(d,element){d3.selectAll(".bb-bar-highlight-rect").remove();_this.element.find("".concat(selector," .talk_region_tooltip")).remove()}, colors:{regions:function regions(d){if(d.index===0)return"#FF4D4F";if(selectedIndex!==null&&d.index===selectedIndex)return"#3a5070";return"#7e99c3"}}}, bar:{width:{ratio:ratio,max:12},radius:{ratio:.2},label:{show:true,format:function format(v,id,i){if(i===0)return"".concat(v);if(selectedIndex!==null&&i===selectedIndex)return"".concat(v);return""}}}, axis:{x:{type:"category",categories:categories,tick:{multiline:true,rotate:0}},y:{show:false,min:0,max:yAxis.max,padding:{bottom:0},tick:{values:axisYValues}}},grid:{y:{lines:gridYLines},lines:{front:false}}, legend:{show:false},tooltip:{show:deviceType==="pc",contents:function contents(d){showTooltipFunc(d[0].index,d[0].value,d[0].index===0)}}, padding:{top:0,right:0,left:38,bottom:60},onrendered:function onrendered(){d3.selectAll(".bb-bars-regions .bb-bar").on("mouseover",function(){_this.regionChart.tooltip.hide()}); d3.selectAll(".bb-axis-x text").each(function(){var tspans=d3.select(this).selectAll("tspan");tspans.each(function(d,i){if(i!==0)d3.select(this).attr("dy","1.1em");else d3.select(this).attr("dy","0.6em")})}); $("".concat(selector," .talk_region_top")).remove();showTooltipFunc(0,regionData[0].value,true)}}); this.syncSlideInnerWidth(selector,chartWidth);setTimeout(function(){var p=_this.element.find("".concat(selector," .bb-axis-x path.domain"));if(p&&p.length>0){p=p[0];var w=p.getBBox().width;p.setAttribute("d", "M0,0H".concat(w))}},350)}}, {key:"_getTalkStatsKey",value:function _getTalkStatsKey(){var _this$commentOption,_this$commentOption2,_this$commentOption3,_this$commentOption4;var listType=((_this$commentOption=this.commentOption)=== null||_this$commentOption===void 0?void 0:_this$commentOption.sListType)||"";var keyMap={"group":((_this$commentOption2=this.commentOption)===null||_this$commentOption2===void 0?void 0:_this$commentOption2.sGroupId)|| "","object":((_this$commentOption3=this.commentOption)===null||_this$commentOption3===void 0?void 0:_this$commentOption3.sObjectId)||"","category":((_this$commentOption4=this.commentOption)===null||_this$commentOption4=== void 0?void 0:_this$commentOption4.sCategoryId)||""};return keyMap[listType]||""}}, {key:"ajaxTalkStatsCount",value:function ajaxTalkStatsCount(choiceList){var _this11=this;if(!this.element.is(":visible")&&menu!=="map"||!$("#wrap").hasClass("wrap_talk")&&menu==="map")return;var url=oBlockScriptService.getChoiceApiUrl(); var key=this._getTalkStatsKey();if(!key)return;var talkMapIntZoom=0;var params={};var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=choiceList[Symbol.iterator](), _step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var choiceName=_step3.value;switch(choiceName){case "regionTalkStatsByKey":params["regionTalkStatsByKey"]= {"key":key};break;case "regionTalkStatsByKeyAndHours":params["regionTalkStatsByKeyAndHours"]={"key":key,"deltaHours":-24};break;case "regionTalkSurgeStatsByKey":params["regionTalkSurgeStatsByKey"]={"key":key}; break;case "visualMapTalkStats":var talkMapParam=oBlockScriptService.callTemplateFuncWithIndex("visualMap",this.getEnabledVisualMapIndex(),"executeTalkMapServiceMakeTalkMapStatsParams");if(this.isTalkMapEnabled()&& talkMapParam&&talkMapParam["visualMapTalkStats"]){talkMapIntZoom=talkMapParam["intZoom"]||0;params["visualMapTalkStats"]=talkMapParam["visualMapTalkStats"]}break;case "regionTalkPublicInfo":params["regionTalkPublicInfo"]= {"key":key};break;case "regionTalk":params["regionTalk"]={"key":this.commentKey,"type":this.commentKeyType,"localCache":true};break}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&& _iterator3["return"]!=null)_iterator3["return"]()}finally{if(_didIteratorError3)throw _iteratorError3;}}var _this=this;oBlockScriptService.ajaxChoiceApiWithUrl(url,params,function(choiceResult){var hourlyGraphCallback= null;var eventGraphCallback=null;if(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKey)_this.drawTalkStatsCount(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKey); if(choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapTalkStats)oBlockScriptService.callTemplateFuncWithIndex("visualMap",_this11.getEnabledVisualMapIndex(),"executeTalkMapServiceProcessMapTalkStats", choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapTalkStats,talkMapIntZoom);if(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKeyAndHours){_this.lastRegionTalkStatsByKeyAndHours= choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKeyAndHours;hourlyGraphCallback=_this.drawTalkStatsHourlyGraph(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKeyAndHours)}if(choiceResult=== null||choiceResult===void 0?void 0:choiceResult.regionTalkSurgeStatsByKey){_this.lastRegionTalkSurgeStatsByKey=choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkSurgeStatsByKey;eventGraphCallback= _this.drawTalkStatsEventGraph(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkSurgeStatsByKey)}if(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalk)_this.lastRegionInfoAndCountWithStats= choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalk;if(choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkPublicInfo){var _data$slimWarnInfo,_data$slimWarnInfo2; var data=choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkPublicInfo;_this.renderPublicInfo((data===null||data===void 0?void 0:data.pickCommentList)||[],(data===null||data===void 0? void 0:(_data$slimWarnInfo=data.slimWarnInfo)===null||_data$slimWarnInfo===void 0?void 0:_data$slimWarnInfo.warnList)||[],(data===null||data===void 0?void 0:(_data$slimWarnInfo2=data.slimWarnInfo)===null|| _data$slimWarnInfo2===void 0?void 0:_data$slimWarnInfo2.disasterSmsList)||[])}if((choiceResult===null||choiceResult===void 0?void 0:choiceResult.regionTalkStatsByKeyAndHours)||(choiceResult===null||choiceResult=== void 0?void 0:choiceResult.regionTalkSurgeStatsByKey)){var showTab="";_this.element.find(".talk_report_tab .talk_tab_item").addClass("hide").attr("aria-selected",false);_this.element.find(".talk_report_chart").addClass("hide"); if(hourlyGraphCallback&&eventGraphCallback){_this.element.find(".talk_report_tab .talk_tab_item").removeClass("hide");showTab="trend_tab"}else if(hourlyGraphCallback)showTab="trend_tab";else if(eventGraphCallback)showTab= "regions_tab";if(showTab){var $enableTab=_this.element.find("#".concat(showTab));_this.element.find(".talk_report").removeClass("hide");$enableTab.removeClass("hide");$enableTab.attr("aria-selected",true); _this.element.find("#".concat($enableTab.attr("aria-controls"))).removeClass("hide");var foldTabFunc=function foldTabFunc(fold){if(fold){_this.element.find("._cnTalkStatsGraphFold").addClass("type_fold"); _this.element.find(".talk_report_chart").addClass("hide")}else if(showTab==="trend_tab"){var _hourlyGraphCallback,_hourlyGraphCallback$;(_hourlyGraphCallback=hourlyGraphCallback)===null||_hourlyGraphCallback=== void 0?void 0:(_hourlyGraphCallback$=_hourlyGraphCallback.render)===null||_hourlyGraphCallback$===void 0?void 0:_hourlyGraphCallback$.call(_hourlyGraphCallback)}else{var _eventGraphCallback,_eventGraphCallback$r; (_eventGraphCallback=eventGraphCallback)===null||_eventGraphCallback===void 0?void 0:(_eventGraphCallback$r=_eventGraphCallback.render)===null||_eventGraphCallback$r===void 0?void 0:_eventGraphCallback$r.call(_eventGraphCallback)}}; if(_this.lastChartFold===null){var _hourlyGraphCallback$2,_hourlyGraphCallback2,_eventGraphCallback$t,_eventGraphCallback2;var tabFold=((_hourlyGraphCallback$2=(_hourlyGraphCallback2=hourlyGraphCallback)=== null||_hourlyGraphCallback2===void 0?void 0:_hourlyGraphCallback2.tabFold)!==null&&_hourlyGraphCallback$2!==void 0?_hourlyGraphCallback$2:true)&&((_eventGraphCallback$t=(_eventGraphCallback2=eventGraphCallback)=== null||_eventGraphCallback2===void 0?void 0:_eventGraphCallback2.tabFold)!==null&&_eventGraphCallback$t!==void 0?_eventGraphCallback$t:true);foldTabFunc(tabFold)}else foldTabFunc(_this.lastChartFold);_this.lastChartTab= showTab}}},function(){if(params["regionTalkStatsByKey"])oBlockScriptService.callTemplateFuncWithIndex("visualMap",_this11.getEnabledVisualMapIndex(),"executeTalkMapServiceTalkMapAjaxAlwaysCallback")})}}, {key:"toggleTalkStatsCountTooltip",value:function toggleTalkStatsCountTooltip(e){e.preventDefault();var $currentTarget=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($currentTarget);oCommon.fnCloseAllInfoLayer(); if(isOpen===false)oCommon.fnOpenInfoLayer($currentTarget)}}, {key:"getEnabledVisualMapIndex",value:function getEnabledVisualMapIndex(){var $visualMap=oBlockScriptService.getBlockTemplateElementByTemplateIdAndFilter("visualMap",function(_,el){return $(el).css("display")!== "none"},true); if($visualMap.length>0)return Number($visualMap.data("template-index"));else return null}}, {key:"getCurrentLowLevelRegionCode",value:function getCurrentLowLevelRegionCode(){var _this$commentOption5;var listType=((_this$commentOption5=this.commentOption)===null||_this$commentOption5===void 0? void 0:_this$commentOption5.sListType)||"";switch(listType){case "group":case "object":return this.talkRegionCode;case "category":return this.talkCategoryRegionCode;default:return""}}}, {key:"getCommentOption",value:function getCommentOption(){return this.commentOption}}, {key:"applyAndroidLayout",value:function applyAndroidLayout(){var measureBar=function measureBar(el){var r=el.getBoundingClientRect();var mb=parseFloat(getComputedStyle(el).marginBottom)||0;return{height:r.height, marginBottom:mb,top:r.top}}; var vv=window.visualViewport;var visibleBottom=function visibleBottom(){return vv?vv.height+vv.offsetTop:window.innerHeight}; var $bar=this.element.find(".u_cbox_write_wrap");var scroller=$("div.section_right_inner").length>0||document.documentElement;if($bar.length===0||!scroller)return;var _measureBar=measureBar($bar[0]),height= _measureBar.height,marginBottom=_measureBar.marginBottom;var vb=visibleBottom();var targetTop=Math.round(vb-(height+marginBottom));if(targetTop<0)targetTop=0;$bar.attr("style","top: ".concat(targetTop, "px !important;"))}}, {key:"renderPublicInfo",value:function renderPublicInfo(pickCommentList,warnList,disasterSmsList){var isNew=false;if(this.isForceKeepCommentNone())return;var htmlList=[];var currentMoment=moment.utc().utcOffset("+09:00"); var getTimeAge=function getTimeAge(current,dataMoment){var minutesDiff=current.diff(dataMoment,"minutes");var hoursDiff=current.diff(dataMoment,"hours");var daysDiff=current.diff(dataMoment,"days");if(minutesDiff< 60)return"".concat(minutesDiff,"\ubd84 \uc804");else if(hoursDiff<24)return"".concat(hoursDiff,"\uc2dc\uac04 \uc804");else if(daysDiff<=7)return"".concat(daysDiff,"\uc77c \uc804");else return dataMoment.format("MM.DD HH:mm")}; var _iteratorNormalCompletion4=true;var _didIteratorError4=false;var _iteratorError4=undefined;try{for(var _iterator4=pickCommentList[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4= true){var _pickComment$badges,_pickComment$badges$r,_pickComment$status;var pickComment=_step4.value;var pickTime=moment(pickComment.regTime);isNew=isNew||pickTime.isAfter(currentMoment.clone().subtract(1, "hours"));var badgeName=(pickComment===null||pickComment===void 0?void 0:(_pickComment$badges=pickComment.badges)===null||_pickComment$badges===void 0?void 0:(_pickComment$badges$r=_pickComment$badges.roleBadge)=== null||_pickComment$badges$r===void 0?void 0:_pickComment$badges$r.badgeName)||"";var badgeHtml=badgeName?'\x3cspan class\x3d"pick_label official"\x3e'.concat(badgeName,"\x3c/span\x3e"):"";var timeAge=getTimeAge(currentMoment, pickTime);var visible=(pickComment===null||pickComment===void 0?void 0:pickComment.visible)||false;var defamation=(pickComment===null||pickComment===void 0?void 0:pickComment.defamation)||false;var blind= (pickComment===null||pickComment===void 0?void 0:pickComment.blind)||false;var status=(_pickComment$status=pickComment===null||pickComment===void 0?void 0:pickComment.status)!==null&&_pickComment$status!== void 0?_pickComment$status:0;var deleted=(pickComment===null||pickComment===void 0?void 0:pickComment.deleted)||false;var hiddenByCleanbot=(pickComment===null||pickComment===void 0?void 0:pickComment.hiddenByCleanbot)|| false;var exceptionMsg="";if(!visible&&defamation)exceptionMsg="\uc815\ubcf4\ud1b5\uc2e0\ub9dd\ubc95\uc5d0 \ub530\ub978 \uad8c\ub9ac\uce68\ud574\x3cbr\x3e \uc694\uccad\uc774 \uc788\uc5b4, \uac8c\uc2dc\uc911\ub2e8 \ub418\uc5c8\uc2b5\ub2c8\ub2e4."; else if(!visible&&blind&&status===15)exceptionMsg="\uc815\ubcf4\ud1b5\uc2e0\ub9dd\ubc95\uc5d0 \ub530\ub978 \uad8c\ub9ac\uce68\ud574\x3cbr\x3e \uc694\uccad\uc774 \uc788\uc5b4, \uac8c\uc2dc\uc911\ub2e8 \ub418\uc5c8\uc2b5\ub2c8\ub2e4."; else if(!visible&&status===1)exceptionMsg="\uc791\uc131\uc790\uc5d0 \uc758\ud574 \uc0ad\uc81c\ub41c \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4.";else if(!visible&&status===3)exceptionMsg="\uc6b4\uc601\uaddc\uc815 \ubbf8\uc900\uc218\ub85c \uc778\ud574 \uc0ad\uc81c\ub41c\x3cbr\x3e \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4."; else if(!visible&&status===11)exceptionMsg="\ucf58\ud150\uce20 \uc81c\uacf5\uc790\uc5d0 \uc758\ud574 \uac8c\uc2dc\ubb3c\uc774\x3cbr\x3e \uc0ad\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.";else if(!visible&&deleted)exceptionMsg= "\uac8c\uc2dc\ubb3c\uc774 \uc0ad\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.";else if(visible&&hiddenByCleanbot)exceptionMsg="\ud074\ub9b0\ubd07\uc774 \uc774\uc6a9\uc790 \ubcf4\ud638\ub97c \uc704\ud574 \uc228\uae34\x3cbr\x3e \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4."; htmlList.push({"ymdt":"".concat(pickTime.format("YYYYMMDDHHmmss")),"html":'\n \x3cli class\x3d"pick_item '.concat(exceptionMsg?"type_exception":"",'"\x3e\n \x3cdiv class\x3d"pick_inner" data-comment-no\x3d"').concat((pickComment=== null||pickComment===void 0?void 0:pickComment.commentNo)||"",'"\x3e\n \x3ca href\x3d"#" class\x3d"pick_header _cnGoToPickComment" data-comment-no\x3d"').concat((pickComment===null||pickComment=== void 0?void 0:pickComment.commentNo)||"",'" data-nlog-area\x3d"region_talk.public_scroll.comment_link"\x3e\n \x3cdiv class\x3d"pick_header"\x3e\n ').concat(badgeHtml, '\n \x3cspan class\x3d"pick_title"\x3e').concat((pickComment===null||pickComment===void 0?void 0:pickComment.userName)||"",'\x3c/span\x3e\n \x3cspan class\x3d"pick_time"\x3e').concat(timeAge, '\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3cp class\x3d"pick_desc"\x3e').concat(exceptionMsg?exceptionMsg:oCommon.fnWrapLinksWithAnchor(pickComment=== null||pickComment===void 0?void 0:pickComment.contents,'\x3ca href\x3d"{url}" class\x3d"pick_url" target\x3d"_blank" data-nlog\x3d"url" rel\x3d"noopener noreferrer" data-nlog-area\x3d"region_talk.url_link"\x3e{url}\x3c/a\x3e'), "\x3c/p\x3e\n \x3c/div\x3e\n \x3c/li\x3e"),"priority":1})}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4["return"]!= null)_iterator4["return"]()}finally{if(_didIteratorError4)throw _iteratorError4;}}var _iteratorNormalCompletion5=true;var _didIteratorError5=false;var _iteratorError5=undefined;try{for(var _iterator5=warnList[Symbol.iterator](), _step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var warn=_step5.value;var reportRTimeMoment=moment(warn.reportRTime,"YYYYMMDDHHmmss");var reportTimeMoment= moment(warn.reportTime,"YYYYMMDDHHmmss");var reportRTimeText=reportRTimeMoment.format("YY.MM.DD. HH:mm");var reportTimeText=reportTimeMoment.format("YY.MM.DD. HH:mm");var ingText=currentMoment.format("YYYYMMDDHHmmss")>= warn.reportTime?"\uc911":"";htmlList.push({"ymdt":warn.reportTime,"html":'\n \x3cli class\x3d"pick_item"\x3e\n \x3cdiv href\x3d"#" class\x3d"pick_inner"\x3e\n \x3cdiv class\x3d"pick_header"\x3e\n \x3cspan class\x3d"pick_label warning"\x3e\uae30\uc0c1\ud2b9\ubcf4\x3c/span\x3e\n \x3cspan class\x3d"pick_title"\x3e'.concat(warn.warnRgnNm, " ").concat(warn.stypeNm).concat(oCommon.fnGetWarnGradeNm(warn.sgrade)," \ubc1c\ud6a8 ").concat(ingText,'\x3c/span\x3e\n \x3c/div\x3e\n \x3cp class\x3d"pick_desc"\x3e\ubc1c\ud45c\x26nbsp;').concat(reportRTimeText, "\x3cbr\x3e\n \ubc1c\ud6a8\x26nbsp;").concat(reportTimeText," \uc774\ud6c4\x3c/p\x3e\n \x3c/div\x3e\n \x3c/li\x3e"),"priority":5})}}catch(err){_didIteratorError5= true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5["return"]!=null)_iterator5["return"]()}finally{if(_didIteratorError5)throw _iteratorError5;}}var _iteratorNormalCompletion6= true;var _didIteratorError6=false;var _iteratorError6=undefined;try{for(var _iterator6=disasterSmsList[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6= true){var sms=_step6.value;var smsMoment=moment(sms.regDate,"YYYY-MM-DD HH:mm:ss");var _timeAge=getTimeAge(currentMoment,smsMoment);htmlList.push({"ymdt":smsMoment.format("YYYYMMDDHHmmss"),"html":'\n \x3cli class\x3d"pick_item"\x3e\n \x3cdiv href\x3d"#" class\x3d"pick_inner"\x3e\n \x3cdiv class\x3d"pick_header"\x3e\n \x3cspan class\x3d"pick_label disaster"\x3e\uc7ac\ub09c\ubb38\uc790\x3c/span\x3e\n \x3cspan class\x3d"pick_title"\x3e'.concat(sms.govNm, '\x3c/span\x3e\n \x3cspan class\x3d"pick_time"\x3e').concat(_timeAge,'\x3c/span\x3e\n \x3c/div\x3e\n \x3cp class\x3d"pick_desc"\x3e').concat(sms.content, "\x3c/p\x3e\n \x3c/div\x3e\n \x3c/li\x3e"),"priority":10})}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6["return"]!= null)_iterator6["return"]()}finally{if(_didIteratorError6)throw _iteratorError6;}}if(htmlList.length<=0)return;var infoHtml="";htmlList.sort(function(a,b){var timeA=moment(a.ymdt,"YYYYMMDDHHmmss").valueOf(); var timeB=moment(b.ymdt,"YYYYMMDDHHmmss").valueOf();if(timeA!==timeB)return timeB-timeA;return a.priority-b.priority}); for(var _i6=0,_htmlList=htmlList;_i6<_htmlList.length;_i6++){var value=_htmlList[_i6];infoHtml+=value["html"]}var newHtml=isNew?'\x3cem class\x3d"icon_new"\x3e\x3cspan class\x3d"blind"\x3enew\x3c/span\x3e\x3c/em\x3e': "";var html='\n \x3cdiv class\x3d"pick_area _cnPickArea _cnStructureTalkPublicInfo"\x3e\n \x3cdiv class\x3d"title_area"\x3e\n \x3cstrong class\x3d"pick_area_title"\x3e\uacf5\uacf5 \uc7ac\ub09c\uc548\uc804 \uc815\ubcf4\x3c/strong\x3e\n '.concat(newHtml, '\n\n \x3cdiv class\x3d"pick_area_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"pick_tooltip_button type_tooltip _cnWeatherInfoLayer _cnExcludeTalkLayer _cnTalkTooltip" aria-pressed\x3d"false" data-nlog\x3d"help" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'officialinfo\')" data-type\x3d"public" data-nlog-area\x3d"region_talk.layer.help_button" data-nlog-params\x3d\'{"category":"public"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n\n \x3cdiv class\x3d"pick_tooltip_inner"\x3e\n \x3cstrong class\x3d"pick_tooltip_title"\x3e\uacf5\uc2dd \uc7ac\ub09c\uc548\uc804 \uc815\ubcf4\x3c/strong\x3e\n\n \x3cp class\x3d"pick_tooltip_text"\x3e\n \uc9c0\uc5ed\uc758 \uacf5\uacf5 \uc7ac\ub09c\u00b7\uc548\uc804 \uc815\ubcf4\ub97c \ubaa8\uc544 \uc81c\uacf5\ud569\ub2c8\ub2e4.\x3cbr\x3e\n \uc804\uad6d, \uad11\uc5ed\uc2dc\u00b7\ub3c4, \uc2dc\u00b7\uad70\u00b7\uad6c \ud1a1 \uc0c1\ub2e8\uc5d0 \ud45c\ucd9c\ub429\ub2c8\ub2e4.\x3cbr\x3e\n \uc804\uad6d \ud1a1\uc5d0\ub294 \uae34\uae09\uc7ac\ub09c\ubb38\uc790, \uae30\uc0c1\ud2b9\ubcf4\ub97c \uc81c\uc678\ud55c \'\uacf5\uc2dd \uc81c\ubcf4\ud1a1\'\ub9cc \ud45c\ucd9c\ub429\ub2c8\ub2e4.\n \x3c/p\x3e\n\n \x3cdl class\x3d"pick_tooltip_description"\x3e\n \x3cdt class\x3d"pick_description_title"\x3e\uacf5\uc2dd \uc81c\ubcf4\ud1a1\x3c/dt\x3e\n \x3cdd class\x3d"pick_description_data"\x3e\ub124\uc774\ubc84 \ub0a0\uc528\uac00 \uc778\uc99d\ud55c \uacf5\uc2dd \uacc4\uc815\uc5d0\uc11c \uac8c\uc7ac\ud55c \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4.\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"pick_tooltip_description"\x3e\n \x3cdt class\x3d"pick_description_title"\x3e\uae34\uae09\uc7ac\ub09c\ubb38\uc790\x3c/dt\x3e\n \x3cdd class\x3d"pick_description_data"\x3e\ucd5c\uadfc 1\uc2dc\uac04 \uc774\ub0b4 \ud574\ub2f9 \uc9c0\uc5ed\uc5d0 \uc1a1\ucd9c\ub41c \uae34\uae09 \uc7ac\ub09c\ubb38\uc790\uc785\ub2c8\ub2e4.\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"pick_tooltip_description"\x3e\n \x3cdt class\x3d"pick_description_title"\x3e\uae30\uc0c1\ud2b9\ubcf4\x3c/dt\x3e\n \x3cdd class\x3d"pick_description_data"\x3e\ud604\uc7ac \ud574\ub2f9 \uc9c0\uc5ed\uc5d0 \ubc1c\ud45c \ub610\ub294 \ubc1c\ud6a8\ub41c \uae30\uc0c1\ud2b9\ubcf4\uc785\ub2c8\ub2e4.\x3c/dd\x3e\n \x3c/dl\x3e\n\n \x3cbutton type\x3d"button" class\x3d"btn_close _cnTalkTooltip" data-type\x3d"public" data-nlog-area\x3d"region_talk.layer.close_button" data-nlog-params\x3d\'{"category":"public"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"talk_tab_fold _cnBtnPickFold" data-nlog\x3d"public_fold" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'officialfold\')" data-nlog-area\x3d"region_talk.public_fold_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ucc28\ud2b8 \uc601\uc5ed \uc5f4\uae30 / \ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"scroll_control" data-nlog\x3d"public_scroll"\x3e\n \x3cdiv class\x3d"scroll_area" data-name\x3d"talkPublicInfo" data-gesture-scroll\x3d"true" data-scroll-percent\x3d"0.61" data-nclk\x3d"').concat(this.clickCode, 'officialscr" data-nlog-area\x3d"region_talk.public_scroll"\x3e\n \x3cul class\x3d"pick_list"\x3e\n ').concat(infoHtml,'\n \x3c/ul\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_prev" data-nlog-area\x3d"region_talk.public_scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_next" data-nlog-area\x3d"region_talk.public_scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); this.element.find("._cnStructureTalkPublicInfo").replaceWith(html);var scrollRatio=this.element.find("._cnStructureTalkPublicInfo .scroll_area .pick_list").children().width()/this.element.find("._cnStructureTalkPublicInfo .scroll_area").width()+ .015;this.element.find("._cnStructureTalkPublicInfo .scroll_area").attr("data-scroll-percent",scrollRatio.toFixed(3));oCommon.initScroll(this.element.find('.scroll_area[data-name\x3d"talkPublicInfo"]'))}}, {key:"pickFold",value:function pickFold(e){e.preventDefault();var $currentTarget=$(e.currentTarget);var isFold=$currentTarget.hasClass("type_fold");if(isFold)this.element.find("._cnPickArea .scroll_control").removeClass("hide"); else this.element.find("._cnPickArea .scroll_control").addClass("hide");$currentTarget.toggleClass("type_fold")}}, {key:"goToPickComment",value:function goToPickComment(e){e.preventDefault();var $currentTarget=$(e.currentTarget);var commentNo=$currentTarget.closest(".pick_inner").data("comment-no");$currentTarget.closest(".pick_inner").addClass("_cnCustomHighlight"); oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"officialorigin"));cbox.Interface.move("cbox_module",commentNo)}}, {key:"getCommentElement",value:function getCommentElement(commentNo){return this.element.find(".cbox_module__comment_".concat(commentNo))}}, {key:"moveAfterFocusComment",value:function moveAfterFocusComment(){var _this12=this;if(!this.isWindowScroll()){var _$$height;var talkHeadHeight=(_$$height=$(".talk_head").height())!==null&&_$$height!== void 0?_$$height:0;var regionBtnHeight=0;this.element.find(".district_area").each(function(){regionBtnHeight+=$(this).outerHeight(true)}); var position=this.getTalkVerticalScrollElement().scrollTop()-(talkHeadHeight+regionBtnHeight);this.goScrollTalkVertical(position)}var $highlightTarget=this.element.find(".pick_inner._cnCustomHighlight"); var commentNo;if($highlightTarget.length>0){commentNo=$highlightTarget.data("comment-no");$highlightTarget.removeClass("_cnCustomHighlight")}else if(this.initHighlightCommentNo){commentNo=this.initHighlightCommentNo; this.initHighlightCommentNo=null}if(commentNo){if(this.customHighlightTimeoutId){clearTimeout(this.customHighlightTimeoutId);this.element.find(".u_cbox_comment_box").removeClass("u_cbox_is_highlight")}this.getCommentElement(commentNo).find(".u_cbox_comment_box").addClass("u_cbox_is_highlight"); this.customHighlightTimeoutId=setTimeout(function(){_this12.getCommentElement(commentNo).find(".u_cbox_comment_box").removeClass("u_cbox_is_highlight")},6E3)}}}, {key:"detectCommentLayer",value:function detectCommentLayer(){var observer=new MutationObserver(_.debounce(function(){var $body=$("body");if($body.find(".u_cbox_layer_wrap").length>0)$body.addClass("_cnNotScrollCommentLayer"); else $body.removeClass("_cnNotScrollCommentLayer")},100)); observer.observe(document.body,{childList:true,subtree:true})}}]); return regionTalk}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iMAX_COUNT){var shuffled=_toConsumableArray(dataList); for(var i=shuffled.length-1;i>0;i--){var j=Math.floor(Math.random()*(i+1));var _ref=[shuffled[j],shuffled[i]];shuffled[i]=_ref[0];shuffled[j]=_ref[1]}dataList=shuffled.slice(0,MAX_COUNT)}var following= (((_relatedLsurFollowing=relatedLsurFollowing)===null||_relatedLsurFollowing===void 0?void 0:_relatedLsurFollowing.channels)||[]).filter(function(item){return item.group==="leisure"}).map(function(item){return item.id}); var followingList=[];var notFollowingList=[];dataList.forEach(function(item){if(following.includes(item.lsurRgnCd))followingList.push(item);else notFollowingList.push(item)}); followingList.sort(function(a,b){return a.lsurNm.localeCompare(b.lsurNm,"ko-KR")}); notFollowingList.sort(function(a,b){return a.lsurNm.localeCompare(b.lsurNm,"ko-KR")}); this.relatedLsurRegionFcastList=[].concat(followingList,notFollowingList)}}, {key:"resetScroll",value:function resetScroll(){var scrollName=this.element.find(".scroll_area").data("name");if(_.isEmpty(oCommon.oScroll[scrollName]))this.initScroll();else oCommon.refreshScroll(scrollName); this.resetScrollHeight()}}, {key:"initScroll",value:function initScroll(){oCommon.initScroll(this.element.find(".scroll_area"))}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"render",value:function render(){var _this=this;var content="";var itemCount=6;var lsurType=this.relatedLsurRegionFcastList[0].lsurType;var lsurTitle="\ub2e4\ub978 "+oCodeUtil.getLsurTypeKor(lsurType)|| "\ub808\uc800\uc9c0\uc5ed";this.element.find("._relatedLsurRegionFcastTitle").text(lsurTitle);this.relatedLsurRegionFcastList.forEach(function(item,index){var urlString="".concat(isBlockPreview?"/preview": "","/today/").concat(item.lsurRgnCd);if(index%itemCount===0)content+='\x3cspan class\x3d"card_list_inner"\x3e';content+='\n \x3ca href\x3d"'.concat(urlString,'" class\x3d"card_list_item" data-region-code\x3d"').concat(item.lsurRgnCd, '" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this.clickCode,'select\')" data-nlog-area\x3d"related_leisure_region_forecast.scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(item.lsurRgnCd, '"}\'\x3e\n \x3cspan class\x3d"card_item_icon"\x3e\n \x3ci class\x3d"ico ico_wt').concat(item.wetrCd,'" aria-hidden\x3d"true"\x3e\x3c/i\x3e\n \x3cspan class\x3d"blind"\x3e').concat(item.wetrTxt, "\x3c/span\x3e\n \x3c/span\x3e\n ").concat(item.lsurNm,"\n \x3c/a\x3e\n ");if(index%itemCount===itemCount-1||index===_this.templateData.length- 1)content+="\x3c/span\x3e"}); this.element.find("._relatedLsurRegionFcastContent").html(content);this.resetScrollHeight()}}, {key:"resetScrollHeight",value:function resetScrollHeight(){if(this.element.find("._relatedLsurRegionFcastContent").length===0)return;var height=this.element.find("._relatedLsurRegionFcastContent").height(); this.element.find(".scroll_area").height(height)}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return!_.isEmpty(this.templateData)}}]); return relatedLsurRegionFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iparseFloat($el.css("line-height"));if(isMultiLine){$el.addClass("is-word");var stillMultiLine= $container[0].offsetHeight>parseFloat($el.css("line-height"));$el.toggleClass("is-text",!stillMultiLine)}$el[0].style.visibility=""}}, {key:"getDataType",value:function getDataType(){if(this.templateData.lsur)return"lsur";else if(this.templateData.domestic)return"domestic";else return"overseas"}}, {key:"render",value:function render(){var key=this.fieldMap[this.getDataType()].key;var data=this.templateData[key];var sareaNm=data[this.fieldMap[this.getDataType()].sareaNm];var subscribed=false;if(regionFollow&& regionFollow.channels)subscribed=regionFollow.channels.some(function(channel){return channel.id===sRegionCode}); var html='\n \x3cdiv class\x3d"location_area"\x3e\n \x3cspan class\x3d"blind"\x3e\ud604\uc704\uce58\x3c/span\x3e\n \x3cdiv class\x3d"location_area_interest"\x3e\n \x3cbutton type\x3d"button" class\x3d"location_interest_button" data-region-code\x3d"'.concat(sRegionCode, '" data-nlog\x3d"follow" data-region-name\x3d"').concat(sareaNm,'" aria-pressed\x3d"').concat(subscribed,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'follow\')" data-nlog-area\x3d"selected_region.follow_button" data-nlog-params\x3d\'{"region_id":"').concat(sRegionCode,'"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uad00\uc2ec\uc9c0\uc5ed \uc124\uc815\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cspan class\x3d"location_area_report hide _cnDangerIcon"\x3e\n \x3cspan class\x3d"blind"\x3e\uc704\ud5d8\x3c/span\x3e\n \x3c/span\x3e\n \x3cstrong class\x3d"location_name" style\x3d"visibility: hidden;"\x3e').concat(regionName, "\x3c/strong\x3e\n ");if(this.templateData.lsur&&menu==="today"){var previewUrl=isBlockPreview?"/preview":"";var lsurRegionCount=this.templateData.lsurRegionList?this.templateData.lsurRegionList.length: 0;var lsurTypeCode=sRegionCode.substring(2,4);var lsurTypeKorName=oCodeUtil.getLsurTypeKor(lsurTypeCode)||"\ub808\uc800\uc9c0\uc5ed";html+='\n \x3cbutton type\x3d"button" class\x3d"location_area_button type_poi _cnRegionBottomSheetOpen" data-nlog\x3d"poi_open" aria-pressed\x3d"false" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'openpoi\')" data-nlog-area\x3d"selected_region.poi_open_button"\x3e\n \x3cspan class\x3d"blind"\x3e').concat(lsurTypeKorName,' \ubaa9\ub85d \uc5f4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"bottom_sheet _cnRegionBottomSheet"\x3e\n \x3cdiv class\x3d"bottom_sheet_dimmed _cnRegionBottomSheetDimmed"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"bottom_sheet_inner _cnRegionBottomSheetInner"\x3e\n \x3cbutton type\x3d"button" class\x3d"handle_btn _cnRegionBottomSheetHandle" data-nlog-area\x3d"selected_region.handle_button"\x3e\x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub3d9\uc791\x3c/span\x3e\x3c/button\x3e\n \x3cem class\x3d"title"\x3e').concat(lsurTypeKorName, '\x3cstrong class\x3d"num"\x3e').concat(lsurRegionCount,'\x3c/strong\x3e\x3c/em\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"location_poi_area"\x3e\n ').concat(this.renderLsurRegionList(previewUrl), '\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close _cnRegionBottomSheetClose" data-nlog\x3d"sheet_close" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'closepoi\')" data-nlog-area\x3d"selected_region.sheet_close_button"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ')}html+= '\n \x3cbutton type\x3d"button" class\x3d"location_area_button type_location _cnBtnLocation" data-loading-class\x3d"loading" aria-pressed\x3d"false" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'curloc\', false, true)" data-nlog-area\x3d"selected_region.location_button"\x3e\x3cspan class\x3d"blind"\x3e\ub0b4\uc704\uce58\x3c/span\x3e\x3c/button\x3e\n ');if(this.templateData.domestic){html+= "\x3c/div\x3e";var cctvWrapperClassName="_cnCctvArea";if(!_.isEmpty(this.templateData.cctv)&&this.templateData.cctv.serviceAvailable){var _this$templateData$ls,_this$templateData$cc,_this$templateData, _this$templateData$cc2;var lsurRgnCd=((_this$templateData$ls=this.templateData.lsurRegion)===null||_this$templateData$ls===void 0?void 0:_this$templateData$ls.lsurRgnCd)||"";this.cctvService=new cctvService(null, this.element,true,this.clickCode,(_this$templateData$cc=this.templateData.cctv)===null||_this$templateData$cc===void 0?void 0:_this$templateData$cc.matrix,null,null,cctvWrapperClassName,lsurRgnCd);var thumbnailUrl= (_this$templateData=this.templateData)===null||_this$templateData===void 0?void 0:_this$templateData.thumbnailUrl;var cctvThumbnailUrl=thumbnailUrl?oCommon.fnGetImageCdnProxyUrl(thumbnailUrl):"";var cctvNm= ((_this$templateData$cc2=this.templateData.cctv)===null||_this$templateData$cc2===void 0?void 0:_this$templateData$cc2.cctvName)||"";html+='\n \x3cdiv class\x3d"cctv_link_area '.concat(cctvWrapperClassName, '"\x3e\n \x3cbutton type\x3d"button" class\x3d"cctv_link_button _cnCctvBtn" aria-pressed\x3d"false" data-nlog-area\x3d"selected_region.cctv_button"\x3e\n \x3cimg src\x3d"https://ssl.pstatic.net/static/m/weather/2011/im/bl4.png" data-src\x3d"').concat(cctvThumbnailUrl, '" class\x3d"cctv_button_image lazy" onerror\x3d"oCommon.thumbReady(this);" alt\x3d"').concat(cctvNm,'"\x3e\n \x3cspan class\x3d"cctv_button_text"\x3eCCTV\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n ')}}else{var _this$templateData$ov, _this$templateData2,_this$templateData2$o;var tzMin=(_this$templateData$ov=(_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:(_this$templateData2$o=_this$templateData2.overseasRegion)=== null||_this$templateData2$o===void 0?void 0:_this$templateData2$o.tzMin)!==null&&_this$templateData$ov!==void 0?_this$templateData$ov:540;var localDateTime=moment().utc().add(tzMin,"minutes");html+='\n \x3cdiv class\x3d"location_area_time"\x3e\n \x3cspan class\x3d"location_time_text"\x3e\n \ud604\uc9c0\uc2dc\uac04\n \x3cem class\x3d"location_text_emphasis"\x3e'.concat(localDateTime.format("YYYY.MM.DD. H:mm"), "\x3c/em\x3e\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}this.element.append(html)}}, {key:"initBottomSheet",value:function initBottomSheet(){var _this2=this,_this$templateInfo$in,_this$templateInfo;this.bottomSheet=oBottomSheet.create(this.element.find("._cnRegionBottomSheet"),{halfViewHeight:60, halfViewMaxHeightPx:480,fitContent:true,dimmedSelector:"._cnRegionBottomSheetDimmed",innerSelector:"._cnRegionBottomSheetInner",handleSelector:"._cnRegionBottomSheetHandle",closeButtonSelector:"._cnRegionBottomSheetClose", onClose:function onClose(){return _this2.clickCloseLsurRegionList()}}); oBottomSheet.register("regionBottomSheet_".concat((_this$templateInfo$in=(_this$templateInfo=this.templateInfo)===null||_this$templateInfo===void 0?void 0:_this$templateInfo.index)!==null&&_this$templateInfo$in!== void 0?_this$templateInfo$in:""),this.bottomSheet)}}, {key:"renderLsurRegionList",value:function renderLsurRegionList(previewUrl){if(!this.templateData.lsurRegionList)return"";var list=this.templateData.lsurRegionList;var useGroupedLayout=list.length>=selectedRegion.GROUPED_LAYOUT_MIN_COUNT; if(useGroupedLayout)return this.renderGroupedRegionList(list,previewUrl);return this.renderFlatRegionList(list,previewUrl)}}, {key:"sortRegionsByPriority",value:function sortRegionsByPriority(items){var activeIdx=items.findIndex(function(item){return item.lsurRgnCd===sRegionCode}); var activeItem=null;if(activeIdx>-1)activeItem=items.splice(activeIdx,1)[0];var followed=[];var unfollowed=[];items.forEach(function(item){var _regionFollow,_regionFollow$channel;var isFollowed=(_regionFollow= regionFollow)===null||_regionFollow===void 0?void 0:(_regionFollow$channel=_regionFollow.channels)===null||_regionFollow$channel===void 0?void 0:_regionFollow$channel.some(function(ch){return ch.id===item.lsurRgnCd}); (isFollowed?followed:unfollowed).push(item)}); followed.sort(function(a,b){var getIndex=function getIndex(item){try{var channel=regionFollow.channels.find(function(ch){return ch.id===item.lsurRgnCd}); return(channel===null||channel===void 0?void 0:channel.metaData)?JSON.parse(channel.metaData).index||Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER}catch(_unused){return Number.MAX_SAFE_INTEGER}}; return getIndex(a)-getIndex(b)}); unfollowed.sort(function(a,b){return a.lsurNm.localeCompare(b.lsurNm,"ko")}); items.length=0;if(activeItem)items.push(activeItem);items.push.apply(items,followed.concat(unfollowed));return items}}, {key:"renderGroupedRegionList",value:function renderGroupedRegionList(list,previewUrl){var _this3=this;var groups={};list.forEach(function(item){var _item$naverRgnCd;var prefix=((_item$naverRgnCd=item.naverRgnCd)=== null||_item$naverRgnCd===void 0?void 0:_item$naverRgnCd.substring(0,2))||"00";var sido=selectedRegion.SIDO_MAP[prefix]||"\uae30\ud0c0";if(!groups[sido])groups[sido]=[];groups[sido].push(item)}); Object.values(groups).forEach(function(items){return _this3.sortRegionsByPriority(items)}); return'\x3cdiv class\x3d"location_poi_list type_location"\x3e'+selectedRegion.SIDO_ORDER.filter(function(sido){return groups[sido]&&groups[sido].length>0}).map(function(sido,index){var items=groups[sido]; var isFirstGroup=index===0;return'\n \x3cdiv class\x3d"location_list_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"location_list_place _cnSidoToggle" data-title\x3d"'.concat(sido, '" aria-pressed\x3d"').concat(isFirstGroup?"true":"false",'" data-nlog-area\x3d"selected_region.sido_button" data-nlog-params\x3d\'{"sido":"').concat(sido,"\"}'\x3e\n ").concat(sido, '\x3cem class\x3d"location_place_count"\x3e').concat(items.length,'\x3c/em\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"location_list_fold"\x3e\n \x3cdiv class\x3d"location_item_wrap"\x3e\n ').concat(items.map(function(item){return _this3.renderRegionItem(item, previewUrl)}).join(""),"\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e")}).join("")+"\x3c/div\x3e"}}, {key:"renderFlatRegionList",value:function renderFlatRegionList(list,previewUrl){var _this4=this;var sortedList=_toConsumableArray(list);this.sortRegionsByPriority(sortedList);return'\x3cdiv class\x3d"location_poi_list type_result"\x3e'+ sortedList.map(function(item){return _this4.renderRegionItem(item,previewUrl)}).join("")+"\x3c/div\x3e"}}, {key:"renderRegionItem",value:function renderRegionItem(lsurRegion,previewUrl){var _regionFollow2,_regionFollow2$channe;var isActive=lsurRegion.lsurRgnCd===sRegionCode;var isSubscribed=(_regionFollow2= regionFollow)===null||_regionFollow2===void 0?void 0:(_regionFollow2$channe=_regionFollow2.channels)===null||_regionFollow2$channe===void 0?void 0:_regionFollow2$channe.some(function(channel){return channel.id=== lsurRegion.lsurRgnCd}); return'\n \x3cdiv class\x3d"location_list_item'.concat(isActive?" is-active":"",'"\x3e\n \x3cbutton type\x3d"button" class\x3d"location_item_button type_favorite" data-nlog\x3d"poi_follow" aria-pressed\x3d"').concat(isSubscribed? "true":"false",'" data-region-code\x3d"').concat(lsurRegion.lsurRgnCd,'" data-region-name\x3d"').concat(lsurRegion.lsurNm,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'followpoi\')" data-nlog-area\x3d"selected_region.poi_follow_button" data-nlog-params\x3d\'{"region_id":"').concat(lsurRegion.lsurRgnCd,'"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uad00\uc2ec\uc9c0\uc5ed ').concat(isSubscribed? "\uc0ad\uc81c":"\ucd94\uac00",'\x3c/span\x3e\n \x3c/button\x3e\n \x3ca href\x3d"').concat(previewUrl,"/today/").concat(lsurRegion.lsurRgnCd,'" class\x3d"location_item_title" data-region-code\x3d"').concat(lsurRegion.lsurRgnCd, '" data-nlog\x3d"poi" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'selectpoi\')" data-nlog-area\x3d"selected_region.poi_link" data-nlog-params\x3d\'{"region_id":"').concat(lsurRegion.lsurRgnCd, '"}\'\x3e\n \x3cspan class\x3d"location_title_text"\x3e').concat(lsurRegion.lsurNm,"\x3c/span\x3e\n \x3c/a\x3e\n \x3c/div\x3e")}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click","button.location_interest_button",$.proxy(this.clickToggleRegionFollow,this));this.element.on("click","button.location_item_button", $.proxy(this.clickToggleRegionFollow,this));this.element.on("click","._cnBtnLocation",$.proxy(oCommon._fnOnClickGeoLocationButton,this));this.element.on("click","._cnCloseRegionFollowMaxTooltip",$.proxy(this.closeRegionFollowMaxMessage, this));this.element.on("click","._cnCloseRegionFollowAddTooltip",$.proxy(this.closeRegionFollowAddMessage,this));this.element.on("click","._cnCloseRegionFollowRemoveTooltip",$.proxy(this.closeRegionFollowRemoveMessage, this));this.element.on("click","._cnCctvBtn",$.proxy(this.enableCctv,this));this.element.on("click","._cnCctvClose",$.proxy(this.closeCctv,this));this.element.on("click",".type_poi",$.proxy(this.clickOpenLsurRegionList, this));this.element.on("click","._cnSidoToggle",$.proxy(this.clickToggleSido,this));this.bindOutsideCloseLsurRegionList()}}, {key:"bindOutsideCloseLsurRegionList",value:function bindOutsideCloseLsurRegionList(){var _this$templateInfo$in2,_this$templateInfo2,_this5=this;var namespace="click.selectedRegionOutside".concat((_this$templateInfo$in2= (_this$templateInfo2=this.templateInfo)===null||_this$templateInfo2===void 0?void 0:_this$templateInfo2.index)!==null&&_this$templateInfo$in2!==void 0?_this$templateInfo$in2:"");var $sheet=this.element.find("._cnRegionBottomSheet"); if(!$sheet.length){$(document).off(namespace);return}$(document).off(namespace).on(namespace,function(e){var _this5$bottomSheet;if(!((_this5$bottomSheet=_this5.bottomSheet)===null||_this5$bottomSheet=== void 0?void 0:_this5$bottomSheet.isOpen))return;if($(e.target).closest("._cnRegionBottomSheetOpen").length||$(e.target).closest($sheet).length)return;_this5.bottomSheet.close()})}}, {key:"clickOpenLsurRegionList",value:function clickOpenLsurRegionList(e){var currentTarget=$(e.currentTarget);var isOpen=currentTarget.attr("aria-pressed")==="true";this.bottomSheet.toggle();currentTarget.attr("aria-pressed", !isOpen)}}, {key:"clickToggleSido",value:function clickToggleSido(e){e.stopPropagation();var $btn=$(e.currentTarget);var isOpen=$btn.attr("aria-pressed")==="true";$btn.attr("aria-pressed",!isOpen);if(!isOpen)setTimeout(function(){var $fold= $btn.next(".location_list_fold");var firstItem=$fold.find(".location_list_item").first()[0];if(!firstItem)return;var scrollContainer=$btn.closest(".bottom_sheet_content")[0];if(!scrollContainer)return; var containerRect=scrollContainer.getBoundingClientRect();var itemRect=firstItem.getBoundingClientRect();if(itemRect.topcontainerRect.bottom){var btnTop=$btn[0].getBoundingClientRect().top- containerRect.top+scrollContainer.scrollTop;scrollContainer.scrollTo({top:btnTop,behavior:"smooth"})}},80)}}, {key:"clickCloseLsurRegionList",value:function clickCloseLsurRegionList(e){var _this6=this;if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc")this.element.find("._cnRegionBottomSheetOpen").attr("aria-pressed", "false");else setTimeout(function(){return _this6.element.find("._cnRegionBottomSheetOpen").attr("aria-pressed","false")},300)}}, {key:"enableCctv",value:function enableCctv(e){if(e)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"cctvbut"));this.cctvService.fnGetCctv(this.templateData.cctv.matrix+"");this.element.find("._cnCctvBtn").attr("aria-pressed", "true")}}, {key:"closeCctv",value:function closeCctv(e){this.element.find("._cnCctvBtn").attr("aria-pressed","false")}}, {key:"clickToggleRegionFollow",value:function clickToggleRegionFollow(e){var _this7=this;if(!isLogin){oPopup.showRegionFollowLoginPopup(location.href);return}var $target=$(e.currentTarget);var regionName= $target.data("regionName");var targetRegionCode=$target.data("regionCode");var updateAllButtonsWithSameRegionCode=function updateAllButtonsWithSameRegionCode(regionCode,ariaPressedValue){$('button[data-region-code\x3d"'.concat(regionCode, '"]')).attr("aria-pressed",ariaPressedValue)}; if($target.attr("aria-pressed")==="false")oFollow.ajaxRegionFollow(targetRegionCode,function(data){if(data==="MAX"){_this7.showRegionFollowMaxTooltip($target.closest(".location_poi_list").length>0);return}var ariaSelected= sRegionCode===targetRegionCode?"true":"false";updateAllButtonsWithSameRegionCode(targetRegionCode,"true");if($(".current_list_inner a[data-region-code\x3d".concat(targetRegionCode,"]")).length===0){var previewPath= isBlockPreview?"/preview":"";var path="".concat(previewPath,"/today/").concat(targetRegionCode);var html='\n \x3ca href\x3d"'.concat(path,'" class\x3d"current_list_item type_basic" data-region-code\x3d"').concat(targetRegionCode, '" aria-selected\x3d"').concat(ariaSelected,'" data-nlog-area\x3d"region_follow_list.scroll.region_link" data-nlog-params\x3d\'{"region_id":"').concat(targetRegionCode,"\"}'\x3e").concat(data,"\x3c/a\x3e\n "); $(".current_list_inner span.current_list_item").before(html);if(oCommon.oScroll["regionFollow"])oCommon.refreshScroll("regionFollow");else oCommon.initScroll($(".current_area .scroll_area"));oCommon.scrollToItem("regionFollow", "data-region-code",targetRegionCode,8);_this7.showRegionFollowAddTooltip(regionName,$target.closest(".location_poi_list").length>0)}}); else if($target.attr("aria-pressed")==="true")oFollow.ajaxRegionUnFollow(targetRegionCode,function(data){updateAllButtonsWithSameRegionCode(targetRegionCode,"false");$target.attr("aria-pressed","false"); $(".current_list_inner a[data-region-code\x3d".concat(targetRegionCode,"]")).remove();if(oCommon.oScroll["regionFollow"])oCommon.refreshScroll("regionFollow");oCommon.controlScrollButton(oCommon.oScroll["regionFollow"], oCommon.scrollElements["regionFollow"]);_this7.showRegionFollowRemoveTooltip(regionName,$target.closest(".location_poi_list").length>0)}); $target.attr("disabled",true);setTimeout(function(){$target.attr("disabled",false);$target.siblings("span.location_interest_tooltip").attr("tabindex",-1)},3E3)}}, {key:"updateRegionFollow",value:function updateRegionFollow(followings,changedType){var channels=followings.channels;var index=channels.findIndex(function(channel){return channel.id===sRegionCode}); var element=this.element.find(".location_interest_button");if(index>-1)element.attr("aria-label","\uad00\uc2ec\uc9c0\uc5ed \uc0ad\uc81c");else element.attr("aria-label","\uad00\uc2ec\uc9c0\uc5ed \ucd94\uac00")}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return!_.isEmpty(this.templateData.naverRegion)||!_.isEmpty(this.templateData.overseasRegion)||!_.isEmpty(this.templateData.lsurRegion)}}, {key:"showRegionFollowMaxTooltip",value:function showRegionFollowMaxTooltip(isToast){this.closeRegionFollowMaxMessage();var previewUrl=isBlockPreview?"/preview":"";var message="\ucd5c\ub300 10\uac1c\uae4c\uc9c0 \ub4f1\ub85d \uac00\ub2a5\ud569\ub2c8\ub2e4."; if(isToast){var element=$("._cnCommonToast .common_text_inner").html(message);oToast.toast(function(){return $("._cnCommonToast").removeClass("hide")},function(){return $("._cnCommonToast").addClass("hide")}, 3E3)}else{var html='\n \x3cspan class\x3d"location_interest_tooltip is-hidden _cnRegionFollowMaxTooltip" tabindex\x3d"0" role\x3d"alert"\x3e\n \x3cspan class\x3d"location_tooltip_text"\x3e\n \x3cspan class\x3d"location_text_inner"\x3e\n '.concat(message, '\n \x3c/span\x3e\n \n \x3ca href\x3d"').concat(previewUrl,'/subscribe" class\x3d"location_text_link type_more _cnGoRegionFollowConfig" data-nlog\x3d"config" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'followset\')" data-nlog-area\x3d"selected_region.layer.config_link"\x3e\uc9c0\uc5ed\uc124\uc815\x3c/a\x3e\n \x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"location_tooltip_button _cnCloseRegionFollowMaxTooltip" aria-label\x3d"\ub2eb\uae30" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'maxtooltip\')" data-type\x3d"max" data-nlog-area\x3d"selected_region.layer.close_button" data-nlog-params\x3d\'{"category":"max"}\'\x3e\x3c/button\x3e\n \x3c/span\x3e\n '); this.element.find(".location_area_interest").find("._cnRegionFollowMaxTooltip").remove();this.element.find(".location_area_interest").append(html);this.element.find(".location_area_interest").find("._cnRegionFollowMaxTooltip").focus()}}}, {key:"showRegionFollowAddTooltip",value:function showRegionFollowAddTooltip(regionName,isToast){this.closeRegionFollowAddMessage();if(isToast){var element=$("._cnCommonToast .common_text_inner").html('\n \x3cstrong class\x3d"common_text_emphasis"\x3e'.concat(regionName, "\x3c/strong\x3e\uc774(\uac00) \uad00\uc2ec\uc9c0\uc5ed\uc73c\ub85c \ucd94\uac00\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n "));oToast.toast(function(){return $("._cnCommonToast").removeClass("hide")}, function(){return $("._cnCommonToast").addClass("hide")},3E3)}else{var html='\n \x3cspan class\x3d"location_interest_tooltip is-hidden _cnRegionFollowAddTooltip" tabindex\x3d"0" role\x3d"alert"\x3e\n \x3cspan class\x3d"location_tooltip_text"\x3e\n \x3cspan class\x3d"location_text_inner"\x3e\n \x3cem class\x3d"location_text_emphasis"\x3e\uad00\uc2ec\uc9c0\uc5ed\x3c/em\x3e\uc774 \ucd94\uac00\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n \x3c/span\x3e\n \x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"location_tooltip_button _cnCloseRegionFollowAddTooltip" aria-label\x3d"\ub2eb\uae30" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'complete\')" data-type\x3d"add" data-nlog-area\x3d"selected_region.layer.close_button" data-nlog-params\x3d\'{"category":"add"}\'\x3e\x3c/button\x3e\n \x3c/span\x3e\n '); this.element.find(".location_area_interest").find("._cnRegionFollowAddTooltip").remove();this.element.find(".location_area_interest").append(html);this.element.find(".location_area_interest").find("._cnRegionFollowAddTooltip").focus()}}}, {key:"showRegionFollowRemoveTooltip",value:function showRegionFollowRemoveTooltip(regionName,isToast){this.closeRegionFollowRemoveMessage();if(isToast){var element=$("._cnCommonToast .common_text_inner").html('\n \x3cstrong class\x3d"common_text_emphasis"\x3e'.concat(regionName, "\x3c/strong\x3e\uc774(\uac00) \uad00\uc2ec\uc9c0\uc5ed\uc5d0\uc11c \uc0ad\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n "));oToast.toast(function(){return $("._cnCommonToast").removeClass("hide")}, function(){return $("._cnCommonToast").addClass("hide")},3E3)}else{var html='\n \x3cspan class\x3d"location_interest_tooltip is-hidden _cnRegionFollowRemoveTooltip" tabindex\x3d"0" role\x3d"alert"\x3e\n \x3cspan class\x3d"location_tooltip_text"\x3e\n \x3cspan class\x3d"location_text_inner"\x3e\n \x3cem class\x3d"location_text_emphasis"\x3e\uad00\uc2ec\uc9c0\uc5ed\x3c/em\x3e\uc774 \uc0ad\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n \x3c/span\x3e\n \x3c/span\x3e\n \x3cbutton type\x3d"button" class\x3d"location_tooltip_button _cnCloseRegionFollowRemoveTooltip" aria-label\x3d"\ub2eb\uae30" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'delcomplete\')" data-type\x3d"remove" data-nlog-area\x3d"selected_region.layer.close_button" data-nlog-params\x3d\'{"category":"remove"}\'\x3e\x3c/button\x3e\n \x3c/span\x3e\n '); this.element.find(".location_area_interest").find("._cnRegionFollowRemoveTooltip").remove();this.element.find(".location_area_interest").append(html);this.element.find(".location_area_interest").find("._cnRegionFollowRemoveTooltip").focus()}}}, {key:"closeRegionFollowMaxMessage",value:function closeRegionFollowMaxMessage(){this.element.find("._cnRegionFollowMaxTooltip").remove();oToast.hide()}}, {key:"closeRegionFollowAddMessage",value:function closeRegionFollowAddMessage(){this.element.find("._cnRegionFollowAddTooltip").remove();oToast.hide()}}, {key:"closeRegionFollowRemoveMessage",value:function closeRegionFollowRemoveMessage(){this.element.find("._cnRegionFollowRemoveTooltip").remove();oToast.hide()}}, {key:"initLocation",value:function initLocation(){var _oBlockScriptService$;var element=this.element.find("._cnBtnLocation");var path=((_oBlockScriptService$=oBlockScriptService.getGnbInfoByPageId(basePageId))=== null||_oBlockScriptService$===void 0?void 0:_oBlockScriptService$.url)||"/today";element.attr("data-path",path.replace("/",""))}}, {key:"showDangerIcon",value:function showDangerIcon(){this.element.find("._cnDangerIcon").removeClass("hide")}}, {key:"hideDangerIcon",value:function hideDangerIcon(){this.element.find("._cnDangerIcon").addClass("hide")}}]); return selectedRegion}(BlockTemplate); _defineProperty(selectedRegion,"SIDO_MAP",{"01":"\uac15\uc6d0","02":"\uacbd\uae30","03":"\uacbd\ub0a8","04":"\uacbd\ubd81",18:"\uc804\ub0a8\uad11\uc8fc","06":"\ub300\uad6c","07":"\ub300\uc804","08":"\ubd80\uc0b0", "09":"\uc11c\uc6b8",10:"\uc6b8\uc0b0",11:"\uc778\ucc9c",13:"\uc804\ubd81",14:"\uc81c\uc8fc",15:"\ucda9\ub0a8",16:"\ucda9\ubd81",17:"\uc138\uc885"}); _defineProperty(selectedRegion,"SIDO_ORDER",["\uc11c\uc6b8","\ubd80\uc0b0","\ub300\uad6c","\uc778\ucc9c","\uc804\ub0a8\uad11\uc8fc","\ub300\uc804","\uc6b8\uc0b0","\uc138\uc885","\uacbd\uae30","\uac15\uc6d0", "\ucda9\ubd81","\ucda9\ub0a8","\uc804\ubd81","\uacbd\ubd81","\uacbd\ub0a8","\uc81c\uc8fc"]);_defineProperty(selectedRegion,"GROUPED_LAYOUT_MIN_COUNT",100); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0}}]); return sliderImagePlay}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0||(((_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:_this$templateData2.disasterSmsList)||[]).length>0}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".talk_alert_sms",$.proxy(this.clickDisasterSmsFold,this))}}, {key:"render",value:function render(data){this.warnRollingIndex=0;var warn=!this.setDisasterSms(data===null||data===void 0?void 0:data.disasterSmsList);if(warn)this.setWarn(data===null||data===void 0?void 0: data.warnList)}}, {key:"setDisasterSms",value:function setDisasterSms(data){var min=moment().utc().add(540,"minutes").subtract(15,"minutes").format("YYYYMMDDHHmmss");var disasterSmsList=(data||[]).filter(function(sms){return(sms=== null||sms===void 0?void 0:sms.content)&&(sms===null||sms===void 0?void 0:sms.daNm)&&(sms===null||sms===void 0?void 0:sms.govNm)&&(sms===null||sms===void 0?void 0:sms.regDate)}).filter(function(sms){return moment(sms.regDate, "YYYY-MM-DD HH:mm:ss").format("YYYYMMDDHHmmss")>=min}).sort(function(first,second){return second.regDate.localeCompare(first.regDate)}); if(disasterSmsList.length<=0)return false;this.element.removeClass("hide");var disasterSms=disasterSmsList[0];var regTime=moment(disasterSms.regDate,"YYYY-MM-DD HH:mm:ss").format("HH:mm");var html='\n \x3ca href\x3d"#" class\x3d"talk_alert_sms is-fold" data-nlog\x3d"sms_fold" data-nlog-area\x3d"slim_warning.sms_fold_link"\x3e\n \x3cdiv class\x3d"talk_sms_type"\x3e\n \x3cstrong class\x3d"talk_type_title '.concat((disasterSms=== null||disasterSms===void 0?void 0:disasterSms.enName)||"",'"\x3e').concat(disasterSms.daNm,'\x3c/strong\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"talk_sms_content"\x3e\n \x3cdl class\x3d"talk_content_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\n \x3cem class\x3d"talk_title_text type_case"\x3e\uae34\uae09 \uc7ac\ub09c \ubb38\uc790\x3c/em\x3e\n\n \x3cspan class\x3d"talk_title_text type_agency"\x3e').concat(regTime, " ").concat(disasterSms.govNm,'\x3c/span\x3e\n \x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n ').concat(disasterSms.content,'\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n\n \x3cspan class\x3d"talk_sms_button type_fold"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/span\x3e\n \x3c/a\x3e\n '); this.element.html("").html(html);return true}}, {key:"setWarn",value:function setWarn(data){if(this.lastInterval)clearInterval(this.lastInterval);var warnList=(data||[]).filter(function(warn){return(warn===null||warn===void 0?void 0:warn.reportTime)&& (warn===null||warn===void 0?void 0:warn.stype)&&(warn===null||warn===void 0?void 0:warn.stypeEnNm)&&(warn===null||warn===void 0?void 0:warn.stypeNm)&&(warn===null||warn===void 0?void 0:warn.sgrade)}).sort(function(first, second){if(first.stype===second.stype)return second.reportTime.localeCompare(first.reportTime); else return second.stype.localeCompare(first.stype)}); if(warnList.length<=0){this.element.html("").addClass("hide");return}this.element.removeClass("hide");var _this=this;var now=moment().utc().add(540,"minutes");var html="";for(var index in warnList){var warn= warnList[index];var warnClass=(warn===null||warn===void 0?void 0:warn.stypeEnNm)||"";var warnNm=(warn===null||warn===void 0?void 0:warn.stypeNm)||"";var warnGrade=(warn===null||warn===void 0?void 0:warn.sgrade)|| "";var reportTime=(warn===null||warn===void 0?void 0:warn.reportTime)||"";var ingText=now.format("YYYYMMDDHHmmss")>=reportTime?"\uc911":"\uc608\uc815";var previewPath=isBlockPreview?"/preview":"";html+= '\n \x3ca href\x3d"'.concat(previewPath,"/warning/").concat(sRegionCode,"?warnType\x3d").concat(warnClass,'" class\x3d"talk_alert_inner" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'warnmore\')" data-warning-type\x3d"').concat(warnClass,'" data-nlog-area\x3d"slim_warning.warning_link" data-nlog-params\x3d\'{"warn_type":"').concat(warnClass,'"}\'\x3e\n \x3cdiv class\x3d"talk_alert_icon" aria-hidden\x3d"true"\x3e\n \x3cspan class\x3d"talk_icon_image ').concat(warnClass, '" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \n \x3cdiv class\x3d"talk_alert_data"\x3e\n \x3cstrong class\x3d"talk_data_title"\x3e').concat(warnNm).concat(oCommon.fnGetWarnGradeNm(warnGrade), " \ubc1c\ud6a8 ").concat(ingText,'\x3c/strong\x3e\n \x3cspan class\x3d"talk_data_date"\x3e').concat(moment(reportTime,"YYYYMMDDHHmmss").format("MM.DD. HH:mm")," \uc774\ud6c4\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n ")}this.element.html("").html(html); var rollingWarn=function rollingWarn(){$(_this.element.children()[_this.warnRollingIndex]).removeClass("is-active");_this.warnRollingIndex=++_this.warnRollingIndex%warnList.length;$(_this.element.children()[_this.warnRollingIndex]).addClass("is-active")}; rollingWarn();if(warnList.length>1)this.lastInterval=setInterval(function(){if(_this.element.is(":visible"))rollingWarn()},3E3)}}, {key:"clickDisasterSmsFold",value:function clickDisasterSmsFold(e){e.preventDefault();var $current=$(e.currentTarget);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"warnfold")); $current.toggleClass("is-fold")}}]); return slimWarn}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0){var scrollName=this.element.find(".scroll_area").data("name"); var $todayGame=$container.find("._today_future_game").first();if($todayGame.length>0&&oCommon.oScroll[scrollName])oCommon.scrollToCell(scrollName,$todayGame[0],0)}}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resetScroll()}}, {key:"render",value:function render(){var _this$templateData,_this=this;var lsurRgnCd=(_this$templateData=this.templateData)===null||_this$templateData===void 0?void 0:_this$templateData.lsurRgnCd;var lsurType= lsurRgnCd?lsurRgnCd.substring(2,4):"";var lsurTypeKor=oCodeUtil.getLsurTypeKor(lsurType)||"";if(lsurTypeKor)this.element.find("._sportsGamesFcastTitle").text(lsurTypeKor+" \uc77c\uc815");var today=moment().utc().add(540, "minutes");var now=moment();var bestTodayGame={index:-1,priority:Infinity,timeDiff:Infinity};var gameContent="";this.templateData.sportsGamesFcastList.forEach(function(item,index){var firstTeam="";var firstTeamEmblemImageUrl= "";var firstTeamScore=null;var secondTeam="";var secondTeamEmblemImageUrl="";var secondTeamScore=null;if(item.reversedHomeAway===true){firstTeam=item.awayTeamName;firstTeamEmblemImageUrl=item.awayTeamEmblemUrl; firstTeamScore=item.awayTeamScore;secondTeam=item.homeTeamName;secondTeamEmblemImageUrl=item.homeTeamEmblemUrl;secondTeamScore=item.homeTeamScore}else{firstTeam=item.homeTeamName;firstTeamEmblemImageUrl= item.homeTeamEmblemUrl;firstTeamScore=item.homeTeamScore;secondTeam=item.awayTeamName;secondTeamEmblemImageUrl=item.awayTeamEmblemUrl;secondTeamScore=item.awayTeamScore}var gameStatus="";var gameStatusIcon= "";if(item.statusCode==="BEFORE"&&item.cancel===true)gameStatus="\ucde8\uc18c";else if(item.statusCode==="ENDED"||item.statusCode==="RESULT")gameStatus="\uc885\ub8cc";if(gameStatus!=="")gameStatusIcon= '\n \x3cem class\x3d"card_head_exception"\x3e'.concat(gameStatus,"\x3c/em\x3e\n ");var gameDatetime=moment(item.gameDateTime);var wetrIcon="";var gameUrl="";var isTodayOrFutureGame= today.isSameOrBefore(gameDatetime,"day");var hasScore=firstTeamScore!=null&&secondTeamScore!=null;var isGameStartedOrEnded=item.statusCode==="STARTED"||item.statusCode==="ENDED"||item.statusCode==="RESULT"; var showScore=hasScore&&(!isTodayOrFutureGame||isGameStartedOrEnded);if(today.isSame(gameDatetime,"day")){var priority;if(item.statusCode==="STARTED")priority=1;else if((item.statusCode==="BEFORE"||item.statusCode=== "READY")&&item.cancel!==true)priority=2;else priority=3;var timeDiff=Math.abs(now.diff(gameDatetime,"minutes"));if(priority=0)this.element.find("._sportsGamesFcast .card_slide_item").eq(bestTodayGame.index).addClass("type_today")}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"isEnableTemplate",value:function isEnableTemplate(){var _this$templateData2,_this$templateData2$s;return((_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:(_this$templateData2$s= _this$templateData2.sportsGamesFcastList)===null||_this$templateData2$s===void 0?void 0:_this$templateData2$s.length)>2}}]); return sportsGamesFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;inowDay.format("YYYYMMDDHH")}).forEach(function(element, index){var innerHtml=""; if(element.apmYmd===oneDayAfter&&element.aplTm==="00")innerHtml='\x3cspan class\x3d"label"\x3e\ub0b4\uc77c\x3c/span\x3e';else innerHtml=moment(element.aplTm,"hh").format("H\uc2dc");var tmpr=oCommon.fnMathRound(element.tmpr, false);if(index<6)html+='\n \x3cli class\x3d"today_item"\x3e\n \x3cdiv class\x3d"day"\x3e'.concat(innerHtml,'\x3c/div\x3e\n \x3cdiv class\x3d"weather"\x3e\n \x3ci class\x3d"ico _cnLazy" data-ico\x3d"ico_wt').concat(element.wetrCd, '" data-tooltip\x3d"').concat(element.wetrTxt,'"\x3e\x3c/i\x3e\n \x3cspan class\x3d"blind"\x3e').concat(element.wetrTxt,'\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"degree"\x3e').concat(tmpr, "\u00b0\x3c/div\x3e\n \x3c/li\x3e\n ")}); this.element.find(".today_list").html(html);this.element.find(".dust_area").attr("href","/air/".concat(this.templateData.naverRgnCd));this.element.find(".card_link").attr("href","/today/".concat(this.templateData.naverRgnCd))}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return _typeof(this.templateData)==="object"&&Object.keys(this.templateData).length>0}}]); return subNowFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)return"\uc57d".concat(hour,"\uc2dc\uac04 ").concat(String(min).padStart(2,"0"),"\ubd84"); return"\uc57d".concat(min,"\ubd84")}}, {key:"getLeisureIconClass",value:function getLeisureIconClass(){var lsurTypeKey=oCodeUtil.getLsurTypeKey(sRegionCode);return this.LSUR_ICON_MAP[lsurTypeKey]||null}}, {key:"isEnableTemplate",value:function isEnableTemplate(){var _this$templateData$tz,_this$templateData2,_this$templateData3,_this$templateData3$s,_this$templateData4,_this$templateData4$s,_this$templateData5, _this$templateData5$s,_this$templateData5$s2;this.tzMin=(_this$templateData$tz=(_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:_this$templateData2.tzMin)!==null&&_this$templateData$tz!== void 0?_this$templateData$tz:this.DEFAULT_TZ_MIN;var nowLocal=moment().utcOffset(this.tzMin);this.todayYmd=nowLocal.format(this.DATE_FORMAT_YYYYMMDD);this.tomorrowYmd=moment().utcOffset(this.tzMin).add(1, "days").format(this.DATE_FORMAT_YYYYMMDD);return!_.isEmpty((_this$templateData3=this.templateData)===null||_this$templateData3===void 0?void 0:(_this$templateData3$s=_this$templateData3.sunRiseSetList)=== null||_this$templateData3$s===void 0?void 0:_this$templateData3$s[0])&&this.isValidRiseSetData((_this$templateData4=this.templateData)===null||_this$templateData4===void 0?void 0:(_this$templateData4$s= _this$templateData4.sunRiseSetList)===null||_this$templateData4$s===void 0?void 0:_this$templateData4$s[0])&&((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:(_this$templateData5$s= _this$templateData5.sunRiseSetList)===null||_this$templateData5$s===void 0?void 0:(_this$templateData5$s2=_this$templateData5$s[0])===null||_this$templateData5$s2===void 0?void 0:_this$templateData5$s2.aplYmd)=== this.todayYmd}}, {key:"isValidRiseSetData",value:function isValidRiseSetData(target){return!_.isEmpty(target===null||target===void 0?void 0:target.aplYmd)&&!_.isEmpty(target===null||target===void 0?void 0:target.sriseTm)&& !_.isEmpty(target===null||target===void 0?void 0:target.ssetTm)}}]); return sunRiseSetWide}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i 0)return;var sarea=((_this$templateData2=this.templateData)===null||_this$templateData2===void 0?void 0:_this$templateData2.sareaNm)||"";var wetrTxt=((_this$templateData3=this.templateData)===null||_this$templateData3=== void 0?void 0:(_this$templateData3$n=_this$templateData3.nowFcast)===null||_this$templateData3$n===void 0?void 0:_this$templateData3$n.wetrTxt)||"";var wetrCd=((_this$templateData4=this.templateData)=== null||_this$templateData4===void 0?void 0:(_this$templateData4$n=_this$templateData4.nowFcast)===null||_this$templateData4$n===void 0?void 0:_this$templateData4$n.wetrCd)||"";var tmpr=(_this$templateData5= this.templateData)===null||_this$templateData5===void 0?void 0:(_this$templateData5$n=_this$templateData5.nowFcast)===null||_this$templateData5$n===void 0?void 0:_this$templateData5$n.tmpr;var stmpr=(_this$templateData6= this.templateData)===null||_this$templateData6===void 0?void 0:(_this$templateData6$n=_this$templateData6.nowFcast)===null||_this$templateData6$n===void 0?void 0:_this$templateData6$n.stmpr;var rainAmt= (_this$templateData7=this.templateData)===null||_this$templateData7===void 0?void 0:(_this$templateData7$n=_this$templateData7.nowFcast)===null||_this$templateData7$n===void 0?void 0:_this$templateData7$n.rainAmt; var snowAmt=(_this$templateData8=this.templateData)===null||_this$templateData8===void 0?void 0:(_this$templateData8$n=_this$templateData8.nowFcast)===null||_this$templateData8$n===void 0?void 0:_this$templateData8$n.snowAmt; var humd=(_this$templateData9=this.templateData)===null||_this$templateData9===void 0?void 0:(_this$templateData9$n=_this$templateData9.nowFcast)===null||_this$templateData9$n===void 0?void 0:_this$templateData9$n.humd; var windDrctn=((_this$templateData0=this.templateData)===null||_this$templateData0===void 0?void 0:(_this$templateData0$n=_this$templateData0.nowFcast)===null||_this$templateData0$n===void 0?void 0:_this$templateData0$n.windDrctn)|| "";var windSpd=(_this$templateData1=this.templateData)===null||_this$templateData1===void 0?void 0:(_this$templateData1$n=_this$templateData1.nowFcast)===null||_this$templateData1$n===void 0?void 0:_this$templateData1$n.windSpd; var pm10Legend=((_this$templateData10=this.templateData)===null||_this$templateData10===void 0?void 0:(_this$templateData10$=_this$templateData10.airFcast)===null||_this$templateData10$===void 0?void 0: _this$templateData10$.stationPm10Legend)||"-";var pm25Legend=((_this$templateData11=this.templateData)===null||_this$templateData11===void 0?void 0:(_this$templateData11$=_this$templateData11.airFcast)=== null||_this$templateData11$===void 0?void 0:_this$templateData11$.stationPm25Legend)||"-";var pm10Level=pm10Legend==="-"?"level4_none":(_this$templateData12=this.templateData)===null||_this$templateData12=== void 0?void 0:(_this$templateData12$=_this$templateData12.airFcast)===null||_this$templateData12$===void 0?void 0:_this$templateData12$.stationPm10LevelClass;var pm25Level=pm25Legend==="-"?"level4_none": (_this$templateData13=this.templateData)===null||_this$templateData13===void 0?void 0:(_this$templateData13$=_this$templateData13.airFcast)===null||_this$templateData13$===void 0?void 0:_this$templateData13$.stationPm25LevelClass; var tmprHtml=!isNaN(Number(tmpr))?tmpr+"\u00b0":"-";var stmprHtml=!isNaN(Number(stmpr))?stmpr+"\u00b0":"-";var rainAmtNumber=Number(rainAmt);var snowAmtNumber=Number(snowAmt);var rainHtml=rainAmtNumber> 0||(rainAmt+"").indexOf("~")>-1?"".concat(rainAmt,'\x3cspan class\x3d"talk_emphasis_unit"\x3emm\x3c/span\x3e'):"-";var snowAmtHtml=snowAmtNumber>0||(snowAmt+"").indexOf("~")>-1?"".concat(snowAmt,'\x3cspan class\x3d"talk_emphasis_unit"\x3ecm\x3c/span\x3e'): "-";var humdHtml=!isNaN(Number(humd))?humd+'\x3cspan class\x3d"talk_emphasis_unit"\x3e%\x3c/span\x3e':"-";var windDrctnHtml=this.windDrctnInfo[windDrctn]||"";var windSpdHtml=!isNaN(Number(windSpd))?windSpd+ '\x3cspan class\x3d"talk_emphasis_unit"\x3em/s\x3c/span\x3e':"-";var rainSnowHtml="";if(rainHtml!=="-")rainSnowHtml='\n \x3cdl class\x3d"talk_state_data"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\uac15\uc218\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis"\x3e'.concat(rainHtml, "\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n ");if(snowAmtHtml!=="-")rainSnowHtml='\n \x3cdl class\x3d"talk_state_data"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\uc801\uc124\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis"\x3e'.concat(snowAmtHtml, "\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n ");var html='\n \x3cdiv class\x3d"talk_slide_item type_current"\x3e\n \x3cdiv class\x3d"talk_item_icon" aria-hidden\x3d"true"\x3e\n \x3cdiv class\x3d"talk_icon_image ico_wt'.concat(wetrCd, '"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_item_data"\x3e\n \x3cdiv class\x3d"talk_data_local"\x3e\n \x3cem class\x3d"talk_local_temperature"\x3e').concat(tmprHtml, '\x3c/em\x3e\n \x3cspan class\x3d"talk_local_city"\x3e').concat(sarea," ").concat(wetrTxt,'\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_data_state"\x3e\n \x3cdl class\x3d"talk_state_data type_air"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis ').concat(pm10Level, '"\x3e').concat(pm10Legend,'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_state_data type_dust"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\ucd08\ubbf8\uc138\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis ').concat(pm25Level, '"\x3e').concat(pm25Legend,'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_state_data"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\uccb4\uac10\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis"\x3e').concat(stmprHtml, "\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n ").concat(rainSnowHtml,'\n\n \x3cdl class\x3d"talk_state_data"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e\uc2b5\ub3c4\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis"\x3e').concat(humdHtml, '\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"talk_state_data"\x3e\n \x3cdt class\x3d"talk_data_title"\x3e').concat(windDrctnHtml, '\x3c/dt\x3e\n \x3cdd class\x3d"talk_data_cell"\x3e\n \x3cem class\x3d"talk_cell_emphasis"\x3e').concat(windSpdHtml,'\x3c/em\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"talk_item_button type_fold" data-tab-name\x3d"weather" data-nlog-area\x3d"talk_extra_info.scroll.fold_button" data-nlog-params\x3d\'{"tab":"weather"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e'); this.element.find("._cnTalkExtraInfoItem").append(html);this.element.find(".tab_list").append(' \x3ca href\x3d"#" class\x3d"tab_link" data-tab-name\x3d"weather" data-nlog-area\x3d"talk_extra_info.scroll.tab_link" data-nlog-params\x3d\'{"tab":"weather"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub0a0\uc528\x3c/span\x3e\x3c/a\x3e')}}, {key:"setDisasterSms",value:function setDisasterSms(){var _this$templateData14;if(this.element.find(".type_sms").length>0)return;var _this=this;var disasterSmsList=(((_this$templateData14=this.templateData)=== null||_this$templateData14===void 0?void 0:_this$templateData14.disasterSmsList)||[]).filter(function(disasterSms){return(disasterSms===null||disasterSms===void 0?void 0:disasterSms.daNm)&&(disasterSms=== null||disasterSms===void 0?void 0:disasterSms.enName)&&(disasterSms===null||disasterSms===void 0?void 0:disasterSms.content)}).sort(function(first,second){return second.regDate.localeCompare(first.regDate)}); if(disasterSmsList.length<=0)return;var html='\n \x3cdiv class\x3d"talk_slide_item type_sms"\x3e\n \x3cdiv class\x3d"talk_item_type"\x3e\n \x3cstrong class\x3d"talk_type_title"\x3e\x3c/strong\x3e\n \x3c/div\x3e\n\n \x3cdiv class\x3d"talk_item_content"\x3e\n \x3cdl class\x3d"talk_content_description"\x3e\n \x3cdt class\x3d"talk_description_title"\x3e\n \x3cem class\x3d"talk_title_text type_case"\x3e\uae34\uae09\uc7ac\ub09c\ubb38\uc790\x3c/em\x3e\n\n \x3cspan class\x3d"talk_title_text type_agency"\x3e\x3c/span\x3e\n \x3c/dt\x3e\n \x3cdd class\x3d"talk_description_data"\x3e\n \x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n\n \x3cbutton type\x3d"button" class\x3d"talk_item_button type_fold" data-tab-name\x3d"disaster_sms" data-nlog-area\x3d"talk_extra_info.scroll.fold_button" data-nlog-params\x3d\'{"tab":"disaster_sms"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n '; this.element.find("._cnTalkExtraInfoItem").append(html);this.element.find(".tab_list").append(' \x3ca href\x3d"#" class\x3d"tab_link" data-tab-name\x3d"disaster_sms" data-nlog-area\x3d"talk_extra_info.scroll.tab_link" data-nlog-params\x3d\'{"tab":"disaster_sms"}\'\x3e\x3cspan class\x3d"blind"\x3e\uc7ac\ub09c\ubb38\uc790\x3c/span\x3e\x3c/a\x3e'); var disasterSmsElement=this.element.find(".type_sms");var firstDisasterSms=disasterSmsList[0];var setDisasterValue=function setDisasterValue(disasterSms){var daNm=(disasterSms===null||disasterSms===void 0? void 0:disasterSms.daNm)||"";var enName=(disasterSms===null||disasterSms===void 0?void 0:disasterSms.enName)||"";var content=(disasterSms===null||disasterSms===void 0?void 0:disasterSms.content)||"";var regDate= (disasterSms===null||disasterSms===void 0?void 0:disasterSms.regDate)||"";var govNm=(disasterSms===null||disasterSms===void 0?void 0:disasterSms.govNm)||"";disasterSmsElement.find(".talk_type_title").html(daNm).removeClass().addClass("talk_type_title").addClass(enName); disasterSmsElement.find(".talk_title_text.type_agency").html("".concat(regDate.replaceAll("-",".")," ").concat(govNm));disasterSmsElement.find(".talk_description_data").html(content)}; setDisasterValue(disasterSmsList[0]);if(disasterSmsList.length>1)setInterval(function(){if(disasterSmsElement.is(":visible")){setDisasterValue(disasterSmsList[++_this.disasterSmsRollingIndex%disasterSmsList.length]); _this.setHeight()}},2E3)}}, {key:"setWarn",value:function setWarn(){var _this$templateData15;if(this.element.find(".type_warning").length>0)return;var warnList=(((_this$templateData15=this.templateData)===null||_this$templateData15=== void 0?void 0:_this$templateData15.warnList)||[]).filter(function(warn){return(warn===null||warn===void 0?void 0:warn.reportRTime)&&(warn===null||warn===void 0?void 0:warn.reportTime)&&(warn===null||warn=== void 0?void 0:warn.stype)&&(warn===null||warn===void 0?void 0:warn.stypeEnNm)&&(warn===null||warn===void 0?void 0:warn.stypeNm)&&(warn===null||warn===void 0?void 0:warn.sgrade)}).sort(function(first,second){if(first.stype=== second.stype)return second.reportTime.localeCompare(first.reportTime); else return second.stype.localeCompare(first.stype)}); if(warnList.length<=0)return;var _this=this;var html='\n \x3cdiv class\x3d"talk_slide_item type_warning"\x3e\n \x3cdiv class\x3d"talk_item_icon" aria-hidden\x3d"true"\x3e\n \x3cdiv class\x3d"talk_icon_image"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_item_data"\x3e\n \x3cdiv class\x3d"talk_data_local"\x3e\n \x3cem class\x3d"talk_local_temperature"\x3e\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_data_state"\x3e\n \x3cdiv class\x3d"talk_state_data"\x3e\n \x3cspan class\x3d"talk_data_item _cnReportRTime"\x3e\x3c/span\x3e\n \x3cspan class\x3d"talk_data_item _cnReportTime"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; this.element.find("._cnTalkExtraInfoItem").append(html);this.element.find(".tab_list").append(' \x3ca href\x3d"#" class\x3d"tab_link" data-tab-name\x3d"warning" data-nlog-area\x3d"talk_extra_info.scroll.tab_link" data-nlog-params\x3d\'{"tab":"warning"}\'\x3e\x3cspan class\x3d"blind"\x3e\uae30\uc0c1\ud2b9\ubcf4\x3c/span\x3e\x3c/a\x3e'); var now=moment().utc().add(540,"minutes");var $warnElement=this.element.find(".type_warning");var setWarnValue=function setWarnValue(warn){var warnClass=(warn===null||warn===void 0?void 0:warn.stypeEnNm)|| "";var warnNm=(warn===null||warn===void 0?void 0:warn.stypeNm)||"";var warnGrade=(warn===null||warn===void 0?void 0:warn.sgrade)||"";var reportTime=(warn===null||warn===void 0?void 0:warn.reportTime)|| "";var reportRTime=(warn===null||warn===void 0?void 0:warn.reportRTime)||"";var ingText=now.format("YYYYMMDDHHmmss")>=reportTime?"\uc911":"\uc608\uc815";$warnElement.find(".talk_icon_image").removeClass().addClass("talk_icon_image").addClass(warnClass); $warnElement.find(".talk_local_temperature").html("".concat(warnNm," ").concat(oCommon.fnGetWarnGradeNm(warnGrade)," \ubc1c\ud6a8 ").concat(ingText));$warnElement.find("._cnReportRTime").html("\ubc1c\ud45c ".concat(moment(reportRTime, "YYYYMMDDHHmmss").format("YY.MM.DD. HH:mm")));$warnElement.find("._cnReportTime").html("\ubc1c\ud6a8 ".concat(moment(reportTime,"YYYYMMDDHHmmss").format("YY.MM.DD. HH:mm")," \uc774\ud6c4"))}; setWarnValue(warnList[0]);if(warnList.length>1)setInterval(function(){if($warnElement.is(":visible")){setWarnValue(warnList[++_this.warnRollingIndex%warnList.length]);_this.setHeight()}},2E3)}}, {key:"setScroll",value:function setScroll(){if(oCommon.oScroll["talkExtraInfo"])return;var _this=this;var elementCount=this.element.find("._cnTalkExtraInfoItem").children().length;var scrollEndCallback= function scrollEndCallback(name){_this.controlIndicator();_this.setHeight()}; var defaultCallback=function defaultCallback(name){}; this.controlIndicator();this.setHeight();if(elementCount>1)oCommon.initScroll(this.element.find(".scroll_area"),null,scrollEndCallback,defaultCallback)}}, {key:"getCurrentScrollIndex",value:function getCurrentScrollIndex(){var _oCommon,_oCommon$oScroll,_oCommon$oScroll$talk,_oCommon$oScroll$talk2;return((_oCommon=oCommon)===null||_oCommon===void 0?void 0: (_oCommon$oScroll=_oCommon.oScroll)===null||_oCommon$oScroll===void 0?void 0:(_oCommon$oScroll$talk=_oCommon$oScroll.talkExtraInfo)===null||_oCommon$oScroll$talk===void 0?void 0:(_oCommon$oScroll$talk2= _oCommon$oScroll$talk.currentPage)===null||_oCommon$oScroll$talk2===void 0?void 0:_oCommon$oScroll$talk2.pageX)||0}}, {key:"getCurrentScrollElement",value:function getCurrentScrollElement(){var $scrollElements=this.element.find(".talk_slide_inner").children();var index=this.getCurrentScrollIndex();var $currentScrollElement= null;if($scrollElements.length>index)$currentScrollElement=$($scrollElements[index]);return $currentScrollElement}}, {key:"setHeight",value:function setHeight(){var $currentScrollElement=this.getCurrentScrollElement();if($currentScrollElement)this.element.find(".scroll_area").css({"height":$currentScrollElement.outerHeight()+ 20})}}, {key:"clickFold",value:function clickFold(e){e.preventDefault();var $currentScrollElement=this.getCurrentScrollElement();$currentScrollElement.toggleClass("is-fold");this.setHeight()}}, {key:"clickTab",value:function clickTab(e){e.preventDefault();var clickTabIndex=$(e.currentTarget).index();var currentIndex=this.getCurrentScrollIndex();if(clickTabIndex!==currentIndex){oCommon.oScroll["talkExtraInfo"].goToPage(clickTabIndex, 0);this.controlIndicator()}}}, {key:"controlIndicator",value:function controlIndicator(){var index=this.getCurrentScrollIndex();var $indicator=this.element.find(".tab_list");$indicator.find(".on").removeClass("on");if($indicator.children().length> index)$($indicator.children()[index]).addClass("on")}}]); return talkExtraInfo}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i2&&arguments[2]!==undefined?arguments[2]:2;this.rollingIndex=0;var labelInfo=oBlockScriptService.callTemplateFunc("regionTalk", "getCurrentTalkLabelInfo")[0]||{};var lsurKor=labelInfo.lsurKor||null;var leisureName=labelInfo.leisureName||null;if(type==="nationFcast"){this.setNationFcastInfo(data);this.setRegionInfo({"lareaNm":lsurKor? "\uc804\uad6d ".concat(lsurKor):"\uc804\uad6d"})}else{this.setWeatherAirInfo(data===null||data===void 0?void 0:data.nowFcastInfo,data===null||data===void 0?void 0:data.airNowInfo,labelInfo);if(leisureName)this.setRegionInfo({"mareaNm":leisureName}); else if(level===2)this.setRegionInfo(data===null||data===void 0?void 0:data.regionInfo);else{var _data$regionInfo;var lareaNm=(data===null||data===void 0?void 0:(_data$regionInfo=data.regionInfo)===null|| _data$regionInfo===void 0?void 0:_data$regionInfo.lareaNm)||"";this.setRegionInfo({"lareaNm":lsurKor&&lareaNm?"".concat(lareaNm," ").concat(lsurKor):lareaNm})}}}}, {key:"setRegionInfo",value:function setRegionInfo(data){var mareaNm=(data===null||data===void 0?void 0:data.mareaNm)||"";var lareaNm=(data===null||data===void 0?void 0:data.lareaNm)||"";var regionName= mareaNm?mareaNm:lareaNm;var html='\n \x3cspan class\x3d"talk_region_name"\x3e'.concat(regionName||"\uc804\uad6d",'\x3c/span\x3e\n \x3cspan class\x3d"talk_region_title"\x3e\n \x3cspan class\x3d"talk_title_emphasis"\x3e\ub0a0\uc528\x3c/span\x3e \uc81c\ubcf4\ud1a1\n \x3c/span\x3e\n '); this.element.find(".talk_head_region").html("").html(html)}}, {key:"setWeatherAirInfo",value:function setWeatherAirInfo(wetrData,airData,labelInfo){if(this.lastInterval)clearInterval(this.lastInterval);var level=labelInfo&&labelInfo.level||"group";var mareaNm=(wetrData=== null||wetrData===void 0?void 0:wetrData.mareaNm)||"";var rawRegionName=(wetrData===null||wetrData===void 0?void 0:wetrData.regionName)||"";var regionName;if(level==="object")if(mareaNm&&rawRegionName)regionName= "".concat(mareaNm," ").concat(rawRegionName," \uae30\uc900");else if(rawRegionName)regionName="".concat(rawRegionName," \uae30\uc900");else regionName="";else if(level==="category")if(rawRegionName)regionName= "".concat(rawRegionName," \uae30\uc900");else regionName="";else regionName=rawRegionName;var wetrCd=(wetrData===null||wetrData===void 0?void 0:wetrData.wetrCd)||"";var tmpr=oCommon.fnGetNumberValueWithUnit(wetrData=== null||wetrData===void 0?void 0:wetrData.tmpr,"\u00b0");var windSpd=oCommon.fnGetNumberValueWithUnit(wetrData===null||wetrData===void 0?void 0:wetrData.windSpd,"m/s");var oneHourRainAmt=oCommon.fnGetNumberValueWithUnit(wetrData=== null||wetrData===void 0?void 0:wetrData.oneHourRainAmt);var pm10Legend=(airData===null||airData===void 0?void 0:airData.stationPm10Legend)||"\uc815\ubcf4 \uc5c6\uc74c";var pm25Legend=(airData===null||airData=== void 0?void 0:airData.stationPm25Legend)||"\uc815\ubcf4 \uc5c6\uc74c";var pm10Class=(airData===null||airData===void 0?void 0:airData.stationPm10LevelClass)||"";var pm25Class=(airData===null||airData=== void 0?void 0:airData.stationPm25LevelClass)||"";var _ref=oneHourRainAmt>0?{hideRainClass:"",rainAmt:oneHourRainAmt+"mm"}:{hideRainClass:"hide",rainAmt:oneHourRainAmt},hideRainClass=_ref.hideRainClass, rainAmt=_ref.rainAmt;var html='\n \x3cdiv class\x3d"talk_data_region"\x3e\n \x3cdiv class\x3d"talk_region_item is-active"\x3e\n \x3cstrong class\x3d"talk_item_title"\x3e'.concat(regionName, '\x3c/strong\x3e\n \n \x3cdiv class\x3d"talk_item_temperature"\x3e\n \x3cdiv class\x3d"talk_temperature_icon" aria-hidden\x3d"true"\x3e\n \x3cdiv class\x3d"talk_icon_image ico_wt').concat(wetrCd, '"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cem class\x3d"talk_temperature_title"\x3e').concat(tmpr,'\x3c/em\x3e\n \x3c/div\x3e\n \n \x3c/div\x3e\n \n \x3c/div\x3e\n \x3cdiv class\x3d"talk_data_dust"\x3e\n \x3cdiv class\x3d"talk_dust_list"\x3e\n \x3cdiv class\x3d"talk_dust_item"\x3e\n \x3cspan class\x3d"talk_item_title"\x3e\ubbf8\uc138\x3c/span\x3e\n \x3cem class\x3d"talk_item_text ').concat(pm10Class, '"\x3e').concat(pm10Legend,'\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_dust_item"\x3e\n \x3cspan class\x3d"talk_item_title"\x3e\ucd08\ubbf8\uc138\x3c/span\x3e\n \x3cem class\x3d"talk_item_text ').concat(pm25Class, '"\x3e').concat(pm25Legend,'\x3c/em\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_dust_list is-active"\x3e\n \x3cdiv class\x3d"talk_dust_item"\x3e\n \x3cspan class\x3d"talk_item_title"\x3e\ud48d\uc18d\x3c/span\x3e\n \x3cem class\x3d"talk_item_text"\x3e').concat(windSpd, '\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"talk_dust_item ').concat(hideRainClass,'"\x3e\n \x3cspan class\x3d"talk_item_title"\x3e\uac15\uc218\x3c/span\x3e\n \x3cem class\x3d"talk_item_text"\x3e').concat(rainAmt, "\x3c/em\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ");this.element.find(".talk_data_inner").html("").html(html);var _this=this;var rollingData=function rollingData(){$(_this.element.find(".talk_data_dust .talk_dust_list")[_this.rollingIndex]).removeClass("is-active"); _this.rollingIndex=++_this.rollingIndex%2;$(_this.element.find(".talk_data_dust .talk_dust_list")[_this.rollingIndex]).addClass("is-active")}; rollingData();this.lastInterval=setInterval(function(){if(_this.element.is(":visible"))rollingData()},3E3)}}, {key:"setNationFcastInfo",value:function setNationFcastInfo(data){if(this.lastInterval)clearInterval(this.lastInterval);var rollingSequence=["N09140104","N02113128","N01110675","N01150615","N16111120", "N07110101","N13113135","N18210101","N18110152","N18130127","N04170690","N06110101","N10110101","N08110580","N14130116","N11720330","N04940320"];var nationFcastMap=data||{};var html='\x3cdiv class\x3d"talk_data_region"\x3e'; for(var _i=0,_rollingSequence=rollingSequence;_i<_rollingSequence.length;_i++){var key=_rollingSequence[_i];var nationFcast=nationFcastMap[key];if(nationFcast&&(nationFcast===null||nationFcast===void 0? void 0:nationFcast.regionName)&&(nationFcast===null||nationFcast===void 0?void 0:nationFcast.tmpr)&&(nationFcast===null||nationFcast===void 0?void 0:nationFcast.wetrCd)){var regionName=nationFcast===null|| nationFcast===void 0?void 0:nationFcast.regionName;var tmpr=oCommon.fnGetNumberValueWithUnit(nationFcast.tmpr,"\u00b0");var wetrCd=nationFcast.wetrCd;html+='\n \x3cdiv class\x3d"talk_data_inner"\x3e\n \x3cdiv class\x3d"talk_region_item"\x3e\n \x3cstrong class\x3d"talk_item_title"\x3e'.concat(regionName, '\x3c/strong\x3e\n \n \x3cdiv class\x3d"talk_item_temperature"\x3e\n \x3cdiv class\x3d"talk_temperature_icon" aria-hidden\x3d"true"\x3e\n \x3cdiv class\x3d"talk_icon_image ico_wt').concat(wetrCd, '"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cem class\x3d"talk_temperature_title"\x3e').concat(tmpr,"\x3c/em\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}}html+= "\x3c/div\x3e";this.element.find(".talk_data_inner").html("").html(html);var _this=this;var rollingData=function rollingData(){var $talkRegionItems=_this.element.find(".talk_region_item");$($talkRegionItems[_this.rollingIndex]).removeClass("is-active"); _this.rollingIndex=++_this.rollingIndex%$talkRegionItems.length;$($talkRegionItems[_this.rollingIndex]).addClass("is-active")}; this.element.find(".talk_region_item").eq(0).addClass("is-active");this.lastInterval=setInterval(function(){if(_this.element.is(":visible"))rollingData()},3E3)}}, {key:"attachEvent",value:function attachEvent(){}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getTalkHeaderHeight",value:function getTalkHeaderHeight(){return this.element.outerHeight(true)}}, {key:"getTalkHeaderPositionTopAndOuterHeight",value:function getTalkHeaderPositionTopAndOuterHeight(){return this.element.position().top+this.element.outerHeight()}}]); return talkHeader}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=3)return true;return nationH24Count!==null&&nationH24Count>=3}}, {key:"_isDisasterPage",value:function _isDisasterPage(){return oBlockScriptService.callTemplateFunc("regionTalk","isWindowScroll")[0]===true}}, {key:"_isNationMode",value:function _isNationMode(){return this._isDisasterPage()||this._isNationFallback===true}}, {key:"_isAllowedDeviceType",value:function _isAllowedDeviceType(){var _this$templateInfo,_this$templateInfo$cu;var opt=((_this$templateInfo=this.templateInfo)===null||_this$templateInfo===void 0?void 0: (_this$templateInfo$cu=_this$templateInfo.customInfo)===null||_this$templateInfo$cu===void 0?void 0:_this$templateInfo$cu.deviceType)||"MP";var isPc=oCommon.fnGetResponsiveSizeType().deviceType==="Pc"; if(opt==="PC")return isPc;if(opt==="MOBILE")return!isPc;return true}}, {key:"init",value:function init(){}}, {key:"_isViolatedComment",value:function _isViolatedComment(c){var _c$visible;if((c===null||c===void 0?void 0:c.blindReport)===true)return true;if((c===null||c===void 0?void 0:c.middleBlindReport)===true)return true; if((c===null||c===void 0?void 0:c.hiddenByCleanbot)===true)return true;var visible=(_c$visible=c===null||c===void 0?void 0:c.visible)!==null&&_c$visible!==void 0?_c$visible:true;if(!visible&&(c===null|| c===void 0?void 0:c.defamation)===true)return true;if(!visible&&(c===null||c===void 0?void 0:c.blind)===true&&(c===null||c===void 0?void 0:c.status)===15)return true;if(!visible&&((c===null||c===void 0? void 0:c.status)===1||(c===null||c===void 0?void 0:c.status)===3||(c===null||c===void 0?void 0:c.status)===11))return true;if(!visible&&(c===null||c===void 0?void 0:c.deleted)===true)return true;return false}}, {key:"_extractRenderableComments",value:function _extractRenderableComments(commentList){var _this2=this;var cutoff=Date.now()-24*60*60*1E3;return commentList.filter(function(c){return c.contents&&c.contents.trim().length> 0&&(new Date(c.regTimeGmt)).getTime()>=cutoff&&!_this2._isViolatedComment(c)}).slice(0,10).map(function(c){var _c$metaInfo; return{commentNo:c.commentNo,contents:c.contents,userName:c.userName,relativeTime:_this2._formatRelativeTime(c.regTimeGmt),regionName:((_c$metaInfo=c.metaInfo)===null||_c$metaInfo===void 0?void 0:_c$metaInfo.title)|| ""}})}}, {key:"updatePosts",value:function updatePosts(){var _ref2=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref2$commentList=_ref2.commentList,commentList=_ref2$commentList===void 0?[]:_ref2$commentList; if(!this.isEnable)return;if(this._isLoaded)return;this._isLoaded=true;var comments=this._extractRenderableComments(commentList);if(this._isDisasterPage()){this._pageH24Count=this._nationH24Count;if(comments.length< 3||this._pageH24Count===null||this._pageH24Count<3){this.element.addClass("hide");return}this._renderContent(comments);return}if(comments.length>=3){this._renderContent(comments);return}this._requestNationComments()}}, {key:"_requestNationComments",value:function _requestNationComments(){var _configResult$,_configResult$$object,_configResult$2,_configResult$2$objec,_this3=this;var configResult=oBlockScriptService.callTemplateFunc("regionTalk", "getCommentRegionConfigInfoByRegionCode","00","00");var groupId=(_configResult$=configResult[0])===null||_configResult$===void 0?void 0:(_configResult$$object=_configResult$.objectRegionInfo)===null||_configResult$$object=== void 0?void 0:_configResult$$object.groupId;var objectId=(_configResult$2=configResult[0])===null||_configResult$2===void 0?void 0:(_configResult$2$objec=_configResult$2.objectRegionInfo)===null||_configResult$2$objec=== void 0?void 0:_configResult$2$objec.objectId;if(!groupId||!objectId){this.element.addClass("hide");return}var settled=false;var settle=function settle(nationCommentList){if(settled)return;settled=true; var nationComments=_this3._extractRenderableComments(nationCommentList||[]);if(nationComments.length<3){_this3.element.addClass("hide");return}_this3._isNationFallback=true;_this3._renderContent(nationComments)}; oBlockScriptService.ajaxChoiceApiWithUrl(oBlockScriptService.getChoiceApiUrl(),{"nationCommentList":{"groupId":groupId,"objectId":objectId}},function(choiceResult){var _choiceResult$nationC;var commentList= choiceResult===null||choiceResult===void 0?void 0:(_choiceResult$nationC=choiceResult.nationCommentList)===null||_choiceResult$nationC===void 0?void 0:_choiceResult$nationC.commentList;settle(Array.isArray(commentList)? commentList:null)},function(){settle(null)})}}, {key:"_renderContent",value:function _renderContent(comments){this.element.removeClass("type_lazy");this._renderShell();this._renderComments(comments);this._rendered=true;if(this._isAllowedDeviceType())this.startAutoRoll(); else this.element.addClass("hide")}}, {key:"_renderShell",value:function _renderShell(){var _this$_pageCategoryNo,_this$_pageObjectNode;var regionName=this._isNationMode()?this._pageNationName||"\uc804\uad6d":((_this$_pageCategoryNo=this._pageCategoryNode)=== null||_this$_pageCategoryNo===void 0?void 0:_this$_pageCategoryNo.shortName)||((_this$_pageObjectNode=this._pageObjectNode)===null||_this$_pageObjectNode===void 0?void 0:_this$_pageObjectNode.shortName)|| "";var regionCode=this._isNationMode()?"00":this._pageCategoryRegionCode||this._pageObjectRegionCode||"";var html='\n \x3cdiv class\x3d"new_talk_head"\x3e\n \x3ch2 class\x3d"talk_title"\x3e\ub0a0\uc528 \uc81c\ubcf4\ud1a1\x3c/h2\x3e\n \x3ca href\x3d"#" class\x3d"talk_more" data-nlog-area\x3d"talk_recent_posts.more_link"\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"new_talk_body"\x3e\n \x3ca href\x3d"#" class\x3d"talk_region_link" data-region-code\x3d"'.concat(regionCode, '" data-nlog-area\x3d"talk_recent_posts.region_link" data-nlog-params\x3d\'{"region_id":"').concat(regionCode,'"}\'\x3e\n \x3cspan class\x3d"region_icon" aria-hidden\x3d"true"\x3e\x3c/span\x3e\n \x3cdiv class\x3d"region_detail"\x3e\n \x3cstrong class\x3d"region_name"\x3e').concat(_.escape(regionName), '\x3c/strong\x3e\n \x3cdiv class\x3d"region_meta"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3cdiv class\x3d"talk_comment_slide"\x3e\n \x3cul class\x3d"talk_comment_list"\x3e\x3c/ul\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '); this.element.html(html);this._renderRegionMeta(this._isNationFallback?this._nationH24Count:this._pageH24Count)}}, {key:"_renderRegionMeta",value:function _renderRegionMeta(h24Count){var hasCount=typeof h24Count==="number"&&Number.isFinite(h24Count);var newCountHtml=hasCount?'\x3cspan class\x3d"meta"\x3e\uc0c8\uae00 '.concat(_.escape(h24Count.toLocaleString("ko-KR")), "\x3c/span\x3e"):"";this.element.find(".region_meta").html('\x3cspan class\x3d"meta"\x3e\ucd5c\uadfc 24\uc2dc\uac04\x3c/span\x3e'.concat(newCountHtml))}}, {key:"_renderComments",value:function _renderComments(comments){var _this4=this;var liHtml=comments.map(function(c){var regionHtml=_this4._isNationFallback&&c.regionName?'\x3cspan class\x3d"meta meta_region"\x3e'.concat(_.escape(c.regionName), "\x3c/span\x3e"):"";return'\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"talk_comment_link" data-comment-no\x3d"'.concat(_.escape(c.commentNo),'" data-nlog-area\x3d"talk_recent_posts.comment_link"\x3e\n \x3cp class\x3d"comment_text"\x3e').concat(_.escape(c.contents), '\x3c/p\x3e\n \x3cdiv class\x3d"comment_meta"\x3e\n \x3cspan class\x3d"meta meta_author"\x3e').concat(_.escape(c.userName),"\x3c/span\x3e\n ").concat(regionHtml, '\n \x3cspan class\x3d"meta meta_time"\x3e').concat(_.escape(c.relativeTime),"\x3c/span\x3e\n \x3c/div\x3e\n \x3c/a\x3e\n \x3c/li\x3e\n ")}).join(""); this.element.find(".talk_comment_list").html(liHtml)}}, {key:"_formatRelativeTime",value:function _formatRelativeTime(modTimeGmt){var diffMs=Date.now()-(new Date(modTimeGmt)).getTime();var min=Math.floor(diffMs/6E4);if(min<1)return"\ubc29\uae08 \uc804";if(min< 60)return"".concat(min,"\ubd84 \uc804");var hr=Math.floor(min/60);if(hr<24)return"".concat(hr,"\uc2dc\uac04 \uc804");return"".concat(Math.floor(hr/24),"\uc77c \uc804")}}, {key:"startAutoRoll",value:function startAutoRoll(){var _this5=this;var $slide=this.element.find(".talk_comment_slide");var $ul=$slide.find(".talk_comment_list");if(!this._cloned){var $items=$ul.find("\x3e li"); if(!$slide.length||!$items.length)return;var liHeight=$items.eq(0).outerHeight(true);if(!liHeight)return;var visibleCount=Math.max(1,Math.floor($slide[0].clientHeight/liHeight));if($items.length<=Math.max(3, visibleCount))return;$items.slice(0,visibleCount).clone().addClass("is-clone").appendTo($ul);this._rollIdx=0;this._rollLiHeight=liHeight;this._rollOriginalLength=$items.length;this._cloned=true}this.stopAutoRoll(); this._rollTimer=setInterval(function(){_this5._rollIdx++;$ul.css("transform","translateY(".concat(-_this5._rollIdx*_this5._rollLiHeight,"px)"));if(_this5._rollIdx>=_this5._rollOriginalLength)_this5._rollResetTimeout= setTimeout(function(){$ul.css("transition","none");$ul.css("transform","translateY(0)");void $ul[0].offsetHeight;$ul.css("transition","");_this5._rollIdx=0;_this5._rollResetTimeout=null},400)},3E3)}}, {key:"stopAutoRoll",value:function stopAutoRoll(){if(this._rollTimer){clearInterval(this._rollTimer);this._rollTimer=null}if(this._rollResetTimeout){clearTimeout(this._rollResetTimeout);this._rollResetTimeout= null}}}, {key:"attachEvent",value:function attachEvent(){var _this=this;this.element.on("mouseenter",".talk_comment_slide",function(){return _this.stopAutoRoll()}).on("mouseleave",".talk_comment_slide",function(){return _this.startAutoRoll()}); this._onVisibilityChange=function(){if(document.hidden)_this.stopAutoRoll();else _this.startAutoRoll()}; document.addEventListener("visibilitychange",this._onVisibilityChange);this.element.on("click",".talk_more, .talk_region_link",function(e){return _this.onClickTalkMore(e)}).on("click",".talk_comment_link", function(e){return _this.onClickTalkCommentLink(e)})}}, {key:"_setInitRegionCodeForTalk",value:function _setInitRegionCodeForTalk(){if(this._isNationMode())oBlockScriptService.callTemplateFunc("regionTalk","setInitRegionCode","00","00");else oBlockScriptService.callTemplateFunc("regionTalk", "setInitRegionCode",this._pageObjectRegionCode,this._pageCategoryRegionCode)}}, {key:"onClickTalkMore",value:function onClickTalkMore(event){event.preventDefault();oCommon.fnSendClick(event,"".concat(this.clickCode,".more"));this._setInitRegionCodeForTalk();oBlockScriptService.callTemplateFunc("regionTalk", "enableTalk")}}, {key:"onClickTalkCommentLink",value:function onClickTalkCommentLink(event){event.preventDefault();var commentNo=$(event.currentTarget).data("comment-no");oCommon.fnSendClick(event,"".concat(this.clickCode, ".contents"));this._setInitRegionCodeForTalk();oBlockScriptService.callTemplateFunc("regionTalk","setInitCommentNo",commentNo);oBlockScriptService.callTemplateFunc("regionTalk","setInitHighlightCommentNo", commentNo);oBlockScriptService.callTemplateFunc("regionTalk","enableTalk")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this$templateInfo2,_this$templateInfo2$c;if(this._rendered&&((_this$templateInfo2=this.templateInfo)===null||_this$templateInfo2=== void 0?void 0:(_this$templateInfo2$c=_this$templateInfo2.customInfo)===null||_this$templateInfo2$c===void 0?void 0:_this$templateInfo2$c.deviceType)){var allowed=this._isAllowedDeviceType();this.element.toggleClass("hide", !allowed);if(allowed)this.startAutoRoll();else{this.stopAutoRoll();return}}if(!this._cloned)return;var $ul=this.element.find(".talk_comment_list");var $items=$ul.find("\x3e li:not(.is-clone)");if(!$items.length)return; var liHeight=$items.eq(0).outerHeight(true);if(!liHeight)return;this._rollLiHeight=liHeight;$ul.css("transition","none");$ul.css("transform","translateY(".concat(-this._rollIdx*this._rollLiHeight,"px)")); void $ul[0].offsetHeight;$ul.css("transition","")}}, {key:"destroy",value:function destroy(){this.stopAutoRoll();this.element.find(".talk_comment_list .is-clone").remove();this._cloned=false;if(this._onVisibilityChange){document.removeEventListener("visibilitychange", this._onVisibilityChange);this._onVisibilityChange=null}if(_get(_getPrototypeOf(talkRecentPosts.prototype),"destroy",this))_get(_getPrototypeOf(talkRecentPosts.prototype),"destroy",this).call(this)}}]); return talkRecentPosts}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=minViewSize&&result[1]===true){_this2.element.find("._cnShowElement").removeClass("hide"); _this2.element.find("._cnEmptyElement").addClass("hide");var moreCount=result[0]-displaySize;if(moreCount>0)_this2.element.find(".card_text_count").html("+".concat(moreCount));else _this2.element.find(".card_list_link.type_more").addClass("hide"); var lazyImages=[].slice.call(_this.element.find(".lazy"));oCommon.lazyLoadFunc(lazyImages)}else{_this2.element.find("._cnShowElement").addClass("hide");_this2.element.find("._cnEmptyElement").removeClass("hide")}})["catch"](function(error){var _error$xhr, _error$xhr2; _this2.element.addClass("hide");oCommon.fnSendErrorToNelo("[regionTalk.js] \ubaa8\uc544\ubcf4\uae30 API \ud638\ucd9c\uc2e4\ud328 error : ".concat(error===null||error===void 0?void 0:error.error,", status : ").concat(error=== null||error===void 0?void 0:(_error$xhr=error.xhr)===null||_error$xhr===void 0?void 0:_error$xhr.status,", textStatus : ").concat(error===null||error===void 0?void 0:error.status,", url : ").concat(error=== null||error===void 0?void 0:error.url,", response : ").concat(error===null||error===void 0?void 0:(_error$xhr2=error.xhr)===null||_error$xhr2===void 0?void 0:_error$xhr2.responseText),error===null||error=== void 0?void 0:error.xhr)})}}, {key:"attachmentCountApi",value:function attachmentCountApi(url,mediaViewerType){var _this=this;return new Promise(function(resolve,reject){return new $.ajax({method:"GET",url:url,success:function success(data){var imageCount= 0;var videoCount=0;var totalCount=0;try{imageCount=Number(data.result.imageCount);videoCount=Number(data.result.videoCount);totalCount=imageCount+videoCount;if(mediaViewerType==="IMAGE")totalCount-=videoCount; else if(mediaViewerType==="VIDEO")totalCount-=imageCount}catch(error){reject({"error":error,"url":url})}resolve(totalCount)}, error:function error(xhr,status,_error2){reject({"error":_error2,"url":url,"xhr":xhr,"status":status})}})})}}, {key:"attachmentListApi",value:function attachmentListApi(url,displaySize){var _this=this;return new Promise(function(resolve,reject){return $.ajax({method:"GET",url:url,xhrFields:{withCredentials:true}, success:function success(data){try{if(data&&data.result&&data.result.attachmentList){var valid=false;var list=data.result.attachmentList.filter(function(data){return data.commentInfo.userReport===false&& data.commentInfo.hiddenByCleanbot===false}).slice(0,displaySize); var html="";var now=moment.utc().utcOffset("+09:00");for(var i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target} function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i= 0)continue;target[key]=source[key]}return target} function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()} function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance");} function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)} function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&(initMapType==="sat"||initMapType==="rdr")||menu==="today"&&sRegionCode.startsWith("WD")&&this.element.parents(".section_center").length> 0&&initMapType==="tmpr"||menu==="air"&&!sRegionCode.startsWith("WD")&&this.element.parents(".section_center").length>0||!sRegionCode.startsWith("WD")&&this.element.parents(".section_center").length>0|| this.element.parents(".section_single").length>0||!!oBlockScriptService.normalizeGroupId((_this$templateInfo27=this.templateInfo)===null||_this$templateInfo27===void 0?void 0:(_this$templateInfo27$=_this$templateInfo27.customInfo)=== null||_this$templateInfo27$===void 0?void 0:_this$templateInfo27$.groupId)}}, {key:"getValidationConfig",value:function getValidationConfig(){return{visualHourlyData:{fields:["domesticWetrList","overseasHourlyFcastList"],operator:"OR",minLength:12,isDynamic:true},observationAirData:{fields:["airStation.stationId", "airStation.stationName","airFcast.stationPM10Legend1","airFcast.stationPM25Legend1"],operator:"AND",isDynamic:true},observationHourlyData:{fields:["awsWetrList","asosWetrList"],operator:"OR",minLength:12, isDynamic:true},visualSeaData:{fields:["seaRegion.seaRgnNm","seaHdayFcastList"],operator:"AND",isDynamic:true},visualTideData:{fields:["tideStation.stationName","tideFcast","seaHdayFcastList"],operator:"AND", isDynamic:true}}}}, {key:"initMap",value:function initMap(){var _this3=this;var _this=this;if(this.naverMap!==null)return;if(this.isMapSdkUnavailable)return;this.oBasePosition=new naver.maps.LatLng(this.latitude,this.longitude); this.naverMap=new naver.maps.Map("_idVisualMap-".concat(this.templateInfo.index),{gl:true,glType:naver.maps.Util.glSupported()?naver.maps.GLType.HYBRID:null,logoControl:false,scaleControl:false,mapDataControl:false, center:this.oBasePosition,zoom:this.nStartZoom,minZoom:this.nMinZoom,maxZoom:this.nMaxZoom,zoomControl:false,draggable:this.bEnableDrag,disableDoubleClickZoom:this.bDisableDoubleClick,disableDoubleTapZoom:this.bDisableDoubleTap, pinchZoom:this.bDisablePinchZoom,scrollWheel:this.bEnableWheel,weather:true});if(this.isEnableTalkMap())this.talkMapService=new talkMapService(this.naverMap,this.element,this.clickCode,this.templateInfo.index, function(){_this.updateZoomBtn();if(_this.cctvService)_this.cctvService.setOffCctv()}); if(this.isEnableTypnMap()){var _this$templateData17;this.typnMapService=new typhoonMapService({naverMap:this.naverMap,element:this.element,clickCode:this.clickCode,typnList:this.typnList,activeTypnKey:this.activeTypnKey, typnTimelineListMap:(_this$templateData17=this.templateData)===null||_this$templateData17===void 0?void 0:_this$templateData17.typnTimelineListMap,templateIndex:this.templateInfo.index,caller:this.caller, getVisualMapType:function getVisualMapType(){return _this3.visualMapType}, getWeatherLayer:function getWeatherLayer(){return _this3.weatherLayer}, callbacks:{isPlaying:function isPlaying(){return _this3.isPlaying()}, renderSliderDate:function renderSliderDate(list){return _this3.renderSliderDate(list)}, getSliderPositionIndex:function getSliderPositionIndex(){return _this3.getSliderPositionIndex()}, moveSlideByYmdt:function moveSlideByYmdt(index,ratio){return _this3.moveSlideByYmdt(index,ratio)}}})}if(this.isEnableWarnMap())this.warnMapService=new warnMapService({naverMap:this.naverMap, element:this.element,clickCode:this.clickCode,warnTimelineMap:this.warnTimelineMap,showWarnTypeList:this.showWarnTypeList,shouldApplyWarnTypeFilter:this.shouldApplyWarnTypeFilter,showWarnList:this.showWarnList, warnPolygonApi:this.warnPolygonApi,templateIndex:this.templateInfo.index,getVisualMapType:function getVisualMapType(){return _this3.visualMapType}, callbacks:{addMarker:function addMarker(marker){return _this3.markerList.push(marker)}, showMapUI:function showMapUI(){return _this3.showMapUI()}, hideExistingMapUI:function hideExistingMapUI(){return _this3.hideExistingMapUI()}, changeMapTab:function changeMapTab(){return _this3.changeMapTab()}}}); if(this.isEnableEqkMap()){var _this$templateInfo28,_this$templateInfo28$;this.eqkMapService=new earthquakeMapService({naverMap:this.naverMap,element:this.element,clickCode:this.clickCode,eqkList:this.eqkList, templateIndex:this.templateInfo.index,callbacks:{addMarker:function addMarker(marker){return _this3.markerList.push(marker)}}}); var paramEqkKey=(new URLSearchParams(location.search)).get("eqkKey");var activeKey=this.eqkList.some(function(eqk){return String(eqk.id)===paramEqkKey})?paramEqkKey:((_this$templateInfo28=this.templateInfo)=== null||_this$templateInfo28===void 0?void 0:(_this$templateInfo28$=_this$templateInfo28.customInfo)===null||_this$templateInfo28$===void 0?void 0:_this$templateInfo28$.defaultEqkId)||null; if(activeKey==="NONE")activeKey=null;if(activeKey)this.eqkMapService.selectedEqk=this.eqkList.find(function(eqk){return String(eqk.id)===String(activeKey)})||null}this.attachMapEvent(); this.updateZoomBtn();if(!_this.isCctvSpecout){var _this$templateData18;var channel="";if(!_.isEmpty((_this$templateData18=this.templateData)===null||_this$templateData18===void 0?void 0:_this$templateData18.cctv)){var _this$templateData19; channel=(_this$templateData19=this.templateData)===null||_this$templateData19===void 0?void 0:_this$templateData19.cctv.matrix}var channelParam=(new URLSearchParams(location.search)).get("channel");channel= _.isEmpty(channelParam)?channel+"":channelParam;if(!_.isEmpty(channel))_this.isCctvEnabled=true;if(_this.isWarnVisualMapType(_this.visualMapType))_this.isCctvEnabled=false;_this.cctvService=new cctvService(_this.naverMap, _this.element,_this.isCctvEnabled,_this.clickCode,channel,null,function(){if(!_this.isTypnVisualMapType(_this.visualMapType)&&!_this.isAqfVisualMapType(_this.visualMapType))_this.resetZoomLevel();if(_this.talkMapService)_this.talkMapService.disableTalkMap()})}}}, {key:"isEnableTalkMap",value:function isEnableTalkMap(){var commentKey=oBlockScriptService.callTemplateFuncWithIndex("regionTalk",1,"getCommentKey");return this.enableTalkMap&&!_.isEmpty(commentKey)}}, {key:"isEnableWarnMap",value:function isEnableWarnMap(){return this.enableWarnMap&&!_.isEmpty(this.warnList)}}, {key:"isEnableEqkMap",value:function isEnableEqkMap(){return this.enableEqkMap&&!_.isEmpty(this.eqkList)}}, {key:"isEnableTypnMap",value:function isEnableTypnMap(){return this.enableTypnMap&&!_.isEmpty(this.typnList)}}, {key:"hasMapType",value:function hasMapType(type){if(type==="earthquake")return this.isEnableEqkMap();if(type==="typn")return this.isEnableTypnMap();if(type==="warn")return this.isEnableWarnMap();return false}}, {key:"focusMapType",value:function focusMapType(type){if(!this.hasMapType(type))return false;var tabName=this.element.data("tabName");if(this.ownerGroup){if(this.ownerGroup.renderMode!=="grid"){var $groupTab= this.ownerGroup.getTabLinks().filter('[data-name\x3d"'.concat(tabName,'"]'));if($groupTab.length>0&&!$groupTab.hasClass(this.ownerGroup.getActiveClass()))$groupTab.trigger("click")}}else{var $tab=$('.tab_list .tab_link[data-name\x3d"'.concat(tabName, '"]'));if($tab.length>0&&!$tab.hasClass("is_on"))$tab.trigger("click")}var sameFamily=type==="warn"&&this.isWarnVisualMapType(this.visualMapType)||type==="earthquake"&&this.isEqkVisualMapType(this.visualMapType)|| type==="typn"&&this.isTypnVisualMapType(this.visualMapType)||this.visualMapType===type;if(!sameFamily){var $btn=this.element.find('.map_tools_depth button[data-type\x3d"'.concat(type,'"]'));if($btn.length> 0)$btn.trigger("click")}var $lnb=this.ownerGroup?this.ownerGroup.element:oBlockScriptService.getBlockTemplateElement("wetrLnb");var anchorId=$lnb.length&&$lnb.attr("id")?$lnb.attr("id"):this.element.attr("id"); if(anchorId)oCommon.fnMoveScrollToTarget("#"+anchorId);return true}}, {key:"shouldShowNoWarningMessage",value:function shouldShowNoWarningMessage(){return this.enableWarnMap&&_.isEmpty(this.warnList)&&this.element.find(".map_tools_item:not(.hide)").length===0}}, {key:"shouldShowNoEqkMessage",value:function shouldShowNoEqkMessage(){return this.enableEqkMap&&_.isEmpty(this.eqkList)&&this.element.find(".map_tools_item:not(.hide)").length===0}}, {key:"buildShowWarnList",value:function buildShowWarnList(){var _this4=this;if(!this.isEnableWarnMap()){this.shouldApplyWarnTypeFilter=false;return[]}var currentWarnTypes=this.warnList.map(function(warn){return warn.en}); var allWarnTabs=["warn"].concat(_toConsumableArray(currentWarnTypes.map(function(type){return"warn_".concat(type)}))); if(this.showWarnTypeList.includes("all")||_.isEmpty(this.showWarnTypeList)||!this.showWarnTypeList.some(function(type){return currentWarnTypes.includes(type)})){this.shouldApplyWarnTypeFilter=false; return allWarnTabs}this.shouldApplyWarnTypeFilter=true;var filteredWarnTypes=currentWarnTypes.filter(function(type){return _this4.showWarnTypeList.includes(type)}); return filteredWarnTypes.map(function(type){return"warn_".concat(type)})}}, {key:"showVisualMapEvent",value:function showVisualMapEvent(){var _this$templateData20,_this5=this;this.initMap();if(!this.naverMap)return;this.naverMap.autoResize();if(!_.isEmpty((_this$templateData20= this.templateData)===null||_this$templateData20===void 0?void 0:_this$templateData20.domesticWetrList))this.overlayWeatherLayer();if(this.bLastWindLayer&&this.isWetrVisualMapType(this.visualMapType)){this.element.find("button.wind").attr("disabled", false).addClass("on");this.onOffWindLayer(true)}else this.onOffWindLayer(false);if(this.isVideoVisualMapType(this.visualMapType))this.noUiSliderPlayerService.resetSlider(true);setTimeout(function(){_this5.initAllScroll()}, 500)}}, {key:"hideVisualMapEvent",value:function hideVisualMapEvent(e){if(this.weatherLayer){this.weatherLayer.setMap(null);this.weatherLayer=null}if(this.windLayer){this.windLayer.setMap(null);this.windLayer= null}if(this.noUiSliderPlayerService&&this.isPlaying())this.noUiSliderPlayerService.timer.pause()}}, {key:"renderMapTab",value:function renderMapTab(){var _this6=this,_this$eqkMapService2;if(this.showObservationList.indexOf("aws")>=0){this.showObservationList.unshift("aws1d");this.showObservationList.unshift("aws1h")}var $mapToolsItem= this.element.find(".map_tools_item");var $mapToolsForecastItem=$mapToolsItem.filter(".type_forecast");this.showForecastList.forEach(function(item,index){$mapToolsForecastItem.removeClass("hide");$mapToolsForecastItem.find(".map_tools_depth").append(_this6.mapTypeBtnMapping[item])}); var $mapToolsObservationItem=$mapToolsItem.filter(".type_observation");this.showObservationList.forEach(function(item,index){$mapToolsObservationItem.removeClass("hide");$mapToolsObservationItem.find(".map_tools_depth").append(_this6.mapTypeBtnMapping[item])}); var $mapToolsVideoItem=$mapToolsItem.filter(".type_satellite");this.showVideoList.forEach(function(item,index){$mapToolsVideoItem.removeClass("hide");$mapToolsVideoItem.find(".map_tools_depth").append(_this6.mapTypeBtnMapping[item])}); var $mapToolsAirItem=$mapToolsItem.filter(".type_air");this.showAirList.forEach(function(item,index){$mapToolsAirItem.removeClass("hide");var buttonHtml=_this6.mapTypeBtnMapping[item];if(_this6.isAqfVisualMapType(item)){var $button= $(buttonHtml);var prefix=item==="pm10"?"\ubbf8\uc138":"\ucd08\ubbf8\uc138";$button.attr("data-shortcut",prefix);$button.text("".concat(prefix,"\uba3c\uc9c0 \uc608\uce21"));$mapToolsAirItem.find(".map_tools_depth").append($button)}else $mapToolsAirItem.find(".map_tools_depth").append(buttonHtml)}); if(this.eqkMapService)this.eqkMapService.renderTab();if(this.typnMapService)this.typnMapService.renderTab();if(this.warnMapService)this.warnMapService.renderTab();if(!this.eqkMapService&&this.shouldShowNoEqkMessage())this.renderNoEqkTab(); else if(!this.warnMapService&&this.shouldShowNoWarningMessage())this.renderNoWarningTab();this.element.find("._cnCctvTabArea").removeClass("hide");if(this.isEnableTalkMap())this.talkMapService.renderTab(); this.lastVisualMapType=this.visualMapType;var selector='.map_tools_depth button[data-type\x3d"'.concat(this.visualMapType,'"]');if(this.isTypnVisualMapType(this.visualMapType)&&this.activeTypnKey){selector+= '[data-key\x3d"'.concat(this.activeTypnKey,'"]');if(this.element.find(selector).length===0)selector='.map_tools_depth button[data-type\x3d"'.concat(this.visualMapType,'"]')}if(this.isEqkVisualMapType(this.visualMapType)&& ((_this$eqkMapService2=this.eqkMapService)===null||_this$eqkMapService2===void 0?void 0:_this$eqkMapService2.selectedEqk)){selector+='[data-key\x3d"'.concat(this.eqkMapService.selectedEqk.id,'"]');if(this.element.find(selector).length=== 0)selector='.map_tools_depth button[data-type\x3d"'.concat(this.visualMapType,'"]')}var $buttons=this.element.find(selector);if($buttons.length){var $button=$buttons.first();$button.click()}if(this.visualMapType=== "talk"&&this.talkMapService)this.talkMapService.enableTalkMap();this.element.find(".color_guide._".concat(this.visualMapType)).removeClass("hide")}}, {key:"renderNoWarningTab",value:function renderNoWarningTab(){this.visualMapType="warn";this.updateNlogContext();var $mapToolsWarnItem=this.element.find(".map_tools_item").filter(".type_warn");$mapToolsWarnItem.removeClass("hide"); var buttonHtml=this.mapTypeBtnMapping["warn"];if(buttonHtml)$mapToolsWarnItem.find(".map_tools_depth").append(buttonHtml);var html='\n \x3cdiv class\x3d"map_warning"\x3e\n \x3cdiv class\x3d"map_warning_exception"\x3e\n \x3cp class\x3d"map_exception_text"\x3e\n \ubc1c\ud6a8 \uc911\uc778 \uae30\uc0c1\ud2b9\ubcf4\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; this.element.find(".map_bottom_area").prepend(html)}}, {key:"renderNoEqkTab",value:function renderNoEqkTab(){this.visualMapType="earthquake";this.updateNlogContext();var $mapToolsEqkItem=this.element.find(".map_tools_item").filter(".type_earthquake");$mapToolsEqkItem.removeClass("hide"); var buttonHtml=this.mapTypeBtnMapping["earthquake"];if(buttonHtml)$mapToolsEqkItem.find(".map_tools_depth").append(buttonHtml);var html='\n \x3cdiv class\x3d"map_warning"\x3e\n \x3cdiv class\x3d"map_warning_exception"\x3e\n \x3cp class\x3d"map_exception_text"\x3e\n \ucd5c\uadfc 30\uc77c \uc774\ub0b4 \ubc1c\uc0dd\ud55c \uad6d\ub0b4 \uc9c0\uc9c4 \uc815\ubcf4\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; this.element.find(".map_bottom_area").prepend(html)}}, {key:"prepareTypnListForDisplay",value:function prepareTypnListForDisplay(typnList){var _this7=this;var displayOption=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"local";var paramTypnKey= arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(_.isEmpty(typnList))return[];var filteredList;if(displayOption==="local")filteredList=typnList.filter(function(typn){return typn.localYn=== "Y"&&!_this7.isExpiredTypn(typn)}); else if(displayOption==="all")filteredList=typnList;else filteredList=[];if(paramTypnKey){var alreadyInFilteredList=filteredList.some(function(typn){return typn.typnKey===paramTypnKey}); if(!alreadyInFilteredList){var paramTypn=typnList.find(function(typn){return typn.typnKey===paramTypnKey}); if(paramTypn){var originalIndex=typnList.findIndex(function(typn){return typn.typnKey===paramTypnKey}); var insertIndex=0;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{var _loop=function _loop(){var item=_step.value;var itemOriginalIndex=typnList.findIndex(function(t){return t.typnKey=== item.typnKey}); if(itemOriginalIndex>=originalIndex)return"break";insertIndex++}; for(var _iterator=filteredList[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _ret=_loop();if(_ret==="break")break}}catch(err){_didIteratorError= true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}filteredList.splice(insertIndex,0, paramTypn)}}}return filteredList}}, {key:"isExpiredTypn",value:function isExpiredTypn(typn){var validYn=(typn.validYn||"").toUpperCase();if(validYn==="N")return true;if(validYn==="Y")return moment(typn.ancmtYmdt,"YYYYMMDDHHmmss").utcOffset(540, true).isBefore(moment().subtract(24,"hours"));return false}}, {key:"getInitVisualMapType",value:function getInitVisualMapType(){var _this$templateData21,_this$templateData22,_this$templateData23,_this$templateData24,_this$templateData25;var initMapType=this.visualMapType; var eqkTypes=this.isEnableEqkMap()?["earthquake"]:[];var typnTypes=this.isEnableTypnMap()?["typn"]:[];var mapTypeList=[].concat(_toConsumableArray(this.showForecastList),_toConsumableArray(this.showObservationList), _toConsumableArray(this.showVideoList),_toConsumableArray(this.showAirList),_toConsumableArray(this.showTalkList),eqkTypes,typnTypes,_toConsumableArray(this.showWarnList));if(this.initVisualMapType&&mapTypeList.includes(this.initVisualMapType))initMapType= this.initVisualMapType;else if(this.initVisualMapType==="warn"&&!mapTypeList.includes("warn")&&!_.isEmpty(this.showWarnList))initMapType=this.showWarnList[0];var targetMenu=(new URLSearchParams(location.search)).get("targetMenu"); var paramVisualMapType=(new URLSearchParams(location.search)).get("visualMapType");var currentLnbTabName=this.element.data("tabName");if(paramVisualMapType&&(!targetMenu||targetMenu===currentLnbTabName))initMapType= paramVisualMapType;var firstMapType=mapTypeList.length>0?mapTypeList[0]:"tmpr";if(initMapType==null||mapTypeList.findIndex(function(mapType){return mapType===initMapType})<0)initMapType=firstMapType; if(this.isObservationVisualMapType(initMapType)&&!((_this$templateData21=this.templateData)===null||_this$templateData21===void 0?void 0:_this$templateData21.domestic))initMapType=firstMapType;if(this.isVideoVisualMapType(initMapType)&& !((_this$templateData22=this.templateData)===null||_this$templateData22===void 0?void 0:_this$templateData22.domestic))initMapType=firstMapType;if(this.isAirVisualMapType(initMapType)&&!((_this$templateData23= this.templateData)===null||_this$templateData23===void 0?void 0:_this$templateData23.domestic))initMapType=firstMapType;if(this.isTalkMapType(initMapType)&&!((_this$templateData24=this.templateData)=== null||_this$templateData24===void 0?void 0:_this$templateData24.domestic))initMapType=firstMapType;if(this.isWarnVisualMapType(initMapType)&&!((_this$templateData25=this.templateData)===null||_this$templateData25=== void 0?void 0:_this$templateData25.domestic))initMapType=firstMapType;if(paramVisualMapType==="air")this.nStartZoom=this.nStandardZoom;var initTalkFlag=oBlockScriptService.callTemplateFuncWithIndex("regionTalk", 1,"isEnableInitTalk");if(initTalkFlag===true&&this.isEnableTalkMap())initMapType="talk";if(!mapTypeList.includes(paramVisualMapType)&&this.isWarnVisualMapType(initMapType)&&this.defaultWarnType&&this.defaultWarnType!== "NONE"){var defaultWarnTab="warn_".concat(this.defaultWarnType);if(mapTypeList.includes(defaultWarnTab))initMapType=defaultWarnTab}return initMapType}}, {key:"getCurrentVisualMapType",value:function getCurrentVisualMapType(){var clickedElement=this.element.find('.map_tools_depth .map_depth_button[aria-pressed\x3d"true"]');var clickedType=this.visualMapType; if(clickedElement.length!==0)clickedType=clickedElement.data("type");if(this.visualMapType)return this.visualMapType;else if(clickedType)return clickedType;else return"wetr"}}, {key:"attachMapEvent",value:function attachMapEvent(){var _this=this;naver.maps.Event.addListener(this.naverMap,"init",function(){_this.renderMapTab();if(!_this.isObservationVisualMapType(_this.visualMapType)&& !_this.isDisasterVisualMapType(_this.visualMapType)&&_this.enableWindLayer)_this.element.find("button.btn_pin.wind").click()}); naver.maps.Event.addListener(this.naverMap,"bounds_changed",_.debounce(function(){_this.optimizeMarker();_this.saveLastMapInfo();if(_this.isVideoVisualMapType(_this.visualMapType)||_this.isAqfVisualMapType(_this.visualMapType)){if(menu!== "today")_this.ajaxSrmBounds()}else if(["today","air"].includes(menu))oCommon.fnAddTrackElementVisible(_this.element,function(){return _this.ajaxVisualMapDataByBounds()}); else _this.ajaxVisualMapDataByBounds()},300)); naver.maps.Event.addListener(this.naverMap,"dragend",function(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"drag"))}); naver.maps.Event.addListener(this.naverMap,"pinchend",function(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"pinch"))}); naver.maps.Event.addListener(this.naverMap,"zoom_changed",_.debounce(function(changedZoom){var intZoom=Math.round(changedZoom);if(intZoom!==_this.nLastZoom){_this.lastBounds="";_this.clearMarker();_this.onCurrentPositon= true}if(_this.visualMapType==="air")if(intZoom<_this.nStandardZoom){_this.element.find(".map_panel").addClass("zoom_out");_this.element.find("._cnVisualMapMaker").removeClass("on")}else _this.element.find(".map_panel").removeClass("zoom_out"); _this.updateZoomBtn();_this.nLastZoom=intZoom;var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=_this.groundOverlayMap.values()[Symbol.iterator](), _step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var overlay=_step2.value;overlay.setOpacity(_this.checkImageOpacity())}}catch(err){_didIteratorError2= true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]!=null)_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}},250)); naver.maps.Event.addListener(this.naverMap,"center_changed",function(e){if(_this.visualMapType==="rdr"||_this.visualMapType==="maple"||_this.isAqfVisualMapType(_this.visualMapType)&&_this.isAqfKoreaResolution())_this.colorAtCoord(e)})}}, {key:"saveLastMapInfo",value:function saveLastMapInfo(){var center=this.naverMap.getCenter();var bounds=this.naverMap.getBounds();var zoom=this.naverMap.getZoom();oBlockScriptService.setSingletonInstance("visualMapLastInfo", {"center":center,"bounds":bounds,"zoom":zoom})}}, {key:"getLastMapInfo",value:function getLastMapInfo(){return oBlockScriptService.getSingletonInstance("visualMapLastInfo")}}, {key:"getCenterByLastMapInfo",value:function getCenterByLastMapInfo(){var _this$getLastMapInfo;return((_this$getLastMapInfo=this.getLastMapInfo())===null||_this$getLastMapInfo===void 0?void 0:_this$getLastMapInfo.center)|| this.naverMap.getCenter()}}, {key:"getBoundsByLastMapInfo",value:function getBoundsByLastMapInfo(){var _this$getLastMapInfo2;return((_this$getLastMapInfo2=this.getLastMapInfo())===null||_this$getLastMapInfo2===void 0?void 0:_this$getLastMapInfo2.bounds)|| this.naverMap.getBounds()}}, {key:"getZoomByLastMapInfo",value:function getZoomByLastMapInfo(){var _this$getLastMapInfo3;return((_this$getLastMapInfo3=this.getLastMapInfo())===null||_this$getLastMapInfo3===void 0?void 0:_this$getLastMapInfo3.zoom)|| this.naverMap.getZoom()}}, {key:"clickMapTabGroup",value:function clickMapTabGroup(e){var $target=$(e.currentTarget);var isPressed=$target.attr("aria-pressed")==="true";var isSelected=$target.hasClass("is-selected");this.element.find("._cnMapInfoBtn").attr("aria-pressed", false);this.checkToolButtonSelected();if(isSelected)$target.removeClass("is-selected").find(".map_button_title").html($target.find(".map_button_emphasis").html());else if(!isPressed){this.element.find(".map_item_button").attr("aria-pressed", false);$target.attr("aria-pressed",true)}}}, {key:"checkToolButtonSelected",value:function checkToolButtonSelected(){this.element.find(".map_item_button").attr("aria-pressed",false);var $selectedButton=this.element.find('.map_depth_button[aria-pressed\x3d"true"]').first(); if(!_.isEmpty($selectedButton)){var $parentTabGroupButton=$selectedButton.parent().siblings(".map_item_button");$parentTabGroupButton.attr("aria-pressed",true).addClass("is-selected").find(".map_button_title").html($selectedButton.data("shortcut"))}}}, {key:"enableTalkMapMode",value:function enableTalkMapMode(){var _this$typnMapService,_this$warnMapService,_this$warnMapService2,_this$eqkMapService3,_this$typnMapService2;this.visualMapType="talk";this.updateNlogContext(); this.lastVisualMapType="talk";this.changeMapBtnStats(this.element.find("._cnTalkMap"));this.changeMapTypeId(this.visualMapType);this.hideGroundOverlay();this.clearMarker();this.element.find("button.wind").attr("disabled", true).removeClass("on");this.onOffWindLayer(false);this.hideDongPositionMarker();this.hideFloatingMarker();this.hideMapAqfButton();this.hideAqfException();this.closeTideCalendar();this.isAqfException=false; this.hideSlider();this.hideLayerSnow();this.hideAllInfoLayer();this.updateColorGuideByMapType();this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",true);(_this$typnMapService=this.typnMapService)=== null||_this$typnMapService===void 0?void 0:_this$typnMapService.removeTypnPath();(_this$warnMapService=this.warnMapService)===null||_this$warnMapService===void 0?void 0:_this$warnMapService.clearWarningPolygon(); (_this$warnMapService2=this.warnMapService)===null||_this$warnMapService2===void 0?void 0:_this$warnMapService2.hideWarnUI();(_this$eqkMapService3=this.eqkMapService)===null||_this$eqkMapService3===void 0? void 0:_this$eqkMapService3.hideEqkUI();this.element.find(".map_warning_exception").closest(".map_warning").addClass("hide");this.resetWeatherLayer();(_this$typnMapService2=this.typnMapService)===null|| _this$typnMapService2===void 0?void 0:_this$typnMapService2.resetTypnRainLayer()}}, {key:"changeMapBtnStats",value:function changeMapBtnStats($target){this.element.find(".map_tools_depth button").attr("aria-pressed",false);$target.attr("aria-pressed",true);var $prevSelected=this.element.find(".map_item_button.is-selected"); $prevSelected.removeClass("is-selected").find(".map_button_title").html($prevSelected.find(".map_button_emphasis").html());this.checkToolButtonSelected();this.element.find(".type_forecast .map_item_button").removeClass("type_tmpr").removeClass("type_stmpr").removeClass("type_rain").removeClass("type_snow").removeClass("type_humd").removeClass("type_wind").removeClass("type_sea"); this.element.find(".type_satellite .map_item_button").removeClass("type_sat").removeClass("type_rdr").removeClass("type_maple");this.element.find(".type_observation .map_item_button").removeClass("type_aws1h").removeClass("type_aws1d").removeClass("type_asos"); this.element.find(".type_air .map_item_button").removeClass("type_air").removeClass("type_pm10").removeClass("type_pm25");this.element.find(".type_disaster .map_item_button").removeClass("type_typn");this.element.find(".type_earthquake .map_item_button").removeClass("type_earthquake"); $target.parent().siblings(".map_item_button").addClass("type_".concat(this.visualMapType))}}, {key:"updateNlogContext",value:function updateNlogContext(){var type=this.visualMapType;var mapType;if(this.isWetrVisualMapType(type))mapType="wetr";else if(type==="sea")mapType="sea";else if(this.isVideoVisualMapType(type))mapType= "video";else if(this.isObservationVisualMapType(type))mapType="observation";else if(this.isAirVisualMapType(type))mapType="air";else if(this.isTalkMapType(type))mapType="talk";else if(this.isTypnVisualMapType(type))mapType= "typhoon";else if(this.isEqkVisualMapType(type))mapType="earthquake";else if(this.isWarnVisualMapType(type))mapType="warn";else mapType=type;this.element.attr("data-nlog-context-params",JSON.stringify({map_type:mapType, data_type:type}))}}, {key:"clickMapTab",value:function clickMapTab(e){var _this$templateData26,_this$templateData27,_this$templateData28,_this$templateData29;var $target=$(e.currentTarget);this.visualMapType=$target.data("type"); this.updateNlogContext();if(this.typnMapService&&this.isTypnVisualMapType(this.visualMapType))this.typnMapService.activeTypnKey=$target.data("key")||"";if(this.eqkMapService&&this.isEqkVisualMapType(this.visualMapType)){var eqk= this.eqkList.find(function(item){return item.id===$target.data("key")}); if(eqk)this.eqkMapService.selectedEqk=eqk}this.changeMapBtnStats($target);if(this.element.find("._cnTalkMap").hasClass("on"))this.talkMapService.disableTalkMap();var sendTypeClickCode="";if(this.visualMapType=== "aws1h")sendTypeClickCode="obsrain1h";else if(this.visualMapType==="aws1d")sendTypeClickCode="obsrain";else if(this.visualMapType==="asos")sendTypeClickCode="obssnow";else if(this.visualMapType==="air")sendTypeClickCode= "airobs";else if(this.visualMapType==="pm10")sendTypeClickCode="aqfpm10";else if(this.visualMapType==="pm25")sendTypeClickCode="aqfpm25";else if(this.visualMapType==="typn")sendTypeClickCode="typn";else if(this.isWarnVisualMapType(this.visualMapType))sendTypeClickCode= "alertdebut";else if(this.isEqkVisualMapType(this.visualMapType))sendTypeClickCode="earthtotbut";else sendTypeClickCode=this.visualMapType;oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(sendTypeClickCode)); this.changeMapTypeId(this.visualMapType);this.hideGroundOverlay();var load=false;if(this.isWarnVisualMapType(this.visualMapType)){var _this$warnMapService3;((_this$warnMapService3=this.warnMapService)=== null||_this$warnMapService3===void 0?void 0:_this$warnMapService3.warnDataLoaded)?this.changeMapTab():this.loadInitWetrData();return}switch(this.visualMapType){case "air":if((((_this$templateData26=this.templateData)=== null||_this$templateData26===void 0?void 0:_this$templateData26.airStation)||[]).length===0)load=true;break;case "aws1h":case "aws1d":if((((_this$templateData27=this.templateData)===null||_this$templateData27=== void 0?void 0:_this$templateData27.awsWetrList)||[]).length===0)load=true;break;case "asos":if((((_this$templateData28=this.templateData)===null||_this$templateData28===void 0?void 0:_this$templateData28.asosWetrList)|| []).length===0)load=true;break;case "pm10":case "pm25":case "rdr":case "sat":case "maple":this.displayPerEach=1E3;if(this.noUiSliderPlayerService)this.noUiSliderPlayerService.updateDisplayPerEach(this.displayPerEach); break;case "sea":this.displayPerEach=500;load=false;break;case "typn":this.displayPerEach=500;if(_.isEmpty((_this$templateData29=this.templateData)===null||_this$templateData29===void 0?void 0:_this$templateData29.typnTimelineListMap))load= true;break;case "earthquake":break;case "talk":default:this.displayPerEach=500;if(this.noUiSliderPlayerService)this.noUiSliderPlayerService.updateDisplayPerEach(this.displayPerEach);if(sRegionCode.startsWith("WD")){var _this$templateData30; if((((_this$templateData30=this.templateData)===null||_this$templateData30===void 0?void 0:_this$templateData30.overseasHourlyFcastList)||[]).length===0)load=true}else{var _this$templateData31;if((((_this$templateData31= this.templateData)===null||_this$templateData31===void 0?void 0:_this$templateData31.domesticWetrList)||[]).length===0)load=true}}if(load)this.loadInitWetrData();else this.changeMapTab()}}, {key:"loadInitWetrData",value:function loadInitWetrData(){var _this8=this;var _this=this;if(!this.visualMapType){this.visualMapType=this.getCurrentVisualMapType();this.updateNlogContext()}var choiceQueryString= {"visualMap":{"naverRgnCd":sRegionCode,"cctv":false,"visualMapType":this.visualMapType}};var commonQueryString={};if(sRegionCode.startsWith("LS"))commonQueryString["lsurRegion"]={"lsurRgnCd":sRegionCode}; oBlockScriptService.ajaxChoiceApiWithCommon(choiceQueryString,commonQueryString,function(result){var _result$visualMap2,_result$visualMap3,_result$visualMap4,_result$visualMap$typ,_result$visualMap5;var visualMapType= _this.visualMapType;if(_this8.isWarnVisualMapType(visualMapType)){var _result$visualMap$war,_result$visualMap;_this8.templateData.warnMap=(_result$visualMap$war=result===null||result===void 0?void 0:(_result$visualMap= result.visualMap)===null||_result$visualMap===void 0?void 0:_result$visualMap.warnMap)!==null&&_result$visualMap$war!==void 0?_result$visualMap$war:{};if(_this8.warnMapService){_this8.warnMapService.warnTimelineMap= _this8.templateData.warnMap;_this8.warnMapService.loadPolygonDataOnce().then(function(){_this8.warnMapService.updateOfferArea();_this.changeMapTab()})["catch"](function(error){oCommon.fnSendInfoToNelo("[visualMap] \uae30\uc0c1\ud2b9\ubcf4 \ud3f4\ub9ac\uace4 \ub85c\ub4dc \uc2e4\ud328", null,error); _this8.switchToNonDisasterTab()})}return}switch(visualMapType){case "air":_this8.templateData.airStation=(result===null||result===void 0?void 0:(_result$visualMap2=result.visualMap)===null||_result$visualMap2=== void 0?void 0:_result$visualMap2.airStation)||[]; _this8.selectedAirStationId=_.isEmpty(_this8.selectedAirStationId)?_this8.templateData.airStation.stationId:_this8.selectedAirStationId;break;case "aws1h":case "aws1d":_this8.templateData.awsWetrList=(result=== null||result===void 0?void 0:(_result$visualMap3=result.visualMap)===null||_result$visualMap3===void 0?void 0:_result$visualMap3.awsWetrList)||[];break;case "asos":_this8.templateData.asosWetrList=(result=== null||result===void 0?void 0:(_result$visualMap4=result.visualMap)===null||_result$visualMap4===void 0?void 0:_result$visualMap4.asosWetrList)||[];break;case "typn":_this8.templateData.typnTimelineListMap= (_result$visualMap$typ=result===null||result===void 0?void 0:(_result$visualMap5=result.visualMap)===null||_result$visualMap5===void 0?void 0:_result$visualMap5.typnTimelineListMap)!==null&&_result$visualMap$typ!== void 0?_result$visualMap$typ:{};if(_this8.typnMapService)_this8.typnMapService.typnTimelineListMap=_this8.templateData.typnTimelineListMap;break;default:if(sRegionCode.startsWith("WD")){var _result$visualMap6; _this8.templateData.overseasHourlyFcastList=(result===null||result===void 0?void 0:(_result$visualMap6=result.visualMap)===null||_result$visualMap6===void 0?void 0:_result$visualMap6.overseasHourlyFcastList)|| []}else{var _result$visualMap7;_this8.templateData.domesticWetrList=(result===null||result===void 0?void 0:(_result$visualMap7=result.visualMap)===null||_result$visualMap7===void 0?void 0:_result$visualMap7.domesticWetrList)|| []}}_this.changeMapTab()})}}, {key:"changeMapTab",value:function changeMapTab(){var _this$typnMapService3,_this9=this;var _this=this;this.resetZoomLevel();this.updateZoomBtn();this.hideDongPositionMarker();this.hideFloatingMarker(); this.hideMapAqfButton();this.hideAqfException();this.closeTideCalendar();(_this$typnMapService3=this.typnMapService)===null||_this$typnMapService3===void 0?void 0:_this$typnMapService3.removeTypnPath(); if(!(this.isEqkVisualMapType(this.lastVisualMapType)&&this.isEqkVisualMapType(this.visualMapType))){var _this$eqkMapService4;(_this$eqkMapService4=this.eqkMapService)===null||_this$eqkMapService4===void 0? void 0:_this$eqkMapService4.hideEqkUI()}else{var _this$eqkMapService5;(_this$eqkMapService5=this.eqkMapService)===null||_this$eqkMapService5===void 0?void 0:_this$eqkMapService5.closeBottomSheet()}if(!(this.isWarnVisualMapType(this.lastVisualMapType)&& this.isWarnVisualMapType(this.visualMapType))){var _this$warnMapService4,_this$warnMapService5;(_this$warnMapService4=this.warnMapService)===null||_this$warnMapService4===void 0?void 0:_this$warnMapService4.clearWarningPolygon(); (_this$warnMapService5=this.warnMapService)===null||_this$warnMapService5===void 0?void 0:_this$warnMapService5.hideWarnUI()}else{var _this$warnMapService6,_this$warnMapService7;(_this$warnMapService6= this.warnMapService)===null||_this$warnMapService6===void 0?void 0:_this$warnMapService6.closeBottomSheet();(_this$warnMapService7=this.warnMapService)===null||_this$warnMapService7===void 0?void 0:_this$warnMapService7.removeDetailMarker()}this.isAqfException= false;if(this.visualMapType==="air"){var _this$typnMapService4;this.controlSnowData();this.hideSlider();this.clearMarker();this.hideAllInfoLayer();this.lastBounds="";this.updateColorGuideByMapType();this.hideLayerSnow(); this.element.find("button.wind").attr("disabled",true).removeClass("on");this.resetWeatherLayer();this.resetWindLayer();(_this$typnMapService4=this.typnMapService)===null||_this$typnMapService4===void 0? void 0:_this$typnMapService4.resetTypnRainLayer();naver.maps.Event.trigger(this.naverMap,"bounds_changed");naver.maps.Event.trigger(this.naverMap,"zoom_changed")}else if(this.visualMapType==="sea"){var _this$typnMapService5; this.controlSnowData();this.clearMarker();this.hideAllInfoLayer();this.lastBounds="";this.updateColorGuideByMapType();this.resetWeatherLayer();(_this$typnMapService5=this.typnMapService)===null||_this$typnMapService5=== void 0?void 0:_this$typnMapService5.resetTypnRainLayer();this.element.find("button.wind").attr("disabled",false);if(this.bLastWindLayer&&this.windLayer){this.onOffWindLayer(true);this.element.find("button.wind").attr("disabled", true).addClass("on")}naver.maps.Event.trigger(this.naverMap,"bounds_changed");if(this.windLayer&&this.windLayer.getMap())this.showSlider();else this.hideSlider();this.lastVisualMapType=this.visualMapType; this.drawMarkerForDongPosition()}else if(this.isAqfVisualMapType(this.visualMapType)){var _this$typnMapService6;this.hideAllInfoLayer();this.clearMarker();this.showMapAqfButton();this.element.find("button.wind").attr("disabled", true).removeClass("on");this.lastBounds="";this.resetWeatherLayer();this.resetWindLayer();(_this$typnMapService6=this.typnMapService)===null||_this$typnMapService6===void 0?void 0:_this$typnMapService6.resetTypnRainLayer(); naver.maps.Event.trigger(this.naverMap,"bounds_changed");if(!this.isAqfKoreaResolution()){this.naverMap.setOptions({maxZoom:this.nEastAsiaAqfMaxZoom});this.updateZoomBtn()}this.updateColorGuideByMapType(); this.hideLayerSnow();if(["today","air"].includes(menu))oCommon.fnAddTrackElementVisible(this.element,function(){return _this9.ajaxAqfImage()}); else this.ajaxAqfImage();if(menu!=="air"){this.toggleAqfTooltip(4E3);this.drawMarkerForDongPosition()}}else if(this.isVideoVisualMapType(this.visualMapType)){var _this$typnMapService7;this.hideAllInfoLayer(); this.clearMarker();this.lastBounds="";this.element.find("button.wind").attr("disabled",true).removeClass("on");if(this.isDomesticRegion)this.showSlider();this.resetWeatherLayer();this.resetWindLayer(); (_this$typnMapService7=this.typnMapService)===null||_this$typnMapService7===void 0?void 0:_this$typnMapService7.resetTypnRainLayer();naver.maps.Event.trigger(this.naverMap,"bounds_changed");this.updateColorGuideByMapType(); this.hideLayerSnow();if(["today","air"].includes(menu))oCommon.fnAddTrackElementVisible(this.element,function(){return _this9.ajaxSrmImage()}); else this.ajaxSrmImage();this.drawMarkerForDongPosition()}else if(this.isObservationVisualMapType(this.visualMapType)){var _this$typnMapService8;this.hideAllInfoLayer();this.hideSlider();var initRegion= "";if(this.isAwsVisualMapType(this.visualMapType)){var _this$templateData32,_this$templateData32$,_this$templateData33,_this$templateData34,_this$templateData35,_this$templateData35$;this.addAwsCacheData((_this$templateData32= this.templateData)===null||_this$templateData32===void 0?void 0:(_this$templateData32$=_this$templateData32.region)===null||_this$templateData32$===void 0?void 0:_this$templateData32$.naverRgnCd,(_this$templateData33= this.templateData)===null||_this$templateData33===void 0?void 0:_this$templateData33.region,(_this$templateData34=this.templateData)===null||_this$templateData34===void 0?void 0:_this$templateData34.awsWetrList); initRegion=(_this$templateData35=this.templateData)===null||_this$templateData35===void 0?void 0:(_this$templateData35$=_this$templateData35.region)===null||_this$templateData35$===void 0?void 0:_this$templateData35$.naverRgnCd}else{var _this$templateData36, _2,_this$templateData37;this.addAsosCacheData((_this$templateData36=this.templateData)===null||_this$templateData36===void 0?void 0:_this$templateData36.asosWetrList);initRegion=(_2=(((_this$templateData37= this.templateData)===null||_this$templateData37===void 0?void 0:_this$templateData37.asosWetrList)||[])[0])===null||_2===void 0?void 0:_2.asosWetrRgnCd}var region;var dataList;if(this.isAwsVisualMapType(this.lastVisualMapType)&& this.isAwsVisualMapType(this.visualMapType)){this.updateMarkerByMapType();region=this.awsRegionCacheMap.get(this.selectedRegionCode);dataList=this.awsCacheMap.get(this.selectedRegionCode)}else if(this.visualMapType!== this.lastVisualMapType){this.clearMarker();this.lastBounds="";this.setLastObsAplYmdt("");naver.maps.Event.trigger(this.naverMap,"bounds_changed")}if(!region||!dataList){region=this.isAwsVisualMapType(this.visualMapType)? this.awsRegionCacheMap.get(initRegion):this.asosRegionCacheMap.get(initRegion);dataList=this.isAwsVisualMapType(this.visualMapType)?this.awsCacheMap.get(initRegion):this.asosCacheMap.get(initRegion)}this.initSelectedRegionHourlyObsCard(region, dataList);this.updateColorGuideByMapType();this.resetWeatherLayer();this.resetWindLayer();(_this$typnMapService8=this.typnMapService)===null||_this$typnMapService8===void 0?void 0:_this$typnMapService8.resetTypnRainLayer(); this.drawMarkerForDongPosition()}else if(this.visualMapType==="talk");else if(this.isTypnVisualMapType(this.visualMapType)){var _this$typnMapService9;this.hideAllInfoLayer();this.clearMarker();this.lastBounds= "";this.element.find("button.wind").attr("disabled",true).removeClass("on");this.resetWeatherLayer();this.resetWindLayer();naver.maps.Event.trigger(this.naverMap,"bounds_changed");this.updateColorGuideByMapType(); this.showSlider();this.hideLayerSnow();(_this$typnMapService9=this.typnMapService)===null||_this$typnMapService9===void 0?void 0:_this$typnMapService9.changeMapTab();this.lastVisualMapType=this.visualMapType}else if(this.isWarnVisualMapType(this.visualMapType)){var _this$typnMapService0, _this$warnMapService8;this.hideAllInfoLayer();this.clearMarker();this.lastBounds="";this.element.find("button.wind").attr("disabled",true).removeClass("on");if(this.element.find(".btn_pin_wrap ._cnBtnCctv").hasClass("on"))this.element.find(".btn_pin_wrap ._cnBtnCctv").click(); this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",true);this.resetWeatherLayer();this.resetWindLayer();(_this$typnMapService0=this.typnMapService)===null||_this$typnMapService0===void 0?void 0: _this$typnMapService0.resetTypnRainLayer();naver.maps.Event.trigger(this.naverMap,"bounds_changed");this.updateColorGuideByMapType();this.hideSlider();this.hideLayerSnow();(_this$warnMapService8=this.warnMapService)=== null||_this$warnMapService8===void 0?void 0:_this$warnMapService8.drawWarningPolygon();this.lastVisualMapType=this.visualMapType}else if(this.isEqkVisualMapType(this.visualMapType)){var _this$typnMapService1; this.hideAllInfoLayer();this.clearMarker();this.lastBounds="";this.element.find("button.wind").attr("disabled",true).removeClass("on");this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",false); this.resetWeatherLayer();this.resetWindLayer();(_this$typnMapService1=this.typnMapService)===null||_this$typnMapService1===void 0?void 0:_this$typnMapService1.resetTypnRainLayer();naver.maps.Event.trigger(this.naverMap, "bounds_changed");this.updateColorGuideByMapType();this.hideSlider();this.hideLayerSnow();if(this.eqkMapService)this.eqkMapService.renderEqkCard();else this.element.find(".map_warning_exception").closest(".map_warning").removeClass("hide"); this.lastVisualMapType=this.visualMapType}else{var _this$typnMapService10;if(["sea","sat","rdr","maple","aws1h","aws1d","asos","air","pm10","pm25","talk"].includes(this.lastVisualMapType)||this.isDisasterVisualMapType(this.lastVisualMapType)){this.clearMarker(); if(this.isObservationVisualMapType(this.lastVisualMapType)||this.isAirVisualMapType(this.lastVisualMapType)||this.lastVisualMapType==="talk")this.lastBounds="";naver.maps.Event.trigger(this.naverMap,"bounds_changed")}this.hideAllInfoLayer(); this.element.find("._wetrInfo").removeClass("hide");this.element.find("._wetrInfo .layer_title .label").html(this.getSelectedVisualMapTypeTitle());if(this.isDomesticRegion)this.showSlider();this.updateHourlyCardByMapType(); this.updateMarkerByMapType();this.updateColorGuideByMapType();this.initializeScroll(this.element.find('.scroll_area[data-name\x3d"'.concat(this.visualHourlyId,'"]')));this.initializeSlidePosition();(_this$typnMapService10= this.typnMapService)===null||_this$typnMapService10===void 0?void 0:_this$typnMapService10.resetTypnRainLayer();if(this.bLastWindLayer&&this.windLayer){this.windLayer.setMap(this.naverMap);this.element.find("button.wind").attr("disabled", false).addClass("on")}if(["sat","rdr","maple","aws1h","aws1d","asos","air","pm10","pm25","talk","typn"].includes(this.lastVisualMapType))setTimeout(function(){_this.overlayWeatherLayer()},200); else this.overlayWeatherLayer()}if(oCommon.fnGetOpenOrNot(this.element.find("._cnMapInfoBtn")))this.toggleMapDesc(true);this.checkCctvStatus()}}, {key:"checkCctvStatus",value:function checkCctvStatus(){var cctvInstance=this.cctvService?this.cctvService.getCctvInstance():null;var _this=this;if(cctvInstance&&cctvInstance.getMap())setTimeout(function(){_this.cctvService.setOnCctv()}, 200)}}, {key:"changeMapTypeId",value:function changeMapTypeId(visualMapType){this.naverMap.setMapTypeId(this.mapTypeIdMapping[visualMapType]||this.mapTypeIdMapping["default"])}}, {key:"changeAqfResolution",value:function changeAqfResolution(e){var $target=$(e.currentTarget);this.isAqfResChanged=this.aqfResolution!==$target.data("type");this.hideAqfException();this.hideFloatingMarker(); this.isAqfException=false;if(this.isAqfResChanged){var isEastAsia=$target.data("type")!=="9km";this.naverMap.setOptions({maxZoom:isEastAsia?this.nEastAsiaAqfMaxZoom:this.nMaxZoom});this.naverMap.morph(this.oBasePosition, isEastAsia?this.nMinZoom:this.nStartZoom);this.updateZoomBtn()}this.aqfResolution=$target.data("type");this.element.find("._cnMapAqfButton ._cnMapPmBtn").attr("aria-pressed",false);$target.attr("aria-pressed", true);var sendTypeClickCode=this.isAqfKoreaResolution()?"aqfkor":"aqfasia";oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(sendTypeClickCode));this.hideGroundOverlay(); this.ajaxAqfImage()}}, {key:"showMapAqfButton",value:function showMapAqfButton(){if(this.isAqfVisualMapType(this.visualMapType)&&menu!=="air")this.element.find("._cnMapAqfButton").removeClass("hide")}}, {key:"hideMapAqfButton",value:function hideMapAqfButton(){this.element.find("._cnMapAqfButton").addClass("hide")}}, {key:"toggleAqfTooltip",value:function toggleAqfTooltip(param){var _this0=this;var $aqfInfo=this.element.find("._cnAqfInfoLayer");var isOpen=oCommon.fnGetOpenOrNot($aqfInfo);oCommon.fnCloseAllInfoLayer(); if(this.aqfTimeout){clearTimeout(this.aqfTimeout);this.aqfTimeout=null}if(Number.isInteger(param)){oCommon.fnOpenInfoLayer($aqfInfo);this.aqfTimeout=setTimeout(function(){$aqfInfo.attr("aria-pressed",false); _this0.aqfTimeout=null},param)}else{if(!isOpen)oCommon.fnOpenInfoLayer($aqfInfo); oCommon.fnSendClick(param,"".concat(blockPageNameEn,".").concat(this.clickCode,"aqfinfo"))}}}, {key:"hideAqfTooltip",value:function hideAqfTooltip(e){var $aqfInfo=this.element.find("._cnAqfInfoLayer");if(this.aqfTimeout){clearTimeout(this.aqfTimeout);this.aqfTimeout=null}$aqfInfo.attr("aria-pressed", false);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"aqfinfox"))}}, {key:"showAqfException",value:function showAqfException(timeout){var _this1=this;if(this.isAqfVisualMapType(this.visualMapType)){var $aqfException=this.element.find("._cnAqfException");if(this.aqfExceptionTimeout){clearTimeout(this.aqfExceptionTimeout); this.aqfExceptionTimeout=null}if(Number.isInteger(timeout)){$aqfException.removeClass("hide");this.aqfExceptionTimeout=setTimeout(function(){$aqfException.addClass("hide");_this1.aqfExceptionTimeout=null}, timeout)}else $aqfException.removeClass("hide"); this.isAqfException=true;if(this.isAirAqfMode()){var html='\x3ca href\x3d"https://www.nier.go.kr/" class\x3d"link_go" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'source\')" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"nier"}\'\x3e\uad6d\ub9bd\ud658\uacbd\uacfc\ud559\uc6d0\x3c/a\x3e\x3cspan class\x3d"margin_left margin_right"\x3e\uc81c\uacf5.\x3c/span\x3e'); this.element.find(".offer_area").html(html).removeClass("hide")}}}}, {key:"hideAqfException",value:function hideAqfException(){this.element.find("._cnAqfException").addClass("hide")}}, {key:"isAqfKoreaResolution",value:function isAqfKoreaResolution(){return this.aqfResolution==="9km"}}, {key:"getAqfPhotoType",value:function getAqfPhotoType(visualMapType,aqfResolution){return"".concat(visualMapType.toUpperCase(),"_").concat(aqfResolution.toUpperCase())}}, {key:"ajaxAqfImage",value:function ajaxAqfImage(){var _this10=this;var aqfPhotoType=this.getAqfPhotoType(this.visualMapType,this.aqfResolution);var choiceQueryString={"visualMapAqfImage":{"photoType":this.aqfPhotoType[aqfPhotoType].type, "srcResolution":this.aqfPhotoType[aqfPhotoType].srcResolution,"limit":this.aqfPhotoType[aqfPhotoType].limit}};return oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){if(_.isEmpty(result.visualMapAqfImage)|| result.visualMapAqfImage.length<12){_this10.showAqfException();_this10.hideSlider();return}if(_this10.isDomesticRegion)_this10.showSlider();else{_this10.hideSlider();return}_this10.aqfCacheMap=_this10.updateCacheMap(_this10.aqfCacheMap, result.visualMapAqfImage,aqfPhotoType);_this10.drawAqfImage()}).fail(function(){_this10.showAqfException(); _this10.hideSlider()})}}, {key:"drawAqfImage",value:function drawAqfImage(){var _this$aqfCacheMap$get;this.aqfUrlList=(_this$aqfCacheMap$get=this.aqfCacheMap.get(this.getAqfPhotoType(this.visualMapType,this.aqfResolution)))===null|| _this$aqfCacheMap$get===void 0?void 0:_this$aqfCacheMap$get.map(function(obj){return"".concat(staticDomain,"/aqfImage/").concat(obj.photoNm)}); var groundOverlay=this.drawImageOnGroundOverlay(this.aqfUrlList,this.aqfResolution);var aqfType=this.getAqfPhotoType(this.visualMapType,this.aqfResolution);this.groundOverlayMap.set(aqfType,groundOverlay); this.aqfTimeSeriesList=this.aqfCacheMap.get(aqfType).map(function(obj){return obj.photoYmdt}); this.renderSliderDate(this.aqfTimeSeriesList);this.lastVisualMapType=this.visualMapType;if(this.isAqfKoreaResolution())this.initCanvas(this.aqfUrlList);if(this.isAirAqfMode())try{var _aqfType=this.getAqfPhotoType(this.visualMapType, this.aqfResolution);var obsYmdt=this.aqfCacheMap.get(_aqfType).map(function(o){return o.fcastYmdt}).reduce(function(latest,current){return current>latest?current:latest},this.aqfCacheMap.get(_aqfType)[0].fcastYmdt); var html='\x3ca href\x3d"https://www.nier.go.kr/" class\x3d"link_go" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn,".").concat(this.clickCode,'source\')" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"nier"}\'\x3e\uad6d\ub9bd\ud658\uacbd\uacfc\ud559\uc6d0\x3c/a\x3e\x3cspan class\x3d"margin_left margin_right"\x3e\uc81c\uacf5.\x3c/span\x3e\x3cspan\x3e\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 ').concat(moment(obsYmdt, "YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm"),"\x3c/span\x3e");this.element.find(".offer_area").html(html).removeClass("hide")}catch(e){var _html='\x3ca href\x3d"https://www.nier.go.kr/" class\x3d"link_go" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'source\')" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"nier"}\'\x3e\uad6d\ub9bd\ud658\uacbd\uacfc\ud559\uc6d0\x3c/a\x3e\x3cspan class\x3d"margin_left margin_right"\x3e\uc81c\uacf5.\x3c/span\x3e'); this.element.find(".offer_area").html(_html).removeClass("hide")}}}, {key:"ajaxSrmImage",value:function ajaxSrmImage(){var _this11=this;var choiceQueryString={"visualMapSrmImage":{"photoType":this.srmPhotoType[this.visualMapType.toUpperCase()].type,"limit":this.srmPhotoType[this.visualMapType.toUpperCase()].limit}}; oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){_this11.srmCacheMap=_this11.updateCacheMap(_this11.srmCacheMap,result.visualMapSrmImage,_this11.visualMapType);_this11.drawSrmImage(); if(menu==="today"){var html;try{var obsYmdt=_this11.getLatestObservationTime(_this11.initVisualMapType);html=_this11.createOfferAreaHtml(obsYmdt)}catch(e){html=_this11.createOfferAreaHtml()}_this11.element.find(".offer_area").html(html).removeClass("hide")}})}}, {key:"ajaxSrmBounds",value:function ajaxSrmBounds(){var _this=this;var oLatLngBounds=this.naverMap.getBounds();if(!$.isEmptyObject(oLatLngBounds)){var nMinX=oLatLngBounds.minX();var nMinY=oLatLngBounds.minY(); var nMaxX=oLatLngBounds.maxX();var nMaxY=oLatLngBounds.maxY();var sBounds=nMinX+"#"+nMinY+"#"+nMaxX+"#"+nMaxY;var choiceQueryString={"visualMapSrmBounds":{"visualMapType":this.visualMapType,"bounds":sBounds}}; oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){var _result$visualMapSrmB;var coordinateType=result===null||result===void 0?void 0:(_result$visualMapSrmB=result.visualMapSrmBounds)=== null||_result$visualMapSrmB===void 0?void 0:_result$visualMapSrmB.coordinateType;if(coordinateType)_this.changeMapBtnStatus(coordinateType)})}}}, {key:"drawSrmImage",value:function drawSrmImage(){var _this$srmCacheMap$get;this.srmUrlList=(_this$srmCacheMap$get=this.srmCacheMap.get(this.visualMapType))===null||_this$srmCacheMap$get===void 0?void 0: _this$srmCacheMap$get.map(function(obj){return"".concat(staticDomain,"/srmImage/").concat(obj.photoNm)}); var groundOverlay=this.drawImageOnGroundOverlay(this.srmUrlList,this.visualMapType);this.groundOverlayMap.set(this.visualMapType,groundOverlay);this.srmTimeSeriesList=this.srmCacheMap.get(this.visualMapType).map(function(obj){return obj.photoYmdt}); this.renderSliderDate(this.srmTimeSeriesList);this.lastVisualMapType=this.visualMapType;if(this.visualMapType==="rdr"||this.visualMapType==="maple")this.initCanvas(this.srmUrlList)}}, {key:"updateCacheMap",value:function updateCacheMap(cacheMap,resultImage,getPhotoType){var _this12=this;if(cacheMap.has(getPhotoType))cacheMap.set(getPhotoType,[]);return resultImage===null||resultImage=== void 0?void 0:resultImage.reduce(function(acc,obj){var photoType=obj.photoType,_obj$srcResolution=obj.srcResolution,srcResolution=_obj$srcResolution===void 0?null:_obj$srcResolution,rest=_objectWithoutProperties(obj, ["photoType","srcResolution"]);var type=photoType;if(srcResolution)type=_this12.getAqfPhotoType(photoType,srcResolution);if(!acc.has(type))acc.set(type,[]);acc.get(type).push(rest);return acc},cacheMap)}}, {key:"drawImageOnGroundOverlay",value:function drawImageOnGroundOverlay(urlList,boundType){var _urlList$this$getSlid;var _this=this;var bounds=oPhotoBounds;var groundOverlay=new naver.maps.GroundOverlay((_urlList$this$getSlid= urlList[this.getSliderPositionIndex()])!==null&&_urlList$this$getSlid!==void 0?_urlList$this$getSlid:urlList[0],new naver.maps.LatLngBounds(new naver.maps.LatLng(bounds[boundType.toUpperCase()].southWestLat, bounds[boundType.toUpperCase()].southWestLng),new naver.maps.LatLng(bounds[boundType.toUpperCase()].northEastLat,bounds[boundType.toUpperCase()].northEastLng)),{opacity:this.checkImageOpacity(),clickable:false, crossOrigin:"anonymous"});groundOverlay.customSetUrl=function(imgUrl){var newImg=this._img.cloneNode();var oldImg=this._img;var overlay=this;newImg.style.display="none";this._wrapper.appendChild(newImg); this._img=newImg;this.setUrl(imgUrl);this._img=oldImg;newImg.decode().then(function(){showNewImg()})["catch"](function(){showNewImg()}); function showNewImg(){var _oldImg$parentNode,_overlay$_wrapper;newImg.style.display="";overlay._img=newImg;(_oldImg$parentNode=oldImg.parentNode)===null||_oldImg$parentNode===void 0?void 0:_oldImg$parentNode.removeChild(oldImg); (_overlay$_wrapper=overlay._wrapper)===null||_overlay$_wrapper===void 0?void 0:_overlay$_wrapper.replaceChildren(newImg);_this.createImageHtmlCanvas(newImg)} }; groundOverlay._wrapper.style.pointerEvents="none";groundOverlay.setMap(this.naverMap);return groundOverlay}}, {key:"initCanvas",value:function initCanvas(imageUrlList){var _this13=this,_imageUrlList$this$ge;if(this.canvas!==undefined)this.canvas.remove();this.canvas=document.createElement("canvas");this.canvas.style.display= "none";this.context=this.canvas.getContext("2d",{willReadFrequently:true,alpha:false,desynchronized:true});var img=new Image;img.crossOrigin="anonymous";img.onload=function(){_this13.drawImageOnCanvas(img)}; var imageUrl=(_imageUrlList$this$ge=imageUrlList[this.getSliderPositionIndex()])!==null&&_imageUrlList$this$ge!==void 0?_imageUrlList$this$ge:imageUrlList[0];img.onerror=function(){_this13.canvasLoad=false; _this13.hideFloatingMarker();oCommon.fnSendErrorToNelo("[visualMapJs.js] canvas image load fail ".concat(imageUrl),null)}; img.src=imageUrl}}, {key:"drawImageOnCanvas",value:function drawImageOnCanvas(img){if(this.visualMapType!=="rdr"&&this.visualMapType!=="maple"&&!this.isAqfVisualMapType(this.visualMapType))return;if(this.isAqfVisualMapType(this.visualMapType)&& !img.src.includes("9KM"))return;this.canvasLoad=true;this.selectedImage=img;var originWidth=img.naturalWidth;var originHeight=img.naturalHeight;this.canvas.width=originWidth;this.canvas.height=originHeight; this.context.clearRect(0,0,this.canvas.width,this.canvas.height);this.context.drawImage(img,0,0,originWidth,originHeight);this.colorAtCoord(this.naverMap.getCenter());this.renderFloatingMarker()}}, {key:"renderFloatingMarker",value:function renderFloatingMarker(){if(this.visualMapType!=="rdr"&&this.visualMapType!=="maple"&&!this.isAqfVisualMapType(this.visualMapType)||this.isAqfException||!this.canvasLoad)return; var html;if(this.isAqfVisualMapType(this.visualMapType)){if(!this.isAqfKoreaResolution())return;html='\n \x3cdiv class\x3d"precipitation_marker type_pm"\x3e\n \x3cdiv class\x3d"precipitation_marker_inner"\x3e\n \x3cspan class\x3d"precipitation_marker_title"\x3e'.concat(this.visualMapType=== "pm10"?"PM10":"PM2.5",' \uc608\uce21\x3c/span\x3e\n\n \x3cstrong class\x3d"precipitation_marker_data"\x3e0\x3c/strong\x3e\n \x3cspan class\x3d"precipitation_marker_unit"\x3e\u338d\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ')}else html= '\n \x3cdiv class\x3d"precipitation_marker"\x3e\n \x3cdiv class\x3d"precipitation_marker_inner"\x3e\n \x3cspan class\x3d"precipitation_marker_title"\x3e\uac15\uc218\ub7c9\x3c/span\x3e\n\n \x3cstrong class\x3d"precipitation_marker_data"\x3e0\x3c/strong\x3e\n \x3cspan class\x3d"precipitation_marker_unit"\x3emm/h\x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '; if(!this.element.find(".layer_cctv").hasClass("on"))if(this.element.find(".precipitation_marker").length===0)this.element.append(html);else this.element.find(".precipitation_marker").replaceWith(html); var $targetMarker=this.element.find(".precipitation_marker");$targetMarker.show();this.colorAtCoord(this.naverMap.getCenter())}}, {key:"hideFloatingMarker",value:function hideFloatingMarker(){this.element.find(".precipitation_marker").addClass("hide")}}, {key:"createImageHtmlCanvas",value:function createImageHtmlCanvas(img){var _this14=this;if(this.visualMapType!=="rdr"&&this.visualMapType!=="maple"&&!this.isAqfVisualMapType(this.visualMapType))return; if(this.isAqfVisualMapType(this.visualMapType)&&!this.isAqfKoreaResolution())return;if(!img){this.canvasLoad=false;this.hideFloatingMarker();oCommon.fnSendErrorToNelo("[visualMapJs.js] Invalid image provided to canvas", null);return}if(img.complete)this.drawImageOnCanvas(img);else{img.onload=function(){_this14.drawImageOnCanvas(img)}; img.onerror=function(){_this14.canvasLoad=false;_this14.hideFloatingMarker();oCommon.fnSendErrorToNelo("[visualMapJs.js] canvas image load fail ".concat(img.src),null)}}}}, {key:"colorAtCoord",value:function colorAtCoord(coord){if(this.selectedImage===undefined||this.isAqfException)return;var originWidth=this.selectedImage.naturalWidth;var originHeight=this.selectedImage.naturalHeight; var pixel=this.coordToPixel(coord,originWidth,originHeight);if(!pixel)return;var _this$context$getImag=_slicedToArray(this.context.getImageData(pixel.x,pixel.y,1,1).data,3),r=_this$context$getImag[0],g= _this$context$getImag[1],b=_this$context$getImag[2];this.updateValueAtColor(r,g,b)}}, {key:"updateValueAtColor",value:function updateValueAtColor(r,g,b){var colorGuideMap=this.isAqfVisualMapType(this.visualMapType)?this.visualMapType==="pm10"?this.pm10ColorGuideMap:this.pm25ColorGuideMap: this.rainColorGuideMap;var value=colorGuideMap["".concat(r,",").concat(g,",").concat(b)];if(value&&value.length>=4)this.element.find(".precipitation_marker.type_pm").addClass("type_count");else this.element.find(".precipitation_marker.type_pm").removeClass("type_count"); this.element.find(".precipitation_marker_data").html(value)}}, {key:"mercatorXfromLng",value:function mercatorXfromLng(lng){return(180+lng)/360}}, {key:"mercatorYfromLat",value:function mercatorYfromLat(lat){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+lat*Math.PI/360)))/360}}, {key:"coordToPixel",value:function coordToPixel(coord,imgWidth,imgHeight){var _this$groundOverlayMa,_this$groundOverlayMa2,_this$groundOverlayMa3,_this$groundOverlayMa4;var mapType=this.isAqfVisualMapType(this.visualMapType)? this.getAqfPhotoType(this.visualMapType,this.aqfResolution):this.visualMapType;var min=(_this$groundOverlayMa=this.groundOverlayMap.get(mapType))===null||_this$groundOverlayMa===void 0?void 0:(_this$groundOverlayMa2= _this$groundOverlayMa.bounds)===null||_this$groundOverlayMa2===void 0?void 0:_this$groundOverlayMa2.getMin();var max=(_this$groundOverlayMa3=this.groundOverlayMap.get(mapType))===null||_this$groundOverlayMa3=== void 0?void 0:(_this$groundOverlayMa4=_this$groundOverlayMa3.bounds)===null||_this$groundOverlayMa4===void 0?void 0:_this$groundOverlayMa4.getMax();if(min==null||max==null)return null;var minX=this.mercatorXfromLng(min.x); var minY=this.mercatorYfromLat(min.y);var maxX=this.mercatorXfromLng(max.x);var maxY=this.mercatorYfromLat(max.y);var x=this.mercatorXfromLng(coord.x);var y=this.mercatorYfromLat(coord.y);return(new naver.maps.Point((x- minX)/(maxX-minX)*imgWidth,(maxY-y)/(maxY-minY)*imgHeight)).round()}}, {key:"checkImageOpacity",value:function checkImageOpacity(){if(this.isAqfVisualMapType(this.visualMapType))return.5;return this.naverMap.getZoom()0?filteredTimeSeries:timeSeries.time_series; weatherTime=(_this15$timeSeriesLis=_this15.timeSeriesList[index])!==null&&_this15$timeSeriesLis!==void 0?_this15$timeSeriesLis:_this15.timeSeriesList[0];weatherOptions={type:weatherType,time:weatherTime}; if(!_this15.weatherLayer)_this15.weatherLayer=new naver.maps.WeatherLayer(weatherOptions);else _this15.weatherLayer.setOptions(weatherOptions);_this15.initSelectedRegionHourlyCardOnce();_this15.weatherLayer.setMap(_this15.naverMap); _this15.renderSliderDate(_this15.timeSeriesList)})["finally"](function(){_this15.lastVisualMapType=_this15.visualMapType}); else{this.weatherLayer.setMap(this.naverMap);this.weatherLayer.setWeatherType(weatherType);this.renderSliderDate(this.timeSeriesList);this.lastVisualMapType=this.visualMapType}}}, {key:"resetWeatherLayer",value:function resetWeatherLayer(){if(this.weatherLayer&&this.weatherLayer.getMap())this.weatherLayer.setMap(null)}}, {key:"resetWindLayer",value:function resetWindLayer(){if(this.windLayer&&this.windLayer.getMap())this.windLayer.setMap(null)}}, {key:"getLastWeatherEntry",value:function getLastWeatherEntry(templateData){if(!_.isEmpty(templateData.region.worldRgnCd))return!_.isEmpty(templateData.overseasHourlyFcastList)?templateData.overseasHourlyFcastList[templateData.overseasHourlyFcastList.length- 1]:null;else return!_.isEmpty(templateData.domesticWetrList)?templateData.domesticWetrList[templateData.domesticWetrList.length-1]:null}}, {key:"converWetrMapToList",value:function converWetrMapToList(wetrMap){if(!wetrMap)return[];var wetrDataArray=Array.from(wetrMap,function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1]; return{key:key,value:value}}); var removedArray=_.map(wetrDataArray,"value").splice(1);if(removedArray.length>this.timeSeriesList.length)removedArray.splice(this.timeSeriesList.length-1);while(removedArray.length>0&&removedArray[removedArray.length- 1].aplYmd+removedArray[removedArray.length-1].aplTm+"00">this.timeSeriesList[this.timeSeriesList.length-1])removedArray.pop();return removedArray}}, {key:"initSelectedRegionHourlyCardOnce",value:function initSelectedRegionHourlyCardOnce(){var _this=this;var tempList=new Array;var now=moment().format("YYYYMMDDHHmm");if("sea"!==this.visualMapType)if(_.isEmpty(this.templateData.region.worldRgnCd)){var _this$templateData$do; (_this$templateData$do=this.templateData.domesticWetrList)===null||_this$templateData$do===void 0?void 0:_this$templateData$do.forEach(function(wetr,index){var aplYmdt=wetr.aplYmd+wetr.aplTm+"00";if(aplYmdt> now&&aplYmdt<=_this.timeSeriesList[_this.timeSeriesList.length-1])tempList.push(wetr)}); this.renderSelectedRegionHourlyCardForDomestic(this.templateData.region,tempList)}else{var _this$templateData$ov;(_this$templateData$ov=this.templateData.overseasHourlyFcastList)===null||_this$templateData$ov=== void 0?void 0:_this$templateData$ov.forEach(function(wetr,index){var aplYmdt=wetr.aplYmd+wetr.aplTm+"00";if(aplYmdt>now&&aplYmdt<=_this.timeSeriesList[_this.timeSeriesList.length-1])tempList.push(wetr)}); this.renderSelectedRegionHourlyCardForOverseas(this.templateData.region,tempList)}}}, {key:"initSelectedRegionHourlyObsCard",value:function initSelectedRegionHourlyObsCard(selectedRegion,selectedDataList){var tempList=new Array;var region={};var latestValue=null;var dataList=_toConsumableArray(selectedDataList.values())|| [];if(dataList.length===0)return;latestValue=dataList[dataList.length-1];var nowYmdt=latestValue.aplYmdt;if(this.getLastObsAplYmdt()){if(this.getLastObsAplYmdt()>nowYmdt)nowYmdt=this.getLastObsAplYmdt()}else this.setLastObsAplYmdt(latestValue.aplYmdt); var now=moment(nowYmdt,"YYYYMMDDHH");var minTime=now.subtract(1,"days");var yesterday;if(nowYmdt.endsWith("00"))yesterday=minTime.format("YYYYMMDDHH");else yesterday=moment().format("YYYYMMDD00");if(this.isAwsVisualMapType(this.visualMapType)){var _latestValue; while(nowYmdt>=minTime.format("YYYYMMDDHH")){var currentYmdt=minTime.format("YYYYMMDDHH");var aws=selectedDataList.get(currentYmdt);var timeValue=moment(currentYmdt,"YYYYMMDDHH").format("HH")+"\uc2dc"; var nowClass="";if(currentYmdt===yesterday){timeValue="\uc5b4\uc81c";nowClass="type_now"}else if(currentYmdt===nowYmdt){nowClass="type_data is-data";if(this.visualMapType==="aws1d")timeValue="\ud604\uc7ac"; else timeValue="\ucd5c\uadfc 1\uc2dc\uac04"}if(aws)if(this.visualMapType==="aws1d")tempList.push({"mainDataName":"\uc77c\uac04","subDataName":"1H","mainData":aws===null||aws===void 0?void 0:aws.rainAmtDay, "subData":(aws===null||aws===void 0?void 0:aws.rainAmt_60m)?aws===null||aws===void 0?void 0:aws.rainAmt_60m:aws===null||aws===void 0?void 0:aws.rainAmt60m,"timeValue":timeValue,"aplYmdt":currentYmdt,"nowClass":nowClass}); else tempList.push({"mainDataName":"1H","subDataName":"\uc77c\uac04","mainData":(aws===null||aws===void 0?void 0:aws.rainAmt_60m)?aws===null||aws===void 0?void 0:aws.rainAmt_60m:aws===null||aws===void 0? void 0:aws.rainAmt60m,"subData":aws===null||aws===void 0?void 0:aws.rainAmtDay,"timeValue":timeValue,"aplYmdt":currentYmdt,"nowClass":nowClass});else tempList.push({"mainDataName":"1H","subDataName":"\uc77c\uac04", "mainData":"-","subData":"-","timeValue":timeValue,"aplYmdt":currentYmdt,"nowClass":nowClass});minTime.add(1,"hours")}region.naverRgnCd=selectedRegion.naverRgnCd;region.regionName=selectedRegion.sareaNm; region.obsName=((_latestValue=latestValue)===null||_latestValue===void 0?void 0:_latestValue.rgnNm)+" \uad00\uce21\uc18c \uae30\uc900 \uac15\uc218\ub7c9"}else{var _latestValue2;while(nowYmdt>=minTime.format("YYYYMMDDHH")){var _currentYmdt= minTime.format("YYYYMMDDHH");var asos=selectedDataList.get(_currentYmdt);var _timeValue=moment(_currentYmdt,"YYYYMMDDHH").format("HH")+"\uc2dc";var _nowClass="";if(_currentYmdt===yesterday){_timeValue= "\uc5b4\uc81c";_nowClass="type_now"}else if(_currentYmdt===nowYmdt){_nowClass="type_data is-data";_timeValue="\ud604\uc7ac"}if(asos)tempList.push({"mainDataName":"\ub204\uc801","subDataName":"\uc77c\uac04", "subData":asos===null||asos===void 0?void 0:asos.snowAmt,"mainData":asos===null||asos===void 0?void 0:asos.snowAmtAllday,"timeValue":_timeValue,"aplYmdt":_currentYmdt,"nowClass":_nowClass});else tempList.push({"mainDataName":"\ub204\uc801", "subDataName":"\uc77c\uac04","subData":"-","mainData":"-","timeValue":_timeValue,"aplYmdt":_currentYmdt,"nowClass":_nowClass});minTime.add(1,"hours")}region.naverRgnCd=selectedRegion.naverRgnCd;region.regionName= (((_latestValue2=latestValue)===null||_latestValue2===void 0?void 0:_latestValue2.rgnNm)||"")+" \uad00\uce21\uc18c";region.asosWetrRgnCd=latestValue.asosWetrRgnCd;region.obsName=latestValue.addr}this.updateObservationMarkerTimeSeries(this.getLastObsAplYmdt()); this.renderSelectedRegionHourlyCardForObs(region,tempList)}}, {key:"toggleOverlayWindLayer",value:function toggleOverlayWindLayer(e){var $target=$(e.currentTarget);if($target.hasClass("on")){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode, "windoff"));$target.removeClass("on");this.onOffWindLayer(false)}else{oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"windon"));$target.addClass("on");this.onOffWindLayer(true)}}}, {key:"onOffWindLayer",value:function onOffWindLayer(on){var _this16=this;var weatherType=this.weatherTypeOptions["wind"];var index=_.defaultTo(this.getSliderPositionIndex(),0);var weatherTime;if(on){this.bLastWindLayer= true;if(!this.windLayer)naver.maps.WeatherHelper.loadTimeSeries(weatherType,{caller:this.caller}).then(function(timeSeries){var filteredTimeSeries=timeSeries.time_series;var lastWetr=_this16.getLastWeatherEntry(_this16.templateData); if(lastWetr){var lastTime=lastWetr.aplYmd+lastWetr.aplTm+"00";filteredTimeSeries=timeSeries.time_series.filter(function(time){return time<=lastTime})}_this16.timeSeriesList=filteredTimeSeries.length>0? filteredTimeSeries:timeSeries.time_series; weatherTime=timeSeries.time_series[index];_this16.windLayer=new naver.maps.WeatherWindLayer({time:weatherTime,particleColor:"#ffffffe6",numParticles:_this16.windLayerOptions.numParticles,fadeOpacity:_this16.windLayerOptions.fadeOpacity, speedFactor:_this16.windLayerOptions.speedFactor,dropRate:_this16.windLayerOptions.dropRate,dropRateBump:_this16.windLayerOptions.dropRateBump,caller:_this16.caller});_this16.windLayer.setMap(_this16.naverMap); _this16.showSlider();_this16.renderSliderDate(_this16.timeSeriesList)}); else{this.showSlider();this.windLayer.setMap(this.naverMap);this.windLayer.setWeatherTime(this.timeSeriesList[index]);this.renderSliderDate(this.timeSeriesList)}}else{this.bLastWindLayer=false;if(this.windLayer)this.windLayer.setMap(null); if(this.visualMapType==="sea")this.hideSlider()}}}, {key:"getSliderWidth",value:function getSliderWidth(){var $slider=this.element.find("._slider");if(_.isEmpty($slider))return;return $slider.get(0).getBoundingClientRect().width}}, {key:"updateSliderTextDisplayClass",value:function updateSliderTextDisplayClass(){var sliderWidth=this.getSliderWidth();if(!sliderWidth)return;var dateTexts=this.element.find("._playerRoot .noUi-date .date_text"); dateTexts.each(function(index,date){var dateParent=$(date).parent();var leftPx=parseFloat(dateParent.css("left"))||0;var dateTextWidthHalf=date.getBoundingClientRect().width/2;var isLeftEdge=leftPx<=dateTextWidthHalf; dateParent.toggleClass("left",isLeftEdge);dateParent.toggleClass("start",isLeftEdge&&leftPx===0);var isRightEdge=leftPx>=sliderWidth-dateTextWidthHalf;dateParent.toggleClass("right",isRightEdge);dateParent.toggleClass("end", isRightEdge&&leftPx===sliderWidth)})}}, {key:"updateSliderTooltipDisplayClass",value:function updateSliderTooltipDisplayClass(ratio){var sliderWidth=this.getSliderWidth();if(!sliderWidth)return;var slider=this.element.find("._playerRoot");var tooltip= slider.find(".noUi-tooltip");var handle=slider.find(".noUi-handle");var tooltipWidthHalf=tooltip.get(0).getBoundingClientRect().width/2;var fillWidth=ratio?sliderWidth*ratio:this.element.find("._slider .noUi-connect").get(0).getBoundingClientRect().width; var isLeftEdge=fillWidth<=tooltipWidthHalf;handle.toggleClass("left",isLeftEdge);handle.toggleClass("start",isLeftEdge&&fillWidth===0);var isRightEdge=fillWidth>=sliderWidth-tooltipWidthHalf;handle.toggleClass("right", isRightEdge);handle.toggleClass("end",isRightEdge&&fillWidth===sliderWidth)}}, {key:"renderSliderDate",value:function renderSliderDate(timeSeries){var currentDate=null;var datetimeMap=new Map;var totalLength=timeSeries.length;var keyIndices=[Math.floor(totalLength*.25),Math.floor(totalLength* .5),Math.floor(totalLength*.75)];var _iteratorNormalCompletion4=true;var _didIteratorError4=false;var _iteratorError4=undefined;try{for(var _iterator4=timeSeries.entries()[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4= (_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var _step4$value=_slicedToArray(_step4.value,2),index=_step4$value[0],timestamp=_step4$value[1];var date=moment(timestamp,"YYYYMMDDHHmm"); if(this.isVideoVisualMapType(this.visualMapType)||this.isAqfVisualMapType(this.visualMapType)){if(keyIndices.includes(index))datetimeMap.set(timestamp,index)}else if(!date.isSame(currentDate,"day")){currentDate= date;datetimeMap.set(timestamp,index)}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4["return"]!=null)_iterator4["return"]()}finally{if(_didIteratorError4)throw _iteratorError4; }}this.element.find("._slider").data("duration",timeSeries.length);var html="";var _iteratorNormalCompletion5=true;var _didIteratorError5=false;var _iteratorError5=undefined;try{for(var _iterator5=datetimeMap.entries()[Symbol.iterator](), _step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var _step5$value=_slicedToArray(_step5.value,2),key=_step5$value[0],value=_step5$value[1];if(datetimeMap.size> 1&&value===0)continue;var weekDay=this.dayNames[moment(key,"YYYYMMDDHHmm").day()];var _date=moment(key,"YYYYMMDDHHmm").format("MM.DD.");var shortDate=moment(key,"YYYYMMDDHHmm").format("M/D");var time=moment(key, "YYYYMMDDHHmm").format("HH:mm");var left=value/(timeSeries.length-1)*100;if(this.isVideoVisualMapType(this.visualMapType)||this.isAqfVisualMapType(this.visualMapType))html+='\n\t\t\t\t\t\x3cspan class\x3d"date" style\x3d"left: '.concat(left, '%;"\x3e\n\t\t\t\t\t\t\x3cem class\x3d"date_text"\x3e').concat(time,"\x3c/em\x3e\n\t\t\t\t\t\x3c/span\x3e \n\t\t\t\t");else if(this.isTypnVisualMapType(this.visualMapType))html+='\n\t\t\t\t\t\x3cspan class\x3d"date" style\x3d"left: '.concat(left, '%;"\x3e\n\t\t\t\t\t\t\x3cem class\x3d"date_text"\x3e').concat(shortDate,"\x3c/em\x3e\n\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t");else html+='\n\t\t\t\t\t\x3cspan class\x3d"date" style\x3d"left: '.concat(left, '%;"\x3e\n\t\t\t\t\t\t\x3cem class\x3d"date_text"\x3e').concat(weekDay," ").concat(_date,"\x3c/em\x3e\n\t\t\t\t\t\x3c/span\x3e \n\t\t\t\t")}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&& _iterator5["return"]!=null)_iterator5["return"]()}finally{if(_didIteratorError5)throw _iteratorError5;}}this.element.find(".noUi-date").html(html);this.initSliderBar();this.noUiSliderPlayerService.updateTotalDataCount(); this.noUiSliderPlayerService.updateTotalDuration();this.updateSliderTextDisplayClass();this.updateSliderTooltipDisplayClass();if(this.isVideoVisualMapType(this.lastVisualMapType)||this.isTypnVisualMapType(this.lastVisualMapType)|| this.isTypnVisualMapType(this.visualMapType))this.noUiSliderPlayerService.resetSlider(false);if(this.element.is(":visible")&&this.isVideoVisualMapType(this.visualMapType))this.noUiSliderPlayerService.resetSlider(menu=== "today"?false:true);if(this.isAqfVisualMapType(this.lastVisualMapType)&&!this.isAqfVisualMapType(this.visualMapType)&&!this.isVideoVisualMapType(this.visualMapType))this.noUiSliderPlayerService.resetSlider(false); else if(!this.isAqfVisualMapType(this.lastVisualMapType)&&this.isAqfVisualMapType(this.visualMapType))this.noUiSliderPlayerService.resetSlider(menu!=="air");else if(this.isAqfResChanged){this.noUiSliderPlayerService.resetSlider(menu!== "air");this.isAqfResChanged=false}if(this.isAqfVisualMapType(this.visualMapType)&&!this.hasAqfAutoPlayed){this.noUiSliderPlayerService.resetSlider(menu!=="air");this.hasAqfAutoPlayed=true}if(this.visualMapType=== "snow")this.initializeSlidePosition();if(this.isTypnVisualMapType(this.visualMapType)){var _this$typnMapService12;(_this$typnMapService12=this.typnMapService)===null||_this$typnMapService12===void 0?void 0: _this$typnMapService12.initializeTypnSlidePosition()}}}, {key:"initSliderBar",value:function initSliderBar(){var _this17=this;if(!_.isEmpty(this.oSlider))return;if(!this.debouncedUpdateImageByIndex)this.debouncedUpdateImageByIndex=_.debounce(this.updateImageByIndex.bind(this), 200,{maxWait:500});this.noUiSliderPlayerService=new noUiSliderPlayerService(this.element.find("._playerRoot"),function(index,ratio){var _this17$typnMapServic;_this17.updateMapLayerBySlider(index);(_this17$typnMapServic= _this17.typnMapService)===null||_this17$typnMapServic===void 0?void 0:_this17$typnMapServic.updateTypnRainLayerBySlider(index);_this17.updateImageByIndex(index);_this17.updateSliderBar(index,ratio)},function(index, ratio){_this17.debouncedUpdateImageByIndex(index); _this17.updateSliderBar(index,ratio);_this17.updateSliderTooltipDisplayClass(ratio);requestAnimationFrame(function(){var _this17$typnMapServic2;return(_this17$typnMapServic2=_this17.typnMapService)===null|| _this17$typnMapServic2===void 0?void 0:_this17$typnMapServic2.updateTypnMarkerByTimeSeries(ratio)})},this.clickCode,this.displayPerEach,function(){var _this17$typnMapServic3,_this17$typnMapServic4; return $((_this17$typnMapServic3=_this17.typnMapService)===null||_this17$typnMapServic3===void 0?void 0:(_this17$typnMapServic4=_this17$typnMapServic3.typnMarker)===null||_this17$typnMapServic4===void 0? void 0:_this17$typnMapServic4._wrapper).css("transition","none")},function(){var _this17$typnMapServic5,_this17$typnMapServic6; return $((_this17$typnMapServic5=_this17.typnMapService)===null||_this17$typnMapServic5===void 0?void 0:(_this17$typnMapServic6=_this17$typnMapServic5.typnMarker)===null||_this17$typnMapServic6===void 0? void 0:_this17$typnMapServic6._wrapper).css("transition","transform 0.2s linear")},function(index,ratio){_this17.updateSliderTooltipDisplayClass(ratio); requestAnimationFrame(function(){var _this17$typnMapServic7;return(_this17$typnMapServic7=_this17.typnMapService)===null||_this17$typnMapServic7===void 0?void 0:_this17$typnMapServic7.updateTypnMarkerByTimeSeries(ratio)})}); this.oSlider=this.noUiSliderPlayerService.getSlider()}}, {key:"updateMapLayerBySlider",value:function updateMapLayerBySlider(index){var _this$timeSeriesList;if(this.isVideoVisualMapType(this.visualMapType)||this.isAqfVisualMapType(this.visualMapType)||this.isDisasterVisualMapType(this.visualMapType))return; if(!((_this$timeSeriesList=this.timeSeriesList)===null||_this$timeSeriesList===void 0?void 0:_this$timeSeriesList[index]))return;if(this.weatherLayer&&this.weatherLayer.getMap())this.weatherLayer.setWeatherTime(this.timeSeriesList[index]); if(this.windLayer&&this.windLayer.getMap())this.windLayer.setWeatherTime(this.timeSeriesList[index]);this.updateMarkerByTimeSeries(index)}}, {key:"updateSliderBar",value:function updateSliderBar(index,ratio){this.focusHourlyCardByTimeSeries(index);this.moveScrollByTimeSeries(index);this.updateToolTipByTimeSeries(index,ratio)}}, {key:"updateImageByIndex",value:function updateImageByIndex(index){var imageUrlList;var mapType;if(this.isVideoVisualMapType(this.visualMapType)){imageUrlList=this.srmUrlList;mapType=this.visualMapType}else if(this.isAqfVisualMapType(this.visualMapType)){imageUrlList= this.aqfUrlList;mapType=this.getAqfPhotoType(this.visualMapType,this.aqfResolution)}else return;if(index!==this.sliderLastIndex)if(this.sliderLastIndex!==undefined){var overlay=this.groundOverlayMap.get(mapType); overlay===null||overlay===void 0?void 0:overlay.customSetUrl(imageUrlList[index])}this.sliderLastIndex=index}}, {key:"updateToolTipByTimeSeries",value:function updateToolTipByTimeSeries(index,ratio){var timeSeriesList;if(this.isVideoVisualMapType(this.visualMapType))timeSeriesList=this.srmTimeSeriesList;else if(this.isAqfVisualMapType(this.visualMapType))timeSeriesList= this.aqfTimeSeriesList;else if(this.isTypnVisualMapType(this.visualMapType)){var _this$typnMapService13;timeSeriesList=(_this$typnMapService13=this.typnMapService)===null||_this$typnMapService13===void 0? void 0:_this$typnMapService13.typnTimeSeriesList}else timeSeriesList=this.timeSeriesList;if(!timeSeriesList)return;var weekDay=this.dayNames[moment(timeSeriesList[index],"YYYYMMDDHHmm").day()];var tooltipHtml= '\x3cspan class\x3d"day"\x3e'.concat(weekDay,"\x3c/span\x3e").concat(moment(timeSeriesList[index],"YYYYMMDDHHmm").format("HH:mm"));this.element.find(".noUi-tooltip").html(tooltipHtml)}}, {key:"updateZoomBtn",value:function updateZoomBtn(){var zoomLevel=Math.round(this.naverMap.getZoom());if(zoomLevel===this.naverMap.getMaxZoom()){this.element.find(".btn_zoom_in").addClass("disable_type").attr("disabled", true);this.element.find(".btn_zoom_out").removeClass("disable_type").attr("disabled",false)}else if(zoomLevel===this.naverMap.getMinZoom()){this.element.find(".btn_zoom_out").addClass("disable_type").attr("disabled", true);this.element.find(".btn_zoom_in").removeClass("disable_type").attr("disabled",false)}else{this.element.find(".btn_zoom_out").removeClass("disable_type").attr("disabled",false);this.element.find(".btn_zoom_in").removeClass("disable_type").attr("disabled", false)}}}, {key:"changeZoom",value:function changeZoom(e){var _this$eqkMapService6;var current=$(e.currentTarget);var currentZoom=this.naverMap.getZoom();if(current.hasClass("btn_zoom_in")){currentZoom+=1;if(currentZoom> this.naverMap.getMaxZoom())currentZoom=this.naverMap.getMaxZoom()}else{currentZoom-=1;if(currentZoom=this.nationRegionStandardZoom&&intZoom.6){xSplit=this.xSplit+1;ySplit=this.ySplit+1}else{xSplit= this.xSplit;ySplit=this.ySplit}}var apiName="visualMapBoundsProto";if(this.visualMapType==="sea"||this.visualMapType==="air"||this.isWarnVisualMapType(this.visualMapType)||this.isEqkVisualMapType(this.visualMapType))apiName= "visualMapBounds";else if(!this.visualMapType){this.visualMapType=this.getCurrentVisualMapType();this.updateNlogContext()}if(this.isWarnVisualMapType(this.visualMapType))excludeList="";var params={"zoomLevel":intZoom+ "","bounds":sBounds,"visualMapType":this.visualMapType,"excludeList":excludeList,"xSplit":xSplit,"ySplit":ySplit,"beforeBounds":beforeBounds,"selectedRgnCd":this.visualMapType==="air"?this.selectedAirStationId: this.selectedRegionCode};var choiceQueryString={};choiceQueryString[apiName]=params;if(this.visualMapType==="air"){params["meterPerPixel"]=intZoom<12?Math.round(oMapsUtils.getMeterPerPixel(this.naverMap)* .7):0;oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(choiceResult){_this18.onCurrentPositon=false;var result=choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapBounds; if(!result)return;_this18.lastVisualMapType=_this18.visualMapType;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);var airStationDataList=result===null||result=== void 0?void 0:result.airStationData;if(!airStationDataList)return;_this18.lastBounds=sBounds;for(var _i2=0,_Object$entries=Object.entries(airStationDataList);_i2<_Object$entries.length;_i2++){var _Object$entries$_i= _slicedToArray(_Object$entries[_i2],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];_this18.airCacheMap.set(key,value);_this18.drawMarkerForAir(key)}_this18.optimizeMarker();_this18.resetMarkerSize()})}else if(this.visualMapType=== "sea")oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(choiceResult){_this18.onCurrentPositon=false; var result=choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapBounds;if(!result)return;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);if(!_.isEmpty(result.seaHdayMap)&& !_.isEmpty(result.tideMap))_this18.element.find(".map_tools_depth button").attr("disabled",false);for(var _i3=0,_Object$entries2=Object.entries(result);_i3<_Object$entries2.length;_i3++){var _Object$entries2$_i= _slicedToArray(_Object$entries2[_i3],2),outerKey=_Object$entries2$_i[0],outerValue=_Object$entries2$_i[1];if(outerKey==="type"||outerKey==="coordinateType")continue;for(var _i4=0,_Object$entries3=Object.entries(outerValue);_i4< _Object$entries3.length;_i4++){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i4],2),key=_Object$entries3$_i[0],value=_Object$entries3$_i[1];_this18.seaCacheMap.set(key,value);_this18.drawMarkerForSea(key, value)}}_this18.optimizeMarker();_this18.resetMarkerSize();if(Math.round(_this18.naverMap.getZoom())!==_this18.nMaxZoom)_this18.removeIntersectMarker()}); else if(this.isAwsVisualMapType(this.visualMapType))oBlockScriptService.ajaxProtoChoiceApi(choiceQueryString,function(choiceResult){var _choiceResult$visualM;_this18.onCurrentPositon=!_.isEmpty(_this18.selectedRegionCode); var result=choiceResult===null||choiceResult===void 0?void 0:(_choiceResult$visualM=choiceResult.visualMapBoundsProto)===null||_choiceResult$visualM===void 0?void 0:_choiceResult$visualM.visualMapBoundsProto; if(!result)return;_this18.lastVisualMapType=_this18.visualMapType;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);var awsWetrData=result===null||result===void 0? void 0:result.awsWetrData;if(!awsWetrData)return;_this18.lastBounds=sBounds;for(var _i5=0,_Object$entries4=Object.entries(awsWetrData);_i5<_Object$entries4.length;_i5++){var _Object$entries4$_i=_slicedToArray(_Object$entries4[_i5], 2),key=_Object$entries4$_i[0],value=_Object$entries4$_i[1];_this18.addAwsCacheData(key,value.region,(value===null||value===void 0?void 0:value.awsWetrList)||[]);_this18.drawMarkerForAws(key);_this18.element.find("._cnVisualMapMaker ._".concat(_this18.visualMapType)).removeClass("hide"); try{_this18.drawMarkerForDomestic(key)}catch(e){}}}); else if(this.visualMapType==="asos")oBlockScriptService.ajaxProtoChoiceApi(choiceQueryString,function(choiceResult){var _choiceResult$visualM2;_this18.onCurrentPositon=false;var result=choiceResult===null|| choiceResult===void 0?void 0:(_choiceResult$visualM2=choiceResult.visualMapBoundsProto)===null||_choiceResult$visualM2===void 0?void 0:_choiceResult$visualM2.visualMapBoundsProto;if(!result)return;_this18.lastVisualMapType= _this18.visualMapType;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);var asosWetrData=result===null||result===void 0?void 0:result.asosWetrData;if(!asosWetrData)return; _this18.lastBounds=sBounds;for(var _i6=0,_Object$entries5=Object.entries(asosWetrData);_i6<_Object$entries5.length;_i6++){var _Object$entries5$_i=_slicedToArray(_Object$entries5[_i6],2),key=_Object$entries5$_i[0], value=_Object$entries5$_i[1];_this18.addAsosCacheData((value===null||value===void 0?void 0:value.asosWetrList)||[]);_this18.drawMarkerForAsos(key);_this18.element.find("._cnVisualMapMaker ._".concat(_this18.visualMapType)).removeClass("hide")}}); else if(this.visualMapType==="talk")this.talkMapService.ajaxTalkCount();else if(this.isTypnVisualMapType(this.visualMapType))oBlockScriptService.ajaxProtoChoiceApi(choiceQueryString,function(choiceResult){var _choiceResult$visualM3; var result=choiceResult===null||choiceResult===void 0?void 0:(_choiceResult$visualM3=choiceResult.visualMapBoundsProto)===null||_choiceResult$visualM3===void 0?void 0:_choiceResult$visualM3.visualMapBoundsProto; if(!result)return;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType)}); else if(this.isWarnVisualMapType(this.visualMapType)){params["meterPerPixel"]=intZoom<12?Math.round(oMapsUtils.getMeterPerPixel(this.naverMap)*.7):0;oBlockScriptService.ajaxChoiceApi(choiceQueryString, function(choiceResult){var result=choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapBounds;if(!result)return;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType); var warnStationDataList=result===null||result===void 0?void 0:result.warnStationData;if(!warnStationDataList)return;_this18.lastBounds=sBounds;if(_this18.warnMapService)for(var _i7=0,_Object$entries6=Object.entries(warnStationDataList);_i7< _Object$entries6.length;_i7++){var _Object$entries6$_i=_slicedToArray(_Object$entries6[_i7],2),key=_Object$entries6$_i[0],value=_Object$entries6$_i[1];_this18.warnMapService.drawMarkerForWarn(key,value)}_this18.optimizeMarker(); _this18.resetMarkerSize()})}else if(this.isEqkVisualMapType(this.visualMapType)){var _this$eqkMapService7,_this$eqkMapService7$; params["meterPerPixel"]=intZoom<12?Math.round(oMapsUtils.getMeterPerPixel(this.naverMap)*.7):0;params["visualMapType"]="earthquake_".concat(((_this$eqkMapService7=this.eqkMapService)===null||_this$eqkMapService7=== void 0?void 0:(_this$eqkMapService7$=_this$eqkMapService7.selectedEqk)===null||_this$eqkMapService7$===void 0?void 0:_this$eqkMapService7$.id)||"");oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(choiceResult){var result= choiceResult===null||choiceResult===void 0?void 0:choiceResult.visualMapBounds;if(!result)return;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);var eqkMarkerData= result===null||result===void 0?void 0:result.eqkMarkerData;if(!eqkMarkerData)return;_this18.lastBounds=sBounds;if(_this18.eqkMapService)for(var _i8=0,_Object$entries7=Object.entries(eqkMarkerData);_i8< _Object$entries7.length;_i8++){var _Object$entries7$_i=_slicedToArray(_Object$entries7[_i8],2),key=_Object$entries7$_i[0],value=_Object$entries7$_i[1];_this18.eqkMapService.drawMarkerForEarthquake(key, value)}_this18.optimizeMarker();_this18.resetMarkerSize()})}else oBlockScriptService.ajaxProtoChoiceApi(choiceQueryString,function(choiceResult){var _choiceResult$visualM4; _this18.onCurrentPositon=!_.isEmpty(_this18.selectedRegionCode);var result=choiceResult===null||choiceResult===void 0?void 0:(_choiceResult$visualM4=choiceResult.visualMapBoundsProto)===null||_choiceResult$visualM4=== void 0?void 0:_choiceResult$visualM4.visualMapBoundsProto;if(!result)return;_this18.lastBounds=sBounds;_this18.changeMapBtnStatus(result===null||result===void 0?void 0:result.coordinateType);for(var _i9= 0,_Object$entries8=Object.entries(result);_i9<_Object$entries8.length;_i9++){var _Object$entries8$_i=_slicedToArray(_Object$entries8[_i9],2),outerKey=_Object$entries8$_i[0],outerValue=_Object$entries8$_i[1]; if(outerKey==="type"||outerKey==="coordinateType")continue;var _loop2=function _loop2(){var _Object$entries9$_i=_slicedToArray(_Object$entries9[_i0],2),key=_Object$entries9$_i[0],value=_Object$entries9$_i[1]; var cacheMap=new Map;if(key.startsWith("WD")){_this18.regionCacheMap.set(value.region.worldRgnCd,value.region);cacheMap.set("crnt",value.overseasCrntWetr);var _iteratorNormalCompletion6=true;var _didIteratorError6= false;var _iteratorError6=undefined;try{for(var _iterator6=value.overseasHourlyFcastList[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6= true){var wetr=_step6.value;cacheMap.set(wetr.aplYmd+wetr.aplTm,wetr)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6["return"]!=null)_iterator6["return"]()}finally{if(_didIteratorError6)throw _iteratorError6; }}}else{_this18.regionCacheMap.set(value.region.naverRgnCd,value.region);var now=moment().format("YYYYMMDDHH");value.domesticWetrList.forEach(function(wetr,index){var aplYmdt=wetr.aplYmd+wetr.aplTm;if(index=== 0||aplYmdt>now)cacheMap.set(aplYmdt,wetr)})}_this18.wetrCacheMap.set(key,cacheMap); try{if(key.startsWith("WD"))_this18.drawMarkerForOverseas(key);else _this18.drawMarkerForDomestic(key)}catch(e){}}; for(var _i0=0,_Object$entries9=Object.entries(outerValue);_i0<_Object$entries9.length;_i0++)_loop2();_this18.element.find("._cnVisualMapMaker ._".concat(_this18.visualMapType)).removeClass("hide")}_this18.optimizeMarker(); _this18.resetMarkerSize();if(Math.round(_this18.naverMap.getZoom())!==_this18.nMaxZoom)_this18.removeIntersectMarker();if(menu==="today"){var wetrCache=_this18.wetrCacheMap.get(_this18.selectedRegionCode); var obsYmdt=wetrCache&&wetrCache.size>0?Array.from(wetrCache.values()).filter(function(o){return o&&o.fcastYmdt}).reduce(function(latest,current){return current.fcastYmdt>latest?current.fcastYmdt:latest}, Array.from(wetrCache.values())[0].fcastYmdt||""):""; var html=_this18.createOfferAreaHtml(obsYmdt);_this18.element.find(".offer_area").html(html).removeClass("hide")}})}}}, {key:"ajaxTideCalendar",value:function ajaxTideCalendar(e){var _this19=this;oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"seaflaymore"));var aplYm="";if(this.element.find("._cnSelectYear").length> 0&&this.element.find("._cnSelectMonth:visible").length>0)aplYm=this.element.find("._cnSelectYear").val()+this.element.find("._cnSelectMonth:visible").val();var stationId=$(e.currentTarget).data("stationId"); var stationName=$(e.currentTarget).data("stationName");var choiceQueryString={"visualMapTideCalendar":{"stationId":stationId,"aplYm":aplYm}};oBlockScriptService.ajaxChoiceApi(choiceQueryString,function(result){result.visualMapTideCalendar.stationName= stationName;result.visualMapTideCalendar.thisYear=moment(result.visualMapTideCalendar.thisMonthFirstDay,"YYYYMMDD").format("YYYY");result.visualMapTideCalendar.thisMonth=moment(result.visualMapTideCalendar.thisMonthFirstDay, "YYYYMMDD").format("MM");result.visualMapTideCalendar.nowYear=moment(result.visualMapTideCalendar.today,"YYYYMMDD").format("YYYY");result.visualMapTideCalendar.nextYear=moment(result.visualMapTideCalendar.today, "YYYYMMDD").add(1,"years").format("YYYY");result.visualMapTideCalendar.prevYearMonth=moment(result.visualMapTideCalendar.prevMonth,"YYYYMMDD").format("YYYYMM");result.visualMapTideCalendar.prevMaxMonth= moment(result.visualMapTideCalendar.prevMaxMonth,"YYYYMMDD").format("MM");result.visualMapTideCalendar.prevMaxYearMonth=moment(result.visualMapTideCalendar.prevMaxMonth,"YYYYMMDD").format("YYYYMM");result.visualMapTideCalendar.nextYearMonth= moment(result.visualMapTideCalendar.nextMonth,"YYYYMMDD").format("YYYYMM");result.visualMapTideCalendar.nextMaxMonth=moment(result.visualMapTideCalendar.nextMaxMonth,"YYYYMMDD").format("MM");result.visualMapTideCalendar.nextMaxYearMonth= moment(result.visualMapTideCalendar.nextMaxMonth,"YYYYMMDD").format("YYYYMM");result.visualMapTideCalendar.blockPageNameEn=blockPageNameEn;result.visualMapTideCalendar.clickCode=_this19.clickCode;var oTemplate= Handlebars.getTemplateSync("_idVisualMapTideCalendarTemplate");var elContent=oTemplate(result.visualMapTideCalendar);_this19.element.find("._tideCalendar").html(elContent).removeClass("hide");if(_this19.element.find(".btn_detail.on").length> 0)_this19.element.find(".btn_detail.on").trigger("click")})}}, {key:"changeMapBtnStatus",value:function changeMapBtnStatus(coordinateType){if(coordinateType==="OVERSEAS"){this.element.find(".map_tools_depth button[data-type\x3dstmpr]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dhumd]").attr("disabled", true);this.element.find(".map_tools_depth button[data-type\x3dsea]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dsnow]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dsat]").attr("disabled", true);this.element.find(".map_tools_depth button[data-type\x3drdr]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dmaple]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3daws1h]").attr("disabled", true);this.element.find(".map_tools_depth button[data-type\x3daws1d]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dasos]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dair]").attr("disabled", true);this.element.find(".map_tools_depth button[data-type\x3dpm10]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type\x3dpm25]").attr("disabled",true);this.element.find(".map_tools_depth button[data-type^\x3dwarn]").attr("disabled", true);this.isDomesticRegion=false;if(this.element.find(".btn_pin_wrap .wind").hasClass("on"))this.element.find(".btn_pin_wrap .wind").click();this.element.find(".btn_pin_wrap .wind").attr("disabled",true); if(this.element.find(".btn_pin_wrap ._cnBtnCctv").hasClass("on"))this.element.find(".btn_pin_wrap ._cnBtnCctv").click();this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",true);if(this.visualMapType!== "sea"&&!this.isTypnVisualMapType(this.visualMapType))this.hideSlider();this.hideFloatingMarker();this.hideMapAqfButton();if(this.talkMapService)this.talkMapService.disableTalkTab();var initTalkFlag=oBlockScriptService.callTemplateFuncWithIndex("regionTalk", 1,"isEnableInitTalk");if(initTalkFlag!==true)oBlockScriptService.callTemplateFunc("regionTalk","closeTalk");if(this.isWarnVisualMapType(this.lastVisualMapType)){this.switchToNonDisasterTab();return}switch(this.lastVisualMapType){case "stmpr":case "humd":case "snow":case "aws1h":case "aws1d":case "asos":case "sea":case "air":case "talk":this.switchToNonDisasterTab(); break}}else{if(!this.isVideoVisualMapType(this.visualMapType)&&!this.isAirVisualMapType(this.visualMapType)&&!this.isDisasterVisualMapType(this.visualMapType))this.element.find(".btn_pin_wrap .wind").attr("disabled", false);this.element.find(".map_tools_depth button").attr("disabled",false);this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",false);this.isDomesticRegion=true;if(this.lastVisualMapType!=="sea"&& this.lastVisualMapType!=="air"&&!this.isAqfException)this.showSlider();this.renderFloatingMarker();this.showMapAqfButton();if(this.talkMapService)this.talkMapService.enableTalkTab();if(this.isObservationVisualMapType(this.visualMapType)|| this.lastVisualMapType==="air"||this.isWarnVisualMapType(this.visualMapType)||this.isEqkVisualMapType(this.visualMapType)){this.hideSlider();this.hideLayerSnow();this.element.find("button.wind").attr("disabled", true).removeClass("on")}if(this.visualMapType==="talk"){this.hideSlider();this.hideLayerSnow();this.element.find("button.wind").attr("disabled",true).removeClass("on");this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled", true).removeClass("on")}if(this.isWarnVisualMapType(this.visualMapType))this.element.find(".btn_pin_wrap ._cnBtnCctv").attr("disabled",true).removeClass("on")}}}, {key:"changeDateTideCalendarYear",value:function changeDateTideCalendarYear(){var selectedYear=this.element.find("._cnSelectYear").val();this.element.find("._cnSelectYear").siblings("strong").html(selectedYear+ "\ub144");this.element.find("._cnSelectMonth").closest("li").hide();this.element.find("#_idMonth"+selectedYear).show();this.element.find("#_idMonth"+selectedYear).find("._cnSelectMonth").trigger("change")}}, {key:"toggleTideCalendar",value:function toggleTideCalendar(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"seacal"));var $target=$(e.currentTarget);this.element.find("._cnTideDetail").remove(); var locate=$target.closest("tr");var cloneTide=this.element.find("#_idTideDetail").clone();cloneTide.addClass("_cnTideDetail");var dataSet=$target.closest("td").data();var sDate=dataSet.sDate;var lDate= dataSet.lDate;var day=dataSet.dayOfWeek;switch(day){case 1:day="\uc77c";break;case 2:day="\uc6d4";break;case 3:day="\ud654";break;case 4:day="\uc218";break;case 5:day="\ubaa9";break;case 6:day="\uae08"; break;default:day="\ud1a0"}var moonIcon=lDate.split(".")[1];var moonTxt;if(2<=moonIcon&&moonIcon<=5){moonIcon="moon1";moonTxt="\ucd08\uc2b9\ub2ec"}else if(6<=moonIcon&&moonIcon<=8){moonIcon="moon2";moonTxt= "\uc0c1\ud604\ub2ec"}else if(9<=moonIcon&&moonIcon<=12){moonIcon="moon3";moonTxt="\ucc28\uac00\ub294\ub2ec"}else if(13<=moonIcon&&moonIcon<=16){moonIcon="moon4";moonTxt="\ubcf4\ub984\ub2ec"}else if(17<= moonIcon&&moonIcon<=20){moonIcon="moon5";moonTxt="\uae30\uc6b8\uc5b4\uac00\ub294\ub2ec"}else if(21<=moonIcon&&moonIcon<=23){moonIcon="moon6";moonTxt="\ud558\ud604\ub2ec"}else if(24<=moonIcon&&moonIcon<= 28){moonIcon="moon7";moonTxt="\uadf8\ubbd0\ub2ec"}else{moonIcon="moon8";moonTxt="\uc2e0\uc6d4"}var typeName=dataSet.tideTypeName;var periodName=dataSet.periodName;var html="";for(var idx=0;idx<4;idx++){var tideTm= $target.closest("td").data("tideTm"+idx);var tideHeight=$target.closest("td").data("tideHeight"+idx);var tideKind=$target.closest("td").data("tideKind"+idx);var tideKindClass=$target.closest("td").data("tideKindClass"+ idx);if(idx===0||idx===2)html+='\x3cli class\x3d"info_item _cnTideInfo"\x3e';if(tideTm!==undefined)html+='\x3cspan class\x3d"info_data"\x3e\x3cstrong class\x3d"info_title '.concat(tideKindClass,'"\x3e').concat(tideKind, '\x3cspan class\x3d"blind"\x3e\uc870\x3c/span\x3e\x3c/strong\x3e ').concat(moment(tideTm,"HHmm").format("HH:mm")," (").concat(tideHeight,"cm)\x3c/span\x3e");if(idx===1||idx===3)html+="\x3c/li\x3e"}cloneTide.find(".detail_day").html("".concat(sDate, "(").concat(day,') \x3cspan class\x3d"day_lunar"\x3e\uc74c\ub825 ').concat(lDate,'\x3c/span\x3e\x3cspan class\x3d"icon_moon ').concat(moonIcon,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(moonTxt,"\x3c/span\x3e\x3c/span\x3e")); var tideTerm;var tideRangeTerm;if(responsiveSizeType.deviceType==="Mobile"){tideTerm="https://m.terms.naver.com/entry.nhn?docId\x3d1977329\x26cid\x3d42904\x26categoryId\x3d42904";tideRangeTerm="https://m.terms.naver.com/entry.nhn?docId\x3d979714\x26cid\x3d42456\x26categoryId\x3d42456"}else{tideTerm= "https://terms.naver.com/entry.nhn?docId\x3d1977329\x26cid\x3d42904\x26categoryId\x3d42904";tideRangeTerm="https://terms.naver.com/entry.nhn?docId\x3d979714\x26cid\x3d42456\x26categoryId\x3d42456"}cloneTide.find("._cnTideInfo").append('\n\t\t\t\x3cli class\x3d"info_item"\x3e\n\t\t\t\t\x3cspan class\x3d"info_data"\x3e\x3cstrong class\x3d"info_title"\x3e\ubb3c\ub54c\x3c/strong\x3e '.concat(typeName, ' \x3ca href\x3d"').concat(tideTerm,'" class\x3d"ico_help" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'seacalinfo\')" data-type\x3d"mulddae" data-nlog-area\x3d"visual_map.help_link" data-nlog-params\x3d\'{"category":"mulddae"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\ub9d0\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e\n\t\t\t\t\x3cspan class\x3d"info_data"\x3e\x3cstrong class\x3d"info_title"\x3e\uc870\ucc28\x3c/strong\x3e ').concat(periodName, ' \x3ca href\x3d"').concat(tideRangeTerm,'" class\x3d"ico_help" target\x3d"_blank" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'seacalinfo\')" data-type\x3d"jocha" data-nlog-area\x3d"visual_map.help_link" data-nlog-params\x3d\'{"category":"jocha"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub3c4\uc6c0\ub9d0\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e\n\t\t\t\x3c/li\x3e\n\t\t')); cloneTide.find("._cnTideInfo").append(html);cloneTide.insertAfter(locate);this.element.find("._cnTideDetail").toggle();this.element.find(".btn_detail.on").removeClass("on");$target.addClass("on")}}, {key:"getSliderPositionIndex",value:function getSliderPositionIndex(){if(_.isEmpty(this.oSlider))return 0;var ratio=this.oSlider.get(true);return this.noUiSliderPlayerService.getIndex(ratio)}}, {key:"drawMarkerForDomestic",value:function drawMarkerForDomestic(regionCode){var region=this.regionCacheMap.get(regionCode);var wetrMap=this.wetrCacheMap.get(regionCode);var index=this.getSliderPositionIndex(); var wetrData=wetrMap.get(this.getTimeSeriesByIndex(index));if(wetrData===undefined&&index===0)wetrData=_toConsumableArray(wetrMap.values())[0];if(this.element.find("#_IdVisualMapMarker-".concat(region.naverRgnCd)).length=== 0){var _wetrData,_wetrData2;var option={};option.regionName=this.getMarkerRegionName(region);option.regionCode=region.naverRgnCd;option.wetrCd=wetrData.wetrCd;option.wetrTxt=wetrData.wetrTxt;option.tmpr= wetrData.tmpr;option.stmpr=wetrData.stmpr;option.oneHourRainAmt=(_wetrData=wetrData)===null||_wetrData===void 0?void 0:_wetrData.oneHourRainAmt;option.windDrctn=wetrData.windDrctn;option.windSpd=wetrData.windSpd; option.humd=wetrData.humd;option.latitude=region.latitude;option.longitude=region.longitude;option.oneHourSnowAmt=(_wetrData2=wetrData)===null||_wetrData2===void 0?void 0:_wetrData2.oneHourSnowAmt;option.on= this.selectedRegionCode===region.naverRgnCd?"on":"";var marker=this.addMarker(option,"_idVisualMapMarkerTemplate");if(marker!==null){if(option.regionCode===this.selectedRegionCode){this.element.find("#_IdVisualMapMarker-".concat(option.regionCode)).parent("div").css("z-index", 1);this.setSelectedRegionHourlyCard(this.selectedRegionCode)}this.markerList.push(marker);naver.maps.Event.addListener(marker,"click",this.clickMarker(this,option.regionCode))}}}}, {key:"drawMarkerForOverseas",value:function drawMarkerForOverseas(regionCode){var region=this.regionCacheMap.get(regionCode);var wetrMap=this.wetrCacheMap.get(regionCode);var index=this.getSliderPositionIndex(); var wetrData=wetrMap.get(this.getTimeSeriesByIndex(index));if(wetrData===undefined&&index===0)wetrData=_toConsumableArray(wetrMap.values())[0];if(this.element.find("#_IdVisualMapMarker-".concat(region.worldRgnCd)).length=== 0){var _wetrData3;var option={};option.regionName=this.getMarkerRegionName(region);option.regionCode=region.worldRgnCd;option.wetrCd=wetrData.wetrCd;option.wetrTxt=wetrData.wetrTxt;option.tmpr=wetrData.tmpr; option.stmpr=wetrData.stmpr;option.oneHourRainAmt=wetrData.oneHourRainAmt||0;option.oneHourSnowAmt=(_wetrData3=wetrData)===null||_wetrData3===void 0?void 0:_wetrData3.oneHourSnowAmt;option.windDrctn=wetrData.windDrctn; option.windSpd=wetrData.windSpd;option.humd=wetrData.humd;option.latitude=region.latitude;option.longitude=region.longitude;option.on=this.selectedRegionCode===region.worldRgnCd?"on":"";var marker=this.addMarker(option, "_idVisualMapMarkerTemplate");if(marker!==null){if(option.regionCode===this.selectedRegionCode){this.element.find("#_IdVisualMapMarker-".concat(option.regionCode)).parent("div").css("z-index",1);this.setSelectedRegionHourlyCard(this.selectedRegionCode)}this.markerList.push(marker); naver.maps.Event.addListener(marker,"click",this.clickMarker(this,option.regionCode))}}}}, {key:"drawMarkerForSea",value:function drawMarkerForSea(key,value){var marker=null;if(this.element.find("#_IdVisualMapMarker-".concat(key)).length===0){if(key.startsWith("DT")){value.regionCode=value.tideStation.stationId; value.latitude=value.tideStation.latitude;value.longitude=value.tideStation.longitude;value.on=this.selectedRegionCode===value.regionCode?"on":"";marker=this.addMarker(value,"_idVisualMapTideMarkerTemplate")}if(key.startsWith("SE")){value.regionCode= value.seaRegion.seaRgnCd;value.latitude=value.seaRegion.latitude;value.longitude=value.seaRegion.longitude;value.on=this.selectedRegionCode===value.regionCode?"on":"";marker=this.addMarker(value,"_idVisualMapSeaMarkerTemplate")}if(marker!== null){if(value.regionCode===this.selectedRegionCode)this.element.find("#_IdVisualMapMarker-".concat(key)).parent("div").css("z-index",1);this.markerList.push(marker);naver.maps.Event.addListener(marker, "click",this.clickMarker(this,key))}}}}, {key:"drawMarkerForAws",value:function drawMarkerForAws(regionCode){var region=this.awsRegionCacheMap.get(regionCode);var awsWetrMap=this.awsCacheMap.get(regionCode);var awsWetr;if(this.getLastObsAplYmdt())awsWetr= awsWetrMap.get(this.getLastObsAplYmdt());else{var awsWetrList=_toConsumableArray(awsWetrMap.values());awsWetr=awsWetrList[awsWetrList.length-1];this.setLastObsAplYmdt(awsWetr.aplYmdt)}if(this.element.find("#_IdVisualMapMarker-".concat(region.naverRgnCd)).length=== 0){var _awsWetr,_awsWetr2,_awsWetr3,_awsWetr4,_awsWetr5;var option={};option.regionName=this.getMarkerRegionName(region);option.regionCode=region.naverRgnCd;option.latitude=region.latitude;option.longitude= region.longitude;option.rainAmt60m=(_awsWetr=awsWetr)===null||_awsWetr===void 0?void 0:_awsWetr.rainAmt_60m;option.rainAmt12hr=(_awsWetr2=awsWetr)===null||_awsWetr2===void 0?void 0:_awsWetr2.rainAmt_12hr; option.rainAmtDay=(_awsWetr3=awsWetr)===null||_awsWetr3===void 0?void 0:_awsWetr3.rainAmtDay;option.typeClass="type_rain";option.typeClassValue=this.visualMapType==="aws1d"?(_awsWetr4=awsWetr)===null|| _awsWetr4===void 0?void 0:_awsWetr4.rainAmtDay:(_awsWetr5=awsWetr)===null||_awsWetr5===void 0?void 0:_awsWetr5.rainAmt_60m;option.on=this.selectedRegionCode===region.naverRgnCd?"on":"";var marker=this.addMarker(option, "_idVisualMapMarkerTemplate");if(marker!==null){if(option.regionCode===this.selectedRegionCode){this.element.find("#_IdVisualMapMarker-".concat(option.regionCode)).parent("div").css("z-index",1);this.initSelectedRegionHourlyObsCard(region, this.awsCacheMap.get(regionCode))}this.markerList.push(marker);naver.maps.Event.addListener(marker,"click",this.clickMarker(this,option.regionCode))}}}}, {key:"drawMarkerForAsos",value:function drawMarkerForAsos(asosWetrRgnCd){var asosWetrMap=this.asosCacheMap.get(asosWetrRgnCd);var asosRegion=this.asosRegionCacheMap.get(asosWetrRgnCd);var asosWetr;if(this.getLastObsAplYmdt())asosWetr= asosWetrMap.get(this.getLastObsAplYmdt());else{var asosWetrList=_toConsumableArray(asosWetrMap.values());asosWetr=asosWetrList[asosWetrList.length-1];this.setLastObsAplYmdt(asosWetr.aplYmdt)}if(asosWetrMap&& asosRegion&&this.element.find("#_IdVisualMapMarker-".concat(asosWetrRgnCd)).length===0){var _asosWetr,_asosWetr2,_asosWetr3,_asosWetr4;var option={};option.regionName=asosRegion===null||asosRegion===void 0? void 0:asosRegion.rgnNm;option.regionCode=asosWetrRgnCd;option.latitude=asosRegion.latitude;option.longitude=asosRegion.longitude;option.snowAmtAllday=(_asosWetr=asosWetr)===null||_asosWetr===void 0?void 0: _asosWetr.snowAmtAllday;option.snowAmt3hr=(_asosWetr2=asosWetr)===null||_asosWetr2===void 0?void 0:_asosWetr2.snowAmt_3hr;option.snowAmt=(_asosWetr3=asosWetr)===null||_asosWetr3===void 0?void 0:_asosWetr3.snowAmt; option.on=this.selectedRegionCode===asosWetrRgnCd?"on":"";option.typeClassValue=(_asosWetr4=asosWetr)===null||_asosWetr4===void 0?void 0:_asosWetr4.snowAmtAllday;option.typeClass="type_snow";var marker= this.addMarker(option,"_idVisualMapMarkerTemplate");if(marker!==null){if(option.regionCode===this.selectedRegionCode){this.element.find("#_IdVisualMapMarker-".concat(option.regionCode)).parent("div").css("z-index", 1);this.initSelectedRegionHourlyObsCard(asosWetrRgnCd,this.asosCacheMap.get(asosWetrRgnCd))}this.markerList.push(marker);naver.maps.Event.addListener(marker,"click",this.clickMarker(this,option.regionCode))}}}}, {key:"drawMarkerForDongPosition",value:function drawMarkerForDongPosition(){var dongMarkerVisible=this.positionMarker?this.positionMarker.getVisible()===false:true;dongMarkerVisible=this.isVideoVisualMapType(this.visualMapType)|| this.visualMapType==="sea"||this.visualMapType==="asos"||this.isAqfVisualMapType(this.visualMapType)||this.isWarnVisualMapType(this.visualMapType)?dongMarkerVisible:false;if(this.selectedRegionCode&&this.dongPositionMarker=== null){var oTemplate=Handlebars.getTemplateSync("_idVisualMapDongPositionTemplate");var elContent=oTemplate();this.dongPositionMarker=new naver.maps.Marker({position:new naver.maps.LatLng(this.latitude, this.longitude),map:this.naverMap,icon:{content:elContent},visible:dongMarkerVisible,zIndex:0})}else this.dongPositionMarker.setVisible(dongMarkerVisible)}}, {key:"drawMarkerForAir",value:function drawMarkerForAir(stationId){var airStation=this.airCacheMap.get(stationId).airStation;var airFcast=this.airCacheMap.get(stationId).airFcast;if(airStation&&airFcast&& this.element.find("#_IdVisualMapMarker-".concat(airStation.stationId)).length===0){var option={};option.stationId=airStation===null||airStation===void 0?void 0:airStation.stationId;option.stationName=airStation=== null||airStation===void 0?void 0:airStation.stationName;option.aplYmdt=airFcast===null||airFcast===void 0?void 0:airFcast.aplYmdt;option.latitude=airStation===null||airStation===void 0?void 0:airStation.stationLat; option.longitude=airStation===null||airStation===void 0?void 0:airStation.stationLng;option.on=this.selectedAirStationId===(airStation===null||airStation===void 0?void 0:airStation.stationId)?this.nLastZoom>= this.nStandardZoom?"on":"":"";option.stationPM10=oCommon.fnGetAirNumberValueWithDefault(airFcast===null||airFcast===void 0?void 0:airFcast.stationPM10);option.stationPM10LevelClass=(airFcast===null||airFcast=== void 0?void 0:airFcast.stationPM10LevelClass)||"level4_none";option.stationPM25=(airStation===null||airStation===void 0?void 0:airStation.pm25ExistYn)==="Y"?oCommon.fnGetAirNumberValueWithDefault(airFcast=== null||airFcast===void 0?void 0:airFcast.stationPM25):"-";option.stationPM25LevelClass=(airFcast===null||airFcast===void 0?void 0:airFcast.stationPM25LevelClass)||"level4_none";var marker=this.addMarker(option, "_idVisualMapAirMarkerTemplate");if(marker!==null){if(option.stationId===this.selectedAirStationId){this.element.find("#_IdVisualMapMarker-".concat(option.stationId)).parent("div").css("z-index",1);this.renderSelectedAirInfoCard(this.selectedAirStationId)}this.markerList.push(marker); naver.maps.Event.addListener(marker,"click",this.clickMarker(this,option.stationId))}}}}, {key:"addMarker",value:function addMarker(option,templateName){var oTemplate=Handlebars.getTemplateSync(templateName);var elContent=oTemplate(option);var marker=new naver.maps.Marker({position:new naver.maps.LatLng(parseFloat(option.latitude), parseFloat(option.longitude)),map:this.naverMap,icon:{content:elContent},visible:this.markerShow,zIndex:0});var width=$(marker.eventTarget).outerWidth();var height=$(marker.eventTarget).outerHeight();marker.setIcon({content:elContent, size:new naver.maps.Size(width,height),anchor:new naver.maps.Point(0,0)});return marker}}, {key:"getMarkerRegionName",value:function getMarkerRegionName(region){if(region.worldRgnCd!==undefined)return region.cityNm;else if(Math.round(this.naverMap.getZoom())>=this.nationRegionStandardZoom)return region.sareaNm; else return this.nationRegionCodeNameMapping[region.naverRgnCd]}}, {key:"clickMarker",value:function clickMarker(_this,regionCode){return function(e){var current=_this.element.find("#_IdVisualMapMarker-".concat(regionCode));_this.element.find("._cnVisualMapMaker").removeClass("on"); current.addClass("on");if(_this.visualMapType==="air"){_this.selectedAirStationId=regionCode;var html=moment(_this.airCacheMap.get(_this.selectedAirStationId).airFcast.fcastYmdt,"YYYYMMDDHHmmss").format("\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 YYYY.MM.DD. HH:mm"); _this.element.find(".map_layer_provide._airDesc span").html(html)}else _this.selectedRegionCode=regionCode;if(regionCode.startsWith("DT"))_this.renderSelectedTideInfoCard(regionCode);else if(regionCode.startsWith("SE"))_this.renderSelectedSeaInfoCard(regionCode); else if(_this.visualMapType==="air"){_this.selectedAirStationId=regionCode;if(Math.round(_this.naverMap.getZoom())<_this.nStandardZoom){var airStation=_this.airCacheMap.get(regionCode).airStation;_this.clearMarker(); _this.naverMap.morph(new naver.maps.LatLng(parseFloat(airStation.stationLat),parseFloat(airStation.stationLng)),_this.nStandardZoom)}_this.renderSelectedAirInfoCard(regionCode)}else if(_this.isAwsVisualMapType(_this.visualMapType)){var region= _this.awsRegionCacheMap.get(regionCode);if(Math.round(_this.naverMap.getZoom())<_this.nStandardZoom){_this.clearMarker();_this.naverMap.morph(new naver.maps.LatLng(parseFloat(region.latitude),parseFloat(region.longitude)), _this.nStandardZoom)}_this.initSelectedRegionHourlyObsCard(region,_this.awsCacheMap.get(regionCode))}else if(_this.visualMapType==="asos"){var _region=_this.asosRegionCacheMap.get(regionCode);if(Math.round(_this.naverMap.getZoom())< _this.nStandardZoom){_this.clearMarker();_this.naverMap.morph(new naver.maps.LatLng(parseFloat(_region.latitude),parseFloat(_region.longitude)),_this.nStandardZoom)}_this.initSelectedRegionHourlyObsCard(_region, _this.asosCacheMap.get(regionCode))}else if(_this.isWarnVisualMapType(_this.visualMapType))return;else{var _region2=_this.regionCacheMap.get(regionCode);if(!regionCode.startsWith("WD")&&Math.round(_this.naverMap.getZoom())< _this.nStandardZoom){_this.clearMarker();_this.naverMap.morph(new naver.maps.LatLng(parseFloat(_region2.latitude),parseFloat(_region2.longitude)),_this.nStandardZoom)}_this.setSelectedRegionHourlyCard(regionCode)}for(var i in _this.markerList){var otherMarker= $(_this.markerList[i].eventTarget);otherMarker.parent("div").css("z-index",0)}current.parent("div").css("z-index",1);if(_this.visualMapType=="sea")oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode, "seamak"));else if(_this.visualMapType=="air")oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"airmrk"));else if(regionCode.startsWith("WD"))oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(_this.clickCode,"owetmak"));else oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"wetmak"))}}}, {key:"setSelectedRegionHourlyCard",value:function setSelectedRegionHourlyCard(regionCode){var region=this.regionCacheMap.get(regionCode);var wetrMap=this.wetrCacheMap.get(regionCode);var wetrDataList=this.converWetrMapToList(wetrMap); if(wetrMap&&wetrDataList.length>0)if(!regionCode.startsWith("WD"))this.renderSelectedRegionHourlyCardForDomestic(region,wetrDataList);else this.renderSelectedRegionHourlyCardForOverseas(region,wetrDataList); this.initializeScroll(this.element.find('.scroll_area[data-name\x3d"'.concat(this.visualHourlyId,'"]')))}}, {key:"renderSelectedTideInfoCard",value:function renderSelectedTideInfoCard(regionCode){var tideData=this.seaCacheMap.get(regionCode);var oTemplate=Handlebars.getTemplateSync("_idVisualMapTideInfoTemplate"); tideData.blockPageNameEn=blockPageNameEn;tideData.clickCode=this.clickCode;var elContent=oTemplate(tideData);this.hideAllInfoLayer();this.element.find("div._tideInfo").html(elContent).removeClass("hide"); this.validateDataAndRenderNoData("visualTideData",tideData)}}, {key:"renderSelectedSeaInfoCard",value:function renderSelectedSeaInfoCard(regionCode){var seaData=this.seaCacheMap.get(regionCode);var oTemplate=Handlebars.getTemplateSync("_idVisualMapSeaInfoTemplate"); var elContent=oTemplate(seaData);this.hideAllInfoLayer();this.element.find("div._seaInfo").html(elContent).removeClass("hide");this.validateDataAndRenderNoData("visualSeaData",seaData);this.initializeScroll(this.element.find('.scroll_area[data-name\x3d"visualSea"]'))}}, {key:"renderSelectedAirInfoCard",value:function renderSelectedAirInfoCard(stationId){if(!stationId||!this.airCacheMap.has(stationId))return;var airStation=this.airCacheMap.get(stationId).airStation;var airFcast= this.airCacheMap.get(stationId).airFcast;this.validateDataAndRenderNoData("observationAirData",{airStation:airStation,airFcast:airFcast});this.hideAllInfoLayer();if(airFcast===null||airFcast===void 0?void 0: airFcast.fcastYmdt){var isOutdated=(airStation===null||airStation===void 0?void 0:airStation.outdatedYn)==="Y"||moment().utcOffset("+09:00").diff(moment(airFcast.fcastYmdt,"YYYYMMDDHHmmss"),"hours")>=4; this.element.find("._airInfo .layer_head_title").html("".concat(airStation===null||airStation===void 0?void 0:airStation.stationName," \uce21\uc815\uc18c"));this.element.find("._airInfo .layer_head_text.type_date").html(isOutdated? moment(airFcast.fcastYmdt,"YYYYMMDDHHmmss").format("YYYY.MM.DD.")+'\n \x3cspan class\x3d"card_text_state type_exception"\x3e\n '.concat(moment(airFcast.fcastYmdt,"YYYYMMDDHHmmss").format("HH:mm"), ' \uae30\uc900 \n \x3cem class\x3d"card_state_emphasis"\x3e\uc9c0\uc5f0\ubc1c\uc0dd\x3c/em\x3e\n \x3c/span\x3e\n \x3cdiv class\x3d"card_text_tooltip"\x3e\n \x3cbutton type\x3d"button" class\x3d"card_tooltip_button" aria-pressed\x3d"false" data-type\x3d"delay" data-nlog-area\x3d"visual_map.help_button" data-nlog-params\x3d\'{"category":"delay"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\uc815\ubcf4\x3c/span\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d"card_tooltip_inner"\x3e\n \x3cstrong class\x3d"card_tooltip_title"\x3e\n \ud55c\uad6d\ud658\uacbd\uacf5\ub2e8 \uc5d0\uc5b4\ucf54\ub9ac\uc544\uc758\x3cbr\x3e\n \ud574\ub2f9 \uce21\uc815\uc18c \uc5c5\ub370\uc774\ud2b8\uac00 \uc9c0\uc5f0\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4.\n \x3c/strong\x3e\n \x3cp class\x3d"card_tooltip_text"\x3e\n \uc5c5\ub370\uc774\ud2b8 \uc9c0\uc5f0\uc740 \uc77c\uc2dc\uc801\uc778 \uce21\uc815\uc18c \uc7a5\uc560\ub098 \uc810\uac80, \uce21\uc815\uc18c \ub370\uc774\ud130 \uc804\uc1a1\uc758 \ubb38\uc81c\uac00 \uc788\uc744 \uacbd\uc6b0 \ubc1c\uc0dd \uac00\ub2a5\ud569\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3cp class\x3d"card_tooltip_text"\x3e\n \uc5c5\ub370\uc774\ud2b8 \uc9c0\uc5f0 \uc2dc, \ucd5c\uadfc \ub370\uc774\ud130\ub97c \uc77c\uc815\uc2dc\uac04 \uac00\uc7a5 \ucd5c\uadfc\x3cbr\x3e\n \ub370\uc774\ud130\ub97c \uc720\uc9c0\ud574 \uc815\uc0c1\ud654 \ubaa8\ub2c8\ud130\ub9c1 \ud6c4, \uc9c0\uc5f0 \uc2dc\uac04\uc774\x3cbr\x3e\n \uae38\uc5b4\uc9c0\uba74 \ud574\ub2f9 \uc9c0\uc5ed\uc758 \ucc28\uc778\uc811 \uce21\uc815\uc18c\uc758 \uce21\uc815\uc815\ubcf4\ub97c\x3cbr\x3e\n \ub300\uccb4 \uc81c\uacf5\ud569\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3cbutton type\x3d"button" class\x3d"btn_close" data-type\x3d"delay" data-nlog-area\x3d"visual_map.layer.close_button" data-nlog-params\x3d\'{"category":"delay"}\'\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e'): moment(airFcast.fcastYmdt,"YYYYMMDDHHmmss").format("YYYY.MM.DD.")+'\n \x3cspan class\x3d"card_text_state"\x3e\n '.concat(moment(airFcast.fcastYmdt,"YYYYMMDDHHmmss").format("HH:mm"), " \uae30\uc900\n \x3c/span\x3e"))}this.element.find("._airInfo .layer_head_data ._pm10Value").removeClass("level4_none").removeClass("level4_1").removeClass("level4_2").removeClass("level4_3").removeClass("level4_4").addClass(airFcast.stationPM10LevelClass).html(oCommon.fnGetAirNumberValueWithDefault(airFcast=== null||airFcast===void 0?void 0:airFcast.stationPM10));this.element.find("._airInfo .layer_head_data ._pm25Value").removeClass("level4_none").removeClass("level4_1").removeClass("level4_2").removeClass("level4_3").removeClass("level4_4").addClass(airFcast.stationPM25LevelClass).html((airStation=== null||airStation===void 0?void 0:airStation.pm25ExistYn)==="Y"?oCommon.fnGetAirNumberValueWithDefault(airFcast===null||airFcast===void 0?void 0:airFcast.stationPM25):"-");this.element.find("div._airInfo").removeClass("hide")}}, {key:"toggleDelayTooltip",value:function toggleDelayTooltip(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"airdelay"));var $target=this.element.find("._airInfo .card_tooltip_button"); var isOpen=$target.attr("aria-pressed")==="true";if(isOpen)$target.attr("aria-pressed",false);else $target.attr("aria-pressed",true)}}, {key:"renderSelectedRegionHourlyCardForDomestic",value:function renderSelectedRegionHourlyCardForDomestic(region,wetrDataList){this.validateDataAndRenderNoData("visualHourlyData",{domesticWetrList:wetrDataList|| []});var option={};for(var i in wetrDataList){var data=wetrDataList[i];if(data.rainProb!=="-"&&data.oneHourSnowAmt){this.firstTownFcastYmdt="".concat(data.aplYmd).concat(data.aplTm);break}}wetrDataList= this.buildHourlyFcastTimeStrAndClass(wetrDataList,false);option.wetrDataList=wetrDataList;option.typeClass=this.visualMapType==="wind"?"type_wind":"";var oTemplate=Handlebars.getTemplateSync("_idVisualMapHourlyTemplate"); var elContent=oTemplate(option);this.element.find("._wetrInfo .scroll_area").html(elContent);this.element.find("._wetrInfo .scroll_area div._".concat(this.visualMapType)).removeClass("hide");var html='\n \x3ca href\x3d"'.concat(this.previewPath, "/today/").concat(region.naverRgnCd,'" class\x3d"layer_title_inner" data-region-code\x3d"').concat(region.naverRgnCd,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'butwet\')" data-nlog-area\x3d"visual_map.region_link" data-nlog-params\x3d\'{"region_id":"').concat(region.naverRgnCd,'"}\'\x3e\n \x3cspan class\x3d"label"\x3e').concat(this.getSelectedVisualMapTypeTitle(), "\x3c/span\x3e").concat(oCommon.fnPrettyPrintMareaNm(region.mareaNm)," ").concat(region.sareaNm,"\n \x3c/a\x3e\n ");this.element.find(".layer_detail .layer_title").html(html);this.hourlyCardWidth= this.element.find("._wetrInfo").width();if(this.getTemplateResponsiveSizeType().deviceType==="Pc")this.infoCardOpen("visualHourly")}}, {key:"renderSelectedRegionHourlyCardForOverseas",value:function renderSelectedRegionHourlyCardForOverseas(region,wetrDataList){this.validateDataAndRenderNoData("visualHourlyData",{overseasHourlyFcastList:wetrDataList|| []});var option={};wetrDataList=this.buildHourlyFcastTimeStrAndClass(wetrDataList,true);option.wetrDataList=wetrDataList;var oTemplate=Handlebars.getTemplateSync("_idVisualMapHourlyTemplate");var elContent= oTemplate(option);this.element.find("._wetrInfo .scroll_area").html(elContent);this.element.find("._wetrInfo .scroll_area div._".concat(this.visualMapType)).removeClass("hide");var html='\n \x3ca href\x3d"'.concat(this.previewPath, "/today/").concat(region.worldRgnCd,'" class\x3d"layer_title_inner" data-region-code\x3d"').concat(region.worldRgnCd,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode, 'butwet\')" data-nlog-area\x3d"visual_map.region_link" data-nlog-params\x3d\'{"region_id":"').concat(region.worldRgnCd,'"}\'\x3e\n \x3cspan class\x3d"label"\x3e').concat(this.getSelectedVisualMapTypeTitle(), "\x3c/span\x3e").concat(region.ctryNm," ").concat(region.cityNm,"\n \x3c/a\x3e \n ");this.element.find(".layer_detail .layer_title").html(html);if(this.getTemplateResponsiveSizeType().deviceType=== "Pc")this.infoCardOpen("visualHourly")}}, {key:"buildHourlyFcastTimeStrAndClass",value:function buildHourlyFcastTimeStrAndClass(wetrDataList,overseas){if(!wetrDataList||wetrDataList.length===0)return[];var minDateTime;var oneDayAfter;var twoDayAfter; var threeDayAfter;for(var i in wetrDataList){var data=wetrDataList[i];var aplYmdt="".concat(data.aplYmd).concat(data.aplTm);if(!minDateTime){if(overseas){minDateTime=moment(aplYmdt,"YYYYMMDDHH");if(aplYmdt.endsWith("00"))minDateTime= minDateTime.subtract(1,"hours")}else minDateTime=moment();oneDayAfter=minDateTime.clone().add(1,"days").format("YYYYMMDD00");twoDayAfter=minDateTime.clone().add(2,"days").format("YYYYMMDD00");threeDayAfter= minDateTime.clone().add(3,"days").format("YYYYMMDD00")}if(aplYmdt>=threeDayAfter){if(aplYmdt.endsWith("00")){data.timeStr="\uae00\ud53c";data.onTheHour=true}else data.onTheHour=false;data.timeClass="after_tomorrow"}else if(aplYmdt>= twoDayAfter){if(aplYmdt.endsWith("00")){data.timeStr="\ubaa8\ub808";data.onTheHour=true}else data.onTheHour=false;data.timeClass="after_tomorrow"}else if(aplYmdt>=oneDayAfter){if(aplYmdt.endsWith("00")){data.timeStr= "\ub0b4\uc77c";data.onTheHour=true}else data.onTheHour=false;data.timeClass="tomorrow"}else{data.timeClass="";data.onTheHour=false}if(!data.timeStr)data.timeStr="".concat(data.aplTm,"\uc2dc")}return wetrDataList}}, {key:"renderSelectedRegionHourlyCardForObs",value:function renderSelectedRegionHourlyCardForObs(region,wetrDataList){var option={};var observationData=this.isAwsVisualMapType(this.visualMapType)?{awsWetrList:wetrDataList|| []}:{asosWetrList:wetrDataList||[]};this.validateDataAndRenderNoData("observationHourlyData",observationData);if(wetrDataList&&wetrDataList.length>0)this.element.find("._observationInfo").removeClass("hide"); else{this.element.find("._observationInfo").addClass("hide");return}option.regionKey=this.isAwsVisualMapType(this.visualMapType)?region.naverRgnCd:region.asosWetrRgnCd;var beforeRegionKey=this.element.find("._observationInfo .layer_table_scroll").data("regionKey"); var beforeDataType=this.element.find("._observationInfo .layer_table_scroll").data("type");if("".concat(beforeRegionKey)==="".concat(option.regionKey)&&"".concat(beforeDataType)==="".concat(this.visualMapType))return; option.wetrDataList=wetrDataList;option.dataType=this.visualMapType;option.unit=this.isAwsVisualMapType(this.visualMapType)?"mm":"cm";var oTemplate=Handlebars.getTemplateSync("_idVisualMapObsHourlyTemplate"); var elContent=oTemplate(option);this.element.find("._observationInfo .scroll_area").html(elContent);var html;if(this.isAwsVisualMapType(this.visualMapType))html='\n \x3ca href\x3d"'.concat(this.previewPath, "/today/").concat(region.naverRgnCd,'" data-region-code\x3d"').concat(region.naverRgnCd,'" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode,'butwet\')" class\x3d"layer_title_text" data-nlog-area\x3d"visual_map.region_link" data-nlog-params\x3d\'{"region_id":"').concat(region.naverRgnCd, "\"}'\x3e\n ").concat(region.regionName,"\n \x3c/a\x3e\n ");else html='\n \x3cspan class\x3d"layer_title_text"\x3e\n '.concat(region.regionName, "\n \x3c/span\x3e\n ");this.element.find(".layer_observation .layer_head_title").html(html);var folded=this.element.find("._cnDetailFoldBtn[data-type\x3dobservationHourly]").hasClass("folded"); this.element.find(".layer_observation .layer_head_text.type_observatory").removeClass("hide").html(region.obsName);if(this.isAwsVisualMapType(this.visualMapType)){this.element.find(".layer_observation .layer_head_title").removeClass("type_asos").addClass("type_aws"); this.updateObservationDetailValue(region.naverRgnCd,this.getLastObsAplYmdt())}else{this.element.find(".layer_observation .layer_head_title").removeClass("type_aws").addClass("type_asos");this.updateObservationDetailValue(region.asosWetrRgnCd, this.getLastObsAplYmdt())}if(this.getTemplateResponsiveSizeType().deviceType==="Pc"||!folded){this.infoCardOpen("observationHourly");var aplYmdt=this.getLastObsAplYmdt();if(aplYmdt)this.focusObservationTimeSeries(aplYmdt, true)}this.setObsHeadText()}}, {key:"getSelectedVisualMapTypeTitle",value:function getSelectedVisualMapTypeTitle(){var title=this.element.find(".map_tools_depth button[data-type\x3d".concat(this.visualMapType,"]")).html();if(title=== "\uc801\uc124")title="\uc2e0\uc801\uc124";return title}}, {key:"updateMarkerByMapType",value:function updateMarkerByMapType(){var $target=this.element.find("._cnVisualMapMaker .value, ._cnVisualMapMaker ._cnSubInfo");if($target.length===0)return;$target.addClass("hide"); $target.filter("._".concat(this.visualMapType)).removeClass("hide");this.resetMarkerSize()}}, {key:"updateMarkerByTimeSeries",value:function updateMarkerByTimeSeries(index){var _this20=this;if(this.visualMapType==="sea")return;this.markerList.forEach(function(marker){var regionCode=$(marker.eventTarget).data("regionCode")+ "";var timeSeries=_this20.getTimeSeriesByIndex(index);var wetrMap=_this20.wetrCacheMap.get(regionCode);var wetrData=wetrMap.get(timeSeries);if(wetrData===undefined&&index===0)wetrData=_toConsumableArray(wetrMap.values())[0]; if(_.isEmpty(wetrData))return;try{$(marker.eventTarget).find(".value._tmpr").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt, '\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(wetrData.tmpr,'\x3c/span\x3e\x3cspan class\x3d"degree"\x3e\u00b0\x3c/span\x3e\n '));$(marker.eventTarget).find(".value._stmpr").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd, '"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt,'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(_.defaultTo(wetrData.stmpr,"-"),'\x3c/span\x3e\x3cspan class\x3d"degree"\x3e\u00b0\x3c/span\x3e\n ')); $(marker.eventTarget).find(".value._rain").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt,'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(wetrData.oneHourRainAmt, '\x3c/span\x3e\x3cspan class\x3d"unit"\x3emm\x3c/span\x3e\n '));$(marker.eventTarget).find(".value._snow").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd, '"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt,'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(wetrData.oneHourSnowAmt,'\x3c/span\x3e\x3cspan class\x3d"unit"\x3ecm\x3c/span\x3e\n ')); $(marker.eventTarget).find(".value._humd").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd,'"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt,'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(_.defaultTo(wetrData.humd, "-"),'\x3c/span\x3e\x3cspan class\x3d"unit"\x3e%\x3c/span\x3e\n '));$(marker.eventTarget).find(".value._wind").html('\n \x3cspan class\x3d"icon ico_wt'.concat(wetrData.wetrCd, '"\x3e\x3cspan class\x3d"blind"\x3e').concat(wetrData.wetrTxt,'\x3c/span\x3e\x3c/span\x3e\n \x3cspan class\x3d"num"\x3e').concat(wetrData.windSpd,'\x3c/span\x3e\x3cspan class\x3d"unit"\x3em/s\x3c/span\x3e\n ')); $(marker.eventTarget).find("._cnSubInfo._tmpr").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uccb4\uac10 \x3cem\x3e'.concat(_.defaultTo(wetrData.stmpr,"-"),'\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \uc2b5\ub3c4 \x3cem\x3e').concat(_.defaultTo(wetrData.humd, "-"),'\x3cspan class\x3d"percent"\x3e%\x3c/span\x3e\x3c/em\x3e\n \x3c/div\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._stmpr").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uae30\uc628 \x3cem\x3e'.concat(wetrData.tmpr, '\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \uc2b5\ub3c4 \x3cem\x3e').concat(_.defaultTo(wetrData.humd,"-"),'\x3cspan class\x3d"percent"\x3e%\x3c/span\x3e\x3c/em\x3e\n \x3c/div\x3e\n ')); $(marker.eventTarget).find("._cnSubInfo._rain").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uae30\uc628 \x3cem\x3e'.concat(wetrData.tmpr,'\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \ud48d\uc18d \x3cem\x3e').concat(wetrData.windSpd, '\x3cspan class\x3d"percent"\x3em/s\x3c/span\x3e\x3c/em\x3e\n \x3c/div\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._snow").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uae30\uc628 \x3cem\x3e'.concat(wetrData.tmpr, '\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \uc2b5\ub3c4 \x3cem\x3e').concat(_.defaultTo(wetrData.humd,"-"),'\x3cspan class\x3d"percent"\x3e%\x3c/span\x3e\x3c/em\x3e\n \x3c/div\x3e\n ')); $(marker.eventTarget).find("._cnSubInfo._humd").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uae30\uc628 \x3cem\x3e'.concat(wetrData.tmpr,'\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \ud48d\uc18d \x3cem\x3e').concat(wetrData.windSpd, '\x3cspan class\x3d"percent"\x3em/s\x3c/span\x3e\x3c/em\x3e\n \x3c/div\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._wind").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uae30\uc628 \x3cem\x3e'.concat(wetrData.tmpr, '\u00b0\x3c/em\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"sub_info"\x3e\n \ud48d\ud5a5 \x3cem\x3e').concat(_this20.windDrctnInfo[wetrData.windDrctn], "\x3c/em\x3e\n \x3c/div\x3e\n "))}catch(e){}})}}, {key:"focusHourlyCardByTimeSeries",value:function focusHourlyCardByTimeSeries(index){if(this.element.find("._infoLayer._wetrInfo").hasClass("hide"))return;var timeSeries=this.getTimeSeriesByIndex(index); if(index!==0&&this.element.find(".cell[data-ymdt\x3d".concat(timeSeries,"]")).length===0)return;this.lastSlideYmdt=timeSeries;this.controlSnowData(this.lastSlideYmdt);this.element.find(".cell.now").removeClass("now"); this.element.find(".cell[data-ymdt\x3d".concat(timeSeries,"]")).addClass("now")}}, {key:"focusHourlyCardByLocalTime",value:function focusHourlyCardByLocalTime(ymdt){this.element.find(".cell.now").removeClass("now");this.element.find(".cell[data-ymdt\x3d".concat(ymdt,"]")).addClass("now")}}, {key:"moveScrollByTimeSeries",value:function moveScrollByTimeSeries(index){if(this.element.find("._infoLayer._wetrInfo").hasClass("hide"))return;var timeSeries=this.getTimeSeriesByIndex(index);if(oCommon.oScroll[this.visualHourlyId]&& this.visualMapType!=="sea"&&!this.element.find(".button_fold[data-type\x3d'visualHourly']").hasClass("folded"))if(oCommon.oScroll[this.visualHourlyId].options.snap){oCommon.isProgrammaticScroll=true;oCommon.oScroll[this.visualHourlyId].goToPage(oCommon.getPageIndexOfItemId(oCommon.oScroll[this.visualHourlyId], this.element.find(".cell[data-ymdt\x3d'".concat(timeSeries,"']"))),0,100)}else oCommon.oScroll[this.visualHourlyId].scrollToElement(".cell[data-ymdt\x3d'".concat(timeSeries,"']"),0,this.hourlyCardWidth/ 2*-1,null)}}, {key:"updateHourlyCardByMapType",value:function updateHourlyCardByMapType(){var $target=this.element.find("._wetrInfo .cell div");if($target.length===0)return;$target.not("._common").addClass("hide");$target.filter("._".concat(this.visualMapType)).removeClass("hide"); var typeClass=this.visualMapType==="wind"?"type_wind":"";$target.parent().removeClass("type_wind").addClass(typeClass)}}, {key:"updateColorGuideByMapType",value:function updateColorGuideByMapType(){this.element.find(".color_guide").addClass("hide");this.element.find(".color_info_guide").addClass("hide");this.element.find(".color_guide").filter("._".concat(this.visualMapType)).removeClass("hide"); var targetType=this.isWarnVisualMapType(this.visualMapType)?"warn":this.visualMapType;if(this.isWarnVisualMapType(this.visualMapType)&&_.isEmpty(this.warnList))return;if(this.isEqkVisualMapType(this.visualMapType)&& _.isEmpty(this.eqkList))return;this.element.find(".color_info_guide").filter("._".concat(targetType)).removeClass("hide")}}, {key:"getTimeSeriesByIndex",value:function getTimeSeriesByIndex(index){var _this$timeSeriesList$;if(this.timeSeriesList===null)return;return(_this$timeSeriesList$=this.timeSeriesList[index])===null||_this$timeSeriesList$=== void 0?void 0:_this$timeSeriesList$.slice(0,10)}}, {key:"initializeScroll",value:function initializeScroll(target){if(!(this.visualMapType!=="sea"&&this.element.find("._cnDetailFoldBtn[data-type\x3d'visualHourly']").hasClass("folded")))oCommon.initScroll(target); if(this.isObservationVisualMapType(this.visualMapType)&&!this.element.find("._cnDetailFoldBtn[data-type\x3d'observationHourly']").hasClass("folded"))oCommon.initScroll(target)}}, {key:"initializeSlidePosition",value:function initializeSlidePosition(){var enableScroll=!!oCommon.oScroll["".concat(this.visualHourlyId)];if(this.visualMapType==="snow"&&this.firstTownFcastYmdt>=this.lastSlideYmdt)this.lastSlideYmdt= this.firstTownFcastYmdt;if(!this.lastSlideYmdt||this.isPlaying())return;var _this$getHourlyIndexA=this.getHourlyIndexAndRatioByYmdt(this.lastSlideYmdt+"00"),_this$getHourlyIndexA2=_slicedToArray(_this$getHourlyIndexA, 2),index=_this$getHourlyIndexA2[0],ratio=_this$getHourlyIndexA2[1];var rawRatio=this.oSlider.get(true);if(this.noUiSliderPlayerService.getIndex(rawRatio)===index)ratio=rawRatio;this.moveSlideByYmdt(index, ratio);if(enableScroll){this.focusHourlyCardByTimeSeries(index);this.moveScrollByTimeSeries(index)}else this.controlSnowData(this.lastSlideYmdt)}}, {key:"clickCurrentPosition",value:function clickCurrentPosition(e){var _this=this;var target=e.currentTarget;if($(target).hasClass("on")){if(this.positionMarker)this.positionMarker.setVisible(false);$(target).removeClass("on"); this.drawMarkerForDongPosition();return}var fnCallback=function fnCallback(oLocation){var aCoords=oLocation.split(",");var sURL="/api/naverRgnCatForCoords";$.ajax({method:"GET",url:sURL,data:{lat:aCoords[0], lng:aCoords[1]}}).done(function(resp){_this.selectedRegionCode=resp.regionCode;_this.latitude=aCoords[0];_this.longitude=aCoords[1];_this.onCurrentPositon=true;_this.element.find("._cnVisualMapMaker").removeClass("on"); var currentPositionInfo=new naver.maps.LatLng(_this.latitude,_this.longitude);_this.naverMap.morph(currentPositionInfo,8);var oTemplate=Handlebars.getTemplateSync("_idVisualMapPositionTemplate");var elContent= oTemplate();if(_this.positionMarker===null)_this.positionMarker=new naver.maps.Marker({position:new naver.maps.LatLng(aCoords[0],aCoords[1]),map:_this.naverMap,icon:{content:elContent},visible:true,zIndex:0}); else{_this.positionMarker.setPosition(new naver.maps.LatLng(aCoords[0],aCoords[1]));_this.positionMarker.setVisible(true)}_this.hideDongPositionMarker();if(_this.dongPositionMarker)_this.dongPositionMarker.setPosition(currentPositionInfo); $(target).addClass("on")}).fail(function(jqXHR){oCommon.fnSendErrorToNelo("[visualMap.js] \uc9c0\uc5ed\ucf54\ub4dc \uc870\ud68c API \ud638\ucd9c\uc2e4\ud328",jqXHR)})}; var htOption={};htOption.callback=fnCallback;htOption.welButton=this.element.find(".btn_current button");htOption.returnType="".concat(this.previewPath).concat(pageJson.url.substring(1,pageJson.url.length)); htOption.originRegionCode=sRegionCode;htOption.originPath="map";oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(_this.clickCode,"loc"),false,true);oCommonGeoLocation.fnInit(htOption)}}, {key:"optimizeMarker",value:function optimizeMarker(){var _this=this;var mapBounds=this.naverMap.getBounds();this.markerList.forEach(function(marker,index){var position=marker.getPosition();if(!mapBounds.hasLatLng(position))_this.hideMarker(marker)})}}, {key:"hideMarker",value:function hideMarker(oMarker){var index=this.markerList.findIndex(function(o){return o===oMarker}); this.markerList.splice(index,1);oMarker.setVisible(false);oMarker.setMap(null)}}, {key:"clearMarker",value:function clearMarker(){var _this=this;var tempList=this.markerList.filter(function(){return true}); tempList.forEach(function(marker){return _this.hideMarker(marker)}); this.markerList=[]}}, {key:"removeIntersectMarker",value:function removeIntersectMarker(){var oMarker,oCompare;var markerListLength=this.markerList.length;for(var i=0;ilatest?current: latest},this.srmCacheMap.get("maple")[0].obsYmdt); html='\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e \ubc1c\ud45c, \x3ca href\x3d"https://www.weatheri.co.kr/" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e \uc81c\uacf5. \ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 '.concat(moment(obsYmdt, "YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm"))}catch(e){html='\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e \ubc1c\ud45c, \x3ca href\x3d"https://www.weatheri.co.kr/" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e \uc81c\uacf5.'}$target.find("._mapleDesc").find(".map_item_provide").html(html); $target.find("._mapleDesc").removeClass("hide");break;case "aws1h":case "aws1d":try{var _this$templateData38;var list=((_this$templateData38=this.templateData)===null||_this$templateData38===void 0?void 0: _this$templateData38.awsWetrList)||[];obsYmdt=list[list.length-1].fcastYmdt;obsYmdt="\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 "+moment(obsYmdt,"YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm")}catch(ignore){obsYmdt= ""}html='\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e \ubc1c\ud45c, \x3ca href\x3d"https://www.weatheri.co.kr/" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e \uc81c\uacf5. '.concat(obsYmdt); $target.find("._awsDesc").find(".map_item_provide").html(html);$target.find("._awsDesc").removeClass("hide");break;case "asos":try{var _this$templateData39;var _list=((_this$templateData39=this.templateData)=== null||_this$templateData39===void 0?void 0:_this$templateData39.asosWetrList)||[];obsYmdt=_list[_list.length-1].fcastYmdt;obsYmdt="\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 "+moment(obsYmdt,"YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm")}catch(ignore){obsYmdt= ""}html='\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e \ubc1c\ud45c, \x3ca href\x3d"https://www.weatheri.co.kr/" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e \uc81c\uacf5. '.concat(obsYmdt); $target.find("._asosDesc").find(".map_item_provide").html(html);$target.find("._asosDesc").removeClass("hide");break;case "pm10":case "pm25":try{obsYmdt=this.aqfCacheMap.get(this.getAqfPhotoType(this.visualMapType, this.aqfResolution)).map(function(o){return o.fcastYmdt}).reduce(function(latest,current){return current>latest?current:latest},this.aqfCacheMap.get(this.getAqfPhotoType(this.visualMapType,this.aqfResolution))[0].fcastYmdt); html='\x3ca href\x3d"https://www.nier.go.kr" target\x3d"_blank" class\x3d"map_provide_link" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"nier"}\'\x3e\uad6d\ub9bd\ud658\uacbd\uacfc\ud559\uc6d0\x3c/a\x3e \ubc1c\ud45c \ubc0f \uc81c\uacf5. \ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 '.concat(moment(obsYmdt, "YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm"))}catch(e){html='\x3ca href\x3d"https://www.nier.go.kr" target\x3d"_blank" class\x3d"map_provide_link" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"nier"}\'\x3e\uad6d\ub9bd\ud658\uacbd\uacfc\ud559\uc6d0\x3c/a\x3e \ubc1c\ud45c \ubc0f \uc81c\uacf5.'}$target.find("._aqfDesc.map_layer_provide").html(html); $target.find("._aqfDesc").removeClass("hide");break;case "typn":$target.find("._typnDesc").removeClass("hide");break;case "earthquake":$target.find("._eqkDesc").removeClass("hide");break;default:if(this.isWarnVisualMapType(this.visualMapType))$target.find("._".concat(this.visualMapType, "._mapDesc")).removeClass("hide");else $target.find("._wetrDesc").removeClass("hide")}oCommon.fnOpenInfoLayer($infoButton)}}}, {key:"getLatestObservationTime",value:function getLatestObservationTime(type){return this.srmCacheMap.get(type).map(function(o){return o.obsYmdt}).reduce(function(latest,current){return current>latest? current:latest},this.srmCacheMap.get(type)[0].obsYmdt)}}, {key:"createOfferAreaHtml",value:function createOfferAreaHtml(obsYmdt){if(menu==="today"){var baseHtml='\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"link_go" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'ref\')" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e\n \x3cspan class\x3d"margin_left margin_right"\x3e\ubc1c\ud45c,\x3c/span\x3e\n \x3ca href\x3d"https://www.weatheri.co.kr" target\x3d"_blank" class\x3d"link_go" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'ref\')" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e\n \x3cspan class\x3d"margin_left margin_right"\x3e\uc81c\uacf5\x3c/span\x3e'); if(obsYmdt)return"".concat(baseHtml," \x3cspan\x3e\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 ").concat(moment(obsYmdt,"YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm"),"\x3c/span\x3e");return baseHtml}else{var _baseHtml= '\x3ca href\x3d"https://www.weather.go.kr/w/index.do" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"kma"}\'\x3e\uae30\uc0c1\uccad\x3c/a\x3e \ubc1c\ud45c, \x3ca href\x3d"https://www.weatheri.co.kr/" target\x3d"_blank" class\x3d"map_provide_emphgasis" data-nlog-area\x3d"visual_map.source_link" data-nlog-params\x3d\'{"weather_cp":"weatheri"}\'\x3e\uc6e8\ub354\uc544\uc774\x3c/a\x3e \uc81c\uacf5.'; if(obsYmdt)return"".concat(_baseHtml," \ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 ").concat(moment(obsYmdt,"YYYYMMDDHHmm").format("YYYY.MM.DD. HH:mm"));return _baseHtml}}}, {key:"clickHourlyCard",value:function clickHourlyCard(e){var $target=$(e.currentTarget);var ymdt=$target.data("ymdt");var _this$getHourlyIndexA3=this.getHourlyIndexAndRatioByYmdt(ymdt+"00"),_this$getHourlyIndexA4= _slicedToArray(_this$getHourlyIndexA3,2),index=_this$getHourlyIndexA4[0],ratio=_this$getHourlyIndexA4[1];if(this.element.find("._playerRoot").hasClass("hide")){this.focusHourlyCardByLocalTime(ymdt);this.lastSlideYmdt= ymdt;this.updateMarkerByTimeSeries(index)}else{this.moveSlideByYmdt(index,ratio);this.focusHourlyCardByTimeSeries(index)}oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"flayclick"))}}, {key:"clickObservationHourlyCard",value:function clickObservationHourlyCard(e){var $target=$(e.currentTarget);var ymdt=$target.data("ymdt")+"";var regionKey=$target.data("regionKey")+"";this.setLastObsAplYmdt(ymdt); this.focusObservationTimeSeries(ymdt,false);this.updateObservationMarkerTimeSeries(ymdt);this.updateObservationDetailValue(regionKey,ymdt);this.setObsHeadText();oCommon.fnSendClick(e,"".concat(blockPageNameEn, ".").concat(this.clickCode,"flayclick"))}}, {key:"focusObservationTimeSeries",value:function focusObservationTimeSeries(aplYmdt,doScroll){this.element.find(".scroll_area[data-name\x3d".concat(this.observationHourlyId,"] .layer_table_cell")).removeClass("is-active"); this.element.find(".scroll_area[data-name\x3d".concat(this.observationHourlyId,"] .layer_table_cell[data-ymdt\x3d").concat(aplYmdt,"]")).addClass("is-active");if(doScroll&&oCommon.oScroll[this.observationHourlyId])if(oCommon.oScroll[this.observationHourlyId].options.snap){oCommon.isProgrammaticScroll= true;oCommon.oScroll[this.observationHourlyId].goToPage(oCommon.getPageIndexOfItemId(oCommon.oScroll[this.observationHourlyId],this.element.find(".layer_table_cell[data-ymdt\x3d'".concat(aplYmdt,"']"))), 0,100)}else oCommon.oScroll[this.observationHourlyId].scrollToElement(".layer_table_cell[data-ymdt\x3d'".concat(aplYmdt,"']"),0,this.hourlyCardWidth/2*-1,null)}}, {key:"updateObservationMarkerTimeSeries",value:function updateObservationMarkerTimeSeries(aplYmdt){var _this=this;this.markerList.forEach(function(marker){try{var regionCode=$(marker.eventTarget).data("regionCode")+ "";var obsDataMap={};var obsData=null;if(_this.visualMapType==="aws1h"){var _obsData,_obsData2,_obsData3;obsDataMap=_this.awsCacheMap.get(regionCode);obsData=obsDataMap.get(aplYmdt);$(marker.eventTarget).attr("data-value", _this.convertRainSnowAmt((_obsData=obsData)===null||_obsData===void 0?void 0:_obsData.rainAmt_60m));$(marker.eventTarget).find(".value._aws1h").html('\n \x3cspan class\x3d"num"\x3e'.concat(_this.convertRainSnowAmt((_obsData2= obsData)===null||_obsData2===void 0?void 0:_obsData2.rainAmt_60m),'\x3c/span\x3e\x3cspan class\x3d"unit"\x3emm\x3c/span\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._aws1h").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uc77c\uac04 \x3cem\x3e'.concat(_this.convertRainSnowAmt((_obsData3= obsData)===null||_obsData3===void 0?void 0:_obsData3.rainAmtDay),"\x3c/em\x3e\n \x3c/div\x3e\n "))}else if(_this.visualMapType==="aws1d"){var _obsData4, _obsData5,_obsData6;obsDataMap=_this.awsCacheMap.get(regionCode);obsData=obsDataMap.get(aplYmdt);$(marker.eventTarget).attr("data-value",_this.convertRainSnowAmt((_obsData4=obsData)===null||_obsData4=== void 0?void 0:_obsData4.rainAmtDay));$(marker.eventTarget).find(".value._aws1d").html('\n \x3cspan class\x3d"num"\x3e'.concat(_this.convertRainSnowAmt((_obsData5=obsData)===null|| _obsData5===void 0?void 0:_obsData5.rainAmtDay),'\x3c/span\x3e\x3cspan class\x3d"unit"\x3emm\x3c/span\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._aws1d").html('\n \x3cdiv class\x3d"sub_info"\x3e\n 1\uc2dc\uac04 \x3cem\x3e'.concat(_this.convertRainSnowAmt((_obsData6= obsData)===null||_obsData6===void 0?void 0:_obsData6.rainAmt_60m),"\x3c/em\x3e\n \x3c/div\x3e\n "))}else{var _obsData7,_obsData8,_obsData9;obsDataMap=_this.asosCacheMap.get(regionCode); obsData=obsDataMap.get(aplYmdt);$(marker.eventTarget).attr("data-value",_this.convertRainSnowAmt((_obsData7=obsData)===null||_obsData7===void 0?void 0:_obsData7.snowAmtAllday));$(marker.eventTarget).find(".value._asos").html('\n \x3cspan class\x3d"num"\x3e'.concat(_this.convertRainSnowAmt((_obsData8= obsData)===null||_obsData8===void 0?void 0:_obsData8.snowAmtAllday),'\x3c/span\x3e\x3cspan class\x3d"unit"\x3ecm\x3c/span\x3e\n '));$(marker.eventTarget).find("._cnSubInfo._asos").html('\n \x3cdiv class\x3d"sub_info"\x3e\n \uc77c \uc2e0\uc801\uc124 \x3cem\x3e'.concat(_this.convertRainSnowAmt((_obsData9= obsData)===null||_obsData9===void 0?void 0:_obsData9.snowAmt),"\x3c/em\x3e\n \x3c/div\x3e\n "))}}catch(ignore){}})}}, {key:"getHourlyIndexAndRatioByYmdt",value:function getHourlyIndexAndRatioByYmdt(ymdt){var index=this.timeSeriesList.indexOf(ymdt)===-1?0:this.timeSeriesList.indexOf(ymdt);var ratio=index/this.timeSeriesList.length; return[index,ratio]}}, {key:"moveSlideByYmdt",value:function moveSlideByYmdt(index,ratio){var _this$typnMapService14,_this$typnMapService15;this.oSlider.set(ratio);this.noUiSliderPlayerService.setSeek(ratio);this.updateToolTipByTimeSeries(index, ratio);this.updateMapLayerBySlider(index,ratio);(_this$typnMapService14=this.typnMapService)===null||_this$typnMapService14===void 0?void 0:_this$typnMapService14.updateTypnRainLayerBySlider(index);(_this$typnMapService15= this.typnMapService)===null||_this$typnMapService15===void 0?void 0:_this$typnMapService15.updateTypnMarkerByTimeSeries(ratio);this.updateSliderTooltipDisplayClass(ratio)}}, {key:"controlSnowData",value:function controlSnowData(ymdt){if(this.visualMapType==="snow")if(this.firstTownFcastYmdt>ymdt){this.showLayerSnow();this.hideAllMarker()}else{this.hideLayerSnow();this.showAllMarker()}else{this.hideLayerSnow(); this.showAllMarker()}}}, {key:"showLayerSnow",value:function showLayerSnow(){var html='\n \x3cdiv class\x3d"layer_snow" aria-hidden\x3d"false"\x3e\n \x3cp class\x3d"layer_snow_text"\x3e\n \uae30\uc0c1\uccad\uc758 \uc2e0\uc801\uc124 \uc608\ubcf4\ub294 \ud604\uc7ac \uae30\uc900 6\uc2dc\uac04 \uc774\ud6c4 \uc2dc\uc810\ubd80\ud130 \uc81c\uacf5\ub429\ub2c8\ub2e4.\n \x3c/p\x3e\n \x3c/div\x3e\n '; this.hideLayerSnow();this.element.find(".map_panel").append(html)}}, {key:"hideLayerSnow",value:function hideLayerSnow(){this.element.find(".map_panel .layer_snow").remove()}}, {key:"showAllMarker",value:function showAllMarker(){this.markerShow=true;var _this=this;this.markerList.forEach(function(marker){marker.setVisible(_this.markerShow)})}}, {key:"hideAllMarker",value:function hideAllMarker(){this.markerShow=false;var _this=this;this.markerList.forEach(function(marker){marker.setVisible(_this.markerShow)})}}, {key:"isPlaying",value:function isPlaying(){return this.element.find("._playBtn").hasClass("clicked")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this$warnMapService9,_this$warnMapService0,_this$eqkMapService8,_this$eqkMapService8$;if(this.isMapSdkUnavailable)return; if(this.element.css("display")!=="none")this.hourlyCardWidth=this.element.find("._wetrInfo").width();this.renderMapTitle();if(!this.naverMap)return;this.naverMap.autoResize();this.initAllScroll();(_this$warnMapService9= this.warnMapService)===null||_this$warnMapService9===void 0?void 0:(_this$warnMapService0=_this$warnMapService9.handleResize)===null||_this$warnMapService0===void 0?void 0:_this$warnMapService0.call(_this$warnMapService9, lastResponsiveSizeType,isChanged);(_this$eqkMapService8=this.eqkMapService)===null||_this$eqkMapService8===void 0?void 0:(_this$eqkMapService8$=_this$eqkMapService8.handleResize)===null||_this$eqkMapService8$=== void 0?void 0:_this$eqkMapService8$.call(_this$eqkMapService8,lastResponsiveSizeType,isChanged);this.updateSliderTextDisplayClass();this.updateSliderTooltipDisplayClass()}}, {key:"initAllScroll",value:function initAllScroll(){this.initializeScroll(this.element.find('.scroll_area[data-name\x3d"'.concat(this.visualHourlyId,'"]')));this.initializeScroll(this.element.find('.scroll_area[data-name\x3d"'.concat(this.observationHourlyId, '"]')))}}, {key:"isValidOverseasMapType",value:function isValidOverseasMapType(type){return["tmpr","rain","wind"].includes(type)}}, {key:"isAwsVisualMapType",value:function isAwsVisualMapType(type){return["aws1h","aws1d"].includes(type)}}, {key:"isObservationVisualMapType",value:function isObservationVisualMapType(type){return this.isAwsVisualMapType(type)||type==="asos"}}, {key:"isWetrVisualMapType",value:function isWetrVisualMapType(type){return["tmpr","stmpr","rain","snow","humd","wind"].includes(type)}}, {key:"isVideoVisualMapType",value:function isVideoVisualMapType(type){return["sat","rdr","maple"].includes(type)}}, {key:"isAirVisualMapType",value:function isAirVisualMapType(type){return type==="air"||this.isAqfVisualMapType(type)}}, {key:"isAqfVisualMapType",value:function isAqfVisualMapType(type){return["pm10","pm25"].includes(type)}}, {key:"isAirAqfMode",value:function isAirAqfMode(){return menu==="air"&&this.isAqfVisualMapType(this.visualMapType)}}, {key:"isTalkMapType",value:function isTalkMapType(type){return["talk"].includes(type)}}, {key:"isTypnVisualMapType",value:function isTypnVisualMapType(type){return["typn"].includes(type)}}, {key:"isWarnVisualMapType",value:function isWarnVisualMapType(type){var _type$startsWith;return(_type$startsWith=type===null||type===void 0?void 0:type.startsWith("warn"))!==null&&_type$startsWith!==void 0? _type$startsWith:false}}, {key:"isEqkVisualMapType",value:function isEqkVisualMapType(type){return["earthquake"].includes(type)}}, {key:"isDisasterVisualMapType",value:function isDisasterVisualMapType(type){return this.isTypnVisualMapType(type)||this.isWarnVisualMapType(type)||this.isEqkVisualMapType(type)}}, {key:"switchToNonDisasterTab",value:function switchToNonDisasterTab(){var buttons=this.element.find(".map_tools_depth button:not([disabled])");for(var i=0;i0;if(isMobile)$("h2.type_weather--map[data-map-type\x3dsat], h2.type_weather--map[data-map-type\x3drdr]").remove(); if(this.initVisualMapType==="sat")if(!hasTitleVideo){var html='\n \x3ch2 class\x3d"title_video tab_btn"\x3e\n \x3cbutton type\x3d"button" class\x3d"title_tab on" data-map-type\x3d"sat" onclick\x3d"oCommon.fnSendClick(event, \''.concat(blockPageNameEn, ".").concat(this.clickCode,'satt\')" data-nlog-area\x3d"visual_map.tab_button" data-nlog-params\x3d\'{"tab":"sat"}\'\x3e\uc704\uc131 \uc601\uc0c1\x3cspan class\x3d"blind"\x3e\uc120\ud0dd\ub428\x3c/span\x3e\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"title_tab" data-map-type\x3d"rdr" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn, ".").concat(this.clickCode,'rdrt\')" data-nlog-area\x3d"visual_map.tab_button" data-nlog-params\x3d\'{"tab":"rdr"}\'\x3e\ub808\uc774\ub354 \uc601\uc0c1\x3c/button\x3e\n \x3ca href\x3d"" class\x3d"title_video_more" data-map-type\x3d"video" data-nlog-area\x3d"visual_map.more_link" data-nlog-params\x3d\'{"target":"video"}\'\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3c/h2\x3e\n '); this.element.before(html);$(document).on("click",".title_video .title_tab",$.proxy(this.clickVisualMapTitleTab,this));$(document).on("click",".title_video a",$.proxy(this.clickVisualMapLanding,this))}else if(isMobile)this.element.prev("h2.title_video").show(); if(isMobile){var activeMapType=$("h2.title_video button.on").data("map-type");$("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3dsat], ._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3drdr]").hide(); $("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d".concat(activeMapType,"]")).show()}else $("._cnBlockTemplate[data-template\x3dvisualMap]").not("[data-group-member]").show()}}, {key:"renderAirMapTitle",value:function renderAirMapTitle(){var _this21=this;var isMobile=oCommon.fnGetResponsiveSizeType().deviceType==="Mobile";var hasTitleVideo=$("h2._cnAqfTitle").length>0;if(isMobile)$("h2.type_weather--map[data-map-type\x3dpm10], h2.type_weather--map[data-map-type\x3dpm25]").remove(); var configMap={pm10:{tabs:[{type:"pm10",text:"\ubbf8\uc138\uc601\uc0c1",clickCode:"pm10t",isOn:true},{type:"pm25",text:"\ucd08\ubbf8\uc138\uc601\uc0c1",clickCode:"pm25t",isOn:false}]}};var config=configMap[this.initVisualMapType]; if(config)if(!hasTitleVideo){var tabsHtml=config.tabs.map(function(tab){return'\n \x3cbutton type\x3d"button"\n class\x3d"title_tab _cnAqfTitleTab'.concat(tab.isOn? " on":"",'"\n data-map-type\x3d"').concat(tab.type,'"\n onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(_this21.clickCode).concat(tab.clickCode, '\')" data-nlog-area\x3d"visual_map.tab_button" data-nlog-params\x3d\'{"tab":"').concat(tab.type,"\"}'\x3e\n ").concat(tab.text).concat(tab.isOn?'\x3cspan class\x3d"blind"\x3e\uc120\ud0dd\ub428\x3c/span\x3e': "","\n \x3c/button\x3e\n ")}).join(""); var html='\n \x3ch2 class\x3d"title_video tab_btn _cnAqfTitle"\x3e\n '.concat(tabsHtml,'\n \x3ca href\x3d"" class\x3d"title_video_more" data-map-type\x3d"aqf" data-nlog-area\x3d"visual_map.more_link" data-nlog-params\x3d\'{"target":"aqf"}\'\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3c/h2\x3e\n '); this.element.before(html);$(document).on("click","._cnAqfTitle ._cnAqfTitleTab",$.proxy(this.clickAqfTitleTab,this));$(document).on("click","._cnAqfTitle a",$.proxy(this.clickAqfLanding,this))}else if(isMobile)this.element.prev("h2._cnAqfTitle").show(); if(isMobile){var activeMapType=$("h2._cnAqfTitle button.on").data("map-type");$("._cnBlockTemplate[data-template\x3dvisualMap]").filter("[data-map-type\x3d'pm10'], [data-map-type\x3d'pm25']").hide();$("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d".concat(activeMapType, "]")).show()}else $("._cnBlockTemplate[data-template\x3dvisualMap]").not("[data-group-member]").show()}}, {key:"renderDefaultMapTitle",value:function renderDefaultMapTitle(){if(oCommon.fnGetResponsiveSizeType().deviceType==="Pc"){this.element.prev("h2.title_video").hide();$("._cnBlockTemplate[data-template\x3dvisualMap]").not("[data-group-member]").show()}if(oCommon.fnGetResponsiveSizeType().deviceType=== "Mobile"&&(this.initVisualMapType==="rdr"||this.initVisualMapType==="pm25"))return;if(menu!=="map"){if(!this.initVisualMapType)return;var hasMoreLink=this.hasGroupId()||this.initVisualMapType!=="tmpr"; if(this.element.prev("h2.type_weather--map").length===0){var _this$templateInfo30,_this$templateInfo30$;var html='\n \x3ch2 class\x3d"title type_weather--map" data-map-type\x3d"'.concat(this.initVisualMapType, '"\x3e\n ').concat(((_this$templateInfo30=this.templateInfo)===null||_this$templateInfo30===void 0?void 0:(_this$templateInfo30$=_this$templateInfo30.customInfo)===null||_this$templateInfo30$=== void 0?void 0:_this$templateInfo30$.lnbTitle)||"\ub0a0\uc528\uc9c0\ub3c4","\n ").concat(hasMoreLink?'\x3ca href\x3d"'.concat(this.previewPath,"/map/").concat(sRegionCode,"?visualMapType\x3d").concat(this.initVisualMapType, '" class\x3d"title_more" onclick\x3d"oCommon.fnSendClick(event, \'').concat(blockPageNameEn,".").concat(this.clickCode).concat(this.initVisualMapType,'more\')" data-map-type\x3d"map" data-nlog-area\x3d"visual_map.more_link" data-nlog-params\x3d\'{"target":"').concat(this.initVisualMapType, "\"}'\x3e\ub354\ubcf4\uae30\x3c/a\x3e"):"","\n \x3c/h2\x3e\n ");this.element.before(html)}}}}, {key:"clickVisualMapTitleTab",value:function clickVisualMapTitleTab(e){if($(e.currentTarget).closest('[data-template\x3d"visualMapGroup"]').length>0)return;var index=$(e.currentTarget).index();var mapType= $(e.currentTarget).data("mapType");$(".title_video .title_tab.on").removeClass("on");$(".title_video .title_tab").eq(index).addClass("on");$("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d'sat'], ._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d'rdr']").hide(); $("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d".concat(mapType,"]")).show();this.allMapAutoResize()}}, {key:"clickAqfTitleTab",value:function clickAqfTitleTab(e){var index=$(e.currentTarget).index();var mapType=$(e.currentTarget).data("mapType");$("._cnAqfTitle ._cnAqfTitleTab.on").removeClass("on");$("._cnAqfTitle ._cnAqfTitleTab").eq(index).addClass("on"); $("._cnBlockTemplate[data-template\x3dvisualMap]").filter("[data-map-type\x3d'pm10'], [data-map-type\x3d'pm25']").hide();$("._cnBlockTemplate[data-template\x3dvisualMap][data-map-type\x3d".concat(mapType, "]")).show();this.allMapAutoResize()}}, {key:"clickVisualMapLanding",value:function clickVisualMapLanding(e){if($(e.currentTarget).closest('[data-template\x3d"visualMapGroup"]').length>0)return;e.preventDefault();var mapType=$(".title_video .title_tab.on").data("mapType"); var url="".concat(this.previewPath,"/map/").concat(sRegionCode,"?visualMapType\x3d").concat(mapType);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(mapType,"more")); location.href=url}}, {key:"clickAqfLanding",value:function clickAqfLanding(e){e.preventDefault();var mapType=$("._cnAqfTitle ._cnAqfTitleTab.on").data("map-type");var url="".concat(this.previewPath,"/map/").concat(sRegionCode, "?visualMapType\x3d").concat(mapType);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(mapType,"more"));location.href=url}}, {key:"allMapAutoResize",value:function allMapAutoResize(){naver.maps.Map.__instances.forEach(function(value){value.autoResize()})}}, {key:"addTalkMapUp",value:function addTalkMapUp(){this.element.find("._cnTalkMap .icon_up").removeClass("hide")}}, {key:"removeTalkMapUp",value:function removeTalkMapUp(){this.element.find("._cnTalkMap .icon_up").addClass("hide")}}, {key:"executeTalkMapServiceEnableTalkMap",value:function executeTalkMapServiceEnableTalkMap(nation){this.talkMapService.enableTalkMap(nation)}}, {key:"executeTalkMapServiceFindSelectedRegionMarker",value:function executeTalkMapServiceFindSelectedRegionMarker(regionCode){var moveImmediately=arguments.length>1&&arguments[1]!==undefined?arguments[1]: false;this.talkMapService.findSelectedRegionMarker(regionCode,moveImmediately)}}, {key:"executeTalkMapServiceMakeTalkMapStatsParams",value:function executeTalkMapServiceMakeTalkMapStatsParams(){return this.talkMapService.makeTalkMapStatsParams()}}, {key:"executeTalkMapServiceProcessMapTalkStats",value:function executeTalkMapServiceProcessMapTalkStats(dataList,intZoom){this.talkMapService.processMapTalkStats(dataList,intZoom)}}, {key:"executeTalkMapServiceTalkMapAjaxAlwaysCallback",value:function executeTalkMapServiceTalkMapAjaxAlwaysCallback(){this.talkMapService.talkMapAjaxAlwaysCallback()}}, {key:"executeTalkMapServiceCheckTalkMapEnabled",value:function executeTalkMapServiceCheckTalkMapEnabled(){return this.talkMapService.checkTalkMapEnabled()}}, {key:"executeTalkMapServiceFocusNation",value:function executeTalkMapServiceFocusNation(){this.talkMapService.focusNation()}}, {key:"executeTalkMapServiceMoveImmediately",value:function executeTalkMapServiceMoveImmediately(zoom,latitude,longitude){var selectedRegion=arguments.length>3&&arguments[3]!==undefined?arguments[3]:undefined; this.talkMapService.moveImmediately(zoom,latitude,longitude,selectedRegion)}}]); return visualMap}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0){var message='\uc2dc\uac01\ud654\uc9c0\ub3c4\uadf8\ub8f9 "'.concat(this.groupId, '"\uc758 \uc9c0\ub3c4\uac00 ').concat(this.memberList.length,"\uac1c\uc785\ub2c8\ub2e4. \ucd5c\uc18c 2\uac1c\uac00 \ud544\uc694\ud569\ub2c8\ub2e4.");oBlockScriptService.warnBlockConfigToNelo("visualMapGroup", message);oBlockScriptService.showPreviewConfigWarn(this.element,"visualMapGroup",message)}return}this.checkMemberPlacement();this.activeTabName=this.getInitTab().data("name");this.renderGroupTitle();this.applyStyleClass(); this.applyRenderMode();if(this.groupType!=="TAB")return;this.initTabScroll();var anchorName=this.getAnchorName();if(this.isTargetMenu===true&&oCommon.oScroll[anchorName])oCommon.oScroll[anchorName].scrollToElement(".tab_link[data-name\x3d'".concat(targetMenu, "']"),10)}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".tab_list .tab_link, .title_tab",$.proxy(this.clickLnb,this));this.element.on("click",".tab_list_more, .title_video_more",$.proxy(this.clickTabMore, this))}}, {key:"isGrid",value:function isGrid(){return this.groupType==="GRID"}}, {key:"isWideTab",value:function isWideTab(){return!this.isGrid()&&this.groupHeightType==="HIGH"}}, {key:"getTabLinks",value:function getTabLinks(){return this.isGrid()?this.element.find(".title_tab"):this.element.find(".tab_list .tab_link")}}, {key:"getActiveClass",value:function getActiveClass(){return this.isGrid()?"on":"is_on"}}, {key:"getAnchorName",value:function getAnchorName(){return"anchor-".concat(this.templateInfo.index)}}, {key:"renderTabBar",value:function renderTabBar(){if(this.isTabBarRendered)return;this.isTabBarRendered=true;if(this.isGrid()){this.element.addClass("title_video tab_btn");this.element.append('\x3ca href\x3d"" class\x3d"title_video_more" data-nlog-area\x3d"visual_map_group.more_link"\x3e\ub354\ubcf4\uae30\x3c/a\x3e'); return}this.element.addClass("scroll_control tab_list_wrap");this.element.append('\n \x3cdiv class\x3d"scroll_area tab_list_wrap" data-name\x3d"'.concat(this.getAnchorName(),'" data-click\x3d"false" data-nclk\x3d"').concat(blockPageNameEn, ".").concat(this.clickCode,'scr" data-bounce\x3d"false" data-nlog-area\x3d"visual_map_group.scroll"\x3e\n \x3cul class\x3d"tab_list"\x3e\x3c/ul\x3e\n \x3cdiv class\x3d"tab_list_gradient"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"tab_list_background"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3ca href\x3d"" class\x3d"tab_list_more" data-nlog-area\x3d"visual_map_group.more_link"\x3e\ub354\ubcf4\uae30\x3c/a\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_prev" data-nlog-area\x3d"visual_map_group.scroll.button" data-nlog-params\x3d\'{"direction":"prev"}\'\x3e\x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"common_slide_button btn_next" data-nlog-area\x3d"visual_map_group.scroll.button" data-nlog-params\x3d\'{"direction":"next"}\'\x3e\x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\x3c/button\x3e\n '))}}, {key:"renderTabItem",value:function renderTabItem(title,tabName){var $link=this.isGrid()?$('\x3cbutton type\x3d"button" class\x3d"title_tab" data-nlog-area\x3d"visual_map_group.tab_button" data-nlog-params\x3d\'{"tab":""}\'\x3e\x3c/button\x3e'): $('\x3ca href\x3d"#" class\x3d"tab_link" data-nlog-area\x3d"visual_map_group.scroll.tab_link" data-nlog-params\x3d\'{"tab":""}\'\x3e\x3c/a\x3e');$link.attr("data-name",tabName).attr("data-lnb-click-code", "vmap").text(title);if(this.isGrid()){this.element.find(".title_video_more").before($link);return}this.element.find(".tab_list").append($("\x3cli\x3e\x3c/li\x3e").append($link))}}, {key:"registerTab",value:function registerTab(title,tabName){this.renderTabBar();if(this.memberList.length>=this.maxTabCount){this.rejectedCount+=1;console.warn("[visualMapGroup:".concat(this.groupId,"] \ucd5c\ub300 \ud0ed \uc218(").concat(this.maxTabCount, ") \ucd08\uacfc - '").concat(tabName,"' \ub4f1\ub85d \uac70\ubd80"));return false}this.renderTabItem(title,tabName);this.memberList.push({tabName:tabName});return true}}, {key:"checkMemberPlacement",value:function checkMemberPlacement(){var expected=this.memberList.map(function(member){return member.tabName}); var found=[];var $node=this.element.next();while($node.length>0&&found.length0)return;var $title=$('\x3cstrong class\x3d"video_head_title"\x3e\x3c/strong\x3e');if(this.groupTitle)$title.text(this.groupTitle); else $title.addClass("hide");this.element.before($title)}}, {key:"applyStyleClass",value:function applyStyleClass(){var typeClass=this.isGrid()?"vmgrp_type_grid":"vmgrp_type_tab";var otherClass=this.isGrid()?"vmgrp_type_tab":"vmgrp_type_grid";var $targets=this.element.add(this.getMemberElements()); $targets.removeClass(otherClass);$targets.addClass(typeClass)}}, {key:"applyModeClass",value:function applyModeClass(){var $targets=this.element.add(this.getMemberElements());$targets.removeClass("vmgrp_mode_tab vmgrp_mode_grid vmgrp_mode_tab--wide");$targets.addClass("vmgrp_mode_".concat(this.renderMode)); if(this.isWideTab())$targets.addClass("vmgrp_mode_tab--wide")}}, {key:"applyRenderMode",value:function applyRenderMode(){var isMobile=oCommon.fnGetResponsiveSizeType().deviceType==="Mobile";var mode="tab";if(this.isGrid()&&this.memberList.length===2&&!isMobile)mode= "grid";if(mode===this.renderMode)return;this.renderMode=mode;this.applyModeClass();if(mode==="tab"){this.syncTabIsOn(this.activeTabName);this.onLnb(this.activeTabName)}else this.showAllMembers();this.syncMemberMapTitles(); this.renderOfferArea();this.updateTabMoreLink()}}, {key:"syncMemberMapTitles",value:function syncMemberMapTitles(){var _this2=this;this.memberList.forEach(function(member){var $member=_this2.getMemberElement(member.tabName);oBlockScriptService.callTemplateFuncWithIndex($member.data("template"), $member.data("templateIndex"),"syncMapTitle")})}}, {key:"showAllMembers",value:function showAllMembers(){var _this3=this;this.memberList.forEach(function(member){var $member=_this3.getMemberElement(member.tabName);var initMethod=$member.data("initMethod"); _this3.showMemberElement($member);if(initMethod&&initMethod.length>0)oBlockScriptService.callTemplateFuncWithIndex($member.data("template"),$member.data("templateIndex"),initMethod)})}}, {key:"showMemberElement",value:function showMemberElement($member){$member.css("display","")}}, {key:"hideMembersExcept",value:function hideMembersExcept(tabName){var _this4=this;this.memberList.forEach(function(member){if(member.tabName===tabName)return;var $member=_this4.getMemberElement(member.tabName); if($member.css("display")==="none")return;var hideMethod=$member.data("hideMethod");if(hideMethod&&hideMethod.length>0)oBlockScriptService.callTemplateFuncWithIndex($member.data("template"),$member.data("templateIndex"), hideMethod);$member.css("display","none")})}}, {key:"clickLnb",value:function clickLnb(e){e.preventDefault();var element=$(e.currentTarget);var name=element.data("name");this.syncTabIsOn(name);this.onLnb(name);var lnbClickCode=element.data("lnbClickCode"); if(lnbClickCode)oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(lnbClickCode))}}, {key:"syncTabIsOn",value:function syncTabIsOn(name){var activeClass=this.getActiveClass();var $links=this.getTabLinks();$links.removeClass(activeClass);$links.find(".blind").remove();var $active=$links.filter("[data-name\x3d'".concat(name, "']")).addClass(activeClass);if(this.isGrid())$active.append('\x3cspan class\x3d"blind"\x3e\uc120\ud0dd\ub428\x3c/span\x3e')}}, {key:"onLnb",value:function onLnb(name){var $on=this.getMemberElement(name);if($on.length===0)return;var wasVisible=$on.css("display")!=="none";this.hideMembersExcept(name);if(!wasVisible){this.showMemberElement($on); var initMethod=$on.data("initMethod");var initParam=this.getTabLinks().filter("[data-name\x3d'".concat(name,"']")).data("initParam");if(initMethod&&initMethod.length>0)oBlockScriptService.callTemplateFuncWithIndex($on.data("template"), $on.data("templateIndex"),initMethod,initParam)}this.activeTabName=name;this.renderOfferArea();this.updateTabMoreLink()}}, {key:"getMemberElements",value:function getMemberElements(){var selector=this.memberList.map(function(member){return".content_area_wrap[data-tab-name\x3d'".concat(member.tabName,"']")}).join(","); return selector?$(selector):$()}}, {key:"getMemberElement",value:function getMemberElement(tabName){return $(".content_area_wrap[data-tab-name\x3d'".concat(tabName,"']"))}}, {key:"getInitTab",value:function getInitTab(){if(this.initTab)return this.initTab;var $links=this.getTabLinks();var index=this.groupInitIndex;if(!Number.isInteger(index)||index<0||index>=this.memberList.length){if(index!== 0){var requested="".concat(index+1,"\ubc88");if(!Number.isInteger(index))requested="\uc22b\uc790\uac00 \uc544\ub2cc \uac12";else if(index<0)requested="".concat(index+1,"\ubc88(\uc21c\ubc88\uc740 1\ubd80\ud130\uc785\ub2c8\ub2e4)"); var reason=this.rejectedCount>0?"\uc815\uc6d0(".concat(this.maxTabCount,"\uac1c)\uc744 \ub118\uaca8 ").concat(this.rejectedCount,"\uac1c\uac00 \ub4f1\ub85d\ub418\uc9c0 \uc54a\uc544 \uc2e4\uc81c \ud0ed\uc740 ").concat(this.memberList.length, "\uac1c\uc785\ub2c8\ub2e4"):"\ud604\uc7ac \ud0ed\uc740 ".concat(this.memberList.length,"\uac1c\uc785\ub2c8\ub2e4");var message="\ucd08\uae30 \ud65c\uc131 \ud0ed\uc73c\ub85c ".concat(requested,"\uc744 \uc9c0\uc815\ud588\uc73c\ub098 ").concat(reason, ". 1\ubc88 \ud0ed\uc73c\ub85c \ub300\uccb4\ub429\ub2c8\ub2e4.");oBlockScriptService.warnBlockConfigToNelo("visualMapGroup",message);oBlockScriptService.showPreviewConfigWarn(this.element,"visualMapGroup", message,"notice")}index=0}this.initTab=$links.eq(index);if(targetMenu.length>1){var $target=$links.filter("[data-name\x3d'".concat(targetMenu,"']"));if($target.length===1){this.isTargetMenu=true;this.initTab= $target}}return this.initTab}}, {key:"shouldInitOnLoad",value:function shouldInitOnLoad(tabName){if(this.memberList.length<2)return false;var isMobile=oCommon.fnGetResponsiveSizeType().deviceType==="Mobile";if(this.isGrid()&&this.memberList.length=== 2&&!isMobile)return true;return this.getInitTab().data("name")===tabName}}, {key:"updateTabMoreLink",value:function updateTabMoreLink(){var $member=this.getMemberElement(this.activeTabName);var mapType=$member.data("mapType");var memberContext=$member.attr("data-nlog-context-params"); if(memberContext)this.element.attr("data-nlog-context-params",memberContext);else this.element.removeAttr("data-nlog-context-params");this.syncTabNlogParams();var $more=this.element.find(".tab_list_more, .title_video_more"); if($more.length===0)return;if(!mapType){$more.addClass("hide");return}$more.removeClass("hide").attr("href","".concat(this.previewPath,"/map/").concat(sRegionCode,"?visualMapType\x3d").concat(mapType))}}, {key:"syncTabNlogParams",value:function syncTabNlogParams(){var _this5=this;this.getTabLinks().each(function(index,el){var $link=$(el);var $member=_this5.getMemberElement($link.data("name"));var mapType= $member.data("mapType");if(!mapType)try{mapType=JSON.parse($member.attr("data-nlog-context-params")||"{}").data_type}catch(e){}if(mapType)$link.attr("data-nlog-params",JSON.stringify({tab:"visual_map_".concat(mapType)}))})}}, {key:"clickTabMore",value:function clickTabMore(e){var mapType=this.getMemberElement(this.activeTabName).data("mapType");oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode).concat(mapType, "more"))}}, {key:"updateOfferArea",value:function updateOfferArea(tabName,html){if(this.isGrid())return;this.offerMap[tabName]=html;this.renderOfferArea()}}, {key:"renderOfferArea",value:function renderOfferArea(){if(this.isGrid()||this.memberList.length===0)return;var html=this.offerMap[this.activeTabName]||"";var $lastMember=this.getMemberElement(this.memberList[this.memberList.length- 1].tabName);var $area=$lastMember.next(".offer_area");if($area.length===0){if(!html)return;$area=$('\x3cdiv class\x3d"offer_area"\x3e\x3c/div\x3e').insertAfter($lastMember)}$area.html(html)}}, {key:"initTabScroll",value:function initTabScroll(){var _this6=this;oCommon.initScroll(this.element.find(".scroll_area"),null,null,function(name){_this6.resizeTabList();oCommon.oScroll[name].refresh()})}}, {key:"refreshTabScroll",value:function refreshTabScroll(){var scroll=oCommon.oScroll[this.getAnchorName()];if(scroll){scroll.refresh();return}this.initTabScroll()}}, {key:"resizeTabList",value:function resizeTabList(){var element=this.element.find(".scroll_area");var sumWidth=0;$(element).find("._cnScrollInner").children().each(function(){if($(this).is(":visible"))sumWidth+= $(this).outerWidth()}); var width=$(element).width();if(Number(sumWidth)>width)$(element).children(".tab_list").width($(element).width()+(sumWidth-width)+"px")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(isChanged)this.applyRenderMode();if(this.groupType!=="TAB")return;this.resizeTabList();this.refreshTabScroll()}}, {key:"getLnbElement",value:function getLnbElement(){return this.isGrid()?this.element:this.element.find(".tab_list")}}]); return visualMapGroup}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;iString(prev.ancmtYmdt))latestByType.set(report.reportType,report)}); return Array.from(latestByType.values()).sort(function(a,b){return _this2.getReportTypeRank(a.reportType)-_this2.getReportTypeRank(b.reportType)})}}, {key:"getReportTypeRank",value:function getReportTypeRank(reportType){var rank=Object.keys(this.reportTypeNames).indexOf(reportType);return rank===-1?Number.MAX_SAFE_INTEGER:rank}}, {key:"getTabParam",value:function getTabParam(reportType){return _.has(this.reportTypeNames,reportType)?reportType:"etc"}}, {key:"renderTabList",value:function renderTabList(){var _this3=this;var tabHtml=this.reportList.map(function(report,index){var isOn=index===_this3.activeIndex;var typeName=_.has(_this3.reportTypeNames, report.reportType)?_this3.reportTypeNames[report.reportType]:report.reportType;var tabParam=_this3.getTabParam(report.reportType);return'\n \x3cli class\x3d"item" role\x3d"presentation"\x3e\n \x3cbutton type\x3d"button" role\x3d"tab" class\x3d"btn_tab'.concat(isOn? " is_on":"",'" aria-selected\x3d"').concat(isOn,'" data-index\x3d"').concat(index,'" data-nlog\x3d"tab" data-nlog-params\x3d\'{"tab":"').concat(tabParam,'"}\' data-nlog-area\x3d"warning_text_type.tab_button"\x3e').concat(_.escape(typeName), "\x3c/button\x3e\n \x3c/li\x3e")}).join(""); this.element.find("._cnReportTabList").html(tabHtml)}}, {key:"renderActiveReport",value:function renderActiveReport(){var report=this.reportList[this.activeIndex];var parsedHtml=this.buildParsedHtml(this.getParsedContent(report));var panelHtml=parsedHtml||this.buildFallbackHtml(report); var announced=moment(report.ancmtYmdt,"YYYYMMDDHHmmss").format("YYYY.MM.DD. HH:mm");this.element.find("._cnReportPanel").html(panelHtml);this.element.find("._cnReportOffer").html("\x3cspan\x3e".concat(announced, " \ubc1c\ud45c \x3c/span\x3e\x3cspan\x3e\uc81c").concat(_.escape(String(report.tmSeq)),"\ud638\x3c/span\x3e"));this.updateNlogContext(report);this.updateExpandable()}}, {key:"updateNlogContext",value:function updateNlogContext(report){this.element.attr("data-nlog-context-params",JSON.stringify({tab:this.getTabParam(report.reportType)}))}}, {key:"getParsedContent",value:function getParsedContent(report){var parsed=report===null||report===void 0?void 0:report.parsedContent;if(!parsed)return null;if(typeof parsed==="string")try{return JSON.parse(parsed)}catch(e){return null}return parsed}}, {key:"buildParsedHtml",value:function buildParsedHtml(parsedContent){var _this4=this;if(!parsedContent)return"";var html="";this.toArray(parsedContent.sections).forEach(function(section){if(section===null|| section===void 0?void 0:section.header)html+='\x3cstrong class\x3d"report_title"\x3e'.concat(_.escape(section.header),"\x3c/strong\x3e");html+=_this4.buildItemGroupsHtml(_this4.toArray(section===null|| section===void 0?void 0:section.items))}); var notes=this.toArray(parsedContent.notes);if(notes.length)html+='\x3cul class\x3d"report_notice"\x3e'.concat(notes.map(function(note){return"\x3cli\x3e\u203b ".concat(_.escape(note),"\x3c/li\x3e")}).join(""), "\x3c/ul\x3e"); return html}}, {key:"toArray",value:function toArray(value){return Array.isArray(value)?value:[]}}, {key:"buildItemGroupsHtml",value:function buildItemGroupsHtml(items){var _this5=this;var groups=items.filter(function(item){return item}).reduce(function(acc,item){var lastGroup=acc[acc.length-1]; if(item.label||!lastGroup||lastGroup.closed)acc.push({label:item.label,items:[],closed:false});var group=acc[acc.length-1];group.items.push(item);if(_this5.toArray(item.bullets).length)group.closed=true; return acc},[]); return groups.map(function(group){var labelHtml=group.label?'\x3cem class\x3d"label"\x3e'.concat(_.escape(group.label),"\x3c/em\x3e"):"";var bodyHtml=group.items.map(function(item){return'\x3cp class\x3d"text"\x3e'.concat(_.escape(item.text|| ""),"\x3c/p\x3e").concat(_this5.buildSubsHtml(item.subs))}).join(""); var bullets=_this5.toArray(group.items[group.items.length-1].bullets);var bulletsHtml=bullets.length?'\x3cdiv class\x3d"report_sub_info"\x3e\x3cem class\x3d"label"\x3e\ud589\ub3d9 \uc694\ub839\x3c/em\x3e\x3cul class\x3d"subs_list"\x3e'.concat(bullets.map(function(bullet){return"\x3cli\x3e".concat(_.escape(bullet), "\x3c/li\x3e")}).join(""),"\x3c/ul\x3e\x3c/div\x3e"):""; return'\x3cdiv class\x3d"report_info"\x3e'.concat(labelHtml).concat(bodyHtml,"\x3c/div\x3e").concat(bulletsHtml)}).join("")}}, {key:"buildSubsHtml",value:function buildSubsHtml(subs){var subList=this.toArray(subs);if(!subList.length)return"";return'\x3cul class\x3d"subs_list"\x3e'.concat(subList.map(function(sub){return"\x3cli\x3e".concat(_.escape(sub), "\x3c/li\x3e")}).join(""),"\x3c/ul\x3e")}}, {key:"buildFallbackHtml",value:function buildFallbackHtml(report){var originHtml=String(report.content||"").split("\n").map(function(line){return _.escape(line).replace(/^ +/,function(spaces){return"\x26nbsp;".repeat(spaces.length)})}).join("\x3cbr\x3e"); return'\x3cdiv class\x3d"report_origin"\x3e'.concat(originHtml,"\x3c/div\x3e")}}, {key:"updateExpandable",value:function updateExpandable(){var wrap=this.element.find("._cnReportWrap");wrap.removeClass("expandable expanded");if(wrap[0].scrollHeight>wrap[0].clientHeight)wrap.addClass("expandable"); this.syncFoldState(false)}}, {key:"syncFoldState",value:function syncFoldState(expanded){this.element.find("._cnReportFoldBtn").attr("aria-expanded",String(expanded))}}, {key:"attachEvent",value:function attachEvent(){var _this6=this;this.element.find("._cnReportTabList").on("click",".btn_tab",function(e){var index=Number($(e.currentTarget).data("index"));if(index===_this6.activeIndex)return; _this6.activeIndex=index;_this6.element.find("._cnReportTabList .btn_tab").removeClass("is_on").attr("aria-selected","false");$(e.currentTarget).addClass("is_on").attr("aria-selected","true");_this6.renderActiveReport()}); this.element.find("._cnReportFoldBtn").on("click",function(){var wrap=_this6.element.find("._cnReportWrap");var expanded=!wrap.hasClass("expanded");wrap.toggleClass("expanded",expanded);_this6.syncFoldState(expanded)})}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){if(this.isEnable){var wrap=this.element.find("._cnReportWrap");var expanded=wrap.hasClass("expanded");this.updateExpandable(); if(expanded&&wrap.hasClass("expandable")){wrap.addClass("expanded");this.syncFoldState(true)}}}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return this.getValidReportList().length>0}}]); return warnTextType}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object, sym).enumerable}); keys.push.apply(keys,symbols)}return keys} function _objectSpread(target){for(var i=1;i=localDate}); fieldMap=this.domesticFieldMap[cpName]}else{var _this$templateData4,_weeklyList$;weeklyList=((_this$templateData4=this.templateData)===null||_this$templateData4===void 0?void 0:_this$templateData4.overseasWeeklyFcastList)|| [];var tzMin=((_weeklyList$=weeklyList[0])===null||_weeklyList$===void 0?void 0:_weeklyList$.tzMin)||0;var _localDate=moment().utc().add(tzMin,"minutes").format("YYYYMMDD");weeklyList=weeklyList.filter(function(item){return item.aplYmd> _localDate}); fieldMap=this.overseasFieldMap[cpName]}var maxAplYmd=weeklyList.length>0?Math.max.apply(Math,_toConsumableArray(weeklyList.map(function(item){return Number(item.aplYmd)}))):0; var filteredOverseasMonthlyFcastList;if(!domestic&&!_.isEmpty(((_this$templateData5=this.templateData)===null||_this$templateData5===void 0?void 0:_this$templateData5.overseasMonthlyFcastList)||{}))filteredOverseasMonthlyFcastList= this.templateData.overseasMonthlyFcastList.filter(function(item){return item.aplYmd>maxAplYmd}); weeklyList.forEach(function(data){var _data$tzMin;var item={};item.aplYmd=data[fieldMap.aplYmd];item.dayString=data[fieldMap.dayString];item.amWetrCd=data[fieldMap.amWetrCd];item.amWetrTxt=data[fieldMap.amWetrTxt]; item.amRainProb=data[fieldMap.amRainProb];item.pmWetrCd=data[fieldMap.pmWetrCd];item.pmWetrTxt=data[fieldMap.pmWetrTxt];item.pmRainProb=data[fieldMap.pmRainProb];item.minTmpr=data[fieldMap.minTmpr];item.maxTmpr= data[fieldMap.maxTmpr];item.minStmpr=data[fieldMap.minStmpr];item.maxStmpr=data[fieldMap.maxStmpr];item.dayRainAmt=data[fieldMap.dayRainAmt];item.daySnowAmt=data[fieldMap.daySnowAmt];item.dayWindSpd=data[fieldMap.dayWindSpd]; item.dayWindDrctnName=data[fieldMap.dayWindDrctnName];item.nightRainAmt=data[fieldMap.nightRainAmt];item.nightSnowAmt=data[fieldMap.nightSnowAmt];item.nightWindSpd=data[fieldMap.nightWindSpd];item.nightWindDrctnName= data[fieldMap.nightWindDrctnName];item.uv=data[fieldMap.uv];item.fcastYmdt=data[fieldMap.fcastYmdt];item.tzMin=(_data$tzMin=data===null||data===void 0?void 0:data.tzMin)!==null&&_data$tzMin!==void 0?_data$tzMin: 540;weeklyData.push(item)}); this.weeklyData=weeklyData;var template="_idWeeklyFcastTemplate";var oTemplate=Handlebars.getTemplateSync(template);var elContent=oTemplate(_objectSpread({},this.templateData,{blockPageNameEn:blockPageNameEn, clickCode:this.clickCode,isPc:deviceType==="pc",weeklyData:weeklyData,overseasMonthlyFcastList:filteredOverseasMonthlyFcastList||((_this$templateData6=this.templateData)===null||_this$templateData6===void 0? void 0:_this$templateData6.overseasMonthlyFcastList)}));this.element.html(elContent);this.element.find(".week_list .week_item.on").trigger("click");if(domestic&&this.element.find("._cnWeeklyFcastList").children().length> 7)this.element.find("._cnWeeklyBtnMore").removeClass("hide")}}, {key:"attachEvent",value:function attachEvent(){this.element.on("click",".ico_help",$.proxy(this.clickWeeklyFcastHelp,this));this.element.on("click",".btn_close",$.proxy(this.closeAllLayer,this));this.element.on("click", ".week_list .btn_more",$.proxy(this.clickWeeklyFcastDetailBtn,this));this.element.on("click","._cnWeeklyBtnMore",$.proxy(this.clickWeeklyFcastMoreBtn,this))}}, {key:"clickWeeklyFcastHelp",value:function clickWeeklyFcastHelp(e){var isOpen=oCommon.fnGetOpenOrNot($(e.currentTarget));oCommon.fnCloseAllInfoLayer();if(isOpen===false){if(this.element.find(".ly_help li").length== 0){var iconMap=new Map;this.element.find(".weather_inner").each(function(){var key=$(this).data("wetrCd");var value=$(this).data("wetrTxt");if(key!==undefined&&value!==undefined)iconMap.set(key,value)}); var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=iconMap[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion= true){var item=_step.value;var html='\x3cli class\x3d"item"\x3e\x3ci class\x3d"ico ico_wt'.concat(item[0],'"\x3e\x3c/i\x3e').concat(item[1],"\x3c/li\x3e");this.element.find(".weather_list").append(html)}}catch(err){_didIteratorError= true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}}oCommon.fnOpenInfoLayer($(e.currentTarget))}}}, {key:"clickWeeklyFcastDetailBtn",value:function clickWeeklyFcastDetailBtn(e){var $target=$(e.currentTarget);$(".week_list .week_item").removeClass("on");$target.parents(".week_item").addClass("on");var data= {amWetrTxt:$target.data("amWetrTxt"),minStmpr:$target.data("minStmpr"),maxStmpr:$target.data("maxStmpr"),uv:$target.data("uv"),dayRainAmt:$target.data("dayRainAmt"),daySnowAmt:$target.data("daySnowAmt"), amRainProb:$target.data("amRainProb"),dayWindSpd:$target.data("dayWindSpd"),dayWindDrctnName:$target.data("dayWindDrctnName"),pmWetrTxt:$target.data("pmWetrTxt"),nightRainAmt:$target.data("nightRainAmt"), nightSnowAmt:$target.data("nightSnowAmt"),pmRainProb:$target.data("pmRainProb"),nightWindSpd:$target.data("nightWindSpd"),nightWindDrctnName:$target.data("nightWindDrctnName")};var template="_idWeeklyFcastDetailTemplate"; var oTemplate=Handlebars.getTemplateSync(template);var elContent=oTemplate(data);this.element.find(".day_info_dsc").html(elContent);oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode, "itemclk"))}}, {key:"clickWeeklyFcastMoreBtn",value:function clickWeeklyFcastMoreBtn(e){var $target=$(e.currentTarget);var $parent=$target.parents("._cnWeeklyFcastScrollControl");$parent.toggleClass("expand");if($parent.hasClass("expand"))$target.text("\uc811\uae30"); else $target.text("\ub354\ubcf4\uae30");oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"loadmore"))}}, {key:"closeAllLayer",value:function closeAllLayer(){oCommon.fnCloseAllInfoLayer()}}, {key:"getWeeklyFcastYmdt",value:function getWeeklyFcastYmdt(){var _this$weeklyData,_this$weeklyData2;return(_this$weeklyData=this.weeklyData)===null||_this$weeklyData===void 0?void 0:(_this$weeklyData2= _this$weeklyData[this.weeklyData.length-1])===null||_this$weeklyData2===void 0?void 0:_this$weeklyData2.fcastYmdt}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){var _this2=this;setTimeout(function(){_this2.initScroll();$(oCommon.oScroll["weekly"].wrapper).css("height",$(oCommon.oScroll["weekly"].scroller).outerHeight(true)+ "px");oCommon.refreshScroll("weekly")},100)}}, {key:"isEnableTemplate",value:function isEnableTemplate(){return true}}, {key:"getValidationConfig",value:function getValidationConfig(){var _this$templateData7;var domestic=(_this$templateData7=this.templateData)===null||_this$templateData7===void 0?void 0:_this$templateData7.domestic; if(domestic)return{weeklyCardData:{fields:["domesticWeeklyFcastList"],minLength:3}};else return{weeklyCardData:{fields:["overseasWeeklyFcastList"],minLength:3}}}}]); return weeklyFcast}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)oBlockScriptService.callTemplateFuncWithIndex(offTemplateId,offIndex,offHideMethod);$(".content_area_wrap[data-tab-name]").css("display","none");onElement.css("display", "block");if(onInitMethod&&onInitMethod.length>0)oBlockScriptService.callTemplateFuncWithIndex(onTemplateId,onIndex,onInitMethod,onLnbInitParam)}}, {key:"removeLnbIsOn",value:function removeLnbIsOn(){this.element.find(".tab_list .is_on").removeClass("is_on")}}, {key:"resizeTabList",value:function resizeTabList(){var element=$(".tab_list_wrap .scroll_area");var sumWidth=0;$(element).find("._cnScrollInner").children().each(function(){if($(this).is(":visible"))sumWidth+= $(this).outerWidth()}); var width=$(element).width();var plus=$(".tab_list_background").width()+$(".tab_list_gradient").width();if(Number(sumWidth)>width)$(element).children(".tab_list").width($(element).width()+(sumWidth-width)+ "px")}}, {key:"resizeTemplate",value:function resizeTemplate(lastResponsiveSizeType,isChanged){this.resizeTabList()}}, {key:"isEnableTalk",value:function isEnableTalk(){return oBlockScriptService.checkExistsTemplate("regionTalk")}}, {key:"addLast",value:function addLast(html){this.element.find(".tab_list").append(html)}}, {key:"clickActLink",value:function clickActLink(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"action"));var link="https://";if(deviceType==="pc")link+="terms.naver.com/entry.naver"; else link+="m.terms.naver.com/entry.naver";if($("#container").hasClass("_cnWetrMapCold"))link+="?docId\x3d2075863\x26cid\x3d42918\x26categoryId\x3d42918";else if($("#container").hasClass("is_hot"))link+= "?docId\x3d2075859\x26cid\x3d42918\x26categoryId\x3d42918";else if($("#container").hasClass("is_snow"))link+="?docId\x3d2075862\x26categoryId\x3d42918\x26cid\x3d42918";else if($("#container").hasClass("earthquake"))link+= "?docId\x3d5661682\x26categoryId\x3d42918\x26cid\x3d42918";else if($("#container").hasClass("is_typhoon"))link+="?docId\x3d2075860\x26categoryId\x3d42918\x26cid\x3d42918";else link+="?docId\x3d5830599\x26cid\x3d42918\x26categoryId\x3d42918"; window.open(link)}}, {key:"clickMore",value:function clickMore(e){e.preventDefault();window.location.href=isBlockPreview?"/preview/map":"/map"}}, {key:"addMoreLink",value:function addMoreLink(){if(this.element.find(".tab_list .tab_list_link.type_more").length===0)this.addLast('\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"tab_list_link type_more" data-nlog-area\x3d"weather_lnb.scroll.more_link"\x3e\n \x3cspan class\x3d"blind"\x3e\ub354 \ubcf4\uae30 - \uc9c0\ub3c4 \ud398\uc774\uc9c0 \uc774\ub3d9\x3c/span\x3e\n \x3c/a\x3e\n \x3c/li\x3e\n ')}}, {key:"enableAct",value:function enableAct(){if(this.element.find(".tab_list .tab_act").length===0){this.addLast('\n \x3cli\x3e\n \x3ca href\x3d"#" class\x3d"tab_link tab_act _cnActLink" data-lnb-click-code\x3d"action" data-nlog\x3d"safety_action" data-nlog-area\x3d"weather_lnb.scroll.safety_action_link"\x3e\ud589\ub3d9\uc694\ub839\x3c/a\x3e\n \x3c/li\x3e\n '); this.element.find(".btn_act").removeClass("hide")}}}, {key:"getLnbElement",value:function getLnbElement(){return this.element.find(".tab_list")}}, {key:"getInitTab",value:function getInitTab(){if(this.initTab)return this.initTab;var tabList=this.element.find(".tab_list");this.initTab=tabList.find("li:eq(".concat(this.initIndex,")")).find(".tab_link"); if(targetMenu.length>1){var tmp=tabList.find(".tab_link[data-name\x3d'".concat(targetMenu,"']"));if(tmp.length===1){this.isTargetMenu=true;this.initTab=tmp}}return this.initTab}}]); return wetrLnb}(BlockTemplate); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i=this.duration){this.elapsed=0;this.pause();return}var now=performance.now();var delta=Math.min(now-this.lastTickTime,1E3);this.elapsed=Number.isFinite(this.duration)&& this.duration>0?Math.min(this.elapsed+delta,this.duration):this.elapsed+delta;this.lastTickTime=now;this.trigger("tick",{elapsed:this.elapsed,ratio:this.elapsed/this.duration})}}]); return timer}(Component); function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0)this.activeTypnKey=this.typnList[0].typnKey;var typnPathList=((_this$typnTimelineLis= this.typnTimelineListMap)===null||_this$typnTimelineLis===void 0?void 0:_this$typnTimelineLis[this.activeTypnKey])||[];this.naverMap.setOptions({minZoom:this.nTypnMinZoom||2});var bounds=new naver.maps.LatLngBounds; typnPathList.forEach(function(point){bounds.extend(new naver.maps.LatLng(point.latude,point.lotude))}); var padding=this.CONFIG.BOUNDS_PADDING;this.naverMap.fitBounds(bounds,{top:padding,right:padding,bottom:padding,left:padding});this.drawTypnPath(typnPathList)}}, {key:"drawTypnPath",value:function drawTypnPath(pathList){pathList=pathList.filter(function(item){return item.latude&&item.lotude&&moment(item.locaYmdt,"YYYYMMDDHHmmss").isValid()}); if(_.isEmpty(pathList))return;this.setTypnTimeSeriesList(pathList);this.drawTypnCircle(pathList);this.drawTypnPathLine(pathList);this.drawTypnPathMarker(pathList);this.drawTypnMarker(pathList);this.animateTypn()}}, {key:"setTypnTimeSeriesList",value:function setTypnTimeSeriesList(activeTypnPathList){var _this$typnTimeSeriesL,_this3=this;var now=moment().utcOffset(9).format("YYYYMMDDHH");var originalTimeSeriesList= activeTypnPathList.map(function(item){return item.locaYmdt}); for(var i=0;inow){this.typnInitTime=moment(originalTimeSeriesList[i],"YYYYMMDDHHmmss").format("YYYYMMDDHHmm");break}if(originalTimeSeriesList.length> 0){var startTime=moment(originalTimeSeriesList[0],"YYYYMMDDHHmm");var endTime=moment(originalTimeSeriesList[originalTimeSeriesList.length-1],"YYYYMMDDHHmm");var newTimeSeriesList=[];var currentTime=startTime.clone(); while(currentTime.isSameOrBefore(endTime)){newTimeSeriesList.push(currentTime.format("YYYYMMDDHHmm"));currentTime.add(1,"hours")}this.typnTimeSeriesList=newTimeSeriesList}else return;this.typnInitIndex= (_this$typnTimeSeriesL=this.typnTimeSeriesList)===null||_this$typnTimeSeriesL===void 0?void 0:_this$typnTimeSeriesL.indexOf(this.typnInitTime);this.callbacks.renderSliderDate(this.typnTimeSeriesList);setTimeout(function(){return _this3.overlayTypnRainLayer()}, 200)}}, {key:"overlayTypnRainLayer",value:function overlayTypnRainLayer(){var _naver,_naver$maps,_naver$maps$WeatherTy,_this4=this,_this$typnRainTimeSer,_this$typnRainTimeSer2;var weatherType=(_naver=naver)=== null||_naver===void 0?void 0:(_naver$maps=_naver.maps)===null||_naver$maps===void 0?void 0:(_naver$maps$WeatherTy=_naver$maps.WeatherType)===null||_naver$maps$WeatherTy===void 0?void 0:_naver$maps$WeatherTy.Precipitation; var index=_.defaultTo(this.callbacks.getSliderPositionIndex(),0);var weatherTime,weatherOptions;weatherTime=this.getTypnTimeSeriesByIndex(index);if(!weatherType||!weatherTime)return;if(!this.typnRainLayer)naver.maps.WeatherHelper.loadTimeSeries(weatherType, {caller:this.caller}).then(function(timeSeries){_this4.typnRainTimeSeriesList=timeSeries.time_series;weatherOptions={type:weatherType,time:weatherTime};_this4.typnRainLayer=new naver.maps.WeatherLayer(weatherOptions)}); else this.typnRainLayer.setWeatherType(weatherType);if((_this$typnRainTimeSer=this.typnRainTimeSeriesList)===null||_this$typnRainTimeSer===void 0?void 0:(_this$typnRainTimeSer2=_this$typnRainTimeSer.includes)=== null||_this$typnRainTimeSer2===void 0?void 0:_this$typnRainTimeSer2.call(_this$typnRainTimeSer,weatherTime))this.typnRainLayer.setMap(this.naverMap)}}, {key:"getTypnTimeSeriesByIndex",value:function getTypnTimeSeriesByIndex(index){var _this$typnTimeSeriesL2;if(this.typnTimeSeriesList===null)return;return(_this$typnTimeSeriesL2=this.typnTimeSeriesList[index])=== null||_this$typnTimeSeriesL2===void 0?void 0:_this$typnTimeSeriesL2.slice(0,10)}}, {key:"animateTypn",value:function animateTypn(){var _this5=this;var index=0;var lastFrameTime=0;var frameDuration=this.typnAnimationSpeed;var maxLength=Math.max((this.typnPathSegments||[]).length,(this.typnPathMarkerList|| []).length);var animateTypn=function animateTypn(timestamp){if(!lastFrameTime||timestamp-lastFrameTime>=frameDuration){var _this5$typnPathOverla;if(index>=maxLength){var _this5$typnCircle,_this5$typnPredictCir; (_this5$typnCircle=_this5.typnCircle)===null||_this5$typnCircle===void 0?void 0:_this5$typnCircle.setVisible(true);(_this5$typnPredictCir=_this5.typnPredictCircle)===null||_this5$typnPredictCir===void 0? void 0:_this5$typnPredictCir.setVisible(true);_this5.typnPolygonTimer=_this5.polygonService.fadeInOverlay([{polygon:_this5.typnCircle,fillOpacity:_this5.CONFIG.TYPN_CIRCLE_FILL_OPACITY,strokeOpacity:_this5.CONFIG.TYPN_CIRCLE_STROKE_OPACITY}, {polygon:_this5.typnPredictCircle,fillOpacity:_this5.CONFIG.TYPN_PREDICT_FILL_OPACITY,strokeOpacity:_this5.CONFIG.TYPN_PREDICT_STROKE_OPACITY}],_this5.CONFIG.POLYGON_FADE_DURATION);_this5.typnMarkerTimer= setTimeout(function(){var _this5$typnMarker;(_this5$typnMarker=_this5.typnMarker)===null||_this5$typnMarker===void 0?void 0:_this5$typnMarker.setVisible(true);_this5.typnInfoWindowTimer=setTimeout(function(){_this5.typnInfoWindowList.forEach(function(infoWindow){return infoWindow.setVisible(true)})}, _this5.CONFIG.INFO_WINDOW_DELAY)},_this5.CONFIG.MARKER_DELAY); cancelAnimationFrame(_this5.typnAnimationRAF);_this5.typnAnimationRAF=null;return}var segments=_this5.typnPathSegments.slice(0,index);var colors=_this5.typnPathColors.slice(0,index);if((_this5$typnPathOverla= _this5.typnPathOverlay)===null||_this5$typnPathOverla===void 0?void 0:_this5$typnPathOverla.getMap()){_this5.typnPathOverlay.setPaths(segments);_this5.typnPathOverlay.setStyles({strokeColors:colors})}else _this5.typnPathOverlay= new naver.maps.PathOverlay({paths:segments,strokeColors:colors,strokeWeight:_this5.CONFIG.PATH_STROKE_WEIGHT,strokeOpacity:_this5.CONFIG.PATH_STROKE_OPACITY,strokeLineCap:"round",strokeLineJoin:"round", outlineWeight:0,zIndex:_this5.CONFIG.PATH_Z_INDEX,map:_this5.naverMap});var marker=_this5.typnPathMarkerList[index];if(marker){marker.setVisible(true);_this5.element.find("._cnTypnPathMarker").eq(index).removeClass("type_reset--scale")}index++; lastFrameTime=timestamp}_this5.typnAnimationRAF=requestAnimationFrame(animateTypn)}; this.typnAnimationRAF=requestAnimationFrame(animateTypn)}}, {key:"drawTypnPathLine",value:function drawTypnPathLine(pathList){var _this6=this;if(pathList.length<2)return;if(this.typnPathOverlay)this.typnPathOverlay.setMap(null);var pathCoordinates=pathList.map(function(item){return new naver.maps.LatLng(item.latude, item.lotude)}); var pathLineColors=pathList.map(function(item){return _this6.getColorByTypnMaxWindSpeed(item.maxWindSpd)}); this.typnPathSegments=[];this.typnPathColors=[];for(var i=0;i=0)newPosition=new naver.maps.LatLng(position.lat(), position.lng()-this.CONFIG.LONGITUDE_OFFSET);this.typnMarker.setPosition(newPosition);var targetMoment=moment(targetTime,"YYYYMMDDHHmm");var _this$findNearestTypn=this.findNearestTypnPathMarker(targetMoment), _this$findNearestTypn2=_slicedToArray(_this$findNearestTypn,2),pastMarker=_this$findNearestTypn2[0],nextMarker=_this$findNearestTypn2[1];var levelClass="empty";var tooltipClass="";if(pastMarker){var _pastMarker$getIcon, _$content$attr,_$content$attr$replac;var $content=$(((_pastMarker$getIcon=pastMarker.getIcon())===null||_pastMarker$getIcon===void 0?void 0:_pastMarker$getIcon.content)||"");levelClass=((_$content$attr= $content.attr("class"))===null||_$content$attr===void 0?void 0:(_$content$attr$replac=_$content$attr.replace("map_route",""))===null||_$content$attr$replac===void 0?void 0:_$content$attr$replac.trim())|| "empty";if(nextMarker){var isMovingBackward=this.lastRatio!=null&&ratiopastMarker.getPosition().lng();if(isMovingBackward&&isMovingTowardsRight|| !isMovingBackward&&!isMovingTowardsRight)tooltipClass="right"}}this.element.find(".map_typhoon_marker").attr("class","map_typhoon_marker ".concat(levelClass)).find(".typhoon_marker_tooltip").attr("class", "typhoon_marker_tooltip ".concat(tooltipClass))}this.lastRatio=ratio}}, {key:"findNearestTypnPathMarker",value:function findNearestTypnPathMarker(targetMoment){var _this0=this;if(_.isEmpty(this.typnCoordList))return[null,null];var nearestPastMarker=null;var nearestFutureMarker= null;var nearestTimeDiff=Infinity;this.typnCoordList.forEach(function(coord,index){var coordMoment=moment(coord.time,"YYYYMMDDHHmm");var timeDiff=targetMoment.diff(coordMoment,"minutes");if(timeDiff>=0&& timeDiff=0)newPosition=new naver.maps.LatLng(position.lat(),position.lng()-_this1.CONFIG.LONGITUDE_OFFSET);else if(!isNegativeCenter&& (position===null||position===void 0?void 0:position.lng())<0)newPosition=new naver.maps.LatLng(position.lat(),position.lng()+_this1.CONFIG.LONGITUDE_OFFSET);return newPosition}; this.typnPathMarkerList.forEach(function(marker){if(!marker)return;var position=marker.getPosition();var newPosition=adjustPosition(position);marker.setPosition(newPosition)}); this.typnInfoWindowList.forEach(function(infoWindow){if(!infoWindow)return;var position=infoWindow.getPosition();var newPosition=adjustPosition(position);infoWindow.setPosition(newPosition)}); if(this.typnMarker){var position=this.typnMarker.getPosition();var newPosition=adjustPosition(position);this.typnMarker.setPosition(newPosition)}}}, {key:"calculateCommonExternalTangents",value:function calculateCommonExternalTangents(circle1,circle2){var center1=turf.point(circle1.center);var center2=turf.point(circle2.center);var distanceKm=turf.distance(center1, center2);var r1=circle1.radius;var r2=circle2.radius;if(!r1&&!r2)return null;else if(!r1)r1=0;else if(!r2)r2=0;var cosAlpha=(r1-r2)/distanceKm;if(distanceKm===0||distanceKm<=Math.abs(r1-r2)||cosAlpha<-1|| cosAlpha>1)return null;var tangentAngle1,tangentAngle2;var bearing=turf.bearing(center1,center2);var alpha=Math.acos(cosAlpha);tangentAngle1=bearing+alpha*180/Math.PI;tangentAngle2=bearing-alpha*180/Math.PI; var tangentPoint1=turf.destination(center1,r1,tangentAngle1).geometry.coordinates;var tangentPoint2=turf.destination(center2,r2,tangentAngle1).geometry.coordinates;var tangentPoint3=turf.destination(center1, r1,tangentAngle2).geometry.coordinates;var tangentPoint4=turf.destination(center2,r2,tangentAngle2).geometry.coordinates;return turf.polygon([[tangentPoint1,tangentPoint2,tangentPoint4,tangentPoint3,tangentPoint1]])}}, {key:"toggleTypnColorGuide",value:function toggleTypnColorGuide(e){var $target=$(e.currentTarget);var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(!isOpen)oCommon.fnOpenInfoLayer($target); oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"tykey"))}}, {key:"clickTypnPathMarker",value:function clickTypnPathMarker(index){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var $target=this.element.find("._cnTypnPathTooltip").eq(index); var isHidden=$target.hasClass("hide");this.closeAllTypnPathInfoWindow();if(isHidden){var marker=this.typnPathMarkerList[index];var markerPosition=marker.getPosition();var $tooltip=$target.find(".route_tooltip"); var mapCenter=this.naverMap.getCenter();var isLeftSide=markerPosition.lng()2&&arguments[2]!==undefined?arguments[2]: false;var colorMap=this.warnTypeColorMap[warnType];if(!colorMap)return null;var fillColor=(_colorMap$warnLevel=colorMap[warnLevel])!==null&&_colorMap$warnLevel!==void 0?_colorMap$warnLevel:colorMap.watch; var fillOpacity=(_this$CONFIG$FILL_OPA=this.CONFIG.FILL_OPACITY[warnLevel])!==null&&_this$CONFIG$FILL_OPA!==void 0?_this$CONFIG$FILL_OPA:this.CONFIG.FILL_OPACITY.watch;var strokeColor=colorMap.border;var strokeWeight= selected?this.CONFIG.STROKE_WEIGHT_SELECTED:this.CONFIG.STROKE_WEIGHT_DEFAULT;return{fillColor:fillColor,fillOpacity:fillOpacity,strokeColor:strokeColor,strokeWeight:strokeWeight,strokeOpacity:1,strokeStyle:"solid", zIndex:selected?this.CONFIG.Z_INDEX_SELECTED:this.CONFIG.Z_INDEX_DEFAULT}}}, {key:"updatePolygonStyle",value:function updatePolygonStyle(regids,selected){var _this7=this;if(_.isEmpty(regids))return;regids.forEach(function(regid){if(!_this7.warnRegionDataCache[regid])return;_this7.polygonLayer.setRegionSelected(regid, selected)})}}, {key:"clearSelectedWarnRegion",value:function clearSelectedWarnRegion(){if(_.isEmpty(this.selectedWarnRegions))return;this.updatePolygonStyle(this.selectedWarnRegions,false);this.selectedWarnRegions=[]}}, {key:"renderPolygonByRegion",value:function renderPolygonByRegion(regions){if(_.isEmpty(regions))return;this.clearSelectedWarnRegion();this.selectedWarnRegions=_toConsumableArray(regions);this.updatePolygonStyle(regions, true)}}, {key:"buildRegionWarnMap",value:function buildRegionWarnMap(timeline){var _this8=this;var regionWarnMap={};var warnTypeMap=this.warnTimelineMap.warnTypeKrToEn||{};var summaryMap={};var detailCardsMap={}; Object.entries(timeline).forEach(function(_ref2){var _ref3=_slicedToArray(_ref2,2),warnTypeName=_ref3[0],gradeMap=_ref3[1];Object.entries(gradeMap).forEach(function(_ref4){var _ref5=_slicedToArray(_ref4, 2),gradeName=_ref5[0],reportList=_ref5[1];var warnLevel=_this8.WARN_LEVEL[gradeName]||"watch";var warnType=warnTypeMap[warnTypeName]||warnTypeName;if(_this8.shouldApplyWarnTypeFilter&&!_this8.showWarnTypeList.includes(warnType))return; if(!summaryMap[warnType])summaryMap[warnType]={warnType:warnType,warnTypeName:warnTypeName,severeCount:0,warningCount:0,watchCount:0};if(!detailCardsMap[warnType])detailCardsMap[warnType]=[];reportList.forEach(function(report){var _report$wetrWarnRgnLi, _report$wetrWarnRgnLi2;var regionCount=((_report$wetrWarnRgnLi=report.wetrWarnRgnList)===null||_report$wetrWarnRgnLi===void 0?void 0:_report$wetrWarnRgnLi.length)||0;if(warnLevel==="severe")summaryMap[warnType].severeCount+= regionCount;else if(warnLevel==="warning")summaryMap[warnType].warningCount+=regionCount;else summaryMap[warnType].watchCount+=regionCount;var regions=[];(_report$wetrWarnRgnLi2=report.wetrWarnRgnList)=== null||_report$wetrWarnRgnLi2===void 0?void 0:_report$wetrWarnRgnLi2.forEach(function(region){var regid=region.warnRgnCd;var regko=region.warnRgnNm;regions.push({regid:regid,regko:regko});if(!regionWarnMap[regid])regionWarnMap[regid]= [];regionWarnMap[regid].push({warnType:warnType,warnLevel:warnLevel,warnTypeName:warnTypeName,warnLevelName:gradeName,reportType:report.reportType,reportTime:report.reportTime,reportRTime:report.reportRTime, reportSType:report.reportSType,reportSGrade:report.reportSGrade,regko:regko,regid:regid})}); detailCardsMap[warnType].push({warnType:warnType,warnTypeName:warnTypeName,warnLevel:warnLevel,gradeName:gradeName,reportTime:report.reportTime,reportRTime:report.reportRTime,regions:regions,regionText:_this8.formatRegionText(regions)})})})}); var getTopLevel=function getTopLevel(item){if(item.severeCount>0)return"severe";if(item.warningCount>0)return"warning";return"watch"}; this.warnSummaryData=Object.values(summaryMap).filter(function(item){return item.severeCount>0||item.warningCount>0||item.watchCount>0}).sort(function(a,b){var aTopLevel=getTopLevel(a); var bTopLevel=getTopLevel(b);if(aTopLevel!==bTopLevel)return _this8.compareWarnLevel(aTopLevel,bTopLevel);return _this8.compareWarnType(a.warnType,b.warnType)}); Object.keys(detailCardsMap).forEach(function(warnType){detailCardsMap[warnType].sort(function(a,b){return _this8.compareByReportTime(a,b)})}); this.warnDetailCardsMap=detailCardsMap;return regionWarnMap}}, {key:"parseWarnType",value:function parseWarnType(){var visualMapType=this.getVisualMapType();if(visualMapType==="warn")return null;return visualMapType.replace("warn_","")}}, {key:"getDisplayWarn",value:function getDisplayWarn(warns){var selectedType=this.parseWarnType();if(!selectedType)return this.getHighestPriorityWarn(warns);else return warns.find(function(warn){return warn.warnType=== selectedType})}}, {key:"compareWarnLevel",value:function compareWarnLevel(a,b){var _order$a,_order$b;var order={severe:0,warning:1,watch:2};return((_order$a=order[a])!==null&&_order$a!==void 0?_order$a:Infinity)-((_order$b= order[b])!==null&&_order$b!==void 0?_order$b:Infinity)}}, {key:"compareWarnType",value:function compareWarnType(a,b){var _this$warnTypePriorit,_this$warnTypePriorit2;var priorityA=(_this$warnTypePriorit=this.warnTypePriority[a])!==null&&_this$warnTypePriorit!== void 0?_this$warnTypePriorit:-Infinity;var priorityB=(_this$warnTypePriorit2=this.warnTypePriority[b])!==null&&_this$warnTypePriorit2!==void 0?_this$warnTypePriorit2:-Infinity;return priorityB-priorityA}}, {key:"getHighestPriorityWarn",value:function getHighestPriorityWarn(warns){var _this9=this;if(_.isEmpty(warns))return null;var sortedWarns=warns.slice().sort(function(a,b){if(a.warnLevel!==b.warnLevel)return _this9.compareWarnLevel(a.warnLevel, b.warnLevel);var typeCompare=_this9.compareWarnType(a.warnType,b.warnType);if(typeCompare!==0)return typeCompare;if(a.reportRTime!==b.reportRTime)return a.reportRTime>b.reportRTime?-1:1;return a.reportTime> b.reportTime?-1:1}); return sortedWarns[0]}}, {key:"renderWarnCard",value:function renderWarnCard(){this.updateWarnLegend();if(_.isEmpty(this.warnSummaryData)){this.hideWarnCard();return}var $mapWarning=this.element.find(".map_bottom_area .map_warning._cnWarnCard"); var isFirstRender=$mapWarning.length===0;if(isFirstRender)this.initWarnCard();this.updateActiveCard()}}, {key:"updateOfferArea",value:function updateOfferArea(){var _this$warnTimelineMap3,_this$warnTimelineMap4;var lastUpdYmdt=(_this$warnTimelineMap3=this.warnTimelineMap)===null||_this$warnTimelineMap3=== void 0?void 0:(_this$warnTimelineMap4=_this$warnTimelineMap3.warnTimeline)===null||_this$warnTimelineMap4===void 0?void 0:_this$warnTimelineMap4.lastUpdYmdt;if(!lastUpdYmdt)return;var updateTimeText="\ucd5c\uc885 \uc5c5\ub370\uc774\ud2b8 "+ moment(lastUpdYmdt,"YYYYMMDDHHmmss").format("YYYY.MM.DD. HH:mm");this.element.find("._cnWarnUpdateTime").text(updateTimeText)}}, {key:"initWarnCard",value:function initWarnCard(){var _this$warnSummaryData,_this0=this;var firstWarnType=(_this$warnSummaryData=this.warnSummaryData[0])===null||_this$warnSummaryData===void 0?void 0:_this$warnSummaryData.warnType; var summaryCardsHtml=this.warnSummaryData.map(function(item){var regionCount=item.severeCount+item.warningCount+item.watchCount;var grades=[{count:item.severeCount,label:"\uc911\ub300\uacbd\ubcf4"},{count:item.warningCount, label:"\uacbd\ubcf4"},{count:item.watchCount,label:"\uc8fc\uc758\ubcf4"}].filter(function(grade){return grade.count>0}).map(function(grade){return'\n \x3cdl class\x3d"map_detail_description"\x3e\n \x3cdt class\x3d"map_description_title"\x3e'.concat(item.warnTypeName).concat(grade.label, ' \uc804\uad6d\x3c/dt\x3e\n \x3cdd class\x3d"map_description_data"\x3e').concat(grade.count,"\uac1c \uc9c0\uc5ed\x3c/dd\x3e\n \x3c/dl\x3e\n ")}); return'\n \x3cdiv class\x3d"map_slide_item _cnWarnSummaryCard type_main--'.concat(item.warnType,'" data-warn-type\x3d"').concat(item.warnType,'"\x3e\n \x3cdiv class\x3d"map_item_inner"\x3e\n \x3cdiv class\x3d"map_item_head"\x3e\n \x3cstrong class\x3d"map_head_title"\x3e').concat(item.warnTypeName, '\ud2b9\ubcf4\x3c/strong\x3e\n \x3cem class\x3d"map_head_place"\x3e').concat(regionCount,' \uc9c0\uc5ed\x3c/em\x3e\n \x3cbutton type\x3d"button" class\x3d"map_head_button type_more _cnWarnSummaryMoreBtn"\x3e\n \x3cspan class\x3d"blind"\x3e\uc0c1\uc138 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cspan class\x3d"map_item_detail"\x3e\n ').concat(grades.join(""), "\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ")}).join(""); var allDetailCardsHtml=Object.values(this.warnDetailCardsMap||{}).map(function(items){return items.map(function(item,index){var regionIds=item.regions.map(function(r){return r.regid}).join(","); return'\n \x3cdiv class\x3d"map_slide_item _cnWarnDetailCard type_detail--'.concat(item.warnType,'" data-index\x3d"').concat(index,'" data-warn-type\x3d"').concat(item.warnType,'" data-warning-regions\x3d"').concat(regionIds, '"\x3e\n \x3cstrong class\x3d"map_list_title"\x3e').concat(item.warnTypeName).concat(item.gradeName,' \ubc1c\ud6a8\uc911\x3c/strong\x3e\n \x3cdiv class\x3d"map_list_date"\x3e\n \x3cdl class\x3d"map_date_description"\x3e\n \x3cdt class\x3d"map_description_title"\x3e\ubc1c\ud45c\x3c/dt\x3e\n \x3cdd class\x3d"map_description_data"\x3e').concat(_this0.formatDateTime(item.reportRTime), '\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"map_date_description"\x3e\n \x3cdt class\x3d"map_description_title"\x3e\ubc1c\ud6a8\x3c/dt\x3e\n \x3cdd class\x3d"map_description_data"\x3e').concat(_this0.formatDateTime(item.reportTime), ' \uc774\ud6c4\x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3cp class\x3d"map_list_text"\x3e').concat(item.regionText,'\x3c/p\x3e\n \x3cbutton type\x3d"button" class\x3d"map_list_more _cnWarnDetailMoreBtn" aria-controls\x3d"warningDetail" data-index\x3d"').concat(index, '"\x3e\uc790\uc138\ud788\ubcf4\uae30\x3c/button\x3e\n \x3c/div\x3e\n ')}).join("")}).join(""); var html='\n \x3cdiv class\x3d"map_warning _cnWarnCard type_'.concat(firstWarnType,'"\x3e\n \x3cdiv class\x3d"map_warning_list scroll_control"\x3e\n \x3cbutton type\x3d"button" class\x3d"map_list_button type_all _cnWarnAllBtn hide"\x3e\ud2b9\ubcf4 \uc804\uccb4\x3c/button\x3e\n \x3cdiv class\x3d"map_list_slide scroll_area" data-name\x3d"warnCard" data-gesture-scroll\x3d"true" data-snap-selector\x3d".map_slide_item"\x3e\n \x3cdiv class\x3d"map_slide_inner"\x3e\n ').concat(summaryCardsHtml, "\n ").concat(allDetailCardsHtml,'\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"card_slide_button btn_prev"\x3e\n \x3cspan class\x3d"blind"\x3e\uc774\uc804 \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" class\x3d"card_slide_button btn_next"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2e4\uc74c \ubcf4\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n ').concat(this.renderWarnDetailBottomSheet(), "\n \x3c/div\x3e\n ");this.element.find(".map_bottom_area").prepend(html);this.initBottomSheet()}}, {key:"updateActiveCard",value:function updateActiveCard(){var _this$warnSummaryData2;var selectedType=this.parseWarnType();var isMainView=!selectedType;var $mapWarning=this.element.find(".map_bottom_area .map_warning._cnWarnCard"); var activeWarnType=selectedType||((_this$warnSummaryData2=this.warnSummaryData[0])===null||_this$warnSummaryData2===void 0?void 0:_this$warnSummaryData2.warnType);$mapWarning.attr("class","map_warning _cnWarnCard type_".concat(activeWarnType)); $mapWarning.find(".map_warning_list").toggleClass("type_detail",!isMainView);$mapWarning.find(".map_slide_inner").toggleClass("is-main",isMainView);$mapWarning.find("._cnWarnAllBtn").toggleClass("hide", isMainView||this.shouldApplyWarnTypeFilter);$mapWarning.find(".map_slide_item").removeClass("is-active");if(isMainView){var $firstCard=$mapWarning.find("._cnWarnSummaryCard").first();if($firstCard.length> 0){$firstCard.addClass("is-active");var warnType=$firstCard.data("warn-type");var regions=this.getRegionsByWarnType(warnType);this.renderPolygonByRegion(regions)}}else{$mapWarning.find('._cnWarnSummaryCard[data-warn-type\x3d"'.concat(selectedType, '"]')).addClass("is-active");var $firstDetailCard=$mapWarning.find(".type_detail--".concat(selectedType)).first();if($firstDetailCard.length>0){$firstDetailCard.addClass("is-active");var _regions=this.getRegionsFromDetailCard($firstDetailCard); this.renderPolygonByRegion(_regions)}}$mapWarning.removeClass("hide");this.initWarnCardScroll()}}, {key:"initWarnCardScroll",value:function initWarnCardScroll(){var $scrollArea=this.element.find(".map_warning._cnWarnCard .scroll_area");if($scrollArea.length===0)return;var scrollName=$scrollArea.data("name"); if(oCommon.oScroll[scrollName])oCommon.refreshScroll(scrollName);else oCommon.initScroll($scrollArea)}}, {key:"hideWarnCard",value:function hideWarnCard(){this.element.find(".map_warning._cnWarnCard").addClass("hide")}}, {key:"updateWarnLegend",value:function updateWarnLegend(){var $legend=this.element.find(".color_info_guide.type_warning .color_info_list");if($legend.length===0)return;var allowedTypes=new Set;(this.warnSummaryData|| []).forEach(function(item){if(item.severeCount>0)allowedTypes.add("major_".concat(item.warnType));if(item.warningCount>0)allowedTypes.add(item.warnType);if(item.watchCount>0)allowedTypes.add("warn_".concat(item.warnType))}); $legend.find(".color_info_item").each(function(_,el){var $item=$(el);$item.toggleClass("hide",!allowedTypes.has($item.attr("data-type")))})}}, {key:"selectCard",value:function selectCard($card,selector){this.element.find(selector).removeClass("is-active");$card.addClass("is-active");this.scrollToCard($card)}}, {key:"selectSummaryCard",value:function selectSummaryCard($card){this.selectCard($card,"._cnWarnCard ._cnWarnSummaryCard")}}, {key:"selectDetailCard",value:function selectDetailCard($card){this.selectCard($card,"._cnWarnCard ._cnWarnDetailCard")}}, {key:"scrollToCard",value:function scrollToCard($card){if(!$card.length)return;var scrollName="warnCard";var scroll=oCommon.oScroll[scrollName];if(scroll){oCommon.isProgrammaticScroll=true;oCommon.scrollToCell(scrollName, $card.get(0),300,true)}}}, {key:"findDetailCardByRegion",value:function findDetailCardByRegion(warnType,regid){var _this1=this;return this.element.find('._cnWarnCard ._cnWarnDetailCard[data-warn-type\x3d"'.concat(warnType,'"]')).filter(function(i, el){var regions=_this1.getRegionsFromDetailCard($(el));return regions.includes(regid)}).eq(0)}}, {key:"getRegionsFromDetailCard",value:function getRegionsFromDetailCard($card){var regionsStr=$card.data("warning-regions")||"";return regionsStr?String(regionsStr).split(","):[]}}, {key:"getRegionsByWarnType",value:function getRegionsByWarnType(warnType){return this.warnTypeRegionsMap[warnType]||[]}}, {key:"initRegionCenter",value:function initRegionCenter(polygonData){var _this10=this;polygonData.forEach(function(item){var regid=item.warnRgnCd;if(_this10.warnRegionCenterMap[regid])return;if(item.centerLatitude> 0&&item.centerLongitude>0)_this10.warnRegionCenterMap[regid]=[item.centerLongitude,item.centerLatitude];else _this10.warnRegionCenterMap[regid]=turf.pointOnFeature(item.polygon).geometry.coordinates})}}, {key:"setCenterByRegion",value:function setCenterByRegion(regId){var _this11=this;var coord=this.warnRegionCenterMap[regId];if(!coord||!this.naverMap)return;if(coord[0]===undefined||coord[1]===undefined)return; setTimeout(function(){return _this11.naverMap.panTo(new naver.maps.LatLng(coord[1],coord[0]))},this.CONFIG.PAN_DELAY_MS)}}, {key:"handleCardClick",value:function handleCardClick(e){var $card=$(e.currentTarget);if($card.hasClass("_cnWarnDetailCard"))this.handleDetailCardClick(e);else if($card.hasClass("_cnWarnSummaryCard"))this.handleSummaryCardClick(e)}}, {key:"handleDetailCardClick",value:function handleDetailCardClick(e){var $card=$(e.currentTarget);var regions=this.getRegionsFromDetailCard($card);if(!$card.hasClass("is-active"))this.closeBottomSheet(); this.selectDetailCard($card);this.renderPolygonByRegion(regions);this.setCenterByRegion(regions[0])}}, {key:"handleSummaryCardClick",value:function handleSummaryCardClick(e){var $card=$(e.currentTarget);var warnType=$card.data("warn-type");var regions=this.getRegionsByWarnType(warnType);this.selectSummaryCard($card); this.renderPolygonByRegion(regions);this.setCenterByRegion(regions[0])}}, {key:"handleDetailCardMoreClick",value:function handleDetailCardMoreClick(e){var _this$warnDetailBotto3;e.stopPropagation();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"cardmore")); var $card=$(e.currentTarget).closest(".map_slide_item");var index=$(e.currentTarget).data("index");if($card.hasClass("is-active")&&((_this$warnDetailBotto3=this.warnDetailBottomSheet)===null||_this$warnDetailBotto3=== void 0?void 0:_this$warnDetailBotto3.isOpen))this.closeBottomSheet();else this.openBottomSheet(index);var regions=this.getRegionsFromDetailCard($card);this.selectDetailCard($card);this.renderPolygonByRegion(regions); this.setCenterByRegion(regions[0])}}, {key:"handleSummaryCardMoreClick",value:function handleSummaryCardMoreClick(e){e.stopPropagation();oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"card"));var $card=$(e.currentTarget).closest(".map_slide_item"); var warnType=$card.data("warn-type");this.switchToWarnTypeTab(warnType)}}, {key:"switchToWarnTypeTab",value:function switchToWarnTypeTab(warnType){var tabType=warnType?"warn_".concat(warnType):"warn";var $targetBtn=this.element.find('.map_tools_depth button[data-type\x3d"'.concat(tabType, '"]'));if($targetBtn.length>0)$targetBtn.trigger("click")}}, {key:"handlePolygonClick",value:function handlePolygonClick(regid,warns,e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"poly"));if(_.isEmpty(warns))return;var $activeCard= this.element.find("._cnWarnCard ._cnWarnDetailCard.is-active");if(!this.getRegionsFromDetailCard($activeCard).includes(regid))this.closeBottomSheet();this.renderPolygonByRegion([regid]);this.setCenterByRegion(regid); var displayWarn=this.getDisplayWarn(warns);if(!displayWarn)return;var selectedType=this.parseWarnType();if(selectedType){var $card=this.findDetailCardByRegion(displayWarn.warnType,regid);this.selectDetailCard($card)}else{var $summaryCard= this.element.find('._cnWarnCard ._cnWarnSummaryCard[data-warn-type\x3d"'.concat(displayWarn.warnType,'"]'));this.selectSummaryCard($summaryCard)}this.showDetailMarker(regid)}}, {key:"handleMarkerClick",value:function handleMarkerClick(warnRgnCd){var cachedData=this.warnRegionDataCache[warnRgnCd];if(!cachedData)return;this.renderPolygonByRegion([warnRgnCd]);this.setCenterByRegion(warnRgnCd); var displayWarn=cachedData.displayWarn;var selectedType=this.parseWarnType();if(selectedType){var $card=this.findDetailCardByRegion(displayWarn.warnType,warnRgnCd);this.selectDetailCard($card)}else{var $summaryCard= this.element.find('._cnWarnCard ._cnWarnSummaryCard[data-warn-type\x3d"'.concat(displayWarn.warnType,'"]'));this.selectSummaryCard($summaryCard)}this.showDetailMarker(warnRgnCd)}}, {key:"toggleWarnColorGuide",value:function toggleWarnColorGuide(e){var $target=this.element.find("._cnWarnColorGuide");var isOpen=oCommon.fnGetOpenOrNot($target);oCommon.fnCloseAllInfoLayer();if(!isOpen)oCommon.fnOpenInfoLayer($target); oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"warninfo"))}}, {key:"handleDetailMarkerClose",value:function handleDetailMarkerClose(e){oCommon.fnSendClick(e,"".concat(blockPageNameEn,".").concat(this.clickCode,"poly"));this.removeDetailMarker()}}, {key:"renderWarnDetailBottomSheet",value:function renderWarnDetailBottomSheet(){return'\n \x3cdiv class\x3d"bottom_sheet _cnWarnBottomSheet type_warning--detail" id\x3d"warningDetail" role\x3d"dialog" aria-modal\x3d"true"\x3e\n \x3cdiv class\x3d"bottom_sheet_dimmed"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"bottom_sheet_inner"\x3e\n \x3cbutton type\x3d"button" class\x3d"handle_btn"\x3e\x3cspan class\x3d"blind"\x3e\ub808\uc774\uc5b4 \ub3d9\uc791\x3c/span\x3e\x3c/button\x3e\n \x3cdiv class\x3d"bottom_sheet_content"\x3e\n \x3cdiv class\x3d"warning_detail"\x3e\n \x3cdiv class\x3d"warning_detail_head"\x3e\n \x3cstrong class\x3d"warning_head_title"\x3e\x3c/strong\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"warning_detail_inner"\x3e\n \x3cdiv class\x3d"warning_detail_date"\x3e\x3c/div\x3e\n \x3cdiv class\x3d"warning_detail_location"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"warning_detail_button type_close btn_close"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n '}}, {key:"initBottomSheet",value:function initBottomSheet(){var _this$templateIndex;var $bottomSheet=this.element.find("._cnWarnBottomSheet");if($bottomSheet.length===0)return;this.warnDetailBottomSheet=oBottomSheet.create($bottomSheet, {enableSnap:true,closeButtonSelector:".btn_close",dimmedClose:true,fullViewHeight:85,maxHeight:85});oBottomSheet.register("warnDetailBottomSheet_".concat((_this$templateIndex=this.templateIndex)!==null&& _this$templateIndex!==void 0?_this$templateIndex:""),this.warnDetailBottomSheet)}}, {key:"openBottomSheet",value:function openBottomSheet(cardIndex){var _this$warnDetailCards;var selectedType=this.parseWarnType();var cards=((_this$warnDetailCards=this.warnDetailCardsMap)===null||_this$warnDetailCards=== void 0?void 0:_this$warnDetailCards[selectedType])||[];var card=cards[cardIndex];if(!card)return;var $bottomSheet=this.element.find("._cnWarnBottomSheet");$bottomSheet.find(".warning_head_title").text("".concat(card.warnTypeName).concat(card.gradeName, " \ubc1c\ud6a8\uc911"));var dateHtml='\n \x3cdl class\x3d"warning_date_description"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e\ubc1c\ud45c\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e'.concat(this.formatDateTime(card.reportRTime), '\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"warning_date_description"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e\ubc1c\ud6a8\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(this.formatDateTime(card.reportTime), " \uc774\ud6c4\x3c/dd\x3e\n \x3c/dl\x3e\n ");$bottomSheet.find(".warning_detail_date").html(dateHtml);var locationHtml=this.buildDetailLocationHtml(card);$bottomSheet.find(".warning_detail_location").html(locationHtml); if(this.warnDetailBottomSheet)this.warnDetailBottomSheet.open()}}, {key:"closeBottomSheet",value:function closeBottomSheet(){if(this.warnDetailBottomSheet)this.warnDetailBottomSheet.close()}}, {key:"buildDetailLocationHtml",value:function buildDetailLocationHtml(card){var groupedRegions=this.groupRegionsByLarea(card.regions);var locationParts=[];Object.entries(groupedRegions).forEach(function(_ref6){var _ref7= _slicedToArray(_ref6,2),larea=_ref7[0],regions=_ref7[1];var regionNames=regions.map(function(r){return r.regko}).join(", "); locationParts.push("".concat(larea,"(").concat(regionNames,")"))}); return'\n \x3cdl class\x3d"warning_location_description"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e'.concat(card.warnTypeName).concat(card.gradeName,'\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(locationParts.join(", "), "\x3c/dd\x3e\n \x3c/dl\x3e\n ")}}, {key:"drawMarkerForWarn",value:function drawMarkerForWarn(warnRgnCd,warnData){var _this12=this;if(this.element.find("#_IdWarnMapMarker-".concat(warnRgnCd)).length>0)return;var cachedData=this.warnRegionDataCache[warnRgnCd]; if(!cachedData)return;var centerCoord=this.warnRegionCenterMap[warnRgnCd];var option={regionName:warnData.warnRgnNm,regionCode:warnRgnCd,latitude:centerCoord[1],longitude:centerCoord[0]};var displayWarn= cachedData.displayWarn;var selectedType=this.parseWarnType();var markerTypeClass=selectedType?"type_main--".concat(selectedType):"type_main";var markerHtml='\n \x3cdiv id\x3d"_IdWarnMapMarker-'.concat(option.regionCode, '" class\x3d"warning_marker _cnWarnMapMaker ').concat(markerTypeClass,'"\x3e\n \x3cdiv class\x3d"warning_marker_inner"\x3e\n \x3cem class\x3d"warning_marker_location"\x3e').concat(option.regionName, '\x3c/em\x3e\n \x3cstrong class\x3d"warning_marker_data"\x3e').concat(displayWarn.warnTypeName,"\x3c/strong\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n ");var $marker= $(markerHtml).css("visibility","hidden");this.element.append($marker);var sizeWidth=$marker.outerWidth();var sizeHeight=$marker.outerHeight();$marker.remove();if(!sizeWidth||!sizeHeight)return;var marker= new naver.maps.Marker({position:new naver.maps.LatLng(parseFloat(option.latitude),parseFloat(option.longitude)),map:this.naverMap,icon:{content:markerHtml,size:new naver.maps.Size(sizeWidth,sizeHeight)}, visible:true,zIndex:0});this.callbacks.addMarker(marker);naver.maps.Event.addListener(marker,"click",function(){_this12.handleMarkerClick(warnRgnCd)})}}, {key:"drawDetailMarkerForWarn",value:function drawDetailMarkerForWarn(warnRgnCd,warnData,displayWarn,warns){var option={regionName:warnData.warnRgnNm,regionCode:warnRgnCd,latitude:warnData.latitude,longitude:warnData.longitude}; var selectedType=this.parseWarnType();var isMainView=!selectedType;var markerHtml;if(isMainView){var summaryItems=warns.slice(0,this.CONFIG.MAX_DISPLAY_SUMMARY_REGIONS).map(function(warn){return'\x3cspan class\x3d"warning_summary_item type_'.concat(warn.warnType, '"\x3e').concat(warn.warnTypeName).concat(warn.warnLevelName," \ubc1c\ud6a8\uc911\x3c/span\x3e")}).join(""); markerHtml='\n \x3cdiv id\x3d"_IdWarnDetailMarker-'.concat(option.regionCode,'" class\x3d"warning_marker _cnWarnDetailMarker type_detail"\x3e\n \x3cstrong class\x3d"warning_marker_title"\x3e').concat(option.regionName, '\x3c/strong\x3e\n \x3cdiv class\x3d"warning_marker_inner"\x3e\n \x3cdiv class\x3d"warning_marker_summary"\x3e\n ').concat(summaryItems, '\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"warning_marker_button type_close _cnWarnDetailMarkerClose"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n ')}else markerHtml= '\n \x3cdiv id\x3d"_IdWarnDetailMarker-'.concat(option.regionCode,'" class\x3d"warning_marker _cnWarnDetailMarker type_detail--').concat(displayWarn.warnType,'"\x3e\n \x3cstrong class\x3d"warning_marker_title"\x3e').concat(option.regionName, '\x3c/strong\x3e\n \x3cdiv class\x3d"warning_marker_inner"\x3e\n \x3cem class\x3d"warning_marker_status"\x3e').concat(displayWarn.warnTypeName).concat(displayWarn.warnLevelName, ' \ubc1c\ud6a8\uc911\x3c/em\x3e\n \x3cdiv class\x3d"warning_marker_date"\x3e\n \x3cdl class\x3d"warning_date_description"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e\ubc1c\ud45c\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(this.formatDateTime(displayWarn.reportRTime), '\x3c/dd\x3e\n \x3c/dl\x3e\n \x3cdl class\x3d"warning_date_description"\x3e\n \x3cdt class\x3d"warning_description_title"\x3e\ubc1c\ud6a8\x3c/dt\x3e\n \x3cdd class\x3d"warning_description_data"\x3e').concat(this.formatDateTime(displayWarn.reportTime), ' \uc774\ud6c4\x3c/dd\x3e\n \x3c/dl\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cbutton type\x3d"button" class\x3d"warning_marker_button type_close _cnWarnDetailMarkerClose"\x3e\n \x3cspan class\x3d"blind"\x3e\ub2eb\uae30\x3c/span\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n '); var $marker=$(markerHtml).css("visibility","hidden");this.element.append($marker);var sizeWidth=$marker.outerWidth();var sizeHeight=$marker.outerHeight();$marker.remove();if(!sizeWidth||!sizeHeight)return; var marker=new naver.maps.Marker({position:new naver.maps.LatLng(parseFloat(option.latitude),parseFloat(option.longitude)),map:this.naverMap,icon:{content:markerHtml,size:new naver.maps.Size(sizeWidth, sizeHeight)},visible:true,zIndex:100});this.activeDetailMarker={marker:marker,regionCode:warnRgnCd}}}, {key:"showDetailMarker",value:function showDetailMarker(warnRgnCd){var _this$activeDetailMar,_this$warnRegionCente,_this$warnRegionCente2;if(((_this$activeDetailMar=this.activeDetailMarker)===null||_this$activeDetailMar=== void 0?void 0:_this$activeDetailMar.regionCode)===warnRgnCd)return;this.removeDetailMarker();var cachedData=this.warnRegionDataCache[warnRgnCd];if(!cachedData)return;var warnData={warnRgnNm:cachedData.regko, latitude:(_this$warnRegionCente=this.warnRegionCenterMap[warnRgnCd])===null||_this$warnRegionCente===void 0?void 0:_this$warnRegionCente[1],longitude:(_this$warnRegionCente2=this.warnRegionCenterMap[warnRgnCd])=== null||_this$warnRegionCente2===void 0?void 0:_this$warnRegionCente2[0]};var warns=cachedData.warns||[];this.drawDetailMarkerForWarn(warnRgnCd,warnData,cachedData.displayWarn,warns)}}, {key:"removeDetailMarker",value:function removeDetailMarker(){if(this.activeDetailMarker){this.activeDetailMarker.marker.setMap(null);this.element.find("#_IdWarnDetailMarker-".concat(this.activeDetailMarker.regionCode)).remove(); this.activeDetailMarker=null}}}, {key:"showLoading",value:function showLoading(){this.$loadingContainer.removeClass("hide");this.$errorBox.addClass("hide");this.$loadingBox.removeClass("hide");this.callbacks.hideExistingMapUI()}}, {key:"hideLoading",value:function hideLoading(){this.$loadingContainer.addClass("hide");this.$loadingBox.addClass("hide");this.callbacks.showMapUI()}}, {key:"showError",value:function showError(){this.$loadingBox.addClass("hide");this.$errorBox.removeClass("hide")}}, {key:"retryLoadPolygonData",value:function retryLoadPolygonData(){var _this13=this;this.warnDataLoaded=false;this.loadPolygonDataOnce().then(function(){_this13.callbacks.changeMapTab()})["catch"](function(){_this13.showError()})}}, {key:"hideWarnUI",value:function hideWarnUI(){this.closeBottomSheet();this.hideWarnCard();this.removeDetailMarker()}}, {key:"compareByReportTime",value:function compareByReportTime(a,b){var _a$reportRTime,_b$reportRTime,_a$reportTime,_b$reportTime;var reportRTimeA=(_a$reportRTime=a===null||a===void 0?void 0:a.reportRTime)!== null&&_a$reportRTime!==void 0?_a$reportRTime:"";var reportRTimeB=(_b$reportRTime=b===null||b===void 0?void 0:b.reportRTime)!==null&&_b$reportRTime!==void 0?_b$reportRTime:"";if(reportRTimeA!==reportRTimeB)return reportRTimeA> reportRTimeB?-1:1;var reportTimeA=(_a$reportTime=a===null||a===void 0?void 0:a.reportTime)!==null&&_a$reportTime!==void 0?_a$reportTime:"";var reportTimeB=(_b$reportTime=b===null||b===void 0?void 0:b.reportTime)!== null&&_b$reportTime!==void 0?_b$reportTime:"";if(reportTimeA!==reportTimeB)return reportTimeA>reportTimeB?-1:1;return 0}}, {key:"formatDateTime",value:function formatDateTime(dateStr){if(!dateStr)return"";return moment(dateStr,"YYYYMMDDHHmm").format("YYYY.MM.DD HH:mm")}}, {key:"getLareaByWarnRegionCode",value:function getLareaByWarnRegionCode(warnRgnCd){var _ref8,_this$warnRegionLarea;if(warnRgnCd===null||warnRgnCd===void 0?void 0:warnRgnCd.startsWith("S"))return"\ubc14\ub2e4"; return(_ref8=(_this$warnRegionLarea=this.warnRegionLareaMap[warnRgnCd])!==null&&_this$warnRegionLarea!==void 0?_this$warnRegionLarea:this.warnRegionPrefixMap[warnRgnCd===null||warnRgnCd===void 0?void 0: warnRgnCd.substring(0,4)])!==null&&_ref8!==void 0?_ref8:null}}, {key:"groupRegionsByLarea",value:function groupRegionsByLarea(regions){var _this14=this;return regions.reduce(function(grouped,region){var larea=_this14.getLareaByWarnRegionCode(region.regid);if(larea){if(!grouped[larea])grouped[larea]= [];grouped[larea].push(region)}return grouped},{})}}, {key:"formatRegionText",value:function formatRegionText(regions){var maxIndividual=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.CONFIG.MAX_INDIVIDUAL_REGIONS;if(regions.length<=maxIndividual)return regions.map(function(r){return r.regko}).join(", "); return Object.entries(this.groupRegionsByLarea(regions)).map(function(_ref9){var _ref0=_slicedToArray(_ref9,2),larea=_ref0[0],list=_ref0[1];return"".concat(larea," ").concat(list.length,"\uac1c \uc9c0\uc5ed")}).join(", ")}}]); return warnMapService}(); function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()} function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");} function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]"))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i= arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e; }}return _arr} function _arrayWithHoles(arr){if(Array.isArray(arr))return arr} function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");} function _defineProperties(target,props){for(var i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]n._adSkipTimeOffset&&!n._adSkippableState&&(n._adSkippableState= !n._adSkippableState,n.dispatchEvent(new f["default"](h.AdEventTypes.AdSkippableStateChange)))}}; var r=t.adScheduleManager,i=t.eventDispatcher,o=t.ad,a=t.adBreak,s=t.onBeforeStart;return n._videoAdScheduleMgr=r,n._eventDispatcher=i,n._viewSlot=null,n._adSystem=null,n._adDuration=NaN,n._adTimeOffset= null,n._adSkipTimeOffset=NaN,n._adSkippableState=null,n._remainingTime=NaN,n._adWidth=NaN,n._adHeight=NaN,n._adExpanded=null,n._adPlacementType=null,n._adApiFramework=null,n._adCreativeId=null,n._adPodInfo= null,n._envVars=null,n._initCreativeData=null,n._gladVolume=NaN,n._ad=o,n._adBreak=a,n._video=null,n._stop$=new l.Subject,n._onBeforeStart=s,n} return i(t,e),Object.defineProperty(t.prototype,"adLinear",{get:function get(){return!0}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adSystem",{get:function get(){return this._adSystem}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adWidth",{get:function get(){return this._adWidth}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adHeight",{get:function get(){return this._adHeight}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adExpanded",{get:function get(){return this._adExpanded}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adSkippableState",{get:function get(){return this._adSkippableState}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adSkipTimeOffset",{get:function get(){return this._adSkipTimeOffset}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adRemainingTime",{get:function get(){return this._remainingTime}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adTimeOffset",{get:function get(){return this._adTimeOffset}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adDuration",{get:function get(){return this._adDuration}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adPaused",{get:function get(){var e,t;return null!==(t=null===(e=this._video)||void 0===e?void 0:e.paused)&&void 0!==t&&t}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adVolume",{get:function get(){var e,t,n;return this._ad.getVolume?this._ad.getVolume():isNaN(this._gladVolume)?null!==(n=(null===(e=this._video)|| void 0===e?void 0:e.muted)?0:null===(t=this._video)||void 0===t?void 0:t.volume)&&void 0!==n?n:NaN:this._gladVolume}, set:function set(e){if(!this._ad.setVolume)throw new Error("incompatible glad sdk version");this._ad.setVolume(e)}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adMuted",{get:function get(){var e,t,n;return!(!(null===(e=this._video)||void 0===e?void 0:e.muted)&&0!==(null===(n=(t=this._ad).getVolume)|| void 0===n?void 0:n.call(t)))}, set:function set(e){if(e&&this._ad.mute)this._ad.mute();else{if(e||!this._ad.unmute)throw new Error("incompatible glad sdk version");this._ad.unmute()}}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adCompanions",{get:function get(){return null}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adIcons",{get:function get(){return null}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adPlacementType",{get:function get(){return this._adPlacementType}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adApiFramework",{get:function get(){return this._adApiFramework}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adCreativeId",{get:function get(){return this._adCreativeId}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adPodInfo",{get:function get(){return this._adPodInfo}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environmentVars",{get:function get(){return this._envVars}, set:function set(e){this._envVars=o({},e)}, enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"live",{get:function get(){return!1}, enumerable:!0,configurable:!0}),t.prototype.handshakeVersion=function(e){return a(this,void 0,void 0,function(){return s(this,function(t){return[2,e]})})},t.prototype.initAd=function(e,t,n,r,i,a){var s, u,l,c,d,h,f,p,v,g,y,m,_,E,T,b,S,w,A,R,L; if(!i||!a)throw new Error("Missing arguments");var I=a.viewSlot;this._viewSlot=I,this._adSystem=null!==(l=null===(u=(s=this._ad).getAdProvider)||void 0===u?void 0:u.call(s))&&void 0!==l?l:null,this._adDuration= null!==(h=null===(d=(c=this._ad).getDuration)||void 0===d?void 0:d.call(c))&&void 0!==h?h:NaN,this._adTimeOffset=null!==(v=null===(p=(f=this._ad).getTimeOffset)||void 0===p?void 0:p.call(f))&&void 0!== v?v:NaN,this._adSkipTimeOffset=null!==(m=null===(y=(g=this._ad).getSkipTimeOffset)||void 0===y?void 0:y.call(g))&&void 0!==m?m:NaN,this._adWidth=null!==(T=null===(E=(_=this._ad).getVastMediaWidth)||void 0=== E?void 0:E.call(_))&&void 0!==T?T:NaN,this._adHeight=null!==(w=null===(S=(b=this._ad).getVastMediaHeight)||void 0===S?void 0:S.call(b))&&void 0!==w?w:NaN,this._adPlacementType=null!==(L=null===(R=(A=this._ad).getPlacementType)|| void 0===R?void 0:R.call(A))&&void 0!==L?L:null,this._remainingTime=this._adDuration,this._envVars=o({},a),this._initCreativeData=o({},i),this._adBreak&&(this._adBreak.unitId&&(this._adCreativeId=this._adBreak.unitId), !0===this._adBreak.isPod&&void 0!==this._adBreak.sequence&&void 0!==this._adBreak.timeOffset&&void 0!==this._adBreak.totalAds&&(this._adPodInfo={adPosition:this._adBreak.sequence,timeOffset:this._adBreak.timeOffset, totalAds:this._adBreak.totalAds})),this._adSkipTimeOffset<0&&(this._adSkipTimeOffset=NaN),this._subscribeAdEvents()},t.prototype.resizeAd=function(e,t,n){this._videoAdScheduleMgr.onPlayerResize({width:e, height:t,isFullScreen:n===h.AdViewModeTypes.FULLSCREEN})},t.prototype.startAd=function(){this._onBeforeStart&&this._onBeforeStart(),this._ad.start()},t.prototype.stopAd=function(){this._stop$.next()},t.prototype.pauseAd= function(){var e; this._ad.pause?this._ad.pause():null===(e=this._video)||void 0===e||e.pause()},t.prototype.resumeAd=function(){var e; this._ad.resume?this._ad.resume():null===(e=this._video)||void 0===e||e.play()},t.prototype.expandAd=function(){throw new Error("Method not supported."); },t.prototype.collapseAd=function(){throw new Error("Method not supported."); },t.prototype.skipAd=function(){try{this._ad.skip()}catch(e){throw new Error("Method not supported."); }},t.prototype.subscribe=function(e,t,n){this.addEventListener(t,e)},t.prototype.unsubscribe=function(e,t,n){this.removeEventListener(t,e)},t.prototype._clearResources=function(){this._stop$.next()},t.prototype._subscribeAdEvents= function(){var e=c.takeUntil(this._stop$),t=this._eventDispatcher; l.fromEvent(t,h.AdEventTypes.AdStarted).pipe(e).subscribe(this._onAdStarted),l.fromEvent(t,h.AdEventTypes.AdSkipped).pipe(e).subscribe(this._onAdSkipped),l.fromEvent(t,h.AdEventTypes.AdStopped).pipe(e).subscribe(this._onAdStopped), l.fromEvent(t,h.AdEventTypes.AdClickThru).pipe(e).subscribe(this._onAdClicked),l.fromEvent(t,h.AdEventTypes.AdImpression).pipe(e).subscribe(this._onAdImpressionSent),l.fromEvent(t,h.AdEventTypes.AdPaused).pipe(e).subscribe(this._onAdPaused), l.fromEvent(t,h.AdEventTypes.AdPlaying).pipe(e).subscribe(this._onAdPlaying),l.fromEvent(t,h.AdEventTypes.AdBreakReady).pipe(e).subscribe(this._onAdBreakReady),this._videoAdScheduleMgr.setAdVolumeChangeListener&& l.fromEvent(t,h.AdEventTypes.AdVolumeChange).pipe(c.tap(this._onStoreAdVolume),e).subscribe(this._onAdVolumeChange)},t.prototype._tryObserveNativeEvents=function(){var e=this; if(this._viewSlot){var t=this._viewSlot.getElementsByTagName("video");l.from(t).pipe(c.filter(function(e){return!e.paused})).subscribe(function(t){e._video=t,l.fromEvent(t,"timeupdate").pipe(c.takeUntil(e._stop$)).subscribe(e._onAdRemainingTimeChange), e._videoAdScheduleMgr.setAdVolumeChangeListener||l.fromEvent(t,"volumechange").pipe(c.takeUntil(e._stop$)).subscribe(e._onAdVolumeChange)})}},t.prototype._fireEvent=function(e){this.dispatchEvent(new f["default"](e))}, t}(d["default"]); t["default"]=p}, 44415:function _(e,t,n){var _r7,i=this&&this.__extends||(_r7=function r(e,t){return _r7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&& (e[n]=t[n])},_r7(e,t)},function(e,t){function n(){this.constructor=e} _r7(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?r:this._adInitParams.desiredBitrate, t=this._adInitParams.environmentVars.contentVideoElement,n=this._videoAdScheduleMgr;try{this._onAfterStartAd(n),i={bitrate:e,autoplayRequiresMuted:t.muted},(null===(l=this._delegate)||void 0===l?void 0: l.onSetAdRenderingSetting)?null===(c=this._delegate)||void 0===c||c.onSetAdRenderingSetting(n,o({},i),function(){n.onPlayerReady()}):(n.setAdRenderingSettings(i),n.onPlayerReady())}catch(e){this.dispatchEvent(new _["default"](f.AdEventTypes.AdError, {error:e})),this.dispatchEvent(new p["default"](f.AdEventTypes.ContentResumeRequested))}return[2]})})},t.prototype._onAfterStartAd=function(e){},t.prototype.stopAd=function(){var e,t; return a(this,void 0,void 0,function(){return s(this,function(n){return this._videoAdScheduleMgr?(this._stopNonLinearAds(),this._videoAdScheduleMgr.destroy(),(null===(t=null===(e=this._adInitParams)||void 0=== e?void 0:e.environmentVars)||void 0===t?void 0:t.viewSlot)&&(this._adInitParams.environmentVars.viewSlot.style.display="none"),this._currentAd&&(this._currentAd.stopAd(),this._currentAd=null,this.dispatchEvent(new p["default"](f.AdEventTypes.AdStopped))), [2]):[2]})})},t.prototype._rejectPendingInitAdPromise=function(e){var t,n; if(this._pendingInitAdPromise){var r=this._pendingInitAdPromise.reject;this._clearInitAd();try{null===(n=null===(t=this._videoAdScheduleMgr)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t)}finally{this._videoAdScheduleMgr= void 0}r(e)}},t.prototype._startTimeoutTimer=function(){var e=this; this._scheduleLoadTimer=window.setTimeout(function(){e._rejectPendingInitAdPromise(new g.AdError({message:"ScheduleLoadTimeout",code:0}))},5E3)},t.prototype._clearInitAd=function(){window.clearTimeout(this._scheduleLoadTimer), this._scheduleLoadTimer=-1,this._pendingInitAdPromise=void 0},t.prototype._stopNonLinearAds=function(){try{for(var e=0,t=this._nonLinears;e0&&this._blockContentPlay$.next(!0)},t}(d["default"]); t["default"]=w}, 7461:function _(e,t,n){var _r8,i=this&&this.__extends||(_r8=function r(e,t){return _r8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&& (e[n]=t[n])},_r8(e,t)},function(e,t){function n(){this.constructor=e} _r8(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1)return e.substr(0,t);var n=e.indexOf("_");return n>-1?e.substr(0,n):e}(),s=new spwp.GfpVideoAd.VideoAdScheduleManager({divId:(null=== (o=e.viewSlot)||void 0===o?void 0:o.id)||"", playerInfo:{videoEl:e.videoSlot,adContainer:e.viewSlot,playerType:null===(a=e.environmentVars)||void 0===a?void 0:a["glad.applicationCode"],locale:r,playerSize:{width:0,isFullscreen:"normal"}}}),[4,this.getDisplayContainerInfo(e.videoSlot)]); case 1:(u=i.sent())&&(s.adDisplayContainerInfo=u),i.label=2;case 2:return i.trys.push([2,4,5,6]),[4,s.createInitAllAdDisplayContainer()];case 3:return i.sent(),this.setDisplayContainerInfo(e.videoSlot, s.adDisplayContainerInfo),[3,6];case 4:return l=i.sent(),console.error(l),[3,6];case 5:return s.destroy(),[7];case 6:return[2]}})})},e.prototype.setDisplayContainerInfo=function(e,t){this._weakReusableDisplayContainerInfoMap.set(e, t)},e.prototype.getDisplayContainerInfo=function(e){return r(this,void 0,void 0,function(){var t; return i(this,function(n){switch(n.label){case 0:return(t=this._pendingGestureUnlockingTaskMap.get(e))?[4,t]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2,this._weakReusableDisplayContainerInfoMap.get(e)|| null]}})})},e.getInstance=function(){return e._singletonInstance||(e._singletonInstance=new e),e._singletonInstance},e}(); t["default"]=u}, 97923:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=-1}); t&&this._reader.open(t)}},e.prototype._initAdObject=function(){this._currentAd||(this._currentAd=new h["default"]({contentVideo:this._videoElement}),this._currentAd.subscribe(this._bubbleEvent,s.AdEventTypes.AdClickThru), this._currentAd.subscribe(this._bubbleEvent,s.AdEventTypes.ContentPauseRequested),this._currentAd.subscribe(this._bubbleEvent,s.AdEventTypes.AdStarted),this._evtDispatcher.dispatchEvent(new f["default"](s.AdEventTypes.AdBreakReady)))}, e.prototype._stopCurrentAdImmediately=function(){this._currentAd&&(this._evtDispatcher.dispatchEvent(new f["default"](s.AdEventTypes.AdStopped)),this._evtDispatcher.dispatchEvent(new f["default"](s.AdEventTypes.ContentResumeRequested)), this._currentAd.unsubscribe(this._bubbleEvent,s.AdEventTypes.AdClickThru),this._currentAd.unsubscribe(this._bubbleEvent,s.AdEventTypes.ContentPauseRequested),this._currentAd.unsubscribe(this._bubbleEvent, s.AdEventTypes.AdStarted),this._currentAd=null)},e.prototype._sendTracking=function(e,t){var n=new XMLHttpRequest; n.open("GET",e),n.withCredentials=!1===this._disableTrackingCors,n.send(null)},e.prototype._read=function(e){var t=this; if(this._playedAtLeastOnce&&!(e<=0)){var n=this._reader.offset+e,r=this._ended?[]:this._reader.read(e);if(0!==r.length){for(var i=0,o=r.filter(g["default"]).map(function(e){return c["default"].parse(e, t._playerType)}).filter(y["default"]);i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r||n.beginTime-e.currentTime>r}); if(!n.every(function(e){return!1===e})){for(var r=[],i=[],o=0;o-1?this.chunks.splice(n,0,t):this.chunks.push(t)},t.prototype._updateChunk=function(e,t){var n,r; t.time0&&this.dispatchEvent(new l["default"](s.LOG,{detail:{event:u,url:e.trackingData[u]}}))}}e.trackingData=o(o({}, e.trackingData),t.trackingData)},t.CHUNK_EXPIRATION_TIME_SEC=2,t.CHUNK_ENDED_PERSIST_TIME_SEC=.5,t.Event={Types:s},t}(u["default"]); t["default"]=h}, 18E3:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._listenerObject=e,this.handleEvent=this.handleEvent.bind(this)} return e.prototype.observe=function(e){for(var t=0,n=Object.keys(this._listenerObject);t=t-n?1:-1},e.prototype.scan=function(e,t,n){var r=Array.from(e),i=r.length,o=-1,a=(t+n)/2; a<=this._getValue(r[0])&&(o=0),a>=this._getValue(r[i-1])&&(o=i-1);for(var s=[],u=0,l=i,c=0,d=NaN,h=NaN,f=NaN,p=!1,v=!1;-1===o&&u0&&a>h?o=-1===this.getClosest(h,d,a)?c-1:c:l=c):(f=this._getValue(r[c+1]),c=0;--u)t<=this._getValue(r[u])?s.unshift(u): p=!0;for(s.push(o),u=o+1;!v&&u=t.priority);); e.splice(n+1,0,t)},e.prototype.dispatchEvent=function(e){var t=this.events.get(e.type)||[]; if(!t||0===t.length)return!0;var n=t.slice();this.setEventTarget(e,this),this.setEventCurrentTarget(e,this),this.setEventPhase(e,e.AT_TARGET),this.setEventTrust(e,!0);for(var r=!1,i=0,o=n;i1){var s=t[3].split(":");switch(s.length){case 2:n=s[0],r=s[1];break;case 1:n=t[3]; break;default:throw new Error("Internal Error");}}return{username:n,password:r,protocol:t[1]+":",host:t[4],query:i["default"](t[9]||""),hash:o["default"](e||"")}}}, 280:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getVideoPlaybackState=function(e){try{var t=e.paused,n=e.currentTime,r=e.src,i=e.playbackRate,o=e.poster,a={length:0};return e.textTracks.length> 0&&(Array.from(e.textTracks).forEach(function(e,t){e&&(a[t]={mode:e.mode})}),a.length=e.textTracks.length),{paused:t, playbackRate:i,currentTime:n,poster:o,src:r,textTracks:a}}catch(e){throw new Error("getVideoPlaybackState : cannot get playback state");}},t.setVideoPlaybackState=function(e,t){try{e.pause(),e.src=t.src, e.playbackRate=t.playbackRate,e.poster=t.poster,e.play().then(function(){e.currentTime=t.currentTime}),Array.from(t.textTracks).forEach(function(t,n){t&&(e.textTracks[n].mode=t.mode)})}catch(e){throw new Error("setVideoPlaybackState : cannot set playback state"); }}}, 38945:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){var n=0,r=!1,i=function i(t,r){n=t,e.apply(void 0,r)}; return function(){for(var e=[],o=0;o3&&void 0!==arguments[3]?arguments[3]:0,i=0,o=1,a=e.getUint8(t,n);if(i+=(-129&a)*Math.pow(2,7*r),128&a){if(t++,1+ ++r<1||51?1:e}}, {key:"calculateVolumeGain",value:function value(e,t){var n=Math.pow(10,(e-t)/20);return n<1?n:1}}, {key:"calculateGain",value:function value(e,t){if(!this.mediaElement)throw new u("A media element is not defined");return this.calculateVolumeGain(e,t)}}, {key:"applyGain",value:function value(){if(this.mediaElement){this.mediaElement.volume=this.uiVolume*this.loudnessGain;for(var e=0;e=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(31394)),s={sid:NaN,vid:"",tid:"",u:"",inout:"in",os:null,osv:null};function u(e){return/^pc#c[1-5]$/.test(e)} var l=function(){function e(){} return e.prototype.update=function(e,t){var n,i,o=e.mark,a=e.payload,s=a.dimensions;switch(o){case "mediaProvider.request.ok":var l=s.sid,c=s.vid,d=s.tid,h=s.u,f=s.inout,p=s.os,v=s.osv,g=s.device,y=s.deviceType; return void(this._data=r(r({},this._data),{sid:l,vid:c,tid:d,u:h,inout:f,os:p,osv:v,d:g,pt:y}));case "player.event.playing":var m=s.volume,_=s.playerVersion,E=s.muted;return void(this._data=r(r({},this._data), {vo:E?0:100*m,pv:_}))}u(o)&&(this._data=r(r({},this._data),((n={})[o.substring(3)]=null===(i=a.parameters)||void 0===i?void 0:i.value,n)))},e.aggregate=function(e){return e.reduce(function(e,t){return r(r({}, e),t._data)},s)},i([a["default"].metadata({id:"pc", filter:{test:function test(e){return!!/(player\.event\.playing|mediaProvider\.request\.ok).*/.test(e)||!!u(e)}}, dimensions:["volume","muted","vid","sid","tid","u","inout","os","osv","device","deviceType","playerVersion"]})],e)}(); t["default"]=l}, 81254:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.refinePTInfo=void 0;var a=n(14890),s=o(n(31394)),u=o(n(57504)),l=o(n(16273)),c=o(n(61543));function d(e){var t,n;return r(r({},e),{ql:null!==(n=null=== (t=e.ql)||void 0===t?void 0:t.map(function(e){return r(r({},e),{wt:Math.round(e.wt)})}))&&void 0!==n?n:[]})} t.refinePTInfo=d;var h=function(){function e(){this._store=t._createStore()} var t;return t=e,e._createStore=function(){return a.createStore(l["default"])},e.aggregate=function(e){var t=e.reduce(function(e,t){var n,i=t._store.getState(),o=r(r({},e),i); return(null===(n=i.ql)||void 0===n?void 0:n.length)&&t.update({mark:"__reset.content.info__",payload:void 0}),o},{}),n=c["default"](t); return n.ct=u["default"](),{infos:[d(n)]}},e.prototype.update=function(e){this._store.dispatch({type:e.mark, payload:e.payload})},t=i([s["default"].metadata({id:"pt", filter:{test:function test(e){return!!/((player|source)\.event\.|mediaProvider\.).*/.test(e)||"player.action.loop"===e}}, dimensions:["vid","tid","sid","playerVersion","currentTime","encodingOptionID","readyState","duration","seeking","os","osv","stp","deviceType","videoStreamingType","volume","muted","currentSrc","providerName", "playbackRate"]})],e)}(); t["default"]=h}, 82663:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.ReplayMetric=void 0;var o=i(n(31394)),a=["player.event.emptied","source.event.ended","source.event.playing","ads.event.AdLoadStart","ads.event.AllAdsCompleted"], s=function(){function e(){this.count=0,this.ended=!1} return e.prototype.update=function(e,t){var n,r;if("player.event.emptied"===e.mark)return this.ended=!1,void(this.count=0);if("source.event.ended"!==e.mark)if("source.event.playing"!==e.mark){if("ads.event.AdLoadStart"=== e.mark){var i=null===(r=null===(n=e.payload.parameters)||void 0===n?void 0:n.creativeData)||void 0===r?void 0:r.transactionId;this.lastTid===i?this.ended&&(this.count+=1,this.ended=!1):(this.lastTid=i, this.ended=!1,this.count=0)}"ads.event.AllAdsCompleted"===e.mark&&(this.ended=!0)}else this.ended&&(this.count+=1,this.ended=!1);else this.ended=!0},e.aggregate=function(e,t,n){return e.reduce(function(e, t){return e+t.count},0)},r([o["default"].metadata({id:"replay", filter:{test:function test(e){return a.includes(e)}}, dimensions:["seeking","duration","tid","paused","error"]})],e)}(); t.ReplayMetric=s}, 97273:function _(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==(typeof Reflect==="undefined"?"undefined": _typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.TimeShiftMetric=void 0;var o=i(n(31394)),a=function(){function e(){this._lastCurrntTime=0,this._timeShiftValue=0,this._played=!1,this._playingDvrLive= !0,this._maxLiveTimeShift=20} return e.prototype.update=function(e){var t,n,r=e.mark,i=e.payload;if(this._playingDvrLive)switch(r){case "mediaProvider.player.attach":(null===(t=i.parameters)||void 0===t?void 0:t.maxLiveTimeShift)&& (this._maxLiveTimeShift=null===(n=i.parameters)||void 0===n?void 0:n.maxLiveTimeShift);case "source.event.canplay":var o=i.dimensions;!isFinite(o.duration)&&o.seekable||(this._playingDvrLive=!1);break; case "player.event.timeupdate":var a=i.dimensions,s=a.currentTime;(p=a.seeking)||(this._lastCurrntTime=s);break;case "player.event.playing":this._played=!0;break;case "player.event.seeking":var u=i.dimensions, l=(s=u.currentTime,u.seekable),c=this._maxLiveTimeShift,d=this._getSeekableEnd(l);if(isFinite(d)&&d-s<=c&&this._lastCurrntTime>0){var h=this._lastCurrntTime-s;this._timeShiftValue>c?this._timeShiftValue= 0:this._timeShiftValue=Math.max(0,this._timeShiftValue+h)}break;case "player.event.heartbeat":var f=i.dimensions,p=(s=f.currentTime,f.seeking),v=(l=f.seekable,f.paused);if(c=this._maxLiveTimeShift,d=this._getSeekableEnd(l), !isFinite(d))return;var g=d-s;p||(this._lastCurrntTime=s),g>c?this._timeShiftValue=g:this._played&&v?this._timeShiftValue+=1:this._timeShiftValue>c&&(this._timeShiftValue=0)}},e.prototype._getSeekableEnd= function(e){return(null==e?void 0:e.length)?e.end(e.length-1):NaN},e.aggregate=function(e){return e.length?Math.max.apply(Math,e.map(function(e){return isFinite(e._timeShiftValue)?e._timeShiftValue:0})): NaN},r([o["default"].metadata({id:"time-shift", filter:new RegExp(["player\\.event\\.heartbeat","player\\.event\\.seeking","player\\.event\\.playing","player\\.event\\.timeupdate","source\\.event\\.canplay","mediaProvider\\.player\\.attach"].join("|")), dimensions:["currentTime","paused","duration","seekable"]})],e)}(); t.TimeShiftMetric=a}, 65733:function _(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==(typeof Reflect==="undefined"?"undefined": _typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(31394)),a=function(){function e(){this._watchTime=0,this._markTime=0,this._watchTimePerProtocols={}} return e.prototype.update=function(e){var t;switch(e.mark){case "player.action.loop":case "player.event.loadstart":this._watchTime=0,this._watchTimePerProtocols={};break;case "player.event.stalled":case "player.event.waiting":case "player.event.playing":case "player.event.seeking":case "player.event.seeked":case "player.event.play":this._markTime= e.payload.timestamp;break;case "player.event.timeupdate":if(this._markTime>0){var n=e.payload.timestamp-this._markTime;this._watchTime+=n;var r=e.payload.dimensions.streamingProtocol;r&&(this._watchTimePerProtocols[r]= (null!==(t=this._watchTimePerProtocols[r])&&void 0!==t?t:0)+n)}this._markTime=e.payload.timestamp}},e.aggregate=function(e){return e.length?e[0]._watchTime:0},r([o["default"].metadata({id:"watch-time", filter:new RegExp([/player\.event\.(loadstart|play|waiting|stalled|timeupdate|seeking|seeked|playing)/.source,/|player\.action\.loop/.source].join("")),dimensions:["currentTime","paused","streamingProtocol"]})], e)}(); t["default"]=a}, 75345:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(31394)),s=function(){function e(){this._markTime=0,this._watchTimePerProtocols={}} return e.prototype.update=function(e){var t;switch(e.mark){case "player.action.loop":case "player.event.loadstart":this._watchTimePerProtocols={};break;case "player.event.stalled":case "player.event.waiting":case "player.event.playing":case "player.event.seeking":case "player.event.seeked":case "player.event.play":this._markTime= e.payload.timestamp;break;case "player.event.timeupdate":if(this._markTime>0){var n=e.payload.timestamp-this._markTime;this._watchTimePerProtocols["*"]+=n;var r=e.payload.dimensions.streamingProtocol;r&& (this._watchTimePerProtocols[r]=(null!==(t=this._watchTimePerProtocols[r])&&void 0!==t?t:0)+n)}this._markTime=e.payload.timestamp}},e.aggregate=function(e){return e.length?r({},e[0]._watchTimePerProtocols): {}},i([a["default"].metadata({id:"watch-time-per-protocol", filter:new RegExp([/player\.event\.(loadstart|play|waiting|stalled|timeupdate|seeking|seeked|playing)/.source,/|player\.action\.loop/.source].join("")),dimensions:["currentTime","paused","streamingProtocol"]})], e)}(); t["default"]=s}, 97617:function _(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){var o=r.splice(n,1)[0],a=(o[0],o[1]);void 0!==a&&(i[e]=a)}},a=0,s=n;a=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.IncrementalSnapshotMetric=void 0;var o=i(n(31394)),a=n(43734),s=function(){function e(){} return e.prototype.update=function(e,t){var n;if("contentInfo.title"!==e.mark){if("statistic.event.qoetickend"===e.mark){this.tickTime=e.payload.timestamp;var r=e.payload.dimensions,i=r.duration,o=r.hlsSegmentDuration, s=r.hlsSegmentCount,u=r.hlsPartDuration,l=o&&u?Math.ceil(o/u):void 0;this.duration=a.toMilliSeconds(i),this.segmentDuration=a.toMilliSeconds(o),this.segmentCount=s,this.segmentPartDuration=a.toMilliSeconds(u), this.segmentPartCount=l}}else this.contentInfoTitle=null===(n=e.payload.parameters)||void 0===n?void 0:n.value},e.aggregate=function(e,t,n){var r,i,o,a,s,u,l,c=(null===(r=e.find(function(e){return isFinite(e.tickTime)}))|| void 0===r?void 0:r.tickTime)||Date.now(),d=(null===(i=e.find(function(e){return e.contentInfoTitle}))||void 0===i?void 0:i.contentInfoTitle)||"",h=n("buffering"),f=n("seeking"),p=n("video-size"),v=n("viewport-size"), g=n("timing"),y=n("error"),m=h.events.length,_=h.duration,E=f.events.length,T=f.duration; h.running&&(_+=c-h.events[h.events.length-1].start),f.running&&(T+=c-f.events[f.events.length-1].start);var b,S=n("watch-time-per-protocol"),w=Object.keys(S).filter(function(e){return"*"!==e}),A=w.includes("HLS"), R=w.includes("LL-HLS"); if(A&&R){var L=[S.HLS,S["LL-HLS"]].sort(function(e,t){return e-t})[0]; b=Math.floor(L/S["*"]*100)}else(R||R)&&(b=100);w.map(function(e){return S[e]}); var I=null===(o=e.find(function(e){return e.segmentDuration}))||void 0===o?void 0:o.segmentDuration,C=null===(a=e.find(function(e){return e.segmentCount}))||void 0===a?void 0:a.segmentCount,O=null===(s= e.find(function(e){return e.segmentPartDuration}))||void 0===s?void 0:s.segmentPartDuration,P=null===(u=e.find(function(e){return e.segmentPartCount}))||void 0===u?void 0:u.segmentPartCount,k=null===(l= e.find(function(e){return"number"==typeof e.duration&&!isNaN(e.duration)}))||void 0===l?void 0:l.duration,D={loggingTime:c, playStartTime:g.playStart,playerLoadingTime:g.initialLoading,totalLoadingTime:g.totalLoading,bufferingCount:m,bufferingDuration:_,seekCount:E,seekDuration:T,initialVideoWidth:NaN,initialVideoHeight:NaN, averageVideoWidth:NaN,averageVideoHeight:NaN,averageViewportWidth:NaN,averageViewportHeight:NaN,watchingTime:S["*"],error:Boolean(y),averageBandwidth:NaN,title:d,segmentRatioFactor:b,segmentDuration:I, segmentCount:C,segmentPartDuration:O,segmentPartCount:P};return p&&(D.initialVideoWidth=p.initialVideoWidth,D.initialVideoHeight=p.initialVideoHeight,D.averageVideoWidth=p.averageVideoWidth.getAverage(c), D.averageVideoHeight=p.averageVideoHeight.getAverage(c)),v&&(D.averageViewportWidth=v.averageViewportWidth.getAverage(c),D.averageViewportHeight=v.averageViewportHeight.getAverage(c)),k&&(isFinite(k)?D.duration= k:I&&C&&(D.duration=I*C)),D},r([o["default"].metadata({id:"qoe-inc-snapshot", filter:new RegExp(["contentInfo\\.title","statistic\\.event\\.qoetickend"].join("|")),dimensions:["duration","hlsSegmentDuration","hlsSegmentCount","hlsPartDuration"]})],e)}(); t.IncrementalSnapshotMetric=s}, 83003:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.truncate=void 0,t.truncate=function(e){if(!e)return e;var t=Object.keys(e),n={};return t.forEach(function(t){var r=e[t];switch(_typeof(r)){case "undefined":return; case "object":if(null===r)return;break;case "number":if(!isFinite(r))return}n[t]=r}),n}}, 82786:function _(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==(typeof Reflect==="undefined"?"undefined": _typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.BufferingMetric=void 0;var o=i(n(31394)),a=function(){function e(){this._reset()} return e.prototype.update=function(e){if("player.event.emptied"!==e.mark)if("player.action.replay"!==e.mark)if("player.event.canplay"===e.mark&&this._stop)this._stop=!1;else{if(!this._stop)return"player.event.error"=== e.mark&&this._runningEvent?(this._onBufferingEnded(e.payload.timestamp),void(this._stop=!0)):void("source.event.loadstart"===e.mark&&!this._runningEvent||"source.event.waiting"===e.mark&&!this._runningEvent? this._onBufferingStart(e.payload.timestamp,e.payload.dimensions.currentTime):"source.event.playing"===e.mark&&this._runningEvent&&this._onBufferingEnded(e.payload.timestamp))}else this._reset();else this._reset()}, e.prototype._reset=function(){this._measures=[],this._runningEvent=void 0,this._stop=!0},e.prototype._onBufferingStart=function(e,t){console.assert(void 0===this._runningEvent,"last buffering record is incompleted"), this._runningEvent={mediaTime:t, start:e,end:NaN},this._measures.push(this._runningEvent)},e.prototype._onBufferingEnded=function(e){this._runningEvent&&(this._runningEvent.end=e,this._runningEvent=void 0)},e.aggregate=function(e,t,n){var r= e.reduce(function(e,t){return e.concat(t._measures)},[]),i=r.filter(function(e){return isFinite(e.end)}),o=r.length!==i.length; return{events:r,duration:i.reduce(function(e,t){return e+(t.end-t.start)},0), running:o}},r([o["default"].metadata({id:"buffering", filter:new RegExp(["player\\.event\\.emptied","player\\.action\\.replay","player\\.event\\.canplay","player\\.event\\.error","source\\.event\\.loadstart","source\\.event\\.waiting","source\\.event\\.playing"].join("|")), dimensions:["currentTime","readyState"]})],e)}(); t.BufferingMetric=a}, 7218:function _(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==(typeof Reflect==="undefined"?"undefined": _typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMetric=void 0;var o=i(n(31394));function a(e){switch(e.code){case 1:return"MEDIA_ERR_ABORTED";case 2:return"MEDIA_ERR_NETWORK";case 3:return"MEDIA_ERR_DECODE"; case 4:return"MEDIA_ERR_SRC_NOT_SUPPORTED";case 5:return"MEDIA_ERR_ENCRYPTED";default:return"MEDIA_ERR_UNKNOWN"}} var s=function(){function e(){} return e.prototype.update=function(e,t){if("player.event.error"!==e.mark);else{var n=e.payload.dimensions.error;this.errorInfo={timestamp:e.payload.timestamp,currentTime:e.payload.currentTime,name:a(n), message:n.message,raw:n}}},e.aggregate=function(e,t){for(var n,r=0,i=e.length;!n&&r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.SeekingMetric=void 0;var o=i(n(31394)),a=function(){function e(){this._reset()} return e.prototype.update=function(e){if("player.event.emptied"!==e.mark)if("player.action.replay"!==e.mark)if("player.event.timeupdate"!==e.mark)if("player.event.canplay"===e.mark&&this._stop)this._stop= !1;else{if(!this._stop){if("player.event.error"===e.mark&&this._runningEvent)return this._abort(this._runningEvent,e.payload.timestamp,"error"),void(this._stop=!0);if("player.event.seeking"!==e.mark)return"player.event.seeked"=== e.mark&&this._runningEvent?(this._seeked(this._runningEvent,e.payload.timestamp,e.payload.dimensions.currentTime),void(this._runningEvent=void 0)):void 0;this._seeking(e.payload.timestamp,e.payload.dimensions.currentTime)}}else this._currentTime= e.payload.dimensions.currentTime;else this._reset();else this._reset()},e.prototype._reset=function(){this._measures=[],this._runningEvent=void 0,this._stop=!0,this._currentTime=NaN},e.prototype._seeking= function(e,t){this._runningEvent&&this._abort(this._runningEvent,e,"seek"),this._runningEvent={start:e, end:NaN,from:this._currentTime,to:t,reached:NaN,aborted:!1,abortReason:null},this._measures.push(this._runningEvent)},e.prototype._abort=function(e,t,n){e.end=t,e.aborted=!0,e.abortReason=n},e.prototype._seeked= function(e,t,n){e.reached=n,e.end=t},e.aggregate=function(e,t,n){var r=e.reduce(function(e,t){return e.concat(t._measures)},[]),i=r.filter(function(e){return isFinite(e.end)}),o=r.length!==i.length; return{events:r,duration:i.reduce(function(e,t){return e+(t.end-t.start)},0), running:o,aborted:i.reduce(function(e,t){return e+(t.aborted?1:0)},0)}},r([o["default"].metadata({id:"seeking", filter:new RegExp(["player\\.event\\.emptied","player\\.action\\.replay","player\\.event\\.timeupdate","player\\.event\\.canplay","player\\.event\\.error","player\\.event\\.seeking","player\\.event\\.seeked"].join("|")), dimensions:["currentTime"]})],e)}(); t.SeekingMetric=a}, 83638:function _(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==(typeof Reflect==="undefined"?"undefined": _typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.TimingMetric=void 0;var o=i(n(31394)),a=function(){function e(){this.reset()} return e.prototype.reset=function(){this._loadstart=NaN,this._canplay=NaN,this._mediaLoadstart=NaN,this._mediaLoadeddata=NaN,this._totalLoading=NaN},e.prototype.update=function(e,t){if("player.event.emptied"!== e.mark){if("player.event.loadstart"!==e.mark||!isNaN(this._loadstart))return"player.event.canplay"===e.mark&&isNaN(this._canplay)?(this._canplay=e.payload.timestamp,void(isFinite(this._canplay)&&isFinite(this._loadstart)&& (this._totalLoading=this._canplay-this._loadstart))):void("source.event.loadstart"===e.mark&&isNaN(this._mediaLoadstart)?this._mediaLoadstart=e.payload.timestamp:"source.event.loadeddata"===e.mark&&isNaN(this._mediaLoadeddata)&& (this._mediaLoadeddata=e.payload.timestamp)); this._loadstart=e.payload.timestamp}else this.reset()},e.aggregate=function(e,t){for(var n,r=0,i=e.length;!n&&r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.VideoSizeMetric=void 0;var o=i(n(31394)),a=n(74611),s=function(){function e(){this.initialVideoWidth=NaN,this.initialVideoHeight=NaN,this.videoWidth=NaN, this.videoHeight=NaN,this.avgVideoWidth=new a.QoeMovingAverage,this.avgVideoHeight=new a.QoeMovingAverage} return e.prototype._reset=function(){this.avgVideoWidth.reset(),this.avgVideoHeight.reset(),this.initialVideoWidth=NaN,this.initialVideoHeight=NaN,this.videoWidth=NaN,this.videoHeight=NaN},e.prototype._setInitialValue= function(e,t,n){this.initialVideoWidth=t,this.initialVideoHeight=n,this.videoWidth=t,this.videoHeight=n,this.avgVideoWidth.reset(),this.avgVideoWidth.plusAssign(t,e),this.avgVideoHeight.reset(),this.avgVideoHeight.plusAssign(n, e)},e.prototype.update=function(e,t){if("player.event.emptied"!==e.mark)if("player.action.replay"!==e.mark)if("source.event.loadedmetadata"===e.mark&&isNaN(this.initialVideoWidth)){var n=e.payload.dimensions; o=n.videoWidth,a=n.videoHeight,this._setInitialValue(e.payload.timestamp,o,a)}else{if("player.event.resize"===e.mark){var r=e.payload.dimensions;return o=r.videoWidth,a=r.videoHeight,this.avgVideoWidth.plusAssign(o, e.payload.timestamp),this.avgVideoHeight.plusAssign(a,e.payload.timestamp),this.videoWidth=o,void(this.videoHeight=a)}}else{var i=e.payload.dimensions,o=i.videoWidth,a=i.videoHeight;this._setInitialValue(e.payload.timestamp, o,a)}else this._reset()},e.prototype._read=function(){return{initialVideoWidth:this.initialVideoWidth, initialVideoHeight:this.initialVideoHeight,currentVideoWidth:this.videoWidth,currentVideoHeight:this.videoHeight,averageVideoWidth:this.avgVideoWidth.clone(),averageVideoHeight:this.avgVideoHeight.clone()}}, e.aggregate=function(e,t){for(var n,r=0,i=e.length;!n&&r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t, n,a),a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0}),t.ViewportSizeMetric=void 0;var o=i(n(31394)),a=n(74611),s=function(){function e(){this.avgViewportWidth=new a.QoeMovingAverage,this.avgViewportHeight=new a.QoeMovingAverage, this._ended=!1} return e.prototype.update=function(e,t){var n=e.payload.dimensions,r=n.clientWidth,i=n.clientHeight;"player.event.ended"===e.mark&&(this._ended=!0),"player.event.playing"===e.mark&&this._ended&&(this._ended= !1,this.avgViewportWidth.reset(),this.avgViewportHeight.reset()),isFinite(r)&&isFinite(i)&&(this.avgViewportWidth.plusAssign(r,e.payload.timestamp),this.avgViewportHeight.plusAssign(i,e.payload.timestamp))}, e.aggregate=function(e,t){for(var n,r=0,i=e.length;!n&&r0&&(n={averageViewportWidth:o.avgViewportWidth.clone(),averageViewportHeight:o.avgViewportHeight.clone()})}return n},r([o["default"].metadata({id:"viewport-size", filter:new RegExp(["player\\.","ads\\."].join("|")),dimensions:["clientWidth","clientHeight"]})],e)}(); t.ViewportSizeMetric=s}, 30773:function _(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function get(){return t[n]}})}:function(e,t,n,r){void 0=== r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)}; Object.defineProperty(t,"__esModule",{value:!0}),i(n(82786),t),i(n(7218),t),i(n(48014),t),i(n(83638),t),i(n(444),t),i(n(32271),t)}, 74611:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.QoeMovingAverage=void 0;var n=function(){function e(){this.total=0,this.count=0,this.lastValue=0,this.lastTimestamp=0,this.savedDuration= 0,this.paused=!1} return e.prototype.clone=function(){var t=new e;return t.total=this.total,t.count=this.count,t.lastValue=this.lastValue,t.lastTimestamp=this.lastTimestamp,t.savedDuration=this.savedDuration,t.paused=this.paused, t},e.prototype.getAverage=function(e){if(0===this.count)return 0; if(this.lastTimestamp>0){var t=e-this.lastTimestamp;return Math.floor((this.total+this.lastValue*t)/(this.count+t))}return this.savedDuration>0?Math.floor((this.total+this.lastValue*this.savedDuration)/ (this.count+this.savedDuration)):Math.floor(this.total/this.count)},e.prototype.setPaused=function(e,t){e?this.lastTimestamp>0&&(this.savedDuration=t-this.lastTimestamp,this.lastTimestamp=0):this.savedDuration> 0&&(this.lastTimestamp=t-this.savedDuration,this.savedDuration=0),this.paused=e},e.prototype.plusAssign=function(e,t){if(this.lastTimestamp>0){var n=t-this.lastTimestamp; this.total+=this.lastValue*n,this.count+=n}else this.paused||(this.total=e,this.count=1);this.lastValue=e,this.lastTimestamp=t},e.prototype.reset=function(){this.total=0,this.count=0,this.lastValue=0,this.lastTimestamp= 0,this.savedDuration=0},e}(); t.QoeMovingAverage=n}, 16273:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n500*P.playbackRate||k<0?0:k;return r(r({},e),{ql:i(i([], e.ql.slice(0,e.ql.length-1)),[r(r({},C),!1===t.payload.dimensions.seeking&&{wt:(C.wt||0)+D})]),__lastWatchedTime:I});case "player.event.waiting":return!e.ql||0===e.ql.length||t.payload.dimensions.readyState<= 1?e:(L=Object.assign({},e.ql[e.ql.length-1]),r(r(r({},e),{ql:i(i([],e.ql.slice(0,e.ql.length-1)),[r(r({},L),{bc:(L.bc||0)+1})])}),void 0===e.__waitingTimeStamp&&{__waitingTimeStamp:t.payload.timestamp})); case "player.event.canplay":if(!e.ql||0===e.ql.length)return e;var x=e.__waitingTimeStamp;return x?(L=Object.assign({},e.ql[e.ql.length-1]),(J=r(r({},e),{ql:i(i([],e.ql.slice(0,e.ql.length-1)),[r(r({}, L),{bt:(L.bt||0)+(t.payload.timestamp-x)})])})).__waitingTimeStamp=void 0,J):e;case "player.event.onVideoTrackChange":var N=e.ql,M=t.payload.dimensions,U=(_=M.encodingOptionID,T=M.duration,b=M.videoStreamingType, A=M.currentSrc,{q:_,bc:0,bt:0,wt:0,sp:[],du:(1E3*(T||0)).toString()});return r(r({},e),{ql:N?i(i([],N),[U]):[U],prtc:a["default"](b),vd:u["default"](A)});case "mediaProvider.request.start":return r(r({}, e),{__apiLoadStartTime:t.payload.timestamp});case "mediaProvider.request.ok":var F=t.payload.dimensions,B=F.vid,V=F.tid,H=F.sid,j=F.inout,G=F.os,K=F.osv,z=F.stp,W=F.deviceType,q=F.providerName;return r(r({}, e),{vid:B,tid:V,sid:H,inout:j,os:G,osv:K,stp:z,pt:W,it:e.__apiLoadStartTime?t.payload.timestamp-e.__apiLoadStartTime:0,__apiLoadStartTime:void 0,ctype:l["default"](H),cc:"",vt:"",vd:q});case "player.event.ended":return r(r({}, e),{__ended:!0});case "player.action.loop":case "__reset.content.info__":if(!(null===(h=e.ql)||void 0===h?void 0:h.length))return e;var Z=r({},e),Y=r({},e.ql[e.ql.length-1]);return Y.bc=0,Y.bt=0,Y.wt=0, Y.sp=[],Y.__replay||(Y.qit=0),Z.ql=[Y],Z;case "source.event.play":return e.__ended?r(r({},e),{__ended:!1,__replayStartTime:t.payload.timestamp}):e;case "source.event.playing":if(!e.__replayStartTime)return e; if(!(null===(f=e.ql)||void 0===f?void 0:f.length))return e;var X=e.ql.slice(0,-1),Q=e.ql[e.ql.length-1];return r(r({},e),{ql:i(i([],X),[r(r({},Q),{qit:t.payload.timestamp-e.__replayStartTime,__replay:!0})]), __ended:!1,__replayStartTime:void 0});case "source.event.loadstart":return L=r({},Array.isArray(e.ql)&&e.ql[e.ql.length-1]),r(r({},e),{ql:i(i([],null!==(g=null===(p=e.ql)||void 0===p?void 0:p.slice(0,(null=== (v=e.ql)||void 0===v?void 0:v.length)-1||0))&&void 0!==g?g:[]),[r(r({},L),{__loadstartTime:t.payload.timestamp})])});case "source.event.canplay":return e.ql&&0!==e.ql.length&&(null===(y=e.ql[e.ql.length- 1])||void 0===y?void 0:y.__loadstartTime)?(L=r({},Array.isArray(e.ql)&&e.ql[e.ql.length-1]),delete (J=r(r({},e),{ql:i(i([],e.ql.slice(0,e.ql.length-1)),[r(r({},L),{qit:t.payload.timestamp-L.__loadstartTime|| 0})])})).ql[J.ql.length-1].__loadstartTime,J):e;var J;case "player.event.volumechange":var $=t.payload.dimensions;return w=$.muted,S=$.volume,r(r({},e),{vo:w?0:Math.round(100*S)});default:return e}}}, 28957:function _(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0){var tn=null!==(fe=null!==(de=null===(ce=g["default"](e.eventList,function(e){return"STATUS"===e.eventType&&"videoWidth"===e.name}))||void 0===ce?void 0:ce.value)&&void 0!==de?de:null=== (he=e.initialStatus)||void 0===he?void 0:he.videoWidth)&&void 0!==fe?fe:NaN; isFinite(tn)&&tn!==$t&&(vt=(vt||e.eventList||[]).concat(l.createQoEStatusChangedEvent("videoWidth",$t,t.payload.dimensions.currentTime,t.payload.timestamp)))}if(en>=0){var nn=null!==(ye=null!==(ve=null=== (pe=g["default"](e.eventList,function(e){return"STATUS"===e.eventType&&"videoHeight"===e.name}))||void 0===pe?void 0:pe.value)&&void 0!==ve?ve:null===(ge=e.initialStatus)||void 0===ge?void 0:ge.videoHeight)&& void 0!==ye?ye:NaN; isFinite(nn)&&nn!==en&&(vt=(vt||e.eventList||[]).concat(l.createQoEStatusChangedEvent("videoHeight",en,t.payload.dimensions.currentTime,t.payload.timestamp)))}return vt?r(r({},e),{eventList:vt}):e;case "source.event.loadstart":return Ne= r({},e),void 0===(null===(me=e.__timingFlags)||void 0===me?void 0:me.initialLoading)&&(Ne=r(r({},Ne),{eventList:i(i([],Ne.eventList||[]),[c.createTimingEvent("initialLoading","START",t.payload.dimensions.currentTime, t.payload.timestamp)]),__timingFlags:r(r({},e.__timingFlags),{initialLoading:!0})})),r(r({},Ne),{eventList:i(i([],Ne.eventList||[]),[c.createTimingEvent("bufferingTime","START",t.payload.dimensions.currentTime, t.payload.timestamp)]),__timingFlags:r(r({},Ne.__timingFlags),{bufferingTime:!0})});case "source.event.loadedmetadata":return Ne=r({},e),!0===(null===(_e=e.__timingFlags)||void 0===_e?void 0:_e.initialLoading)&& (Ne=r(r({},Ne),{eventList:i(i([],Ne.eventList||[]),[c.createTimingEvent("initialLoading","END",t.payload.dimensions.currentTime,t.payload.timestamp)]),__timingFlags:r(r({},e.__timingFlags),{initialLoading:!1})})), Ne;case "source.event.waiting":return!0===(null===(Ee=e.__timingFlags)||void 0===Ee?void 0:Ee.bufferingTime)?e:r(r({},e),{eventList:i(i([],e.eventList||[]),[c.createTimingEvent("bufferingTime","START", t.payload.dimensions.currentTime,t.payload.timestamp)]),__timingFlags:r(r({},e.__timingFlags),{bufferingTime:!0})});case "source.event.canplay":case "source.event.canplaythrough":case "source.event.playing":return Ne= e,(null===(Te=e.__timingFlags)||void 0===Te?void 0:Te.bufferingTime)?r(r({},Ne),{eventList:i(i([],Ne.eventList||[]),[c.createTimingEvent("bufferingTime","END",t.payload.dimensions.currentTime,t.payload.timestamp)]), __timingFlags:r(r({},Ne.__timingFlags),{bufferingTime:!1})}):Ne;case "player.event.screenorientationchange":return Ht=t.payload.dimensions.screenOrientation,r(r({},e),{eventList:i(i([],e.eventList||[]), [l.createQoEStatusChangedEvent("screenOrientation",Ht.split("-")[0].toUpperCase(),t.payload.dimensions.currentTime,t.payload.timestamp)])});case "player.event.onVideoTrackChange":var rn=t.payload.dimensions, on=(Ct=rn.currentSrc,jt=rn.abr,Kt=rn.videoTrackId,It=rn.videoTrackKind,g["default"](e.eventList,function(e){return"STATUS"===e.eventType&&"abr"===e.name})),an=g["default"](e.eventList,function(e){return"STATUS"=== e.eventType&&"multiTrackId"===e.name}); switch(Ot=void 0,It){case "low-latency":case "low-latency-p2p":Ot="LL-HLS";break;default:Ot=m["default"](Ct)}return We=r(r({},e),{snapshotStatus:r(r({},null==e?void 0:e.snapshotStatus),{videoStreamingType:Ot, cdnDomain:p["default"](Ct)}),eventList:[]}),e.eventList&&(f=We.eventList).push.apply(f,e.eventList),on!==jt&&We.eventList.push(l.createQoEStatusChangedEvent("abr",jt,t.payload.dimensions.currentTime,t.payload.timestamp)), an!==Kt&&We.eventList.push(l.createQoEStatusChangedEvent("multiTrackId",Kt,t.payload.dimensions.currentTime,t.payload.timestamp)),We;case "player.event.onTextTrackChange":var sn=t.payload.dimensions.subtitle, un=E["default"](t.payload.dimensions.subtitleType),ln=(vt=e.eventList||[],!1);return sn!==d["default"]("subtitle",e.eventList,e.initialStatus)&&(ln=!0,vt=v["default"](vt,l.createQoEStatusChangedEvent("subtitle", sn,t.payload.dimensions.currentTime,t.payload.timestamp),1E3,e.initialStatus)),un!==E["default"](d["default"]("subtitleType",e.eventList,e.initialStatus))&&(ln=!0,vt=v["default"](vt,l.createQoEStatusChangedEvent("subtitleType", un,t.payload.dimensions.currentTime,t.payload.timestamp),1E3,e.initialStatus)),ln?r(r({},e),{eventList:vt}):e;case "ads.event.AdLoadStart":var cn=t.payload.dimensions;return wt=cn.playerVersion,At=cn.id, Rt=cn.autoplay,r(r({},e),{logInfo:{logOrder:0,logStartTime:t.payload.timestamp,mediaLogOrder:0,mediaStartTime:L(e.__lastCurrentTime||0),mediaEndTime:L(e.__lastCurrentTime||0)},playerInfo:r(r({},e.playerInfo), {playerVersion:wt,playerId:At,autoPlay:Rt}),eventList:i(i([],e.eventList||[]),[c.createTimingEvent("adApi","START",t.payload.dimensions.currentTime,t.payload.timestamp)]),initialStatus:r(r({},e.initialStatus), {viewportWidth:t.payload.parameters.width,viewportHeight:t.payload.parameters.height,screenMode:t.payload.parameters.screenMode,vr:!1}),__timingFlags:r(r({},e.__timingFlags),{adApi:!0})});case "ads.event.AdMetadata":return r(r({}, e),{eventList:i(i([],e.eventList||[]),[c.createTimingEvent("adApi","END",t.payload.dimensions.currentTime,t.payload.timestamp)]),__timingFlags:{adApi:!1}});case "ads.event.AdClickThru":return r(r({},e), {eventList:i(i([],e.eventList||[]),[a.createAdEvent("click",t.payload.dimensions.currentTime,t.payload.timestamp)])});case "ads.event.AdSkipped":return r(r({},e),{eventList:i(i([],e.eventList||[]),[a.createAdEvent("skip", t.payload.dimensions.currentTime,t.payload.timestamp)])});case "ads.event.AdError":return r(r({},e),{eventList:i(i(i([],e.eventList||[]),[a.createAdEvent("error",t.payload.dimensions.currentTime,t.payload.timestamp)]), (null===(be=e.__timingFlags)||void 0===be?void 0:be.adApi)?[c.createTimingEvent("adApi","END",t.payload.dimensions.currentTime,t.payload.timestamp)]:[]),__timingFlags:{adApi:!1}});case "ads.event.AdStarted":return r(r({}, e),{mediaInfo:{mediaType:"AD",adType:null===(Se=t.payload.dimensions.adType)||void 0===Se?void 0:Se.toUpperCase(),adSystem:t.payload.dimensions.adSystem,adSkipOffset:L(t.payload.dimensions.adSkipTimeOffset), live:t.payload.dimensions.live,mediaId:"",mediaLength:L(t.payload.dimensions.duration)},eventList:i([],e.eventList||[]),logInfo:r(r({},e.logInfo),{mediaLogOrder:0,mediaStartTime:t.payload.dimensions.currentTime}), initialStatus:r(r({},e.initialStatus),{playbackStatus:"PLAYING",videoWidth:t.payload.dimensions.videoWidth,videoHeight:t.payload.dimensions.videoHeight,viewportWidth:t.payload.dimensions.clientWidth,viewportHeight:t.payload.dimensions.clientHeight}), __lastCurrentTime:t.payload.dimensions.currentTime});case "ads.event.AdPlaying":return r(r({},e),{eventList:i(i([],e.eventList||[]),[l.createQoEStatusChangedEvent("playbackStatus","PLAYING",t.payload.dimensions.currentTime, t.payload.timestamp)])});case "ads.event.resize":return r(r({},e),{eventList:i(i(i(i([],e.eventList||[]),(null===(we=e.initialStatus)||void 0===we?void 0:we.viewportWidth)!==t.payload.dimensions.clientWidth? [l.createQoEStatusChangedEvent("viewportWidth",t.payload.dimensions.clientWidth,t.payload.dimensions.currentTime,t.payload.dimensions.timestamp)]:[]),(null===(Ae=e.initialStatus)||void 0===Ae?void 0:Ae.viewportHeight)!== t.payload.dimensions.clientHeight?[l.createQoEStatusChangedEvent("viewportHeight",t.payload.dimensions.clientHeight,t.payload.dimensions.currentTime,t.payload.dimensions.timestamp)]:[]),(null===(Re=e.initialStatus)|| void 0===Re?void 0:Re.screenMode)!==t.payload.dimensions.screenMode?[l.createQoEStatusChangedEvent("screenMode",t.payload.dimensions.screenMode,t.payload.dimensions.currentTime,t.payload.dimensions.timestamp)]: [])});case "metadata.request.start":var dn="api"+(pn=t.payload.parameters.componentType);return r(r({},e),{eventList:i(i([],e.eventList||[]),[c.createTimingEvent(dn,"START",t.payload.dimensions.currentTime, t.payload.timestamp)]),__timingFlags:r(r({},e.__timingFlags),(O={},O[dn]=!0,O))});case "metadata.request.ok":var hn="api"+(pn=t.payload.parameters.componentType);return r(r({},e),{eventList:i(i([],e.eventList|| []),[c.createTimingEvent(hn,"END",t.payload.dimensions.currentTime,t.payload.timestamp)]),__timingFlags:r(r({},e.__timingFlags),(P={},P[hn]=!1,P))});case "metadata.event.toggle":var fn=t.payload.parameters, pn=fn.componentType,vn=fn.value,gn="toggle"+pn;return r(r({},e),{eventList:i(i([],e.eventList||[]),[s.createDynamicStatusChangedEvent(gn,vn,t.payload.dimensions.currentTime,t.payload.timestamp)])});case "metadata.event.click":var yn= t.payload.parameters,mn=(pn=yn.componentType,vn=yn.value,"click"+pn);return r(r({},e),{eventList:i(i([],e.eventList||[]),[s.createDynamicStatusChangedEvent(mn,"",t.payload.dimensions.currentTime,t.payload.timestamp)])}); case "metadata.status.changed":var _n=t.payload.parameters,En=(pn=_n.componentType,vn=_n.value,pn);return r(r({},e),{eventList:i(i([],e.eventList||[]),[l.createQoEStatusChangedEvent(En,vn,t.payload.dimensions.currentTime, t.payload.timestamp)])});case "player.event.error":var Tn=t.payload.dimensions.error;return r(r({},e),{eventList:i(i([],e.eventList||[]),[u.createErrorEvent("error",null!==(Le=null==Tn?void 0:Tn.code)&& void 0!==Le?Le:-1,t.payload.dimensions.currentTime,t.payload.timestamp)])});case "hls.fragmentLoaded":return r(r({},e),{snapshotStatus:r(r({},e.snapshotStatus),{mediaSegmentCount:(null!==(Ce=null===(Ie= e.snapshotStatus)||void 0===Ie?void 0:Ie.mediaSegmentCount)&&void 0!==Ce?Ce:0)+1,mediaSegmentSize:(null!==(Pe=null===(Oe=e.snapshotStatus)||void 0===Oe?void 0:Oe.mediaSegmentSize)&&void 0!==Pe?Pe:0)+t.payload.parameters.segmentSize, segmentDownloadTime:(null!==(De=null===(ke=e.snapshotStatus)||void 0===ke?void 0:ke.segmentDownloadTime)&&void 0!==De?De:0)+Math.floor(t.payload.parameters.timing)})});case "hls.fragmentChanged":var bn= t.payload.dimensions,Sn=bn.hlsSegmentDuration,wn=bn.hlsSegmentCount,An=bn.hlsPartDuration,Rn=bn.streamingProtocol,Ln=Sn&&An?Math.ceil(Sn/An):NaN;return r(r({},e),{snapshotStatus:r(r({},e.snapshotStatus), {segmentDuration:L(Sn),segmentCount:wn,segmentPartDuration:An>0?L(An):NaN,segmentPartCount:Ln,videoStreamingType:"LL-HLS"===Rn?"LL-HLS":null===(xe=e.snapshotStatus)||void 0===xe?void 0:xe.videoStreamingType})}); case "hls.recovery":return r(r({},e),{eventList:i(i([],e.eventList||[]),[u.createErrorEvent("recover",t.payload.parameters.code,t.payload.dimensions.currentTime,t.payload.timestamp)])})}return"p2p.event"=== t.type?b.reduceP2PEvents(e,t):function(e,t){var n,i,o;if(!1===/^(userInfo|customInfo|clientInfo|campaignInfo)\.*/.test(t.type))return e;var a=/^(\w+)\.(\w+)$/g.exec(t.type);if(!a||!a[1]||!a[2])return e; var s=a[1],u=a[2];return r(r({},e),((n={})[s]=r(r({},e[s]||{}),((i={})[u]=null===(o=t.payload.parameters)||void 0===o?void 0:o.value,i)),n))}(e,t)}}, 43190:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){switch(e){case "PD":return 1;case "HLS":case "HLS-TEMPLATE":case "DASH":return 3;default:return 0}}}, 42976:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return Number(e)<2E3?2:1}}, 57504:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){void 0===e&&(e=new Date);var t=e.toString().split(" ");return t[2]+"/"+t[1]+"/"+t[3]+":"+t[4]}}, 43141:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/.*naver\.(net|com).*/,r=/.*smartmediarep\.com.*/;t["default"]=function(e){return r.test(e)?"SMR":(n.test(e),"NAVER")}}, 26895:function _(e,t,n){var r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;nn)return r(r([],e),[t]);var d=o["default"](s,e,i,{beforeIndex:u});return void 0===d||d!==t.value?r(r([],e),[t]):e.filter(function(e,t){return t!==u})}}, 59183:function _(e,t){function n(e,t){if(!e||0===e.length)return-1;for(var n=e.length-1;n>-1;n--)if(t(e[n],n))return n;return-1} Object.defineProperty(t,"__esModule",{value:!0}),t.findBackwardIndex=void 0,t.findBackwardIndex=n,t["default"]=function(e,t){var r=n(e,t);return r>-1?null==e?void 0:e[r]:void 0}}, 68806:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t=new Date(e);return function(e){return void 0===e&&(e=Date.now()),e-t.getTime()}}}, 15146:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=new RegExp("\\.("+["mp4","avi","mkv","webm"].join("|")+")"),r=new RegExp("\\.("+["m3u8","ts"].join("|")+")"),i=new RegExp("\\.("+ ["mpd","m4s"].join("|")+")");t["default"]=function(e){return n.test(e)?"PD":r.test(e)?"HLS":i.test(e)?"DASH":""}}, 41706:function _(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}}; Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(68806));t["default"]=function(e,t){var n=i["default"](t);return e.forEach(function(e){e.mediaTime=n(e.logTime)}),e}}, 69652:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeHdrFormat=void 0;var n=["HDR10","HDR10_PLUS","HLG","UNKNOWN"];t.normalizeHdrFormat=function(e){if("string"==typeof e){var t= e.trim().toUpperCase().replace(/[\s-]+/g,"_");if(t&&"SDR"!==t)return n.indexOf(t)>-1||0===t.indexOf("DOLBY_VISION")?t:"UNKNOWN"}}}, 81842:function _(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){if("string"==typeof e)return e.trim().toUpperCase()||void 0}}, 42361:function _(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=13]: (null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.getHighEntropyValues)?[4,null===(t=navigator.userAgentData)||void 0===t?void 0:t.getHighEntropyValues(["platformVersion"]).then(function(e){var t= null==e?void 0:e.platformVersion;t&&(r=z()(String(t).split(".")[0],10))})["catch"](function(){r=void 0})]:[3, 2]:[2,!1]):[2,!1];case 1:a.sent(),a.label=2;case 2:return r&&(o=z()(String(r).split(".")[0],10),r=o,q()(o)&&o>=13)?[2,!0]:[2,!1];case 3:return a.sent(),[2,!1];case 4:return[2]}var s})},new ((a=void 0)|| (a=u()))(function(e,t){function r(e){try{u(s.next(e))}catch(e){t(e)}} function i(e){try{u(s["throw"](e))}catch(e){t(e)}} function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a(function(e){e(n)})).then(r,i)} u((s=s.apply(n,o||[])).next())})} var _Y=function Y(){return _Y=a()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1},e.prototype.requestMediaKeySystemAccess=function(e,t){var n,r,i,o,a; return r=this,i=void 0,a=function a(){var r,i,o,a,s,u,l,c,d,h,f=this;return X(this,function(p){switch(p.label){case 0:return this.isSubsystemOf(e)?[3,3]:V.Z.getInstance().contains(e)?[4,V.Z.getInstance().requestMediaKeySystemAccess(e, t)]:[3,2];case 1:if(r=p.sent(),i=null==r?void 0:r.getConfiguration(),r)return[2,new j.e([r],i)];p.label=2;case 2:throw new B.Z("No available key system access");case 3:return o=t,[4,Z()];case 4:a=p.sent(), s=null,l=function l(e){var t,r,i;return X(this,function(l){switch(l.label){case 0:t=[],r=E()(o).call(o,function(n,r){var i,o=_Y({},r);return o.initDataTypes=["cenc","skd"],o.videoCapabilities=null===(i= r.videoCapabilities||[])||void 0===i?void 0:E()(i).call(i,function(n,r){var i,o,s,u,l,c,d=_Y({},r);if(!d.contentType)return g()(n).call(n,d);var h=[];switch(r.robustness){case "tee":if("PlayReadyLegacy"=== e)return n;h.push(_Y(_Y({},d),{robustness:null===(i=f._findCdmRobustness(e))||void 0===i?void 0:i.robustness.TEE}));break;case $:h.push(_Y(_Y({},d),{robustness:null===(o=f._findCdmRobustness(e))||void 0=== o?void 0:o.robustness.ALLOW_SW}));break;case ee:h.push(_Y(_Y({},d),{robustness:null===(s=f._findCdmRobustness(e))||void 0===s?void 0:s.robustness.UNSAFE}));break;case "":h.push(_Y(_Y({},d),{robustness:null=== (u=f._findCdmRobustness(e))||void 0===u?void 0:u.robustness.UNSAFE}));break;case void 0:var p,v=b()(p=Q(Q([],w()(null!==(c=null===(l=f._findCdmRobustness(e))||void 0===l?void 0:l.robustness)&&void 0!== c?c:{})||[],!0),[""],!1)).call(p,function(e,t,n){return R()(n).call(n,e)===t}); I()(v).call(v,function(e){if(void 0===e){var t=_Y({},d);delete t.robustness,h.push(t)}else h.push(_Y(_Y({},d),{robustness:e}))}); break;default:h.push(_Y({},d))}var y,m=r.encryptionScheme;y=null==m?"FairPlay"===e?[null]:["cenc","cbcs"]:[m];for(var _=[],E=0,T=h;E0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t, n,s):i(t,n))||s);return o>3&&s&&u()(t,n,s),s},K=function K(e,t,n,r){return new (n||(n=c()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},z=function z(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof h()&&(o[p()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t, n,s):i(t,n))||s);return o>3&&s&&u()(t,n,s),s}([(0,m.Pv)("AegisMediaKeysController")],e)}()}, 36167:function _(e,t,n){n.d(t,{Q:function Q(){return r}}); var r={FairPlay:"com.apple.fps",Widevine:"com.widevine.alpha",PlayReady:"com.microsoft.playready.recommendation",PlayReadyLegacy:"com.microsoft.playready"}}, 46776:function _(e,t,n){n.d(t,{U9:function U9(){return l.U9}, OA:function OA(){return l.OA}, zb:function zb(){return i.z}, $E:function $E(){return r.$}, Yr:function Yr(){return l.Yr}, LQ:function LQ(){return l.LQ}, FD:function FD(){return l.FD}, p6:function p6(){return u}, eW:function eW(){return c.e}}); var r=n(75173),i=n(52903),o=n(1190),a=n(64405),s=n(13652),u=function(){function e(){} return e.prototype.decode=function(e){var t=JSON.parse((new TextDecoder).decode(e)),n=null;if("license-request"===t.type&&(n=s.k),!n)throw new TypeError("Invalid message type");return(0,a.y)(n,t),t.dataType&& t.data&&"arrayBuffer"===t.dataType&&(t.data=o.Z.base64ToUint8Array(t.data)),t},e}(),l=n(44355),c=n(13613)}, 23353:function _(e,t,n){n.d(t,{d:function d(){return i}}); var r,i="dataPropMetaKey";!function(e){e[e.OPTIONAL=0]="OPTIONAL",e[e.REQUIRED=1]="REQUIRED"}(r||(r={}))}, 11990:function _(e,t,n){n.d(t,{F:function F(){return i}}),n(28660); var r=n(23353);function i(e){return Reflect.metadata(r.d,{kind:0,opts:e})} }, 56594:function _(e,t,n){n.d(t,{a:function a(){return i}}),n(28660); var r=n(23353);function i(e){return Reflect.metadata(r.d,{kind:1,opts:e})} }, 63334:function _(e,t,n){function r(e){return function(t){return t===e}} n.d(t,{i:function i(){return r}})}, 49735:function _(e,t,n){n.d(t,{I:function I(){return a}}); var r=n(26295),i=n.n(r),o=n(36167);function a(e){for(var t=0,n=i()(o.Q);t-1}} }, 64405:function _(e,t,n){n.d(t,{y:function y(){return c}}); var r=n(20116),i=n.n(r),o=n(86902),a=n.n(o),s=n(77766),u=n.n(s),l=n(23353);function c(e,t){for(var n,r=i()(n=a()(e.prototype)).call(n,function(t){return Object.prototype.hasOwnProperty.call(e.prototype, t)}),o=0,s=r;o=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t,n,u):o(t,n))|| u);return s>3&&u&&a()(t,n,u),u},v="aegis-token",g="aegis-aeds",y=function(){function e(){} return p([(0,l.F)({type:"string"})],e.prototype,"licenseUrl",void 0),p([(0,l.F)({type:"string"})],e.prototype,"certificateUrl",void 0),e}(),m=function(){function e(){} return p([(0,c.a)({type:"number",validate:(0,d.i)(1)})],e.prototype,"version",void 0),p([(0,c.a)({type:"string",validate:(0,h.k)("FairPlay","PlayReady","Widevine")})],e.prototype,"drmType",void 0),p([(0, l.F)({type:"object",validate:u()(f.y).call(f.y,null,y)})],e.prototype,"licenseRequestInfo",void 0),e}(),_=function(){function e(){} var t;return p([(0,c.a)({type:"number",validate:(0,d.i)(2)})],e.prototype,"version",void 0),p([(0,c.a)({type:"string",validate:(0,h.k)("FairPlay","PlayReady","Widevine")})],e.prototype,"drmType",void 0), p([(0,l.F)({type:"object",validate:u()(f.y).call(f.y,null,y)})],e.prototype,"licenseRequestInfo",void 0),p([(0,c.a)({type:"object",validate:(t=ArrayBuffer,function(e){return e instanceof t})})],e.prototype, "initData",void 0),p([(0,c.a)({type:"string"})],e.prototype,"initDataType",void 0),e}()}, 13652:function _(e,t,n){n.d(t,{k:function k(){return h}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(11990),u=n(56594),l=n(63334),c=n(46440),d=function d(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r;if("object"==(typeof Reflect==="undefined"? "undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t,n,u):o(t,n))||u);return s>3&&u&&a()(t,n, u),u},h=function(){function e(){} return d([(0,u.a)({type:"number",validate:(0,l.i)(1)})],e.prototype,"version",void 0),d([(0,u.a)({type:"string",validate:(0,c.k)("individualization-request","license-release","license-renewal","license-request")})], e.prototype,"type",void 0),d([(0,u.a)({type:"string"})],e.prototype,"method",void 0),d([(0,s.F)({type:"object"})],e.prototype,"headers",void 0),d([(0,s.F)()],e.prototype,"data",void 0),d([(0,s.F)({type:"string"})], e.prototype,"dataType",void 0),d([(0,u.a)({type:"string"})],e.prototype,"responseType",void 0),e}()}, 16686:function _(e,t,n){n.d(t,{p:function p(){return v}}); var r=n(39392),i=n.n(r),o=n(92762),a=n.n(o),s=n(3649),u=n.n(s),l=n(33032),c=n.n(l),d=n(94473),h=n.n(d),f=n(81643),p=n.n(f),v=function(){function e(){this.events=new (i())} return e.prototype.addEventListener=function(e,t,n){this.events.has(e)||this.events.set(e,[]);var r=this.events.get(e),i=this.getListenerCallback(t),o="object"==_typeof(n)?n:{once:!1,priority:0},a=o.once, s=o.priority;this.addEventData(r,this.createEventData(i,a,s))},e.prototype.addEventData=function(e,t){for(var n=e.length;n--&&!(e[n].priority>=t.priority);); a()(e).call(e,n+1,0,t)},e.prototype.dispatchEvent=function(e){var t=this.events.get(e.type)||[]; if(!t||0===t.length)return!0;var n=u()(t).call(t);this.setEventTarget(e,this),this.setEventCurrentTarget(e,this),this.setEventPhase(e,e.AT_TARGET),this.setEventTrust(e,!0);for(var r=!1,i=0,o=n;i2&&arguments[2]!==undefined?arguments[2]:{},n=_ref.blocked,r=_ref.upgrade,i=_ref.blocking,o=_ref.terminated;var a=indexedDB.open(e,t),s=M(a);return r&&a.addEventListener("upgradeneeded", function(e){r(M(a.result),e.oldVersion,e.newVersion,M(a.transaction),e)}),n&&a.addEventListener("blocked",function(e){return n(e.oldVersion,e.newVersion,e)}),s.then(function(e){o&&e.addEventListener("close", function(){return o()}),i&&e.addEventListener("versionchange",function(e){return i(e.oldVersion,e.newVersion,e)})})["catch"](function(){}),s} var B=["get","getKey","getAll","getAllKeys","count"],V=["put","add","delete","clear"],H=new Map;function j(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(H.get(t))return H.get(t); var n=t.replace(/FromIndex$/,""),r=t!==n,i=V.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!B.includes(n))return;var o=function(){var _ref2=_asyncToGenerator(regeneratorRuntime.mark(function _callee(e){var _a2; var o,a,_len3,t,_key3,_args=arguments;return regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:o=this.transaction(e,i?"readwrite":"readonly");a=o.store; for(_len3=_args.length,t=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)t[_key3-1]=_args[_key3];r&&(a=a.index(t.shift()));_context.next=6;return Promise.all([(_a2=a)[n].apply(_a2,t),i&&o.done]); case 6:return _context.abrupt("return",_context.sent[0]);case 7:case "end":return _context.stop()}},_callee,this)})); return function o(_x){return _ref2.apply(this,arguments)}}(); return H.set(t,o),o} x(function(e){return _objectSpread({},e,{get:function get(t,n,r){return j(t,n)||e.get(t,n,r)}, has:function has(t,n){return!!j(t,n)||e.has(t,n)}})}); var G=["continue","continuePrimaryKey","advance"],K={},z=new WeakMap,W=new WeakMap,q={get:function get(e,t){if(!G.includes(t))return e[t];var n=K[t];return n||(n=K[t]=function(){var _W$get;z.set(this,(_W$get= W.get(this))[t].apply(_W$get,arguments))}),n}}; function Z(){return _Z.apply(this,arguments)} function _Z(){_Z=_wrapAsyncGenerator(regeneratorRuntime.mark(function _callee2(){var _t2;var t,n,_args2=arguments;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev= _context2.next){case 0:t=this;_context2.t0=t instanceof IDBCursor;if(_context2.t0){_context2.next=6;break}_context2.next=5;return _awaitAsyncGenerator((_t2=t).openCursor.apply(_t2,_args2));case 5:t=_context2.sent; case 6:if(t){_context2.next=8;break}return _context2.abrupt("return");case 8:n=new Proxy(t,q);W.set(n,t),k.set(n,U(t));case 10:if(!t){_context2.next=19;break}_context2.next=13;return n;case 13:_context2.next= 15;return _awaitAsyncGenerator(z.get(n)||t["continue"]());case 15:t=_context2.sent;z["delete"](n);case 17:_context2.next=10;break;case 19:case "end":return _context2.stop()}},_callee2,this)})); return _Z.apply(this,arguments)} function Y(e,t){return t===Symbol.asyncIterator&&L(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&L(e,[IDBIndex,IDBObjectStore])} x(function(e){return _objectSpread({},e,{get:function get(t,n,r){return Y(t,n)?Z:e.get(t,n,r)}, has:function has(t,n){return Y(t,n)||e.has(t,n)}})}); var X,_Q,J,$,ee=n(99506),te=function te(e,t,n,r){return new (n||(n=u()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},ne=function ne(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof c()&&(o[h()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=a?[2,i(n)]:n instanceof DOMException&& R()(re).call(re,n.name)?(this.openAbortCallback=s(c),[2,void 0]):[2,i(n)];case 4:return[2]}})})}; c()})},e.prototype._claimQuotaUsingWebAPI=function(e){return te(this,void 0,void 0,function(){var t; return ne(this,function(n){switch(n.label){case 0:return[4,navigator.storage.estimate()];case 1:if("number"!=typeof(t=n.sent().quota))throw new ee.M("No quota information",ee.M.Errors.QuotaExceededError); if(t=r)throw t;if(t instanceof DOMException&&t.name===ie){if(!(o>n))throw t;o=Math.max(o/2|0,n)}return[3,4];case 4:return[2,_a3()]}})})},u.label=1; case 1:return u.trys.push([1,2,3,7]),[2,_a3()];case 2:throw u.sent();case 3:return u.trys.push([3,5,,6]),[4,e.transaction(ae,"readwrite").objectStore(ae).clear()];case 4:case 5:return u.sent(),[3,6];case 6:return[7]; case 7:return[2]}})})},e.prototype._claimQuota=function(e,t,n){var r; return te(this,void 0,void 0,function(){var i,o;return ne(this,function(a){switch(a.label){case 0:if("function"!=typeof(null===(r=null===navigator||void 0===navigator?void 0:navigator.storage)||void 0=== r?void 0:r.estimate))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._claimQuotaUsingWebAPI(n)];case 2:return i=a.sent(),[2,Math.min(i,t)];case 3:if((o=a.sent())instanceof Error&&o.name=== ie)throw o;return[3,4];case 4:return[2,this._claimQuotaWithTrials(e,t,n)]}})})},e.getInstance=function(){return X||(X=new e),X},e}(),pe=(_Q=function Q(e,t){return _Q=i()||{__proto__:[]}instanceof Array&& function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_Q(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+ String(t)+" is not a constructor or null"); function n(){this.constructor=e} _Q(e,t),e.prototype=null===t?a()(t):(n.prototype=t.prototype,new n)}),ve=function ve(e,t,n,r){return new (n||(n=u()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},ge=function ge(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof c()&&(o[h()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&h()(t,n,a),a}([g._],e)}(),m=n(34445),_=n(42656),E=n(9608),T=n(97115),b=n(37251),S=n(78914),w=n.n(S),A=n(77766),R=n.n(A),L=n(94198),I=n.n(L),C=function(){function e(){this.type= "TAG",this.name="EXT-X-SESSION-KEY"} var t;return t=e,e.prototype.toString=function(){var e,t=[];if("SAMPLE-AES"===this.value.method){t.push("METHOD\x3d".concat(this.value.method)),t.push('URI\x3d"'.concat(this.value.uri,'"'));var n=this.value.keyFormat|| "identity";t.push('KEYFORMAT\x3d"'.concat(n,'"'));var r=this.value.keyFormatVersions||[1];t.push('KEYFORMATVERSIONS\x3d"'.concat(r.join("/"),'"'))}return w()(e=this.value.unknownAttrs).call(e,function(e){var n; t.push(R()(n="".concat(e.name,"\x3d")).call(n,e.value))}),"#EXT-X-SESSION-KEY:".concat(t.join(","))},e.parse=function(e){var n=e.match(r.Mt); if(!n)return null;try{var o,a=(0,v.Z)(n[1]),s=new t,u=[],l="",c=[1],d="identity";return w()(a).call(a,function(e){var t;switch(e.name){case "KEYFORMAT":d=e.value.replace(r.iP,"$1");break;case "KEYFORMATVERSIONS":c= p()(t=e.value.replace(r.iP,"$1").split("/")).call(t,function(e){return I()(e,10)}); break;case "METHOD":o=e.value;break;case "URI":l=e.value.replace(r.iP,"$1");break;default:u.push(e)}}),"SAMPLE-AES"!==o?i(e):(s.value={uri:l, method:o,keyFormat:d,keyFormatVersions:c,unknownAttrs:u},{statement:s})}catch(t){return i(e)}},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=c()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&h()(t,n,a),a}([g._],e)}(),O=n(9890),P=n(69399),k=n(31238),D=n.n(k),x=function(){function e(){this.type="TAG",this.name="EXT-X-PART-INF"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-PART-INF:PART-TARGET\x3d".concat(this.value)},e.parse=function(e){var n=e.match(r.bp); if(!n)return null;var i=new t;return i.value=D()(n[1]),{statement:i}},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=c()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&h()(t,n,a),a}([g._],e)}(),N=n(84988); function M(e,t,n){for(var r=0,l=[a.p.parse,N.t.parse,b.B.parse,T.r.parse,O.f.parse,y.parse,C.parse,E.O.parse,_._.parse,s.u.parse,u.s.parse,m.t.parse,P.z.parse,x.parse,i,o];r0&&!_.eh.test(i.value.uri)&&(i.value.uri=m()(r="".concat(this._baseUrl)).call(r,i.value.uri))}},e.prototype._updateUriAttributes=function(){for(var e,t=c()(e=this.source).call(e,function(e){var t; return null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.attrs}),n="",r=0,i=t;r=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([u._],e)}()}, 57698:function _(e,t,n){n.d(t,{u:function u(){return p}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(77766),u=n.n(s),l=n(94198),c=n.n(l),d=n(85418),h=n(25916),f=n(12690),p=function(){function e(){this.type="TAG",this.name="EXT-X-BYTERANGE"} var t;return t=e,e.prototype.toString=function(){var e,t,n=void 0!==this.value.byteOffset?"@".concat(this.value.byteOffset):"";return u()(e=u()(t="#EXT-X-BYTERANGE:".concat(this.value.byteLength)).call(t, n,"\n")).call(e,this.value.uri)},e.parse=function(e,n,r){var i=[e, r[n+1]||""].join("\n").match(d.BO);if(!i)return null;var o=new t;return o.value={byteLength:c()(i[1],10),byteOffset:"string"==typeof i[2]?c()(i[2],10):void 0,uri:i[3]},{next:h.Z,statement:o}},t=function(e, t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([f._],e)}()}, 77173:function _(e,t,n){n.d(t,{s:function s(){return l}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(85418),u=n(12690),l=function(){function e(){this.type="TAG",this.name="EXT-X-ENDLIST"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-ENDLIST"},e.parse=function(e){return e.match(s.ju)?{statement:new t}:null},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r= i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([u._],e)}()}, 34445:function _(e,t,n){n.d(t,{t:function t(){return l}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(85418),u=n(12690),l=function(){function e(){this.type="TAG",this.name="EXT-X-INDEPENDENT-SEGMENTS"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-INDEPENDENT-SEGMENTS"},e.parse=function(e){return e.match(s.J0)?{statement:new t}:null},t=function(e,t,n,r){var o,s=arguments.length,u=s<3? t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([u._],e)}()}, 42656:function _(e,t,n){n.d(t,{_:function _(){return m}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(77766),u=n.n(s),l=n(81643),c=n.n(l),d=n(25843),h=n.n(d),f=n(31238),p=n.n(f),v=n(85418),g=n(25916),y=n(12690),m=function(){function e(){this.type="TAG",this.name= "EXTINF"} var t;return t=e,e.prototype.toString=function(){var e,t,n,r,i,o=(t=this.value.duration,isFinite(t)&&Math.floor(t)===t?this.value.duration.toPrecision(6):this.value.duration),a=null!==(e=this.value.title)&& void 0!==e?e:"";return this.value.uri?u()(n=u()(r="#EXTINF:".concat(o,",")).call(r,a,"\n")).call(n,this.value.uri):u()(i="#EXTINF:".concat(o,",")).call(i,a)},e.parse=function(e,n,r){var i,o=[e, r[n+1]||""].join("\n").match(v.fc);if(!o)return null;var a=new t,s=o[3],u=-1===c()(s).call(s,"#EXT-X-BYTERANGE"),l=h()(i=o[2]).call(i)||null;return a.value={duration:p()(o[1]),title:l,uri:u?s:void 0},{next:u? g.Z:void 0,statement:a}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([y._],e)}()}, 9608:function _(e,t,n){n.d(t,{O:function O(){return h}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(2991),u=n.n(s),l=n(1922),c=n(85418),d=n(12690),h=function(){function e(){this.type="TAG",this.name="EXT-X-MAP"} var t;return t=e,e.prototype.toString=function(){var e,t=u()(e=this.value.attrs).call(e,function(e){return e.toString()}); return"#EXT-X-MAP:".concat(t)},e.parse=function(e){var n=e.match(c.Gm); if(!n)return null;var r=(0,l.Z)(n[1]),i=new t;return i.value={attrs:r},{statement:i}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([d._],e)}()}, 97115:function _(e,t,n){n.d(t,{r:function r(){return h}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(2991),u=n.n(s),l=n(1922),c=n(85418),d=n(12690),h=function(){function e(){this.type="TAG",this.name="EXT-X-MEDIA"} var t;return t=e,e.prototype.toString=function(){var e,t=u()(e=this.value.attrs).call(e,function(e){return e.toString()}); return"#EXT-X-MEDIA:".concat(t)},e.parse=function(e){var n=e.match(c.tG); if(!n)return null;var r=(0,l.Z)(n[1]),i=new t;return i.value={attrs:r},{statement:i}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([d._],e)}()}, 37251:function _(e,t,n){n.d(t,{B:function B(){return l}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(85418),u=n(12690),l=function(){function e(){this.type="TAG",this.name="EXT-X-PLAYLIST-TYPE"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-PLAYLIST-TYPE:".concat(this.value)},e.parse=function(e){var n=e.match(s.Jn); if(!n)return null;var r=new t;return r.value=n[1],{statement:r}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([u._],e)}()}, 9890:function _(e,t,n){n.d(t,{f:function f(){return v}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(2991),u=n.n(s),l=n(77766),c=n.n(l),d=n(1922),h=n(85418),f=n(25916),p=n(12690),v=function(){function e(){this.type="TAG",this.name="EXT-X-STREAM-INF"} var t;return t=e,e.prototype.toString=function(){var e,t,n=u()(e=this.value.attrs).call(e,function(e){return e.toString()}); return c()(t="#EXT-X-STREAM-INF:".concat(n,"\n")).call(t,this.value.uri)},e.parse=function(e,n,r){var i=[e, r[n+1]||""].join("\n").match(h.pX);if(!i)return null;var o=(0,d.Z)(i[1]),a=i[i.length-1],s=new t;return s.value={attrs:o,uri:a},{next:f.Z,statement:s}},t=function(e,t,n,r){var o,s=arguments.length,u=s< 3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([p._],e)}()}, 69399:function _(e,t,n){n.d(t,{z:function z(){return d}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(94198),u=n.n(s),l=n(85418),c=n(12690),d=function(){function e(){this.type="TAG",this.name="EXT-X-TARGETDURATION"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-TARGETDURATION:".concat(this.value)},e.parse=function(e){var n=e.match(l.Wj); if(!n)return null;var r=new t;return r.value=u()(n[1],10),{statement:r}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([c._],e)}()}, 84988:function _(e,t,n){n.d(t,{t:function t(){return d}}); var r=n(34074),i=n.n(r),o=n(63978),a=n.n(o),s=n(94198),u=n.n(s),l=n(85418),c=n(12690),d=function(){function e(){this.type="TAG",this.name="EXT-X-VERSION"} var t;return t=e,e.prototype.toString=function(){return"#EXT-X-VERSION:".concat(this.value)},e.parse=function(e){var n=e.match(l.zd); if(!n)return null;var r=new t;return r.value=u()(n[1],10),{statement:r}},t=function(e,t,n,r){var o,s=arguments.length,u=s<3?t:null===r?r=i()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([c._],e)}()}, 12690:function _(e,t,n){function r(e){return e} n.d(t,{_:function _(){return r}})}, 79296:function _(e,t,n){n.d(t,{Z:function Z(){return o}}); var r=n(94473),i=n.n(r);function o(e,t){var n,r;return(null===(r=null===(n=null==e?void 0:e.value)||void 0===n?void 0:n.attrs)||void 0===r?void 0:i()(r).call(r,function(e){return e.name===t}))||null} }, 50507:function _(e,t,n){function r(e){return function(t){return"TAG"===t.type&&t.name===e}} n.d(t,{F7:function F7(){return r}, Lj:function Lj(){return l}, Lx:function Lx(){return s}, UL:function UL(){return i}, _q:function _q(){return o}, nm:function nm(){return u}, sS:function sS(){return a}}); var i=r("EXTINF"),o=r("EXT-X-BYTERANGE"),a=r("EXT-X-STREAM-INF"),s=r("EXT-X-ENDLIST"),u=r("EXT-X-MEDIA"),l=r("EXT-X-PART-INF")}, 39225:function _(e,t,n){n.d(t,{D:function D(){return u}}); var r=n(77149),i=n.n(r),o=n(81643),a=n.n(o),s=[".ts",".m4v",".m4a",".m4i",".m4s",".mp4"];function u(e){return!!e&&i()(s).call(s,function(t){return a()(e).call(e,t)>-1})} }, 62028:function _(e,t,n){n.d(t,{S:function S(){return i}}); var r=n(82903);function i(e){for(var t={},n=0,i=e.replace(/"+/g,"").split(/[ ,]+/);n>2,o=(3&t)<<4|(n=e[l++])>>4,a=(15&n)<<2|(r=e[l++])>>6,s=63&r,isNaN(n)?a=s=64:isNaN(r)&&(s=64),u=u+this._keyStr.charAt(i)+ this._keyStr.charAt(o)+this._keyStr.charAt(a)+this._keyStr.charAt(s);return u}, decode:function decode(e){var t,n,r,i,o,a,s=[],u=0,l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,n=(15&i)<<4|(o=this._keyStr.indexOf(e[u++]))>> 2,r=(3&o)<<6|(a=this._keyStr.indexOf(e[u++])),s[l++]=t,64!=o&&(s[l++]=n),64!=a&&(s[l++]=r);return s}},r.plugout.utf8={encode:function encode(e){e=e.replace(/\r\n/g,"\n"); for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224), t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}, decode:function decode(e){for(var t="",n=0,r=0,i=0;n191&&r<224?(i=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&i),n+=2):(i= e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&i)<<6|63&c3),n+=3);return t}},r.plugout.encrypt_by_key=function(e,t){for(var n=r.plugout.utf8.encode(t),i=[],o=0,a=0;ao.hbTimeout&&(N("HB Timeout check is failed (IOInterval : "+g+", Timeout : "+o.hbTimeout+")"),1)?(N("naver.palyer.healthChecker _onHeartBeat isTimeout"),n.onHeartBeatError({code:f.FAILURE_HB, detail:"FAILURE HB"}),t.stopHeartBeat(),!1):(function(e){var t=r.plugout.common.curry(i.sendPing,i,e,o.timeout,{tabId:u},p);h<=0?(d=!1,h=0):h--;var n;n=d?o.quickHbInterval:o.hbInterval,c&&(clearTimeout(c), c=null),c=setTimeout(t,n)}(l),!v||!v.rt||"pong"!==v.rt&&"msg"!==v.rt&&"multimsg"!==v.rt?(N("naver.palyer.healthChecker _onHeartBeat format error"),y=f.INVALID_FORMAT,"INVALID FORMAT",n.onHeartBeatError({code:y, detail:"INVALID FORMAT"}),!1):(t.updateLastIOTime(),"msg"!=v.rt&&"multimsg"!=v.rt||n.onReceiveMsg(e,v),!0)):(N("naver.palyer.healthChecker _onHeartBeat !_isHealthChecking"),!1);var g,y} return i=e.ajaxObj,t.startHeartBeat=function(e,t,c,d){return!(a||!e||!function(e,t,i,c){return e?(n=e,o=c,a=!0,s=new Date,u=t,l=i,r.plugout.common.logging("Plugout_HealthChecker Options \x3d "+JSON.stringify(o)), !0):(M("naver.plugout.healthChecker init fail. no handler"),!1)}(e,t,c,d)||(i.sendPing(c,o.timeout,{tabId:u},p),0))},t.startQuickHeartBeat=function(){return!!a&&(d=!0,h=o.quickHbCount-1,c&&(clearTimeout(c), c=null),i.sendPing(l,o.timeout,{tabId:u},p),!0)},t.clearQuickHeartBeat=function(){return!!a&&(d=!1,h=0,!0)},t.updateLastIOTime=function(){return!!a&&(s=new Date,!0)},t.stopHeartBeat=function(){return!!a&& (n=null,a=!1,s=null,u=null,l=null,r.plugout.common.logging("Plugout_HealthChecker is finalized"),!0)},t},(r=r||{}).plugout=r.plugout||{},r.plugout.sessionImpl=function(e,t){M("new naver.plugout.sessionImpl"); var n=this,i=null,o=null,a=null,s=null,u=null,l=null,c=r.plugout.constants.socket,d=r.plugout.errorcode.socket;if(!function(e,t){return e?(l=e,o=c.STATE_CLOSED,i=t,r.plugout.common.logging("Plugout_Session conf \x3d "+ JSON.stringify(i)),!0):(N("naver.plugout.sessionImpl _initialize !ajaxObj"),!1)}(e,t))throw x("naver.plugout.sessionImpl _initialize error. Invalid conf"),new Error(-1,"Invalid conf"); function h(e){var t={text:JSON.stringify(e)};return"function"==typeof n.onmessage&&setTimeout(function(){n.onmessage(t)},0),!0} function f(e,t){var r={code:e,detail:t};return x("naver.plugout.sessionImpl _handleError ".concat(JSON.stringify(r))),"function"==typeof n.onerror&&setTimeout(function(){n.onerror(r)},0),e!=d.INVALID_AUTHKEY&& e!=d.FAILURE_HB||p({code:c.CLOSE_ERROR}),!0} function p(e){o=c.STATE_CLOSED,s=null,u&&(u.stopHeartBeat(),u=null),"function"==typeof n.onclose&&setTimeout(function(){n.onclose(e)},0)} return n.onReceiveMsg=function(e,t){return e.code!=c.SUCCESS?(f(e.code,e.detail),!0):t&&t.rt&&t.rslt&&"false"!==t.rslt?"multimsg"==t.rt?(u.clearQuickHeartBeat(),t.param?(function(e){for(var t=0;t65535)return!1;a.url=e.url||"http://127.0.0.1", a.portcount=e.portcount||1,a.enableHB=e.enableHB||!0,a.enableEncrypt=e.enableEncrypt,"boolean"!=typeof a.enableEncrypt&&(a.enableEncrypt=!0),a.ports=[];for(var n=0;n-1}, isEdge:function isEdge(){return"undefined"!=typeof navigator&&/edge\/\d+/i.test(navigator.userAgent)}, isNewEdge:function isNewEdge(){return"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("edg")>-1}, isOpera:function isOpera(){return"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().match(/opera|opr\//)}, isChrome:function isChrome(){return"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().match(/chrom(e|ium)\//)&&!r.plugout.browser.isOpera()&&!r.plugout.browser.isEdge()&&!r.plugout.browser.isWhale()}, isAboveChrome99:function isAboveChrome99(){var e=/Chrome\/(\d+)./.exec(navigator.userAgent);return!!e&&parseInt(e[1],10)>=99}, isFirefox:function isFirefox(){return"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1}}; var F={EXT_ID:r.plugout.browser.isWhale()?"jielicmbabjkjaeffodlffnaiiflnphp":r.plugout.browser.isNewEdge()?"jedbgfnhnpbfcbplibkacnmiafbojobk":"ooadnieabchijkibjpeieeliohjidnjj",EXT_URL:r.plugout.browser.isWhale()? "https://store.whale.naver.com/detail/jielicmbabjkjaeffodlffnaiiflnphp":r.plugout.browser.isNewEdge()?"https://microsoftedge.microsoft.com/addons/detail/jedbgfnhnpbfcbplibkacnmiafbojobk":"https://chrome.google.com/webstore/detail/ooadnieabchijkibjpeieeliohjidnjj", DLG_ID:"ext_dlg",INSTALLED:0,NOT_INSTALLED:-1,NOT_EXT_INSTALLED:-2,NOT_ALLOWED_DOMAIN:-5,isInstall:function isInstall(e,t,n){var i=function i(t){if(M("Extension completion sendMessage(svc\x3dinstall)"), null==t){if(null!=n){if(M("popup !\x3d null. showDialog"),null==n.autoClose)var i=!1;else i=n.autoClose;var o=n.title,a=n.text,s=n.button;r.extension.showDialog(i,o,a,s)}null!=e&&(M("naver.extension.NOT_EXT_INSTALLED"), e(r.extension.NOT_EXT_INSTALLED,r.extension.EXT_URL))}else"install"==t&&(null!=n&&(M("popup !\x3d null. hideDialog"),r.extension.hideDialog()),null!=e&&(M("naver.extension.INSTALLED"),e(r.extension.INSTALLED)))}; if(null!=window.location.ancestorOrigins){var o=window.location.ancestorOrigins.length,a=o>0?window.location.ancestorOrigins[o-1]:window.location.href;if(!(a.match(/^https?:\/\/([^\/]+\.)?nhncorp\.com(\/|$)*/i)|| a.match(/^https?:\/\/([^\/]+\.)?navercorp\.com(\/|$)*/i)||a.match(/^https?:\/\/([^\/]+\.)?naver\.com(\/|$)*/i)))return void(null!=e&&(M("naver.extension.NOT_ALLOWED_DOMAIN"),e(r.extension.NOT_ALLOWED_DOMAIN)))}if(null== chrome.runtime)return M("chrome.runtime is undefined"),void i();M('chrome.runtime.sendMessage(ext\x3d"'.concat(r.extension.EXT_ID,'", { svc\x3dinstall })')),chrome.runtime.sendMessage(r.extension.EXT_ID, {svc:"install"},i)}, setOnMessage:function setOnMessage(e){M("setOnMessage"),window.addEventListener("message",e)}, sendMessage:function sendMessage(e,t,n){M('chrome.runtime.sendMessage(ext\x3d"'.concat(r.extension.EXT_ID,'", {svc\x3d').concat(e,", ver\x3d").concat(t,", param\x3d").concat(JSON.stringify(n),"})")),chrome.runtime.sendMessage(r.extension.EXT_ID, {svc:e,ver:t,param:n},function(e){M("chrome.runtime.sendMessage callback: ".concat(JSON.stringify(e)))})}, hideDialog:function hideDialog(){var e=document.getElementById(r.extension.DLG_ID);null!=e&&(e.style.display="none")}, openLink:function openLink(){window.open(r.extension.EXT_URL),r.extension.hideDialog()}, showDialog:function showDialog(e,t,n,i){if(null==document.getElementById(r.extension.DLG_ID)){var o=".ly_pop{display:block;position:fixed;left:50%;z-index:1001;padding:36px 20px 34px;background:#fff;border:1px solid #74787e;font-family:'\ub098\ub214\uace0\ub515',NanumGothic,Dotum,AppleGothic,sans-serif;font-size:12px;color:#000;text-align:center}\t\t\t\t\t.ly_pop .ly_header{position:relative}\t\t\t\t\t.ly_pop .title{font-size:14px;line-height:21px;color:#000}\t\t\t\t\t.ly_pop .title em{color:#298cdd}\t\t\t\t\t.ly_pop .text{margin:7px 0 16px;line-height:18px;color:#666}\t\t\t\t\t.ly_pop .btn_confirm{display:inline-block;width:auto;height:25px;padding:0 19px;border:0;border-top:1px solid #19aae2;border-bottom:1px solid #1593c4;background:#2DB400;font-weight:bold;line-height:26px;color:#fff;text-align:center;text-decoration:none}\t\t\t\t\t.ly_pop .btn_close{display:block;overflow:hidden;position:absolute;top:3px;right:3px;width:19px;height:19px;background:url(http://static.naver.net/software/2013/04/sp_bu.png) 3px -737px no-repeat;text-indent:-9999px}\t\t\t\t\t.dimmed{position:fixed;top:0;left:0;z-index:1000;width:100%;height:100%;background-color:#000;opacity: .5;filter:alpha(opacity\x3d50)}", a=document.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=o:a.appendChild(document.createTextNode(o)),document.getElementsByTagName("head")[0].appendChild(a);var s=document.createElement("div"), u=r.plugout.browser.isWhale()?"\uc6e8\uc77c":"\ud06c\ub86c",l=r.plugout.browser.isWhale()?"\uc6e8\uc77c \uc2a4\ud1a0\uc5b4":"\ud06c\ub86c \uc6f9\uc2a4\ud1a0\uc5b4";s.id=r.extension.DLG_ID,s.innerHTML="\x3cdiv class\x3d'ly_pop' style\x3d'display:block;width:420px;margin-left:-230px;top:30%;'\x3e\t\t\t\t\t\t\t\t\t\t\t\t\x3cdiv class\x3d'ly_header'\x3e\t\t\t\t\t\t\t\t\t\t\t\t\t\x3cstrong class\x3d'title'\x3e"+ (null==t?"\uc11c\ube44\uc2a4 \uc774\uc6a9\uc744 \uc704\ud574 "+u+" \ud655\uc7a5 \ud504\ub85c\uadf8\ub7a8 \uc124\uce58\uac00 \ud544\uc694\ud569\ub2c8\ub2e4.":t)+"\x3c/strong\x3e\t\t\t\t\t\t\t\t\t\t\t\t\t\x3cp class\x3d'text'\x3e"+ (null==n?(null==i?"\ud655\uc778":i)+" \ubc84\ud2bc\uc744 \ub204\ub974\uba74 "+l+"\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4.":n)+"\x3c/p\x3e"+(1==e?"\x3ca href\x3d'#' onclick\x3d'naver.extension.openLink(); return false;' class\x3d'btn_confirm'\x3e"+ (null==i?"\ud655\uc778":i)+"\x3c/a\x3e":"\x3ca href\x3d'"+r.extension.EXT_URL+"' target\x3d'_blank' class\x3d'btn_confirm'\x3e\ud655\uc778\x3c/a\x3e")+"\x3c/div\x3e\t\t\t\t\t\t\t\t\t\t\t\t\x3ca href\x3d'#' onclick\x3d'naver.extension.hideDialog(); return false;' class\x3d'btn_close'\x3e\ub2eb\uae30\x3c/a\x3e\t\t\t\t\t\t\t\t\t\t\t\x3c/div\x3e\t\t\t\t\t\t\t\t\t\t\t\x3cdiv class\x3d'dimmed' id\x3d'home_dimmed' style\x3d'display:block'\x3e\x3c/div\x3e", document.body.appendChild(s)}var c=document.getElementById(r.extension.DLG_ID);null!=c&&(c.style.display="block")}},B={INSTALLED:0, NOT_INSTALLED:-1,NOT_EXT_INSTALLED:-2,NOT_ALLOWED_DOMAIN:-5,CONNECTING:-3,RE_CONNECT:-4,ENCODE_KEY:"8EDD7B56DB9540E6BE7487A6D3FE196E",DEFAULT_INIT_TIMEOUT:1E4,DEFAULT_SESSION_TIMEOUT:3E4,DEFAULT_IDLE_TIMEOUT:3E4, DEFAULT_PORT_COUNT:3,socket:null,callback:null,socketParam:null,msgListener:null,installed:!1,listener:{onconnected:function onconnected(e){r.plugout.common.logging("naver.extension.socket.onconnected"), r.extension.installed=!0,r.extension.callback(r.extension.INSTALLED)}, onerror:function onerror(e){x("naver.extension.socket.onerror : (code :"+e.code+")"),5011==e.code&&r.extension.callback(r.extension.NOT_INSTALLED)}, onclose:function onclose(e){if(U("naver.extension.socket.onclose : "+e.code),-1==e.code){if(r.extension.socket.state()==r.plugout.constants.socket.STATE_CONNECTED)return;1==r.extension.installed&&r.extension._launchUrl()}}, onmessage:function onmessage(e){r.plugout.common.logging("naver.extension.socket.onmessage : "+e.text);try{r.extension.msgListener({data:e.text})}catch(e){x("naver.extension.socket.onmessage error"),r.plugout.common.logging(e)}}}, _launchUrlProtocolWithIframe:function _launchUrlProtocolWithIframe(e){try{if(M("launchUrlProtocolWithIframe called"),document.getElementById("plugoutUrlScheme"))M("plugoutUrlScheme.src\x3d".concat(e)), document.getElementById("plugoutUrlScheme").src=e;else{var t=document.createElement("div");if(t){var n=e.replace('"','"');M("Appending iframe.src\x3d".concat(n)),t.innerHTML='\x3cdiv style\x3d"display:none;"\x3e\x3ciframe id\x3d"plugoutUrlScheme"\x3e\x3c/iframe\x3e\x3c/div\x3e', document.body.appendChild(t),document.getElementById("plugoutUrlScheme").src=n}}r.extension.socket.connect()}catch(e){x("_launchUrlProtocolWithIframe error : "+e.message)}}, _launchUrlProtocolWithMsLaunchUriEdge:function _launchUrlProtocolWithMsLaunchUriEdge(e){M("launchUrlProtocolWithMsLaunchUriEdge called"),navigator&&void 0!==navigator.msLaunchUri?(M("navigator.msLaunchUri (url\x3d".concat(e, ")")),navigator.msLaunchUri(e,function(){},function(){}),r.extension.socket.connect()):x("navigator.msLaunchUri is undefined")}, _launchUrlProtocolWithMsLaunchUri:function _launchUrlProtocolWithMsLaunchUri(e){M("launchUrlProtocolWithMsLaunchUri called"),navigator&&void 0!==navigator.msLaunchUri?(M("navigator.msLaunchUri (url\x3d".concat(e, ")")),navigator.msLaunchUri(e,function(){M("msLaunchUri success"),r.extension.socket.connect()},function(){x("msLaunchUri failed"),r.extension.callback(r.extension.NOT_INSTALLED)})):x("navigator.msLaunchUri is undefined")}, _launchUrl:function _launchUrl(){M("naver.socket.launchUrl");var e=r.extension.socketParam;(null==e.initTimeout||e.initTimeout<=0)&&(e.initTimeout=r.extension.DEFAULT_INIT_TIMEOUT),(null==e.sessionTimeout|| e.sessionTimeout<=0)&&(e.sessionTimeout=r.extension.DEFAULT_SESSION_TIMEOUT),(null==e.idleTimeout||e.idleTimeout<=0)&&(e.idleTimeout=r.extension.DEFAULT_IDLE_TIMEOUT);var t="s^"+e.startPort+"\x26n^"+e.portCount+ "\x26x^"+e.initTimeout+"\x26y^"+e.sessionTimeout+"\x26z^"+e.idleTimeout+"\x26e^"+(e.encrypt?"y":"n"),n=e.protocol+":///p^"+r.plugout.encrypt_by_key(r.extension.ENCODE_KEY,t)+e.execute;n=encodeURI(n),r.plugout.common.logging("url : "+ n),1==r.plugout.browser.isEdge()?r.extension._launchUrlProtocolWithMsLaunchUriEdge(n):r.plugout.browser.isFirefox()||r.plugout.browser.isOpera()||r.plugout.browser.isChrome()?r.extension._launchUrlProtocolWithIframe(n): r.extension._launchUrlProtocolWithMsLaunchUri(n)}, isInstall:function isInstall(e,t){if(null!=e){if(null==t)return N("proxy \x3d\x3d null, naver.extension.NOT_INSTALLED"),void e(r.extension.NOT_INSTALLED);if(null==t.protocol)return N("proxy.protocol \x3d\x3d null, naver.extension.NOT_INSTALLED"), void e(r.extension.NOT_INSTALLED);if(null==t.startPort)return N("proxy.startPort \x3d\x3d null, naver.extension.NOT_INSTALLED"),void e(r.extension.NOT_INSTALLED);if(null!=t.portCount&&0!=t.portCount||(t.portCount= r.extension.DEFAULT_PORT_COUNT),null==t.encrypt&&(t.encrypt=!0),null!=r.extension.socket&&r.extension.socket.state()==r.plugout.constants.socket.STATE_CONNECTED)return M("naver.extension.socket.state\x3dSTATE_CONNECTED, naver.extension.INSTALLED"), void e(r.extension.INSTALLED);r.extension.callback=e,null==r.extension.socket?(M("naver.extension.socket \x3d\x3d null, new socket and call _launchUrl"),r.extension.socketParam=t,r.extension.socket=r.session({url:"http://127.0.0.1", port:t.startPort,portcount:t.portCount,enableEncrypt:t.encrypt,connectionTimeout:1E4,hbInterval:1E3,quickHbInterval:100,quickHbCount:5,timeout:5E3,async:!0}),r.extension.socket.onconnected=r.extension.listener.onconnected, r.extension.socket.onerror=r.extension.listener.onerror,r.extension.socket.onclose=r.extension.listener.onclose,r.extension.socket.onmessage=r.extension.listener.onmessage,r.extension._launchUrl()):(null== t.autoRefresh||null==t.autoRefresh||t.autoRefresh)&&(M("proxy.autoRefresh"),r.extension._launchUrl())}else N("callback \x3d\x3d null")}, setOnMessage:function setOnMessage(e){(r.plugout.browser.isChrome()||r.plugout.browser.isWhale()||r.plugout.browser.isNewEdge())&&r.plugout.browser.isAboveChrome99()?(M("add onmessage listener"),window.addEventListener("message", e)):(M("set naver.extension.msgListener"),r.extension.msgListener=e)}, sendMessage:function sendMessage(e,t,n){var i=new Object;n.svc=e,n.ver=t,i.param=n,U("naver.extension.sendMessage : "+JSON.stringify(i)),r.extension.socket.send(i)}}; "undefined"==typeof window||void 0!==window.naver&&null!=window.naver||(window.naver={}),(r.plugout.browser.isWhale()||r.plugout.browser.isChrome()||r.plugout.browser.isNewEdge())&&r.plugout.browser.isAboveChrome99()|| function(e){var t,n,r,i,o=0;try{o+=/\[native code\]/.test(null===(n=null===(t=e.chrome)||void 0===t?void 0:t.csi)||void 0===n?void 0:n.toString())?1:0,o+=/\[native code\]/.test(null===(i=null===(r=e.chrome)|| void 0===r?void 0:r.loadTimes)||void 0===i?void 0:i.toString())?1:0,o+=void 0!==e.webkitResolveLocalFileSystemURL?1:0}catch(e){}return o>=2}("undefined"!=typeof window?window:{})?r.extension=F:r.extension= B; var V=r.extension.isInstall,H=r.extension.sendMessage,j=r.extension.setOnMessage,G=n(76596),K=n(3579),z=function z(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t, n):r;if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a): o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},W=function W(e,t,n,r){return new (n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},q=function q(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(r+=1),"undefined"!=typeof window&&function(e){var t,n,r,i,o=0;try{o+=/\[native code\]/.test(null=== (n=null===(t=e.chrome)||void 0===t?void 0:t.csi)||void 0===n?void 0:n.toString())?1:0,o+=/\[native code\]/.test(null===(i=null===(r=e.chrome)||void 0===r?void 0:r.loadTimes)||void 0===i?void 0:i.toString())? 1:0,o+=void 0!==e.webkitResolveLocalFileSystemURL?1:0}catch(e){}return o>=2}(window)&&(r+=1),r>0?X:Q} function ee(e){var t=null===e?(0,S.ST)():e;return $(t)===X&&function(e){var t,n="windows"===(null===(t=(0,S.os)())||void 0===t?void 0:t.toLowerCase());return e?n||function(){try{var e=(0,R.t$)();return e.includes(" Direct3D")|| e.includes("(WDDM)")||e.includes("Microsoft Basic Render Driver")}catch(e){return null}}()?X:Q:n?X:Q}(t)===X?X:Q} var te=function(){function e(){var e;this._message$=new a.xQ,t.INSTANCE=this,e=o(),D=e,j(this._onMessage.bind(this))} var t;return t=e,e.getState=function(e,n){var r,i;return void 0===e&&(e="real"),W(this,void 0,void 0,function(){var o,a,s,u;return q(this,function(l){switch(l.label){case 0:return ee(null!==(i=null===(r= null==n?void 0:n.experimentals)||void 0===r?void 0:r.testUserAgentString)&&void 0!==i?i:Y.experimentals.testUserAgentString)===J[0]?[2,Promise.resolve(-1E3)]:[4,(o=t.getInstance()).getExtensionState(e)]; case 1:return 0!==(a=l.sent())?[2,a]:[4,t.getClientState()];case 2:if(0!==(s=l.sent()))return[2,s];if(!(null==n?void 0:n.serviceMinVersion))return[3,6];l.label=3;case 3:return l.trys.push([3,5,,6]),[4, o._verifyClientVersion(n.serviceMinVersion).toPromise()];case 4:return l.sent(),[3,6];case 5:switch(u=l.sent(),!0){case "LiveConnector is failed to launch"===u:return[2,0];case u instanceof I.DT&&"NEED_UPDATE"=== u.code:return[2,-2147483646];case u instanceof I.DT&&"NO_VERSION_INFO"===u.code:return[2,-2147483645];default:throw u;}return[3,6];case 6:return[2,s]}})})},e.prototype.getExtensionState=function(e){return void 0=== e&&(e="real"),W(this,void 0,void 0,function(){var t; return q(this,function(n){return t=(0,k.v)(e),[2,new Promise(function(e){V(function(t){return e(t)},new O(t))})]})})},e.prototype._getChannelAddrAsync=function(){var e=this; return(0,s.P)(function(){return H(L.Z.serviceId,L.Z.proxyVersion,{cmd:"getChannelAddr"}),e._message$.pipe((0,h.h)(Z("getChannelAddr")),(0,f.U)(function(e){if("error"===e.command)throw e.value;return e.raw}), (0,p.q)(1))})},e.getClientState=function(){return W(this,void 0,void 0,function(){var e,n; return q(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.getInstance()._isInstall().pipe((0,p.q)(1)).toPromise()];case 1:return e=r.sent(),U("clientState:".concat(e)),e?[2,0]: [2,-1];case 2:if("LiveConnector No Installed"===(n=r.sent()))return[2,-1];throw x("".concat(n)),n;case 3:return[2]}})})},e.getProtocolType=function(e){var t,n=null===e?(0,S.ST)():e; switch(null===(t=(0,S.Xh)())||void 0===t?void 0:t.toLowerCase()){case "chrome":case "whale":case "samsung browser":return(0,S.vu)()<99?P.m.URL_SCHEME:P.m.NATIVE_MESSAGING;case "edge":return"undefined"!= typeof navigator&&navigator.userAgent.toLowerCase().indexOf("edg")>-1?(0,S.vu)()<99?P.m.URL_SCHEME:P.m.NATIVE_MESSAGING:P.m.URL_SCHEME;default:return $(n)===X?P.m.URL_SCHEME:P.m.UNSUPPORTED}},e.p2pClientDownloadUrl= function(e){return void 0===e&&(e="real"),L.Z.getSetupFileUrl((0,k.v)(e))},Object.defineProperty(e,"extensionStoreUrl",{get:function get(){return F.EXT_URL}, enumerable:!1,configurable:!0}),e.setConfigUrl=function(e){t.getInstance()._configUrl=e},e.setExtensionEnv=function(e){var t,n,r,i; "undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("whale")>-1?(t="NLIVE_CONNECTOR_WHALE_EXTENSION_ID",n="NLIVE_CONNECTOR_WHALE_EXTENSION_URL"):"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("edg")> -1?(t="NLIVE_CONNECTOR_EDGE_CR_EXTENSION_ID",n="NLIVE_CONNECTOR_EDGE_CR_EXTENSION_URL"):(t="NLIVE_CONNECTOR_CHROME_EXTENSION_ID",n="NLIVE_CONNECTOR_CHROME_EXTENSION_URL");try{var o=(0,G.S)(e,t),a=(0,G.S)(e, n);i=o,F.EXT_ID=i,r=a,F.EXT_URL=r}catch(e){console.error(e)}},e.getInstance=function(){return t.INSTANCE||(t.INSTANCE=new t),this.INSTANCE},e.prototype.prepare=function(e,n){var r=this; void 0===e&&(e="real");var i=(0,k.v)(e);return(0,u.of)("prepare").pipe((0,v.w)(function(){return r._isLauncherInstall(i)}),(0,v.w)(function(){return r._isInstall()}),(0,v.w)(function(){return r._launch(i)}), (0,v.w)(function(){return r._waitForReady(i)}),(0,v.w)(function(){return r._getHlsPort()}),(0,v.w)(function(e){var r=t.convertHlsUrl(n,e); return(0,u.of)(r)}))},e.convertHlsUrl=function(e,t){void 0===t&&(t=17080); var n=e.indexOf("?"),r="http://localhost:".concat(t).concat(e.substr(0,n+1)),i=encodeURIComponent(e.substr(n+1).split("\x26").map(function(e){var t=e.indexOf("\x3d"),n=e.substr(0,t),r=e.substr(t+1);return"".concat(n, "\x3d").concat(encodeURIComponent(r))}).join("\x26")); return"".concat(r).concat(i)},e.createEventStream=function(e,t){var n=(0,w.Z)(decodeURIComponent(e.substring(e.indexOf("?")+1))),r=new URL("/api/v1/qoe",e); return r.searchParams.set("channel_id",n.channel_id),new C.N(r.toString(),t)},e.parseVersionString=function(e){var t=e.split(".").map(Number); if(4!==t.length||t.some(isNaN))return 0;var n=t.map(function(e){return 255&e}); return n[0]<<24|n[1]<<16|n[2]<<8|n[3]},e.prototype._onMessage=function(e){var t,n; try{n=JSON.parse(e.data)}catch(t){return void x("".concat(t,"\ndata\x3d").concat(JSON.stringify(e)))}if(n.err){var r=null!==(t=I.H9[n.errCode])&&void 0!==t?t:"Unexpected error";return x("".concat(JSON.stringify(n))), void this._message$.next({command:"error",value:r,raw:n})}U("".concat(JSON.stringify(n))),this._message$.next({command:n.cmd,value:n.rslt,raw:n})},e.prototype._isLauncherInstall=function(e){return new l.y(function(t){V(function(e){switch(e){case 0:t.next(e), t.complete(); break;case -1:t.error("Launcher is not installed");break;case -2:t.error("Extension is not installed");break;default:t.error("Unexpected Launcher State")}},new O(e))})},e.prototype._isInstall=function(){var e= "isInstall"; return H(L.Z.serviceId,L.Z.proxyVersion,{cmd:e}),this._message$.pipe((0,h.h)(Z(e)),(0,f.U)(function(e){if("error"===e.command)throw e.value;return"true"===e.value}),(0,p.q)(1))},e.prototype._launch=function(e){var t, n="launchNative",r=null!==(t=this._configUrl)&&void 0!==t?t:L.Z.getConfigUrl(e),i=L.Z.getUpdateUrl(e); return H(L.Z.serviceId,L.Z.proxyVersion,{cmd:n,config:r,update:i}),this._message$.pipe((0,h.h)(Z(n)),(0,f.U)(function(e){if("true"===e.value)return!0;throw"LiveConnector is failed to launch";}),(0,p.q)(1))}, e.prototype._waitForReady=function(e){var n,r,i=this,o="getLiveConnectorStatus"; return(0,c.H)(0,null!==(n=(0,G.S)(e,"NLIVE_CONNECTOR_STATUS_CHECK_INTERVAL"))&&void 0!==n?n:t.STATUS_INTERVAL_TIME_MS).pipe((0,g.b)(function(e){r=e%t.RETRY_TO_LAUNCH_COUNT,H(L.Z.serviceId,L.Z.proxyVersion, {cmd:o})}),(0,y.c)(this._message$),(0,h.h)(function(e){return e.command===o}),(0,f.U)(function(e){return e.value}),(0,v.w)(function(n){if("-1"===n)throw"LiveConnector No Installed"; if(void 0===n)throw"Unexpected Live Connector State";return r===t.RETRY_TO_LAUNCH_COUNT-1?i._launch(e).pipe((0,m.h)(n)):(0,u.of)(n)}),(0,h.h)(function(e){return"2"===e}),(0,_.P)())},e.prototype._verifyClientVersion= function(e){return this._getChannelAddrAsync().pipe((0,v.w)(function(n){return n.engineVersion?t.parseVersionString(n.engineVersion)0}),(0,p.q)(1),(0,g.b)(function(){t.unsubscribe()}))},e.STATUS_INTERVAL_TIME_MS=1E3, e.RETRY_TO_LAUNCH_COUNT=5,e.DEFAULT_STATE_QUERY_OPTIONS=Y,z([(0,A.z)(205)],e.prototype,"getExtensionState",null),z([(0,A.z)(211)],e.prototype,"prepare",null),z([(0,A.z)(212)],e.prototype,"_isLauncherInstall", null),z([(0,A.z)(213)],e.prototype,"_isInstall",null),z([(0,A.z)(214)],e.prototype,"_launch",null),z([(0,A.z)(215)],e.prototype,"_waitForReady",null),z([(0,A.z)(216)],e.prototype,"_getHlsPort",null),z([(0, A.z)(218)],e,"getState",null),z([(0,A.z)(206)],e,"getClientState",null),z([(0,A.z)(210)],e,"getProtocolType",null),z([(0,A.z)(217)],e,"createEventStream",null),t=z([(0,K.Pv)("LiveConnector")],e)}()}, 93989:function _(e,t,n){var r,i,o,a=n(76596),s=((r={}).real="https://apis.naver.com/livecloud/livecloud/xray/p2p/v1/config/default",r),u=({}.real="https://appdown.pstatic.net/naver/nliveconnector/NLiveConnectorSetup.exe", (i={}).real="http://appdown.naver.com/naver/nliveconnector/upgrade/VersionInfo_Proxy.xml",i),l=((o={}).real="http://appdown.naver.com/naver/nliveconnector/upgrade/VersionInfo.xml",o),c=function(){function e(){} return e.getSetupFileUrl=function(e){var t=(0,a.S)(e,"NLIVE_CONNECTOR_SETUP_URL");if(!t)throw new Error("No setup url for env: ".concat(e));return t},e.getConfigUrl=function(e){return(0,a.S)(e,"NLIVE_CONNECTOR_CONFIG_URL")|| s.real},e.getUpdateUrl=function(e){return(0,a.S)(e,"NLIVE_CONNECTOR_VERSION_INFO_URL")||l.real},e.getProxyVersionInfoPath=function(e){return(0,a.S)(e,"NLIVE_CONNECTOR_VERSION_INFO_PROXY_URL")||u.real}, e.serviceId="nliveconnector",e.proxyVersion="1.0.0.0",e}(); t.Z=c}, 46266:function _(e,t,n){n.d(t,{DT:function DT(){return s}, H9:function H9(){return a}}); var _r14,i,o=(_r14=function r(e,t){return _r14=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&& (e[n]=t[n])},_r14(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r14(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}); !function(e){e.UNEXPECTED_LAUNCHER_STATE="Unexpected Launcher State",e.UNEXPECTED_LIVE_CONNECTOR_STATE="Unexpected Live Connector State",e.EXT_NOT_INSTALLED="Extension is not installed",e.LAUNCHER_NOT_INSTALLED= "Launcher is not installed",e.LIVE_CONNECTOR_NOT_INSTALLED="LiveConnector No Installed",e.LIVE_CONNECTOR_FAILED_TO_LAUNCH="LiveConnector is failed to launch",e.FAILED_TO_GET_HLS_PORT="Failed to get HLS port", e.MISSING_ESSENTIAL_KEY="Missing essential key",e.FAILED_TO_PARSE_JSON="Failed to parse json",e.UNEXPECTED_ERROR="Unexpected error",e.NEED_UPDATE="NEED_UPDATE",e.NO_VERSION_INFO="NO_VERSION_INFO"}(i||(i= {})); var a={1E3:"LiveConnector No Installed",1001:"Missing essential key",1002:"Failed to parse json"},s=function(e){function t(t,n){var r=this.constructor,i=e.call(this,t)||this;return i.name="LiveConnectorException", i.code=n,Object.setPrototypeOf(i,r.prototype),i} return o(t,e),t}(Error)}, 32529:function _(e,t,n){n.d(t,{N:function N(){return g}, U:function U(){return h}}); var r=n(43001),i=n(16686),o=n(6103),a=n(77766),s=n.n(a),u=n(3649),l=n.n(u);function c(e,t){if(e.length<=1)return e;var n=Math.floor(e.length/2),r=l()(e).call(e,0,n),i=l()(e).call(e,n);return function(e, t,n){for(var r=[],i=0,o=0;i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}; !function(e){e.BROKEN_CHANNEL="RETRY_COUNT_EXCEED_ERROR_TOLERANCES",e.P2P_INTERNAL_ERROR="P2P_INTERNAL_ERROR",e.BAD_REQUEST="BAD_REQUEST",e.NOT_SUPPORTED="NOT_SUPPORTED",e.INVALID_RESPONSE="INVALID_RESPONSE"}(h|| (h={})); var g=function(e){function t(t,n){var r=e.call(this)||this;return r._request=function(){r._pending.aborted||r._pending.abort(),r._pending.run()},r.url=t,r._maxRetries=n.maxRetries,r._requestDelay=n.delay, r._trials=0,r._invalidResponseTrials=0,r._timerId=-1,r._connected=!1,r._version=null,r._pending=new o.a(r.url,{responseType:"json"}),r._pending.addListener(r),r._request(),r} return p(t,e),Object.defineProperty(t.prototype,"version",{get:function get(){return this._version}, enumerable:!1,configurable:!0}),t.prototype.close=function(){clearTimeout(this._timerId),this._timerId=-1,this._pending.abort()},t.prototype._scheduleRequest=function(){this._timerId=window.setTimeout(this._request, this._requestDelay)},t.prototype.onSuccess=function(e,t){var n=this; this._trials=0,this._connected||(this._connected=!0,this._version=t.getResponseHeader("x-nliveconnector-version"),this.dispatchEvent(new r.x("open",{cancelable:!1}))),e&&Array.isArray(e.events)?(this._invalidResponseTrials= 0,c(e.events,function(e,t){return e.timestamp-t.timestamp}).forEach(function(e){n.dispatchEvent(new r.x("message",{detail:e}))}),this._scheduleRequest()):this._handleInvalidResponse()},t.prototype._handleInvalidResponse= function(){this._invalidResponseTrials++,this._invalidResponseTrials===this._maxRetries&&this.dispatchEvent(new r.x("error",{detail:h.INVALID_RESPONSE, cancelable:!1})),this._scheduleRequest()},t.prototype.onError=function(e){var t; switch(null===(t=e.detail)||void 0===t?void 0:t.errorMsg){case null:return void this._handleUnknownError(e);case "no channel id":return void this._handleNoChannelIdError();case "no channel":this._handleNoChannelError(); break;default:if(this._connected&&0===e.status)return void this.dispatchEvent(new r.x("error",{detail:h.BROKEN_CHANNEL,cancelable:!1}));this._trials++,this._trials0&&i.push(new l.Z("BANDWIDTH","".concat(o)));var a=e.buildCodecs(t);return a.length>0&&i.push(new l.Z("CODECS",'"'.concat(a.join(","),'"'))),t.videoWidth&&t.videoHeight&&i.push(new l.Z("RESOLUTION","".concat(t.videoWidth, "x").concat(t.videoHeight))),t.videoFrameRate&&i.push(new l.Z("FRAME-RATE",Number(t.videoFrameRate).toFixed(2))),r.value={attrs:i,uri:(new URL(t.p2pPath,n)).toString()},r},e.buildCodecs=function(e){var t= []; if("H264"===e.videoCodec){var n=Number(e.videoHeight)||0;t.push(n>=1080?"avc1.64002A":"avc1.640028")}var r={AAC:"mp4a.40.2",AC3:"ac-3"};return e.audioCodec&&r[e.audioCodec]?t.push(r[e.audioCodec]):e.audioBitRate&& t.push("mp4a.40.2"),t},e}(),f=n(69901),p=n(42798),v=function v(e,t,n,r){return new (n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},g=function g(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0?decodeURIComponent(l.slice(d+1)):"",v="nliveconnector:abr-master/".concat(encodeURIComponent(a),"/index.m3u8"), [4,this._caches.put(v,f)]):[3,4];case 3:g.sent(),c=v,g.label=4;case 4:return y=r[0],_=y.videoCodec,E=y.audioCodec,T=m,[2,new o.h(t,a,{label:"ABR",selected:!1,id:T,width:Number(y.videoWidth),height:Number(y.videoHeight), videoCodec:_,audioCodec:E,kind:p.c.LOW_LATENCY_P2P,src:c,encodingOptionID:"abr"})];case 5:return b=g.sent(),i().mark(this,"p2p.abr.track.failed",{reason:"Failed to prepare P2P URL",error:b.message}),[2, null];case 6:return[2]}})})},e.prototype.prepareTracks=function(e,t,n,r){var i,o; return v(this,void 0,void 0,function(){var s;return g(this,function(u){switch(u.label){case 0:return(null===(o=null===(i=null===a.R||void 0===a.R?void 0:a.R.experimental)||void 0===i?void 0:i.nliveconnector)|| void 0===o?void 0:o.p2pMasterGeneratorEnabled)?[4,this.createP2PABRTrack(n,r)]:[2,null];case 1:return(s=u.sent())?[2,{videoTracks:y([s],e,!0),audioTracks:t}]:[2,{videoTracks:e,audioTracks:t}]}})})},e.prototype._prepareP2PUrl= function(e,t){return new Promise(function(n,r){var i=s.ZP.getInstance().prepare(e,t).subscribe({next:function next(e){i.unsubscribe(),n(e)}, error:function error(e){i.unsubscribe(),r(e)}})})},e.prototype.setCurrentEventStream=function(e){this.closeEventStream(),this._eventStream=e; for(var t=0,n=this._eventListeners;t=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([(0,f.z)(242)],e.prototype,"createP2PABRTrack",null),e}(),T=new WeakMap,b={getInstance:function getInstance(e){if(!e)throw new Error("P2PTrackManager.getInstance requires a target"); var t=T.get(e);return t||(t=new E,T.set(e,t)),t}}}, 82293:function _(e,t,n){n.d(t,{De:function De(){return u.Z}, UW:function UW(){return a.U}, b$:function b$(){return o.m}, _G:function _G(){return i._G}, Gb:function Gb(){return i.Gb}, vY:function vY(){return s.v}}); var r,i=n(52626),o=n(84612);!function(e){e[e.INSTALLED=0]="INSTALLED",e[e.CLIENT_NOT_INSTALLED=-1]="CLIENT_NOT_INSTALLED",e[e.EXT_NOT_INSTALLED=-2]="EXT_NOT_INSTALLED",e[e.NOT_ALLOWED_DOMAIN=-5]="NOT_ALLOWED_DOMAIN", e[e.CONNECTING=-3]="CONNECTING",e[e.UNAVAILABLE=-1E3]="UNAVAILABLE",e[e.CLIENT_ERROR_OFFSET=-2147483647]="CLIENT_ERROR_OFFSET",e[e.CLIENT_NEED_UPDATE=-2147483646]="CLIENT_NEED_UPDATE",e[e.CLIENT_NO_VERSION_INFO= -2147483645]="CLIENT_NO_VERSION_INFO"}(r||(r={})),n(46266); var a=n(32529),s=n(8267),u=n(93989);i.ZP.DEFAULT_STATE_QUERY_OPTIONS}, 59523:function _(e,t,n){n.d(t,{lr:function lr(){return et}, G5:function G5(){return Xe}, Ao:function Ao(){return T}, vM:function vM(){return de}, $0:function $0(){return xe}, pV:function pV(){return Oe}, j2:function j2(){return se}}); var _r15,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(93476),l=n.n(u),c=n(65420),d=n.n(c),h=n(98341),f=n.n(h),p=n(39969),v=n.n(p),g=n(78914),y=n.n(g),m=n(84838),_=n(12594),E=(_r15=function r(e,t){return _r15= o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r15(e,t)},function(e,t){if("function"!=typeof t&& null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r15(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),T=function(e){function t(t,n){var r=this.constructor,i=e.call(this,t)||this; return o()(i,r.prototype),i.name="NmcProviderError",i.code=n,i} return E(t,e),t.ErrorCodes={VERSION_NOT_SUPPORTED:"VERSION_NOT_SUPPORTED",HTTP_LOADER_ABORTED:"HTTP_LOADER_ABORTED",HTTP_LOADER_ERROR:"HTTP_LOADER_ERROR",INVALID_PARAM:"INVALID_PARAM",INTERNAL_ERROR:"INTERNAL_ERROR"}, t}(Error),b=n(66419),S=n.n(b),w=n(27849),A=n(27804),R=n(8304),L=n(11128),I=n.n(L),C=n(81643),O=n.n(C),P=n(94198),k=n.n(P),D=n(31238),x=n.n(D),N=n(41511),M=n.n(N),U=n(2991),F=n.n(U),B=n(29828),V=n.n(B), H=n(94473),j=n.n(H),G=n(61084),K=n(20850),z=n(10131),W=n(20316),q=["mediaPresentationDuration", "minimumUpdatePeriod","minBufferTime","timeShiftBufferDepth","suggestedPresentationDelay","maxSegmentDuration","maxSubsegmentDuration","start","duration","starttime"],Z=["availabilityStartTime","availabilityEndTime", "publishTime"],Y=["minFrameRate","maxFrameRate","frameRate"],X=/^urn:naver:vod:information:/;function Q(e){if(!e)return null;try{var t=new Date(e);return isNaN(t.getTime())?null:t}catch(e){return null}} function J(e){if(!e)return null;try{var t=new Date(e);return isNaN(t.getTime())||t.getTime()-1)return(n=new z.s).test(t)?n.parse(t):t;if(O()(Z).call(Z,e)>-1)return(n=new K.a).test(t)?n.parse(t):t;if(O()(Y).call(Y,e)>-1)return(n=new W.m).test(t)?n.parse(t): t;if("string"==typeof t){if(/^-?\d+$/.test(t))return k()(t,10);if(/^-?\d+\.\d+$/.test(t))return x()(t)}return t} function ee(e){if(!e||"object"!=_typeof(e))return e;var t=M()(e)?[]:{};for(var n in e){var r=e[n];M()(r)?r=F()(r).call(r,function(e){return"string"==typeof e?{"#text":e}:"object"==_typeof(e)?ee(e):e}): V()(n).call(n,"@")?r=$(n.substring(1),r):"object"==_typeof(r)?r=null!==r?ee(r):[{"#text":""}]:"string"==typeof r&&(r=$("",r)),t[n]=r}return t} function te(e){var t,n,r={};if(null===(n=null===(t=e.Period)||void 0===t?void 0:t[0])||void 0===n?void 0:n.SupplementalProperty){var i,o=j()(i=e.Period[0].SupplementalProperty).call(i,function(e){return X.test(e["@schemeIdUri"])}); o&&(r.information=o)}return r} function ne(e,t){return{videoId:e["@nvod:videoId"]||null,serverTime:Q(e["@nvod:serverTime"]),expireTime:J(e["@nvod:expireTime"]),contentDuration:e["@mediaPresentationDuration"]||0,rawData:t,mpd:e,supplementalProperties:te(e), periods:e.Period||[]}} var re,ie=function(){function e(){} return e.prototype.readVideoId=function(e){return e["@nvod:videoId"]||null},e.prototype.readServerTime=function(e){var t=e["@nvod:serverTime"]; if(!t)return null;try{var n=new Date(t);return isNaN(n.getTime())?null:n}catch(e){return null}},e.prototype.readExpireTime=function(e){var t=e["@nvod:expireTime"]; if(!t)return null;try{var n=new Date(t);return isNaN(n.getTime())||n.getTime()0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1){var n=new s.s;return n.test(t)?n.parse(t):t}if(i()(c).call(c,e)>-1){var r= new a.a;return r.test(t)?r.parse(t):t}if(i()(d).call(d,e)>-1){var o=new u.m;return o.test(t)?o.parse(t):t}return t}})).parse(e)} }, 83751:function _(e,t,n){var _r16,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(77449),l=(_r16=function r(e,t){return _r16=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_r16(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r16(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),c=function(e){function t(t,n){var r=n.videoWidth,i=n.videoHeight,o=e.call(this,t)||this; return o.videoHeight=i,o.videoWidth=r,o} return l(t,e),t}(u["default"]); t.Z=c}, 17458:function _(e,t,n){n.d(t,{CD:function CD(){return _}, kr:function kr(){return S}, vz:function vz(){return y}}); var r=n(81643),i=n.n(r),o=n(92762),a=n.n(o),s=n(78580),u=n.n(s),l=n(59340),c=n.n(l),d=n(54103),h=n.n(d),f=n(45424),p=n.n(f),v=n(8594),g="debug.hlsjs.log",y={experimental:{"hls.js":{debug:!1,enableWorker:!1, workerPath:null,liveSyncDuration:void 0,liveSyncDurationCount:void 0,maxLiveSyncPlaybackRate:1.03,explictInLiveRange:20,minLiveSyncBufferLength:2,maxLiveSyncBufferLength:4,minDurationToRetainAfterLiveSync:3E3, minDurationToRetainAfterCatchup:3E3,liveMaxLatencyDurationCount:void 0,liveMaxLatencyDuration:void 0,enableSemiAbr:!0,abrEwmaDefaultEstimateMax:5E7,abrEwmaDefaultEstimate:5E7,preferManagedMediaSource:!1, preserveManualLevelOnError:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,gapRecoveryPolicy:["log"],gapDetectThreshold:5, enableValidationLogging:void 0,enableRecoveryLogging:void 0,collectTaoHeaders:!1,collectServerTimingHeaders:!1,hlsSlowDownloadThreshold:1.8,llHlsSlowDownloadThreshold:1.8},coreplayer:{webkitUseHlsJs:!1}, avplayer:{enableTextTrackCharacteristics:!0}}},m=[];function _(e){var t=i()(m).call(m,e);-1!==t&&a()(m).call(m,t,1)} function E(e){var t,n=String(e);if("object"!=_typeof(e)||null===e)return n;if("function"!=typeof e.toJSON&&!u()(n).call(n,"[object "))return n;try{return null!==(t=c()(e))&&void 0!==t?t:n}catch(e){return n}} function T(e){for(var t="",n=0;n0&&(t+=" ");try{t+=E(e[n])}catch(e){t+="[unformattable]"}}return t} function b(e,t){m.push(e);var n=function n(_n4){return function(){for(var r=[],i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(l.desc=s);else{var c={dur:u};s.length>0&&(c.desc=s),t[o]=c}}return t}} var k=function(){function e(){this._observer=null,this._buffer=[],this._started=!1,this._manifestPath=null} return e.prototype.setManifestUrl=function(e){this._manifestPath=e.split("?")[0]},e.prototype.start=function(){var e=this; if(!this._started){this._started=!0;try{this._observer=new PerformanceObserver(function(t){for(var n,r=0,i=t.getEntries();r0?o.connectEnd-o.secureConnectionStart:0,d=o.responseStart-o.requestStart,h={dataType:a, uri:o.name,timestamp:o.startTime,timing:{duration:s,dnsLookup:isNaN(u)?0:u,tcpConnect:isNaN(l)?0:l,tlsNegotiation:isNaN(c)?0:c,ttfb:isNaN(d)?0:d,transferSize:o.transferSize,responseStatus:null!==(n=o.responseStatus)&& void 0!==n?n:0}},f=P(o.serverTiming);f&&(h.serverTiming=f),e._buffer.push(h)}}}}),this._observer.observe({type:"resource", buffered:!0})}catch(e){this._started=!1}}},e.prototype.drain=function(){var e=this._buffer; return this._buffer=[],e},e.prototype.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null),this._buffer=[],this._started=!1},e.prototype._getHlsDataType=function(e){var t= e.split("?")[0]; return this._manifestPath&&w()(t).call(t,this._manifestPath)?I:R()(t).call(t,".m3u8")?C:(0,L.D)(t)?O:null},e}(),_D=function D(){return _D=i()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.max&&(e.max=t)} function W(e){if(e&&0!==e.count)return{avg:b(e.sum/e.count,1),max:b(e.max,1)}} function q(e){try{return btoa(unescape(encodeURIComponent(e)))}catch(e){return null}} function Z(e){return x(this,void 0,void 0,function(){var t;return N(this,function(n){switch(n.label){case 0:return[4,(0,T.L1)(e)];case 1:return(t=n.sent())===e?[2,q(e)]:[2,t]}})})} var Y=function(){function e(e){var t,n;this._events=[],this._counters={fragTotalCount:0,fragSlowCount:0,fragErrorCount:0,m3u8TotalCount:0,m3u8SlowCount:0,m3u8ErrorCount:0},this._durationAcc=((t={})[V]= {sum:0,count:0,max:0},t[H]={sum:0,count:0,max:0},t),this._slowAcc=((n={})[V]={ttfb:{sum:0,count:0,max:0},serverTiming:{}},n[H]={ttfb:{sum:0,count:0,max:0},serverTiming:{}},n),this._observer=new k,this._partDuration= null,this._segmentDuration=null,this._hasManifestEvent=!1,this._config=e} return e.create=function(t){return t.collectTaoHeaders||t.collectServerTimingHeaders?"undefined"==typeof PerformanceObserver?null:new e(t):null},e.prototype.start=function(){this._observer.start()},e.prototype.setManifestUrl= function(e){this._observer.setManifestUrl(e)},e.prototype.setDurations=function(e,t){this._segmentDuration=e,this._partDuration=t},e.prototype.flush=function(e){for(var t=0,n=e;t=400; if(i||(r.dataType===O?(this._counters.fragTotalCount++,z(this._durationAcc[V],r.timing.duration)):r.dataType!==C&&r.dataType!==I||(this._counters.m3u8TotalCount++,z(this._durationAcc[H],r.timing.duration))), this._shouldCollect(r,i)){var o=this._toDownloadEvent(r,i);this._events.push(o),this._updateSummary(o)}}if(this._events.length>36E3){for(var a=this._events.length-36E3,s=[],u=[],l=0,c=this._events;l0&&(n.downloadBytes=e.timing.transferSize),this._config.collectTaoHeaders){var r=e.timing,i=r.ttfb, o=r.dnsLookup,a=r.tcpConnect,s=r.tlsNegotiation;(i>0||o>0||a>0||s>0)&&(i>0&&(n.ttfb=b(i,1)),o>0&&(n.dnsLookup=b(o,1)),a>0&&(n.tcpConnect=b(a,1)),s>0&&(n.tlsNegotiation=b(s,1)))}return e.timing.responseStatus> 0&&(n.statusCode="H".concat(e.timing.responseStatus)),this._config.collectServerTimingHeaders&&e.serverTiming&&(n.serverTiming=e.serverTiming),n},e.prototype._updateSummary=function(e){var t=e.name,n=e.value, r=t===F; n===B?r?this._counters.fragErrorCount++:this._counters.m3u8ErrorCount++:(r?this._counters.fragSlowCount++:this._counters.m3u8SlowCount++,this._updateFilteredAccumulators(r?V:H,e))},e.prototype._updateFilteredAccumulators= function(e,t){var n=t.ttfb,r=t.serverTiming,i=this._slowAcc[e]; if(this._config.collectTaoHeaders&&void 0!==n&&n>0&&z(i.ttfb,n),this._config.collectServerTimingHeaders&&r)for(var o=0,a=m()(r);o-1},e.prototype.contains= function(){return!1},e.prototype.requestMediaKeySystemAccess=function(e,t){return navigator.requestMediaKeySystemAccess(e,t)},e.prototype.getMediaKeysController=function(){return null},e}(),ue=n(3579), le=n(51859),ce=n(39392),de=n.n(ce),he=n(77766),fe=n.n(he),pe=n(1190),ve=n(62957),ge=(_ie=function ie(e,t){return _ie=i()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_ie(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _ie(e,t),e.prototype=null===t?a()(t):(n.prototype=t.prototype,new n)}),ye=function ye(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},me=function me(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof p()&&(o[g()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&c()(t,n,a),a}([(0,ue.Pv)("EMEProducedCandidateMediaKeysController")],e)}(),Se=function Se(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},we=function we(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof p()&&(o[g()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(i[t]=!1,i.video.currentTime=0)}),i} return Pe(n,e),c()(n.prototype,"ended",{get:function get(){return this[t]}, enumerable:!1,configurable:!0}),n.prototype.load=function(){return""===this.video.src&&(this[t]=!1),e.prototype.load.call(this)},n}(e)} var De=n(93711),xe=n(15765),Ne=function Ne(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},Me=function Me(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof p()&&(o[g()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&c()(t,n,a),a},vt=function vt(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},gt=function gt(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof p()&&(o[g()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1&&i>0||this._reloadCount>=3||(this._reloadCount++,h().resolve().then(function(){e._loadNative()}))},t.prototype._loadNative=function(){this._videoElement.load()},t.prototype._abortPendingPlayPromise= function(){if(this._pendingPlayPromise){var e=new Error("The operation was aborted."); e.name="AbortError","function"==typeof this._rejectPlayPromise&&this._rejectPlayPromise(e)}},t.prototype._resetPendingPlayPromiseState=function(){var e,t; this._pendingPlayPromise=void 0,this._resolvePlayPromise=void 0,this._rejectPlayPromise=void 0,this._reloadCount=0,this._videoElement.removeEventListener(te.Z.LOADED_DATA,this._resolveOrRejectPendingPromise), this._videoElement.removeEventListener(te.Z.SUSPEND,this._reloadToHandlePendingPlayPromise),null===(t=null===(e=this._mediaController)||void 0===e?void 0:e.setPlayPromise)||void 0===t||t.call(e)},t.prototype._createPendingPlayPromise= function(){var e=this; if(this._pendingPlayPromise)return this._pendingPlayPromise;var t=new (h())(function(n,r){var i,o;null===(o=null===(i=e._mediaController)||void 0===i?void 0:i.setPlayPromise)||void 0===o||o.call(i,t),e._resolvePlayPromise= function(){return n()},e._rejectPlayPromise=function(e){return r(e)},e._reloadCount=0,e._videoElement.addEventListener(te.Z.LOADED_DATA,e._resolveOrRejectPendingPromise),e._videoElement.addEventListener(te.Z.SUSPEND, e._reloadToHandlePendingPlayPromise)}); return this._pendingPlayPromise=t,t},t.prototype.play=function(){var e,t,n,r,i,o=this,a=this._videoElement.src||(null===(e=this._videoElement.querySelector("source"))||void 0===e?void 0:e.src); if(!a)return this._loadNative(),this._createPendingPlayPromise();var s=0===(null==a?void 0:E()(a).call(a,"blob:"));if(this._videoElement.audioTracks&&!s){var u=this._videoElement.readyState<2;if(0===(null=== (t=this._videoElement.audioTracks)||void 0===t?void 0:t.length)&&(0,X.Z)()&&u)return this._loadNative(),this._createPendingPlayPromise()}var l=(0,K.Z)(this.seekable),c=!isFinite(l)||0===l&&3!==this.video.networkState, d=this._srcLoadedAt&&m()()-this._srcLoadedAt>3E3;if(c&&d){if(!s)return this.mediaKeys&&(0,Y.Z)()?this.setMediaKeys(null).then(function(){return o._loadNative(),o._createPendingPlayPromise()}):(this._loadNative(), this._createPendingPlayPromise()); var f=this._videoElement.seekable.length;if(f){var p=this._videoElement.seekable.end(f-1);isFinite(p)&&(this._videoElement.currentTime=p-((null===(n=this._mediaController)||void 0===n?void 0:n.targetLatency)|| 5))}}var v=this._playNative();return v?(null===(i=null===(r=this._mediaController)||void 0===r?void 0:r.setPlayPromise)||void 0===i||i.call(r,v),v["finally"](function(){var e,t;null===(t=null===(e=o._mediaController)|| void 0===e?void 0:e.setPlayPromise)||void 0===t||t.call(e)})["catch"](function(){}),v):new (h())(function(e,t){o._videoElement.paused?t(new Error("play() can only be initiated by a user gesture")):e()})}, t.prototype.pause=function(){return this._pendingPlayPromise&&(this._abortPendingPlayPromise(),this._resetPendingPlayPromiseState()),this._videoElement.pause()},t.prototype.load=function(){var e; this._sourceChanged$.next(null!==(e=this._src)&&void 0!==e?e:""),this._mediaController?this._mediaController.load():this._loadNative()},t.prototype.canPlayType=function(e){var t,r=null===(t=this._videoElement)|| void 0===t?void 0:t.canPlayType(e); return""!==r&&r||!n.mediaCapabilities.canPlayType(e)?r:"extensible"},t.prototype.removeAttribute=function(e){this.video.removeAttribute(e),"src"===e&&(this._src="",this._videoError=null,this._destroyMediaController())}, t.prototype._destroyMediaController=function(){var e=this._mediaController; e&&(e.removeEventListener("error",this._onErrorFromMediaController),e.removeEventListener("encrypted",this._onMediaControllerEncrypted),e.destroy(),C().setOwnership(e,void 0),this._mediaController=null, this._abrLevelSwitchedSubscription$.unsubscribe())},c()(t.prototype,"poster",{get:function get(){return this.video.poster}, set:function set(e){if(this.video.poster=e,(0,X.Z)()&&(0,Q.Z)()){var t=this._videoElement.style;t.backgroundRepeat="no-repeat",t.backgroundPosition="center center",t.backgroundSize="contain",t.backgroundImage= 'url("'.concat(e,'")')}}, enumerable:!1,configurable:!0}),c()(t.prototype,"volume",{get:function get(){return this.video.volume}, set:function set(e){this.video.volume=e,this._volume=this.video.volume}, enumerable:!1,configurable:!0}),c()(t.prototype,"muted",{get:function get(){return this.video.muted}, set:function set(e){this.video.muted=e}, enumerable:!1,configurable:!0}),c()(t.prototype,"defaultMuted",{get:function get(){return this.video.defaultMuted}, set:function set(e){this.video.defaultMuted=e}, enumerable:!1,configurable:!0}),c()(t.prototype,"seeking",{get:function get(){return this._seeking}, enumerable:!1,configurable:!0}),c()(t.prototype,"seekable",{get:function get(){var e,t;return null!==(t=null===(e=this._mediaController)||void 0===e?void 0:e.seekable)&&void 0!==t?t:this.video.seekable}, enumerable:!1,configurable:!0}),c()(t.prototype,"paused",{get:function get(){return!this._pendingPlayPromise&&this._videoElement.paused}, enumerable:!1,configurable:!0}),c()(t.prototype,"currentTime",{get:function get(){return this.video.currentTime}, set:function set(e){var t=this,n=.1;if(!isFinite(e))throw new Error("Failed to set the 'currentTime' property on 'SourcePlayer': The provided double value is non-finite.");if(e>=this.video.duration-n)if(this.video.buffered.length> 0){var r=this.video.buffered.end(this.video.buffered.length-1);r>=this.video.duration-n?this.video.currentTime=r-n:(this._onSourceSeeking$.pipe((0,M.c)(this._onSourceDurationChange$),(0,M.c)(this._onSourceSeeked$), (0,U.q)(1),(0,F.R)((0,k.T)(this._onSourceEnded$,this._onSourceAbort$))).subscribe(function(){if(!t.video.ended){var e=t.video.buffered.end(t.video.buffered.length-1);t.video.currentTime=e-n}}),this.video.currentTime= Math.floor(this.video.duration))}else this.video.currentTime=Math.floor(this.video.duration); else this.video.currentTime=e}, enumerable:!1,configurable:!0}),c()(t.prototype,"src",{get:function get(){return this._src}, set:function set(e){this._destroyMediaController(),this.video.mediaKeys&&this.video.setMediaKeys(null),this._videoError=null,this._startTime=0,this._src=e,this._sourceChanged$.next(e),this._pendingPlayPromise&& 0!==this.video.networkState&&(this._abortPendingPlayPromise(),this._resetPendingPlayPromiseState());var t=(0,at.Z)(e),r=n.mediaCapabilities.findCapability(e,t||void 0);r?this._playWithMediaCap(r):this._videoElement.src= e}, enumerable:!1,configurable:!0}),c()(t.prototype,"playbackRate",{get:function get(){return this.video.playbackRate}, set:function set(e){this.video.playbackRate=e}, enumerable:!1,configurable:!0}),c()(t.prototype,"duration",{get:function get(){var e,t;return null!==(t=null===(e=this._mediaController)||void 0===e?void 0:e.duration)&&void 0!==t?t:this.video.duration}, enumerable:!1,configurable:!0}),c()(t.prototype,"defaultPlaybackRate",{get:function get(){var e;return null!==(e=this.video.defaultPlaybackRate)&&void 0!==e?e:1}, set:function set(e){this.video.defaultPlaybackRate=e}, enumerable:!1,configurable:!0}),c()(t.prototype,"width",{get:function get(){var e=this.shadowRoot.style.width;return e?(0,Xe.Z)(e):NaN}, set:function set(e){this.shadowRoot.style.width="".concat(e,"px")}, enumerable:!1,configurable:!0}),c()(t.prototype,"height",{get:function get(){var e=this.shadowRoot.style.height;return e?(0,Xe.Z)(e):NaN}, set:function set(e){this.shadowRoot.style.height="".concat(e,"px")}, enumerable:!1,configurable:!0}),c()(t.prototype,"videoWidth",{get:function get(){return this.video.videoWidth}, enumerable:!1,configurable:!0}),c()(t.prototype,"videoHeight",{get:function get(){return this.video.videoHeight}, enumerable:!1,configurable:!0}),c()(t.prototype,"error",{get:function get(){return this._videoError||this.video.error}, enumerable:!1,configurable:!0}),c()(t.prototype,"ended",{get:function get(){return this.video.ended}, enumerable:!1,configurable:!0}),c()(t.prototype,"caches",{get:function get(){return this._caches}, enumerable:!1,configurable:!0}),c()(t.prototype,"mediaKeys",{get:function get(){return this._mediaKeys||this.video.mediaKeys||this.video.msKeys||this.video.webkitKeys}, enumerable:!1,configurable:!0}),c()(t.prototype,"videoTracks",{get:function get(){var e;return null===(e=this._mediaController)||void 0===e?void 0:e.videoTracks}, enumerable:!1,configurable:!0}),t.prototype.setMediaKeys=function(e){return vt(this,void 0,void 0,function(){var t;return gt(this,function(n){switch(n.label){case 0:if(this._attachingMediaKeys)throw(t= new Error("The existing MediaKeys object cannot be removed at this time.")).name="InvalidStateError",t;if(this._mediaKeys===e)return[2];n.label=1;case 1:return n.trys.push([1,6,7,8]),this._attachingMediaKeys= !0,this._mediaKeys?[4,this._closeMediaKeysController(this._mediaKeys)]:[3,3];case 2:n.sent(),n.label=3;case 3:return this._mediaController?[4,this._setMediaKeysController(this._mediaController,e)]:[3,5]; case 4:n.sent(),n.label=5;case 5:return this._mediaKeys=e,[3,8];case 6:return n.sent(),this._mediaKeys=null,[3,8];case 7:return this._attachingMediaKeys=!1,[7];case 8:return[2]}})})},t.prototype._setMediaKeysController= function(e,t){var n=t?ae.Z.getInstance().getMediaKeysController(t):null; e.mediaKeysController=n,n&&n.attachMedia(this.video)},t.prototype._closeMediaKeysController=function(e){return vt(this,void 0,void 0,function(){var t,n; return gt(this,function(r){switch(r.label){case 0:if(!(t=ae.Z.getInstance().getMediaKeysController(e)))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.close()];case 2:return r.sent(),[3, 4];case 3:return n=r.sent(),console.warn("internal error: failed send close signal to current mediaKeys Controller. it cause memory leaks potentially."),console.warn(n),[3,4];case 4:return this._mediaController&& (this._mediaController.mediaKeysController=null),this._mediaKeys=null,[2]}})})},t.prototype._attachEvents=function(){this._handlePlayingEvent(),this._handleSeekEvent(),this._handlePendingPlayRequest(), this._handleMediaFragment(),this._handleSourceAttach(),this._handleErrorEvent(),this._handleAbort(),this._normalizeTextTrackAddEvent(),this._handlePrivateDataReset()},t.prototype._handlePrivateDataReset= function(){var e=this; this._videoElement.addEventListener(te.Z.EMPTIED,function(){(0,xe.vK)(e._videoElement)})},t.prototype._normalizeTextTrackAddEvent=function(){var e=this; this._videoElement.addEventListener("addtrack",function(t){var n=t.track;n&&e._videoElement.textTracks.dispatchEvent(new TrackEvent("addtrack",{track:n}))})},t.prototype._handleSeekEvent=function(){var e= this; this._onSourceSeeking$.subscribe(function(){e._seeking=!0}),this._onSourceSeeked$.subscribe(function(){e._seeking=!1})},t.prototype._handlePendingPlayRequest=function(){var e=this; this._onSourcePlay$.pipe((0,B.w)(function(){return e._onSourceLoadStart$}),(0,V.h)(function(){var t=e._videoElement,n=t.preload,r=t.paused,i=t.networkState; return"none"===n&&!r&&1===i})).subscribe(function(){e.play()})},t.prototype._handleMediaFragment=function(){var e,t,n,r,i=this,o=(0,D.u)((e=this,t=this._sourceChanged$,n=function(e){return e.pipe((0,H.U)(function(e){return(0, re.Z)(e)}),(0,V.h)(function(e){return null!==e}))}(t),r=(0,k.T)(function(e){return(0,k.T)((0,O.R)(e,"ended"),(0,O.R)(e,"error"))}(e),t),(0,k.T)(function(e,t,n){return t.pipe((0,V.h)(function(e){return e.begin> 0}),(0,B.w)(function(t){return(0,O.R)(e,"canplay").pipe((0,H.U)(function(){return{type:"begin", time:t.begin}}),(0,U.q)(1),(0,F.R)(n))}))}(e,n,r),function(e,t,n){return t.pipe((0,V.h)(function(e){return void 0!==e.end&&!isNaN(e.end)&&e.end>e.begin}),(0,B.w)(function(t){var r=Number(t.end); return(0,O.R)(e,"timeupdate").pipe((0,V.h)(function(){return!e.paused&&!e.seeking&&e.currentTime>=r}),(0,H.U)(function(){return{type:"end", time:r}}),(0,U.q)(1),(0,F.R)(n))}))}(e,n,r))),function(e){return"begin"===e.type}),a=o[0],s=o[1]; a.pipe((0,V.h)(function(){var e=(0,K.Z)(i.seekable);return isFinite(e)&&0!==e})).subscribe(function(e){i.video.seeking||(i.currentTime=e.time),i._startTime=e.time}),s.subscribe(function(){i.pause()})}, t.prototype._handleSourceAttach=function(){var e=this; this._onSourceLoadStart$.pipe((0,B.w)(function(){return(0,x.H)(1E3).pipe((0,F.R)((0,k.T)(e._onSourceError$,e._onSourceDurationChange$,e._onSourceResize$,e._onSourceProgress$,e._onSourceSuspend$)))}),(0, V.h)(function(){return 2!==e._videoElement.networkState&&""!==e._src&&null===e.video.error}),(0,B.w)(function(){return(0,N.h)({url:e._src, method:"HEAD"})}),(0,F.R)(this._onSourceAbort$)).subscribe(function(t){t.status>=400&&e._dispatchErrorEvent(J.Z.MEDIA_ERR_NETWORK)})},t.prototype._handleErrorEvent=function(){var e=this; this._onSourceError$.pipe((0,V.h)(function(){return null!==e._videoError||!!e._pendingPlayPromise})).subscribe(function(){e._pendingPlayPromise&&e._resolveOrRejectPendingPromise()})},t.prototype._handleAbort= function(){var e=this; this._onSourceLoadStart$.pipe((0,V.h)(function(){return Boolean(e._src)}),(0,H.U)(function(){return e._src}),(0,B.w)(function(t){return e._onSourceEmptied$.pipe((0,V.h)(function(){return e._src!==t}))})).subscribe(function(){e._videoError= null})},t.prototype._handlePlayingEvent=function(){var e=this; this._onSourcePlaying$.subscribe(function(t){e.video.paused&&t.stopImmediatePropagation()})},t.prototype._dispatchErrorEvent=function(e,t){void 0===t&&(t=J.Z[e]),this._videoError={code:e, message:t},this.dispatchEvent(new te.Z("error"))},t.prototype._playWithMediaCap=function(e){var t,n,r,i,o=this,a=e.createController(this._getMediaControllerConfig(this.src)); a.videoElement=this._videoElement,a.src=this._src,a.caches=this._caches,this._mediaKeys&&this._setMediaKeysController(a,this._mediaKeys),this._videoElement.removeAttribute("src"),this._loadNative(),C().setOwnership(a, this),this._mediaController=a,this._streamingProfile&&(null===(t=a.applyStreamingProfile)||void 0===t||t.call(a,this._streamingProfile)),a.load(),this._mediaController.addEventListener("error",this._onErrorFromMediaController), this._mediaController.addEventListener(ht.Z.STALLED,function(){o.dispatchEvent(new te.Z(ht.Z.STALLED))}),this._mediaController.addEventListener("encrypted",this._onMediaControllerEncrypted),this._abrLevelSwitchedSubscription$= (n=this,r=this.video,i=this._mediaController,(0,k.T)((0,O.R)(i,ne.Z.LEVEL_SWITCHED),(0,O.R)(r,te.Z.RESIZE)).subscribe(function(e){var t=e instanceof ee.Z?e:r,i=t.videoWidth,o=t.videoHeight,a=new te.Z(te.Z.RESIZE, {videoWidth:i, videoHeight:o});n.dispatchEvent(a)}))},t.prototype._getMediaControllerConfig=function(e){var t; if(E()(e).call(e,"cmcd")>-1)try{var n=/cmcd=([^&]+)/.exec((new (b())(this.src)).hash);n&&(t=JSON.parse(decodeURIComponent(n[1])))}catch(e){}return t?{cmcd:t}:void 0},t.prototype.getRenderContainer=function(){return this.shadowRoot.querySelector(".webplayer-internal-source-renderoverlay")}, t.prototype.getNativeVideoElement=function(){return this.video},t.prototype._initializePreProcessing=function(){this._preprocessingManager=new De.Z,this._preprocessingManager.initialize(this)},t.prototype.configurePreProcessor= function(e){this._preprocessingManager.configure(e)},t.prototype.clearPreprocessor=function(){this._preprocessingManager.clear()},t.prototype.getPreProcessorControl=function(e){return this._preprocessingManager.getControls(e)}, t.prototype._onMediaControllerEncrypted=function(e){this.dispatchEvent(new Re.$({initData:e.initData, initDataType:e.initDataType}))},t.prototype._onErrorFromMediaController=function(e){var t; if(null===(t=this._mediaController)||void 0===t?void 0:t.error){var n=this._mediaController.error,r=n.code,i=n.message;this._dispatchErrorEvent(r,i)}else this._dispatchErrorEvent(J.Z.MEDIA_ERR_NETWORK)}, t.prototype.addEventListener=function(t,n,r){e.prototype.addEventListener.call(this,t,n,r),"encrypted"!==t&&this.video.addEventListener(t,n,r)},t.prototype.dispatchEvent=function(t){return t instanceof Event&&this.video.dispatchEvent(t),e.prototype.dispatchEvent.call(this,t)},t.prototype.removeEventListener=function(t,n,r){e.prototype.removeEventListener.call(this,t,n,r),this.video.removeEventListener(t, n,r)},t.prototype.requestFullscreen=function(e){return(0,z.Z)(this.video,e)},t.prototype.exitFullscreen=function(){return(0,G.Z)(this.video)},t.prototype.getStartDate=function(){var e,t,n; return(null===(e=this._mediaController)||void 0===e?void 0:e.getStartDate)?n=null===(t=this._mediaController)||void 0===t?void 0:t.getStartDate():this.video.getStartDate&&(n=this.video.getStartDate()), n||new Date(NaN)},t.prototype._getStreamingController=function(){var e=this; return{applyProfile:function applyProfile(t){var n,r;e._streamingProfile=t,null===(r=null===(n=e._mediaController)||void 0===n?void 0:n.applyStreamingProfile)||void 0===r||r.call(n,t)}}},t.prototype._dumpState= function(){var e,t,n,r=null===(n=null===(t=this._mediaController)||void 0===t?void 0:t._dumpState)||void 0===n?void 0:n.call(t),i=w()(e=[this.video.seekable, this.video.buffered]).call(e,function(e){var t;return w()(t=(0,st.P)(e)).call(t,(2,function(e){return w()(e).call(e,function(e){return R()(e.toFixed(2))})}))}),o=i[0],a=i[1]; return{src:this.src,controller:r,seekable:o,buffered:a}},c()(t.prototype,"displayingPictureInPicture",{get:function get(){return!(void 0===document.pictureInPictureElement||!document.pictureInPictureElement)&& document.pictureInPictureElement===this.video}, enumerable:!1,configurable:!0}),c()(t.prototype,"disableRemotePlayback",{get:function get(){return this.video.disableRemotePlayback}, set:function set(e){this.video.disableRemotePlayback=e,this.video.setAttribute("x-webkit-airplay",e?"deny":"allow"),e?this.video.setAttribute("x-webkit-wirelessvideoplaybackdisabled",""):this.video.removeAttribute("x-webkit-wirelessvideoplaybackdisabled")}, enumerable:!1,configurable:!0}),c()(t.prototype,"remote",{get:function get(){return this.video.remote}, enumerable:!1,configurable:!0}),t.mediaCapabilities=new je,t.mediaKeySystems={define:function define(e){ae.Z.getInstance().define(e)}},pt([(0,j.z)(104)],t.prototype,"_playNative",null),pt([Z],t.prototype, "_resolveOrRejectPendingPromise",null),pt([Z],t.prototype,"_reloadToHandlePendingPlayPromise",null),pt([(0,j.z)(103)],t.prototype,"_loadNative",null),pt([(0,j.z)(102)],t.prototype,"_abortPendingPlayPromise", null),pt([(0,j.z)(139)],t.prototype,"_resetPendingPlayPromiseState",null),pt([(0,j.z)(101)],t.prototype,"_createPendingPlayPromise",null),pt([(0,j.z)(100)],t.prototype,"play",null),pt([(0,j.z)(138)],t.prototype, "pause",null),pt([(0,j.z)(137)],t.prototype,"load",null),pt([(0,j.z)(121)],t.prototype,"_destroyMediaController",null),pt([(0,j.u)(226)],t.prototype,"poster",null),pt([(0,j.u)(225)],t.prototype,"volume", null),pt([(0,j.u)(224)],t.prototype,"muted",null),pt([(0,j.u)(193)],t.prototype,"currentTime",null),pt([(0,j.u)(195)],t.prototype,"src",null),pt([(0,j.u)(194)],t.prototype,"playbackRate",null),pt([(0,j.z)(140)], t.prototype,"_dispatchErrorEvent",null),pt([(0,j.z)(106)],t.prototype,"_playWithMediaCap",null),pt([Z],t.prototype,"_onMediaControllerEncrypted",null),pt([Z],t.prototype,"_onErrorFromMediaController",null), pt([(0,j.z)(120)],t.prototype,"dispatchEvent",null),n=pt([Oe, ke],t)}(L["default"]))}, 58617:function _(e,t,n){var r=n(93476),i=n.n(r),o=n(65420),a=n.n(o),s=n(98341),u=n.n(s),l=n(34967),c=n.n(l),d=n(16976),h=n.n(d),f=n(34665),p=function(){function e(){this._keySystems=[]} return e.getInstance=function(){return e._instance||(e._instance=new e),e._instance},e.prototype.contains=function(e){for(var t=0,n=this._keySystems;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0)&&(null!=t?t:n)} }, 30076:function _(e,t,n){n.d(t,{z:function z(){return f}}); var r=n(3649),i=n.n(r),o=n(77766),a=n.n(o),s=n(94198),u=n.n(s),l=n(54903),c=n.n(l),d=["","A","B","C"],h=[{levelIdc:30,maxLumaPictureSize:36864,maxLumaSampleRate:552960,maxMainTierBitrate:128,maxHighTierBitrate:0}, {levelIdc:60,maxLumaPictureSize:122880,maxLumaSampleRate:3686400,maxMainTierBitrate:1500,maxHighTierBitrate:0},{levelIdc:63,maxLumaPictureSize:245760,maxLumaSampleRate:7372800,maxMainTierBitrate:3E3,maxHighTierBitrate:0}, {levelIdc:90,maxLumaPictureSize:552960,maxLumaSampleRate:16588800,maxMainTierBitrate:6E3,maxHighTierBitrate:0},{levelIdc:93,maxLumaPictureSize:983040,maxLumaSampleRate:33177600,maxMainTierBitrate:1E4,maxHighTierBitrate:0}, {levelIdc:120,maxLumaPictureSize:2228224,maxLumaSampleRate:66846720,maxMainTierBitrate:12E3,maxHighTierBitrate:3E4},{levelIdc:123,maxLumaPictureSize:2228224,maxLumaSampleRate:133693440,maxMainTierBitrate:2E4, maxHighTierBitrate:5E4},{levelIdc:150,maxLumaPictureSize:8912896,maxLumaSampleRate:267386880,maxMainTierBitrate:25E3,maxHighTierBitrate:1E5},{levelIdc:153,maxLumaPictureSize:8912896,maxLumaSampleRate:534773760, maxMainTierBitrate:4E4,maxHighTierBitrate:16E4},{levelIdc:156,maxLumaPictureSize:8912896,maxLumaSampleRate:1069547520,maxMainTierBitrate:6E4,maxHighTierBitrate:24E4},{levelIdc:180,maxLumaPictureSize:35651584, maxLumaSampleRate:1069547520,maxMainTierBitrate:6E4,maxHighTierBitrate:24E4},{levelIdc:183,maxLumaPictureSize:35651584,maxLumaSampleRate:2139095040,maxMainTierBitrate:12E4,maxHighTierBitrate:48E4},{levelIdc:186, maxLumaPictureSize:35651584,maxLumaSampleRate:4278190080,maxMainTierBitrate:24E4,maxHighTierBitrate:8E5}],f=function(){function e(){this.profileSpace=0,this.constraintBytes=[]} return e.parseCodecString=function(t){var n,r=t.split(".");if(r.length<4||"hev1"!==r[0]&&"hvc1"!==r[0])throw new Error("Not HEVC codec string");var o=new e;switch(o.fourCC=r[0],null===(n=r[1].substring(0, 1))||void 0===n?void 0:n.toUpperCase()){case "A":o.profileSpace=1;break;case "B":o.profileSpace=2;break;case "C":o.profileSpace=3;break;default:o.profileSpace=0}if(0!==o.profileSpace?o.profileIdc=u()(r[1].substring(1), 10):o.profileIdc=u()(r[1],10),isNaN(o.profileIdc)||o.profileIdc<0||o.profileIdc>31)throw new Error("invalid profile idc");if(o.profileCompatibilityIndicator=u()(r[2],16),isNaN(o.profileCompatibilityIndicator))throw new Error("invalid profile compatibility indicator"); switch(r[3].substring(0,1).toUpperCase()){case "L":o.generalTierFlag="L";break;case "H":o.generalTierFlag="H";break;default:throw new Error("invalid general tier flag");}var a=u()(r[3].substring(1),10); if(a<30||a>255||a%3!=0)throw new Error("invalid level idc");if(o.levelIdc=a,r.length-4>6)throw new Error("too many constraint bytes");for(var s=0,l=i()(r).call(r,4);s255)throw new Error("invalid constraint byte");o.constraintBytes.push(d)}return o},e.estimate=function(t){var n=t.profile,r=t.width,i=t.height,o=t.frameRate,a=t.bitrate,s=new e; s.fourCC="hvc1","main"===(null!=n?n:"").toLowerCase().replace(/[^a-z0-9]/g,"")?(s.profileIdc=1,s.profileCompatibilityIndicator=2):(s.profileIdc=2,s.profileCompatibilityIndicator=4);for(var u=r*i,l=u*o, c=a/1E3,d=h[h.length-1],f=0,p=h;f0?"H":"L",s.constraintBytes=[],s},e.prototype.toCodecString=function(){for(var e,t,n=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2))if(1!==t.length){var r=decodeURIComponent(t[0]),i=decodeURIComponent(t[1]); n[r]="track"===r?n[r]?(new (u())(n[r])).add(i):new (u())([i]):i}else n[decodeURIComponent(e)]=""}); var o=c()(n),s={};s.uri=e.substr(0,t);var l=!1;if(i()(o).call(o,"t")>-1){var d=v.exec(n.t);d&&(s.begin=h()(d[1]||"0"),s.end=h()(d[2])||void 0),(s.begin||s.end)&&(l=!0)}if(i()(o).call(o,"tid")>-1&&(s.tid= n.tid,l=!0),i()(o).call(o,"ext_vod_auth_key1")>-1)try{s.extVodAuthKey1s=JSON.parse(decodeURIComponent(n.ext_vod_auth_key1)),l=!0}catch(e){}if(i()(o).call(o,"level_start")>-1)try{s.levelStart=JSON.parse(decodeURIComponent(n.level_start)), l=!0}catch(e){}if(i()(o).call(o,"level_cap")>-1)try{s.levelCap=JSON.parse(decodeURIComponent(n.level_cap)),l=!0}catch(e){}return i()(o).call(o,"max-bitrate")>-1&&(s.maxBitrate=p()(decodeURIComponent(n["max-bitrate"]), 10),l=!0),i()(o).call(o,"experimental-audio-bitrate")>-1&&(s.audioBitrate=p()(n["experimental-audio-bitrate"],10),l=!0),i()(o).call(o,"experimental-video-bitrate")>-1&&(s.videoBitrate=p()(n["experimental-video-bitrate"], 10),l=!0),i()(o).call(o,"stream-type")>-1&&(s.streamType=JSON.parse(decodeURIComponent(n["stream-type"])),l=!0),i()(o).call(o,"track")>-1&&(s.track=new (u())(n.track),l=!0),l?s:null} }, 42059:function _(e,t,n){function r(e){var t=[];if(!(null==e?void 0:e.length))return t;for(var n=0;n>2,o=(3&t)<<4|(n=c>4,a=(15&n)<<2|(r=c>6,s=63&r,isNaN(n)?a=s=64:isNaN(r)&&(s=64),l+=u.charAt(i)+u.charAt(o)+u.charAt(a)+ u.charAt(s); return l},e.BIG_ENDIAN=!0,e.LITTLE_ENDIAN=!1,e}(); t.Z=o}, 43623:function _(e,t,n){n.d(t,{GQ:function GQ(){return N}, K1:function K1(){return k}, MM:function MM(){return I}, ST:function ST(){return m}, Sc:function Sc(){return E}, Xh:function Xh(){return C}, ah:function ah(){return T}, dz:function dz(){return P}, ip:function ip(){return _}, l7:function l7(){return D}, os:function os(){return L}, rO:function rO(){return x}, vu:function vu(){return M}, x_:function x_(){return O}}); var r=n(34074),i=n.n(r),o=n(78580),a=n.n(o),s=n(25843),u=n.n(s),l=n(77766),c=n.n(l),d=n(94198),h=n.n(d),f=n(81643),p=n.n(f),v=n(42238),g=n(90373),y=n(26486),m=(0,g.Z)(function(){var e,t;if("undefined"== typeof window)return!1;if("undefined"==typeof navigator||"undefined"==typeof Navigator)return!0;try{var n,r,o=i()(Navigator.prototype,"userAgent");if(!(null==o?void 0:o.get))return!0;if("get userAgent"!== o.get.name){var s;if("[object Navigator]"!==Navigator.toString()&&!a()(s=Navigator.toString()).call(s,"[native code]"))return!0;if("[object NavigatorPrototype]"!==Navigator.prototype.toString()&&"[object Navigator]"!== Navigator.prototype.toString())return!0;if("get id"===(null===(t=null===(e=i()(Element.prototype,"id"))||void 0===e?void 0:e.get)||void 0===t?void 0:t.name))return!0}var l=u()(n=o.get.toString()).call(n); if(!a()(l).call(l,"[native code]"))return!0;if("function get userAgent() { [native code] }"!==l&&"function userAgent() {\n [native code]\n}"!==l)return!0;var c=u()(r=o.get.toString.toString()).call(r); return"function toString() { [native code] }"!==c&&"function toString() {\n [native code]\n}"!==c||navigator.userAgent!==o.get.call(navigator)}catch(e){return!0}}); function _(){var e;if("undefined"==typeof navigator||"undefined"==typeof Navigator)return"";try{var t,n=i()(Navigator.prototype,"userAgent");return(null===(e=null==n?void 0:n.get)||void 0===e?void 0:a()(t= e.toString()).call(t,"[native code]"))?n.get.call(navigator):navigator.userAgent}catch(e){return navigator.userAgent}} var E=(0,g.Z)(function(){return _()}),T=(0,g.Z)(function(e){return void 0===e&&(e=E()),new v.UAParser(e)}),b=/CriOS\/(\d+)/i,S=/(?:CPU(?: iPhone)? OS|iPhone OS)\s(\d+(?:[_.]\d+)*)/i,w=/Version\/(\d+(?:\.\d+)*)/i; function A(e){var t=e.match(S);if(null==t?void 0:t[1])return t[1].replace(/_/g,".");var n=e.match(w);return(null==n?void 0:n[1])||null} function R(e){return b.test(e)?{name:"iOS",version:A(e)}:null} var L=(0,g.Z)(function(e){var t;void 0===e&&(e=E());var n=R(e);return n?n.name:(null===(t=T(e).getOS())||void 0===t?void 0:t.name)||null}),I=(0,g.Z)(function(e){var t; void 0===e&&(e=E());var n=R(e);return n?n.version:(null===(t=T(e).getOS())||void 0===t?void 0:t.version)||null}),C=(0,g.Z)(function(e){var t; return void 0===e&&(e=E()),(null===(t=T(e).getBrowser())||void 0===t?void 0:t.name)||null}),O=(0,g.Z)(function(e){var t; return void 0===e&&(e=E()),(null===(t=T(e).getBrowser())||void 0===t?void 0:t.version)||null}),P=(0,g.Z)(function(e){var t,n,r,i,o,a; void 0===e&&(e=E());var s=T(e),u=s.getDevice().model,l=void 0===u?"":u,d=s.getBrowser(),h=d.name,f=void 0===h?"":h,p=d.version,v=void 0===p?"":p;if(!(0,y.Z)())return c()(t=c()(n="".concat(l,";")).call(n, f,"/")).call(t,v);var g=T(e.split("NAVER")[0]).getBrowser(),m=g.name,_=g.version;return c()(r=c()(i=c()(o=c()(a="".concat(l,";")).call(a,f,"/")).call(o,v,";")).call(i,m,"/")).call(r,_)}),k=(0,g.Z)(function(e){return void 0=== e&&(e=E()),{os:L(e), osVersion:I(e),browser:C(e),browserVersion:O(e),device:P(e)}}),D=(0,g.Z)(function(e){void 0===e&&(e=E()); var t=T(e).getDevice();return"mobile"===t.type||"tablet"===t.type?"mobile":"desktop"}),x=(0,g.Z)(function(){var e; return"edge"===(null===(e=C())||void 0===e?void 0:e.toLowerCase())&&h()(O()||"",10)<79}),N=(0,g.Z)(function(){var e; return-1!==p()(e=E()).call(e,"Xbox;")}),M=(0,g.Z)(function(){var e=/Chrome\/(\d+)\./.exec(E()); return e?h()(e[1],10):NaN})}, 6103:function _(e,t,n){n.d(t,{a:function a(){return R}, o:function o(){return w}}); var _r21,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(3649),l=n.n(u),c=n(77766),d=n.n(c),h=n(63978),f=n.n(h),p=n(54103),v=n.n(p),g=n(78914),y=n.n(g),m=n(57027),_=n(70540),E=n(1558),T=n(36296),b=(_r21=function r(e, t){return _r21=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r21(e,t)},function(e,t){if("function"!= typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r21(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),S=function S(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;iu()())return c().resolve(i[0]);delete _[r]}var o=m(e,t),s=(0,g.m)(o,"load","error").then(function(){return r&&(null==t?void 0:t.cache)&& (_[r]=[o.response,u()()+t.cache],h()(function(){delete _[r]},t.cache)),o.response}); return o.send(),s}(e,t):function(e,t){void 0===t&&(t={}); var n=t.body;p()(t,{method:"post"});var r=m(e,t),i=(0,g.m)(r,"load","error").then(function(){return r.response}); return r.send("object"==_typeof(n)?(0,v.Z)(n):n),i}(e,t)} }, 11189:function _(e,t,n){n.d(t,{Z:function Z(){return s}}); var r=n(81643),i=n.n(r),o=n(77766),a=n.n(o);function s(e,t){var n,r,o=i()(e).call(e,"?")>-1?"\x26":"?";return a()(n=a()(r="".concat(e)).call(r,o)).call(n,t)} }, 35522:function _(e,t,n){n.d(t,{Z:function Z(){return s}}); var r=n(2991),i=n.n(r),o=n(66419),a=n.n(o);function s(e){var t;return(new Uint8Array(i()(t=a()(atob(e))).call(t,function(e){return e.charCodeAt(0)}))).buffer} }, 17862:function _(e,t,n){function r(e){for(var t,n=65535,r=0;r>=1,t&&(n^=40961)}return n} n.d(t,{L:function L(){return r}})}, 50:function _(e,t,n){n.d(t,{P:function P(){return o}}); var r=n(94473),i=n.n(r);function o(e,t,n){var r;if("undefined"!=typeof self){var o=i()(r=["WebKitDataCue","VTTCue","TextTrackCue"]).call(r,function(e){return e in self}); if(o)return new self[o](e,t,n)}} }, 47778:function _(e,t,n){function r(e,t,n){for(var r=e.length,i=-1,o=1/0,a=NaN,s=0;s1){var s=t[3].split(":");switch(s.length){case 2:n=s[0],a=s[1];break;case 1:n=t[3];break;default:throw new Error("Internal Error"); }}return{username:n,password:a,protocol:"".concat(t[1],":"),host:t[4],query:(0,r.Z)(t[9]||""),hash:(0,i.Z)(e||"")}} }, 8304:function _(e,t,n){n.d(t,{Z:function Z(){return o}}); var r=n(78914),i=n.n(r);function o(e,t){var n=[],r=[];return i()(Array.prototype).call(e,function(e){t(e)?n.push(e):r.push(e)}),[n, r]} }, 3579:function _(e,t,n){n.d(t,{Pv:function Pv(){return l}, a0:function a0(){return d}, od:function od(){return c}}); var r=n(39392),i=n.n(r),o=n(63978),a=n.n(o),s="$rtti.identifier",u=new (i());function l(e){return function(t){return a()(t,s,{value:e,enumerable:!1,configurable:!1,writable:!1}),u.set(e,t),t}} function c(e){return e[s]} function d(e,t){return!!t&&c(e.constructor)===t} l.getClassById=function(e){return u.get(e)}}, 66668:function _(e,t,n){n.d(t,{dX:function dX(){return f}, eg:function eg(){return h}, oQ:function oQ(){return d}}); var r=n(77766),i=n.n(r),o=n(51938),a=n.n(o),s=n(2991),u=n.n(s),l=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, c=/\D*(\d*)(?:\.(\d*)(?:\.(\d*)){0,1}(?:-(\w*)\.(\d+)){0,1}){0,1}/;function d(e){var t,n,r,o,s,u,l,d=null!==(r=c.exec(e))&&void 0!==r?r:[],h=d[1],f=d[2],p=d[3],v=d[4],g=d[5];return v?i()(o=i()(s=i()(u= i()(l="".concat(+(null!=h?h:0),".")).call(l,+(null!=f?f:0),".")).call(u,+(null!=p?p:0),"-")).call(s,v,".")).call(o,a()(g,10)):i()(t=i()(n="".concat(+(null!=h?h:0),".")).call(n,+(null!=f?f:0),".")).call(t, +(null!=p?p:0))} function h(e,t){var n,r,i,o;if(!l.test(e))return!1;if(!l.test(t))return!1;var s=null!==(r=null===(n=l.exec(e))||void 0===n?void 0:u()(n).call(n,function(e){return a()(e,10)}))&&void 0!==r?r:[],c=s[1],d= s[2],h=s[3],f=null!==(o=null===(i=l.exec(t))||void 0===i?void 0:u()(i).call(i,function(e){return a()(e,10)}))&&void 0!==o?o:[],p=f[1],v=f[2],g=f[3]; return c!==p?c>p:d!==v?d>v:h===g||h>g} function f(e){var t=l.exec(e);if(!t)throw new Error("Invalid semantic version: ".concat(e));var n=t[1],r=t[2],i=t[3],o=t[4];return[a()(n,10),a()(r,10),a()(i,10),null!=o?o:null]} }, 78990:function _(e,t,n){n.d(t,{m:function m(){return o}}); var r=n(93476),i=n.n(r);function o(e,t,n){return new (i())(function(r,i){var o=function o(i){r(i),e.removeEventListener(t,o),n&&e.removeEventListener(n,a)},a=function a(r){i(r),e.removeEventListener(t, o),n&&e.removeEventListener(n,a)}; e.addEventListener(t,o),n&&e.addEventListener(n,a)})} }, 25401:function _(e,t,n){n.d(t,{k:function k(){return r}}); var r="http://www.w3.org/2000/xmlns/"}, 12304:function _(e,t,n){n.d(t,{Z:function Z(){return Or}}); var _r22,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(51942),l=n.n(u),c=n(34074),d=n.n(c),h=n(63978),f=n.n(h),p=n(93476),v=n.n(p),g=n(65420),y=n.n(g),m=n(98341),_=n.n(m),E=n(20116),T=n.n(E),b=n(77149),S= n.n(b),w=n(66419),A=n.n(w),R=n(94473),L=n.n(R),I=n(54103),C=n.n(I),O=n(78914),P=n.n(O),k=n(20455),D=n.n(k),x=n(26295),N=n.n(x),M=n(59340),U=n.n(M),F=n(81643),B=n.n(F),V=n(92762),H=n.n(V),j=n(77766),G=n.n(j), K=n(98926),z=n.n(K),W=n(33032),q=n.n(W),Z=n(2991),Y=n.n(Z),X=n(6999),Q=n(16032),J=n.n(Q),$=n(45424),ee=n.n($),te=n(89233),ne=n(57027),re=n(38821),ie=n(14370),oe=n(43608),ae=n(69604),se=n(1558),ue=n(66008), le=n(25971),ce=n(55709),de=n(5602),he=n(71198),fe=n(96381),pe=n(51015),ve=n(33756),ge=n(13068),ye=n(31166),me=n(3018),_e=n(55877),Ee=n(84740),Te=n(83751),be=n(36206),Se=(_r22=function r(e,t){return _r22= o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r22(e,t)},function(e,t){if("function"!=typeof t&& null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r22(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),we=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this; return o()(r,n.prototype),r.name="AbortError",r} return Se(t,e),t}(Error),Ae=function(){var _e0=function e(t,n){return _e0=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e0(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e0(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),Re=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this; return o()(r,n.prototype),r.name="NotAllowedError",r} return Ae(t,e),t}(Error),Le=function(){var _e1=function e(t,n){return _e1=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e1(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e1(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),Ie=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this; return o()(r,n.prototype),r.name="NotSupportedError",r} return Le(t,e),t}(Error),Ce=n(51639),Oe=n(93711),Pe=n(58617),ke=n(84968),De=n(65151),xe=n(43623); function Ne(e){switch(e){case 0:return"portrait-primary";case 90:return"landscape-primary";case -90:return"landscape-secondary";case 180:return"portrait-secondary";default:return}} function Me(e){if(void 0===e&&(e=window),e.orientation)return Ne(e.orientation);var t=e.screen;return t.msOrientation||t.mozOrientation||(t.orientation||{type:void 0}).type||Ne(0)} var Ue=n(59455),Fe=n(43001),Be=function(){var _e10=function e(t,n){return _e10=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e10(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e10(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),_Ve=function Ve(){return _Ve=l()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&f()(t,n,a),a},Nt=y()(),Mt=y()(),Ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t[n]=!0,t[r]=[],t.onchange=null,t.onaddtrack=null,t.onremovetrack=null,t} var n,r;return Dt(t,e),f()(t.prototype,"length",{get:function get(){return this[Mt].length}, enumerable:!1,configurable:!0}),t.prototype[n=Nt,r=Mt,_()]=function(){return Pt()(this[Mt])},t.prototype.getTrackById=function(e){var t,n; return null!==(n=L()(t=this[Mt]).call(t,function(t){return t.id===e}))&&void 0!==n?n:null},t.prototype.pzpGetTracksByGroupId=function(e){var t; return T()(t=this[Mt]).call(t,function(t){return t.pzpGroupId===e})},f()(t.prototype,"pzpFirstEnabledTrack",{get:function get(){var e,t; return null!==(t=L()(e=this[Mt]).call(e,function(e){return e.enabled}))&&void 0!==t?t:null}, enumerable:!1,configurable:!0}),f()(t.prototype,"pzpFirstEnabledIndex",{get:function get(){var e;return rt()(e=this[Mt]).call(e,function(e){return e.enabled})}, enumerable:!1,configurable:!0}),t.upcast=function(e){return e[Nt]?e:null},xt([(0,kt.V)("change")],t.prototype,"onchange",void 0),xt([(0,kt.V)("addtrack")],t.prototype,"onaddtrack",void 0),xt([(0,kt.V)("removetrack")], t.prototype,"onremovetrack",void 0),t}(ht.Z),Ft=function Ft(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=d()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&f()(t,n,a),a},Bt=y()(),Vt=y()(),Ht=y()(),jt=y()(),Gt=y()(),Kt=y()(),zt=y()(); function Wt(e,t){var n,r=!1;return P()(n=e[jt].getArray()).call(n,function(e){var n=e===t;e.enabled!==n&&(qe(e).setProperty("enabled",n),r=!0)}),r} function qt(e,t){var n,r=!1;return P()(n=e[Gt].getArray()).call(n,function(e){var n=e===t;e.selected!==n&&(Qe(e).setProperty("selected",n),r=!0)}),r} function Zt(e){var t,n,r=!1;return P()(t=T()(n=e[jt].getArray()).call(n,function(e){return e.enabled})).call(t,function(e){var t=qe(e); t&&(t.setProperty("enabled",!1),r=!0)}),r} function Yt(e){var t,n,r=!1;return P()(t=T()(n=e[Gt].getArray()).call(n,function(e){return e.selected})).call(t,function(e){var t=Qe(e); t&&(t.setProperty("selected",!1),r=!0)}),r} function Xt(e,t,n){var r=e[Bt][Ge].call(e[Bt],n,t),i=r[0],o=r[1];n&&i&&e[zt](),t&&o&&e[Kt]()} var Qt=function(){function e(e){this[Bt]=e.client,this[jt]=new ot,this[Gt]=It.createWrapper(e.videoTrackList);var t=Ut.upcast(e.audioTrackList);if(!t)throw new Error("Invalid audioTrackList");this[Vt]= t,this[Ht]=e.videoTrackList} var t,n;return e.prototype.clearAudioTracks=function(){this[jt].clear()},e.prototype.clearVideoTracks=function(){this[Gt].clear()},e.prototype.addAudioTrackPrivate=function(e){this[jt].addTrack(new We(e)), e.addClient(this)},e.prototype.addVideoTrackPrivate=function(e){this[Gt].addTrack(new Xe(e)),e.addClient(this)},e.prototype.updateAudioTrackInterface=function(){var e=this[jt]; e&&function(e,t){for(var n=0,r=e[Mt].length;n0&&("low-latency"!==t.kind&&"low-latency-p2p"!==t.kind||(s=L()(l).call(l,function(e){return"low-latency-alt"===e.kind})),s||(s=l[0])),o||(l=T()(u=e[jt].getArray()).call(u,function(e){return""=== e.pzpGroupId&&("alternative"===e.kind||"low-latency-alt"===e.kind)})).length>0&&("low-latency"!==t.kind&&"low-latency-p2p"!==t.kind||(o=L()(l).call(l,function(e){return"low-latency-alt"===e.kind})),o|| (o=l[0])),o?(n.setProperty("selected",!1),[Wt(e,o), !0]):[!1,!1]}(e,t,n,r)}(this,e,i))[0],s=o[1]; (s||a)&&Xt(this,a,s)}}else i.setProperty(t,n)},Ft([je(0)],e.prototype,t,null),Ft([je(0)],e.prototype,n,null),e}(),Jt=n(6272),$t=function(){var _e15=function e(t,n){return _e15=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e15(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e15(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),en=function(e){function t(t){var n=e.call(this)||this; return n.bindTrack(t),n.dataset={},n} return $t(t,e),f()(t.prototype,"id",{get:function get(){return this._id}, enumerable:!1,configurable:!0}),f()(t.prototype,"activeCues",{get:function get(){return this._nativeTrack.activeCues}, enumerable:!1,configurable:!0}),f()(t.prototype,"cues",{get:function get(){return this._nativeTrack.cues}, enumerable:!1,configurable:!0}),f()(t.prototype,"kind",{get:function get(){return this._nativeTrack.kind}, enumerable:!1,configurable:!0}),f()(t.prototype,"label",{get:function get(){return this._nativeTrack.label}, set:function set(e){f()(this._nativeTrack,"label",{get:function get(){return e}, configurable:!0})}, enumerable:!1,configurable:!0}),f()(t.prototype,"language",{get:function get(){return this._nativeTrack.language}, enumerable:!1,configurable:!0}),f()(t.prototype,"inBandMetadataTrackDispatchType",{get:function get(){return this._nativeTrack.inBandMetadataTrackDispatchType}, enumerable:!1,configurable:!0}),f()(t.prototype,"mode",{get:function get(){return this._nativeTrack.mode}, set:function set(e){this._mode=e,this._nativeTrack.mode!==e&&(this._nativeTrack.mode=e,this.dispatchEvent(new Jt.z(Jt.z.CHANGE,this)))}, enumerable:!1,configurable:!0}),f()(t.prototype,"oncuechange",{get:function get(){return this._nativeTrack.oncuechange}, set:function set(e){this._nativeTrack.oncuechange=e}, enumerable:!1,configurable:!0}),t.prototype.addCue=function(e){this._nativeTrack.addCue(e)},t.prototype.removeCue=function(e){this._nativeTrack.removeCue(e)},f()(t.prototype,"trackElement",{get:function get(){return this._nativeTrack}, enumerable:!1,configurable:!0}),t.prototype.bindTrack=function(e){var t=this,n=this._mode;this._id=this._getTrackId(e),this._nativeTrack=e,this._nativeTrack.mode=n||"disabled",e.addEventListener("cuechange", function(e){return t.dispatchEvent(e)})},t.prototype._getTrackId=function(e){var t; return T()(t=[e.kind,e.label,e.language]).call(t,function(e){return!!e}).join("_")},t}(ht.Z),tn=en,nn=n(1996); function rn(){if("undefined"==typeof navigator)return null;var e="".concat(navigator.userAgent);if(!e.match(/Version\/[\d.]+.*Safari/)||"Apple Computer, Inc."!=="".concat(navigator.vendor))return null; var t=e.match(/Version\/(\d+)/);return t&&t[1]?dt()(t[1],10):null} function on(){return 26===rn()} var an=function(){var _e16=function e(t,n){return _e16=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}, _e16(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e16(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),sn=function(e){function t(t){var n=e.call(this)||this; return n._cachedActiveCues=null,n._cachedPlayhead=NaN,n._cachedCuesLength=-1,n._nativeTrack=t,n._playhead=NaN,n} return an(t,e),f()(t.prototype,"activeCues",{get:function get(){var e,t;if(on()&&isFinite(this._playhead)){var n=null!==(t=null===(e=this._nativeTrack.cues)||void 0===e?void 0:e.length)&&void 0!==t?t:0; if(this._playhead===this._cachedPlayhead&&n===this._cachedCuesLength&&this._cachedActiveCues)return this._cachedActiveCues;var r=function(e,t,n){var r=[];if(!e.cues||0===e.cues.length)return r;for(var i= e.cues,o=0,a=i.length-1,s=-1;o<=a;){var u=Math.floor((o+a)/2);i[u].startTime<=t?(s=u,o=u+1):a=u-1}if(-1===s)return r;for(var l=s;l>=0;l--){var c=i[l];if(t-c.startTime>1)break;r.unshift(c)}return r}(this, this._playhead); return this._cachedActiveCues=(0,nn.T)(r),this._cachedPlayhead=this._playhead,this._cachedCuesLength=n,this._cachedActiveCues}return this._nativeTrack.activeCues}, enumerable:!1,configurable:!0}),f()(t.prototype,"cues",{get:function get(){return this._nativeTrack.cues}, enumerable:!1,configurable:!0}),f()(t.prototype,"kind",{get:function get(){return this._nativeTrack.kind}, enumerable:!1,configurable:!0}),f()(t.prototype,"label",{get:function get(){return this._nativeTrack.label}, enumerable:!1,configurable:!0}),f()(t.prototype,"language",{get:function get(){return this._nativeTrack.language}, enumerable:!1,configurable:!0}),f()(t.prototype,"inBandMetadataTrackDispatchType",{get:function get(){return this._nativeTrack.inBandMetadataTrackDispatchType}, enumerable:!1,configurable:!0}),f()(t.prototype,"mode",{get:function get(){return this._nativeTrack.mode}, set:function set(e){this._nativeTrack.mode=e}, enumerable:!1,configurable:!0}),f()(t.prototype,"oncuechange",{get:function get(){return this._nativeTrack.oncuechange}, set:function set(e){this._nativeTrack.oncuechange=e}, enumerable:!1,configurable:!0}),t.prototype.addCue=function(e){this._nativeTrack.addCue(e),this._invalidateActiveCues(this._playhead)},t.prototype.removeCue=function(e){this._nativeTrack.removeCue(e),this._invalidateActiveCues(this._playhead)}, t.prototype.addEventListener=function(e,t,n){this._nativeTrack.addEventListener(e,t,n)},t.prototype.removeEventListener=function(e,t,n){this._nativeTrack.removeEventListener(e,t,n)},f()(t.prototype,"trackElement", {get:function get(){return this._nativeTrack}, enumerable:!1,configurable:!0}),t.prototype.bindTrack=function(e){var t=this._nativeTrack.mode;this._nativeTrack=e,this._nativeTrack.mode=t,this._invalidateActiveCues(NaN)},t.prototype._invalidateActiveCues= function(e){this._playhead=e,this._cachedActiveCues=null,this._cachedPlayhead=NaN,this._cachedCuesLength=-1},t._fixActiveCues=function(e,t){e._invalidateActiveCues(t)},t}(ht.Z),un=n(37955),ln=function(){var _e17= function e(t,n){return _e17=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e17(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e17(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),cn=function(e){function t(t,n){var r=e.call(this,t)||this; return r.track=n,r} return ln(t,e),t.CHANGE="change",t.ADD_TRACK="addtrack",t.REMOVE_TRACK="removetrack",t.LOAD="load",t}(Fe.x),dn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t._onTrackReady=function(e){t.dispatchEvent(new cn("_internal_ready_",e.track))},t._onTrackChange=function(e){t.dispatchEvent(new cn(cn.CHANGE,e.track))},t._onTrackLoad=function(e){t.dispatchEvent(new cn(cn.LOAD, e.track))},t} return ln(t,e),t.prototype[_()]=function(){var e,t;return function(e,t){var n,r,i,o,a={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof y()&&(o[_()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&H()(n=this._callbacks).call(n,r,1)},e.prototype.start=function(){return-1===this._timer&&(this._timer=Fn()(this._onTick,1E3)),this._timer},e.prototype.stop=function(){window.clearInterval(this._timer), this._timer=-1},e.prototype.resetCount=function(){this._count=0},e.prototype._onTick=function(){var e,t=this; P()(e=this._callbacks).call(e,function(e){e(t._count)}),this._count++},e._instance=new e,e}(),Vn=Bn,Hn=n(32366),jn=n.n(Hn),Gn=n(63938),_Kn=function Kn(){return _Kn=l()||function(e){for(var t,n=1,r=arguments.length;n< r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]); return e},_Kn.apply(this,arguments)},zn=function(){function e(){} return e.prototype.initialize=function(t){var n;this._processorMap=jn()(n=e._registeredProcessors).call(n,function(e,n){var r;try{var i=new n;return i.initialize(t),_Kn(_Kn({},e),((r={})[n[Gn.R]]=i,r))}catch(t){return console.error(t), e}},{})},e.prototype.configure=function(){for(var e=this,t=[],n=0;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&f()(t,n,a),a},Rr=function Rr(e,t,n,r){return new (n||(n=v()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},Lr=function Lr(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof y()&&(o[_()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)o[0].bindTrack(e.track);else{var a,s=S()(a=A()(t.textTracks)).call(a,function(t){var n,r;return(t instanceof sn?t.trackElement:null!==(r=null===(n=t.trackElement)||void 0===n?void 0:n.track)&& void 0!==r?r:null)===e.track}); if(s)return;t.textTracks.addTrack(new sn(e.track))}break;case "subtitles":var u,l=T()(u=t._findReusableInbandTextTracks()).call(u,function(e){return"subtitles"===e.kind&&e instanceof tn}); if(l.length>0)for(var c=0,d=l;c=1&&r._duration!==r.player.duration&&r._setDuration(r.player.duration)}),this._onSourceABRLevelSwitched$.subscribe(function(e){var t= r.videoTracks.selectedIndex,n=e instanceof Te.Z?e:r.player,i=n.videoWidth,o=n.videoHeight; r.videoTracks[t].width=i,r.videoTracks[t].height=o,r._setVideoSizeInternal(i,o),r._updateVideoTrackColorSpace(e),r.dispatchEvent(e)}),this.player.textTracks.addEventListener("addtrack",this._onSourceTextTrackAdded), (0,ne.R)(this.adsController,Q.AdEventTypes.AdBreakReady).pipe((0,ce.U)(function(){var e; return(null===(e=r.adsController.currentAd)||void 0===e?void 0:e.adPlacementType)||""}),(0,fe.w)(function(e){return(0,ne.R)(r.adsController,Q.AdEventTypes.ContentResumeRequested).pipe((0,de.h)(e),(0,se.R)((0, ie.T)((0,ne.R)(r,Tn.Z.ABORT),(0,ne.R)(r,Tn.Z.ERROR))))})).subscribe(function(e){return Rr(r,void 0,void 0,function(){var t; return Lr(this,function(n){switch(n.label){case 0:return this.player.ended||!this.player.paused?[3,2]:("pre"===e&&this.duration===1/0&&(t=this.seekable).length>0&&(this.player.currentTime=t.end(t.length- 1)),[4,this.play()]);case 1:n.sent(),n.label=2;case 2:return[2]}})})})},t.prototype._findReusableInbandTextTracks=function(){for(var e=[],t=0;t=2)){var s=B()(n=this._preventPropagationEvents).call(n,a);if(s>-1){var u;H()(u=this._preventPropagationEvents).call(u, s,1)}else{if("ratechange"===a&&this.player.playbackRate!==this.playbackRate){if(this._preventPropagationEvents.length>0)return;this._playbackRateImmutable||(null===(i=this.getPreProcessorControl("hls"))|| void 0===i?void 0:i.isCatchUpRateActive)||(this._playbackRate=this.player.playbackRate)}"playing"===a&&(this._preventPropagationEvents=[],this._playbackRateImmutable=!1),this.dispatchEvent(new Tn.Z(a))}}}, t.prototype._updateNetworkState=function(e){var t=this._networkState; this._networkState=e,t!==e&&0===e&&(this.dispatchEvent(new Tn.Z(Tn.Z.EMPTIED)),this.dispatchEvent(new Tn.Z(Tn.Z.TIME_UPDATE)))},t.prototype._updateReadyState=function(e){var t=this.readyState; void 0===e?(this._readyState=0,this._hasEnoughMetadata()&&(this._readyState=1,t<1&&this.dispatchEvent(new Tn.Z(Tn.Z.LOADED_METADATA)))):this._readyState=e},t.prototype._hasEnoughMetadata=function(){return!isNaN(this.duration)&& !!this._wasProviderVideoSizeLoaded},t.prototype._setDuration=function(e){this._duration=e,this.dispatchEvent(new Tn.Z(Tn.Z.DURATION_CHANGED))},t.prototype._setVideoSize=function(e,t){this._wasProviderVideoSizeLoaded= !0,this._setVideoSizeInternal(e,t)},t.prototype._setVideoSizeInternal=function(e,t){this._videoWidth=e,this._videoHeight=t,this.dispatchEvent(new Tn.Z(Tn.Z.RESIZE))},t.prototype._updateVideoTrackColorSpace= function(e){return Rr(this,void 0,void 0,function(){var n,r,i; return Lr(this,function(o){switch(o.label){case 0:if(!((n=this.videoTracks[this.videoTracks.selectedIndex])&&n instanceof pn.S))return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fn(t.unwrap(this), this.videoTracks.selectedIndex)];case 2:return(r=o.sent())&&("canplay"===e.type&&(n.videoColorspaceInfo=r),pn.S._setHdrFormat(n,r)),[3,4];case 3:return i=o.sent(),ee().mark(this,"debug.unable_to_read_colorspace_info", {message:(a=i,a instanceof Error?a.message:"string"==typeof a?a:""),level:"warn"}),[3,4];case 4:return[2]}var a})})},t.prototype._setTextTracks=function(e){this._clearTextTracks(); for(var t=0,n=e;t-1?"\x26":"#","t\x3d")).call(t,o._lastCurrentTime)}; if(this.ended||this.player.videoTracks)return!1;this._wasPlayingBeforeTrackChanges=null!==(t=this._wasPlayingBeforeTrackChanges)&&void 0!==t?t:!this.player.paused;var l=(0,ur.Z)(this.player.seekable),c= null===(i=null===(r=null===(n=this.srcObject)||void 0===n?void 0:n.data)||void 0===r?void 0:r.live)||void 0===i?void 0:i.timeMachine;if("boolean"==typeof c&&!1===c)s=e,this._lastCurrentTime=NaN;else if(isFinite(l)&& l>0){var d=!0===c,h=isFinite(this.duration)&&!d?0:this.player.seekable.start(0);this._lastCurrentTime=this._lastCurrentTime||this.currentTime-h,s=u(s)}else this._lastCurrentTime>0?s=u(s):(s=e,this._lastCurrentTime= NaN);return s=this._appendSourceParams(s),this.player.src=s,!0},t.prototype._afterSwitchCurrentSrc=function(){var e,t,n=this,r=this._wasPlayingBeforeTrackChanges; (null===(e=this.getPreProcessorControl("vr"))||void 0===e?void 0:e.enabled())||this._showDimmedLayer();var i,o=(0,ie.T)(this._onCoreAbort$,this._onCoreError$).pipe((0,ge.b)(function(){return n._hideDimmedLayer()})), a=(0,ne.R)(this.player,ke.Z.LOAD_START).pipe((0,pe.q)(1),(0,se.R)(o),(0,ge.b)(function(){r?n.player.play():n.player.load()}),(0,ye.n)(),(0,me.x)()),s=(0,ne.R)(this.player,ke.Z.SEEKED),u=(0,ne.R)(this.player, ke.Z.CAN_PLAYTHROUGH),l=(0,ne.R)(this.player,ke.Z.TIME_UPDATE),c=null===(t=(0,xe.Xh)())||void 0===t?void 0:t.toLowerCase(); i="firefox"===c||"ie"===c||(0,xe.rO)()?(0,ie.T)(u,(0,ne.R)(this.player,ke.Z.CAN_PLAY),(0,ae.H)(0,250).pipe((0,ce.U)(function(){var e;return null!==(e=ir(n.player))&&void 0!==e?e:0}),(0,ue.h)(function(e){return e> Math.max(n.playbackRate,.5)}))):u,a.pipe((0,fe.w)(function(){return!z()(n._lastCurrentTime)&&n._lastCurrentTime>0?isFinite(n.duration)?n.paused?s:s.pipe((0,pe.q)(1),(0,he.c)(l)):(0,ie.T)((0,ae.H)(0,250).pipe((0, ce.U)(function(){var e; return null!==(e=ir(n.player))&&void 0!==e?e:0}),(0,ue.h)(function(e){return e>Math.max(n.playbackRate,.5)})),s.pipe((0,fe.w)(function(){return l}))):i}),(0,pe.q)(1),(0,se.R)(o)).subscribe(function(){n._wasPlayingBeforeTrackChanges= void 0,n._lastCurrentTime=NaN,n._hideDimmedLayer(),n._clearMetadataTextTrack()}); var d=this._playbackRate;a.pipe((0,fe.w)(function(){return(0,ne.R)(n.player,ke.Z.PLAYING)}),(0,pe.q)(1)).subscribe(function(){n._keepPlaybackProperties(),1===n.playbackRate&&d!==n.playbackRate&&n.dispatchEvent(new Tn.Z("ratechange"))})}, t.prototype._setCurrentSrc=function(e,t){var n=t.width,r=t.height,i=t.kind; this._currentSrc=Mn(this.src,e),this._currentSrcMetadata={width:n,height:r,kind:i}},t.prototype._loadCurrentSrc=function(){this.player.src=this._appendSourceParams(this._currentSrc)},t.prototype._appendSourceParams= function(e){var t; if(!e)return e;var n={tid:this._getSession().sessionId};return(null===(t=this._currentSrcMetadata)||void 0===t?void 0:t.kind)&&(n.kind=this._currentSrcMetadata.kind),function(e,t,n){var r,i,o,a,s,u=N()(t); if(0===u.length)return e;var l=B()(e).call(e,"#"),c=(null==n?void 0:n.unique)?new (mt())(T()(r=Y()(i=l>-1?$e()(e).call(e,l+1).split("\x26"):[]).call(i,function(e){return e.split("\x3d")[0]})).call(r,Boolean)): new (mt()),d=Y()(o=T()(u).call(u,function(e){var t=e[0]; return!c.has(t)})).call(o,function(e){var t,n=e[0],r=e[1]; return G()(t="".concat(n,"\x3d")).call(t,encodeURIComponent(r))}); if(0===d.length)return e;var h=l>-1?"\x26":"#";return G()(a=G()(s="".concat(e)).call(s,h)).call(a,d.join("\x26"))}(e,n,{unique:!0})},t.prototype._switchCurrentSrc=function(){this._currentSrcMetadata&&(this._beforeSwitchCurrentSrc(this._currentSrcMetadata), this._switchCurrentSrcInternal(this._currentSrc)&&this._afterSwitchCurrentSrc())},t.prototype._setAudioTrackPrivates=function(e){if(!Ut.upcast(this.audioTracks))throw new TypeError; var t=L()(e).call(e,function(e){return e.getProperty("enabled")&&""===e.getProperty("pzpGroupId")}); t&&P()(e).call(e,function(e){e.setProperty("enabled",e===t)}),this._trackManager.clearAudioTracks(); for(var n=0,r=e;n1?(t.load(),e._warmUpInternal().then(n,r)):(e._preventPropagationEvents=[],t.pause(),r(new Re("The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.")))}, 3E4),a=t.playbackRate; t.playbackRate=0,e._playbackRateImmutable=!0,e._playbackRate=a,t.play().then(function(){i||(clearTimeout(o),t.pause(),e._restorePlaybackRate(t),(0,ne.R)(t,"pause").pipe((0,pe.q)(1)).subscribe(function(){e._preventPropagationEvents= []}),n())})["catch"](function(n){var a,s; i||(e._nelo.send({type:"warmup",result:"rejected",protocol:null!==(s=null===(a=e.srcObject)||void 0===a?void 0:a.protocol)&&void 0!==s?s:"unknown"}),e._restorePlaybackRate(t),clearTimeout(o),e._preventPropagationEvents= [],r(n))})})},t.prototype.pause=function(){var e,t,n=null===(e=this._pendingLoad)||void 0===e?void 0:e.waitingPlays; n&&n.length>0&&(this._paused=!0,P()(t=H()(n).call(n,0)).call(t,function(e){(0,e.reject)(new we("The operation was aborted."))})),this.player.pause()},t.prototype.dispatchEvent=function(t){return ee().mark(this, "player.event.".concat(t.type)),e.prototype.dispatchEvent.call(this,t)},t.prototype._load=function(){if(this._initLoadStart())return this._shouldFetchMetadata()?void this._startLoadSrcObject():(this._updateNetworkState(1), void this.dispatchEvent(new Tn.Z(Tn.Z.SUSPEND)))},t.prototype.load=function(){this._initLoadStart()&&this._startLoadSrcObject()},t.prototype._invalidatePendingLoad=function(){var e,t,n=this._pendingLoad; n&&(this._pendingLoad=void 0,P()(e=H()(t=n.waitingPlays).call(t,0)).call(e,function(e){(0,e.reject)(new we("The operation was aborted."))}))},t.prototype._startLoadSrcObject=function(){var e=this,t={waitingPlays:[]}; this._invalidatePendingLoad(),this._pendingLoad=t;var n=function n(_n5){var r,i,o;e._pendingLoad===t&&(e._pendingLoad=void 0),P()(r=H()(i=t.waitingPlays).call(i,0)).call(r,function(e){return(0,e.resolve)()}), _n5&&(0,Tr.jd)("load_src_object_unexpected_error",_n5.message,null===(o=e._dumpState)||void 0===o?void 0:o.call(e))}; this._loadSrcObject().then(function(){return n()},n)},t.prototype._initLoadStart=function(){return this._invalidatePendingLoad(),this._initVideoMetadata(),this.playbackRate=this.defaultPlaybackRate,this._updateNetworkState(3), null===this._selectResource()?(this._updateNetworkState(0),!1):(this._updateNetworkState(2),!!this.dispatchEvent(new Tn.Z(Tn.Z.LOAD_START))||(this._updateNetworkState(1),!1))},t.prototype._loadSrcObject= function(){return Rr(this,void 0,void 0,function(){var e; return Lr(this,function(t){switch(t.label){case 0:if(null===this.srcObject)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),this._resetPlaybackSession(),ee().mark(this,"debug.player.loadstart"), [4,this.srcObject.load()];case 2:return t.sent(),ee().mark(this,"debug.player.loaded"),[3,4];case 3:return e=t.sent(),this._handleLoadError(e)?[3,4]:[2];case 4:return this._updateReadyState(),this.error|| !this._shouldSetSrcOfSourcePlayer()||this.player.src?(this._updateNetworkState(1),this.dispatchEvent(new Tn.Z(Tn.Z.SUSPEND))):this._loadCurrentSrc(),this._shouldPlayThrough()?(this._playThrough(),[2]): (this.error&&this.dispatchEvent(new Tn.Z(Tn.Z.ERROR)),[2])}})})},t.prototype._playThrough=function(){var e=this.play(); void 0!==(null==e?void 0:e["catch"])&&e["catch"](function(e){switch(e.name){case "AbortError":case "NotAllowedError":case "NotSupportedError":return;default:throw e;}})},t.prototype._handleLoadError=function(e){return ee().mark(this, "debug.player.loaderror",{reason:e}),"Abort"!==e.message&&(this._setError(2,"MEDIA_ERR_NETWORK"),this._updateNetworkState(3),this.dispatchEvent(new Tn.Z(Tn.Z.ERROR)),!0)},t.prototype._handleAbort=function(){this._setError(1, "MEDIA_ERR_ABORTED"),this.dispatchEvent(new Fe.x(Tn.Z.ABORT)),this._updateNetworkState(0===this._readyState?0:1)},t.prototype._shouldFetchMetadata=function(){return!!this._shouldPlayThrough()||!!this._shouldSetSrcOfSourcePlayer()|| "auto"===this.preload||"metadata"===this.preload},t.prototype._shouldSetSrcOfSourcePlayer=function(){return!!this._shouldPlayThrough()||!this._paused||"auto"===this.preload},t.prototype._shouldPlayThrough= function(){return this._canAutoplay&&this.autoplay&&!this.error},t.prototype._selectResource=function(){return this.srcObject?this.srcObject:null},t.prototype._showDimmedLayer=function(){this._dimEl.classList.remove("wpc-dis-hid")}, t.prototype._hideDimmedLayer=function(){this._dimEl.classList.add("wpc-dis-hid")},t.prototype._clearMetadataTextTrack=function(){var e,t=A()(this.player.textTracks),n=this.textTracks; P()(e=A()(n)).call(e,function(e){if("metadata"===e.kind&&!vn(e)){var r=e.trackElement;L()(t).call(t,function(e){return e===r})||n.removeTrack(e)}})},t.prototype._getDesiredAdBitrate=function(){var e=0; try{var t=this.videoTracks[this.videoTracks.selectedIndex];e+=isFinite(t.videoBitrate)?t.videoBitrate:0,e+=isFinite(t.audioBitrate)?t.audioBitrate:0}catch(e){}if(0===e&&(this.player.videoWidth||this.player.videoHeight))for(var n= this.player,r=n.videoWidth,i=n.videoHeight,o=0;0===e&&o1||1===this.networkState&&(this.readyState<1&&this._shouldFetchMetadata()?this._load():this._shouldSetSrcOfSourcePlayer()&&!this.player.src&&this._loadCurrentSrc())}, enumerable:!1,configurable:!0}),t.prototype.addTextTrack=function(e,t,n){var r={label:"",language:"",country:"",fanName:"",locale:"",type:"",source:""};t&&(r.label=t),n&&(r.language=n);var i="chapters"=== e?new un.h(r,void 0,e):new Jt.Z(r,void 0,e);return this.textTracks.addTrack(i),i.mode="hidden",i},t.prototype.pzpRemoveTextTrack=function(e){this.textTracks.removeTrack(e)},t.prototype._clearTextTracks= function(){for(var e=0;e=t.priority);); a()(e).call(e,n+1,0,t)},e.prototype.dispatchEvent=function(e){var t=this.events.get(e.type)||[]; if(!t||0===t.length)return!0;var n=u()(t).call(t);this.setEventTarget(e,this),this.setEventCurrentTarget(e,this),this.setEventPhase(e,e.AT_TARGET),this.setEventTrust(e,!0);for(var r=!1,i=0,o=n;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>_r27,_o2=!(_i3>>>7==0&&0==t),_a4=255&(_o2?128|_i3:_i3);if(n.push(_a4),!_o2)return}var r=e>>>28&15|(7&t)<<4,i=!(t>>3==0);if(n.push(255&(i?128|r:r)),i){for(var _e20=3;_e20<31;_e20+=7){var _r28=t>>>_e20, _i4=!(_r28>>>7==0),_o3=255&(_i4?128|_r28:_r28);if(n.push(_o3),!_i4)return}n.push(t>>>31&1)}} var ie=4294967296;function oe(e){var t="-"===e[0];t&&(e=e.slice(1));var n=1E6;var r=0,i=0;function o(t,o){var a=Number(e.slice(t,o));i*=n,r=r*n+a,r>=ie&&(i+=r/ie|0,r%=ie)} return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?ue(r,i):se(r,i)} function ae(e,t){var _ref3;if(_ref3=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t),e=_ref3.lo,t=_ref3.hi,_ref3,t<=2097151)return String(ie*t+e); var n=16777215&(e>>>24|t<<8),r=t>>16&65535;var i=(16777215&e)+6777216*n+6710656*r,o=n+8147497*r,a=2*r;var s=1E7;return i>=s&&(o+=Math.floor(i/s),i%=s),o>=s&&(a+=Math.floor(o/s),o%=s),a.toString()+le(o)+ le(i)} function se(e,t){return{lo:0|e,hi:0|t}} function ue(e,t){return t=~t,e?e=1+~e:t+=1,se(e,t)} var le=function le(e){var t=String(e);return"0000000".slice(t.length)+t}; function ce(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(var _n6=0;_n6<9;_n6++)t.push(127&e|128),e>>=7;t.push(1)}} var de=he();function he(){var e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"== typeof e.setBigUint64&&("object"!=(typeof process==="undefined"?"undefined":_typeof(process))||"object"!=_typeof(process.env)||"1"!==process.env.BUF_BIGINT_DISABLE)){var _t3=BigInt("-9223372036854775808"), _n7=BigInt("9223372036854775807"),_r29=BigInt("0"),_i5=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse:function parse(e){var r="bigint"==typeof e?e:BigInt(e);if(r>_n7||r<_t3)throw new Error("invalid int64: ".concat(e)); return r}, uParse:function uParse(e){var t="bigint"==typeof e?e:BigInt(e);if(t>_i5||t<_r29)throw new Error("invalid uint64: ".concat(e));return t}, enc:function enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}}, uEnc:function uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}}, dec:function dec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)}, uDec:function uDec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0)}}}return{zero:"0", supported:!1,parse:function parse(e){return"string"!=typeof e&&(e=e.toString()),fe(e),e}, uParse:function uParse(e){return"string"!=typeof e&&(e=e.toString()),pe(e),e}, enc:function enc(e){return"string"!=typeof e&&(e=e.toString()),fe(e),oe(e)}, uEnc:function uEnc(e){return"string"!=typeof e&&(e=e.toString()),pe(e),oe(e)}, dec:function dec(e,t){return function(e,t){var n=se(e,t);var r=2147483648&n.hi;r&&(n=ue(n.lo,n.hi));var i=ae(n.lo,n.hi);return r?"-"+i:i}(e,t)}, uDec:function uDec(e,t){return ae(e,t)}}} function fe(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e);} function pe(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e);} var ve=Symbol["for"]("@bufbuild/protobuf/text-encoding");var ge;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup= 4]="EndGroup",e[e.Bit32=5]="Bit32"}(ge||(ge={})); var ye=function(){function ye(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(){if(null==globalThis[ve]){var _e21=new globalThis.TextEncoder,_t4=new globalThis.TextDecoder;globalThis[ve]= {encodeUtf8:function encodeUtf8(t){return _e21.encode(t)}, decodeUtf8:function decodeUtf8(e){return _t4.decode(e)}, checkUtf8:function checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[ve]}().encodeUtf8; _classCallCheck(this,ye);this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]} _createClass(ye,[{key:"finish",value:function finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);var e=0;for(var _t5=0;_t5>>0)}}, {key:"raw",value:function raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}}, {key:"uint32",value:function uint32(e){for(_e(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}}, {key:"int32",value:function int32(e){return me(e),ce(e,this.buf),this}}, {key:"bool",value:function bool(e){return this.buf.push(e?1:0),this}}, {key:"bytes",value:function bytes(e){return this.uint32(e.byteLength),this.raw(e)}}, {key:"string",value:function string(e){var t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}}, {key:"float",value:function float(e){!function(e){if("string"==typeof e){var _t6=e;if(e=Number(e),isNaN(e)&&"NaN"!==_t6)throw new Error("invalid float32: "+_t6);}else if("number"!=typeof e)throw new Error("invalid float32: "+ _typeof(e));if(Number.isFinite(e)&&(e>3.4028234663852886E38||e<-3.4028234663852886E38))throw new Error("invalid float32: "+e);}(e); var t=new Uint8Array(4);return(new DataView(t.buffer)).setFloat32(0,e,!0),this.raw(t)}}, {key:"double",value:function double(e){var t=new Uint8Array(8);return(new DataView(t.buffer)).setFloat64(0,e,!0),this.raw(t)}}, {key:"fixed32",value:function fixed32(e){_e(e);var t=new Uint8Array(4);return(new DataView(t.buffer)).setUint32(0,e,!0),this.raw(t)}}, {key:"sfixed32",value:function sfixed32(e){me(e);var t=new Uint8Array(4);return(new DataView(t.buffer)).setInt32(0,e,!0),this.raw(t)}}, {key:"sint32",value:function sint32(e){return me(e),ce(e=(e<<1^e>>31)>>>0,this.buf),this}}, {key:"sfixed64",value:function sfixed64(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=de.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}}, {key:"fixed64",value:function fixed64(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=de.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}}, {key:"int64",value:function int64(e){var t=de.enc(e);return re(t.lo,t.hi,this.buf),this}}, {key:"sint64",value:function sint64(e){var t=de.enc(e),n=t.hi>>31;return re(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}}, {key:"uint64",value:function uint64(e){var t=de.uEnc(e);return re(t.lo,t.hi,this.buf),this}}]); return ye}(); function me(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+_typeof(e));if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int32: "+ e);} function _e(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+_typeof(e));if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint32: "+ e);} var Ee,Te,be,Se,we,Ae,Re,Le,Ie,Ce,Oe,Pe,ke,De;!function(e){e[e.MEDIA_EVENT_UNKNOWN=0]="MEDIA_EVENT_UNKNOWN",e[e.MEDIA_EVENT_LOADSTART=1]="MEDIA_EVENT_LOADSTART",e[e.MEDIA_EVENT_PROGRESS=2]="MEDIA_EVENT_PROGRESS", e[e.MEDIA_EVENT_SUSPEND=3]="MEDIA_EVENT_SUSPEND",e[e.MEDIA_EVENT_ABORT=4]="MEDIA_EVENT_ABORT",e[e.MEDIA_EVENT_ERROR=5]="MEDIA_EVENT_ERROR",e[e.MEDIA_EVENT_EMPTIED=6]="MEDIA_EVENT_EMPTIED",e[e.MEDIA_EVENT_STALLED= 7]="MEDIA_EVENT_STALLED",e[e.MEDIA_EVENT_LOADEDMETADATA=8]="MEDIA_EVENT_LOADEDMETADATA",e[e.MEDIA_EVENT_LOADEDDATA=9]="MEDIA_EVENT_LOADEDDATA",e[e.MEDIA_EVENT_CANPLAY=10]="MEDIA_EVENT_CANPLAY",e[e.MEDIA_EVENT_CANPLAYTHROUGH= 11]="MEDIA_EVENT_CANPLAYTHROUGH",e[e.MEDIA_EVENT_PLAYING=12]="MEDIA_EVENT_PLAYING",e[e.MEDIA_EVENT_WAITING=13]="MEDIA_EVENT_WAITING",e[e.MEDIA_EVENT_SEEKING=14]="MEDIA_EVENT_SEEKING",e[e.MEDIA_EVENT_SEEKED= 15]="MEDIA_EVENT_SEEKED",e[e.MEDIA_EVENT_ENDED=16]="MEDIA_EVENT_ENDED",e[e.MEDIA_EVENT_DURATIONCHANGE=17]="MEDIA_EVENT_DURATIONCHANGE",e[e.MEDIA_EVENT_TIMEUPDATE=18]="MEDIA_EVENT_TIMEUPDATE",e[e.MEDIA_EVENT_PLAY= 19]="MEDIA_EVENT_PLAY",e[e.MEDIA_EVENT_PAUSE=20]="MEDIA_EVENT_PAUSE",e[e.MEDIA_EVENT_RATECHANGE=21]="MEDIA_EVENT_RATECHANGE",e[e.MEDIA_EVENT_RESIZE=22]="MEDIA_EVENT_RESIZE",e[e.MEDIA_EVENT_VOLUMECHANGE= 23]="MEDIA_EVENT_VOLUMECHANGE",e[e.MEDIA_EVENT_ENCRYPTED=24]="MEDIA_EVENT_ENCRYPTED"}(Ee||(Ee={})),function(e){e[e.AD_EVENT_UNKNOWN=0]="AD_EVENT_UNKNOWN",e[e.AD_EVENT_LOADED=1]="AD_EVENT_LOADED",e[e.AD_EVENT_METADATA= 2]="AD_EVENT_METADATA",e[e.AD_EVENT_STARTED=3]="AD_EVENT_STARTED",e[e.AD_EVENT_STOPPED=4]="AD_EVENT_STOPPED",e[e.AD_EVENT_SKIPPED=5]="AD_EVENT_SKIPPED",e[e.AD_EVENT_LINEARCHANGE=6]="AD_EVENT_LINEARCHANGE", e[e.AD_EVENT_SIZECHANGE=7]="AD_EVENT_SIZECHANGE",e[e.AD_EVENT_EXPANDEDCHANGE=8]="AD_EVENT_EXPANDEDCHANGE",e[e.AD_EVENT_SKIPPABLESTATECHANGE=9]="AD_EVENT_SKIPPABLESTATECHANGE",e[e.AD_EVENT_REMAININGTIMECHANGE= 10]="AD_EVENT_REMAININGTIMECHANGE",e[e.AD_EVENT_DURATIONCHANGE=11]="AD_EVENT_DURATIONCHANGE",e[e.AD_EVENT_VOLUMECHANGE=12]="AD_EVENT_VOLUMECHANGE",e[e.AD_EVENT_IMPRESSION=13]="AD_EVENT_IMPRESSION",e[e.AD_EVENT_VIDEOSTART= 14]="AD_EVENT_VIDEOSTART",e[e.AD_EVENT_VIDEOFIRSTQUARTILE=15]="AD_EVENT_VIDEOFIRSTQUARTILE",e[e.AD_EVENT_VIDEOMIDPOINT=16]="AD_EVENT_VIDEOMIDPOINT",e[e.AD_EVENT_VIDEOTHIRDQUARTILE=17]="AD_EVENT_VIDEOTHIRDQUARTILE", e[e.AD_EVENT_VIDEOCOMPLETE=18]="AD_EVENT_VIDEOCOMPLETE",e[e.AD_EVENT_CLICKTHRU=19]="AD_EVENT_CLICKTHRU",e[e.AD_EVENT_INTERACTION=20]="AD_EVENT_INTERACTION",e[e.AD_EVENT_USERACCEPTINVITATION=21]="AD_EVENT_USERACCEPTINVITATION", e[e.AD_EVENT_USERMINIMIZE=22]="AD_EVENT_USERMINIMIZE",e[e.AD_EVENT_USERCLOSE=23]="AD_EVENT_USERCLOSE",e[e.AD_EVENT_PAUSED=24]="AD_EVENT_PAUSED",e[e.AD_EVENT_PLAYING=25]="AD_EVENT_PLAYING",e[e.AD_EVENT_LOG= 26]="AD_EVENT_LOG",e[e.AD_EVENT_ERROR=27]="AD_EVENT_ERROR",e[e.AD_EVENT_CONTENTPAUSEREQUESTED=28]="AD_EVENT_CONTENTPAUSEREQUESTED",e[e.AD_EVENT_CONTENTRESUMEREQUESTED=29]="AD_EVENT_CONTENTRESUMEREQUESTED", e[e.AD_EVENT_ALLADSCOMPLETED=30]="AD_EVENT_ALLADSCOMPLETED",e[e.AD_EVENT_NONLINEARADREADY=31]="AD_EVENT_NONLINEARADREADY",e[e.AD_EVENT_NONLINEARADCOMPLETE=32]="AD_EVENT_NONLINEARADCOMPLETE",e[e.AD_EVENT_BREAKREADY= 33]="AD_EVENT_BREAKREADY"}(Te||(Te={})),function(e){e[e.HLSJS_UNKNOWN_EVENT=0]="HLSJS_UNKNOWN_EVENT",e[e.HLSJS_MEDIA_ATTACHING=1]="HLSJS_MEDIA_ATTACHING",e[e.HLSJS_MEDIA_ATTACHED=2]="HLSJS_MEDIA_ATTACHED", e[e.HLSJS_MEDIA_DETACHING=3]="HLSJS_MEDIA_DETACHING",e[e.HLSJS_MEDIA_DETACHED=4]="HLSJS_MEDIA_DETACHED",e[e.HLSJS_BUFFER_RESET=5]="HLSJS_BUFFER_RESET",e[e.HLSJS_BUFFER_CODECS=6]="HLSJS_BUFFER_CODECS",e[e.HLSJS_BUFFER_CREATED= 7]="HLSJS_BUFFER_CREATED",e[e.HLSJS_BUFFER_APPENDING=8]="HLSJS_BUFFER_APPENDING",e[e.HLSJS_BUFFER_APPENDED=9]="HLSJS_BUFFER_APPENDED",e[e.HLSJS_BUFFER_EOS=10]="HLSJS_BUFFER_EOS",e[e.HLSJS_BUFFER_FLUSHING= 11]="HLSJS_BUFFER_FLUSHING",e[e.HLSJS_BUFFER_FLUSHED=12]="HLSJS_BUFFER_FLUSHED",e[e.HLSJS_MANIFEST_LOADING=13]="HLSJS_MANIFEST_LOADING",e[e.HLSJS_MANIFEST_LOADED=14]="HLSJS_MANIFEST_LOADED",e[e.HLSJS_MANIFEST_PARSED= 15]="HLSJS_MANIFEST_PARSED",e[e.HLSJS_LEVEL_SWITCHING=16]="HLSJS_LEVEL_SWITCHING",e[e.HLSJS_LEVEL_SWITCHED=17]="HLSJS_LEVEL_SWITCHED",e[e.HLSJS_LEVEL_LOADING=18]="HLSJS_LEVEL_LOADING",e[e.HLSJS_LEVEL_LOADED= 19]="HLSJS_LEVEL_LOADED",e[e.HLSJS_LEVEL_UPDATED=20]="HLSJS_LEVEL_UPDATED",e[e.HLSJS_LEVEL_PTS_UPDATED=21]="HLSJS_LEVEL_PTS_UPDATED",e[e.HLSJS_LEVELS_UPDATED=22]="HLSJS_LEVELS_UPDATED",e[e.HLSJS_AUDIO_TRACKS_UPDATED= 23]="HLSJS_AUDIO_TRACKS_UPDATED",e[e.HLSJS_AUDIO_TRACK_SWITCHING=24]="HLSJS_AUDIO_TRACK_SWITCHING",e[e.HLSJS_AUDIO_TRACK_SWITCHED=25]="HLSJS_AUDIO_TRACK_SWITCHED",e[e.HLSJS_AUDIO_TRACK_LOADING=26]="HLSJS_AUDIO_TRACK_LOADING", e[e.HLSJS_AUDIO_TRACK_LOADED=27]="HLSJS_AUDIO_TRACK_LOADED",e[e.HLSJS_SUBTITLE_TRACKS_UPDATED=28]="HLSJS_SUBTITLE_TRACKS_UPDATED",e[e.HLSJS_SUBTITLE_TRACKS_CLEARED=29]="HLSJS_SUBTITLE_TRACKS_CLEARED",e[e.HLSJS_SUBTITLE_TRACK_SWITCH= 30]="HLSJS_SUBTITLE_TRACK_SWITCH",e[e.HLSJS_SUBTITLE_TRACK_LOADING=31]="HLSJS_SUBTITLE_TRACK_LOADING",e[e.HLSJS_SUBTITLE_TRACK_LOADED=32]="HLSJS_SUBTITLE_TRACK_LOADED",e[e.HLSJS_SUBTITLE_FRAG_PROCESSED= 33]="HLSJS_SUBTITLE_FRAG_PROCESSED",e[e.HLSJS_CUES_PARSED=34]="HLSJS_CUES_PARSED",e[e.HLSJS_NON_NATIVE_TEXT_TRACKS_FOUND=35]="HLSJS_NON_NATIVE_TEXT_TRACKS_FOUND",e[e.HLSJS_INIT_PTS_FOUND=36]="HLSJS_INIT_PTS_FOUND", e[e.HLSJS_FRAG_LOADING=37]="HLSJS_FRAG_LOADING",e[e.HLSJS_FRAG_LOAD_EMERGENCY_ABORTED=38]="HLSJS_FRAG_LOAD_EMERGENCY_ABORTED",e[e.HLSJS_FRAG_LOADED=39]="HLSJS_FRAG_LOADED",e[e.HLSJS_FRAG_DECRYPTED=40]= "HLSJS_FRAG_DECRYPTED",e[e.HLSJS_FRAG_PARSING_INIT_SEGMENT=41]="HLSJS_FRAG_PARSING_INIT_SEGMENT",e[e.HLSJS_FRAG_PARSING_USERDATA=42]="HLSJS_FRAG_PARSING_USERDATA",e[e.HLSJS_FRAG_PARSING_METADATA=43]="HLSJS_FRAG_PARSING_METADATA", e[e.HLSJS_FRAG_PARSED=44]="HLSJS_FRAG_PARSED",e[e.HLSJS_FRAG_BUFFERED=45]="HLSJS_FRAG_BUFFERED",e[e.HLSJS_FRAG_CHANGED=46]="HLSJS_FRAG_CHANGED",e[e.HLSJS_FPS_DROP=47]="HLSJS_FPS_DROP",e[e.HLSJS_FPS_DROP_LEVEL_CAPPING= 48]="HLSJS_FPS_DROP_LEVEL_CAPPING",e[e.HLSJS_ERROR=49]="HLSJS_ERROR",e[e.HLSJS_DESTROYING=50]="HLSJS_DESTROYING",e[e.HLSJS_KEY_LOADING=51]="HLSJS_KEY_LOADING",e[e.HLSJS_KEY_LOADED=52]="HLSJS_KEY_LOADED", e[e.HLSJS_LIVE_BACK_BUFFER_REACHED=53]="HLSJS_LIVE_BACK_BUFFER_REACHED",e[e.HLSJS_BACK_BUFFER_REACHED=54]="HLSJS_BACK_BUFFER_REACHED",e[e.HLSJS_STEERING_MANIFEST_LOADED=55]="HLSJS_STEERING_MANIFEST_LOADED", e[e.HLSJS_ASSET_LIST_LOADING=56]="HLSJS_ASSET_LIST_LOADING",e[e.HLSJS_ASSET_LIST_LOADED=57]="HLSJS_ASSET_LIST_LOADED",e[e.HLSJS_INTERSTITIALS_UPDATED=58]="HLSJS_INTERSTITIALS_UPDATED",e[e.HLSJS_INTERSTITIALS_BUFFERED_TO_BOUNDARY= 59]="HLSJS_INTERSTITIALS_BUFFERED_TO_BOUNDARY",e[e.HLSJS_INTERSTITIAL_ASSET_PLAYER_CREATED=60]="HLSJS_INTERSTITIAL_ASSET_PLAYER_CREATED",e[e.HLSJS_INTERSTITIAL_STARTED=61]="HLSJS_INTERSTITIAL_STARTED", e[e.HLSJS_INTERSTITIAL_ASSET_STARTED=62]="HLSJS_INTERSTITIAL_ASSET_STARTED",e[e.HLSJS_INTERSTITIAL_ASSET_ENDED=63]="HLSJS_INTERSTITIAL_ASSET_ENDED",e[e.HLSJS_INTERSTITIAL_ASSET_ERROR=64]="HLSJS_INTERSTITIAL_ASSET_ERROR", e[e.HLSJS_INTERSTITIAL_ENDED=65]="HLSJS_INTERSTITIAL_ENDED",e[e.HLSJS_INTERSTITIALS_PRIMARY_RESUMED=66]="HLSJS_INTERSTITIALS_PRIMARY_RESUMED",e[e.HLSJS_PLAYOUT_LIMIT_REACHED=67]="HLSJS_PLAYOUT_LIMIT_REACHED", e[e.HLSJS_EVENT_CUE_ENTER=68]="HLSJS_EVENT_CUE_ENTER",e[e.HLSJS_MEDIA_ENDED=1E3]="HLSJS_MEDIA_ENDED",e[e.HLSJS_STALL_RESOLVED=1001]="HLSJS_STALL_RESOLVED",e[e.HLSJS_BUFFERED_TO_END=1002]="HLSJS_BUFFERED_TO_END", e[e.HLSJS_AUDIO_TRACK_UPDATED=1003]="HLSJS_AUDIO_TRACK_UPDATED",e[e.HLSJS_SUBTITLE_TRACK_UPDATED=1004]="HLSJS_SUBTITLE_TRACK_UPDATED",e[e.HLSJS_MAX_AUTO_LEVEL_UPDATED=1005]="HLSJS_MAX_AUTO_LEVEL_UPDATED", e[e.HLSJS_CUSTOM_GAP_TOOFAR_AHEAD=1006]="HLSJS_CUSTOM_GAP_TOOFAR_AHEAD"}(be||(be={})),function(e){e[e.HLSJS_SOURCE_BUFFER_UNKNOWN=0]="HLSJS_SOURCE_BUFFER_UNKNOWN",e[e.HLSJS_SOURCE_BUFFER_VIDEO=1]="HLSJS_SOURCE_BUFFER_VIDEO", e[e.HLSJS_SOURCE_BUFFER_AUDIO=2]="HLSJS_SOURCE_BUFFER_AUDIO",e[e.HLSJS_SOURCE_BUFFER_AUDIOVIDEO=3]="HLSJS_SOURCE_BUFFER_AUDIOVIDEO"}(Se||(Se={})),function(e){e[e.HLSJS_ERROR_TYPE_UNKNOWN=0]="HLSJS_ERROR_TYPE_UNKNOWN", e[e.HLSJS_ERROR_TYPE_NETWORK_ERROR=1]="HLSJS_ERROR_TYPE_NETWORK_ERROR",e[e.HLSJS_ERROR_TYPE_MEDIA_ERROR=2]="HLSJS_ERROR_TYPE_MEDIA_ERROR",e[e.HLSJS_ERROR_TYPE_KEY_SYSTEM_ERROR=3]="HLSJS_ERROR_TYPE_KEY_SYSTEM_ERROR", e[e.HLSJS_ERROR_TYPE_MUX_ERROR=4]="HLSJS_ERROR_TYPE_MUX_ERROR",e[e.HLSJS_ERROR_TYPE_OTHER_ERROR=5]="HLSJS_ERROR_TYPE_OTHER_ERROR"}(we||(we={})),function(e){e[e.HLSJS_ERROR_DETAIL_UNKNOWN=0]="HLSJS_ERROR_DETAIL_UNKNOWN", e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_KEYS=1]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_KEYS",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_ACCESS=2]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_ACCESS",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_SESSION= 3]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_SESSION",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_CONFIGURED_LICENSE=4]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_NO_CONFIGURED_LICENSE",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_LICENSE_REQUEST_FAILED= 5]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_LICENSE_REQUEST_FAILED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED=6]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED= 7]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_SESSION_UPDATE_FAILED=8]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_SESSION_UPDATE_FAILED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED= 9]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_STATUS_INTERNAL_ERROR=10]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_STATUS_INTERNAL_ERROR",e[e.HLSJS_ERROR_DETAIL_MANIFEST_LOAD_ERROR= 11]="HLSJS_ERROR_DETAIL_MANIFEST_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_MANIFEST_LOAD_TIMEOUT=12]="HLSJS_ERROR_DETAIL_MANIFEST_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_MANIFEST_PARSING_ERROR=13]="HLSJS_ERROR_DETAIL_MANIFEST_PARSING_ERROR", e[e.HLSJS_ERROR_DETAIL_MANIFEST_INCOMPATIBLE_CODECS_ERROR=14]="HLSJS_ERROR_DETAIL_MANIFEST_INCOMPATIBLE_CODECS_ERROR",e[e.HLSJS_ERROR_DETAIL_LEVEL_EMPTY_ERROR=15]="HLSJS_ERROR_DETAIL_LEVEL_EMPTY_ERROR", e[e.HLSJS_ERROR_DETAIL_LEVEL_LOAD_ERROR=16]="HLSJS_ERROR_DETAIL_LEVEL_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_LEVEL_LOAD_TIMEOUT=17]="HLSJS_ERROR_DETAIL_LEVEL_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_LEVEL_PARSING_ERROR= 18]="HLSJS_ERROR_DETAIL_LEVEL_PARSING_ERROR",e[e.HLSJS_ERROR_DETAIL_LEVEL_SWITCH_ERROR=19]="HLSJS_ERROR_DETAIL_LEVEL_SWITCH_ERROR",e[e.HLSJS_ERROR_DETAIL_AUDIO_TRACK_LOAD_ERROR=20]="HLSJS_ERROR_DETAIL_AUDIO_TRACK_LOAD_ERROR", e[e.HLSJS_ERROR_DETAIL_AUDIO_TRACK_LOAD_TIMEOUT=21]="HLSJS_ERROR_DETAIL_AUDIO_TRACK_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_SUBTITLE_LOAD_ERROR=22]="HLSJS_ERROR_DETAIL_SUBTITLE_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_SUBTITLE_TRACK_LOAD_TIMEOUT= 23]="HLSJS_ERROR_DETAIL_SUBTITLE_TRACK_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_FRAG_LOAD_ERROR=24]="HLSJS_ERROR_DETAIL_FRAG_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_FRAG_LOAD_TIMEOUT=25]="HLSJS_ERROR_DETAIL_FRAG_LOAD_TIMEOUT", e[e.HLSJS_ERROR_DETAIL_FRAG_DECRYPT_ERROR=26]="HLSJS_ERROR_DETAIL_FRAG_DECRYPT_ERROR",e[e.HLSJS_ERROR_DETAIL_FRAG_PARSING_ERROR=27]="HLSJS_ERROR_DETAIL_FRAG_PARSING_ERROR",e[e.HLSJS_ERROR_DETAIL_FRAG_GAP= 28]="HLSJS_ERROR_DETAIL_FRAG_GAP",e[e.HLSJS_ERROR_DETAIL_REMUX_ALLOC_ERROR=29]="HLSJS_ERROR_DETAIL_REMUX_ALLOC_ERROR",e[e.HLSJS_ERROR_DETAIL_KEY_LOAD_ERROR=30]="HLSJS_ERROR_DETAIL_KEY_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_KEY_LOAD_TIMEOUT= 31]="HLSJS_ERROR_DETAIL_KEY_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_BUFFER_ADD_CODEC_ERROR=32]="HLSJS_ERROR_DETAIL_BUFFER_ADD_CODEC_ERROR",e[e.HLSJS_ERROR_DETAIL_BUFFER_INCOMPATIBLE_CODECS_ERROR=33]="HLSJS_ERROR_DETAIL_BUFFER_INCOMPATIBLE_CODECS_ERROR", e[e.HLSJS_ERROR_DETAIL_BUFFER_APPEND_ERROR=34]="HLSJS_ERROR_DETAIL_BUFFER_APPEND_ERROR",e[e.HLSJS_ERROR_DETAIL_BUFFER_APPENDING_ERROR=35]="HLSJS_ERROR_DETAIL_BUFFER_APPENDING_ERROR",e[e.HLSJS_ERROR_DETAIL_BUFFER_STALLED_ERROR= 36]="HLSJS_ERROR_DETAIL_BUFFER_STALLED_ERROR",e[e.HLSJS_ERROR_DETAIL_BUFFER_FULL_ERROR=37]="HLSJS_ERROR_DETAIL_BUFFER_FULL_ERROR",e[e.HLSJS_ERROR_DETAIL_BUFFER_SEEK_OVER_HOLE=38]="HLSJS_ERROR_DETAIL_BUFFER_SEEK_OVER_HOLE", e[e.HLSJS_ERROR_DETAIL_BUFFER_NUDGE_ON_STALL=39]="HLSJS_ERROR_DETAIL_BUFFER_NUDGE_ON_STALL",e[e.HLSJS_ERROR_DETAIL_INTERNAL_EXCEPTION=40]="HLSJS_ERROR_DETAIL_INTERNAL_EXCEPTION",e[e.HLSJS_ERROR_DETAIL_INTERNAL_ABORTED= 41]="HLSJS_ERROR_DETAIL_INTERNAL_ABORTED",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR=42]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR= 43]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR",e[e.HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR=44]="HLSJS_ERROR_DETAIL_KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR",e[e.HLSJS_ERROR_DETAIL_ASSET_LIST_LOAD_ERROR= 45]="HLSJS_ERROR_DETAIL_ASSET_LIST_LOAD_ERROR",e[e.HLSJS_ERROR_DETAIL_ASSET_LIST_LOAD_TIMEOUT=46]="HLSJS_ERROR_DETAIL_ASSET_LIST_LOAD_TIMEOUT",e[e.HLSJS_ERROR_DETAIL_ASSET_LIST_PARSING_ERROR=47]="HLSJS_ERROR_DETAIL_ASSET_LIST_PARSING_ERROR", e[e.HLSJS_ERROR_DETAIL_INTERSTITIAL_ASSET_ITEM_ERROR=48]="HLSJS_ERROR_DETAIL_INTERSTITIAL_ASSET_ITEM_ERROR",e[e.HLSJS_ERROR_DETAIL_ATTACH_MEDIA_ERROR=49]="HLSJS_ERROR_DETAIL_ATTACH_MEDIA_ERROR",e[e.HLSJS_ERROR_DETAIL_DASH_SEGMENT_LIST_UPDATE_ERROR= 50]="HLSJS_ERROR_DETAIL_DASH_SEGMENT_LIST_UPDATE_ERROR"}(Ae||(Ae={})),function(e){e[e.DBG_FUNCTION_ID_UNKNOWN=0]="DBG_FUNCTION_ID_UNKNOWN",e[e.SOURCE_PLAY=100]="SOURCE_PLAY",e[e.SOURCE_CREATE_PENDING_PLAY_PROMISE= 101]="SOURCE_CREATE_PENDING_PLAY_PROMISE",e[e.SOURCE_ABORT_PENDING_PLAY_PROMISE=102]="SOURCE_ABORT_PENDING_PLAY_PROMISE",e[e.MEDIA_ELEMENT_LOAD=103]="MEDIA_ELEMENT_LOAD",e[e.MEDIA_ELEMENT_PLAY=104]="MEDIA_ELEMENT_PLAY", e[e.MEDIA_ELEMENT_PAUSE=105]="MEDIA_ELEMENT_PAUSE",e[e.SOURCE_PLAY_WITH_MEDIA_CAP=106]="SOURCE_PLAY_WITH_MEDIA_CAP",e[e.HLS_CONTROLLER_LOAD=107]="HLS_CONTROLLER_LOAD",e[e.HLS_CONTROLLER_LOAD_INTERNAL=108]= "HLS_CONTROLLER_LOAD_INTERNAL",e[e.HLS_CONTROLLER_LOAD_SOURCE=109]="HLS_CONTROLLER_LOAD_SOURCE",e[e.HLS_JS_MANIFEST_LOADING=110]="HLS_JS_MANIFEST_LOADING",e[e.HLS_JS_MANIFEST_LOADED=111]="HLS_JS_MANIFEST_LOADED", e[e.HLS_JS_MANIFEST_PARSED=112]="HLS_JS_MANIFEST_PARSED",e[e.HLS_JS_FRAG_CHANGED=113]="HLS_JS_FRAG_CHANGED",e[e.HLS_JS_FRAG_LOADED=114]="HLS_JS_FRAG_LOADED",e[e.HLS_JS_ERROR=115]="HLS_JS_ERROR",e[e.HLS_JS_TRY_TO_RECOVER_ERROR= 116]="HLS_JS_TRY_TO_RECOVER_ERROR",e[e.HLS_JS_LEVEL_LOADED=117]="HLS_JS_LEVEL_LOADED",e[e.HLS_CONTROLLER_DESTROY=118]="HLS_CONTROLLER_DESTROY",e[e.SOUCE_ON_MEDIA_CONTROLLER_ERROR=119]="SOUCE_ON_MEDIA_CONTROLLER_ERROR", e[e.SOURCE_DISPATCH_EVENT=120]="SOURCE_DISPATCH_EVENT",e[e.SOURCE_DESTROY_METHOD_CONTROLLER=121]="SOURCE_DESTROY_METHOD_CONTROLLER",e[e.LIVE_PROVIDER_PREPARE_P2P_TRACK=122]="LIVE_PROVIDER_PREPARE_P2P_TRACK", e[e.LIVE_PROVIDER_DISABLE_P2P=123]="LIVE_PROVIDER_DISABLE_P2P",e[e.LIVE_PROVIDER_ENABLE_P2P=124]="LIVE_PROVIDER_ENABLE_P2P",e[e.CORE_SET_VIDEO_TRACKS=125]="CORE_SET_VIDEO_TRACKS",e[e.CORE_SET_TEXT_TRACKS= 126]="CORE_SET_TEXT_TRACKS",e[e.CORE_SET_VIDEO_SIZE_INTERNAL=127]="CORE_SET_VIDEO_SIZE_INTERNAL",e[e.CORE_SET_VIDEO_SIZE=128]="CORE_SET_VIDEO_SIZE",e[e.CORE_SET_DURATION=129]="CORE_SET_DURATION",e[e.CORE_REFRESH_SELECTED_TRACK= 130]="CORE_REFRESH_SELECTED_TRACK",e[e.CORE_SET_ERROR=131]="CORE_SET_ERROR",e[e.CORE_ON_TRACK_CHANGE=132]="CORE_ON_TRACK_CHANGE",e[e.CORE_ON_TEXT_TRACK_READY=133]="CORE_ON_TEXT_TRACK_READY",e[e.CORE_TEXT_TRACK_ON_CHANGE= 134]="CORE_TEXT_TRACK_ON_CHANGE",e[e.CORE_PLAY=135]="CORE_PLAY",e[e.CORE_PLAY_SOURCE_PLAYER=136]="CORE_PLAY_SOURCE_PLAYER",e[e.SOURCE_LOAD=137]="SOURCE_LOAD",e[e.SOURCE_PAUSE=138]="SOURCE_PAUSE",e[e.SOURCE_RESET_PENDING_PLAY_PROMISE_STATE= 139]="SOURCE_RESET_PENDING_PLAY_PROMISE_STATE",e[e.SOURCE_DISPATCH_ERROR_EVENT=140]="SOURCE_DISPATCH_ERROR_EVENT",e[e.CORE_DISPATCH_EVENT=141]="CORE_DISPATCH_EVENT",e[e.CORE_LOAD_INTERNAL=142]="CORE_LOAD_INTERNAL", e[e.CORE_UPDATE_NETWORK_STATE=143]="CORE_UPDATE_NETWORK_STATE",e[e.CORE_UPDATE_READY_STATE=144]="CORE_UPDATE_READY_STATE",e[e.CORE_TRY_UNLOCK_USER_GESTURE=145]="CORE_TRY_UNLOCK_USER_GESTURE",e[e.CORE_WARMUP= 146]="CORE_WARMUP",e[e.CORE_RESTORE_PLAYBACK_RATE=147]="CORE_RESTORE_PLAYBACK_RATE",e[e.CORE_WARMUP_INTENAL=148]="CORE_WARMUP_INTENAL",e[e.CORE_PROPAGATE_EVENT=149]="CORE_PROPAGATE_EVENT",e[e.CORE_SET_PRELOAD_POLICY= 150]="CORE_SET_PRELOAD_POLICY",e[e.CORE_LOOP=151]="CORE_LOOP",e[e.CORE_CHANGE_TRACK=152]="CORE_CHANGE_TRACK",e[e.CORE_SHOW_DIMMED_LAYER=153]="CORE_SHOW_DIMMED_LAYER",e[e.CORE_HIDE_DIMMED_LAYER=154]="CORE_HIDE_DIMMED_LAYER", e[e.CORE_CLEAR_METADATA_TEXT_TRACK=155]="CORE_CLEAR_METADATA_TEXT_TRACK",e[e.LIVE_PROVIDER_LOAD=156]="LIVE_PROVIDER_LOAD",e[e.LIVE_PROVIDER_LOAD_LIVE_PLAYBACK=157]="LIVE_PROVIDER_LOAD_LIVE_PLAYBACK",e[e.LIVE_PROVIDER_SET_ERROR= 158]="LIVE_PROVIDER_SET_ERROR",e[e.LIVE_PROVIDER_UPDATE_METADATA=159]="LIVE_PROVIDER_UPDATE_METADATA",e[e.LIVE_PROVIDER_PROCESS_QOE=160]="LIVE_PROVIDER_PROCESS_QOE",e[e.LIVE_PROVIDER_INIT_WATCHING_LOG= 161]="LIVE_PROVIDER_INIT_WATCHING_LOG",e[e.LIVE_PROVIDER_ON_LIVE_CONNECTOR_EVENT_LOG=162]="LIVE_PROVIDER_ON_LIVE_CONNECTOR_EVENT_LOG",e[e.LIVE_PROVIDER_ON_LIVE_CONNECTOR_INVOKE_VERSION=163]="LIVE_PROVIDER_ON_LIVE_CONNECTOR_INVOKE_VERSION", e[e.LIVE_PROVIDER_LIVE_CONNECTOR_VERIFY_VERSION=164]="LIVE_PROVIDER_LIVE_CONNECTOR_VERIFY_VERSION",e[e.LIVE_PROVIDER_LIVE_CONNECTOR_INVOKE_VALID_VERSION=165]="LIVE_PROVIDER_LIVE_CONNECTOR_INVOKE_VALID_VERSION", e[e.FIX_AUDIO_SYNC=166]="FIX_AUDIO_SYNC",e[e.LIVE_CONNECTOR_EVENT_STREAM_CLOSE=167]="LIVE_CONNECTOR_EVENT_STREAM_CLOSE",e[e.LIVE_CONNECTOR_EVENT_STREAM_ON_ERROR=168]="LIVE_CONNECTOR_EVENT_STREAM_ON_ERROR", e[e.LIVE_PROVIDER_ON_LIVE_CONNECTOR_EVENT_ERROR=169]="LIVE_PROVIDER_ON_LIVE_CONNECTOR_EVENT_ERROR",e[e.CORE_HANDLE_LOAD_ABORT=170]="CORE_HANDLE_LOAD_ABORT",e[e.CORE_HANDLE_LOAD_ERROR=171]="CORE_HANDLE_LOAD_ERROR", e[e.CORE_AFTER_LOAD=172]="CORE_AFTER_LOAD",e[e.CORE_LOAD_SRC_OBJECT=173]="CORE_LOAD_SRC_OBJECT",e[e.CORE_RESET_PLAYBACK_SESSION=174]="CORE_RESET_PLAYBACK_SESSION",e[e.CORE_RESET_SESSION=175]="CORE_RESET_SESSION", e[e.CORE_SHOULD_PLAY_THROUGH=176]="CORE_SHOULD_PLAY_THROUGH",e[e.CORE_PLAY_THROUGH=177]="CORE_PLAY_THROUGH",e[e.LIVE_PROVIDER_CLEAN_UP_PRE_PROCESSING=178]="LIVE_PROVIDER_CLEAN_UP_PRE_PROCESSING",e[e.LIVE_PROVIDER_UPDATE_PLAYER= 179]="LIVE_PROVIDER_UPDATE_PLAYER",e[e.LIVE_PROVIDER_UPDATE_POSTER=180]="LIVE_PROVIDER_UPDATE_POSTER",e[e.LIVE_PROVIDER_UPDATE_VIDEO_TRACKS=181]="LIVE_PROVIDER_UPDATE_VIDEO_TRACKS",e[e.LIVE_PROVIDER_HANDLE_UNSUPPORTED_MEDIA= 182]="LIVE_PROVIDER_HANDLE_UNSUPPORTED_MEDIA",e[e.LIVE_PROVIDER_HANDLE_MEDIA=183]="LIVE_PROVIDER_HANDLE_MEDIA",e[e.LIVE_PROVIDER_CONFIGURE_CMCD=184]="LIVE_PROVIDER_CONFIGURE_CMCD",e[e.LIVE_PROVIDER_HANDLE_NO_AVAIL_TRACKS= 185]="LIVE_PROVIDER_HANDLE_NO_AVAIL_TRACKS",e[e.LIVE_PROVIDER_UPDATE_DIMENSION=186]="LIVE_PROVIDER_UPDATE_DIMENSION",e[e.LIVE_PROVIDER_MUTATE_TRACK_LIST=187]="LIVE_PROVIDER_MUTATE_TRACK_LIST",e[e.LIVE_PROVIDER_REMOVE_OVER_TRAFFIC_TRACK= 188]="LIVE_PROVIDER_REMOVE_OVER_TRAFFIC_TRACK",e[e.LIVE_PROVIDER_UPDATE_AD_INFO=189]="LIVE_PROVIDER_UPDATE_AD_INFO",e[e.LIVE_PROVIDER_ESTIMATE_ADS_BITRATE=190]="LIVE_PROVIDER_ESTIMATE_ADS_BITRATE",e[e.LIVE_PROVIDER_CLOSE= 191]="LIVE_PROVIDER_CLOSE",e[e.LIVE_PROVIDER_UPDATE_LIVE_STATUS=192]="LIVE_PROVIDER_UPDATE_LIVE_STATUS",e[e.SOURCE_SETTER_CURRENT_TIME=193]="SOURCE_SETTER_CURRENT_TIME",e[e.SOURCE_SETTER_PLAYBACK_RATE= 194]="SOURCE_SETTER_PLAYBACK_RATE",e[e.SOURCE_SETTER_SRC=195]="SOURCE_SETTER_SRC",e[e.CORE_SETTER_SRC=196]="CORE_SETTER_SRC",e[e.CORE_SETTER_SRC_OBJECT=197]="CORE_SETTER_SRC_OBJECT",e[e.CORE_SETTER_MUTED= 198]="CORE_SETTER_MUTED",e[e.CORE_SETTER_VOLUME=199]="CORE_SETTER_VOLUME",e[e.CORE_SETTER_LOOP=200]="CORE_SETTER_LOOP",e[e.CORE_SETTER_AUTOPLAY=201]="CORE_SETTER_AUTOPLAY",e[e.CORE_SETTER_CROSS_ORIGIN= 202]="CORE_SETTER_CROSS_ORIGIN",e[e.CORE_SETTER_CURRENT_TIME=203]="CORE_SETTER_CURRENT_TIME",e[e.CORE_SETTER_PLAYBACK_RATE=204]="CORE_SETTER_PLAYBACK_RATE",e[e.LIVE_CONNECTOR_GET_EXTENSION_STATE=205]="LIVE_CONNECTOR_GET_EXTENSION_STATE", e[e.LIVE_CONNECTOR_GET_CLIENT_STATE=206]="LIVE_CONNECTOR_GET_CLIENT_STATE",e[e.LIVE_CONNECTOR_IS_SUPPORTED_PLATFORM=207]="LIVE_CONNECTOR_IS_SUPPORTED_PLATFORM",e[e.LIVE_CONNECTOR_IS_SUPPORTED_BROWSER=208]= "LIVE_CONNECTOR_IS_SUPPORTED_BROWSER",e[e.LIVE_CONNECTOR_IS_SUPPORTED=209]="LIVE_CONNECTOR_IS_SUPPORTED",e[e.LIVE_CONNECTOR_GET_PROTOCOL_TYPE=210]="LIVE_CONNECTOR_GET_PROTOCOL_TYPE",e[e.LIVE_CONNECTOR_PREPARE= 211]="LIVE_CONNECTOR_PREPARE",e[e.LIVE_CONNECTOR_IS_LAUNCHER_INSTALL=212]="LIVE_CONNECTOR_IS_LAUNCHER_INSTALL",e[e.LIVE_CONNECTOR_IS_INSTALL=213]="LIVE_CONNECTOR_IS_INSTALL",e[e.LIVE_CONNECTOR_LAUNCH=214]= "LIVE_CONNECTOR_LAUNCH",e[e.LIVE_CONNECTOR_WAIT_FOR_READY=215]="LIVE_CONNECTOR_WAIT_FOR_READY",e[e.LIVE_CONNECTOR_GET_HLS_PORT=216]="LIVE_CONNECTOR_GET_HLS_PORT",e[e.LIVE_CONNECTOR_CREATE_EVENT_STREAM= 217]="LIVE_CONNECTOR_CREATE_EVENT_STREAM",e[e.LIVE_CONNECTOR_GET_STATE=218]="LIVE_CONNECTOR_GET_STATE",e[e.HLS_CONTROLLER_ON_BUFFER_CODEC_UPDATED=219]="HLS_CONTROLLER_ON_BUFFER_CODEC_UPDATED",e[e.HLS_CONTROLLER_ON_MEDIA_PLAYING= 220]="HLS_CONTROLLER_ON_MEDIA_PLAYING",e[e.HLS_CONTROLLER_ON_MEDIA_PLAYED=221]="HLS_CONTROLLER_ON_MEDIA_PLAYED",e[e.HLS_CONTROLLER_ON_MEDIA_PAUSED=222]="HLS_CONTROLLER_ON_MEDIA_PAUSED",e[e.HLS_CONTROLLER_SETTER_MAX_BITRATE= 223]="HLS_CONTROLLER_SETTER_MAX_BITRATE",e[e.SOURCE_SETTER_MUTED=224]="SOURCE_SETTER_MUTED",e[e.SOURCE_SETTER_VOLUME=225]="SOURCE_SETTER_VOLUME",e[e.SOURCE_SETTER_POSTER=226]="SOURCE_SETTER_POSTER",e[e.CORE_PAUSE= 227]="CORE_PAUSE",e[e.CORE_LOAD=228]="CORE_LOAD",e[e.CORE_SETTER_PRELOAD=229]="CORE_SETTER_PRELOAD",e[e.CORE_SETTER_DEFAULT_MUTED=230]="CORE_SETTER_DEFAULT_MUTED",e[e.CORE_SETTER_WIDTH=231]="CORE_SETTER_WIDTH", e[e.CORE_SETTER_HEIGHT=232]="CORE_SETTER_HEIGHT",e[e.CORE_SETTER_POSTER=233]="CORE_SETTER_POSTER",e[e.CORE_SETTER_CONTROL=234]="CORE_SETTER_CONTROL",e[e.CORE_SETTER_DEFAULT_PLAYBACK_RATE=235]="CORE_SETTER_DEFAULT_PLAYBACK_RATE", e[e.CORE_CONFIGURE_PRE_PROCESSOR=236]="CORE_CONFIGURE_PRE_PROCESSOR",e[e.CORE_CONFIGURE_POST_PROCESSOR=237]="CORE_CONFIGURE_POST_PROCESSOR",e[e.CORE_DETACH_MEDIA_KEYS=238]="CORE_DETACH_MEDIA_KEYS",e[e.CORE_SET_MEDIA_KEYS= 239]="CORE_SET_MEDIA_KEYS",e[e.CORE_REQUEST_PICTURE_IN_PICTURE=240]="CORE_REQUEST_PICTURE_IN_PICTURE",e[e.CORE_SETTER_DISABLE_PICTURE_IN_PICTURE=241]="CORE_SETTER_DISABLE_PICTURE_IN_PICTURE",e[e.P2P_TRACK_MANAGER_CREATE_ABR= 242]="P2P_TRACK_MANAGER_CREATE_ABR",e[e.HLS_JS_TRY_TO_RECOVER_DECODE_ERROR=243]="HLS_JS_TRY_TO_RECOVER_DECODE_ERROR",e[e.HLS_JS_TRY_TO_RECOVER_MANIFEST_ERROR=244]="HLS_JS_TRY_TO_RECOVER_MANIFEST_ERROR"}(Re|| (Re={})),function(e){e[e.P2P_CORE_UNKNOWN_EVENT=0]="P2P_CORE_UNKNOWN_EVENT",e[e.SET=1]="SET",e[e.WORKING=2]="WORKING",e[e.INIT=3]="INIT",e[e.UNINIT=4]="UNINIT",e[e.LOAD=5]="LOAD"}(Le||(Le={})),function(e){e[e.P2P_COR_UNKNOWNE_ACTION= 0]="P2P_COR_UNKNOWNE_ACTION",e[e.VERSION=1]="VERSION",e[e.VALID_VERSION=2]="VALID_VERSION",e[e.ERROR=3]="ERROR",e[e.START=4]="START",e[e.END=5]="END",e[e.ENABLE=6]="ENABLE",e[e.DISABLE=7]="DISABLE"}(Ie|| (Ie={})),function(e){e[e.P2P_CORE_UNKNOWN_TARGET=0]="P2P_CORE_UNKNOWN_TARGET",e[e.P2PCORE=1]="P2PCORE",e[e.CHANNEL=2]="CHANNEL",e[e.INDEXSERVER=3]="INDEXSERVER",e[e.P2PCONNECTOR=4]="P2PCONNECTOR",e[e.STREAMSERVER= 5]="STREAMSERVER",e[e.CONFIG=6]="CONFIG",e[e.MASTERPLAYLIST=7]="MASTERPLAYLIST",e[e.CHUNKLIST=8]="CHUNKLIST",e[e.PIECE=9]="PIECE",e[e.INITIAL=10]="INITIAL",e[e.PARTIAL=11]="PARTIAL",e[e.EVENT=12]="EVENT", e[e.SUBTITLECHUNKLIST=13]="SUBTITLECHUNKLIST",e[e.SUBTITLE=14]="SUBTITLE",e[e.SUBTITLEPARTIAL=15]="SUBTITLEPARTIAL"}(Ce||(Ce={})),function(e){e[e.P2P_CORE_UNKNOWN_SOURCE=0]="P2P_CORE_UNKNOWN_SOURCE",e[e.CDN= 1]="CDN",e[e.PEER=2]="PEER"}(Oe||(Oe={})),function(e){e[e.LOG_LEVEL_UNKNOWN=0]="LOG_LEVEL_UNKNOWN",e[e.LOG_LEVEL_TRACE=1]="LOG_LEVEL_TRACE",e[e.LOG_LEVEL_DEBUG=2]="LOG_LEVEL_DEBUG",e[e.LOG_LEVEL_LOG=3]= "LOG_LEVEL_LOG",e[e.LOG_LEVEL_INFO=4]="LOG_LEVEL_INFO",e[e.LOG_LEVEL_WARN=5]="LOG_LEVEL_WARN",e[e.LOG_LEVEL_ERROR=6]="LOG_LEVEL_ERROR"}(Pe||(Pe={})),function(e){e[e.OBJECT_TAG_ANY=0]="OBJECT_TAG_ANY",e[e.JSON= 1]="JSON",e[e.Event=2]="Event",e[e.HttpError=3]="HttpError"}(ke||(ke={})),function(e){e[e.NOTHING=0]="NOTHING",e[e.GZIP=1]="GZIP"}(De||(De={})); var xe={encode:function encode(e,t){var n;void 0===t&&(t=new ye),0!==e.basetime&&t.uint32(8).uint64(e.basetime),0!==e.objectId.length&&t.uint32(18).bytes(e.objectId),void 0!==e.state&&Ze.encode(e.state, t.uint32(26).fork()).join();for(var r=0,i=e.events;r=a.length&&(d=!0),c)}, get length(){return u},get index(){return l},get done(){return d}}),g=r-n;!v.done&&(p=f,(f=v.next())0?(h-=1,f=p):h===e.times.length&&(h-=1),h<=0)return e;var y=E()(i=e.times).call(i, h),m=E()(o=ne()(e)).call(o,h),_=_mt(_mt({},e),{times:y,values:m});return h>0&&_.times.length>0&&(_.times[0]=f-t),_},Rt=function Rt(e,t,n,r){var i,o={ranges:K()(i=(0,yt.P)(n)).call(i,function(e){return{startMs:1E3* e[0]|0, endMs:1E3*e[1]|0}})}; return wt(e,t,o,r,St)},Lt=n(94198),It=n.n(Lt),Ct=n(54903),Ot=n.n(Ct); function Pt(e){return K()(Array.prototype).call(e,function(e){var t;return Ot()(t=e.toString(16)).call(t,2,"0")}).join("")} function kt(e,t,n){return new Uint8Array(E()(Array.prototype).call(e,t,n))} var _Dt=function Dt(){return _Dt=i()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(this.events=E()(t=this.events).call(t,n+1))},e.prototype.onLogFunctionCall=function(e){var t=e.timestamp,n=e.parameters,r=e.dimensions; this.addEvent(t,"call",{functionId:n[0],callId:n[1]}),this.appendMediaStates(r,t)},e.prototype.onLogFunctionReturn=function(e){var t=e.timestamp,n=e.dimensions,r=e.parameters; this.addEvent(t,"callReturns",{callId:r[0]}),this.appendMediaStates(n,t)},e.prototype.onLogMediaEvent=function(e){var t=e.timestamp,n=e.parameters,r=e.dimensions; this.addEvent(t,"mediaEvent",{type:n.eventType,throttled:n.throttled}),this.appendMediaStates(r,t)},e.prototype.appendMediaStates=function(e,t){var n,r=this; j()(n=W()(Vt)).call(n,function(n){if(n in e){var i=Vt[n](r.basetime,t,e[n],r.state[n]);i=At(i,r.basetime,r.logLifeSpan,t),r.state[n]=i}})},e.prototype.onLogHlsJsEvent=function(e){var t=e.timestamp,n=e.parameters, r=e.dimensions; this.addEvent(t,"hlsjs",_Dt(_Dt(_Dt(_Dt({type:n.type},void 0!==n.errorType&&{errorType:n.errorType}),void 0!==n.errorDetails&&{errorDetails:n.errorDetails}),void 0!==n.reason&&{reason:n.reason}),void 0!== n.url&&{url:n.url})),this.appendHlsJsState(r,t)},e.prototype.appendHlsJsState=function(e,t){var n,r=this; j()(n=W()(Ht)).call(n,function(n){if(void 0!==e[n]){var i=Ht[n](r.basetime,t,e[n],r.hlsjs[n]);i=At(i,r.basetime,r.logLifeSpan,t),r.hlsjs[n]=i}})},e.prototype.onLogP2PCoreEvent=function(e){var t,n,r,i,o= e.parameters,a=null!==(t=pt[o.source])&&void 0!==t?t:0,s=null!==(n=dt[o.type])&&void 0!==n?n:0,u=null!==(r=ht[o.target])&&void 0!==r?r:0,l=null!==(i=ft[o.action])&&void 0!==i?i:0; this.addEvent(o.timestamp,"p2p",{type:s,target:u,action:l,source:a,error:o.error,fileSize:o.fileSize,pieceId:o.pieceId,partialId:o.partialId}),1!==s&&(this.p2pcore.channelId=At(wt(this.basetime,o.timestamp, o.channelId||"",this.p2pcore.channelId),this.basetime,this.logLifeSpan,o.timestamp))},e.prototype.onLogNetworkEvent=function(e){var t=e.timestamp,n=e.parameters; switch(n.type){case "loadstart":this.addEvent(t,"netRequest",n);break;case "error":case "timeout":this.addEvent(t,"netError",{requestId:n.requestId,httpStatus:n.httpStatus});break;case "abort":this.addEvent(t, "netAbort",{requestId:n.requestId});break;case "progress":this.addEvent(t,"netProgress",{requestId:n.requestId,httpStatus:n.httpStatus,bodyLength:n.loaded});break;case "loadend":this.addEvent(t,"netResponse", {requestId:n.requestId,bodyLength:n.loaded})}},e.prototype.onLogFeatureState=function(e){var t,n=e.mark,r=e.payload,i=E()(n).call(n,Q.AO.length),o="string"==typeof(null===(t=r.parameters)||void 0===t?void 0: t.value)?r.parameters.value:""; this.addEvent(r.timestamp,"log",{event:n,message:o}),i&&o&&(this.featureState[i]=At(wt(this.basetime,r.timestamp,o,this.featureState[i]),this.basetime,this.logLifeSpan,r.timestamp))},e.prototype.onAnyLogEvent= function(e){var t,n,r,i=e.mark,o=e.payload; this.addEvent(o.timestamp,"log",{event:i,message:"string"==typeof(null===(t=o.parameters)||void 0===t?void 0:t.message)?o.parameters.message:"",level:(r=null===(n=o.parameters)||void 0===n?void 0:n.level, "string"==typeof r?Nt[r]:void 0)})},e.useStorage=!1,t=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=a()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t, n,s):i(t,n))||s);return o>3&&s&&u()(t,n,s),s}([q.Metric.metadata({id:"debug-log", filter:{test:function test(e){return e===Q.kh||0===k()(e).call(e,"debug.")}}, dimensions:xt([],gt,!0)})],e)}()}, 69901:function _(e,t,n){n.d(t,{u:function u(){return f}, z:function z(){return h}}); var r=n(2991),i=n.n(r),o=n(77766),a=n.n(o),s=n(45424),u=n.n(s),l=n(17602),c=1;function d(){return c++} function h(e){for(var t=[],n=1;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&y()(t,n,a),a}([i.Metric.metadata({id:"plugout-log", filter:{test:function test(e){return 0===U()(e).call(e,"debug.plugout")||0===U()(e).call(e,"debug.nliveconnector")}}, dimensions:["visible","onLine","historyLength"]})],e)}(),H=!0,j=(0,d.Z)(function(){var e=""; try{var t=document.createElement("canvas"),n=t.getContext("experimental-webgl",{stencil:!0});if(n){var r=n.getExtension("WEBGL_debug_renderer_info");r&&(e=n.getParameter(r.UNMASKED_RENDERER_WEBGL))}e|| (n=t.getContext("webgl"))&&(e=n.getParameter(n.RENDERER))}catch(t){e="error"}return e}),G=function G(e){var t; f.A.isSupported()&&((null==e?void 0:e.persist)&&(f.A.useStorage=null==e?void 0:e.persist),(null==e?void 0:e.dbName)&&(a.K.DB_NAME=e.dbName),"number"==typeof(null==e?void 0:e.quotaMax)&&e.quotaMax>0&&(a.K.QUOTA_MAX_BYTES= e.quotaMax),"number"==typeof(null==e?void 0:e.quotaMin)&&e.quotaMin>0&&(a.K.QUOTA_MIN_BYTES=e.quotaMin),"number"==typeof(null==e?void 0:e.commitInterval)&&e.commitInterval>0&&(a.K.LOG_COMMIT_INTERVAL=e.commitInterval), "number"==typeof(null==e?void 0:e.retentionPeriod)&&e.retentionPeriod>0&&(a.K.LOG_RETENTION_PERIOD=e.retentionPeriod),"number"==typeof(null==e?void 0:e.logDuration)&&e.logDuration>0&&(a.K.LOG_WINDOW=e.logDuration), o().init(window,{dimensions:{clsId:function clsId(){return"188c9e9b-0e1e-4c36-a7fa-620eeaa9ef50"}, userAgent:function userAgent(){return(0,s.Sc)()}, gpu:function gpu(){return j()}, visible:function visible(){return"visible"===c().document.visibilityState}, onLine:function onLine(){return c().navigator.onLine}, historyLength:function historyLength(){return c().history.length}, webdriver:function webdriver(){var e;return null!==(e=c().navigator.webdriver)&&void 0!==e&&e}}}),i.defaultLogMonitor.register(f.A),i.defaultLogMonitor.register(V),H=null===(t=null==e?void 0:e.disableNeloCollector)|| void 0===t||t,r=null==e?void 0:e.neloCollectorOptions)}; function K(){return!1===H} function z(){return new h.K(r)} }, 81611:function _(e,t,n){n.d(t,{L:function L(){return i}}); var r=n(65420),i=n.n(r)()()}, 13272:function _(e,t,n){n.d(t,{Z:function Z(){return S}}); var r=n(51942),i=n.n(r),o=n(93476),a=n.n(o),s=n(65420),u=n.n(s),l=n(98341),c=n.n(l),d=n(24717),h=n.n(d),f=n(90373),p=n(43623),v=n(66668),g={hlg:{iOS:{"Mobile Safari":{file:{since:"14.5.0"}},Chrome:{file:{since:"14.5.0"}}}, "iPad OS":{"Mobile Safari":{"media-source":{since:"14.5.0"},file:{since:"14.5.0"}},Chrome:{file:{since:"14.5.0"},"media-source":{since:"14.5.0"}}},"Mac OS":{Safari:{"media-source":{since:"10.15.0"},file:{since:"10.15.0"}}}}}; function y(e,t){var n;switch(void 0===t&&(t="file"),t){case "file":return""!==(null!==(n=document.querySelector("video"))&&void 0!==n?n:document.createElement("video")).canPlayType(e);case "media-source":return"undefined"!= typeof MediaSource&&MediaSource.isTypeSupported(e);default:return!1}} var _m2=function m(){return _m2=i()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1},e.prototype.requestMediaKeySystemAccess=function(e,t){for(var n=null,r=0,i=t;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&& e[r++],done:!e}}}; throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");} function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&& !r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error;}}return a} function A(){for(var e=[],t=0;t]*)>/)){var r=document.createElement("div");r.innerHTML=e,n=Te(r.childNodes)}else n=Te(document.querySelectorAll(e));t||(n=n.length>= 1?n[0]:void 0)}else e===de?n=e:"value"in e||"current"in e?n=e.value||e.current:!e.nodeName||1!==e.nodeType&&9!==e.nodeType?"jQuery"in de&&e instanceof jQuery||e.constructor.prototype.jquery?n=t?e.toArray(): e.get(0):Array.isArray(e)&&(n=e.map(function(e){return be(e)}),t||(n=n.length>=1?n[0]:void 0)):n=e; return n},Se=de.requestAnimationFrame||de.webkitRequestAnimationFrame,we=de.cancelAnimationFrame||de.webkitCancelAnimationFrame; if(Se&&!we){var Ae={},Re=Se;Se=function Se(e){var t=Re(function(n){Ae[t]&&e(n)}); return Ae[t]=!0,t},we=function we(e){delete Ae[e]}}else Se&&we||(Se=function Se(e){return de.setTimeout(function(){e(de.performance&&de.performance.now&&de.performance.now()||(new Date).getTime())},16)}, we=de.clearTimeout); var Le=function Le(e,t){var n={};for(var r in e)r&&(n[r]=t(e[r],r));return n},Ie=function Ie(e,t){var n={}; for(var r in e)r&&t(e[r],r)&&(n[r]=e[r]);return n},Ce=function Ce(e,t){for(var n in e)if(n&&!t(e[n],n))return!1; return!0},Oe=function Oe(e,t){return Ce(e,function(e,n){return e===t[n]})},Pe={},ke=function ke(e,t){return Pe[t]||(Pe[t]=Ne(t)),Pe[t](e)},De=function De(e,t){return e&&t?Le(e,function(e,n){return ke(e, "number"==typeof t?t:t[n])}):e},xe=function xe(e){if(!isFinite(e))return 0; var t="".concat(e);if(t.indexOf("e")>=0){for(var n=0,r=1;Math.round(e*r)/r!==e;)r*=10,n++;return n}return t.indexOf(".")>=0?t.length-t.indexOf(".")-1:0},Ne=function Ne(e){var t=e<1?Math.pow(10,xe(e)):1; return function(n){return 0===e?0:Math.round(Math.round(n/e)*e*t)/t}},Me=function Me(e){var t=!0; return Object.keys(Ee).forEach(function(n){e&&e[n]===Ee[n]||(t=!1)}),t},Ue=function Ue(e,t){return e&&t?30:e?6:t?fe:1},Fe=function Fe(e,t,n){return n?!!(30===t||t&e&&n&e):!!(t&e)},Be=function Be(e,t,n){var r, i=((r={})[1]="auto",r[30]="none",r[24]="pan-x",r[6]="pan-y",r),o={}; if(e&&e.style){var a=t.touchAction?t.touchAction:i[n],s=_he(_he({},Ee),{"touch-action":"none"===e.style["touch-action"]?"none":a});Object.keys(s).forEach(function(t){o[t]=e.style[t],e.style[t]=s[t]})}return o}, Ve=function Ve(e,t){e&&e.style&&t&&Object.keys(t).forEach(function(n){e.style[n]=t[n]})},He=function(){function e(e){this._axes=e} var t=e.prototype;return t.hold=function(e,t){var n=this._getRoundPos(e).roundPos;this._axes.trigger(new C("hold",{pos:n,input:t.input||null,inputEvent:t.event||null,isTrusted:!0}))},t.triggerRelease=function(e){var t= this._getRoundPos(e.destPos,e.depaPos),n=t.roundPos,r=t.roundDepa; e.destPos=n,e.depaPos=r,e.setTo=this._createUserControll(e.destPos,e.duration),this._axes.trigger(new C("release",_he(_he({},e),{bounceRatio:this._getBounceRatio(n)})))},t.triggerChange=function(e,t,n, r){var i=this; void 0===r&&(r=!1);var o=this.animationManager,a=o.axisManager,s=o.getEventInfo(),u=this._getRoundPos(e,t),l=u.roundPos,c=u.roundDepa,d=a.moveTo(l,c),h=(null==n?void 0:n.event)||(null==s?void 0:s.event)|| null,f={pos:d.pos,delta:d.delta,bounceRatio:this._getBounceRatio(d.pos),holding:r,inputEvent:h,isTrusted:!!h,input:(null==n?void 0:n.input)||(null==s?void 0:s.input)||null,set:h?this._createUserControll(d.pos): function(){}},p=new C("change",f); return this._axes.trigger(p),Object.keys(d.pos).forEach(function(e){var t=d.pos[e];ae(i._axes,e,t).current=t}),h&&a.set(f.set().destPos),!p.isCanceled()},t.triggerAnimationStart=function(e){var t=this._getRoundPos(e.destPos, e.depaPos),n=t.roundPos,r=t.roundDepa; e.destPos=n,e.depaPos=r,e.setTo=this._createUserControll(e.destPos,e.duration);var i=new C("animationStart",e);return this._axes.trigger(i),!i.isCanceled()},t.triggerAnimationEnd=function(e){void 0===e&& (e=!1),this._axes.trigger(new C("animationEnd",{isTrusted:e}))},t.triggerFinish=function(e){void 0===e&&(e=!1),this._axes.trigger(new C("finish",{isTrusted:e}))},t.setAnimationManager=function(e){this.animationManager= e},t.destroy=function(){this._axes.off()},t._createUserControll=function(e,t){void 0===t&&(t=0); var n={destPos:_he({},e),duration:t};return function(e,t){return e&&(n.destPos=_he({},e)),void 0!==t&&(n.duration=t),n}},t._getRoundPos=function(e,t){var n=this._axes.options.round; return{roundPos:De(e,n),roundDepa:De(t,n)}},t._getBounceRatio=function(e){return this._axes.axisManager.map(e,function(e,t){return et.range[1]&& 0!==t.bounce[1]?(e-t.range[1])/t.bounce[1]:0})},e}(),je=function(){function e(e){this._options=e,this._prevented=!1} var t=e.prototype;return t.isInterrupting=function(){return this._options.interruptable||this._prevented},t.isInterrupted=function(){return!this._options.interruptable&&this._prevented},t.setInterrupt= function(e){this._options.interruptable||(this._prevented=e)},e}(),Ge=function Ge(e,t,n,r){var i=e,o=[n[0]?t[0]:r?t[0]-r[0]:t[0], n[1]?t[1]:r?t[1]+r[1]:t[1]];return i=Math.max(o[0],i),Math.min(o[1],i)},Ke=function Ke(e,t){return et[1]},ze=function ze(e,t,n){return n[1]&&e>t[1]||n[0]&&eo&&(r=(r-o)%a+i),n[0]&&e-1|| t.indexOf("none")>-1&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey||t.indexOf("shift")>-1&&e.shiftKey||t.indexOf("ctrl")>-1&&e.ctrlKey||t.indexOf("alt")>-1&&e.altKey||t.indexOf("meta")>-1&&e.metaKey)}, Je=function(){function e(){var e=this; this._stopContextMenu=function(t){t.preventDefault(),de.removeEventListener("contextmenu",e._stopContextMenu)}} var t=e.prototype;return t.extendEvent=function(e){var t,n,r,i=this.prevEvent,o=this._getCenter(e),a=i?this._getMovement(e):{x:0,y:0},s=i?this._getScale(e):1,u=i?(n=o.x-i.center.x,r=o.y-i.center.y,180* Math.atan2(r,n)/Math.PI):0,l=i?i.deltaX+a.x:a.x,c=i?i.deltaY+a.y:a.y,d=a.x,h=a.y,f=this._latestInterval,p=Date.now(),v=f?p-f.timestamp:0,g=i?i.velocityX:0,y=i?i.velocityY:0;return(!f||v>=16)&&(f&&(g=(t= [(l-f.deltaX)/v,(c-f.deltaY)/v])[0],y=t[1]),this._latestInterval={timestamp:p,deltaX:l,deltaY:c}),{srcEvent:e,scale:s,angle:u,center:o,deltaX:l,deltaY:c,offsetX:d,offsetY:h,velocityX:g,velocityY:y,preventSystemEvent:!0}}, t._getDistance=function(e,t){var n=t.clientX-e.clientX,r=t.clientY-e.clientY; return Math.sqrt(n*n+r*r)},t._getButton=function(e){var t={1:pe, 2:ve,4:ge};return(this._isTouchEvent(e)?pe:t[e.buttons])||null},t._isTouchEvent=function(e){return e.type&&e.type.indexOf("touch")>-1},t._isValidButton=function(e,t){return t.indexOf(e)>-1},t._isValidEvent= function(e,t,n){return(!t||Qe(e,t))&&(!n||this._isValidButton(this._getButton(e),n))},t._preventMouseButton=function(e,t){t===ve?de.addEventListener("contextmenu",this._stopContextMenu):t===ge&&e.preventDefault()}, e}(),$e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t} ce(t,e);var n=t.prototype;return n.onEventStart=function(e,t,n){var r=this._getButton(e);return this._isValidEvent(e,t,n)?(this._preventMouseButton(e,r),this.extendEvent(e)):null},n.onEventMove=function(e, t,n){return this._isValidEvent(e,t,n)?this.extendEvent(e):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(e,t){if(t){var n={1:pe, 2:ge,3:ve};return this._isValidButton(n[e.which],t)&&-1===this.end.indexOf(e.type)?1:0}return 0},n._getScale=function(){return 1},n._getCenter=function(e){return{x:e.clientX, y:e.clientY}},n._getMovement=function(e){var t=this.prevEvent.srcEvent; return{x:e.clientX-t.clientX,y:e.clientY-t.clientY}},t}(Je),et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t} ce(t,e);var n=t.prototype;return n.onEventStart=function(e,t){return this._baseTouches=e.touches,this._isValidEvent(e,t)?this.extendEvent(e):null},n.onEventMove=function(e,t){return this._isValidEvent(e, t)?this.extendEvent(e):null},n.onEventEnd=function(e){this._baseTouches=e.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(e){return e.touches.length},n._getScale= function(e){return 2!==e.touches.length||this._baseTouches.length<2?null:this._getDistance(e.touches[0],e.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(e){return{x:e.touches[0].clientX, y:e.touches[0].clientY}},n._getMovement=function(e){var t=this.prevEvent.srcEvent; return e.touches[0].identifier!==t.touches[0].identifier?{x:0,y:0}:{x:e.touches[0].clientX-t.touches[0].clientX,y:e.touches[0].clientY-t.touches[0].clientY}},t}(Je),tt=function(e){function t(){var t=null!== e&&e.apply(this,arguments)||this; return t.start=Ye?["pointerdown"]:["MSPointerDown"],t.move=Ye?["pointermove"]:["MSPointerMove"],t.end=Ye?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs= [],t} ce(t,e);var n=t.prototype;return n.onEventStart=function(e,t,n){var r=this._getButton(e);return this._isValidEvent(e,t,n)?(this._preventMouseButton(e,r),this._updatePointerEvent(e),this.extendEvent(e)): null},n.onEventMove=function(e,t,n){return this._isValidEvent(e,t,n)?(this._updatePointerEvent(e),this.extendEvent(e)):null},n.onEventEnd=function(e){this._removePointerEvent(e)},n.onRelease=function(){this.prevEvent= null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0], this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(e){return{x:e.clientX, y:e.clientY}},n._getMovement=function(e){var t=this.prevEvent.srcEvent; return e.pointerId!==t.pointerId?{x:0,y:0}:{x:e.clientX-t.clientX,y:e.clientY-t.clientY}},n._updatePointerEvent=function(e){var t=this,n=!1; this._recentInputs.forEach(function(r,i){r.pointerId===e.pointerId&&(n=!0,t._recentInputs[i]=e)}),n||(this._firstInputs.push(e),this._recentInputs.push(e))},n._removePointerEvent=function(e){this._firstInputs= this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(Je),nt=function(e){function t(){var t= null!==e&&e.apply(this,arguments)||this; return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t} ce(t,e);var n=t.prototype;return n.onEventStart=function(e,t,n){var r=this._getButton(e);return this._isTouchEvent(e)&&(this._baseTouches=e.touches),this._isValidEvent(e,t,n)?(this._preventMouseButton(e, r),this.extendEvent(e)):null},n.onEventMove=function(e,t,n){return this._isValidEvent(e,t,n)?this.extendEvent(e):null},n.onEventEnd=function(e){this._isTouchEvent(e)&&(this._baseTouches=e.touches)},n.onRelease= function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(e){return this._isTouchEvent(e)?e.touches.length:0},n._getScale=function(e){return this._isTouchEvent(e)?2!==e.touches.length|| this._baseTouches.length<2?1:this._getDistance(e.touches[0],e.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(e){return this._isTouchEvent(e)? {x:e.touches[0].clientX, y:e.touches[0].clientY}:{x:e.clientX,y:e.clientY}},n._getMovement=function(e){var t=this,n=[e, this.prevEvent.srcEvent].map(function(e){return t._isTouchEvent(e)?{id:e.touches[0].identifier,x:e.touches[0].clientX,y:e.touches[0].clientY}:{id:null,x:e.clientX,y:e.clientY}}),r=n[0],i=n[1]; return r.id===i.id?{x:r.x-i.x,y:r.y-i.y}:{x:0,y:0}},t}(Je),rt=function rt(e,t){return t.reduce(function(t,n,r){return e[r]&&(t[e[r]]=n),t},{})},it=function it(e){void 0===e&&(e=[]); var t=!1,n=!1,r=!1;return e.forEach(function(e){switch(e){case "mouse":n=!0;break;case "touch":t=Ze;break;case "pointer":r=Xe}}),r?new tt:t&&n?new nt:t?new et:n?new $e:null}; function ot(e){return e.indexOf("touch")>-1&&{passive:!1}} var at=function(){function e(e){var t=e.options,n=e.interruptManager,r=e.eventManager,i=e.axisManager,o=e.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=t,this._interruptManager= n,this._eventManager=r,this._axisManager=i,this._animationManager=o} var t=e.prototype;return t.get=function(e){return this._axisManager.get(e.axes)},t.hold=function(e,t){if(!this._interruptManager.isInterrupted()&&e.axes.length){var n={input:e, event:t};this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(e.axes), this._moveDistance=this._axisManager.get(e.axes)}},t.change=function(e,t,n,r){if(!this._isStopped&&this._interruptManager.isInterrupting()&&!this._axisManager.every(n,function(e){return 0===e})){var i= t.srcEvent?t.srcEvent:t; if(!i.__childrenAxesAlreadyChanged){var o,a=this._moveDistance||this._axisManager.get(e.axes);o=Le(a,function(e,t){return e+(n[t]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(e, t){var n=t.circular,r=t.range; return n&&(n[0]||n[1])?We(e,r,n):e})),this._isOutside&&this._axisManager.every(a,function(e,t){return!Ke(e,t.range)})&&(this._isOutside=!1),a=this._atOutside(a),o=this._atOutside(o),this.options.nested&& this._isEndofAxis(n,a,o)||(i.__childrenAxesAlreadyChanged=!0); var s={input:e,event:t};if(r){var u=this._animationManager.getDuration(o,a);this._animationManager.animateTo(o,u,s)}else!this._eventManager.triggerChange(o,a,s,!0)&&(this._isStopped=!0,this._moveDistance= null,this._animationManager.finish(!1))}}},t.release=function(e,t,n,r){if(!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance){var i=t.srcEvent?t.srcEvent:t; i.__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})); var o=this._axisManager.get(e.axes),a=this._axisManager.get(),s=this._animationManager.getDisplacement(n),u=rt(e.axes,s),l=this._axisManager.get(this._axisManager.map(u,function(e,t,n){return t.circular&& (t.circular[0]||t.circular[1])?o[n]+e:Ge(o[n]+e,t.range,t.circular,t.bounce)})); i.__childrenAxesAlreadyReleased=!0;var c=this._animationManager.getDuration(l,o,r);0===c&&(l=_he({},a));var d={depaPos:a,destPos:l,duration:c,delta:this._axisManager.getDelta(a,l),inputEvent:t,input:e, isTrusted:!0};this._eventManager.triggerRelease(d),this._moveDistance=null;var h=this._animationManager.getUserControl(d),f=Oe(h.destPos,a),p={input:e,event:t};f||0===h.duration?(f||this._eventManager.triggerChange(h.destPos, a,p,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(p):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(h.destPos,h.duration, p)}},t._atOutside=function(e){var t=this; return this._isOutside?this._axisManager.map(e,function(e,t){var n=t.range[0]-t.bounce[0],r=t.range[1]+t.bounce[1];return e>r?r:ei?e:ei?i+t._animationManager.interpolate(e-i,o[1]):e})},t._isEndofAxis=function(e,t,n){return this._axisManager.every(t,function(r, i,o){return 0===e[o]||t[o]===n[o]&&(a=r,s=i.range,u=i.bounce,!(l=i.circular)[0]&&a===s[0]-u[0]||!l[1]&&a===s[1]+u[1]); var a,s,u,l})},e}(),st=function st(e,t,n){return Math.max(Math.min(e,n),t)},ut=function(){function e(e){var t=e.options,n=e.interruptManager,r=e.eventManager,i=e.axisManager; this._options=t,this.interruptManager=n,this.eventManager=r,this.axisManager=i,this.animationEnd=this.animationEnd.bind(this)} var t=e.prototype;return t.getDuration=function(e,t,n){var r,i=this;if(void 0!==n)r=n;else{var o=Le(t,function(t,n){return function(e,t){var n=Math.sqrt(e/t*2);return n<100?0:n}(Math.abs(t-e[n]),i._options.deceleration)}); r=Object.keys(o).reduce(function(e,t){return Math.max(e,o[t])},-1/0)}return st(r,this._options.minimumDuration,this._options.maximumDuration)},t.getDisplacement=function(e){var t=Math.pow(e.reduce(function(e, t){return e+t*t},0),1/e.length),n=Math.abs(t/-this._options.deceleration); return e.map(function(e){return e/2*n})},t.stopAnimation=function(e){if(this._animateParam){var t=this.axisManager.get(),n=this.axisManager.map(t,function(e,t){return We(e,t.range,t.circular)}); Ce(n,function(e,n){return t[n]===e})||this.eventManager.triggerChange(n,t,e,!!e),this._animateParam=null,this._raf&&(r=this._raf,we(r)),this._raf=null,this.eventManager.triggerAnimationEnd(!!(null==e?void 0: e.event))}var r},t.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input, event:this._animateParam.inputEvent}:null},t.restore=function(e){var t=this.axisManager.get(),n=this.axisManager.map(t,function(e,t){return Math.min(t.range[1],Math.max(t.range[0],e))}); this.stopAnimation(),this.animateTo(n,this.getDuration(t,n),e)},t.animationEnd=function(){var e=this.getEventInfo(); this._animateParam=null;var t=this.axisManager.filter(this.axisManager.get(),function(e,t){return ze(e,t.range,t.circular)}); Object.keys(t).length>0&&this.setTo(this.axisManager.map(t,function(e,t){return We(e,t.range,t.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!e),this.axisManager.isOutside()? this.restore(e):this.finish(!!e)},t.finish=function(e){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(e)},t.getUserControl=function(e){var t=e.setTo(); return t.destPos=this.axisManager.get(t.destPos),t.duration=st(t.duration,this._options.minimumDuration,this._options.maximumDuration),t},t.animateTo=function(e,t,n){var r=this; this.stopAnimation();var i=this._createAnimationParam(e,t,n),o=_he({},i.depaPos),a=this.eventManager.triggerAnimationStart(i),s=this.getUserControl(i);if(!a&&this.axisManager.every(s.destPos,function(e, t){return ze(e,t.range,t.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!Oe(s.destPos,o)){var u=(null==n?void 0:n.event)||null; this._animateLoop({depaPos:o,destPos:s.destPos,duration:s.duration,delta:this.axisManager.getDelta(o,s.destPos),isTrusted:!!u,inputEvent:u,input:(null==n?void 0:n.input)||null},function(){return r.animationEnd()})}}, t.setTo=function(e,t){void 0===t&&(t=0); var n=Object.keys(e),r=this.axisManager.get(n);if(Oe(e,r))return this;this.interruptManager.setInterrupt(!0);var i=Ie(e,function(e,t){return r[t]!==e}); return Object.keys(i).length?(i=this.axisManager.map(i,function(e,t){var n=t.range,r=t.circular;return r&&(r[0]||r[1])?e:Ge(e,n,r)}),Oe(i,r)||(t>0?this.animateTo(i,t):(this.stopAnimation(),this.eventManager.triggerChange(i), this.finish(!1))),this):this},t.setBy=function(e,t){return void 0===t&&(t=0),this.setTo(Le(this.axisManager.get(Object.keys(e)),function(t,n){return t+e[n]}),t)},t._createAnimationParam=function(e,t,n){var r= this.axisManager.get(),i=e,o=(null==n?void 0:n.event)||null; return{depaPos:r,destPos:i,duration:st(t,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(r,i),inputEvent:o,input:(null==n?void 0:n.input)||null,isTrusted:!!o, done:this.animationEnd}},t._animateLoop=function(e,t){var n=this; if(e.duration){this._animateParam=_he(_he({},e),{startTime:(new Date).getTime()});var r=Le(e.destPos,function(e){return e}),i=this._initState(this._animateParam),o=function o(){n._raf=null; var e=n._animateParam,a=n._getNextState(i),s=!n.eventManager.triggerChange(a.pos,i.pos);if(i=a,a.finished)return e.destPos=n._getFinalPos(e.destPos,r),Oe(e.destPos,n.axisManager.get(Object.keys(e.destPos)))|| n.eventManager.triggerChange(e.destPos,a.pos),void t();s?n.finish(!1):n._raf=Se(o)}; o()}else this.eventManager.triggerChange(e.destPos),t()},t._getFinalPos=function(e,t){var n=this,r=1E-6; return Le(e,function(e,i){if(e>=t[i]-r&&e<=t[i]+r)return t[i];var o=n._getRoundUnit(e,i);return ke(e,o)})},t._getRoundUnit=function(e,t){var n,r=this._options.round,i=null; if(!r){var o=this.axisManager.getAxisOptions(t);n=Math.max(xe(o.range[0]),xe(o.range[1]),xe(e)),i=1/Math.pow(10,n)}return i||r},e}(),lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)|| this; return t._useDuration=!0,t} ce(t,e);var n=t.prototype;return n.interpolate=function(e,t){var n=this._easing(1E-5)/1E-5;return this._easing(e/(t*n))*t},n.updateAnimation=function(e){var t,n=this._animateParam; if(n){var r=(new Date).getTime()-n.startTime,i=(null==e?void 0:e.destPos)||n.destPos,o=null!==(t=null==e?void 0:e.duration)&&void 0!==t?t:n.duration;if((null==e?void 0:e.restart)||o<=r)this.setTo(i,o-r); else{if(null==e?void 0:e.destPos){var a=this.axisManager.get();this._initialEasingPer=this._prevEasingPer,n.delta=this.axisManager.getDelta(a,i),n.destPos=i}if(null==e?void 0:e.duration){var s=(r+this._durationOffset)/ n.duration;this._durationOffset=s*o-r,n.duration=o}}}},n._initState=function(e){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:e.depaPos, easingPer:0,finished:!1}},n._getNextState=function(e){var t=this,n=this._animateParam,r=e.pos,i=n.destPos,o=Le(r,function(e,t){return e<=i[t]?1:-1}),a=((new Date).getTime()-n.startTime+this._durationOffset)/ n.duration,s=this._easing(a),u=this.axisManager.map(r,function(e,u,l){var c=a>=1?i[l]:e+n.delta[l]*(s-t._prevEasingPer)/(1-t._initialEasingPer),d=We(c,u.range,u.circular); if(c!==d){var h=o[l]*(u.range[1]-u.range[0]);i[l]-=h,r[l]-=h}return d}); return this._prevEasingPer=s,{pos:u,easingPer:s,finished:s>=1}},n._easing=function(e){return e>1?1:this._options.easing(e)},t}(ut),ct=function(e){function t(t,n,r){void 0===t&&(t={}),void 0===n&&(n={}), void 0===r&&(r={}); var i=e.call(this)||this;return i.axis=t,i._inputs=[],i.options=_he({easing:function easing(e){return 1-Math.pow(1-e,3)}, interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6E-4,round:null,nested:!1},n),Object.keys(r).forEach(function(e){i.axis[e].startPos=r[e]}),i.interruptManager=new je(i.options),i.axisManager= new qe(i.axis),i.eventManager=new He(i),i.animationManager=new lt(i),i.inputObserver=new at(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i} ce(t,e);var n=t.prototype;return n.connect=function(e,t){var n;return n="string"==typeof e?e.split(" "):e.concat(),~this._inputs.indexOf(t)&&this.disconnect(t),t.mapAxes(n),t.connect(this.inputObserver), this._inputs.push(t),this},n.disconnect=function(e){if(e){var t=this._inputs.indexOf(e); t>=0&&(this._inputs[t].disconnect(),this._inputs.splice(t,1))}else this._inputs.forEach(function(e){return e.disconnect()}),this._inputs=[]; return this},n.get=function(e){return this.axisManager.get(e)},n.setTo=function(e,t){return void 0===t&&(t=0),this.animationManager.setTo(e,t),this},n.setBy=function(e,t){return void 0===t&&(t=0),this.animationManager.setBy(e, t),this},n.setOptions=function(e){return this.options=_he(_he({},this.options),e),this},n.setAxis=function(e){return this.axisManager.setAxis(e),this},n.stopAnimation=function(){return this.animationManager.stopAnimation(), this.animationManager.finish(!1),this},n.updateAnimation=function(e){return this.animationManager.updateAnimation(e),this},n.isBounceArea=function(e){return this.axisManager.isOutside(e)},n.destroy=function(){this.disconnect(), this.eventManager.destroy()},t.VERSION="3.8.2",t.TRANSFORM=_e,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL= fe,t.DIRECTION_ALL=30,t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([ue],t),t}(O),dt=function(){function e(e,t){var n=this; this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._isOverThreshold=!1,this._preventClickWhenDragged=function(e){n._dragged&& (e.preventDefault(),e.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=be(e),this.options=_he({inputType:["touch", "mouse","pointer"],inputKey:[ye],inputButton:[pe],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},t),this._onPanstart=this._onPanstart.bind(this), this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)} var t=e.prototype;return t.mapAxes=function(e){this._direction=Ue(!!e[0],!!e[1]),this.axes=e},t.connect=function(e){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)), this._attachElementEvent(e),this._originalCssProps=Be(this.element,this.options,this._direction),this},t.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent), Me(this._originalCssProps)||Ve(this.element,this._originalCssProps),this._direction=1,this},t.destroy=function(){this.disconnect(),this.element=null},t.enable=function(){return this._enabled=!0,this},t.disable= function(){return this._enabled=!1,this},t.isEnabled=function(){return this._enabled},t.release=function(){var e=this._activeEvent,t=e.prevEvent; return e.onRelease(),this._observer.release(this,t,[0,0]),this._detachWindowEvent(e),this},t._onPanstart=function(e){var t=this.options,n=t.inputKey,r=t.inputButton,i=this._activeEvent,o=i.onEventStart(e, n,r); if(o&&this._enabled&&!(i.getTouches(e,r)>1)&&!1!==o.srcEvent.cancelable){var a=this.options.iOSEdgeSwipeThreshold;this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,o),this._atRightEdge= me&&o.center.x>window.innerWidth-a,this._attachWindowEvent(i),i.prevEvent=o}},t._onPanmove=function(e){var t=this,n=this.options,r=n.iOSEdgeSwipeThreshold,i=n.preventClickOnDrag,o=n.releaseOnScroll,a=n.inputKey, s=n.inputButton,u=n.threshold,l=n.thresholdAngle,c=this._activeEvent,d=c.onEventMove(e,a,s),h=c.getTouches(e,s); if(0===h||o&&d&&!d.srcEvent.cancelable)this._onPanend(e);else if(d&&this._enabled&&!(h>1)){var f=function(e,t){if(t<0||t>90)return 1;var n=Math.abs(e);return n>t&&n<180-t?fe:6}(d.angle,l),p=Fe(6,this._direction, f),v=Fe(fe,this._direction,f); if(c.prevEvent&&me){if(d.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),d.deltaX<-r?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return t.release()}, 100))}var g=this._getDistance([d.deltaX, d.deltaY],[p,v]),y=this._getOffset([d.offsetX,d.offsetY],[p,v]),m=y.some(function(e){return 0!==e}); m&&(!1!==d.srcEvent.cancelable&&d.srcEvent.preventDefault(),d.srcEvent.stopPropagation()),d.preventSystemEvent=m,m&&(this._isOverThreshold||g>=u)&&(this._dragged=i,this._isOverThreshold=!0,this._observer.change(this, d,rt(this.axes,y))),c.prevEvent=d}},t._onPanend=function(e){var t=this.options.inputButton,n=this._activeEvent; if(n.onEventEnd(e),this._enabled&&0===n.getTouches(e,t)){this._detachWindowEvent(n),clearTimeout(this._rightEdgeTimer);var r=n.prevEvent,i=this._isOverThreshold?this._getOffset([Math.abs(r.velocityX)*(r.offsetX< 0?-1:1),Math.abs(r.velocityY)*(r.offsetY<0?-1:1)],[Fe(6,this._direction),Fe(fe,this._direction)]):[0,0];n.onRelease(),this._observer.release(this,r,i)}},t._attachWindowEvent=function(e){var t=this; null==e||e.move.forEach(function(e){window.addEventListener(e,t._onPanmove,ot(e))}),null==e||e.end.forEach(function(e){window.addEventListener(e,t._onPanend,ot(e))})},t._detachWindowEvent=function(e){var t= this; null==e||e.move.forEach(function(e){window.removeEventListener(e,t._onPanmove)}),null==e||e.end.forEach(function(e){window.removeEventListener(e,t._onPanend)})},t._getOffset=function(e,t){var n=this.options.scale; return[t[0]?e[0]*n[0]:0,t[1]?e[1]*n[1]:0]},t._getDistance=function(e,t){return Math.sqrt(Number(t[0])*Math.pow(e[0],2)+Number(t[1])*Math.pow(e[1],2))},t._attachElementEvent=function(e){var t=this,n=it(this.options.inputType), r=this.element; if(n){if(!r)throw new Error("Element to connect input does not exist.");this._observer=e,this._enabled=!0,this._activeEvent=n,r.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(e){r.addEventListener(e, t._onPanstart)}),n.move.forEach(function(e){r.addEventListener(e,t._voidFunction)})}},t._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element; n&&(n.removeEventListener("click",this._preventClickWhenDragged,!0),null==t||t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null==t||t.move.forEach(function(t){n.removeEventListener(t, e._voidFunction)})),this._enabled=!1,this._observer=null},e}(),ht=function(){function e(e,t){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this._isOverThreshold= !1,this.element=be(e),this.options=_he({scale:1, threshold:0,inputType:["touch","pointer"],touchAction:"none"},t),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)} var t=e.prototype;return t.mapAxes=function(e){this.axes=e},t.connect=function(e){return this._activeEvent&&this._detachEvent(),this._attachEvent(e),this._originalCssProps=Be(this.element,this.options, 30),this},t.disconnect=function(){return this._detachEvent(),Me(this._originalCssProps)||Ve(this.element,this._originalCssProps),this},t.destroy=function(){this.disconnect(),this.element=null},t.enable= function(){return this._enabled=!0,this},t.disable=function(){return this._enabled=!1,this},t.isEnabled=function(){return this._enabled},t._onPinchStart=function(e){var t=this._activeEvent,n=t.onEventStart(e); n&&this._enabled&&2===t.getTouches(e)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,e),this._pinchFlag=!0,this._isOverThreshold=!1,t.prevEvent=n)},t._onPinchMove=function(e){var t= this.options.threshold,n=this._activeEvent,r=n.onEventMove(e); if(r&&this._pinchFlag&&this._enabled&&2===n.getTouches(e)){var i=this._getDistance(r.scale),o=this._getOffset(r.scale,n.prevEvent.scale);(this._isOverThreshold||i>=t)&&(this._isOverThreshold=!0,this._observer.change(this, e,rt(this.axes,[o]))),n.prevEvent=r}},t._onPinchEnd=function(e){var t=this._activeEvent; t.onEventEnd(e),!this._pinchFlag||!this._enabled||t.getTouches(e)>=2||(t.onRelease(),this._observer.release(this,e,[0],0),this._baseValue=null,this._pinchFlag=!1)},t._attachEvent=function(e){var t=this, n=it(this.options.inputType),r=this.element; if(n){if(!r)throw new Error("Element to connect input does not exist.");this._observer=e,this._enabled=!0,this._activeEvent=n,n.start.forEach(function(e){r.addEventListener(e,t._onPinchStart,!1)}),n.move.forEach(function(e){r.addEventListener(e, t._onPinchMove,!1)}),n.end.forEach(function(e){r.addEventListener(e,t._onPinchEnd,!1)})}},t._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element; n&&(null==t||t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null==t||t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null==t||t.end.forEach(function(t){n.removeEventListener(t, e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},t._getOffset=function(e,t){return void 0===t&&(t=1),this._baseValue*(e-t)*this.options.scale},t._getDistance=function(e){return Math.abs(e-1)}, e}(),ft=function(){function e(e,t){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=be(e),this.options=_he({inputKey:[ye], scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},t),this._onWheel=this._onWheel.bind(this)} var t=e.prototype;return t.mapAxes=function(e){this._direction=Ue(!!e[1],!!e[0]),this.axes=e},t.connect=function(e){return this._detachEvent(),this._attachEvent(e),this},t.disconnect=function(){return this._detachEvent(), this},t.destroy=function(){this.disconnect(),this.element=null},t.enable=function(){return this._enabled=!0,this},t.disable=function(){return this._enabled=!1,this},t.isEnabled=function(){return this._enabled}, t._onWheel=function(e){var t=this; if(this._enabled&&Qe(e,this.options.inputKey)){var n=this._getOffset([e.deltaY,e.deltaX],[Fe(fe,this._direction),Fe(6,this._direction)]);0===n[0]&&0===n[1]||(e.preventDefault(),this._holding||(this._observer.hold(this, e),this._holding=!0),this._observer.change(this,e,rt(this.axes,n),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){t._holding&&(t._holding=!1,t._observer.release(t, e,[0]))},this.options.releaseDelay))}},t._getOffset=function(e,t){var n=this.options.scale,r=this.options.useNormalized; return[t[0]&&e[0]?(e[0]>0?-1:1)*(r?1:Math.abs(e[0]))*n:0,t[1]&&e[1]?(e[1]>0?-1:1)*(r?1:Math.abs(e[1]))*n:0]},t._attachEvent=function(e){var t=this.element; if(!t)throw new Error("Element to connect input does not exist.");this._observer=e,t.addEventListener("wheel",this._onWheel),this._enabled=!0},t._detachEvent=function(){this.element&&this.element.removeEventListener("wheel", this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},e}(),pt=function(){function e(e,t){this.axes=[],this.element=null,this._enabled=!1,this._holding= !1,this._timer=null,this.element=be(e),this.options=_he({scale:[1, 1]},t),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)} var t=e.prototype;return t.mapAxes=function(e){this.axes=e},t.connect=function(e){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(e), this},t.disconnect=function(){return this._detachEvent(),this},t.destroy=function(){this.disconnect(),this.element=null},t.enable=function(){return this._enabled=!0,this},t.disable=function(){return this._enabled= !1,this},t.isEnabled=function(){return this._enabled},t._onKeydown=function(e){if(this._enabled){var t=!0,n=1,r=-1; switch(e.keyCode){case 37:case 65:n=-1;break;case 39:case 68:break;case 40:case 83:n=-1,r=1;break;case 38:case 87:r=1;break;default:t=!1}if((-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(t=!1),t){e.preventDefault(); var i=-1===r?[+this.options.scale[0]*n,0]:[0,+this.options.scale[1]*n];this._holding||(this._observer.hold(this,e),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,e,rt(this.axes, i))}}},t._onKeyup=function(e){var t=this; this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){t._observer.release(t,e,[0,0]),t._holding=!1},80))},t._attachEvent=function(e){var t=this.element; if(!t)throw new Error("Element to connect input does not exist.");this._observer=e,t.addEventListener("keydown",this._onKeydown,!1),t.addEventListener("keypress",this._onKeydown,!1),t.addEventListener("keyup", this._onKeyup,!1),this._enabled=!0},t._detachEvent=function(){var e=this.element; e&&(e.removeEventListener("keydown",this._onKeydown,!1),e.removeEventListener("keypress",this._onKeydown,!1),e.removeEventListener("keyup",this._onKeyup,!1)),this._enabled=!1,this._observer=null},e}(), vt=ct,gt=1E-6,yt="undefined"!=typeof Float32Array?Float32Array:Array; Math.random;var mt=Math.PI/180;function _t(e){return e*mt} function Et(){var e=new yt(3);return yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e} function Tt(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)} function bt(e,t,n){var r=new yt(3);return r[0]=e,r[1]=t,r[2]=n,r} function St(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e} function wt(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],u=n[2];return e[0]=i*u-o*s,e[1]=o*a-r*u,e[2]=r*s-i*a,e} function At(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e} function Rt(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],u=t[1],l=t[2],c=i*l-o*u,d=o*s-r*l,h=r*u-i*s,f=i*h-o*d,p=o*c-r*h,v=r*d-i*c,g=2*a;return c*=g,d*=g,h*=g,f*=2,p*=2,v*=2,e[0]=s+c+f,e[1]=u+d+p,e[2]= l+h+v,e} Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}); var Lt;function It(){var e=new yt(9);return yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e} function Ct(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e} function Ot(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=t[8],d=c*a-s*l,h=-c*o+s*u,f=l*o-a*u,p=n*d+r*h+i*f;return p?(p=1/p,e[0]=d*p,e[1]=(-c*r+i*l)*p,e[2]=(s*r-i*a)*p,e[3]=h*p,e[4]= (c*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=f*p,e[7]=(-l*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null} function Pt(){var e=new yt(4);return yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e} Et(),Lt=new yt(4),yt!=Float32Array&&(Lt[0]=0,Lt[1]=0,Lt[2]=0,Lt[3]=0);var kt=function kt(e){var t=new yt(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Dt=function Dt(e,t,n,r){var i=new yt(4); return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i},xt=function xt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},Nt=function Nt(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o; return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e}; function Mt(e,t){var n=new yt(2);return n[0]=e,n[1]=t,n} function Ut(e,t){return e[0]=t[0],e[1]=t[1],e} function Ft(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e} function Bt(){var e=new yt(16);return yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e} function Vt(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],d=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]= t[15]),e[4]=o*i+l*r,e[5]=a*i+c*r,e[6]=s*i+d*r,e[7]=u*i+h*r,e[8]=l*i-o*r,e[9]=c*i-a*r,e[10]=d*i-s*r,e[11]=h*i-u*r,e} function Ht(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],l=t[8],c=t[9],d=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]= t[15]),e[0]=o*i-l*r,e[1]=a*i-c*r,e[2]=s*i-d*r,e[3]=u*i-h*r,e[8]=o*r+l*i,e[9]=a*r+c*i,e[10]=s*r+d*i,e[11]=u*r+h*i,e} Et(),bt(1,0,0),bt(0,1,0),Pt(),Pt(),It(),function(){var e;e=new yt(2),yt!=Float32Array&&(e[0]=0,e[1]=0)}(); var jt=function jt(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(o=1/(r-i),e[10]=(i+ r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e},_Gt=function Gt(e,t){return _Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_Gt(e,t)}; function Kt(e,t){function n(){this.constructor=e} _Gt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)} var _zt=function zt(){return _zt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0},n.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount= 0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(e){e.loader&&e.loader.destroy()}),this.elementInfos=[]},n.destroy=function(){this.clear(),this.off()},n.getLoader=function(e, t){var n=this,r=e.tagName.toLowerCase(),i=this.options.loaders,o=t.prefix,a=Object.keys(i); if(i[r])return new i[r](e,t);var s=new dn(e,t),u=en(e.querySelectorAll(a.join(", ")));s.setHasLoading(u.some(function(e){return tn(e,o)})); var l=!1,c=this.clone().on("error",function(e){s.onError(e.target)}).on("ready",function(){s.onReady(l)}); return s.on("requestChildren",function(){var t=function(e,t,n){var r=en(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t=1||(e.error?(this.onAlreadyError(e),1):(this.addEvents(),0)))},t.EVENTS=["loadedmetadata", "error"],t}(cn),vn=function(e){function t(t){return void 0===t&&(t={}),e.call(this,_zt({loaders:{img:fn, video:pn}},t))||this} return Kt(t,e),t}(hn),gn="3.6.3",_yn=function yn(e,t){return _yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]= t[n])},_yn(e,t)}; function mn(e,t){function n(){this.constructor=e} _yn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)} var _n8=function _n(){return _n8=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&& e[r++],done:!e}}}; throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");} function Tn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&& !r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error;}}return a} function bn(){for(var e=[],t=0;t0)-Number(e<0)||+e},Fn.toDegree=Un,Fn.getRotationDelta= function(e,t,n){var r=bt(Bn[n].targetAxis[0],Bn[n].targetAxis[1],Bn[n].targetAxis[2]),i=Bn[n].meshPoint,o=kt(e),a=kt(t); Nt(o,o),Nt(a,a);var s=bt(0,0,1),u=bt(0,0,1);Rt(s,s,o),Rt(u,u,a),Rt(r,r,a);var l,c=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(r,wt(Et(),s,u))>0?1:-1,d=bt(i[0],i[1],i[2]); l=n!==Bn.YAW_DELTA_BY_YAW?bt(0,c,0):bt(c,0,0),Rt(d,d,a),Rt(l,l,a);var h=d,f=l,p=Et();wt(p,h,f),function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]= t[2]*o}(p,p); var v=p[0],g=p[1],y=p[2];Rt(u=bt(i[0],i[1],i[2]),u,a),Rt(s=bt(i[0],i[1],i[2]),s,o);var m=Math.abs(s[0]*v+s[1]*g+s[2]*y),_=Et();St(_,s,function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}(Et(), p,m)); var E=(_[0]*u[0]+_[1]*u[1]+_[2]*u[2])/(Tt(_)*Tt(u));E>1&&(E=1);var T,b=Math.acos(E),S=wt(Et(),u,_);return m=v*S[0]+g*S[1]+y*S[2],T=n!==Bn.YAW_DELTA_BY_YAW?m>0?1:-1:m<0?1:-1,Un(b*T*c)},Fn.angleBetweenVec2= Vn; var Hn=-1,jn=null,Gn=null,Kn=/Chrome\/([0-9]+)\.(?:[0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(Pn);Kn&&(Hn=parseInt(Kn[1],10),jn=Kn[2],Gn=Kn[3]);var zn,Wn,qn,Zn=Hn,Yn=65===Hn&&"3325"===jn&&parseInt(Gn,10)<148,Xn= /Android/i.test(Pn),Qn=.0014,Jn=[.2,.2],$n={NONE:"none",YAWPITCH:"yawPitch",VR:"VR"},er=Sn.MathUtil||{};er.degToRad=Math.PI/180,er.radToDeg=180/Math.PI,er.Vector2=function(e,t){this.x=e||0,this.y=t||0}, er.Vector2.prototype={constructor:er.Vector2, set:function set(e,t){return this.x=e,this.y=t,this}, copy:function copy(e){return this.x=e.x,this.y=e.y,this}, subVectors:function subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},er.Vector3=function(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0},er.Vector3.prototype={constructor:er.Vector3, set:function set(e,t,n){return this.x=e,this.y=t,this.z=n,this}, copy:function copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}, length:function length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}, normalize:function normalize(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this}, multiplyScalar:function multiplyScalar(e){this.x*=e,this.y*=e,this.z*=e}, applyQuaternion:function applyQuaternion(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*r-a*n,l=s*n+a*t-i*r,c=s*r+i*n-o*t,d=-i*t-o*n-a*r;return this.x=u*s+d*-i+l*-a-c*-o,this.y=l*s+d* -o+c*-i-u*-a,this.z=c*s+d*-a+u*-o-l*-i,this}, dot:function dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}, crossVectors:function crossVectors(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}},er.Quaternion=function(e,t,n,r){this.x=e||0,this.y=t||0,this.z= n||0,this.w=void 0!==r?r:1},er.Quaternion.prototype={constructor:er.Quaternion, set:function set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}, copy:function copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}, setFromEulerXYZ:function setFromEulerXYZ(e,t,n){var r=Math.cos(e/2),i=Math.cos(t/2),o=Math.cos(n/2),a=Math.sin(e/2),s=Math.sin(t/2),u=Math.sin(n/2);return this.x=a*i*o+r*s*u,this.y=r*s*o-a*i*u,this.z=r* i*u+a*s*o,this.w=r*i*o-a*s*u,this}, setFromEulerYXZ:function setFromEulerYXZ(e,t,n){var r=Math.cos(e/2),i=Math.cos(t/2),o=Math.cos(n/2),a=Math.sin(e/2),s=Math.sin(t/2),u=Math.sin(n/2);return this.x=a*i*o+r*s*u,this.y=r*s*o-a*i*u,this.z=r* i*u-a*s*o,this.w=r*i*o+a*s*u,this}, setFromAxisAngle:function setFromAxisAngle(e,t){var n=t/2,r=Math.sin(n);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(n),this}, multiply:function multiply(e){return this.multiplyQuaternions(this,e)}, multiplyQuaternions:function multiplyQuaternions(e,t){var n=e.x,r=e.y,i=e.z,o=e.w,a=t.x,s=t.y,u=t.z,l=t.w;return this.x=n*l+o*a+r*u-i*s,this.y=r*l+o*s+i*a-n*u,this.z=i*l+o*u+n*s-r*a,this.w=o*l-n*a-r*s- i*u,this}, inverse:function inverse(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this}, normalize:function normalize(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z= this.z*e,this.w=this.w*e),this}, slerp:function slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this.x,r=this.y,i=this.z,o=this.w,a=o*e.w+n*e.x+r*e.y+i*e.z;if(a<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,a=-a): this.copy(e),a>=1)return this.w=o,this.x=n,this.y=r,this.z=i,this;var s=Math.acos(a),u=Math.sqrt(1-a*a);if(Math.abs(u)<.001)return this.w=.5*(o+this.w),this.x=.5*(n+this.x),this.y=.5*(r+this.y),this.z= .5*(i+this.z),this;var l=Math.sin((1-t)*s)/u,c=Math.sin(t*s)/u;return this.w=o*l+this.w*c,this.x=n*l+this.x*c,this.y=r*l+this.y*c,this.z=i*l+this.z*c,this}, setFromUnitVectors:function setFromUnitVectors(e,t){return void 0===zn&&(zn=new er.Vector3),(Wn=e.dot(t)+1)<1E-6?(Wn=0,Math.abs(e.x)>Math.abs(e.z)?zn.set(-e.y,e.x,0):zn.set(0,-e.z,e.y)):zn.crossVectors(e, t),this.x=zn.x,this.y=zn.y,this.z=zn.z,this.w=Wn,this.normalize(),this}}; var tr,nr,rr,ir=null!==(qn=null==An?void 0:An.userAgent)&&void 0!==qn?qn:"",or=Sn.Util||{};or.MIN_TIMESTEP=.001,or.MAX_TIMESTEP=1,or.base64=function(e,t){return"data:"+e+";base64,"+t},or.clamp=function(e, t,n){return Math.min(Math.max(t,e),n)},or.lerp=function(e,t,n){return e+(t-e)*n},or.isIOS=function(){var e=/iPad|iPhone|iPod/.test(null==An?void 0:An.platform); return function(){return e}}(),or.isWebViewAndroid=(tr=-1!==ir.indexOf("Version")&&-1!==ir.indexOf("Android")&&-1!==ir.indexOf("Chrome"),function(){return tr}),or.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(ir); return function(){return e}}(),or.isFirefoxAndroid=(nr=-1!==ir.indexOf("Firefox")&&-1!==ir.indexOf("Android"),function(){return nr}),or.isR7=(rr=-1!==ir.indexOf("R7 Build"),function(){return rr}),or.isLandscapeMode= function(){var e=90===Sn.orientation||-90===Sn.orientation; return or.isR7()?!e:e},or.isTimestampDeltaValid=function(e){return!(isNaN(e)||e<=or.MIN_TIMESTEP||e>or.MAX_TIMESTEP)},or.getScreenWidth=function(){return Math.max(Sn.screen.width,Sn.screen.height)*Sn.devicePixelRatio}, or.getScreenHeight=function(){return Math.min(Sn.screen.width,Sn.screen.height)*Sn.devicePixelRatio},or.requestFullscreen=function(e){if(or.isWebViewAndroid())return!1; if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1; e.msRequestFullscreen()}return!0},or.exitFullscreen=function(){if(wn.exitFullscreen)wn.exitFullscreen(); else if(wn.webkitExitFullscreen)wn.webkitExitFullscreen();else if(wn.mozCancelFullScreen)wn.mozCancelFullScreen();else{if(!wn.msExitFullscreen)return!1;wn.msExitFullscreen()}return!0},or.getFullscreenElement= function(){return wn.fullscreenElement||wn.webkitFullscreenElement||wn.mozFullScreenElement||wn.msFullscreenElement},or.linkProgram=function(e,t,n,r){var i=e.createShader(e.VERTEX_SHADER); e.shaderSource(i,t),e.compileShader(i);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,n),e.compileShader(o);var a=e.createProgram();for(var s in e.attachShader(a,i),e.attachShader(a,o),r)e.bindAttribLocation(a, r[s],s);return e.linkProgram(a),e.deleteShader(i),e.deleteShader(o),a},or.getProgramUniforms=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i="",o=0;o-1?e.split("/")[2]:e.split("/")[0]).split(":")[0]}; var ar=function(){function e(e){this.predictionTimeS=e,this.previousQ=new er.Quaternion,this.previousTimestampS=null,this.deltaQ=new er.Quaternion,this.outQ=new er.Quaternion} return e.prototype.getPrediction=function(e,t,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new er.Vector3;r.copy(t),r.normalize();var i=t.length();if(i< 20*er.degToRad)return or.isDebug()&&console.log("Moving slowly, at %s deg/s: no prediction",(er.radToDeg*i).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;this.previousTimestampS;var o= i*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=n,this.outQ},e}(),sr=function(e){function t(){var t= e.call(this)||this; return t._onDeviceMotion=t._onDeviceMotion.bind(t),t._onDeviceOrientation=t._onDeviceOrientation.bind(t),t._onChromeWithoutDeviceMotion=t._onChromeWithoutDeviceMotion.bind(t),t.isWithoutDeviceMotion=Yn, t.isAndroid=Xn,t.stillGyroVec=Et(),t.rawGyroVec=Et(),t.adjustedGyroVec=Et(),t._timer=-1,t.lastDevicemotionTimestamp=0,t._isEnabled=!1,t.enable(),t} mn(t,e);var n=t.prototype;return n.enable=function(){this.isAndroid&&Sn.addEventListener("deviceorientation",this._onDeviceOrientation),this.isWithoutDeviceMotion?Sn.addEventListener("deviceorientation", this._onChromeWithoutDeviceMotion):Sn.addEventListener("devicemotion",this._onDeviceMotion),this._isEnabled=!0},n.disable=function(){Sn.removeEventListener("deviceorientation",this._onDeviceOrientation), Sn.removeEventListener("deviceorientation",this._onChromeWithoutDeviceMotion),Sn.removeEventListener("devicemotion",this._onDeviceMotion),this._isEnabled=!1},n._onChromeWithoutDeviceMotion=function(e){var t= e.alpha,n=e.beta,r=e.gamma; null!==t&&(t=(t||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this.trigger(new C("devicemotion",{inputEvent:{deviceorientation:{alpha:t,beta:n,gamma:-r}}})))},n._onDeviceOrientation=function(){var e= this; this._timer&&clearTimeout(this._timer),this._timer=Sn.setTimeout(function(){(new Date).getTime()-e.lastDevicemotionTimestamp<200&&function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2]}(e.stillGyroVec,e.rawGyroVec)}, 200)},n._onDeviceMotion=function(e){var t=!(null==e.rotationRate.alpha),n=!(null==e.accelerationIncludingGravity.x); if(0!==e.interval&&t&&n){var r=_n8({},e);r.interval=e.interval,r.timeStamp=e.timeStamp,r.type=e.type,r.rotationRate={alpha:e.rotationRate.alpha,beta:e.rotationRate.beta,gamma:e.rotationRate.gamma},r.accelerationIncludingGravity= {x:e.accelerationIncludingGravity.x,y:e.accelerationIncludingGravity.y,z:e.accelerationIncludingGravity.z},r.acceleration={x:e.acceleration.x,y:e.acceleration.y,z:e.acceleration.z},this.isAndroid&&(function(e, t,n,r){e[0]=t,e[1]=n,e[2]=r}(this.rawGyroVec,e.rotationRate.alpha||0,e.rotationRate.beta||0,e.rotationRate.gamma||0),St(this.adjustedGyroVec,this.rawGyroVec,this.stillGyroVec),this.lastDevicemotionTimestamp= (new Date).getTime(),r.adjustedRotationRate={alpha:this.adjustedGyroVec[0], beta:this.adjustedGyroVec[1],gamma:this.adjustedGyroVec[2]}),this.trigger(new C("devicemotion",{inputEvent:r}))}},t}(O),ur=function(){function e(e,t){this.set(e,t)} var t=e.prototype;return t.set=function(e,t){this.sample=e,this.timestampS=t},t.copy=function(e){this.set(e.sample,e.timestampS)},e}(),lr=function(){function e(e){this.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e, t); var n=t-this.previousGyroMeasurement.timestampS;or.isTimestampDeltaValid(n)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},this.kFilter=e,this.currentAccelMeasurement=new ur, this.currentGyroMeasurement=new ur,this.previousGyroMeasurement=new ur,or.isIOS()?this.filterQ=new er.Quaternion(-1,0,0,1):this.filterQ=new er.Quaternion(1,0,0,1),this.previousFilterQ=new er.Quaternion, this.previousFilterQ.copy(this.filterQ),this.accelQ=new er.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new er.Vector3,this.measuredGravity=new er.Vector3,this.gyroIntegralQ=new er.Quaternion} var t=e.prototype;return t.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},t.getOrientation=function(){return this.filterQ},t.run_=function(){if(!this.isOrientationInitialized)return this.accelQ= this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0); var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ), this.filterQ.multiply(t);var n=new er.Quaternion;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample), this.measuredGravity.normalize();var r=new er.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),or.isDebug()&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)", er.radToDeg*or.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1), this.measuredGravity.z.toFixed(1));var i=new er.Quaternion;i.copy(this.filterQ),i.multiply(r),this.filterQ.slerp(i,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},t.accelToQuaternion_=function(e){var t= new er.Vector3; t.copy(e),t.normalize();var n=new er.Quaternion;return n.setFromUnitVectors(new er.Vector3(0,0,-1),t),n.inverse(),n},t.gyroToQuaternionDelta_=function(e,t){var n=new er.Quaternion,r=new er.Vector3; return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*t),n},e}(); lr.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized= !0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ), this.filterQ.multiply(t);var n=new er.Quaternion;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample), this.measuredGravity.normalize();var r=new er.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse();var i=new er.Quaternion;i.copy(this.filterQ),i.multiply(r),this.filterQ.slerp(i, 1-this.kFilter),this.previousFilterQ.copy(this.filterQ),this.isFilterQuaternionInitialized||(this.isFilterQuaternionInitialized=!0)},lr.prototype.getOrientation=function(){return this.isFilterQuaternionInitialized? this.filterQ:null}; var cr,dr,hr=function(e){function t(){var t=e.call(this)||this;return t.deviceMotion=new sr,t.accelerometer=new er.Vector3,t.gyroscope=new er.Vector3,t._onDeviceMotionChange=t._onDeviceMotionChange.bind(t), t._onScreenOrientationChange=t._onScreenOrientationChange.bind(t),t.filter=new lr(.98),t.posePredictor=new ar(.04),t.filterToWorldQ=new er.Quaternion,t.isFirefoxAndroid=or.isFirefoxAndroid(),t.isIOS=Cn|| On,t.isChromeUsingDegrees=Zn>=66,t._isEnabled=!1,t.isIOS?t.filterToWorldQ.setFromAxisAngle(new er.Vector3(1,0,0),Math.PI/2):t.filterToWorldQ.setFromAxisAngle(new er.Vector3(1,0,0),-Math.PI/2),t.inverseWorldToScreenQ= new er.Quaternion,t.worldToScreenQ=new er.Quaternion,t.originalPoseAdjustQ=new er.Quaternion,t.originalPoseAdjustQ.setFromAxisAngle(new er.Vector3(0,0,1),-Sn.orientation*Math.PI/180),t._setScreenTransform(), or.isLandscapeMode()&&t.filterToWorldQ.multiply(t.inverseWorldToScreenQ),t.resetQ=new er.Quaternion,t.deviceMotion.on("devicemotion",t._onDeviceMotionChange),t.enable(),t} mn(t,e);var n=t.prototype;return n.enable=function(){this.isEnabled()||(this.deviceMotion.enable(),this._isEnabled=!0,Sn.addEventListener("orientationchange",this._onScreenOrientationChange))},n.disable= function(){this.isEnabled()&&(this.deviceMotion.disable(),this._isEnabled=!1,Sn.removeEventListener("orientationchange",this._onScreenOrientationChange))},n.isEnabled=function(){return this._isEnabled}, n.destroy=function(){this.disable(),this.deviceMotion=null},n.getOrientation=function(){var e; if(this.deviceMotion.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(new er.Quaternion).setFromAxisAngle(new er.Vector3(0,1,0),-this._alpha),e=this._deviceOrientationQ, (n=new er.Quaternion).copy(e),n.multiply(this.filterToWorldQ),n.multiply(this.resetQ),n.multiply(this.worldToScreenQ),n.multiplyQuaternions(this.deviceOrientationFixQ,n);var t=Dt(n.x,n.y,n.z,n.w);return Nt(t, t)}if(!(e=this.filter.getOrientation()))return null;var n=this._convertFusionToPredicted(e);return t=Dt(n.x,n.y,n.z,n.w),Nt(t,t)},n._triggerChange=function(){var e=this.getOrientation(); e&&(this._prevOrientation?function(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(n-a)<=gt*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=gt*Math.max(1,Math.abs(r), Math.abs(s))&&Math.abs(i-u)<=gt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-l)<=gt*Math.max(1,Math.abs(o),Math.abs(l))}(this._prevOrientation,e)||this.trigger(new C("change",{quaternion:e})):this._prevOrientation= e)},n._convertFusionToPredicted=function(e){this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS); var t=new er.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),t},n._onDeviceMotionChange=function(e){var t=e.inputEvent, n=t.deviceorientation,r=t,i=r.accelerationIncludingGravity,o=r.adjustedRotationRate||r.rotationRate,a=r.timeStamp/1E3; n?(this._alpha||(this._alpha=n.alpha),this._deviceOrientationQ=this._deviceOrientationQ||new er.Quaternion,this._deviceOrientationQ.setFromEulerYXZ(n.beta,n.alpha,n.gamma),this._triggerChange()):(this.isFirefoxAndroid&& (a/=1E3),this.accelerometer.set(-i.x,-i.y,-i.z),this.gyroscope.set(o.alpha,o.beta,o.gamma),(this.isIOS||this.isFirefoxAndroid||this.isChromeUsingDegrees)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer, a),this.filter.addGyroMeasurement(this.gyroscope,a),this._triggerChange(),this.previousTimestampS=a)},n._onScreenOrientationChange=function(){this._setScreenTransform()},n._setScreenTransform=function(){this.worldToScreenQ.set(0, 0,0,1); var e=Sn.orientation;switch(e){case 0:break;case 90:case -90:case 180:this.worldToScreenQ.setFromAxisAngle(new er.Vector3(0,0,1),e/-180*Math.PI)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()}, t}(O),fr=function fr(e,t){return Fn.getRotationDelta(e,t,Bn.PITCH_DELTA)},pr=function(e){function t(t,n){void 0===n&&(n={}); var r=e.call(this)||this;return r.element=t,r._prevQuaternion=null,r._quaternion=null,r.fusionPoseSensor=null,r.options=_n8({scale:1,threshold:0},n),r._onPoseChange=r._onPoseChange.bind(r),r} mn(t,e);var n=t.prototype;return n.mapAxes=function(e){this.axes=e},n.connect=function(e){return this.observer||(this.observer=e,this.fusionPoseSensor=new hr,this.fusionPoseSensor.enable(),this._attachEvent()), this},n.disconnect=function(){return this.observer?(this._dettachEvent(),this.fusionPoseSensor.disable(),this.fusionPoseSensor.destroy(),this.fusionPoseSensor=null,this.observer=null,this):this},n.destroy= function(){this.disconnect(),this.element=null,this.options=null,this.axes=null,this._prevQuaternion=null,this._quaternion=null},n._onPoseChange=function(e){if(!this._prevQuaternion)return this._prevQuaternion= kt(e.quaternion),void(this._quaternion=kt(e.quaternion)); var t,n,r,i;xt(this._prevQuaternion,this._quaternion),xt(this._quaternion,e.quaternion),this.observer.change(this,e,(t=this.axes,[(n=this._prevQuaternion,r=this._quaternion,i=Fn.getRotationDelta(n,r,Bn.YAW_DELTA_BY_YAW), Fn.getRotationDelta(n,r,Bn.YAW_DELTA_BY_ROLL)*Math.sin(Fn.extractPitchFromQuat(r))+i),fr(this._prevQuaternion,this._quaternion)].reduce(function(e,n,r){return t[r]&&(e[t[r]]=n),e},{})))},n._attachEvent= function(){this.fusionPoseSensor.on("change",this._onPoseChange)},n._dettachEvent=function(){this.fusionPoseSensor.off("change",this._onPoseChange)},t}(O),vr=null,gr=0,yr=function(){function e(){if(gr++, vr)return vr; vr=this,this._onDeviceOrientation=this._onDeviceOrientation.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._spinR=0,this._screenOrientationAngle=0,Sn.addEventListener("deviceorientation", this._onDeviceOrientation),Sn.addEventListener("orientationchange",this._onOrientationChange)} var t=e.prototype;return t.getRadian=function(){return this._spinR+_t(this._screenOrientationAngle)},t.unref=function(){--gr>0||(Sn.removeEventListener("deviceorientation",this._onDeviceOrientation),Sn.removeEventListener("orientationchange", this._onOrientationChange),this._spinR=0,this._screenOrientationAngle=0,vr=null,gr=0)},t._onDeviceOrientation=function(e){if(null!==e.beta&&null!==e.gamma){var t=_t(e.beta),n=_t(e.gamma); this._spinR=Math.atan2(Math.cos(t)*Math.sin(n),Math.sin(t))}},t._onOrientationChange=function(){Sn.screen&&Sn.screen.orientation&&void 0!==Sn.screen.orientation.angle?this._screenOrientationAngle=screen.orientation.angle: void 0!==Sn.orientation&&(this._screenOrientationAngle=Sn.orientation>=0?Sn.orientation:360+Sn.orientation)},e}(),mr=function(e){function t(t,n){void 0===n&&(n={}); var r=e.call(this,t,n)||this;return r._useRotation=!1,r._screenRotationAngle=null,r.setUseRotation(!(!n||!n.useRotation)),r._userDirection=vt.DIRECTION_ALL,r} mn(t,e);var n=t.prototype;return n.setUseRotation=function(e){this._useRotation=e,this._screenRotationAngle&&(this._screenRotationAngle.unref(),this._screenRotationAngle=null),this._useRotation&&(this._screenRotationAngle= new yr)},n.connect=function(t){return this._userDirection=this._direction,this._useRotation&&this._direction&vt.DIRECTION_ALL&&(this._direction=vt.DIRECTION_HORIZONTAL),e.prototype.connect.call(this,t)}, n.destroy=function(){this._useRotation&&this._screenRotationAngle&&this._screenRotationAngle.unref(),e.prototype.destroy.call(this)},n._getOffset=function(t,n){if(!1===this._useRotation)return e.prototype._getOffset.call(this, t,n); var r=e.prototype._getOffset.call(this,t,[!0,!0]),i=[0,0],o=this._screenRotationAngle.getRadian(),a=Math.cos(o),s=Math.sin(o);return i[0]=r[0]*a-r[1]*s,i[1]=r[1]*a+r[0]*s,this._userDirection&vt.DIRECTION_HORIZONTAL? this._userDirection&vt.DIRECTION_VERTICAL||(i[1]=0):i[0]=0,i},t}(dt),_r=bt(0,1,0),Er=function(e){function t(){var t=e.call(this)||this; return t._fusionPoseSensor=new hr,t._quaternion=Pt(),t._fusionPoseSensor.enable(),t._fusionPoseSensor.on("change",function(e){t._quaternion=e.quaternion,t.trigger(new C("change",{isTrusted:!0}))}),t} mn(t,e);var n=t.prototype;return n.getCombinedQuaternion=function(e){var t=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}(Pt(),_r,_t(-e)),n=function(e, t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}(Pt(),this._quaternion); return function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],u=n[1],l=n[2],c=n[3];return e[0]=r*c+a*s+i*l-o*u,e[1]=i*c+a*u+o*s-r*l,e[2]=o*c+a*l+r*u-i*s,e[3]=a*c-r*s-i*u-o*l,e}(Pt(),n,t)},n.destroy=function(){this.off(), this._fusionPoseSensor&&(this._fusionPoseSensor.off(),this._fusionPoseSensor.destroy(),this._fusionPoseSensor=null)},t}(O),Tr=[-180, 180],br=[-90,90],Sr=[-180,180],wr=function(e){function t(t){var n=e.call(this)||this;n.options={};var r=_n8({element:null,yaw:0,pitch:0,fov:65,showPolePoint:!1,useZoom:!0,useKeyboard:!0,gyroMode:$n.YAWPITCH, touchDirection:6,yawRange:Tr,pitchRange:br,fovRange:[30,110],aspectRatio:1},t);return n._element=r.element,n._initialFov=r.fov,n._enabled=!1,n._isAnimating=!1,n._deviceQuaternion=null,n._initAxes(r),n.option(r), n} mn(t,e);var n=t.prototype;return n.updatePanScale=function(e){void 0===e&&(e={});var t=this._axes.get().fov,n=e.height||parseInt(window.getComputedStyle(this._element).height,10),r=Jn[0]*t/this._initialFov* 320/n;return this._axesPanInput.options.scale=[r,r],this._axes.options.deceleration=Qn*t/110,this},n.option=function(e,t){if(!e)return this._getOptions(); if(e&&"string"==typeof e&&void 0===t)return this._getOptions(e);var n={},r=[];if("string"==typeof e)r.push(e),n[e]=t;else{var i=e;r=Object.keys(i),n=_n8({},i)}return this._setOptions(this._getValidatedOptions(n)), this._applyOptions(r),this},n.enable=function(){return this._enabled||(this._enabled=!0,this._applyOptions(Object.keys(this.options)),this.updatePanScale()),this},n.disable=function(e){return void 0=== e&&(e=!1),this._enabled?(e||this._resetOrientation(),this._axes.disconnect(),this._enabled=!1,this):this},n.lookAt=function(e,t){var n=e.yaw,r=e.pitch,i=e.fov,o=this._axes.get(),a=void 0===n?0:n-o.yaw, s=void 0===r?0:r-o.pitch,u=void 0===i?0:i-o.fov; this._axes.options.maximumDuration=1/0,this._axes.setBy({yaw:a,pitch:s,fov:u},t)},n.getYawPitch=function(){var e=this._axes.get(); return{yaw:e.yaw,pitch:e.pitch}},n.getFov=function(){return this._axes.get().fov},n.getQuaternion=function(){var e=this._axes.get(); return this._deviceQuaternion.getCombinedQuaternion(e.yaw)},n.shouldRenderWithQuaternion=function(){return this.options.gyroMode===$n.VR},n.destroy=function(){this._axes&&this._axes.destroy(),this._axesPanInput&& this._axesPanInput.destroy(),this._axesWheelInput&&this._axesWheelInput.destroy(),this._axesTiltMotionInput&&this._axesTiltMotionInput.destroy(),this._axesPinchInput&&this._axesPinchInput.destroy(),this._axesMoveKeyInput&& this._axesMoveKeyInput.destroy(),this._deviceQuaternion&&this._deviceQuaternion.destroy()},n._initAxes=function(e){var t=this,n=this._updateYawRange(e.yawRange,e.fov,e.aspectRatio),r=this._updatePitchRange(e.pitchRange, e.fov,e.showPolePoint),i=e.gyroMode===$n.VR; this._axesPanInput=new mr(this._element,{useRotation:i}),this._axesWheelInput=new ft(this._element,{scale:-4}),this._axesTiltMotionInput=null,this._axesPinchInput=kn?new ht(this._element,{scale:-1}):null, this._axesMoveKeyInput=new pt(this._element,{scale:[-6,6]}),this._axes=(new vt({yaw:{range:n,circular:this._isCircular(n),bounce:[0,0]},pitch:{range:r,circular:this._isCircular(r),bounce:[0,0]},fov:{range:e.fovRange, circular:[!1,!1],bounce:[0,0]}},{deceleration:Qn,maximumDuration:1E3},{yaw:e.yaw,pitch:e.pitch,fov:e.fov})).on({hold:function hold(e){t._axes.options.maximumDuration=1E3,t.trigger(new C("hold",{isTrusted:e.isTrusted}))}, change:function change(e){0!==e.delta.fov&&(t._updateControlScale(e),t.updatePanScale()),t._triggerChange(e)}, release:function release(e){t._triggerChange(e)}, animationEnd:function animationEnd(e){t.trigger(new C("animationEnd",{isTrusted:e.isTrusted}))}})},n._getValidatedOptions=function(e){return e.yawRange&&(e.yawRange=this._getValidYawRange(e.yawRange,e.fov, e.aspectRatio)),e.pitchRange&&(e.pitchRange=this._getValidPitchRange(e.pitchRange,e.fov)),e},n._getOptions=function(e){var t; return"string"==typeof e?t=this.options[e]:0===arguments.length&&(t=this.options),t},n._setOptions=function(e){for(var t in e)this.options[t]=e[t]},n._applyOptions=function(e){var t=this.options,n=this._axes, r=t.gyroMode===$n.VR,i=t.gyroMode===$n.YAWPITCH,o=r?2&t.touchDirection:t.touchDirection; if(e.some(function(e){return"showPolePoint"===e||"fov"===e||"aspectRatio"===e||"yawRange"===e||"pitchRange"===e})&&(e.indexOf("fov")>=0&&(n.setTo({fov:t.fov}),this.updatePanScale()),this._updateControlScale()), e.some(function(e){return"fovRange"===e})){var a=t.fovRange,s=n.get().fov,u=n.get().fov; Ut(n.axis.fov.range,a),ua[1]&&(u=a[1]),s!==u&&(n.setTo({fov:u},0),this._updateControlScale(),this.updatePanScale())}if(e.some(function(e){return"gyroMode"===e})&&Dn&&(this._axesTiltMotionInput&& (this._axes.disconnect(this._axesTiltMotionInput),this._axesTiltMotionInput.destroy(),this._axesTiltMotionInput=null),this._deviceQuaternion&&(this._deviceQuaternion.destroy(),this._deviceQuaternion=null), r?this._initDeviceQuaternion():i&&(this._axesTiltMotionInput=new pr(this._element),this._axes.connect(["yaw", "pitch"],this._axesTiltMotionInput)),this._axesPanInput.setUseRotation(r)),e.some(function(e){return"useKeyboard"===e})&&(t.useKeyboard?n.connect(["yaw", "pitch"],this._axesMoveKeyInput):n.disconnect(this._axesMoveKeyInput)),e.some(function(e){return"useZoom"===e})){var l=t.useZoom; n.disconnect(this._axesWheelInput),l&&n.connect(["fov"],this._axesWheelInput)}this._togglePinchInputByOption(t.touchDirection,t.useZoom),e.some(function(e){return"touchDirection"===e})&&this._enabled&& this._enableTouch(o)},n._togglePinchInputByOption=function(e,t){this._axesPinchInput&&(this._axes.disconnect(this._axesPinchInput),t&&6===e&&-1===this._axes._inputs.indexOf(this._axesPinchInput)&&this._axes.connect(["fov"], this._axesPinchInput))},n._enableTouch=function(e){this._axesPanInput&&this._axes.disconnect(this._axesPanInput); var t=2&e?"yaw":null,n=4&e?"pitch":null;this._axes.connect([t,n],this._axesPanInput)},n._initDeviceQuaternion=function(){var e=this; this._deviceQuaternion=new Er,this._deviceQuaternion.on("change",function(t){e._triggerChange(t)})},n._getValidYawRange=function(e,t,n){var r=this._adjustAspectRatio(n||this.options.aspectRatio||1),i=(t|| this._axes.get().fov)*r; return e[1]-e[0]>=i?e:this.options.yawRange||Tr},n._getValidPitchRange=function(e,t){var n=t||this._axes.get().fov; return e[1]-e[0]>=n?e:this.options.pitchRange||br},n._isCircular=function(e){return e[1]-e[0]<360?[!1, !1]:[!0,!0]},n._updateControlScale=function(e){var t=this.options,n=this._axes.get().fov,r=this._updatePitchRange(t.pitchRange,n,t.showPolePoint),i=this._updateYawRange(t.yawRange,n,t.aspectRatio),o=this._axes.get(), a=o.yaw,s=o.pitch; return Ut(this._axes.axis.yaw.range,i),Ut(this._axes.axis.pitch.range,r),this._axes.axis.yaw.circular=this._isCircular(i),this._axes.axis.pitch.circular=this._isCircular(r),ai[1]&&(a=i[1]), sr[1]&&(s=r[1]),e&&e.set({yaw:a,pitch:s}),this._axes.setTo({yaw:a,pitch:s},0),this},n._updatePitchRange=function(e,t,n){if(this.options.gyroMode===$n.VR)return Sr; var r=e[1]-e[0],i=t/2;return!n||r<180?[e[0]+i,e[1]-i]:e.concat()},n._updateYawRange=function(e,t,n){if(this.options.gyroMode===$n.VR)return Tr; if(e[1]-e[0]>=360)return e.concat();var r=Fn.toDegree(Math.atan2(n,1/Math.tan(_t(t/2))));return[e[0]+r,e[1]-r]},n._triggerChange=function(e){var t=this._axes.get(),n=this.options,r={targetElement:n.element, isTrusted:e.isTrusted,yaw:t.yaw,pitch:t.pitch,fov:t.fov,quaternion:null};n.gyroMode===$n.VR&&this._deviceQuaternion&&(r.quaternion=this._deviceQuaternion.getCombinedQuaternion(t.yaw)),this.trigger(new C("change", r))},n._adjustAspectRatio=function(e){for(var t=[.52, .54,.563,.57,.584,.59,.609,.67,.702,.72,.76,.78,.82,.92,.97,1,1.07,1.14,1.19,1.25,1.32,1.38,1.4,1.43,1.53,1.62,1.76,1.77,1.86,1.96,2.26,2.3,2.6,3,5,6],n=[.51,.54,.606,.56,.628,.63,.647,.71,.736,.757,.78, .77,.8,.89,.975,1,1.07,1.1,1.15,1.18,1.22,1.27,1.3,1.33,1.39,1.45,1.54,1.55,1.58,1.62,1.72,1.82,1.92,2,2.24,2.3],r=-1,i=0;i=e){r=i;break}if(-1===r)return t[0]>e?n[0]: n[n[0].length-1];var o=t[r],a=t[r+1],s=n[r],u=n[r+1];return this._lerp(s,u,(e-o)/(a-o))},n._lerp=function(e,t,n){return e+n*(t-e)},n._resetOrientation=function(){var e=this.options; return this._axes.setTo({yaw:e.yaw,pitch:e.pitch,fov:e.fov},0),this},t.VERSION=gn,t.CONTROL_MODE_VR=1,t.CONTROL_MODE_YAWPITCH=2,t.TOUCH_DIRECTION_ALL=6,t.TOUCH_DIRECTION_YAW=2,t.TOUCH_DIRECTION_PITCH=4, t.TOUCH_DIRECTION_NONE=1,t}(O),Ar={INVALID_DEVICE:10, NO_WEBGL:11,FAIL_IMAGE_LOAD:12,FAIL_BIND_TEXTURE:13,INVALID_RESOURCE:14,RENDERING_CONTEXT_LOST:15},Rr={READY:"ready",VIEW_CHANGE:"viewChange",ANIMATION_END:"animationEnd",ERROR:"error"},Lr={EQUIRECTANGULAR:"equirectangular", CUBEMAP:"cubemap",CUBESTRIP:"cubestrip",PANORAMA:"panorama",STEREOSCOPIC_EQUI:"stereoequi"},Ir={TOP_BOTTOM:"3dv",LEFT_RIGHT:"3dh",NONE:""},Cr=function Cr(e,t){var n,r;if("object"==_typeof(t)?(n=t.src,r= t.type):"string"==typeof t&&(n=t),!n)return!1;var i=document.createElement("source");i.src=n,r&&(i.type=r),e.appendChild(i)},Or={0:"NO_ERROR", 1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",37442:"CONTEXT_LOST_WEBGL"},Pr=null,kr=function(){function e(){} return e.createShader=function(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.error(e.getShaderInfoLog(r)),null)},e.createProgram= function(e,t,n){var r=e.createProgram(); return e.attachShader(r,t),e.attachShader(r,n),e.linkProgram(r),e.deleteShader(t),e.deleteShader(n),e.getProgramParameter(r,e.LINK_STATUS)?r:(e.deleteProgram(r),null)},e.initBuffer=function(e,t,n,r,i){var o= e.createBuffer(); return e.bindBuffer(t,o),e.bufferData(t,n,e.STATIC_DRAW),o&&(o.itemSize=r,o.numItems=n.length/r),void 0!==i&&(e.enableVertexAttribArray(i),e.vertexAttribPointer(i,o.itemSize,e.FLOAT,!1,0,0)),o},e.getWebglContext= function(e,t){var n,r,i=null,o=_n8({preserveDrawingBuffer:!1, antialias:!1},t),a=function a(e){return e.statusMessage}; e.addEventListener("webglcontextcreationerror",a);try{for(var s=En(["webgl","experimental-webgl","webkit-3d","moz-webgl"]),u=s.next();!u.done;u=s.next()){var l=u.value;try{i=e.getContext(l,o)}catch(e){}if(i)break}}catch(e){n= {error:e}}finally{try{u&&!u.done&&(r=s["return"])&&r.call(s)}finally{if(n)throw n.error;}}return e.removeEventListener("webglcontextcreationerror",a),i},e.createTexture=function(e,t){var n=e.createTexture(); return e.bindTexture(t,n),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(t,e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE),e.bindTexture(t,null),n},e.isWebGLAvailable=function(){if(null===Pr){var t=document.createElement("canvas"),n=e.getWebglContext(t); if(Pr=!!n,n){var r=n.getExtension("WEBGL_lose_context");r&&r.loseContext()}}return!!Pr},e.isStableWebGL=function(){var e=ne(),t=!0; if("android"===e.os.name){var n=parseFloat(e.os.version);(n<=4.3&&n>=1||4.4===n&&"chrome"!==e.browser.name)&&(t=!1)}return t},e.getErrorNameFromWebGLErrorCode=function(e){return e in Or?Or[e]:"UNKNOWN_ERROR"}, e.texImage2D=function(e,t,n){try{e.texImage2D(t,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}catch(e){console.error("WebGLUtils.texImage2D error:",e)}},e.getMaxTextureSize=function(e){return e.getParameter(e.MAX_TEXTURE_SIZE)}, e}(),Dr=ne(),xr="ie"===Dr.browser.name&&11===Dr.browser.majorVersion,Nr={ERROR:"error"},Mr=function(e){function t(){var t=e.call(this)||this; return t._forceDimension=null,t._pixelCanvas=null,t._pixelContext=null,t} mn(t,e);var n=t.prototype;return n.render=function(e){var t=e.gl,n=e.shaderProgram,r=e.indexBuffer,i=e.mvMatrix,o=e.pMatrix;t.uniformMatrix4fv(n.pMatrixUniform,!1,o),t.uniformMatrix4fv(n.mvMatrixUniform, !1,i),r&&t.drawElements(t.TRIANGLES,r.numItems,t.UNSIGNED_SHORT,0)},n.getDimension=function(e){return{width:e.naturalWidth||e.videoWidth, height:e.naturalHeight||e.videoHeight}},n.updateShaderData=function(e){},n._initPixelSource=function(e,t){if(void 0===t&&(t=null),xr&&e instanceof HTMLVideoElement||t){var n=t||this.getDimension(e),r=n.width, i=n.height; this._pixelCanvas=document.createElement("canvas"),this._pixelCanvas.width=r,this._pixelCanvas.height=i,this._pixelContext=this._pixelCanvas.getContext("2d")}this._forceDimension=t},n._getPixelSource=function(e){if(!this._pixelCanvas)return e; var t=this.getDimension(e),n=this._forceDimension||t;return this._pixelCanvas.width!==n.width&&(this._pixelCanvas.width=n.width),this._pixelCanvas.height!==n.height&&(this._pixelCanvas.height=n.height), this._forceDimension?this._pixelContext.drawImage(e,0,0,t.width,t.height,0,0,n.width,n.height):this._pixelContext.drawImage(e,0,0),this._pixelCanvas},n._extractTileConfig=function(e){var t=Array.isArray(e.tileConfig)? e.tileConfig:Array.apply(void 0,bn(Array(6))).map(function(){return e.tileConfig}); return t=t.map(function(e){return _n8({flipHorizontal:!1,rotation:0},e)}),t},n._triggerError=function(e){console.error("Renderer Error:",e),this.trigger(new C(Nr.ERROR,{message:"string"==typeof e?e:e.message}))}, t.EVENTS=Nr,t}(O),Ur=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} mn(t,e);var n=t.prototype;return t.extractOrder=function(e){return e.order||"RLUDBF"},n.getVertexPositionData=function(){return t._VERTEX_POSITION_DATA=null!==t._VERTEX_POSITION_DATA?t._VERTEX_POSITION_DATA: [1, -1,1,-1,-1,1,-1,1,1,1,1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,-1,1,1,1,-1,1,1,1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,1,1,-1,-1,1,-1,1,1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1],t._VERTEX_POSITION_DATA}, n.getIndexData=function(){if(t._INDEX_DATA)return t._INDEX_DATA; for(var e=[],n=this.getVertexPositionData(),r=0;r0||!e.flipHorizontal&&n<0?r.push(r.shift()):r.unshift(r.pop());for(var o=a.slice(12*t,12*t+12),s=[],u=0;u<4;u++)s[r[u]]=o.splice(0,3);return s}).map(function(e){return n._shrinkCoord({image:r, faceCoords:e,trim:u})}).reduce(function(e,t){return bn(e,t.reduce(function(e,t){return bn(e,t)},[]))},[]); return l},n.getVertexShaderSource=function(){return"\nattribute vec3 aVertexPosition;\nattribute vec3 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nvarying highp vec3 vVertexDirectionVector;\nvoid main(void) {\n vVertexDirectionVector \x3d aTextureCoord;\n gl_Position \x3d uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n}"}, n.getFragmentShaderSource=function(){return"\nprecision highp float;\nuniform samplerCube uSampler;\nvarying highp vec3 vVertexDirectionVector;\nvoid main(void) {\n gl_FragColor \x3d textureCube(uSampler, vVertexDirectionVector);\n}"}, n.updateTexture=function(e,n,r){var i="RLUDBF",o=t.extractOrder(r),a={}; o.split("").forEach(function(e,t){a[e]=t}); try{if(n instanceof Array)for(var s=0;s<6;s++){var u=a[i[s]];kr.texImage2D(e,e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n[u])}else{var l=this.getMaxCubeMapTextureSize(e,n);for(s=0;s<6;s++){u=a[i[s]];var c=this.extractTileFromImage(n, u,l);kr.texImage2D(e,e.TEXTURE_CUBE_MAP_POSITIVE_X+s,c)}}}catch(e){this._triggerError(e)}},n.bindTexture=function(e,t,n,r){e.bindTexture(e.TEXTURE_CUBE_MAP,t),this.updateTexture(e,n,r)},n.getSourceTileSize= function(e){var t=this.getDimension(e),n=t.width,r=t.height,i=n/r; return i===1/6?n:6===i?r:i===2/3?n/2:n/3},n.extractTileFromImage=function(e,t,n){var r=this.getDimension(e).width,i=this.getSourceTileSize(e),o=document.createElement("canvas"); o.width=n,o.height=n;var a=o.getContext("2d"),s=r/i,u=i*t%(i*s),l=Math.floor(t/s)*i;return a.drawImage(e,u,l,i,i,0,0,n,n),o},n.getMaxCubeMapTextureSize=function(e,t){var n=ne(),r=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), i=this.getSourceTileSize(t); if("ie"===n.browser.name&&11===n.browser.majorVersion&&!Fn.isPowerOfTwo(i))for(var o=1;o=0;u--)for(var l=0;l<3;l++){var c=[l/3, u/2,(l+1)/3,u/2,(l+1)/3,(u+1)/2,l/3,(u+1)/2];s.push(c)}var d=this._extractTileConfig(r);return s=s.map(function(e){return t._shrinkCoord(e,i,o)}).map(function(e,n){return t._transformCoord(e,d[n])}),"BFUDRL".split("").map(function(e){return a.indexOf(e)}).map(function(e){return s[e]}).reduce(function(e, t){return e.concat(t)},[])},n.updateTexture=function(e,t){kr.texImage2D(e,e.TEXTURE_2D,this._getPixelSource(t))},n.bindTexture=function(e,t,n){var r=this.getDimension(n),i=r.width,o=r.height,a=Math.max(i, o),s=kr.getMaxTextureSize(e); a>s?this._triggerError("Image width("+i+") exceeds device limit("+s+"))"):(this._initPixelSource(n),e.activeTexture(e.TEXTURE0),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.bindTexture(e.TEXTURE_2D,t),this.updateTexture(e, n))},n._transformCoord=function(e,t){var n=e.slice(); return t.flipHorizontal&&(n=this._flipHorizontalCoord(n)),t.rotation&&(n=this._rotateCoord(n,t.rotation)),n},n._shrinkCoord=function(e,t,n){var r=t.width,i=n*(1/t.height),o=n*(1/r); return[e[0]+o,e[1]+i,e[2]-o,e[3]+i,e[4]-o,e[5]-i,e[6]+o,e[7]-i]},n._rotateCoord=function(e,t){var n,r=Math.floor(t/90)%4; if(0===r)return e;var i=[];return r>0?(n=e.splice(0,2*r),i=e.concat(n)):i=(n=e.splice(2*(4+r),2*-r)).concat(e),i},n._flipHorizontalCoord=function(e){return[e[2], e[3],e[0],e[1],e[6],e[7],e[4],e[5]]},t}(Mr),Br=-.5*Math.PI,Vr=[],Hr=[],jr=[]; for(cr=0;cr<=60;cr++){var Gr=(cr/60-.5)*Math.PI,Kr=Math.sin(Gr),zr=Math.cos(Gr);for(dr=0;dr<=60;dr++){var Wr=2*(dr/60-.5)*Math.PI+Br,qr=Math.sin(Wr),Zr=Math.cos(Wr)*zr,Yr=Kr,Xr=qr*zr,Qr=dr/60,Jr=cr/60; if(Vr.push(Qr,Jr),Hr.push(2*Zr,2*Yr,2*Xr),60!==dr&&60!==cr){var $r=61*cr+dr,ei=$r+60+1;jr.push($r,ei,$r+1,ei,ei+1,$r+1)}}}var ti=function(e){function t(t){var n=e.call(this)||this;return n._stereoFormat= t,n} mn(t,e);var n=t.prototype;return n.render=function(t){var n,r,i=t.gl,o=t.shaderProgram;switch(this._stereoFormat){case Ir.TOP_BOTTOM:n=[1,.5,0,0],r=[1,.5,0,.5];break;case Ir.LEFT_RIGHT:n=[.5,1,0,0],r=[.5, 1,.5,0];break;default:n=[1,1,0,0],r=[1,1,0,0]}var a=i.getUniformLocation(o,"uTexScaleOffset");i.uniform4fv(a,bn(n,r)),e.prototype.render.call(this,t)},n.getVertexPositionData=function(){return t._VERTEX_POSITION_DATA}, n.getIndexData=function(){return t._INDEX_DATA},n.getTextureCoordData=function(){return t._TEXTURE_COORD_DATA},n.getVertexShaderSource=function(){return"\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nuniform float uEye;\nuniform vec4 uTexScaleOffset[2];\nvarying highp vec2 vTextureCoord;\nvoid main(void) {\n vec4 scaleOffset \x3d uTexScaleOffset[int(uEye)];\n vTextureCoord \x3d aTextureCoord.xy * scaleOffset.xy + scaleOffset.zw;\n gl_Position \x3d uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n}"}, n.getFragmentShaderSource=function(){return"\nprecision highp float;\nvarying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor \x3d texture2D(uSampler, vTextureCoord.st);\n}"}, n.updateTexture=function(e,t){kr.texImage2D(e,e.TEXTURE_2D,this._getPixelSource(t))},n.bindTexture=function(e,t,n){var r=this.getDimension(n),i=r.width,o=r.height,a=Math.max(i,o),s=kr.getMaxTextureSize(e); a>s?this._triggerError("Image width("+i+") exceeds device limit("+s+"))"):(this._initPixelSource(n),e.activeTexture(e.TEXTURE0),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.bindTexture(e.TEXTURE_2D,t),this.updateTexture(e, n))},t._VERTEX_POSITION_DATA=Hr,t._TEXTURE_COORD_DATA=Vr,t._INDEX_DATA=jr,t}(Mr),ni=60,ri=[],ii=[],oi=[],ai=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} mn(t,e);var n=t.prototype;return n.getVertexPositionData=function(){return t._VERTEX_POSITION_DATA},n.getIndexData=function(){return t._INDEX_DATA},n.getTextureCoordData=function(){return t._TEXTURE_COORD_DATA}, n.getVertexShaderSource=function(){return"\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nvarying highp vec2 vTextureCoord;\nvoid main(void) {\n vTextureCoord \x3d aTextureCoord;\n gl_Position \x3d uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n}"}, n.getFragmentShaderSource=function(){return"\nprecision highp float;\nvarying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n}"}, n.updateTexture=function(e,t){kr.texImage2D(e,e.TEXTURE_2D,this._getPixelSource(t))},n.bindTexture=function(e,t,n){var r,i=this.getDimension(n),o=i.width,a=i.height,s=Math.max(o,a),u=kr.getMaxTextureSize(e); s>u&&(this._triggerError("Image width("+o+") exceeds device texture limit("+u+"))"),r=o>a?{width:u,height:u*a/o}:{width:u*o/a,height:u}),this._initPixelSource(n,r),e.activeTexture(e.TEXTURE0),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !0),e.bindTexture(e.TEXTURE_2D,t),this.updateTexture(e,n)},n.updateShaderData=function(e){var t,n,r,i,o,a=e.imageAspectRatio,s=void 0===a?6:a; if(s<1?(i=!0,o=1/s):(i=!1,o=s),o>=6){var u=360/o;n=2*Math.PI,r=Math.tan(_t(u/2))}else n=o,r=.5;ri.length=0,ii.length=0,oi.length=0;for(var l=[-r,r],c=Math.PI/2+(2*Math.PI-n)/2,d=0,h=l.length;d0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(clearTimeout(e._rafTimer),e._rafTimer=-1),i<16?e._rafId=e._context.requestAnimationFrame(e._onLoop):e._rafTimer= window.setTimeout(e._onLoop,0)},this._callback=null,this._context=window,this._rafId=-1,this._rafTimer=-1} var t=e.prototype;return t.setCallback=function(e){this._callback=e},t.setContext=function(e){this._context=e},t.start=function(){var e=this._context,t=this._callback; e&&t&&(this._rafId>=0||this._rafTimer>=0||(this._rafId=On?e.requestAnimationFrame(this._onLoopNextTick):e.requestAnimationFrame(this._onLoop)))},t.stop=function(){this._rafId>=0&&this._context.cancelAnimationFrame(this._rafId), this._rafTimer>=0&&clearTimeout(this._rafTimer),this._rafId=-1,this._rafTimer=-1},e}(),pi=Lr,vi=Nn||1; vi>2&&(vi=2);var gi,yi={BIND_TEXTURE:"bindTexture",IMAGE_LOADED:"imageLoaded",ERROR:"error",RENDERING_CONTEXT_LOST:"renderingContextLost",RENDERING_CONTEXT_RESTORE:"renderingContextRestore"},mi={INVALID_DEVICE:10, NO_WEBGL:11,FAIL_IMAGE_LOAD:12,RENDERER_ERROR:13},_i=function(e){function t(t,n,r,i,o,a,s,u){var l=e.call(this)||this;return l.textureCoordBuffer=null,l.vertexBuffer=null,l.indexBuffer=null,l.exitVR=function(){var e= l._vr,t=l.context,n=l._animator;e&&(e.removeEndCallback(l.exitVR),e.destroy(),l._vr=null,Cn&&l._restoreStyle(),l.updateViewportDimensions(l.width,l.height),l._updateViewport(),t.bindFramebuffer(t.FRAMEBUFFER, null),l._bindBuffers(),l._shouldForceDraw=!0,n.stop(),n.setContext(window),n.setCallback(l._render.bind(l)),n.start())},l._renderStereo=function(e,t){var n,r,i=l._vr,o=l.context,a=i.getEyeParams(o,t); if(a){i.beforeRender(o,t);try{for(var s=En([0,1]),u=s.next();!u.done;u=s.next()){var c=u.value,d=a[c];l.mvMatrix=d.mvMatrix,l.pMatrix=d.pMatrix,o.viewport.apply(o,bn(d.viewport)),o.uniform1f(l.shaderProgram.uEye, c),l._bindBuffers(),l._draw()}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=s["return"])&&r.call(s)}finally{if(n)throw n.error;}}i.afterRender()}},l._onFirstVRFrame=function(e,t){var n=l._vr,r=l.context, i=l._animator; if(n.canRender(t)){var o=bt(0,0,-1),a=n.getEyeParams(r,t)[0],s=Ct(It(),a.mvMatrix),u=Ct(It(),a.pMatrix),c=Ot(It(),s),d=Ot(It(),u),h=At(Et(),o,d);At(h,h,c);var f=Fn.yawOffsetBetween(h,bt(0,0,1));0!==f&& (n.setYawOffset(f),i.setCallback(l._renderStereo))}},l.sphericalConfig=s,l.fieldOfView=s.fieldOfView,l.width=n,l.height=r,l._lastQuaternion=null,l._lastYaw=null,l._lastPitch=null,l._lastFieldOfView=null, l.pMatrix=Bt(),l.mvMatrix=Bt(),jt(l.pMatrix,_t(l.fieldOfView),n/r,.1,100),l.textureCoordBuffer=null,l.vertexBuffer=null,l.indexBuffer=null,l.canvas=l._initCanvas(o,a,n,r),l._setDefaultCanvasStyle(),l._wrapper= null,l._wrapperOrigStyle=null,l._renderingContextAttributes=u,l._image=null,l._imageConfig=null,l._imageIsReady=!1,l._shouldForceDraw=!1,l._keepUpdate=!1,l._onContentLoad=l._onContentLoad.bind(l),l._onContentError= l._onContentError.bind(l),l._animator=new fi,l._vr=null,t&&l.setImage({image:t, imageType:s.imageType,isVideo:i,cubemapConfig:s.cubemapConfig}),l} mn(t,e);var n=t.prototype;return n.setYawPitchControl=function(e){this._yawPitchControl=e},n.getContent=function(){return this._image},n.setImage=function(e){var t=e.image,n=e.imageType,r=e.isVideo,i=void 0!== r&&r,o=e.cubemapConfig; this._imageIsReady=!1,this._isVideo=i,this._imageConfig=_n8({order:n===pi.CUBEMAP?"RLUDBF":"RLUDFB",tileConfig:{flipHorizontal:!1,rotation:0},trim:0},o),this._setImageType(n),this._contentLoader&&this._contentLoader.destroy(), this._contentLoader=(new vn).on("ready",this._onContentLoad).on("error",this._onContentError),i?(this._image=function(e){if(e instanceof HTMLVideoElement)return e;var t=document.createElement("video"); return t.setAttribute("crossorigin","anonymous"),t.setAttribute("webkit-playsinline",""),t.setAttribute("playsinline",""),e instanceof Array?e.forEach(function(e){return Cr(t,e)}):Cr(t,e),t.querySelectorAll("source").length> 0&&t.readyState<1&&t.load(),t}(t),this._contentLoader.check([this._image]),this._keepUpdate=!0):(this._image=function(e){var t=(e instanceof Array?e:[e]).map(function(e){var t=e; return"string"==typeof e&&((t=new Image).crossOrigin="anonymous",t.src=e),t}); return 1===t.length?t[0]:t}(t),this._contentLoader.check(Array.isArray(this._image)?this._image:[this._image]),this._keepUpdate=!1)},n.isImageLoaded=function(){return!!this._image&&this._imageIsReady&& (!this._isVideo||this._image.readyState>=2)},n.bindTexture=function(){var e=this; return new H(function(t,n){var r=e._contentLoader;return e._image?r?void(r.isReady()?(e._bindTexture(),t()):(r.check(Array.isArray(e._image)?e._image:[e._image]),r.once("ready",function(r){r.errorCount> 0?n("Failed to load images."):(e._bindTexture(),t())}))):n("ImageLoader is not initialized"):n("Image is not defined")})},n.attachTo=function(e){this._hasExternalCanvas||(this.detach(),e.appendChild(this.canvas)), this._wrapper=e},n.forceContextLoss=function(){if(this.hasRenderingContext()){var e=this.context.getExtension("WEBGL_lose_context"); e&&e.loseContext()}},n.detach=function(){!this._hasExternalCanvas&&this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas)},n.destroy=function(){this._contentLoader&&this._contentLoader.destroy(), this._animator.stop(),this.detach(),this.forceContextLoss(),this.off(),this.canvas.removeEventListener("webglcontextlost",this._onWebglcontextlost),this.canvas.removeEventListener("webglcontextrestored", this._onWebglcontextrestored)},n.hasRenderingContext=function(){var e=this.context; return!(!e||e.isContextLost()||!e.getProgramParameter(this.shaderProgram,e.LINK_STATUS))},n.updateFieldOfView=function(e){this.fieldOfView=e,this._updateViewport()},n.updateViewportDimensions=function(e, t){var n=!1; this.width=e,this.height=t;var r=e*vi,i=t*vi;r!==this.canvas.width&&(this.canvas.width=r,n=!0),i!==this.canvas.height&&(this.canvas.height=i,n=!0),n&&(this._updateViewport(),this._shouldForceDraw=!0)}, n.keepUpdate=function(e){e&&!1===this.isImageLoaded()&&(this._shouldForceDraw=!0),this._keepUpdate=e},n.startRender=function(){this._animator.setCallback(this._render.bind(this)),this._animator.start()}, n.stopRender=function(){this._animator.stop()},n.renderWithQuaternion=function(e,t){this.isImageLoaded()&&(!1===this._keepUpdate&&this._lastQuaternion&&function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]=== t[2]&&e[3]===t[3]}(this._lastQuaternion,e)&&this.fieldOfView&&this.fieldOfView===t&&!1===this._shouldForceDraw||(void 0!==t&&t!==this.fieldOfView&&this.updateFieldOfView(t),this.mvMatrix=function(e,t){var n= t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,d=r*s,h=i*a,f=i*s,p=i*u,v=o*a,g=o*s,y=o*u; return e[0]=1-d-p,e[1]=c+y,e[2]=h-g,e[3]=0,e[4]=c-y,e[5]=1-l-p,e[6]=f+v,e[7]=0,e[8]=h+g,e[9]=f-v,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}(Bt(),e),this._draw(),this._lastQuaternion=kt(e),this._shouldForceDraw&& (this._shouldForceDraw=!1)))},n.renderWithYawPitch=function(e,t,n){this.isImageLoaded()&&(!1===this._keepUpdate&&null!==this._lastYaw&&this._lastYaw===e&&null!==this._lastPitch&&this._lastPitch===t&&this.fieldOfView&& this.fieldOfView===n&&!1===this._shouldForceDraw||(void 0!==n&&n!==this.fieldOfView&&this.updateFieldOfView(n),function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1, e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this.mvMatrix),Vt(this.mvMatrix,this.mvMatrix,-_t(t)),Ht(this.mvMatrix,this.mvMatrix,-_t(e)),this._draw(),this._lastYaw=e,this._lastPitch=t,this._shouldForceDraw&& (this._shouldForceDraw=!1)))},n.getProjectionRenderer=function(){return this._renderer},n.enterVR=function(e){var t=this._vr; return Mn||navigator.getVRDisplays?t&&t.isPresenting()?H.resolve("VR already enabled."):this._requestPresent(e):H.reject("VR is not available on this browser.")},n._setImageType=function(e){var t=this; if(e&&this._imageType!==e){switch(this._imageType=e,this._isCubeMap=e===pi.CUBEMAP,this._renderer&&this._renderer.off(),e){case pi.CUBEMAP:this._renderer=new Ur;break;case pi.CUBESTRIP:this._renderer=new Fr; break;case pi.PANORAMA:this._renderer=new ai;break;case pi.STEREOSCOPIC_EQUI:this._renderer=new ti(this.sphericalConfig.stereoFormat);break;default:this._renderer=new ti(Ir.NONE)}this._renderer.on(Mr.EVENTS.ERROR, function(e){t.trigger(new C(yi.ERROR,{type:mi.RENDERER_ERROR,message:e.message}))}),this._initWebGL()}},n._initCanvas=function(e,t,n,r){var i=e.querySelector("."+t),o=i||this._createCanvas(t); return this._hasExternalCanvas=!!i,o.width=n,o.height=r,this._onWebglcontextlost=this._onWebglcontextlost.bind(this),this._onWebglcontextrestored=this._onWebglcontextrestored.bind(this),o.addEventListener("webglcontextlost", this._onWebglcontextlost),o.addEventListener("webglcontextrestored",this._onWebglcontextrestored),o},n._createCanvas=function(e){var t=document.createElement("canvas"); return t.className=e,t},n._setDefaultCanvasStyle=function(){var e=this.canvas; e.style.bottom="0",e.style.left="0",e.style.right="0",e.style.top="0",e.style.margin="auto",e.style.maxHeight="100%",e.style.maxWidth="100%",e.style.outline="none",e.style.position="absolute"},n._onContentError= function(){return this._imageIsReady=!1,this._image=null,this.trigger(new C(yi.ERROR,{type:mi.FAIL_IMAGE_LOAD, message:"failed to load image"})),!1},n._triggerContentLoad=function(){this.trigger(new C(yi.IMAGE_LOADED,{content:this._image, isVideo:this._isVideo,projectionType:this._imageType}))},n._onContentLoad=function(e){e.errorCount>0||(this._imageIsReady=!0,this._triggerContentLoad())},n._initShaderProgram=function(){var e=this.context; this.shaderProgram&&(e.deleteProgram(this.shaderProgram),this.shaderProgram=null);var t=this._renderer,n=t.getVertexShaderSource(),r=t.getFragmentShaderSource(),i=kr.createShader(e,e.VERTEX_SHADER,n),o= kr.createShader(e,e.FRAGMENT_SHADER,r),a=kr.createProgram(e,i,o);if(!a)throw new Error("Failed to initialize shaders: "+kr.getErrorNameFromWebGLErrorCode(e.getError()));e.useProgram(a),a.vertexPositionAttribute= e.getAttribLocation(a,"aVertexPosition"),a.pMatrixUniform=e.getUniformLocation(a,"uPMatrix"),a.mvMatrixUniform=e.getUniformLocation(a,"uMVMatrix"),a.samplerUniform=e.getUniformLocation(a,"uSampler"),a.textureCoordAttribute= e.getAttribLocation(a,"aTextureCoord"),a.uEye=e.getUniformLocation(a,"uEye"),e.enableVertexAttribArray(a.vertexPositionAttribute),e.enableVertexAttribArray(a.textureCoordAttribute),e.clear(e.COLOR_BUFFER_BIT| e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT),e.uniform1i(a.samplerUniform,0),this.shaderProgram=a},n._onWebglcontextlost=function(e){e.preventDefault(),this.trigger(new C(yi.RENDERING_CONTEXT_LOST))},n._onWebglcontextrestored= function(){this._initWebGL(),this.trigger(new C(yi.RENDERING_CONTEXT_RESTORE))},n._updateViewport=function(){jt(this.pMatrix,_t(this.fieldOfView),this.canvas.width/this.canvas.height,.1,100),this.context.viewport(0, 0,this.context.drawingBufferWidth,this.context.drawingBufferHeight)},n._initWebGL=function(){var e; try{this._initRenderingContext(),e=this.context,this.updateViewportDimensions(this.width,this.height),this._initShaderProgram()}catch(e){return this.trigger(new C(yi.ERROR,{type:mi.NO_WEBGL,message:"no webgl support"})), this.destroy(),void console.error(e)}e.clearColor(0,0,0,0);var t=this._isCubeMap?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D;this.texture&&e.deleteTexture(this.texture),this.texture=kr.createTexture(e,t),this._imageType=== pi.CUBESTRIP&&e.enable(e.CULL_FACE)},n._initRenderingContext=function(){if(!this.hasRenderingContext()){if(!window.WebGLRenderingContext)throw new Error("WebGLRenderingContext not available."); if(this.context=kr.getWebglContext(this.canvas,this._renderingContextAttributes),!this.context)throw new Error("Failed to acquire 3D rendering context");}},n._initBuffers=function(){var e=this._image,t= this._renderer.getVertexPositionData(),n=this._renderer.getIndexData(),r=this._renderer.getTextureCoordData({image:e, imageConfig:this._imageConfig}),i=this.context;this.vertexBuffer=kr.initBuffer(i,i.ARRAY_BUFFER,new Float32Array(t),3,this.shaderProgram.vertexPositionAttribute),this.indexBuffer=kr.initBuffer(i,i.ELEMENT_ARRAY_BUFFER, new Uint16Array(n),1),this.textureCoordBuffer=kr.initBuffer(i,i.ARRAY_BUFFER,new Float32Array(r),this._isCubeMap?3:2,this.shaderProgram.textureCoordAttribute),this._bindBuffers()},n._bindTexture=function(){if(this._imageType=== pi.CUBESTRIP){var e=this._renderer.getDimension(this._image),t=e.width,n=e.height,r=t&&n&&t/n!=1.5?1:0; this.context.uniform1f(this.context.getUniformLocation(this.shaderProgram,"uIsEAC"),r)}else if(this._imageType===pi.PANORAMA){var i=this._renderer.getDimension(this._image),o=(t=i.width,n=i.height,t&&n&& t/n);this._renderer.updateShaderData({imageAspectRatio:o})}this._initBuffers(),this._renderer.bindTexture(this.context,this.texture,this._image,this._imageConfig),this._shouldForceDraw=!0,this.trigger(new C(yi.BIND_TEXTURE))}, n._updateTexture=function(){this._renderer.updateTexture(this.context,this._image,this._imageConfig)},n._render=function(){var e=this._yawPitchControl,t=e.getFov(); if(e.shouldRenderWithQuaternion()){var n=e.getQuaternion();this.renderWithQuaternion(n,t)}else{var r=e.getYawPitch();this.renderWithYawPitch(r.yaw,r.pitch,t)}},n._bindBuffers=function(){var e=this.context, t=this.shaderProgram,n=this.vertexBuffer,r=this.textureCoordBuffer; e.bindBuffer(e.ARRAY_BUFFER,n),e.enableVertexAttribArray(t.vertexPositionAttribute),e.vertexAttribPointer(t.vertexPositionAttribute,n.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer), e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(t.textureCoordAttribute),e.vertexAttribPointer(t.textureCoordAttribute,r.itemSize,e.FLOAT,!1,0,0)},n._draw=function(){this._isVideo&&this._keepUpdate&& this._updateTexture(),this._renderer.render({gl:this.context, shaderProgram:this.shaderProgram,indexBuffer:this.indexBuffer,mvMatrix:this.mvMatrix,pMatrix:this.pMatrix})},n._requestPresent=function(e){var t=this,n=this.context,r=this.canvas,i=this._animator; this._vr=Mn?new hi(e):new ci;var o=this._vr;return i.stop(),new H(function(e,a){o.requestPresent(r,n).then(function(){o.addEndCallback(t.exitVR),i.setContext(o.context),i.setCallback(t._onFirstVRFrame), Cn&&t._setWrapperFullscreen(),t._shouldForceDraw=!0,i.start(),e("success")})["catch"](function(e){o.destroy(),t._vr=null,i.start(),a(e)})})},n._setWrapperFullscreen=function(){var e=this._wrapper; if(e){this._wrapperOrigStyle=e.getAttribute("style");var t=e.style;t.width="100vw",t.height="100vh",t.position="fixed",t.left="0",t.top="0",t.zIndex="9999"}},n._restoreStyle=function(){var e=this._wrapper, t=this.canvas; e&&(this._wrapperOrigStyle?e.setAttribute("style",this._wrapperOrigStyle):e.removeAttribute("style"),this._wrapperOrigStyle=null,t.removeAttribute("style"),this._setDefaultCanvasStyle())},t.EVENTS=yi,t.ERROR_TYPE= mi,t}(O),Ei=function(e){function t(n,r){void 0===r&&(r={}); var i=e.call(this)||this;if(!kr.isWebGLAvailable())return setTimeout(function(){i.trigger(new C(Rr.ERROR,{type:Ar.NO_WEBGL,message:"no webgl support"}))},0),i; if(!kr.isStableWebGL())return setTimeout(function(){i.trigger(new C(Rr.ERROR,{type:Ar.INVALID_DEVICE,message:"blacklisted browser"}))},0),i; if(r.image&&r.video)return setTimeout(function(){i.trigger(new C(Rr.ERROR,{type:Ar.INVALID_RESOURCE,message:"Specifying multi resouces(both image and video) is not valid."}))},0),i; !function(){var e=window.navigator;e.xr&&(e.xr.isSessionSupported?e.xr.isSessionSupported("immersive-vr").then(function(e){Mn=e})["catch"](function(){}):e.xr.supportsSession&&e.xr.supportsSession("immersive-vr").then(function(e){Mn= e})["catch"](function(){}))}(),i._container=n,i._image=r.image||r.video,i._isVideo=!!r.video,i._projectionType=r.projectionType||Lr.EQUIRECTANGULAR,i._cubemapConfig=_n8({order:i._projectionType===Lr.CUBEMAP? "RLUDBF":"RLUDFB", tileConfig:{flipHorizontal:!1,rotation:0},trim:0},r.cubemapConfig),i._stereoFormat=r.stereoFormat||Ir.TOP_BOTTOM,i._width=r.width||parseInt(window.getComputedStyle(n).width,10),i._height=r.height||parseInt(window.getComputedStyle(n).height, 10),i._yaw=r.yaw||0,i._pitch=r.pitch||0,i._fov=r.fov||65,i._gyroMode=r.gyroMode||$n.YAWPITCH,i._quaternion=null,i._aspectRatio=0!==i._height?i._width/i._height:1,i._canvasClass=r.canvasClass||"view360-canvas"; var o=r.fovRange||[30,110],a=t._isValidTouchDirection(r.touchDirection)?r.touchDirection:wr.TOUCH_DIRECTION_ALL,s=_n8(_n8({},r),{element:n,yaw:i._yaw,pitch:i._pitch,fov:i._fov,gyroMode:i._gyroMode,fovRange:o, aspectRatio:i._aspectRatio,touchDirection:a});return i._isReady=!1,i._initYawPitchControl(s),i._initRenderer(i._yaw,i._pitch,i._fov,i._projectionType,i._cubemapConfig),i} mn(t,e);var n=t.prototype;return t.isSupported=function(){return kr.isWebGLAvailable()&&kr.isStableWebGL()},t.isWebGLAvailable=function(){return kr.isWebGLAvailable()},t.isGyroSensorAvailable=function(e){var n; xn||!e?H.race([new H(function(e){n=function n(t){var n=!(null==t.rotationRate.alpha);e(n)},window.addEventListener("devicemotion",n)}), new H(function(e){setTimeout(function(){return e(!1)},1E3)})]).then(function(r){window.removeEventListener("devicemotion",n),e&&e(r),t.isGyroSensorAvailable=function(e){return e&&e(r),r}}):e(!1)},t._isValidTouchDirection= function(e){return e===t.TOUCH_DIRECTION.NONE||e===t.TOUCH_DIRECTION.YAW||e===t.TOUCH_DIRECTION.PITCH||e===t.TOUCH_DIRECTION.ALL},n.getVideo=function(){return this._isVideo?this._photoSphereRenderer.getContent(): null},n.setVideo=function(e,t){return void 0===t&&(t={}),e&&this.setImage(e,{projectionType:t.projectionType, isVideo:!0,cubemapConfig:t.cubemapConfig,stereoFormat:t.stereoFormat}),this},n.getImage=function(){return this._isVideo?null:this._photoSphereRenderer.getContent()},n.setImage=function(e,t){void 0===t&& (t={}); var n=_n8({order:"RLUDBF",tileConfig:{flipHorizontal:!1,rotation:0},trim:0},t.cubemapConfig),r=t.stereoFormat||Ir.TOP_BOTTOM,i=!!t.isVideo;return this._image&&this._isVideo!==i?(console.warn("PanoViewer is not currently supporting content type changes. (Image \x3c--\x3e Video)"), this):(e&&(this._deactivate(),this._image=e,this._isVideo=i,this._projectionType=t.projectionType||Lr.EQUIRECTANGULAR,this._cubemapConfig=n,this._stereoFormat=r,this._initRenderer(this._yaw,this._pitch, this._fov,this._projectionType,this._cubemapConfig)),this)},n.keepUpdate=function(e){return this._photoSphereRenderer.keepUpdate(e),this},n.getProjectionType=function(){return this._projectionType},n.enableSensor= function(){return new H(function(e,t){xn&&"function"==typeof xn.requestPermission?xn.requestPermission().then(function(n){"granted"===n?e():t(new Error("permission denied"))})["catch"](function(e){t(e)}): e()})},n.disableSensor=function(){return this},n.enterVR=function(e){var t=this; return void 0===e&&(e={}),this._isReady?new H(function(n,r){t.enableSensor().then(function(){return t._photoSphereRenderer.enterVR(e)}).then(function(e){return n(e)})["catch"](function(e){return r(e)})}): H.reject(new Error("PanoViewer is not ready to show image."))},n.exitVR=function(){return this._photoSphereRenderer.exitVR(),this},n.setUseZoom=function(e){return"boolean"==typeof e&&this._yawPitchControl.option("useZoom", e),this},n.setUseKeyboard=function(e){return this._yawPitchControl.option("useKeyboard",e),this},n.setGyroMode=function(e){return this._yawPitchControl.option("gyroMode",e),this},n.setFovRange=function(e){return this._yawPitchControl.option("fovRange", e),this},n.getFovRange=function(){return this._yawPitchControl.option("fovRange")},n.updateViewportDimensions=function(e){if(void 0===e&&(e={}),!this._isReady)return this; var t;void 0!==e.width&&void 0!==e.height||(t=window.getComputedStyle(this._container));var n=e.width||parseInt(t.width,10),r=e.height||parseInt(t.height,10);return n===this._width&&r===this._height||(this._width= n,this._height=r,this._aspectRatio=n/r,this._photoSphereRenderer.updateViewportDimensions(n,r),this._yawPitchControl.option("aspectRatio",this._aspectRatio),this._yawPitchControl.updatePanScale({height:r}), this.lookAt({},0)),this},n.getFov=function(){return this._fov},n.getYaw=function(){return this._yaw},n.getPitch=function(){return this._pitch},n.getYawRange=function(){return this._yawPitchControl.option("yawRange")}, n.getPitchRange=function(){return this._yawPitchControl.option("pitchRange")},n.setYawRange=function(e){return this._yawPitchControl.option("yawRange",e),this},n.setPitchRange=function(e){return this._yawPitchControl.option("pitchRange", e),this},n.setShowPolePoint=function(e){return this._yawPitchControl.option("showPolePoint",e),this},n.lookAt=function(e,t){if(void 0===t&&(t=0),!this._isReady)return this; var n=void 0!==e.yaw?e.yaw:this._yaw,r=void 0!==e.pitch?e.pitch:this._pitch,i=this._yawPitchControl.option("pitchRange"),o=i[1]-i[0],a=void 0!==e.fov?e.fov:this._fov;return oe?t.activeTargets.push(n):t.skippedTargets.push(n))})})},ji=[],Gi=0,Ki={attributes:!0, characterData:!0,childList:!0,subtree:!0},zi=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur", "focus"],Wi=function Wi(e){return void 0===e&&(e=0),Date.now()+e},qi=!1,Zi=new (function(){function e(){var e=this; this.stopped=!0,this.listener=function(){return e.schedule()}} return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!qi){qi=!0;var n,r=Wi(e);n=function n(){var n=!1;try{n=function(){var e,t=0;for(Hi(t);Ti.some(function(e){return e.activeTargets.length> 0});)t=Vi(),Hi(t); return Ti.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:bi}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message= bi),window.dispatchEvent(e)),t>0}()}finally{if(qi=!1,e=r-Wi(),!Gi)return; n?t.run(1E3):e>0?t.run(e):t.start()}},function(e){if(!Si){var t=0,n=document.createTextNode(""); (new MutationObserver(function(){return ji.splice(0).forEach(function(e){return e()})})).observe(n,{characterData:!0}),Si=function Si(){n.textContent=""+(t?t--:t++)}}ji.push(e),Si()}(function(){requestAnimationFrame(n)})}}, e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function t(){return e.observer&&e.observer.observe(document.body,Ki)}; document.body?t():Ii.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this; this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),zi.forEach(function(t){return Ii.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e= this; this.stopped||(this.observer&&this.observer.disconnect(),zi.forEach(function(t){return Ii.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),Yi=function Yi(e){!Gi&&e>0&&Zi.start(),!(Gi+=e)&& Zi.stop()},Xi=function(){function e(e,t){this.target=e,this.observedBox=t||gi.CONTENT_BOX,this.lastReportedSize={inlineSize:0, blockSize:0}} return e.prototype.isActive=function(){var e,t=Ui(this.target,this.observedBox,!0);return e=this.target,Ai(e)||function(e){switch(e.tagName){case "INPUT":if("image"!==e.type)break;case "VIDEO":case "AUDIO":case "EMBED":case "OBJECT":case "CANVAS":case "IFRAME":case "IMG":return!0}return!1}(e)|| "inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Qi=function Qi(e,t){this.activeTargets= [],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Ji=new WeakMap,$i=function $i(e,t){for(var n=0;n=0&&(i&&Ti.splice(Ti.indexOf(n),1),n.observationTargets.splice(r,1),Yi(-1))},e.disconnect=function(e){var t=this,n=Ji.get(e); n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),to=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");eo.connect(this,e)} return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Li(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); eo.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); if(!Li(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");eo.unobserve(this,e)},e.prototype.disconnect=function(){eo.disconnect(this)},e.toString= function(){return"function ResizeObserver () { [polyfill code] }"},e}(),no=n(61146),ro=n(8929),io=n(54404),oo={ALL:30, NONE:1,PITCH:24,YAW:6},_ao=function ao(){return _ao=i()||function(e){for(var t,n=1,r=arguments.length;n=0&&u()(r=s._listenerMap[e]).call(r,o,1),null===(i=s._panoViewer)||void 0===i|| i.off(e,t),s._control}, updateViewportDimensions:function updateViewportDimensions(e){var t,n=e.width,r=e.height;return null===(t=this._panoViewer)||void 0===t||t.updateViewportDimensions({width:n,height:r}),this._control}, get gyroMode(){return this._mergedConfig.gyroMode},set gyroMode(e){this._panoViewer.setGyroMode(e)}},this.adjustOverlaySize=c()(e=this.adjustOverlaySize).call(e,this),this._initiatePanoViewer=c()(t=this._initiatePanoViewer).call(t, this),this._onPaused=c()(n=this._onPaused).call(n,this),this._onPlaying=c()(r=this._onPlaying).call(r,this),this._onSeeking=c()(i=this._onSeeking).call(i,this),this._onSeeked=c()(o=this._onSeeked).call(o, this)} return e.createConfig=function(e){var t;return _ao(_ao(_ao(((t={})[no.B]="vr",t),so),e),{enable:!!e})},e.prototype.initialize=function(e){var t=e.getRenderContainer(),n=e.getNativeVideoElement(); if(!t||"DIV"!==t.tagName)throw new Error("Given container is not valid HTMLDivElement");this._renderContainer=t,this._videoElement=n,this._videoElement.addEventListener("pause",this._onPaused),this._videoElement.addEventListener("playing", this._onPlaying),this._videoElement.addEventListener("seeking",this._onSeeking),this._videoElement.addEventListener("seeked",this._onSeeked)},e.prototype.adjustOverlaySize=function(){var e=this; if(!this._videoElement||!this._renderContainer)return!1;var t=this._videoElement.getBoundingClientRect(),n=t.width,r=t.height;return this._renderContainer.style.width="".concat(n,"px"),this._renderContainer.style.height= "".concat(r,"px"),h().resolve().then(function(){var t;null===(t=e._panoViewer)||void 0===t||t.updateViewportDimensions({width:n,height:r})}),!0},e.prototype._showRenderContainer=function(){this._renderContainer.style.setProperty("display", "block")},e.prototype._hideRenderContainer=function(){this._renderContainer.style.setProperty("display",null)},e.prototype.addResizeEventListener=function(){var e=this; return this._renderOverlayResolved||(window.addEventListener("resize",this.adjustOverlaySize),this._videoElement.addEventListener("resize",this.adjustOverlaySize),this._resizeObserver=new to(function(){e.adjustOverlaySize()}), this._resizeObserver.observe(this._videoElement)),!0},e.prototype._removeResizeEventListener=function(){var e; window.removeEventListener("resize",this.adjustOverlaySize),this._videoElement.removeEventListener("resize",this.adjustOverlaySize),null===(e=this._resizeObserver)||void 0===e||e.unobserve(this._videoElement)}, e.prototype._hideVideo=function(){return this._videoElement.style.setProperty("visibility","hidden"),"hidden"===window.getComputedStyle(this._videoElement).visibility},e.prototype._displayVideo=function(){return this._videoElement.style.removeProperty("visibility"), "hidden"!==window.getComputedStyle(this._videoElement).visibility},e.prototype.resolveRenderOverlay=function(){if(this._renderOverlayResolved)return!0; this._showRenderContainer();var e=!0;return e=(e=e&&this.adjustOverlaySize())&&this.addResizeEventListener(),this._renderOverlayResolved=!0,e},e.prototype._cleanUpRenderOverlay=function(){this._removeResizeEventListener(), this._hideRenderContainer(),this._renderOverlayResolved=!1},e.prototype.resolvePrecondition=function(){var e=this; return h().resolve().then(function(){var t=!0;return t=e.resolveCORS()&&t,e.resolveRenderOverlay()&&t})},e.prototype.isCORSResolved=function(){var e; return"anonymous"===(null===(e=this._videoElement)||void 0===e?void 0:e.crossOrigin)},e.prototype.isRenderContainerResizingResolve=function(){return this._renderOverlayResolved},e.prototype.isPreconditionSatisfied= function(){return!!this._renderContainer&&Ei.isSupported()&&this.isCORSResolved()&&this.isRenderContainerResizingResolve()},e.prototype.configure=function(e){var t; this._mergedConfig=_ao(_ao({},so),e),Ei.isSupported()?this.enable(null!==(t=this._mergedConfig.enable)&&void 0!==t&&t):(this._mergedConfig.enable=!1,this.enable(!1))},e.prototype._initiatePanoViewer=function(){var e= this; this._videoElement.removeEventListener("play",this._initiatePanoViewer),this._panoViewer||(this._panoViewer=new Ei(this._renderContainer,_ao({video:this._videoElement},this._mergedConfig)),this._panoViewer.on("ready", function(){var t,n;null===(n=null===(t=e._panoViewer._yawPitchControl)||void 0===t?void 0:t.axesMoveKeyInput)||void 0===n||n.disable()})),this._registerPreservedEventHandler(),this._hideVideo()},e.prototype._registerPreservedEventHandler= function(){var e,t=this; p()(e=g()(this._listenerMap)).call(e,function(e){var n=e[0],r=e[1];p()(r).call(r,function(e){var r;null===(r=t._panoViewer)||void 0===r||r.on(n,e)})})},m()(e.prototype,"enabled",{get:function get(){var e; return null!==(e=this._mergedConfig.enable)&&void 0!==e&&e}, set:function set(e){this._mergedConfig.enable=e}, enumerable:!1,configurable:!0}),e.prototype.enable=function(e){e?(this.resolvePrecondition(),this._addInitializePanoViewerCallback()):(this.cleanUp(),this._removeInitializePanoViewerCallback())},e.prototype._removeInitializePanoViewerCallback= function(){var e; null===(e=this._videoElement)||void 0===e||e.removeEventListener("play",this._initiatePanoViewer)},e.prototype._addInitializePanoViewerCallback=function(){var e; null===(e=this._videoElement)||void 0===e||e.addEventListener("play",this._initiatePanoViewer)},m()(e.prototype,"control",{get:function get(){return this._control}, enumerable:!1,configurable:!0}),e.prototype.isGyroSensorAvailable=function(){return new (h())(function(e){Ei.isGyroSensorAvailable(function(t){e(t)})})},e.prototype.cleanUp=function(){var e; null===(e=this._panoViewer)||void 0===e||e.destroy(),this._panoViewer=null,this._displayVideo(),this._cleanUpCORS(),this._cleanUpRenderOverlay()},e.prototype.resolveCORS=function(){return!!this._videoElement&& ("anonymous"!==this._videoElement.crossOrigin&&"use-credentials"!==this._videoElement.crossOrigin?(this._crossoriginAlreadyConfigured=!1,this._videoElement.setAttribute("data-coreplayer-crossorigin",E()(this._videoElement.crossOrigin)), this._videoElement.crossOrigin="anonymous"):this._crossoriginAlreadyConfigured=!0,!!this._videoElement.crossOrigin)},e.prototype._cleanUpCORS=function(){this._crossoriginAlreadyConfigured?this._crossoriginAlreadyConfigured= !1:null!==this._videoElement.getAttribute("data-coreplayer-crossorigin")&&(this._videoElement.crossOrigin=JSON.parse(this._videoElement.getAttribute("data-coreplayer-crossorigin")),this._videoElement.removeAttribute("data-coreplayer-crossorigin"))}, e.prototype._onPaused=function(){var e; null===(e=this._panoViewer)||void 0===e||e.keepUpdate(!1)},e.prototype._onPlaying=function(){var e; null===(e=this._panoViewer)||void 0===e||e.keepUpdate(!0)},e.prototype._onSeeking=function(){this._panoViewer&&this._videoElement.paused&&this._panoViewer.keepUpdate(!0)},e.prototype._onSeeked=function(){var e= this; this._panoViewer&&b()(function(){var t;e._videoElement.paused&&(null===(t=e._panoViewer)||void 0===t||t.keepUpdate(!1))},100)},e[no.B]="vr",e.TOUCH_DIRECTION=oo,e}(),co=lo; function ho(e){e.registerProcessor(co)} var fo,po,vo,go,yo,mo,_o,Eo,To,bo=n(85507),So=n.n(bo),wo=n(54943),Ao=n.n(wo),Ro=n(65420),Lo=n.n(Ro),Io=n(98341),Co=n.n(Io),Oo=n(94473),Po=n.n(Oo),ko=n(51859),Do=n(3579),xo=n(34074),No=n.n(xo),Mo=n(16686), Uo=n(84740),Fo=n(34665),Bo=n(10662),Vo=n(43001),Ho=function(){var _e24=function e(t,n){return _e24=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e24(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e24(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),jo=function(e){function t(t,n,r){var i=e.call(this,"sessioncreate",r)||this; return i.session=t,i.controller=n,i} return Ho(t,e),t}(Vo.x),Go=n(62957),Ko=function(){var _e25=function e(t,n){return _e25=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e25(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e25(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),zo=function zo(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},Wo=function Wo(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&m()(t,n,a),a}([(0,Do.Pv)("HttpRequestProxyMediaKeyController")],t)}(Mo.p),aa=function aa(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},sa=function sa(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1},e.prototype.contains=function(e){return(0,Do.a0)(e,(0,Do.od)(oa))},e.prototype.requestMediaKeySystemAccess= function(e,t){for(var n=null,r=0,i=t;r=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()): this.defaultEstimate_},t.getEstimateTTFB=function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_},t.destroy=function(){},Ra(e,[{key:"defaultEstimate", get:function get(){return this.defaultEstimate_}}])}(),zs=function zs(e,t){var n,r,i,o,a; this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;var s="["+e+"]:";this.trace=Ws,this.debug=l(n=t.debug).call(n,null,s),this.log=l(r=t.log).call(r, null,s),this.warn=l(i=t.warn).call(i,null,s),this.info=l(o=t.info).call(o,null,s),this.error=l(a=t.error).call(a,null,s)},Ws=function Ws(){},qs={trace:Ws, debug:Ws,log:Ws,warn:Ws,info:Ws,error:Ws};function Zs(){return Ya({},qs)} function Ys(e,t,n){var r;return t[e]?l(r=t[e]).call(r,t):function(e,t){var n=self.console[e];return n?l(n).call(n,self.console,(t?"["+t+"] ":"")+"["+e+"] \x3e"):Ws}(e,n)} var Xs=Zs(),Qs=Xs;function Js(e){if(void 0===e&&(e=!0),"undefined"!=typeof self)return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource} function $s(e,t){var n=Fa(e),r=Fa(t),i=n.length,a=r.length;return!i||!a||i===a&&!qa(n).call(n,function(e){return-1===o(r).call(r,e)})} function eu(e,t){if(void 0===t&&(t=!1),"undefined"!=typeof TextDecoder){var n=(new TextDecoder("utf-8")).decode(e);if(t){var r=o(n).call(n,"\x00");return-1!==r?n.substring(0,r):n}return n.replace(/\0/g, "")}for(var i,a,s,u=e.length,l="",c=0;c>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:a= e[c++],l+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[c++],s=e[c++],l+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}}return l} function tu(e){for(var t="",n=0;n1||1===r&&null!=(t=this.levelkeys[n[0]])&&t.encrypted)return!0}return!1}}, {key:"programDateTime",get:function get(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}, set:function set(e){Os(e)?this._programDateTime=e:this._programDateTime=this.rawProgramDateTime=null}}, {key:"ref",get:function get(){return lu(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}}])}(uu),du= function(e){function t(t,n,r,i,o){var a; (a=e.call(this,r)||this).fragOffset=0,a.duration=0,a.independent=!1,a.relurl=void 0,a.fragment=void 0,a.index=void 0,a.gap=!1,a.duration=t.decimalFloatingPoint("DURATION"),a.gap=t.bool("GAP"),a.independent= t.bool("INDEPENDENT"),a.relurl=t.enumeratedString("URI"),a.fragment=n,a.index=i;var s=t.enumeratedString("BYTERANGE");return s&&a.setByteRange(s,o),o&&(a.fragOffset=o.fragOffset+o.duration),a} return Ka(t,e),Ra(t,[{key:"start",get:function get(){return this.fragment.start+this.fragOffset}}, {key:"end",get:function get(){return this.start+this.duration}}, {key:"loaded",get:function get(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo||this.fragment.type===js&&this.stats.loaded)}}])}(uu); function hu(e,t){var n=is(e);if(n)return xo(n,t)||hu(n,t)} function fu(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function pu(e){for(var t=1;t1?i+o:r;if(mu(e.subarray(i+4,i+8))===t[0])if(1===t.length)n.push(e.subarray(i+8,a));else{var s=Su(e.subarray(i+ 8,a),Ea(t).call(t,1));s.length&&gu.apply(n,s)}i=a}return n} function wu(e){var t=[],n=e[0],r=8,i=Eu(e,r);r+=4;var o=0,a=0;0===n?(o=Eu(e,r),a=Eu(e,r+4),r+=8):(o=Tu(e,r),a=Tu(e,r+8),r+=16),r+=2;var s=e.length+a,u=_u(e,r);r+=2;for(var l=0;l>>31)return Qs.warn("SIDX has hierarchical references (not supported)"),null;var f=Eu(e,c);c+=4,t.push({referenceSize:h,subsegmentDuration:f,info:{duration:f/ i,start:s,end:s+h-1}}),s+=h,r=c+=4}return{earliestPresentationTime:o,timescale:i,version:n,referencesCount:u,references:t}} function Au(e){for(var t=[],n=Su(e,["moov","trak"]),r=0;r3&&(o+="."+Cu(c[1])+Cu(c[2])+Cu(c[3]),t=Lu("avc1"===l?"dva1":"dvav",r));break;case "mp4a":var d=Su(n,[i])[0], h=Su(d.subarray(28),["esds"])[0];if(h&&h.length>7){var p=4;if(3!==h[p++])break;p=Iu(h,p),p+=2;var v=h[p++];if(128&v&&(p+=2),64&v&&(p+=h[p++]),4!==h[p++])break;p=Iu(h,p);var g=h[p++];if(64!==g)break;if(o+= "."+Cu(g),p+=12,5!==h[p++])break;p=Iu(h,p);var y=h[p++],m=(248&y)>>3;31===m&&(m+=1+((7&y)<<3)+((224&h[p])>>5)),o+="."+m}break;case "hvc1":case "hev1":var _=Su(r,["hvcC"])[0];if(_&&_.length>12){var E=_[1], T=["","A","B","C"][E>>6],b=31&E,S=Eu(_,2),w=(32&E)>>5?"H":"L",A=_[12],R=_.subarray(6,12);o+="."+T+b,o+="."+function(e){for(var t=0,n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}(S).toString(16).toUpperCase(), o+="."+w+A; for(var L="",I=R.length;I--;){var C=R[I];(C||L)&&(L="."+C.toString(16).toUpperCase()+L)}o+=L}t=Lu("hev1"==l?"dvhe":"dvh1",r);break;case "dvh1":case "dvhe":case "dvav":case "dva1":case "dav1":o=Lu(o,r)|| o;break;case "vp09":var O=Su(r,["vpcC"])[0];if(O&&O.length>6){var P=O[4],k=O[5],D=O[6]>>4&15;o+="."+Ou(P)+"."+Ou(k)+"."+Ou(D)}break;case "av01":var x=Su(r,["av1C"])[0];if(x&&x.length>2){var N=x[1]>>>5, M=31&x[1],U=x[2]>>>7?"H":"M",F=(64&x[2])>>6,B=(32&x[2])>>5,V=2===N&&F?B?12:10:F?10:8,H=(16&x[2])>>4,j=(8&x[2])>>3,G=(4&x[2])>>2,K=3&x[2];o+="."+N+"."+Ou(M)+U+"."+Ou(V)+"."+H+"."+j+G+K+"."+Ou(1)+"."+Ou(1)+ "."+Ou(1)+".0",t=Lu("dav1",r)}}return{codec:o,encrypted:a,supplemental:t}} function Lu(e,t){var n=Su(t,["dvvC"]),r=n.length?n[0]:Su(t,["dvcC"])[0];if(r){var i=r[2]>>1&127,o=r[2]<<5&32|r[3]>>3&31;return e+"."+Ou(i)+"."+Ou(o)}} function Iu(e,t){for(var n=t+5;128&e[t++]&&t0;o||(i=Su(r,["encv"])),f(i).call(i, function(e){var n=Su(o?e.subarray(28):e.subarray(78),["sinf"]);f(n).call(n,function(e){var n=ku(e);n&&t(n,o)})})}})} function ku(e){var t=Su(e,["schm"])[0];if(t){var n=mu(t.subarray(4,8));if("cbcs"===n||"cenc"===n){var r=Su(e,["schi","tenc"])[0];if(r)return r}}} function Du(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n} function xu(e,t){var n=[],r=t.samples,i=t.timescale,o=t.id,a=!1,s=Su(r,["moof"]);return Ma(s).call(s,function(s){var u=s.byteOffset-8,l=Su(s,["traf"]);Ma(l).call(l,function(s){var l,c,d=Ma(l=Su(s,["tfdt"])).call(l, function(e){var t=e[0],n=Eu(e,4);return 1===t&&(n*=Math.pow(2,32),n+=Eu(e,8)),n/i})[0]; return void 0!==d&&(e=d),Ma(c=Su(s,["tfhd"])).call(c,function(l){var c,d=Eu(l,4),h=16777215&Eu(l,0),f=0,p=!!(16&h),v=0,g=!!(32&h),y=8;d===o&&(!!(1&h)&&(y+=8),!!(2&h)&&(y+=4),!!(8&h)&&(f=Eu(l,y),y+=4),p&& (v=Eu(l,y),y+=4),g&&(y+=4),"video"===t.type&&(a=Nu(t.codec)),Ma(c=Su(s,["trun"])).call(c,function(o){var s=o[0],l=16777215&Eu(o,0),c=!!(1&l),d=0,h=!!(4&l),p=!!(256&l),g=0,y=!!(512&l),m=0,_=!!(1024&l),E= !!(2048&l),T=0,b=Eu(o,4),S=8;c&&(d=Eu(o,S),S+=4),h&&(S+=4);for(var w=d+u,A=0;A>1&63;return 39===n||40===n}return 6==(31&t)} function Uu(e,t,n,r){var i=Fu(e),o=0;o+=t;for(var a=0,s=0,u=0;o=i.length)break;a+=u=i[o++]}while(255===u);s=0;do{if(o>=i.length)break;s+=u=i[o++]}while(255===u);var l=i.length-o, c=o;if(sl){Qs.error("Malformed SEI payload. "+s+" is too small, only "+l+" bytes left to parse.");break}if(4===a){if(181===i[c++]){var d=_u(i,c);if(c+=2,49===d){var h=Eu(i,c);if(c+=4, 1195456820===h){var f=i[c++];if(3===f){var p=i[c++],v=64&p,g=v?2+3*(31&p):0,y=new Uint8Array(g);if(v){y[0]=p;for(var m=1;m16){for(var _=[],E=0;E<16;E++){var T=i[c++].toString(16);_.push(1==T.length?"0"+T:T),3!==E&&5!==E&&7!==E&&9!==E||_.push("-")}for(var b=s-16,S=new Uint8Array(b),w=0;w>>24;if(0!==i&&1!==i)return{offset:n, size:t};var o=e.buffer,a=tu(new Uint8Array(o,n+12,16)),s=null,u=0;if(0===i)u=28;else{var l=e.getUint32(28);if(!l||r<32+16*l)return{offset:n,size:t};s=[];for(var c=0;c4||-1!==o(n=["ac-3","ec-3","alac","fLaC","Opus"]).call(n,e))&&(Ju(e,"audio")||Ju(e,"video")))return e;if(t){var r=t.split(",");if(r.length>1){if(e)for(var i=r.length;i--;)if(r[i].substring(0, 4)===e.substring(0,4))return r[i];return r[0]}}return t||e} function Ju(e,t){return ju(e,t)&&Ku(e,t)} function $u(e){if(es(e).call(e,"av01.")){for(var t=e.split("."),n=["0","111","01","01","01","0"],r=t.length;r>4&&r<10;r++)t[r]=n[r-4];return t.join(".")}return e} function el(e){var t=Js(e)||{isTypeSupported:function isTypeSupported(){return!1}}; return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs\x3d"mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs\x3d"ac-3"')}} function tl(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")} var nl={supported:!1,smooth:!1,powerEfficient:!1},rl={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function il(e,t){return{supported:!1,configurations:t, decodingInfoResults:[nl],error:e}} function ol(e,t,n,r){void 0===r&&(r={});var i=e.videoCodec;if(!i&&!e.audioCodec||!n)return d.resolve(rl);for(var o=[],a=function(e){var t,n=null==(t=e.videoCodec)?void 0:t.split(","),r=sl(e),i=e.width|| 640,o=e.height||480,a=e.frameRate||30,s=e.videoRange.toLowerCase();return n?Ma(n).call(n,function(e){var t={contentType:zu($u(e),"video"),width:i,height:o,bitrate:r,framerate:a};return"sdr"!==s&&(t.transferFunction= s),t}):[]}(e),s=a.length,u=function(e,t,n){var r,i,o=null==(r=e.audioCodec)?void 0:r.split(","),a=sl(e); return o&&e.audioGroups?ba(i=e.audioGroups).call(i,function(e,r){var i,s=r?null==(i=t.groups[r])?void 0:i.tracks:null;return s?ba(s).call(s,function(e,t){if(t.groupId===r){var i=Ja(t.channels||"");f(o).call(o, function(t){var r={contentType:zu(t,"audio"),bitrate:n?al(t,a):a};i&&(r.channels=""+i),e.push(r)})}return e},e):e},[]):[]}(e,t,s>0),l=u.length,c=s||1*l||1;c--;){var h={type:"media-source"}; if(s&&(h.video=a[c%s]),l){h.audio=u[c%l];var p=h.audio.bitrate;h.video&&p&&(h.video.bitrate-=p)}o.push(h)}if(i){var v,g=navigator.userAgent;if(qa(v=i.split(",")).call(v,function(e){return Nu(e)})&&Vu())return d.resolve(il(new Error("Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: ("+ g+")"),o))}return d.all(Ma(o).call(o,function(e){var t=function(e){var t="",n=e.audio,r=e.video; return r&&(t+=tl(r.contentType)+"_r"+r.height+"x"+r.width+"f"+Math.ceil(r.framerate)+(r.transferFunction||"sd")+"_"+Math.ceil(r.bitrate/1E5)),n&&(t+=(r?"_":"")+tl(n.contentType)+"_c"+n.channels),t}(e); return r[t]||(r[t]=n.decodingInfo(e))})).then(function(e){return{supported:!qa(e).call(e,function(e){return!e.supported}), configurations:o,decodingInfoResults:e}})["catch"](function(e){return{supported:!1, configurations:o,decodingInfoResults:[],error:e}})} function al(e,t){if(t<=1)return 1;var n=128E3;return"ec-3"===e?n=768E3:"ac-3"===e&&(n=64E4),Math.min(t/2,n)} function sl(e){return 1E3*Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)/1E3)||1} var ul=["NONE","TYPE-0","TYPE-1",null],ll=["SDR","PQ","HLG"];function cl(e){var t=e.canSkipUntil,n=e.canSkipDateRanges,r=e.age;return t&&r-1;r--)if(n(e[r]))return r;for(var i=t+1;i-1&&v!==p,y=!!e||g;if(y||!u.paused&&u.playbackRate&&u.readyState){var m= a.mainForwardBufferInfo;if(y||null!==m){var _=n.bwEstimator.getEstimateTTFB(),E=Math.abs(u.playbackRate);if(!(h<=Math.max(_,d/(2*E)*1E3))){var T=m?m.len/E:0,b=c.loading.first?c.loading.first-c.loading.start: -1,S=c.loaded&&b>-1,w=n.getBwEstimate(),A=a.levels,R=A[p],L=Math.max(c.loaded,Math.round(d*(i.bitrate||R.averageBitrate)/8)),I=S?h-b:h;I<1&&S&&(I=Math.min(h,8*c.loaded/w));var C=S?1E3*c.loaded/I:0,O=_/ 1E3,P=C?(L-c.loaded)/C:8*L/w+O;if(!(P<=T)){var k,D=C?8*C:w,x=!0===(null==(t=(null==e?void 0:e.details)||n.hls.latestLevelDetails)?void 0:t.live),N=n.hls.config.abrBandWidthUpFactor,M=Number.POSITIVE_INFINITY; for(k=p-1;k>f;k--){var U=A[k].maxBitrate,F=!A[k].details||x;if((M=n.getTimeToLoadFrag(O,D,d*U,F))=P||M>10*d)){S?n.bwEstimator.sample(h-Math.min(_,b),c.loaded):n.bwEstimator.sampleTTFB(h); var B=A[k].maxBitrate;n.getBwEstimate()*N>B&&n.resetEstimator(B);var V=n.findBestLevel(B,f,k,0,T,1,1);V>-1&&(k=V),n.warn("Fragment "+i.sn+(o?" part "+o.index:"")+" of level "+p+" is loading too slowly;\n Fragment duration: "+ i.duration.toFixed(3)+"\n Time to underbuffer: "+T.toFixed(3)+" s\n Estimated load time for current fragment: "+P.toFixed(3)+" s\n Estimated load time for down switch fragment: "+M.toFixed(3)+ " s\n TTFB estimate: "+(0|b)+" ms\n Current BW estimate: "+(Os(w)?0|w:"Unknown")+" bps\n New BW estimate: "+(0|n.getBwEstimate())+" bps\n Switching to level "+k+" @ "+(0|B)+" bps"), a.nextLoadLevel=a.nextAutoLevel=k,n.clearTimer();var H=function H(){if(n.clearTimer(),n.fragCurrent===i&&n.hls.loadLevel===k&&k>0){var e=n.getStarvationDelay();if(n.warn("Aborting inflight request "+(k> 0?"and switching down":"")+"\n Fragment duration: "+i.duration.toFixed(3)+" s\n Time to underbuffer: "+e.toFixed(3)+" s"),i.abortRequests(),n.fragCurrent=n.partCurrent=null,k>f){var t=n.findBestLevel(n.hls.levels[f].bitrate, f,k,0,e,1,1);-1===t&&(t=f),n.hls.nextLoadLevel=n.hls.nextAutoLevel=t,n.resetEstimator(n.hls.levels[t].bitrate)}}}; g||P>2*M?H():n.timer=za(H,1E3*M),a.trigger(Ns.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:o,stats:c})}}}}}}}},n.hls=t,n.bwEstimator=n.initEstimator(),n.registerListeners(),n} Ka(t,e);var n=t.prototype;return n.resetEstimator=function(e){e&&(this.log("setting initial bwe to "+e),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}, n.initEstimator=function(){var e=this.hls.config; return new Ks(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)},n.registerListeners=function(){var e=this.hls; e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.FRAG_LOADING,this.onFragLoading,this),e.on(Ns.FRAG_LOADED,this.onFragLoaded,this),e.on(Ns.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Ns.LEVEL_SWITCHING, this.onLevelSwitching,this),e.on(Ns.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Ns.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Ns.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(Ns.ERROR, this.onError,this)},n.unregisterListeners=function(){var e=this.hls; e&&(e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.FRAG_LOADING,this.onFragLoading,this),e.off(Ns.FRAG_LOADED,this.onFragLoaded,this),e.off(Ns.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Ns.LEVEL_SWITCHING, this.onLevelSwitching,this),e.off(Ns.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ns.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Ns.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(Ns.ERROR, this.onError,this))},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null},n.onManifestLoading= function(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()},n.onLevelsUpdated= function(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup= null},n.onMaxAutoLevelUpdated=function(){this.firstSelection=-1,this.nextAutoLevelKey=""},n.onFragLoading=function(e,t){var n,r=t.frag; this.ignoreFragment(r)||(r.bitrateTest||(this.fragCurrent=r,this.partCurrent=null!=(n=t.part)?n:null),this.clearTimer(),this.timer=za(this._abandonRulesCheck,100))},n.onLevelSwitching=function(e,t){this.clearTimer()}, n.onError=function(e,t){if(!t.fatal)switch(t.details){case xs.BUFFER_ADD_CODEC_ERROR:case xs.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1; break;case xs.FRAG_LOAD_TIMEOUT:var n=t.frag,r=this.fragCurrent,i=this.partCurrent;if(n&&r&&n.sn===r.sn&&n.level===r.level){var o=performance.now(),a=i?i.stats:n.stats,s=o-a.loading.start,u=a.loading.first? a.loading.first-a.loading.start:-1;if(a.loaded&&u>-1){var l=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(s-Math.min(l,u),a.loaded)}else this.bwEstimator.sampleTTFB(s)}}},n.getTimeToLoadFrag= function(e,t,n,r){return e+n/t+(r?e+this.lastLevelLoadSec:0)},n.onLevelLoaded=function(e,t){var n=this.hls.config,r=t.stats.loading,i=r.end-r.first; Os(i)&&(this.lastLevelLoadSec=i/1E3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}, n.onFragLoaded=function(e,t){var n=t.frag,r=t.part,i=r?r.stats:n.stats; if(n.type===Vs&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(n)){if(this.clearTimer(),n.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1, this.hls.config.abrMaxWithRealBitrate){var o=r?r.duration:n.duration,a=this.hls.levels[n.level],s=(a.loaded?a.loaded.bytes:0)+i.loaded,u=(a.loaded?a.loaded.duration:0)+o;a.loaded={bytes:s,duration:u},a.realBitrate= Math.round(8*s/u)}if(n.bitrateTest){var l={stats:i,frag:n,part:r,id:n.type};this.onFragBuffered(Ns.FRAG_BUFFERED,l),n.bitrateTest=!1}else this.lastLoadedFragLevel=n.level}},n.onFragBuffered=function(e, t){var n=t.frag,r=t.part,i=null!=r&&r.stats.loaded?r.stats:n.stats; if(!i.aborted&&!this.ignoreFragment(n)){var o=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,i.loaded),i.bwEstimate= this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1E3:this.bitrateTestDelay=0}},n.ignoreFragment=function(e){return e.type!==Vs||"initSegment"===e.sn},n.clearTimer=function(){this.timer>-1&&(self.clearInterval(this.timer), this.timer=-1)},n.getAutoLevelKey=function(){return this.getBwEstimate()+"_"+this.getStarvationDelay().toFixed(2)},n.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,n=this.hls; if(n.levels.length<=1)return n.loadLevel;var r=n.maxAutoLevel,i=n.config,o=n.minAutoLevel,a=t?t.duration:e?e.duration:0,s=this.getBwEstimate(),u=this.getStarvationDelay(),l=i.abrBandWidthFactor,c=i.abrBandWidthUpFactor; if(u){var d=this.findBestLevel(s,o,r,u,0,l,c);if(d>=0)return this.rebufferNotice=-1,d}var h=a?Math.min(a,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){var f=this.bitrateTestDelay;f&&(h=(a?Math.min(a, i.maxLoadingDelay):i.maxLoadingDelay)-f,this.info("bitrate test took "+Math.round(1E3*f)+"ms, set first fragment max fetchDuration to "+Math.round(1E3*h)+" ms"),l=c=1)}var p=this.findBestLevel(s,o,r,u, h,l,c);if(this.rebufferNotice!==p&&(this.rebufferNotice=p,this.info((u?"rebuffering expected":"buffer is empty")+", optimal quality level "+p)),p>-1)return p;var v=n.levels[o],g=n.loadLevelObj;return g&& (null==v?void 0:v.bitrate)0),f=Math.min(f,t.minHeight),p=Math.min(p,t.minFramerate),v=Math.min(v,t.minBitrate),Oa(T).call(T,function(e){return t.videoRanges[e]>0}).length>0&&(h=!0)},S=a.length;S--;)b(); f=Os(f)?f:0,p=Os(p)?p:0;var w=Math.max(1080,f),A=Math.max(30,p);v=Os(v)?v:n,n=Math.max(v,n),h||(t=void 0);var R=a.length>1;return{codecSet:ba(a).call(a,function(t,r){var i=e[r];if(r===t)return t;if(m=h? Oa(T).call(T,function(e){return i.videoRanges[e]>0}):[],R){if(i.minBitrate>n)return vl(r,"min bitrate of "+i.minBitrate+" \x3e current estimate of "+n),t; if(!i.hasDefaultAudio)return vl(r,"no renditions with default or auto-select sound found"),t;if(u&&o(r).call(r,u.substring(0,4))%5!=0)return vl(r,'audio codec preference "'+u+'" not found'),t;if(s&&!c){if(!i.channels[s])return vl(r, "no renditions with "+s+" channel sound found (channels options: "+Fa(i.channels)+")"),t}else if((!u||c)&&d&&0===i.channels[2])return vl(r,"no renditions with stereo sound found"),t;if(i.minHeight>w)return vl(r, "min resolution of "+i.minHeight+" \x3e maximum of "+w),t;if(i.minFramerate>A)return vl(r,"min framerate of "+i.minFramerate+" \x3e maximum of "+A),t;if(!qa(m).call(m,function(e){return i.videoRanges[e]> 0}))return vl(r,"no variants with VIDEO-RANGE of "+pl(m)+" found"),t; if(l&&o(r).call(r,l.substring(0,4))%5!=0)return vl(r,'video codec preference "'+l+'" not found'),t;if(i.maxScore= qu(t)||i.fragmentError>e[t].fragmentError)?t:(g=i.minIndex,y=i.maxScore,r)},void 0), videoRanges:m,preferHDR:E,minFramerate:p,minBitrate:v,minIndex:g}}(P,A,e,L,I),D=k.codecSet,x=k.videoRanges,N=k.minFramerate,M=k.minBitrate,U=k.minIndex,F=k.preferHDR; O=U,T=D,A=F?x[x.length-1]:x[0],R=N,e=Math.max(e,M),this.log("picked start tier "+pl(k))}else T=null==b?void 0:b.codecSet,A=null==b?void 0:b.videoRange;for(var B,V=v?v.duration:p?p.duration:0,H=this.bwEstimator.getEstimateTTFB()/ 1E3,j=[],G="allow"===this.hls.config.abrUpSwitchToLowerFrameRateMode,K="allow"===this.hls.config.abrDownSwitchToHigherFrameRateMode,z=function z(){var t,u=y[W],p=W>h;if(!u)return 0;if(E.useMediaCapabilities&& !u.supportedResult&&!u.supportedPromise){var g=navigator.mediaCapabilities;"function"==typeof(null==g?void 0:g.decodingInfo)&&function(e,t,n,r,i,o){var a,s,u=e.videoCodec,l=e.audioCodec?e.audioGroups:null, c=null==o?void 0:o.audioCodec,d=null==o?void 0:o.channels,h=d?Xa(d):c?1/0:2,p=null;if(null!=l&&l.length)try{p=1===l.length&&l[0]?t.groups[l[0]].channels:ba(l).call(l,function(e,n){if(n){var r,i=t.groups[n]; if(!i)throw new Error("Audio track group "+n+" not found");f(r=Fa(i.channels)).call(r,function(t){e[t]=(e[t]||0)+i.channels[t]})}return e},{2:0})}catch(e){return!0}return void 0!==u&&(qa(a=u.split(",")).call(a, function(e){return Nu(e)})||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(i,8E6))||!!p&&Os(h)&&qa(s=Fa(p)).call(s, function(e){return Xa(e)>h})}(u,C,A,R,e,L)?(u.supportedPromise=ol(u,C,g,l.supportedCache),u.supportedPromise.then(function(e){var t; if(l.hls){u.supportedResult=e;var n=l.hls.levels,r=o(n).call(n,u);e.error?l.warn('MediaCapabilities decodingInfo error: "'+e.error+'" for level '+r+" "+pl(e)):e.supported?qa(t=e.decodingInfoResults).call(t, function(e){return!1===e.smooth||!1===e.powerEfficient})&&l.log("MediaCapabilities decodingInfo for level "+r+" not smooth or powerEfficient: "+pl(e)):(l.warn("Unsupported MediaCapabilities decodingInfo result for level "+ r+" "+pl(e)),r>-1&&n.length>1&&(l.log("Removing unsupported level "+r),l.hls.removeLevel(r),-1===l.hls.loadLevel&&(l.hls.nextLoadLevel=0)))}})["catch"](function(e){l.warn("Error handling MediaCapabilities decodingInfo: "+ e)})):u.supportedResult=rl}if((T&&u.codecSet!==T||A&&u.videoRange!==A||p&&R>u.frameRate&&!G||!p&&R>0&&R=2*V&&0===i?u.averageBitrate:u.maxBitrate,k=l.getTimeToLoadFrag(H,m,P*I,void 0===b); if(m>=P&&(W===d||0===u.loadError&&0===u.fragmentError)&&(k<=H||!Os(k)||S&&!l.bitrateTestDelay||k=t;W--)if(0!==(B=z())&&B)return B.v; return-1},n.deriveNextAutoLevel=function(e){var t=this.hls,n=t.maxAutoLevel,r=t.minAutoLevel; return Math.min(Math.max(e,r),n)},Ra(t,[{key:"firstAutoLevel", get:function get(){var e=this.hls,t=e.maxAutoLevel,n=e.minAutoLevel,r=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,o=this.findBestLevel(r,n,t,0,i,1,1);if(o>-1)return o;var a=this.hls.firstLevel, s=Math.min(Math.max(a,n),t);return this.warn("Could not find best starting auto level. Defaulting to first in playlist "+a+" clamped to "+s),s}}, {key:"forcedAutoLevel",get:function get(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}}, {key:"nextAutoLevel",get:function get(){var e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e; var r=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){var i=this.hls.levels;if(i.length>Math.max(e,r)&&i[e].loadError<=i[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey= this.getAutoLevelKey(),r}, set:function set(e){var t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}}])}(zs),wl=function wl(e,t){for(var n=0,r=e.length-1,i=null,o=null;n<=r;){var a= t(o=e[i=(n+r)/2|0]); if(a>0)n=i+1;else{if(!(a<0))return o;r=i-1}}return null}; function Al(e,t,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=.005);var o=null;if(e){o=t[1+e.sn-t[0].sn]||null;var a=e.endDTS-n;a>0&&a<1.5E-6&&(n+=1.5E-6),o&&e.level!==o.level&&o.end<=e.end&& (o=t[2+e.sn-t[0].sn]||null)}else 0===n&&0===t[0].start&&(o=t[0]);if(o&&((!e||e.level===o.level)&&0===Rl(n,r,o)||function(e,t,n){if(t&&0===t.start&&t.level0){var r,i=ba(r=t.tagList).call(r, function(e,t){return"INF"===t[0]&&(e+=Ja(t[1])),e},n); return e.start<=i}return!1}(o,e,Math.min(i,r))))return o; var s=wl(t,l(Rl).call(Rl,null,n,r));return!s||s===e&&o?o:s} function Rl(e,t,n){if(void 0===e&&(e=0),void 0===t&&(t=0),n.start<=e&&n.start+n.duration>e)return 0;var r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&& n.start?-1:0} function Ll(e,t,n){var r=1E3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e} function Il(e,t,n){if(e&&e.startCC<=t&&e.endCC>=t){var r,i=e.fragments,o=e.fragmentHint;return o&&(i=ls(i).call(i,o)),wl(i,function(e){return e.cct?-1:(r=e,e.end<=n?1:e.start>n?-1:0)}),r||null}return null} function Cl(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function Ol(e){for(var t=1;t499)}(i)||!!n); return e.shouldRetry?e.shouldRetry(e,t,n,r,o):o} function Fl(e){return 0===e&&!1===navigator.onLine} var Bl=function(e){function t(t){var n;return(n=e.call(this,"error-controller",t.logger)||this).hls=void 0,n.playlistError=0,n.hls=t,n.registerListeners(),n} Ka(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(Ns.ERROR,this.onError,this),e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.LEVEL_UPDATED,this.onLevelUpdated, this)},n.unregisterListeners=function(){var e=this.hls; e&&(e.off(Ns.ERROR,this.onError,this),e.off(Ns.ERROR,this.onErrorOut,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.LEVEL_UPDATED,this.onLevelUpdated,this))},n.destroy=function(){this.unregisterListeners(), this.hls=null},n.startLoad=function(e){},n.stopLoad=function(){this.playlistError=0},n.getVariantLevelIndex=function(e){return(null==e?void 0:e.type)===Vs?e.level:this.getVariantIndex()},n.getVariantIndex= function(){var e,t=this.hls,n=t.currentLevel; return null!=(e=t.loadLevelObj)&&e.details||-1===n?t.loadLevel:n},n.variantHasKey=function(e,t){if(e){var n; if(null!=(n=e.details)&&n.hasKey(t))return!0;var r=e.audioGroups;if(r){var i,a=Oa(i=this.hls.allAudioTracks).call(i,function(e){return o(r).call(r,e.groupId)>=0}); return qa(a).call(a,function(e){var n;return null==(n=e.details)?void 0:n.hasKey(t)})}}return!1},n.onManifestLoading=function(){this.playlistError=0},n.onLevelUpdated=function(){this.playlistError=0},n.onError= function(e,t){var n; if(!t.fatal){var r=this.hls,i=t.context;switch(t.details){case xs.FRAG_LOAD_ERROR:case xs.FRAG_LOAD_TIMEOUT:case xs.KEY_LOAD_ERROR:case xs.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t)); case xs.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction=Vl());case xs.FRAG_GAP:case xs.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action= 2);case xs.LEVEL_EMPTY_ERROR:case xs.LEVEL_PARSING_ERROR:var o,a=t.parent===Vs?t.level:r.loadLevel;return void(t.details===xs.LEVEL_EMPTY_ERROR&&null!=(o=t.context)&&null!=(o=o.levelDetails)&&o.live?t.errorAction= this.getPlaylistRetryOrSwitchAction(t,a):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,a)));case xs.LEVEL_LOAD_ERROR:case xs.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==i?void 0: i.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level)));case xs.AUDIO_TRACK_LOAD_ERROR:case xs.AUDIO_TRACK_LOAD_TIMEOUT:case xs.SUBTITLE_LOAD_ERROR:case xs.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){var s= r.loadLevelObj;if(s&&(i.type===Fs&&s.hasAudioGroup(i.groupId)||i.type===Bs&&s.hasSubtitleGroup(i.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=2, void(t.errorAction.flags=1)}return;case xs.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(t.errorAction={action:2,flags:2});case xs.KEY_SYSTEM_SESSION_UPDATE_FAILED:case xs.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case xs.KEY_SYSTEM_NO_SESSION:return void(t.errorAction= {action:2,flags:4});case xs.BUFFER_ADD_CODEC_ERROR:case xs.REMUX_ALLOC_ERROR:case xs.BUFFER_APPEND_ERROR:var u;return void(t.errorAction||(t.errorAction=this.getLevelSwitchAction(t,null!=(u=t.level)?u: r.loadLevel)));case xs.INTERNAL_EXCEPTION:case xs.BUFFER_APPENDING_ERROR:case xs.BUFFER_FULL_ERROR:case xs.LEVEL_SWITCH_ERROR:case xs.BUFFER_STALLED_ERROR:case xs.BUFFER_SEEK_OVER_HOLE:case xs.BUFFER_NUDGE_ON_STALL:return void(t.errorAction= Vl())}t.type===Ds.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Vl())}},n.getPlaylistRetryOrSwitchAction=function(e,t){var n=xl(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++; if(Ul(n,r,Pl(e),e.response))return{action:5,flags:0,retryConfig:n,retryCount:r};var i=this.getLevelSwitchAction(e,t);return n&&(i.retryConfig=n,i.retryCount=r),i},n.getFragRetryOrSwitchAction=function(e){var t, n=this.hls,r=this.getVariantLevelIndex(e.frag),i=n.levels[r],o=n.config,a=o.fragLoadPolicy,s=o.keyLoadPolicy,u=xl(kl(e)?s:a,e),l=ba(t=n.levels).call(t,function(e,t){return e+t.fragmentError},0); if(i&&(e.details!==xs.FRAG_GAP&&i.fragmentError++,!Dl(e)&&Ul(u,l,Pl(e),e.response)))return{action:5,flags:0,retryConfig:u,retryCount:l};var c=this.getLevelSwitchAction(e,r);return u&&(c.retryConfig=u,c.retryCount= l),c},n.getLevelSwitchAction=function(e,t){var n=this.hls; null==t&&(t=n.loadLevel);var r=this.hls.levels[t];if(r){var i,o,a=e.details;r.loadError++,a===xs.BUFFER_APPEND_ERROR&&r.fragmentError++;var s=-1,u=n.levels,l=n.loadLevel,c=n.minAutoLevel,d=n.maxAutoLevel; n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);for(var h,f=null==(i=e.frag)?void 0:i.type,p=(f===Hs&&a===xs.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(a===xs.BUFFER_ADD_CODEC_ERROR|| a===xs.BUFFER_APPEND_ERROR))&&qa(u).call(u,function(e){var t=e.audioCodec;return r.audioCodec!==t}),v="video"===e.sourceBufferName&&(a===xs.BUFFER_ADD_CODEC_ERROR||a===xs.BUFFER_APPEND_ERROR)&&qa(u).call(u, function(e){var t=e.codecSet,n=e.audioCodec; return r.codecSet!==t&&r.audioCodec===n}),g=null!=(o=e.context)?o:{},y=g.type,m=g.groupId,_=function _(){var t=(E+l)%u.length; if(t!==l&&t>=c&&t<=d&&0===u[t].loadError){var n,i,o=u[t];if(a===xs.FRAG_GAP&&f===Vs&&e.frag){var h=u[t].details;if(h){var g=Al(e.frag,h.fragments,e.frag.start);if(null!=g&&g.gap)return 0}}else{if(y===Fs&& o.hasAudioGroup(m)||y===Bs&&o.hasSubtitleGroup(m))return 0;if(f===Hs&&null!=(n=r.audioGroups)&&qa(n).call(n,function(e){return o.hasAudioGroup(e)})||f===js&&null!=(i=r.subtitleGroups)&&qa(i).call(i,function(e){return o.hasSubtitleGroup(e)})|| p&&r.audioCodec===o.audioCodec||v&&r.codecSet===o.codecSet||!p&&r.codecSet!==o.codecSet)return 0}return s=t,1}},E=u.length;E--&&(0===(h=_())||1!==h);); if(s>-1&&n.loadLevel!==s)return e.levelRetry=!0,this.playlistError=0,{action:2,flags:0,nextAutoLevel:s}}return{action:2,flags:1}},n.onErrorOut=function(e,t){var n; switch(null==(n=t.errorAction)?void 0:n.action){case 0:break;case 2:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===xs.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&& (this.warn('MediaSource ended after "'+t.sourceBufferName+'" sourceBuffer append error. Attempting to recover from media error.'),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}, n.sendAlternateToPenaltyBox=function(e){var t=this.hls,n=e.errorAction; if(n){var r=ns(n),i=n.nextAutoLevel;switch(r){case 0:this.switchLevel(e,i);break;case 2:var a=this.getVariantLevelIndex(e.frag),s=t.levels[a],u=null==s?void 0:s.attrs["HDCP-LEVEL"];if(n.hdcpLevel=u,"NONE"=== u)this.warn("HDCP policy resticted output with HDCP-LEVEL\x3dNONE");else if(u){t.maxHdcpLevel=ul[o(ul).call(ul,u)-1],n.resolved=!0,this.warn('Restricting playback to HDCP-LEVEL of "'+t.maxHdcpLevel+'" or lower'); break}case 4:var l=e.decryptdata;if(l){for(var c=this.hls.levels,d=c.length,h=d;h--;){var f,p;this.variantHasKey(c[h],l)&&(this.log("Banned key found in level "+h+" ("+c[h].bitrate+'bps) or audio group "'+ (null==(f=c[h].audioGroups)?void 0:f.join(","))+'" ('+(null==(p=e.frag)?void 0:p.type)+" fragment) "+tu(l.keyId||[])),c[h].fragmentError++,c[h].loadError++,this.log("Removing level "+h+" with key error ("+ e.error+")"),this.hls.removeLevel(h))}var v=e.frag;if(this.hls.levels.length=u.body.sn))if(u.buffered||u.loaded&&!i){var l= u.range[e];l&&(0!==l.time.length?qa(o=l.time).call(o,function(e){var n=!a.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&a.removeFragment(u.body),n}):a.removeFragment(u.body))}else u.body.type===n&&a.removeFragment(u.body)})}, t.detectPartialFragments=function(e){var t,n=this,r=this.timeRanges,i=e.frag,o=e.part,a=e.id; if(r&&lu(i)){var s=ql(i),u=this.fragments[s];if(!(!u||u.buffered&&i.gap)){var l=!i.relurl;f(t=Fa(r)).call(t,function(e){var t=i.elementaryStreams[e];if(t){var s=r[e],c=l||!0===t.partial;u.range[e]=n.getBufferedTimes(i, o,c,s),n.detectEvictedFragments(e,s,a,o)}}),u.loaded=null; var c=Fa(u.range);if(c.length){if(this.bufferedEnd(u,i),Wl(u)||this.removeParts(i.sn-1,i.type),!o){var d=Math.min(.004,i.duration);qa(c).call(c,function(e){var t,r=null==(t=u.range[e])?void 0:t.time,o= 0===r.length||1===r.length&&r[0].endPTS-r[0].startPTS=e}))},t.fragBuffered=function(e,t){var n=ql(e),r=this.fragments[n]; !r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:wo(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)},t.getBufferedTimes=function(e,t,n,r){for(var i={time:[], partial:n},o=e.start,a=e.end,s=e.minEndPTS||a,u=e.maxStartPTS||o,l=0;l=c&&s<=d){i.time.push({startPTS:Math.max(o,r.start(l)), endPTS:Math.min(a,r.end(l))});break}if(oc){var h=Math.max(o,r.start(l)),f=Math.min(a,r.end(l));f>h&&(i.partial=!0,i.time.push({startPTS:h,endPTS:f}))}else if(a<=c)break}return i},t.getPartialFragment= function(e){var t,n,r,i,o=null,a=0,s=this.bufferPadding,u=this.fragments; return f(t=Fa(u)).call(t,function(t){var l=u[t];l&&Wl(l)&&(r=l.body.start-s,i=l.body.end+s,e>=r&&e<=i&&(n=Math.min(e-r,i-e),a<=n&&(o=l.body,a=n)))}),o},t.isEndListAppended=function(e){var t=this.endListFragments[e]; return void 0!==t&&(t.buffered||Wl(t))},t.getState=function(e){var t=ql(e),n=this.fragments[t]; return n?n.buffered?Wl(n)?Gl:Kl:jl:Hl},t.isTimeBuffered=function(e,t,n){for(var r,i,o=0;o=r&&t<=i)return!0; if(t<=r)return!1}return!1},t.onManifestLoading=function(){this.removeAllFragments()},t.onFragLoaded=function(e,t){if(lu(t.frag)&&!t.frag.bitrateTest){var n=t.frag,r=t.part?null:t,i=ql(n); this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:wo(null)}}},t.onBufferAppended=function(e,t){var n=t.frag,r=t.part,i=t.timeRanges; if(lu(n)){var o=n.type;if(r){var a=this.activePartLists[o];a||(this.activePartLists[o]=a=[]),a.push(r)}this.timeRanges=i}},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t= ql(e); return!!this.fragments[t]},t.hasFragments=function(e){var t=this.fragments,n=Fa(t); if(!e)return n.length>0;for(var r=n.length;r--;){var i=t[n[r]];if((null==i?void 0:i.body.type)===e)return!0}return!1},t.hasParts=function(e){var t; return!(null==(t=this.activePartLists[e])||!t.length)},t.getBackBufferEvictionEnd=function(e,t,n){for(var r=this.fragments,i=0,o=0,a=Fa(r),s=0;s=n))return o}}return o> 0?o:0},t.removeFragmentsInRange=function(e,t,n,r,i){var o,a=this; r&&!this.hasGaps||f(o=Fa(this.fragments)).call(o,function(o){var s=a.fragments[o];if(s){var u=s.body;u.type!==n||r&&!u.gap||u.starte&&(s.buffered||i)&&a.removeFragment(u)}})},t.removeFragment= function(e){var t=ql(e); e.clearElementaryStreamInfo();var n=this.activePartLists[e.type];if(n){var r=e.sn;this.activePartLists[e.type]=Zl(n,function(e){return e.fragment.sn!==r})}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}, t.removeAllFragments=function(){var e; this.fragments=wo(null),this.endListFragments=wo(null),this.activePartLists=wo(null),this.hasGaps=!1;var t=null==(e=this.hls)||null==(e=e.latestLevelDetails)?void 0:e.partList;t&&f(t).call(t,function(e){return e.clearElementaryStreamInfo()})}, e}(); function Wl(e){var t,n,r;return e.buffered&&!!(e.body.gap||null!=(t=e.range.video)&&t.partial||null!=(n=e.range.audio)&&n.partial||null!=(r=e.range.audiovideo)&&r.partial)} function ql(e){return e.type+"_"+e.level+"_"+e.sn} function Zl(e,t){return Oa(e).call(e,function(e){var n=t(e);return n||e.clearElementaryStreamInfo(),n})} var Yl=function(){function e(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n} return e.prototype.decrypt=function(e,t){switch(this.aesMode){case 0:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case 1:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV, length:64},t,e);default:throw new Error("[AESCrypto] invalid aes mode "+this.aesMode);}},e}(),Xl=function(){function e(){this.rcon=[0, 1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256), new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()} var t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r<4;r++)n[r]=t.getUint32(4*r);return n},t.initTable=function(){var e=this.sBox,t=this.invSBox, n=this.subMix,r=n[0],i=n[1],o=n[2],a=n[3],s=this.invSubMix,u=s[0],l=s[1],c=s[2],d=s[3],h=new Uint32Array(256),f=0,p=0,v=0; for(v=0;v<256;v++)h[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[f]=g,t[g]=f;var y=h[f],m=h[y],_=h[m],E=257*h[g]^16843008*g;r[f]=E<<24|E>>>8,i[f]=E<<16|E>>>16, o[f]=E<<8|E>>>24,a[f]=E,E=16843009*_^65537*m^257*y^16843008*f,u[g]=E<<24|E>>>8,l[g]=E<<16|E>>>16,c[g]=E<<8|E>>>24,d[g]=E,f?(f=y^h[h[h[_^y]]],p^=h[h[p]]):f=p=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e), n=!0,r=0;r>>24)>>>24]<<24|h[u>>>16&255]<<16|h[u>>>8&255]<<8|h[255& u],u^=f[o/i|0]<<24):i>6&&o%i==4&&(u=h[u>>>24]<<24|h[u>>>16&255]<<16|h[u>>>8&255]<<8|h[255&u]),c[o]=s=(c[o-i]^u)>>>0);for(a=0;a>>24]]^g[h[u>>>16&255]]^ y[h[u>>>8&255]]^m[h[255&u]],d[a]=d[a]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,n){for(var r,i,o,a,s,u,l,c,d,h,f,p,v,g,y=this.keySize+ 6,m=this.invKeySchedule,_=this.invSBox,E=this.invSubMix,T=E[0],b=E[1],S=E[2],w=E[3],A=this.uint8ArrayToUint32Array_(n),R=A[0],L=A[1],I=A[2],C=A[3],O=new Int32Array(e),P=new Int32Array(O.length),k=this.networkToHostOrderSwap;t< O.length;){for(d=k(O[t]),h=k(O[t+1]),f=k(O[t+2]),p=k(O[t+3]),s=d^m[0],u=p^m[1],l=f^m[2],c=h^m[3],v=4,g=1;g>>24]^b[u>>16&255]^S[l>>8&255]^w[255&c]^m[v],i=T[u>>>24]^b[l>>16&255]^S[c>>8&255]^ w[255&s]^m[v+1],o=T[l>>>24]^b[c>>16&255]^S[s>>8&255]^w[255&u]^m[v+2],a=T[c>>>24]^b[s>>16&255]^S[u>>8&255]^w[255&l]^m[v+3],s=r,u=i,l=o,c=a,v+=4; r=_[s>>>24]<<24^_[u>>16&255]<<16^_[l>>8&255]<<8^_[255&c]^m[v],i=_[u>>>24]<<24^_[l>>16&255]<<16^_[c>>8&255]<<8^_[255&s]^m[v+1],o=_[l>>>24]<<24^_[c>>16&255]<<16^_[s>>8&255]<<8^_[255&u]^m[v+2],a=_[c>>>24]<< 24^_[s>>16&255]<<16^_[u>>8&255]<<8^_[255&l]^m[v+3],P[t]=k(r^R),P[t+1]=k(a^L),P[t+2]=k(o^I),P[t+3]=k(i^C),R=d,L=h,I=f,C=p,t+=4}return P.buffer},e}(),Ql=function(){function e(e,t,n){this.subtle=void 0,this.key= void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n} return e.prototype.expandKey=function(){var e=function(e){switch(e){case 0:return"AES-CBC";case 1:return"AES-CTR";default:throw new Error("[FastAESKey] invalid aes mode "+e);}}(this.aesMode); return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])},e}(),Jl=function(){function e(e,t){var n=(void 0===t?{}:t).removePKCS7Padding,r=void 0===n||n; if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null, this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=r,r)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(e){}this.useSoftware= !this.subtle} var t=e.prototype;return t.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},t.isSync= function(){return this.useSoftware},t.flush=function(){var e=this.currentResult,t=this.remainderData; if(!e||t)return this.reset(),null;var n,r,i,o=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?(i=(r=(n=o).byteLength)&&(new DataView(n.buffer)).getUint8(r-1))?Ea(n).call(n,0,r-i):n:o},t.reset= function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,n,r){var i=this; return this.useSoftware?new d(function(o,a){var s=ArrayBuffer.isView(e)?e:new Uint8Array(e);i.softwareDecrypt(s,t,n,r);var u=i.flush();u?o(u.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}): this.webCryptoDecrypt(new Uint8Array(e),t,n,r)},t.softwareDecrypt=function(e,t,n,r){var i=this.currentIV,o=this.currentResult,a=this.remainderData; if(0!==r||16!==t.byteLength)return Qs.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=Du(a,e),this.remainderData=null);var s=this.getValidChunk(e);if(!s.length)return null; i&&(n=i);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new Xl),u.expandKey(t);var l=o;return this.currentResult=u.decrypt(s.buffer,0,n),this.currentIV=Ea(s).call(s,-16).buffer,l||null},t.webCryptoDecrypt= function(e,t,n,r){var i=this; if(this.key!==t||!this.fastAesKey){if(!this.subtle)return d.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new Ql(this.subtle,t,r)}return this.fastAesKey.expandKey().then(function(t){return i.subtle? (i.logOnce("WebCrypto AES decrypt"),(new Yl(i.subtle,new Uint8Array(n),r)).decrypt(e.buffer,t)):d.reject(new Error("web crypto not initialized"))})["catch"](function(o){return Qs.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+ o.name+": "+o.message),i.onWebCryptoError(e,t,n,r)})},t.onWebCryptoError=function(e,t,n,r){var i=this.enableSoftwareAES; if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);var o=this.flush();if(o)return o.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data"); },t.getValidChunk=function(e){var t=e,n=e.length-e.length%16; return n!==e.length&&(t=Ea(e).call(e,0,n),this.remainderData=Ea(e).call(e,n)),t},t.logOnce=function(e){this.logEnabled&&(Qs.log("[decrypter]: "+e),this.logEnabled=!1)},e}(); function $l(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function ec(e){for(var t=1;t1&&this.tickImmediate(),this._tickCallCount= 0)},n.tickImmediate=function(){this.clearNextTick(),this._tickTimer=T(this._boundTick,0)},n.doTick=function(){},t}(zs),sc=function sc(e,t,n,r,i,o){void 0===r&&(r=0),void 0===i&&(i=-1),void 0===o&&(o=!1), this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0, executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}}, this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=o},uc={length:0, start:function start(){return 0}, end:function end(){return 0}},lc=function(){function e(){} return e.isBuffered=function(t,n){if(t)for(var r=e.getBuffered(t),i=r.length;i--;)if(n>=r.start(i)&&n<=r.end(i))return!0;return!1},e.bufferedRanges=function(t){if(t){var n=e.getBuffered(t); return e.timeRangesToArray(n)}return[]},e.timeRangesToArray=function(e){for(var t=[],n=0;n1&&ma(e).call(e,function(e,t){return e.start-t.start||t.end- e.end}); var r=-1,i=[];if(n)for(var o=0;o=e[o].start&&t<=e[o].end&&(r=o);var a=i.length;if(a){var s=i[a-1].end;e[o].start-ss&&(i[a-1].end=e[o].end):i.push(e[o])}else i.push(e[o])}else i= e;for(var u,l=0,c=t,d=t,h=0;h=f&&t<=p&&(r=h),t+n>=f&&tGa?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t,n=Ea(t=this[e]||"0x").call(t,2); n=(1&n.length?"0":"")+n;for(var r=new Uint8Array(n.length/2),i=0;iGa?1/0:t},t.decimalFloatingPoint=function(e){return Ja(this[e])},t.optionalFloat=function(e,t){var n=this[e]; return n?Ja(n):t},t.enumeratedString=function(e){return this[e]},t.enumeratedStringList=function(e,t){var n,r=this[e]; return ba(n=r?r.split(/[ ,]+/):[]).call(n,function(e,t){return e[t.toLowerCase()]=!0,e},t)},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=vc.exec(this[e]); if(null!==t)return{width:Xa(t[1],10),height:Xa(t[2],10)}},e.parseAttrList=function(e,t){var n,r={}; for(gc.lastIndex=0;null!==(n=gc.exec(e));){var i,a=fa(i=n[1]).call(i),s=n[2],u=0===o(s).call(s,'"')&&La(s).call(s,'"')===s.length-1,l=!1;if(u)s=Ea(s).call(s,1,-1);else switch(a){case "IV":case "SCTE35-CMD":case "SCTE35-IN":case "SCTE35-OUT":l= !0}if(t&&(u||l))s=hc(t,s);else if(!l&&!u)switch(a){case "CLOSED-CAPTIONS":if("NONE"===s)break;case "ALLOWED-CPC":case "CLASS":case "ASSOC-LANGUAGE":case "AUDIO":case "BYTERANGE":case "CHANNELS":case "CHARACTERISTICS":case "CODECS":case "DATA-ID":case "END-DATE":case "GROUP-ID":case "ID":case "IMPORT":case "INSTREAM-ID":case "KEYFORMAT":case "KEYFORMATVERSIONS":case "LANGUAGE":case "NAME":case "PATHWAY-ID":case "QUERYPARAM":case "RECENTLY-REMOVED-DATERANGES":case "SERVER-URI":case "STABLE-RENDITION-ID":case "STABLE-VARIANT-ID":case "START-DATE":case "SUBTITLES":case "SUPPLEMENTAL-CODECS":case "URI":case "VALUE":case "VIDEO":case "X-ASSET-LIST":case "X-ASSET-URI":Qs.warn(e+ ": attribute "+a+" is missing quotes")}r[a]=s}return r},Ra(e,[{key:"clientAttrs", get:function get(){var e;return Oa(e=Fa(this)).call(e,function(e){return"X-"===e.substring(0,2)})}}])}(); function mc(e){return"ID"!==e&&"CLASS"!==e&&"CUE"!==e&&"START-DATE"!==e&&"DURATION"!==e&&"END-DATE"!==e&&"END-ON-NEXT"!==e} function _c(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e} var Ec=Ra(function(e,t,n){var r;if(void 0===n&&(n=0),this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId= void 0,this.tagAnchor=(null==t?void 0:t.tagAnchor)||null,this.tagOrder=null!=(r=null==t?void 0:t.tagOrder)?r:n,t){var i=t.attr;for(var o in i)if(Object.prototype.hasOwnProperty.call(e,o)&&e[o]!==i[o]){Qs.warn('DATERANGE tag attribute: "'+ o+'" does not match for tags with ID: "'+e.ID+'"'),this._badValueForSameId=o;break}e=Ya(new yc({}),i,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd= t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){var a=(null==t?void 0:t.endDate)||new Date(this.attr["END-DATE"]);Os(a.getTime())&&(this._endDate=a)}},[{key:"id", get:function get(){return this.attr.ID}}, {key:"class",get:function get(){return this.attr.CLASS}}, {key:"cue",get:function get(){var e=this._cue;return void 0===e?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}}, {key:"startTime",get:function get(){var e=this.tagAnchor;return null===e||null===e.programDateTime?(Qs.warn('Expected tagAnchor Fragment with PDT set for DateRange "'+this.id+'": '+e),NaN):e.start+(this.startDate.getTime()- e.programDateTime)/1E3}}, {key:"startDate",get:function get(){return this._startDate}}, {key:"endDate",get:function get(){var e=this._endDate||this._dateAtEnd;if(e)return e;var t=this.duration;return null!==t?this._dateAtEnd=new Date(this._startDate.getTime()+1E3*t):null}}, {key:"duration",get:function get(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(Os(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/ 1E3;return null}}, {key:"plannedDuration",get:function get(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}}, {key:"endOnNext",get:function get(){return this.attr.bool("END-ON-NEXT")}}, {key:"isInterstitial",get:function get(){return"com.apple.hls.interstitial"===this["class"]}}, {key:"isValid",get:function get(){return!!this.id&&!this._badValueForSameId&&Os(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this["class"])&&(!this.attr.CUE|| !this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}]),Tc=function(){function e(e){this.PTSKnown=!1,this.alignedSliding= !1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled= -1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type= null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0, this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd= 0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges= {},this.url=e} var t=e.prototype;return t.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN|| !!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1},t.hasKey=function(e){var t; return qa(t=this.encryptedFragments).call(t,function(t){var n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)})},Ra(e,[{key:"hasProgramDateTime", get:function get(){return!!this.fragments.length&&Os(this.fragments[this.fragments.length-1].programDateTime)}}, {key:"levelTargetDuration",get:function get(){return this.averagetargetduration||this.targetduration||10}}, {key:"drift",get:function get(){var e=this.driftEndTime-this.driftStartTime;return e>0?1E3*(this.driftEnd-this.driftStart)/e:1}}, {key:"edge",get:function get(){return this.partEnd||this.fragmentEnd}}, {key:"partEnd",get:function get(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}}, {key:"fragmentEnd",get:function get(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}}, {key:"fragmentStart",get:function get(){return this.fragments.length?this.fragments[0].start:0}}, {key:"age",get:function get(){return this.advancedDateTime?Math.max(hs()-this.advancedDateTime,0)/1E3:0}}, {key:"lastPartIndex",get:function get(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}}, {key:"maxPartIndex",get:function get(){var e=this.partList;if(e){var t=this.lastPartIndex;if(-1!==t){for(var n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}}, {key:"lastPartSn",get:function get(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}, {key:"expired",get:function get(){if(this.live&&this.age&&this.misses<3){var e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}])}(); function bc(e,t){return e.length===t.length&&!qa(e).call(e,function(e,n){return e!==t[n]})} function Sc(e,t){return!e&&!t||!(!e||!t)&&bc(e,t)} function wc(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e} function Ac(e){switch(e){case "AES-128":case "AES-256":return 0;case "AES-256-CTR":return 1;default:throw new Error("invalid full segment method "+e);}} function Rc(e){return Uint8Array.from(atob(e),function(e){return e.charCodeAt(0)})} function Lc(e){return Uint8Array.from(unescape(encodeURIComponent(e)),function(e){return e.charCodeAt(0)})} function Ic(e){var t=function t(e,_t7,n){var r=e[_t7];e[_t7]=e[n],e[n]=r}; t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)} function Cc(e){var t,n,r=e.split(":"),i=null;if("data"===r[0]&&2===r.length){var o=r[1].split(";"),a=o[o.length-1].split(",");if(2===a.length){var u="base64"===a[0],l=a[1];u?(s(o).call(o,-1,1),i=Rc(l)): (t=Lc(l).subarray(0,16),(n=new Uint8Array(16)).set(t,16-t.length),i=n)}}return i} var Oc="undefined"!=typeof self?self:void 0,Pc="org.w3.clearkey",kc="com.apple.fps",Dc="com.microsoft.playready",xc="com.widevine.alpha",Nc="org.w3.clearkey",Mc="com.apple.streamingkeydelivery",Uc="com.microsoft.playready", Fc="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Bc(e){switch(e){case Mc:return kc;case Uc:return Dc;case Fc:return xc;case Nc:return Pc}} function Vc(e){switch(e){case kc:return Mc;case Dc:return Uc;case xc:return Fc;case Pc:return Nc}} function Hc(e){var t,n=e.drmSystems,r=e.widevineLicenseUrl,i=n?Oa(t=[kc,xc,Dc,Pc]).call(t,function(e){return!!n[e]}):[]; return!i[xc]&&r&&i.push(xc),i} var jc,Gc,Kc=null!=Oc&&null!=(jc=Oc.navigator)&&jc.requestMediaKeySystemAccess?l(Gc=self.navigator.requestMediaKeySystemAccess).call(Gc,self.navigator):null;function zc(e){var t=new Uint16Array(e.buffer, e.byteOffset,e.byteLength/2),n=String.fromCharCode.apply(null,ps(t)),r=n.substring(o(n).call(n,"\x3c"),n.length),i=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(i){var a= i.childNodes[0]?i.childNodes[0].nodeValue:i.getAttribute("VALUE");if(a){var s=Rc(a).subarray(0,16);return Ic(s),s}}return null} var Wc={},qc=function(){function e(e,t,n,r,i,o){void 0===r&&(r=[1]),void 0===i&&(i=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption= void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.size=1,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption= this.encrypted&&!wc(e),null!=o&&es(o).call(o,"0x")&&(this.keyId=new Uint8Array(nu(o)))} e.clearKeyUriToKeyIdMap=function(){Wc={}},e.setKeyIdForUri=function(e,t){Wc[e]=t}; var t=e.prototype;return t.matches=function(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&bc(e.keyFormatVersions,this.keyFormatVersions)&& Sc(e.iv,this.iv)&&Sc(e.keyId,this.keyId)},t.isSupported=function(){var e; if(this.method){if(wc(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case Mc:case Fc:case Uc:case Nc:return-1!==o(e=["SAMPLE-AES", "SAMPLE-AES-CENC","SAMPLE-AES-CTR"]).call(e,this.method)}}return!1},t.getDecryptData=function(t,n){if(!this.encrypted||!this.uri)return null; if(wc(this.method)){var r=this.iv;return r||("number"!=typeof t&&(Qs.warn('missing IV for initialization segment with method\x3d"'+this.method+'" - compliance issue'),t=0),r=function(e){for(var t=new Uint8Array(16), n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}(t)),new e(this.method,this.uri,"identity",this.keyFormatVersions,r)}if(this.keyId){var i=Wc[this.uri]; if(i&&!bc(this.keyId,i)&&e.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}var o,a=Cc(this.uri);if(a)switch(this.keyFormat){case Fc:if(this.pssh=a,!this.keyId){var s=function(e){var t=[];if(e instanceof ArrayBuffer)for(var n=e.byteLength,r=0;r+320&&(new DataView(o.buffer)).setUint32(0, n.byteLength,!1),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>24& 255,s[1]=o>>16&255,s[2]=o>>8&255,s[3]=255&o,s.set(e,4),a=0,o=8;a0&&o.length0&&c.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=c.optionalFloat("PART-HOLD-BACK",0),h.holdBack= c.optionalFloat("HOLD-BACK",0);break;case "PART-INF":h.partTarget&&cd(h,N,s);var J=new yc(M);h.partTarget=J.decimalFloatingPoint("PART-TARGET");break;case "PART":var $=h.partList;$||($=h.partList=[]);var ee= m>0?$[$.length-1]:void 0,te=m++,ne=new yc(M,h),re=new du(ne,S,d,te,ee);$.push(re),S.duration+=re.duration;break;case "PRELOAD-HINT":var ie=new yc(M,h);h.preloadHint=ie;break;case "RENDITION-REPORT":var oe= new yc(M,h);h.renditionReports=h.renditionReports||[],h.renditionReports.push(oe);break;default:Qs.warn("line parsed but not handled: "+s)}}}b&&!b.relurl?(p.pop(),_-=b.duration,h.partList&&(h.fragmentHint= b)):h.partList&&(sd(S,b,v),S.cc=E,h.fragmentHint=S,l&&ld(S,l,h)),h.targetduration||(h.playlistParsingError=new Error("Missing Target Duration"));var ae=p.length,se=p[0],ue=p[ae-1];if((_+=h.skippedSegments* h.targetduration)>0&&ae&&ue){h.averagetargetduration=_/ae;var le=ue.sn;h.endSN="initSegment"!==le?le:0,h.live||(ue.endList=!0),w>0&&(function(e,t){for(var n=e[t],r=t;r--;){var i=e[r];if(!i)return;i.programDateTime= n.programDateTime-1E3*i.duration,n=i}}(p,w),se&&v.unshift(se))}return h.fragmentHint&&(_+=h.fragmentHint.duration),h.totalduration=_,v.length&&h.dateRangeTagCount&&se&&td(v,h),h.endCC=E,h},e}(); function td(e,t){var n=e.length;if(!n){if(!t.hasProgramDateTime)return;var r=t.fragments[t.fragments.length-1];e.push(r),n++}for(var i=e[n-1],o=t.live?1/0:t.totalduration,a=Fa(t.dateRanges),s=a.length;s--;){var u= t.dateRanges[a[s]],l=u.startDate.getTime();u.tagAnchor=i.ref;for(var c=n;c--;){var d;if((null==(d=e[c])?void 0:d.sn)=s||0===r)&&t<=s+1E3*(((null==(a=n[r+1])?void 0:a.start)||i)-o.start)){var u=n[r].sn-e.startSN;if(u<0)return-1;var l=e.fragments; if(l.length>n.length)for(var c=(n[r+1]||l[l.length-1]).sn-e.startSN;c>u;c--){var d=l[c].programDateTime;if(t>=d&&te.sn?(i=n-e.start,r=e):(i=e.start-n,r=t),r.duration!==i&&r.setDuration(i)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS- e.start)):t.setStart(e.start+e.duration):t.setStart(Math.max(e.start-t.duration,0))} function fd(e,t,n,r,i,o,a){r-n<=0&&(a.warn("Fragment should have a positive duration",t),r=n+t.duration,o=i+t.duration);var s=n,u=r,l=t.startPTS,c=t.endPTS;if(Os(l)){var d=Math.abs(l-n);e&&d>e.totalduration? a.warn("media timestamps and playlist times differ by "+d+"s for level "+t.level+" "+e.url):Os(t.deltaPTS)?t.deltaPTS=Math.max(d,t.deltaPTS):t.deltaPTS=d,s=Math.max(n,l),n=Math.min(n,l),i=void 0!==t.startDTS? Math.min(i,t.startDTS):i,u=Math.min(r,c),r=Math.max(r,c),o=void 0!==t.endDTS?Math.max(o,t.endDTS):o}var h=n-t.start;0!==t.start&&t.setStart(n),t.setDuration(r-t.start),t.startPTS=n,t.maxStartPTS=s,t.startDTS= i,t.endPTS=r,t.minEndPTS=u,t.endDTS=o;var f,p=t.sn;if(!e||pe.endSN)return 0;var v=p-e.startSN,g=e.fragments;for(g[v]=t,f=v;f>0;f--)hd(g[f],g[f-1]);for(f=v;f=0,a=0;if(o&&rt){var i=1E3*r[r.length-1].duration;ie.startCC)}(t,e)){var n=Math.min(t.endCC,e.endCC),r=wd(t.fragments,n),i=wd(e.fragments,n); r&&i&&(Qs.log("Aligning playlist at start of dicontinuity sequence "+n),Rd(r.start-i.start,e))}} function Id(e,t){if(e.hasProgramDateTime&&t.hasProgramDateTime){var n=e.fragments,r=t.fragments;if(n.length&&r.length){var i,o,a=Math.min(t.endCC,e.endCC);t.startCCu.end){var f=s>h;(sa.lastCurrentTime&&(a.lastCurrentTime=s),!a.loadingParts)){var p= Math.max(u.end,s),v=a.shouldLoadParts(a.getLevelDetails(),p);v&&(a.log("LL-Part loading ON after seeking to "+s.toFixed(2)+" with buffer @"+p.toFixed(2)),a.loadingParts=v)}a.hls.hasEnoughToStart||(a.log("Setting "+ (l?"startPosition":"nextLoadPosition")+" to "+s+" for seek without enough to start"),a.nextLoadPosition=s,l&&(a.startPosition=s)),l&&a.state===kd&&a.tickImmediate()},a.onMediaEnded=function(){a.log("setting startPosition to 0 because media ended"), a.startPosition=a.lastCurrentTime=0},a.playlistType=o,a.hls=t,a.fragmentLoader=new nc(t.config),a.keyLoader=r,a.fragmentTracker=n,a.config=t.config,a.decrypter=new Jl(t.config),a} Ka(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ns.MANIFEST_LOADING, this.onManifestLoading,this),e.on(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ns.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls; e.off(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.MANIFEST_LOADED,this.onManifestLoaded, this),e.off(Ns.ERROR,this.onError,this)},n.doTick=function(){this.onTickEnd()},n.onTickEnd=function(){},n.startLoad=function(e){},n.stopLoad=function(){if(this.state!==Pd){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType); var e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(), this.state=Pd}},n.pauseBuffering=function(){this.buffering=!1},n.resumeBuffering=function(){this.buffering=!0},n._streamEnded=function(e,t){if(t.live||!this.media)return!1; var n=e.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;var i=e.buffered;this.config.maxBufferHole&&i&&i.length>1&&(e=lc.bufferedInfo(i,e.start,0));var o=e.nextStart;if(o&&o>r&&o0&&null!=o&&o.key&&o.iv&&wc(o.method)){var a=self.performance.now();return n.decrypter.decrypt(new Uint8Array(i),o.key.buffer,o.iv.buffer,Ac(o.method))["catch"](function(e){throw t.trigger(Ns.ERROR, {type:Ds.MEDIA_ERROR,details:xs.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:r}),e;}).then(function(i){var o=self.performance.now(); return t.trigger(Ns.FRAG_DECRYPTED,{frag:r,part:null,payload:i,stats:{tstart:a,tdecrypt:o}}),e.payload=i,n.completeInitSegmentLoad(e)})}return n.completeInitSegmentLoad(e)})["catch"](function(t){n.state!== Pd&&n.state!==Vd&&(n.warn(t),n.resetFragmentLoading(e))})},n.completeInitSegmentLoad=function(e){if(!this.levels)throw new Error("init load aborted, missing levels"); var t=e.frag.stats;this.state!==Pd&&(this.state=kd),e.frag.data=new Uint8Array(e.payload),t.parsing.start=t.buffering.start=self.performance.now(),t.parsing.end=t.buffering.end=self.performance.now(),this.tick()}, n.unhandledEncryptionError=function(e,t){var n,r; if(!this.config.emeEnabled)return!1;var i=e.tracks;if(i&&!t.encrypted&&(null!=(n=i.audio)&&n.encrypted||null!=(r=i.video)&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){var o= this.media,a=new Error("Encrypted track with no key in "+this.fragInfo(t)+" (media "+(o?"attached mediaKeys: "+o.mediaKeys:"detached")+")");return this.warn(a.message),!(!o||o.mediaKeys||(this.hls.trigger(Ns.ERROR, {type:Ds.KEY_SYSTEM_ERROR,details:xs.KEY_SYSTEM_NO_KEYS,fatal:!1,error:a,frag:t}),this.resetTransmuxer(),0))}return!1},n.fragContextChanged=function(e){var t=this.fragCurrent; return!e||!t||e.sn!==t.sn||e.level!==t.level},n.fragBufferedComplete=function(e,t){var n=this.mediaBuffer?this.mediaBuffer:this.media; if(this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+this.fragInfo(e,!1,t)+" \x3e buffer:"+(n?function(e){for(var t="",n=e.length,r=0;re.end&&s.fragmentHint&&(e=s.fragmentHint);var v=this.getNextPart(p,e,n);if(v>-1){var g, y=p[v],m=a!==y.fragment;return e=this.fragCurrent=y.fragment,this.log("Loading "+e.type+" sn: "+e.sn+" part: "+y.index+" ("+v+"/"+(p.length-1)+") of "+this.fragInfo(e,!1,y)+") cc: "+e.cc+" ["+s.startSN+ "-"+s.endSN+"], target: "+Ja(n.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=xd,u?(m?(this.log("Regenerate key requests for next part (from frag.sn\x3d"+a.sn+" -\x3e "+e.sn+")"),this.state= Dd,u=this.keyLoader.load(y.fragment).then(function(e){if(!o.fragContextChanged(e.frag))return o.hls.trigger(Ns.KEY_LOADED,e),o.state===Dd&&(o.state=kd),e}).then(function(e){return o.state=xd,e}),this.hls.trigger(Ns.KEY_LOADING, {frag:e})):this.state=xd,g=u.then(function(n){return!n||o.fragContextChanged(n.frag)?null:o.doFragPartsLoad(e,y,t,r)})["catch"](function(e){return o.handleFragLoadError(e)})):g=this.doFragPartsLoad(e,y, t,r)["catch"](function(e){return o.handleFragLoadError(e)}),this.hls.trigger(Ns.FRAG_LOADING,{frag:e, part:y,targetBufferTime:n}),null===this.fragCurrent?d.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}if(!e.url||this.loadedEndOfParts(p,n))return d.resolve(null)}}if(lu(e)&& this.loadingParts)this.log("LL-Part loading OFF after next part miss @"+n.toFixed(2)+" Check buffer at sn: "+e.sn+" loaded parts: "+(null==(l=s.partList)?void 0:Ma(c=Oa(l).call(l,function(e){return e.loaded})).call(c, function(e){return"["+e.start+"-"+e.end+"]"}))),this.loadingParts=!1; else if(!e.url)return d.resolve(null);this.log("Loading "+e.type+" sn: "+e.sn+" of "+this.fragInfo(e,!1)+") cc: "+e.cc+" ["+s.startSN+"-"+s.endSN+"], target: "+Ja(n.toFixed(3))),Os(e.sn)&&!this.bitrateTest&& (this.nextLoadPosition=e.start+e.duration),this.state=xd;var _,E=this.config.progressive;return _=E&&u?u.then(function(t){return!t||o.fragContextChanged(t.frag)?null:o.fragmentLoader.load(e,r)})["catch"](function(e){return o.handleFragLoadError(e)}): d.all([this.fragmentLoader.load(e,E?r:void 0), u]).then(function(e){var t=e[0];return!E&&r&&r(t),t})["catch"](function(e){return o.handleFragLoadError(e)}),this.hls.trigger(Ns.FRAG_LOADING,{frag:e, targetBufferTime:n}),null===this.fragCurrent?d.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):_},n.doFragPartsLoad=function(e,t,n,r){var i=this; return new d(function(o,a){var s,u=[],l=null==(s=n.details)?void 0:s.partList,c=function c(t){i.fragmentLoader.loadPart(e,t,r).then(function(r){u[t.index]=r;var a=r.part;i.hls.trigger(Ns.FRAG_LOADED,r); var s=_d(n.details,e.sn,t.index+1)||Ed(l,e.sn,t.index+1);if(!s)return o({frag:e,part:a,partsLoaded:u});c(s)})["catch"](a)}; c(t)})},n.handleFragLoadError=function(e){if("data"in e){var t=e.data; t.frag&&t.details===xs.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===Ds.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)): this.hls.trigger(Ns.ERROR,t)}else this.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR,details:xs.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null},n._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e); if(t&&this.state===Ud){var n=t.frag,r=t.part,i=t.level,o=self.performance.now();n.stats.parsing.end=o,r&&(r.stats.parsing.end=o);var a=this.getLevelDetails(),s=a&&n.sn>a.endSN||this.shouldLoadParts(a,n.end); s!==this.loadingParts&&(this.log("LL-Part loading "+(s?"ON":"OFF")+" after parsing segment ending @"+n.end.toFixed(2)),this.loadingParts=s),this.updateLevelTiming(n,r,i,e.partial)}else this.fragCurrent|| this.state===Pd||this.state===Vd||(this.state=kd)},n.shouldLoadParts=function(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts; if(e.partList){var n,r,i=e.partList[0];if(t>=i.end+((null==(n=e.fragmentHint)?void 0:n.duration)||0)&&(this.hls.hasEnoughToStart?(null==(r=this.media)?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())> i.start-i.fragment.duration)return!0}}return!1},n.getCurrentContext=function(e){var t=this.levels,n=this.fragCurrent,r=e.level,i=e.sn,o=e.part; if(null==t||!t[r])return this.warn("Levels object was unset while buffering fragment "+i+" of "+this.playlistLabel()+" "+r+". The current chunk will not be buffered."),null;var a=t[r],s=a.details,u=o>-1? _d(s,i,o):null,l=u?u.fragment:md(s,i,n);return l?(n&&n!==l&&(l.stats=n.stats),{frag:l,part:u,level:a}):null},n.bufferFragmentData=function(e,t,n,r,i){if(this.state===Ud){var o=e.data1,a=e.data2,s=o; if(a&&(s=Du(o,a)),s.length){var u=this.initPTS[t.cc],l=u?-u.baseTime/u.timescale:void 0,c={type:e.type,frag:t,part:n,chunkMeta:r,offset:l,parent:t.type,data:s};if(this.hls.trigger(Ns.BUFFER_APPENDING,c), e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}}},n.flushBufferGap=function(e){var t=this.media; if(t)if(lc.isBuffered(t,t.currentTime)){var n=t.currentTime,r=lc.bufferInfo(t,n,0),i=e.duration,o=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),a=Math.max(Math.min(e.start-o,r.end-o),n+o);e.start- a>o&&this.flushMainBuffer(a,e.start)}else this.flushMainBuffer(0,e.start)},n.getFwdBufferInfo=function(e,t){var n,r=this.getLoadPosition(); if(!Os(r))return null;var i=this.lastCurrentTime>r||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,i)},n.getFwdBufferInfoAtPos=function(e,t,n,r){var i= lc.bufferInfo(e,t,r); if(0===i.len&&void 0!==i.nextStart){var o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&(i.nextStart<=o.end||o.gap)){var a=Math.max(Math.min(i.nextStart,o.end)-t,r);return lc.bufferInfo(e,t,a)}}return i}, n.getMaxBufferLength=function(e){var t,n=this.config; return t=e?Math.max(8*n.maxBufferSize/e,n.maxBufferLength):n.maxBufferLength,Math.min(t,n.maxMaxBufferLength)},n.exceedsMaxBuffer=function(e,t,n){var r=e.nextStart; if(r&&n.start>r){var i=e.buffered;if(i){for(var o=e.len,a=e.bufferedIndex,s=i.length-1;s>a;s--)i[s].start=t}}return!1},n.reduceMaxBufferLength=function(e,t){var n= this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t),i=Math.max(e-3*t,n.maxMaxBufferLength/2,r); return i>=r&&(n.maxMaxBufferLength=i,this.warn("Reduce max buffer length to "+i+"s"),!0)},n.getAppendedFrag=function(e,t){void 0===t&&(t=Vs); var n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n},n.getNextFragment=function(e,t){var n=t.fragments,r=n.length; if(!r)return null;var i=this.config,o=n[0].start,a=i.lowLatencyMode&&!!t.partList,s=null;if(t.live){var u=i.initialLiveManifestSize;if(r=o?c:d)||s.start:e;this.startPosition==h&&this.nextLoadPosition==h||(this.log("Setting startPosition to "+ h+" to match start frag at live edge. mainStart: "+c+" liveSyncPosition: "+d+" frag.start: "+(null==(l=s)?void 0:l.start)),this.startPosition=this.nextLoadPosition=h)}}else e<=o&&(s=n[0]);if(!s){var f= this.loadingParts?t.partEnd:t.fragmentEnd;s=this.getFragmentAtPosition(e,f,t)}var p=this.filterReplacedPrimary(s,t);if(!p&&s){var v=s.sn-t.startSN;p=this.filterReplacedPrimary(n[v+1]||null,t)}return this.mapToInitFragWhenRequired(p)}, n.isLoopLoading=function(e,t){if(this.nextLoadPosition<=t)return!1; var n=this.fragmentTracker.getState(e);if(n===Kl)return!0;if(n===Gl){if(e.gap)return!0;if(e.stats.retry>1)return!0}return!1},n.getNextFragmentLoopLoading=function(e,t,n,r,i){var o=null; if(e.gap&&(o=this.getNextFragment(this.nextLoadPosition,t))&&!o.gap&&n.nextStart){var a=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(null!==a&&n.len+a.len>= i){var s=o.sn;return this.loopSn!==s&&(this.log('buffer full after gaps in "'+r+'" playlist starting at sn: '+s),this.loopSn=s),null}}return this.loopSn=void 0,o},n.filterReplacedPrimary=function(e,t){if(!e)return e; if(Kd(this.config)&&e.type!==js){var n=this.hls.interstitialsManager,r=null==n?void 0:n.bufferingItem;if(r){var i=r.event;if(i){if(i.appendInPlace||Math.abs(e.start-r.start)>1||0===r.start)return null}else{if(e.end<= r.start&&!1===(null==t?void 0:t.live))return null;if(e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}}var o=null==n?void 0:n.playerQueue;if(o)for(var a=o.length;a--;){var s= o[a].interstitial;if(s.appendInPlace&&e.start>=s.startTime&&e.end<=s.resumeTime)return null}}return e},n.mapToInitFragWhenRequired=function(e){return null==e||!e.initSegment||e.initSegment.data||this.bitrateTest? e:e.initSegment},n.getNextPart=function(e,t,n){for(var r=-1,i=!1,o=!0,a=0,s=e.length;a-1&&nn.start)return!0}return!1},n.getInitialLiveFragment=function(e){var t=e.fragments,n=this.fragPrevious,r=null; if(n){if(e.hasProgramDateTime&&(r=function(e,t,n){if(null===t||!Na(e)||!e.length||!Os(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;for(var r= 0;r=e.startSN&&i<=e.endSN){var o=t[i-e.startSN];n.cc===o.cc&&(r=o,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=Il(e,n.cc,n.end))&&this.log("Live playlist, switching playlist, load frag with same CC: "+ r.sn)}}else{var a=this.hls.liveSyncPosition;null!==a&&(r=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r},n.getFragmentAtPosition=function(e,t,n){var r,i,o=this.config,a= this.fragPrevious,s=n.fragments,u=n.endSN,l=n.fragmentHint,c=o.maxFragLookUpTolerance,d=n.partList,h=!!(this.loadingParts&&null!=d&&d.length&&l); if(h&&!this.bitrateTest&&d[d.length-1].fragment.sn===l.sn&&(s=ls(s).call(s,l),u=l.sn),r=et-c||null!=(i=this.media)&&i.paused||!this.startFragRequested?0:c):s[s.length- 1]){var f=r.sn-n.startSN,p=this.fragmentTracker.getState(r);if((p===Kl||p===Gl&&r.gap)&&(a=r),a&&r.sn===a.sn&&(!h||d[0].fragment.sn>r.sn||!n.live)&&r.level===a.level){var v=s[f+1];r=r.snMath.max(e.partHoldBack,3*e.partTarget)},n.setStartPosition=function(e,t){var n=this.startPosition; n=0&&(n=this.nextLoadPosition),n},n.handleFragLoadAborted=function(e,t){this.transmuxer&&e.type===this.playlistType&& lu(e)&&e.stats.aborted&&(this.log("Fragment "+e.sn+(t?" part "+t.index:"")+" of "+this.playlistLabel()+" "+e.level+" was aborted"),this.resetFragmentLoading(e))},n.resetFragmentLoading=function(e){this.fragCurrent&& (this.fragContextChanged(e)||this.state===Nd)||(this.state=kd)},n.onFragmentOrKeyLoadError=function(e,t){if(t.chunkMeta&&!t.frag){var n=this.getCurrentContext(t.chunkMeta); n&&(t.frag=n.frag)}var r=t.frag,i=t.part;if(r&&r.type===e&&this.levels)if(this.fragContextChanged(r)){var o;this.warn("Frag load error must match current frag to retry "+r.url+" \x3e "+(null==(o=this.fragCurrent)? void 0:o.url))}else{var a=t.details===xs.FRAG_GAP;a&&this.fragmentTracker.addAsGap(r);var s=t.errorAction;if(s){var u=s.action,l=ns(s),c=s.retryCount,d=void 0===c?0:c,h=s.retryConfig,f=!!h,p=f&&5===u,v= f&&!s.resolved&&1===l,g=this.hls.latestLevelDetails,y=null==g?void 0:g.live;if(!p&&v&&lu(r)&&y&&r.sn=t||n&&!Fl(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=kd)},n.reduceLengthAndFlushBuffer=function(e){if(this.state===Ud||this.state===Fd){var t=e.frag, n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5; i&&this.reduceMaxBufferLength(r.len,(null==t?void 0:t.duration)||10);var o=!i;return o&&this.warn("Buffer full error while media.currentTime ("+this.getLoadPosition()+") is not buffered, flush "+n+" buffer"), t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1},n.resetFragmentErrors=function(e){e===Hs&&(this.fragCurrent=null),this.hls.hasEnoughToStart|| (this.startFragRequested=!1),this.state!==Pd&&(this.state=kd)},n.afterBufferFlushed=function(e,t,n){if(e){var r=lc.getBuffered(e); this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===Bd&&this.resetLoadingState()}},n.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null, this.state!==Pd&&(this.state=kd)},n.resetStartWhenNotLoaded=function(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1; var e=this.levelLastLoaded,t=e?e.details:null;null!=t&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()): this.nextLoadPosition=this.startPosition}},n.resetWhenMissingContext=function(e){this.log("Loading context changed while buffering sn "+e.sn+" of "+this.playlistLabel()+" "+(-1===e.level?"\x3cremoved\x3e": e.level)+". This chunk will not be buffered."),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()},n.removeUnbufferedFrags=function(e){void 0===e&&(e=0),this.fragmentTracker.removeFragmentsInRange(e, 1/0,this.playlistType,!1,!0)},n.updateLevelTiming=function(e,t,n,r){var i,o=this,a=n.details; if(a){if(!ba(i=Fa(e.elementaryStreams)).call(i,function(t,i){var s=e.elementaryStreams[i];if(s){var u=s.endPTS-s.startPTS;if(u<=0)return o.warn("Could not parse fragment "+e.sn+" "+i+" duration reliably ("+ u+")"),t||!1;var l=r?0:fd(a,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS,o);return o.hls.trigger(Ns.LEVEL_PTS_UPDATED,{details:a,level:n,drift:l,type:i,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}, !1)){var s,u,l,c,d=null===(null==(s=this.transmuxer)?void 0:s.error),h=null!=(null==(u=this.transmuxer)?void 0:u.error),f=(null!=(l=null==(c=this.levels)?void 0:c.length)?l:0)>1; if((0===n.fragmentError||d&&(n.fragmentError<2||e.endList)||h&&f)&&this.treatAsGap(e,n),d){var p=new Error("Found no media in "+this.playlistLabel()+" "+e.level+" "+(t?"part: "+t.index+" of ":"")+"sn: "+ e.sn+" at playlist time: "+e.start+". Resetting transmuxer to fallback to playlist timing");if(this.warn(p.message),this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.FRAG_PARSING_ERROR,fatal:!1, error:p,frag:e,reason:"Found no media in msn "+e.sn+" of "+this.playlistLabel()+' "'+n.url+'"'}),!this.hls)return;this.resetTransmuxer()}}this.state=Fd,this.log("Parsed "+e.type+" sn: "+e.sn+(t?" part: "+ t.index:"")+" of "+this.fragInfo(e,!1,t)+")"),this.hls.trigger(Ns.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")},n.playlistLabel=function(){return this.playlistType===Vs?"level": "track"},n.fragInfo=function(e,t,n){var r,i; return void 0===t&&(t=!0),this.playlistLabel()+" "+e.level+" ("+(n?"part":"frag")+":["+(null!=(r=t&&!n?e.startPTS:(n||e).start)?r:NaN).toFixed(3)+"-"+(null!=(i=t&&!n?e.endPTS:(n||e).end)?i:NaN).toFixed(3)+ "]"+(n&&"main"===e.type?"INDEPENDENT\x3d"+(n.independent?"YES":"NO"):"")},n.treatAsGap=function(e,t){t&&t.fragmentError++,this.fragmentTracker.addAsGap(e)},n.resetTransmuxer=function(){var e; null==(e=this.transmuxer)||e.reset()},n.recoverWorkerError=function(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer= null),this.resetStartWhenNotLoaded(),this.resetLoadingState())},Ra(t,[{key:"startPositionValue", get:function get(){var e=this.nextLoadPosition,t=this.startPosition;return-1===t&&e?e:t}}, {key:"bufferingEnabled",get:function get(){return this.buffering}}, {key:"inFlightFrag",get:function get(){return{frag:this.fragCurrent,state:this.state}}}, {key:"timelineOffset",get:function get(){var e,t=this.config.timelineOffset;return t?(null==(e=this.getLevelDetails())?void 0:e.appliedTimelineOffset)||t:0}}, {key:"primaryPrefetch",get:function get(){var e;return!(!Kd(this.config)||!(null==(e=this.hls.interstitialsManager)||null==(e=e.playingItem)?void 0:e.event))}}, {key:"state",get:function get(){return this._state}, set:function set(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"-\x3e"+e))}}])}(ac); function Kd(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback} var zd=function(){function e(){this.chunks=[],this.dataLength=0} var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,n=this.dataLength; return t.length?(e=1===t.length?t[0]:function(e,t){for(var n=new Uint8Array(t),r=0,i=0;i>>5} function Qd(e,t){return t+1=e.length)return!1;var r=Xd(e,t);if(r<=n)return!1;var i=t+r;return i===e.length||Qd(e,i)}return!1} function $d(e,t,n,r,i){if(!e.samplerate){var o=function(e,t,n,r){var i=t[n+2],o=i>>2&15;if(!(o>12)){var a=1+(i>>6&3),s=t[n+3]>>6&3|(1&i)<<2,u="mp4a.40."+a,l=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050, 16E3,12E3,11025,8E3,7350][o],c=o;5!==a&&29!==a||(c-=3);var d=[a<<3|(14&c)>>1,(1&c)<<7|s<<3];return Qs.log("manifest codec:"+r+", parsed codec:"+u+", channels:"+s+", rate:"+l+" (ADTS object type:"+a+" sampling index:"+ o+")"),{config:d,samplerate:l,channelCount:s,codec:u,parsedCodec:u,manifestCodec:r}}var h=new Error("invalid ADTS sampling index:"+o);e.emit(Ns.ERROR,Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.FRAG_PARSING_ERROR, fatal:!0,error:h,reason:h.message})}(t,n,r,i); if(!o)return;Ya(e,o)}} function eh(e){return 9216E4/e} function th(e,t,n,r,i){var o,a=r+i*eh(e.samplerate),s=function(e,t){var n=Yd(e,t);if(t+n<=e.length){var r=Xd(e,t)-n;if(r>0)return{headerLength:n,frameLength:r}}}(t,n); if(s){var u=s.frameLength,l=s.headerLength,c=l+u,d=Math.max(0,n+c-t.length);d?(o=new Uint8Array(c-l)).set(t.subarray(n+l,t.length),0):o=t.subarray(n+l,n+c);var h={unit:o,pts:a};return d||e.samples.push(h), {sample:h,length:c,missing:d}}var f=t.length-n;return(o=new Uint8Array(f)).set(t.subarray(n,t.length),0),{sample:{unit:o,pts:a},length:f,missing:-1}} var nh=function(e){return e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3",e.misbklv="urn:misb:KLV:bin:1910.1",e}({}); function rh(e,t){return void 0===e&&(e=""),void 0===t&&(t=9E4),{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}} var ih=function ih(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},oh=function oh(e,t){return t+10<=e.length&&51=== e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},ah=function ah(e,t){for(var n=t,r=0;ih(e,t);)r+=10,r+=sh(e,t+6),oh(e,t+10)&&(r+=10),t+=r; if(r>0)return e.subarray(n,n+r)},sh=function sh(e,t){var n=0; return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,(n|=(127&e[t+2])<<7)|127&e[t+3]},uh=function uh(e,t){return ih(e,t)&&sh(e,t+6)+10<=e.length-t},lh=function lh(e){for(var t=hh(e),n=0;n> 4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:d+=String.fromCharCode(s);break;case 12:case 13:u=e[h++],d+=String.fromCharCode((31&s)<<6|63&u);break;case 14:u=e[h++],l=e[h++],d+=String.fromCharCode((15& s)<<12|(63&u)<<6|63&l)}}return d}; function _h(e){if(1===e[0]){if(255===e[1]&&254===e[2])return"utf-16le";if(254===e[1]&&255===e[2])return"utf-16be"}else{if(2===e[0])return"utf-16be";if(3===e[0])return"utf-8";if(e[0]>=32&&e[0]<=255)return"ISO-8859-1"; if(0===e[0])return"ISO-8859-1"}return"utf-8"} var Eh={},Th=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null} var t=e.prototype;return t.resetInitSegment=function(e,t,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9E4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS= e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,n){},t.demux=function(e,t){this.cachedData&& (e=Du(this.cachedData,e),this.cachedData=null); var n,r=ah(e,0),i=r?r.length:0,o=this._audioTrack,a=this._id3Track,s=r?lh(r):void 0,u=e.length;for((null===this.basePTS||0===this.frameIndex&&Os(s))&&(this.basePTS=bh(s,t,this.initPTS),this.lastPTS=this.basePTS), null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:nh.audioId3,duration:Number.POSITIVE_INFINITY});it.length)){var o= Ch(t,n);if(o&&n+o.frameLength<=t.length){var a=r+i*(9E4*o.samplesPerFrame/o.sampleRate),s={unit:t.subarray(n,n+o.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=o.channelCount,e.samplerate= o.sampleRate,e.samples.push(s),{sample:s,length:o.frameLength,missing:0}}}} function Ch(e,t){var n=e[t+1]>>3&3,r=e[t+1]>>1&3,i=e[t+2]>>4&15,o=e[t+2]>>2&3;if(1!==n&&0!==i&&15!==i&&3!==o){var a=e[t+2]>>1&1,s=e[t+3]>>6,u=1E3*wh[14*(3===n?3-r:3===r?3:4)+i-1],l=Ah[3*(3===n?0:2===n? 1:2)+o],c=3===s?1:2,d=Rh[n][r],h=Lh[r],f=8*d*h,p=Math.floor(d*u/l+a)*h;if(null===Sh){var v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Sh=v?Xa(v[1]):0}return!!Sh&&Sh<=87&&2===r&&u>=224E3&&0===s&& (e[t+3]=128|e[t+3]),{sampleRate:l,channelCount:c,frameLength:p,samplesPerFrame:f}}} function Oh(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))} function Ph(e,t){return t+10;){a[0]=e[t];var s=Math.min(r,8),u=8-s;o[0]=4278190080>>>24+u<>u,n=n?n<t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;var o=t[n+4]>>6;if(o>=3)return-1;var a=[48E3,44100,32E3][o],s=63&t[n+4],u=2*[64,69,96,64,70,96,80,87,120,80,88,120,96, 104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384, 418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393, 1920,1280,1394,1920][3*s+o];if(n+u>t.length)return-1;var l=t[n+6]>>5,c=0;2===l?c+=2:(1&l&&1!==l&&(c+=2),4&l&&(c+=2));var d=(t[n+6]<<8|t[n+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][l]+d,f=t[n+5]>>3,p=7&t[n+5],v=new Uint8Array([o<< 6|f<<1|p>>2,(3&p)<<6|l<<3|d<<2|s>>4,s<<4&224]),g=r+i*(1536/a*9E4),y=t.subarray(n,n+u);return e.config=v,e.channelCount=h,e.samplerate=a,e.samples.push({unit:y,pts:g}),u} var Uh=function(e){function t(){return e.apply(this,arguments)||this} Ka(t,e);var n=t.prototype;return n.resetInitSegment=function(t,n,r,i){e.prototype.resetInitSegment.call(this,t,n,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0, segmentCodec:"mp3",samples:[],manifestCodec:n,duration:i,inputTimeScale:9E4,dropped:0}},t.probe=function(e){if(!e)return!1; var t=ah(e,0),n=(null==t?void 0:t.length)||0;if(t&&11===e[n]&&119===e[n+1]&&void 0!==lh(t)&&xh(e,n)<=16)return!1;for(var r=e.length;n8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=r>1?n+r:t}return!1}(e)},t.demux=function(e,t){this.timeOffset=t; var n=e,r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Du(this.remainderData,e));var o=function(e){var t={valid:null,remainder:null},n=Su(e,["moof"]);if(n.length<2)return t.remainder= e,t;var r=n[n.length-1];return t.valid=Ea(e).call(e,0,r.byteOffset-8),t.remainder=Ea(e).call(e,r.byteOffset-8),t}(n); this.remainderData=o.remainder,r.samples=o.valid||new Uint8Array}else r.samples=n;var a=this.extractID3Track(r,t);return i.samples=xu(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}, t.flush=function(){var e=this.timeOffset,t=this.videoTrack,n=this.txtTrack; t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var r=this.extractID3Track(t,this.timeOffset);return n.samples=xu(e,t),{videoTrack:t,audioTrack:rh(),id3Track:r,textTrack:rh()}},t.extractID3Track= function(e,t){var n=this,r=this.id3Track; if(e.samples.length){var i=Su(e.samples,["emsg"]);i&&f(i).call(i,function(e){var i,o=function(e){var t=e[0],n="",r="",i=0,o=0,a=0,s=0,u=0,l=0;if(0===t){for(;"\x00"!==mu(e.subarray(l,l+1));)n+=mu(e.subarray(l, l+1)),l+=1;for(n+=mu(e.subarray(l,l+1)),l+=1;"\x00"!==mu(e.subarray(l,l+1));)r+=mu(e.subarray(l,l+1)),l+=1;r+=mu(e.subarray(l,l+1)),l+=1,i=Eu(e,12),o=Eu(e,16),s=Eu(e,20),u=Eu(e,24),l=28}else if(1===t){i= Eu(e,l+=4);var c=Eu(e,l+=4),d=Eu(e,l+=4);for(l+=4,a=Math.pow(2,32)*c+d,Ps(a)||(a=Ga,Qs.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),s=Eu(e,l), u=Eu(e,l+=4),l+=4;"\x00"!==mu(e.subarray(l,l+1));)n+=mu(e.subarray(l,l+1)),l+=1;for(n+=mu(e.subarray(l,l+1)),l+=1;"\x00"!==mu(e.subarray(l,l+1));)r+=mu(e.subarray(l,l+1)),l+=1;r+=mu(e.subarray(l,l+1)), l+=1}return{schemeIdUri:n,value:r,timeScale:i,presentationTime:a,presentationTimeDelta:o,eventDuration:s,id:u,payload:e.subarray(l,e.byteLength)}}(e); if(Fh.test(o.schemeIdUri)){var a=Vh(o,t),s=4294967295===o.eventDuration?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;s<=.001&&(s=Number.POSITIVE_INFINITY);var u=o.payload;r.samples.push({data:u, len:u.byteLength,dts:a,pts:a,type:nh.emsg,duration:s})}else if(n.config.enableEmsgKLVMetadata&&es(i=o.schemeIdUri).call(i,"urn:misb:KLV:bin:1910.1")){var l=Vh(o,t);r.samples.push({data:o.payload,len:o.payload.byteLength, dts:l,pts:l,type:nh.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r},t.demuxSampleAes=function(e,t,n){return d.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy= function(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0},e}(); function Vh(e,t){return Os(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale} var Hh=function(){function e(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Jl(t,{removePKCS7Padding:!1})} var t=e.prototype;return t.decryptBuffer=function(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,0)},t.decryptAacSample=function(e,t,n){var r,i=this,o=e[t].unit; if(!(o.length<=16)){var a=o.subarray(16,o.length-o.length%16),s=Ea(r=a.buffer).call(r,a.byteOffset,a.byteOffset+a.length);this.decryptBuffer(s).then(function(r){var a=new Uint8Array(r);o.set(a,16),i.decrypter.isSync()|| i.decryptAacSamples(e,t+1,n)})["catch"](n)}},t.decryptAacSamples=function(e,t,n){for(;;t++){if(t>=e.length)return void n(); if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,n),this.decrypter.isSync())))return}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t),r=0,i=32;i< e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r); return n},t.getAvcDecryptedUnit=function(e,t){for(var n=new Uint8Array(t),r=0,i=32;i=e.length)return void r();for(var i=e[t].units;!(n>=i.length);n++){var o=i[n];if(!(o.data.length<=48||1!==o.type&&5!==o.type||(this.decryptAvcSample(e,t,n,r,o),this.decrypter.isSync())))return}}}, e}(),jh=function(){function e(){this.VideoSample=null} var t=e.prototype;return t.createVideoSample=function(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}},t.getLastNalUnit=function(e){var t,n,r=this.VideoSample; if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){var i=r.units;n=i[i.length-1]}return n},t.pushAccessUnit=function(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var n=t.samples,r= n.length; if(!r)return void t.dropped++;var i=n[r-1];e.pts=i.pts,e.dts=i.dts}t.samples.push(e)}},t.parseNALu=function(e,t,n){var r,i,o=t.byteLength,a=e.naluState||0,s=a,u=[],l=0,c=-1,d=0; for(-1===a&&(c=0,d=this.getNALuType(t,0),a=0,l=1);l=0){var h={data:t.subarray(c,i),type:d};u.push(h)}else{var f=this.getLastNalUnit(e.samples);f&& (s&&l<=4-s&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-s)),i>0&&(f.data=Du(f.data,t.subarray(0,i)),f.state=0))}l=0&&a>=0){var p={data:t.subarray(c,o),type:d,state:a};u.push(p)}if(0===u.length){var v=this.getLastNalUnit(e.samples);v&&(v.data=Du(v.data,t))}return e.naluState=a,u},e}(),Gh=function(){function e(e){this.data= void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0} var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n, n+i)),this.word=(new DataView(r.buffer)).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},t.skipBits=function(e){var t; e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<= e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t; if(e>32&&Qs.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(t= e-t)>0&&this.bitsAvailable?n<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG= function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ(); return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG(); return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)}, e}(),Kh=function(e){function t(){return e.apply(this,arguments)||this} Ka(t,e);var n=t.prototype;return n.parsePES=function(e,t,n,r){var i,o=this,a=this.parseNALu(e,n.data,r),s=this.VideoSample,u=!1;n.data=null,s&&a.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample= this.createVideoSample(!1,n.pts,n.dts)),f(a).call(a,function(r){var a,l;switch(r.type){case 1:var c=!1;i=!0;var d,h=r.data;if(u&&h.length>4){var f=o.readSliceType(h);2!==f&&4!==f&&7!==f&&9!==f||(c=!0)}c&& null!=(d=s)&&d.frame&&!s.key&&(o.pushAccessUnit(s,e),s=o.VideoSample=null),s||(s=o.VideoSample=o.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=c;break;case 5:i=!0,null!=(a=s)&&a.frame&&!s.key&&(o.pushAccessUnit(s, e),s=o.VideoSample=null),s||(s=o.VideoSample=o.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:i=!0,Uu(r.data,1,n.pts,t.samples);break;case 7:var p,v;i=!0,u=!0;var g=r.data,y=o.readSPS(g); if(!e.sps||e.width!==y.width||e.height!==y.height||(null==(p=e.pixelRatio)?void 0:p[0])!==y.pixelRatio[0]||(null==(v=e.pixelRatio)?void 0:v[1])!==y.pixelRatio[1]){e.width=y.width,e.height=y.height,e.pixelRatio= y.pixelRatio,e.sps=[g];for(var m=g.subarray(1,4),_="avc1.",E=0;E<3;E++){var T=m[E].toString(16);T.length<2&&(T="0"+T),_+=T}e.codec=_}break;case 8:i=!0,e.pps=[r.data];break;case 9:i=!0,e.audFound=!0,null!= (l=s)&&l.frame&&(o.pushAccessUnit(s,e),s=null),s||(s=o.VideoSample=o.createVideoSample(!1,n.pts,n.dts));break;case 12:i=!0;break;default:i=!1}s&&i&&s.units.push(r)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample= null)},n.getNALuType=function(e,t){return 31&e[t]},n.readSliceType=function(e){var t=new Gh(e); return t.readUByte(),t.readUEG(),t.readUEG()},n.skipScalingList=function(e,t){for(var n=8,r=8,i=0;i>>1},n.ebsp2rbsp=function(e){for(var t=new Uint8Array(e.byteLength), n=0,r=0;r=2&&3===e[r]&&0===e[r-1]&&0===e[r-2]||(t[n]=e[r],n++); return new Uint8Array(t.buffer,0,n)},n.pushAccessUnit=function(t,n){e.prototype.pushAccessUnit.call(this,t,n),this.initVPS&&(this.initVPS=null)},n.readVPS=function(e){var t=new Gh(e); return t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6),{numTemporalLayers:t.readBits(3)+1,temporalIdNested:t.readBoolean()}},n.readSPS=function(e){var t=new Gh(this.ebsp2rbsp(e)); t.readUByte(),t.readUByte(),t.readBits(4);var n=t.readBits(3);t.readBoolean();for(var r=t.readBits(2),i=t.readBoolean(),o=t.readBits(5),a=t.readUByte(),s=t.readUByte(),u=t.readUByte(),l=t.readUByte(),c= t.readUByte(),d=t.readUByte(),h=t.readUByte(),f=t.readUByte(),p=t.readUByte(),v=t.readUByte(),g=t.readUByte(),y=[],m=[],_=0;_0)for(var E=n;E< 8;E++)t.readBits(2);for(var T=0;T1&&t.readEG();for(var U=0;U0&&oe<16?(ee=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][oe-1],te=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][oe-1]):255===oe&&(ee=t.readBits(16),te=t.readBits(16))}if(t.readBoolean()&& t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(), t.readBoolean(),t.readBoolean()&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(re=t.readBits(32),ie=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){var ae=t.readBoolean(), se=t.readBoolean(),ue=!1;(ae||se)&&((ue=t.readBoolean())&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),ue&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5)); for(var le=0;le<=n;le++){var ce=!1;(ne=t.readBoolean())||t.readBoolean()?t.readEG():ce=t.readBoolean();var de=ce?1:t.readUEG()+1;if(ae)for(var he=0;he>Te&1)<<31-Te)>>>0;var be=Ee.toString(16); return 1===o&&"2"===be&&(be="6"),{codecString:"hvc1."+me+o+"."+be+"."+(i?"H":"L")+g+".B0",params:{general_tier_flag:i,general_profile_idc:o,general_profile_space:r,general_profile_compatibility_flags:[a, s,u,l],general_constraint_indicator_flags:[c,d,h,f,p,v],general_level_idc:g,bit_depth:O+8,bit_depth_luma_minus8:O,bit_depth_chroma_minus8:P,min_spatial_segmentation_idc:$,chroma_format_idc:b,frame_rate:{fixed:ne, fps:ie/re}},width:pe,height:ve,pixelRatio:[ee,te]}},n.readPPS=function(e){var t=new Gh(this.ebsp2rbsp(e)); t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4); var n=t.readBoolean(),r=t.readBoolean(),i=1;return r&&n?i=0:r?i=3:n&&(i=2),{parallelismType:i}},n.matchSPS=function(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null, t).substr(3)},t}(jh),Wh=188,qh=function(){function e(e,t,n,r){this.logger=void 0,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._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0, this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null} e.probe=function(t,n){var r=e.syncOffset(t);return r>0&&n.warn("MPEG2-TS detected but first sync word found @ offset "+r),-1!==r},e.syncOffset=function(e){for(var t=e.length,n=Math.min(940,t-Wh)+1,r=0;r< n;){for(var i=!1,o=-1,a=0,s=r;s1&&(0===o&&a>2||s+Wh>n))return o}r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"=== e?"video/mp2t":void 0, type:e,id:yu[e],pid:-1,inputTimeScale:9E4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}; var t=e.prototype;return t.resetInitSegment=function(t,n,r,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=e.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=e.createTrack("audio", i),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=n,this.videoCodec= r},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._videoTrack,n=this._id3Track; e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null},t.demux=function(t,n,r,i){var o; void 0===r&&(r=!1),void 0===i&&(i=!1),r||(this.sampleAes=null);var a=this._videoTrack,s=this._audioTrack,u=this._id3Track,l=this._txtTrack,c=a.pid,d=a.pesData,h=s.pid,f=u.pid,p=s.pesData,v=u.pesData,g= null,y=this.pmtParsed,m=this._pmtId,_=t.length;if(this.remainderData&&(_=(t=Du(this.remainderData,t)).length,this.remainderData=null),_>4>1){if((A=b+5+t[b+4])===b+Wh)continue}else A=b+4;switch(w){case c:S&&(d&&(o=$h(d,this.logger))&&(this.readyVideoParser(a.segmentCodec),null!==this.videoParser&& this.videoParser.parsePES(a,l,o,!1)),d={data:[],size:0}),d&&(d.data.push(t.subarray(A,b+Wh)),d.size+=b+Wh-A);break;case h:if(S){if(p&&(o=$h(p,this.logger)))switch(s.segmentCodec){case "aac":this.parseAACPES(s, o);break;case "mp3":this.parseMPEGPES(s,o);break;case "ac3":this.parseAC3PES(s,o)}p={data:[],size:0}}p&&(p.data.push(t.subarray(A,b+Wh)),p.size+=b+Wh-A);break;case f:S&&(v&&(o=$h(v,this.logger))&&this.parseID3PES(u, o),v={data:[],size:0}),v&&(v.data.push(t.subarray(A,b+Wh)),v.size+=b+Wh-A);break;case 0:S&&(A+=t[A]+1),m=this._pmtId=Yh(t,A);break;case m:S&&(A+=t[A]+1);var R=Xh(t,A,this.typeSupported,r,this.observer, this.logger);(c=R.videoPid)>0&&(a.pid=c,a.segmentCodec=R.segmentVideoCodec),(h=R.audioPid)>0&&(s.pid=h,s.segmentCodec=R.segmentAudioCodec),(f=R.id3Pid)>0&&(u.pid=f),null===g||y||(this.logger.warn("MPEG-TS PMT found at "+ b+" after unknown PID '"+g+"'. Backtracking to sync byte @"+E+" to parse all TS packets."),g=null,b=E-188),y=this.pmtParsed=!0;break;case 17:case 8191:break;default:g=w}}else T++;T>0&&Qh(this.observer, new Error("Found "+T+" TS packet/s that do not start with 0x47"),void 0,this.logger),a.pesData=d,s.pesData=p,u.pesData=v;var L={audioTrack:s,videoTrack:a,id3Track:u,textTrack:l};return i&&this.extractRemainingSamples(L), L},t.flush=function(){var e,t=this.remainderData; return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes? this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,n=e.audioTrack,r=e.videoTrack,i=e.id3Track,o=e.textTrack,a=r.pesData,s=n.pesData,u=i.pesData; if(a&&(t=$h(a,this.logger))?(this.readyVideoParser(r.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(r,o,t,!0),r.pesData=null)):r.pesData=a,s&&(t=$h(s,this.logger))){switch(n.segmentCodec){case "aac":this.parseAACPES(n, t);break;case "mp3":this.parseMPEGPES(n,t);break;case "ac3":this.parseAC3PES(n,t)}n.pesData=null}else null!=s&&s.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData= s;u&&(t=$h(u,this.logger))?(this.parseID3PES(i,t),i.pesData=null):i.pesData=u},t.demuxSampleAes=function(e,t,n){var r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new Hh(this.observer,this.config, t); return this.decrypt(r,i)},t.readyVideoParser=function(e){null===this.videoParser&&("avc"===e?this.videoParser=new Kh:"hevc"===e&&(this.videoParser=new zh))},t.decrypt=function(e,t){return new d(function(n){var r= e.audioTrack,i=e.videoTrack; r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,function(){i.samples?t.decryptAvcSamples(i.samples,0,0,function(){n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,function(){n(e)})})}, t.destroy=function(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack= this._audioTrack=this._id3Track=this._txtTrack=void 0},t.parseAACPES=function(e,t){var n,r,i,o=0,a=this.aacOverFlow,s=t.data; if(a){this.aacOverFlow=null;var u=a.missing,l=a.sample.unit.byteLength;if(-1===u)s=Du(a.sample.unit,s);else{var c=l-u;a.sample.unit.set(s.subarray(0,u),c),e.samples.push(a.sample),o=a.missing}}for(n=o, r=s.length;n0;)s+=i;else this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS")},t.parseID3PES=function(e,t){if(void 0!==t.pts){var n=Ya({},t,{type:this._videoTrack? nh.emsg:nh.audioId3, duration:Number.POSITIVE_INFINITY});e.samples.push(n)}else this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},e}(); function Zh(e,t){return((31&e[t+1])<<8)+e[t+2]} function Yh(e,t){return(31&e[t+10])<<8|e[t+11]} function Xh(e,t,n,r,i,o){var a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t0)for(var c=t+5,d=l;d>2;){106=== e[c]&&(!0!==n.ac3?o.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=u,a.segmentAudioCodec="ac3"));var h=e[c+1]+2;c+=h,d-=h}break;case 194:case 135:return Qh(i,new Error("Unsupported EC-3 in M2TS found"), void 0,o),a;case 36:-1===a.videoPid&&(a.videoPid=u,a.segmentVideoCodec="hevc",o.log("HEVC in M2TS found"))}t+=l+5}return a} function Qh(e,t,n,r){r.warn("parsing error: "+t.message),e.emit(Ns.ERROR,Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})} function Jh(e,t){t.log(e+" with AES-128-CBC encryption found in unencrypted stream")} function $h(e,t){var n,r,i,o,a,u=0,l=e.data;if(!e||0===e.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=Du(l[0],l[1]),s(l).call(l,1,1);if(1===((n=l[0])[0]<<16)+(n[1]<<8)+n[2]){if((r=(n[4]<<8)+n[5])&& r>e.size-6)return null;var c=n[7];192&c&&(o=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&c?o-(a=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+ 128*(255&n[17])+(254&n[18])/2)>54E5&&(t.warn(Math.round((o-a)/9E4)+"s delta between PTS and DTS, align them"),o=a):a=o);var d=(i=n[8])+9;if(e.size<=d)return null;e.size-=d;for(var h=new Uint8Array(e.size), f=0,p=l.length;fv){d-=v;continue}n=n.subarray(d),v-=d,d=0}h.set(n,u),u+=v}return r&&(r-=i+3),{data:h,pts:o,dts:a,len:r}}return null} var ef=function(){function e(){} return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0, 200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4, 153,0,33,144,2,56]);if(6===t)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])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0, 0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128, 186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)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])}},e}(),tf=Math.pow(2,32)-1,nf=function(){function e(){} return e.init=function(){var t;for(t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[], dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&& (e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114, 0]),r=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]);e.HDLR_TYPES={video:n,audio:r};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0, 12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=o,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0, 0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,a,u,a,s),e.DINF=e.box(e.types.dinf, e.box(e.types.dref,i))},e.box=function(e){for(var t=8,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i>24&255,s[1]=t>>16&255,s[2]=t>>8&255,s[3]=255&t,s.set(e,4),o=0,t=8;o>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>> 24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale||0,t.duration||0),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0, 0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}, e.moof=function(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))},e.moov=function(t){for(var n,r,i=t.length,o=[];i--;)o[i]=e.trak(t[i]); return e.box.apply(null,ls(n=ls(r=[e.types.moov,e.mvhd(t[0].timescale||0,t[0].duration||0)]).call(r,o)).call(n,e.mvex(t)))},e.mvex=function(t){for(var n,r=t.length,i=[];r--;)i[r]=e.trex(t[r]); return e.box.apply(null,ls(n=[e.types.mvex]).call(n,i))},e.mvhd=function(t,n){n*=t; var r=Math.floor(n/(tf+1)),i=Math.floor(n%(tf+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255& i,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 e.box(e.types.mvhd,o)}, e.sdtp=function(t){var n,r,i=t.samples||[],o=new Uint8Array(4+i.length); for(n=0;n>>8&255),u.push(255&s),u=ls(u).call(u,Ea(Array.prototype).call(a));for(o=0;o>>8&255),l.push(255& s),l=ls(l).call(l,Ea(Array.prototype).call(a));var c=e.box(e.types.avcC,new Uint8Array(ls(n=ls(r=ls(i=[1,u[3],u[4],u[5],255,224|t.sps.length]).call(i,u)).call(r,[t.pps.length])).call(n,l))),d=t.width,h= t.height,f=t.pixelRatio[0],p=t.pixelRatio[1];return e.box(e.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,d>>8&255,255&d,h>>8&255,255&h,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]),c,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp, new Uint8Array([f>>24,f>>16&255,f>>8&255,255&f,p>>24,p>>16&255,p>>8&255,255&p])))},e.esds=function(e){var t,n=e.config; return new Uint8Array(ls(t=[0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2]).call(t,n,[6,1,2]))},e.audioStsd=function(e){var t=e.samplerate||0; return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,255&t,0,0])},e.mp4a=function(t){return e.box(e.types.mp4a,e.audioStsd(t),e.box(e.types.esds,e.esds(t)))}, e.mp3=function(t){return e.box(e.types[".mp3"],e.audioStsd(t))},e.ac3=function(t){return e.box(e.types["ac-3"],e.audioStsd(t),e.box(e.types.dac3,t.config))},e.stsd=function(t){var n=t.segmentCodec; if("audio"===t.type){if("aac"===n)return e.box(e.types.stsd,e.STSD,e.mp4a(t));if("ac3"===n&&t.config)return e.box(e.types.stsd,e.STSD,e.ac3(t));if("mp3"===n&&"mp3"===t.codec)return e.box(e.types.stsd,e.STSD, e.mp3(t))}else{if(!t.pps||!t.sps)throw new Error("video track missing pps or sps");if("avc"===n)return e.box(e.types.stsd,e.STSD,e.avc1(t));if("hevc"===n&&t.vps)return e.box(e.types.stsd,e.STSD,e.hvc1(t))}throw new Error("unsupported "+ t.type+" segment codec ("+n+"/"+t.codec+")");},e.tkhd=function(t){var n=t.id,r=(t.duration||0)*(t.timescale||0),i=t.width||0,o=t.height||0,a=Math.floor(r/(tf+1)),s=Math.floor(r%(tf+1)); return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s,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,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))},e.traf=function(t,n){var r=e.sdtp(t),i=t.id,o=Math.floor(n/(tf+1)),a= Math.floor(n%(tf+1)); return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255, 255&a])),e.trun(t,r.length+16+20+8+16+8+8),r)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var n=t.id; return e.box(e.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,n){var r,i,o,a,s,u,l=t.samples||[],c=l.length,d=12+16*c,h=new Uint8Array(d); for(n+=8+d,h.set(["video"===t.type?1:0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r>>24&255, o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,u>>>24& 255,u>>>16&255,u>>>8&255,255&u],12+16*r);return e.box(e.types.trun,h)},e.initSegment=function(t){e.types||e.init(); var n=e.moov(t);return Du(e.FTYP,n)},e.hvc1=function(t){for(var n=t.params,r=[t.vps, t.sps,t.pps],i=new Uint8Array([1,n.general_profile_space<<6|(n.general_tier_flag?32:0)|n.general_profile_idc,n.general_profile_compatibility_flags[0],n.general_profile_compatibility_flags[1],n.general_profile_compatibility_flags[2], n.general_profile_compatibility_flags[3],n.general_constraint_indicator_flags[0],n.general_constraint_indicator_flags[1],n.general_constraint_indicator_flags[2],n.general_constraint_indicator_flags[3], n.general_constraint_indicator_flags[4],n.general_constraint_indicator_flags[5],n.general_level_idc,240|n.min_spatial_segmentation_idc>>8,255&n.min_spatial_segmentation_idc,252|n.parallelismType,252|n.chroma_format_idc, 248|n.bit_depth_luma_minus8,248|n.bit_depth_chroma_minus8,0,Xa(n.frame_rate.fps),3|n.temporal_id_nested<<2|n.num_temporal_layers<<3|(n.frame_rate.fixed?64:0),r.length]),o=i.length,a=0;a>8,255&r[c][d].length]),o),o+=2,u.set(r[c][d],o),o+=r[c][d].length}var h=e.box(e.types.hvcC,u),f=t.width,p=t.height,v=t.pixelRatio[0], g=t.pixelRatio[1];return e.box(e.types.hvc1,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,f>>8&255,255&f,p>>8&255,255&p,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]),h,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([v>>24,v>>16& 255,v>>8&255,255&v,g>>24,g>>16&255,g>>8&255,255&g])))},e}(); function rf(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);var i=e*t*n;return r?Math.round(i):i} function of(e,t){return rf(e,1E3,1/9E4,t)} function af(e){var t=e.baseTime,n=e.timescale;return t/n+" ("+t+"/"+n+") trackId: "+e.trackId} nf.types=void 0,nf.HDLR_TYPES=void 0,nf.STTS=void 0,nf.STSC=void 0,nf.STCO=void 0,nf.STSZ=void 0,nf.VMHD=void 0,nf.SMHD=void 0,nf.STSD=void 0,nf.FTYP=void 0,nf.DINF=void 0;var sf=null,uf=null;function lf(e, t,n,r){return{duration:t,size:n,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}} var cf=function(e){function t(t,n,r,i){var o;if((o=e.call(this,"mp4-remuxer",i)||this).observer=void 0,o.config=void 0,o.typeSupported=void 0,o.ISGenerated=!1,o._initPTS=null,o._initDTS=null,o.nextVideoTs= null,o.nextAudioTs=null,o.videoSampleDuration=null,o.isAudioContiguous=!1,o.isVideoContiguous=!1,o.videoTrackConfig=void 0,o.observer=t,o.config=n,o.typeSupported=r,o.ISGenerated=!1,null===sf){var a=(navigator.userAgent|| "").match(/Chrome\/(\d+)/i);sf=a?Xa(a[1]):0}if(null===uf){var s=navigator.userAgent.match(/Safari\/(\d+)/i);uf=s?Xa(s[1]):0}return o} Ka(t,e);var n=t.prototype;return n.destroy=function(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null},n.resetTimeStamp=function(e){var t=this._initPTS; t&&e&&e.trackId===t.trackId&&e.baseTime===t.baseTime&&e.timescale===t.timescale||this.log("Reset initPTS: "+(t?af(t):t)+" \x3e "+(e?af(e):e)),this._initPTS=this._initDTS=e},n.resetNextTimestamp=function(){this.log("reset next timestamp"), this.isVideoContiguous=!1,this.isAudioContiguous=!1},n.resetInitSegment=function(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0},n.getVideoStartPts=function(e){var t= !1,n=e[0].pts,r=ba(e).call(e,function(e,r){var i=r.pts,o=i-e; return o<-4294967296&&(t=!0,o=(i=df(i,n))-e),o>0?e:i},n); return t&&this.debug("PTS rollover detected"),r},n.remux=function(e,t,n,r,i,o,a,s){var u,l,c,d,h,f,p=i,v=i,g=e.pid>-1,y=t.pid>-1,m=t.samples.length,_=e.samples.length>0,E=a&&m>0||m>1; if((!g||_)&&(!y||E)||this.ISGenerated||a){if(this.ISGenerated){var T,b,S,w,A=this.videoTrackConfig;(A&&(t.width!==A.width||t.height!==A.height||(null==(T=t.pixelRatio)?void 0:T[0])!==(null==(b=A.pixelRatio)? void 0:b[0])||(null==(S=t.pixelRatio)?void 0:S[1])!==(null==(w=A.pixelRatio)?void 0:w[1]))||!A&&E||null===this.nextAudioTs&&_)&&this.resetInitSegment()}this.ISGenerated||(c=this.generateIS(e,t,i,o));var R, L=this.isVideoContiguous,I=-1;if(E&&(I=function(e){for(var t=0;t0){var C; this.warn("Dropped "+I+" out of "+m+" video samples due to a missing keyframe");var O=this.getVideoStartPts(t.samples);t.samples=Ea(C=t.samples).call(C,I),t.dropped+=I,R=v+=(t.samples[0].pts-O)/t.inputTimeScale}else-1=== I&&(this.warn("No keyframe found out of "+m+" video samples"),f=!1);if(this.ISGenerated){if(_&&E){var P=this.getVideoStartPts(t.samples),k=(df(e.samples[0].pts,P)-P)/t.inputTimeScale;p+=Math.max(0,k),v+= Math.max(0,-k)}if(_){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),c=this.generateIS(e,t,i,o)),l=this.remuxAudio(e,p,this.isAudioContiguous,o,y||E||s===Hs?v:void 0),E){var D=l? l.endPTS-l.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),c=this.generateIS(e,t,i,o)),u=this.remuxVideo(t,v,L,D)}}else E&&(u=this.remuxVideo(t,v,L,0));u&&(u.firstKeyFrame= I,u.independent=-1!==I,u.firstKeyFramePTS=R)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=hf(n,i,this._initPTS,this._initDTS)),r.samples.length&&(d=ff(r,i,this._initPTS))), {audio:l,video:u,initSegment:c,independent:f,text:d,id3:h}},n.computeInitPts=function(e,t,n,r){var i=Math.round(n*t),o=df(e,i); if(o0?T- 1:T].dts&&(y=!0)}y&&ma(s).call(s,function(e,t){var n=e.dts-t.dts,r=e.pts-t.pts;return n||r}),i=s[0].dts; var S=s[s.length-1].dts-i,w=S?Math.round(S/(l-1)):p||e.inputTimeScale/30;if(n){var A=i-E,R=A>w,L=A<-1;if((R||L)&&(R?this.warn((e.segmentCodec||"").toUpperCase()+": "+of(A,!0)+" ms ("+A+"dts) hole between fragments detected at "+ t.toFixed(3)):this.warn((e.segmentCodec||"").toUpperCase()+": "+of(-A,!0)+" ms ("+A+"dts) overlapping between fragments detected at "+t.toFixed(3)),!L||E>=s[0].pts||sf)){i=E;var I=s[0].pts-A;if(R)s[0].dts= i,s[0].pts=I;else for(var C=!0,O=0;OI&&C);O++){var P=s[O].pts;if(s[O].dts-=A,s[O].pts-=A,O0?Q.dts-s[X-1].dts:w;if(oe=X>0?Q.pts-s[X-1].pts:w,ae.stretchShortVideoTrack&&null!==this.nextAudioTs){var ue= Math.floor(ae.maxBufferHole*a),le=(r?v+r*a:this.nextAudioTs+d)-Q.pts;le>ue?((p=le-se)<0?p=se:z=!0,this.log("It is approximately "+le/90+" ms to the next segment; using duration "+p/90+" ms for the last video frame.")): p=se}else p=se}var ce=Math.round(Q.pts-Q.dts);W=Math.min(W,p),Z=Math.max(Z,p),q=Math.min(q,oe),Y=Math.max(Y,oe),u.push(lf(Q.key,p,$,ce))}if(u.length)if(sf){if(sf<70){var de=ns(u[0]);de.dependsOn=2,de.isNonSync= 0}}else if(uf&&Y-q0&&(r&&Math.abs(_-(y+m))<9E3||Math.abs(df(v[0].pts,_)-(y+m))<20*l),f(v).call(v,function(e){e.pts=df(e.pts,_)}),!n||y<0){var E=v.length; if(v=Oa(v).call(v,function(e){return e.pts>=0}),E!==v.length&&this.warn("Removed "+(v.length-E)+" of "+E+" samples (initPTS "+m+" / "+o+")"),!v.length)return; y=0===i?0:r&&!p?Math.max(0,_-m):v[0].pts-m}if("aac"===e.segmentCodec)for(var T=this.config.maxAudioFramesDrift,b=0,S=y+m;b=T*l&&L<1E4&&p){var I=Math.round(R/l);for(S=A-I*l;S<0&&I&&l;)I--,S+= l;0===b&&(this.nextAudioTs=y=S-m),this.warn("Injecting "+I+" audio frames @ "+((S-m)/o).toFixed(3)+"s due to "+Math.round(1E3*R/o)+" ms gap.");for(var C=0;C0))return;x+=g;try{P=new Uint8Array(x)}catch(e){return void this.observer.emit(Ns.ERROR,Ns.ERROR,{type:Ds.MUX_ERROR,details:xs.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:x, reason:"fail allocating audio mdat "+x})}d||((new DataView(P.buffer)).setUint32(0,x),P.set(nf.types.mdat,4))}P.set(B,g);var H=B.byteLength;g+=H,h.push(lf(!0,u,H,0)),D=V}var j=h.length;if(j){var G=h[h.length- 1];y=D-m,this.nextAudioTs=y+a*G.duration;var K=d?new Uint8Array(0):nf.moof(e.sequenceNumber++,k/a,Ya({},e,{samples:h}));e.samples=[];var z=(k-m)/o,W=y/o,q={data1:K,data2:P,startPTS:z,endPTS:W,startDTS:z, endDTS:W,type:"audio",hasAudio:!0,hasVideo:!1,nb:j};return this.isAudioContiguous=!0,q}},t}(zs); function df(e,t){var n;if(null===t)return e;for(n=t4294967296;)e+=n;return e} function hf(e,t,n,r){var i=e.samples.length;if(i){for(var o=e.inputTimeScale,a=0;ai}(u,v,i,g)&&R===u.timescale||(u&&this.warn("Timestamps at playlist time: "+(o?"":"~")+i+" "+L/R+" !\x3d initPTS: "+u.baseTime/ u.timescale+" ("+u.baseTime+"/"+u.timescale+") trackId: "+u.trackId),this.log("Found initPTS at playlist time: "+i+" offset: "+(v-i)+" ("+L+"/"+R+") trackId: "+I),u=null,h.initPTS=L,h.timescale=R,h.trackId= I),u?(h.initPTS=u.baseTime,h.timescale=u.timescale,h.trackId=u.trackId):(h.timescale&&void 0!==h.trackId&&void 0!==h.initPTS||(this.warn("Could not set initPTS"),h.initPTS=v,h.timescale=1,h.trackId=-1), this.initPTS=u={baseTime:h.initPTS, timescale:h.timescale,trackId:h.trackId});var C=!!p.audio,O=!!p.video,P=v-u.baseTime/u.timescale,k=P+g,D=O&&void 0!==(null==A?void 0:A.ptsMin)?A.ptsMin/A.timescale-u.baseTime/u.timescale:P,x=O&&null!=A&& A.ptsMax?A.ptsMax/A.timescale-u.baseTime/u.timescale:k;g>0?this.lastEndTime=k:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var N="";C&&(N+="audio"),O&&(N+= "video");var M={data1:d,startPTS:D,startDTS:P,endPTS:x,endDTS:k,type:N,hasAudio:C,hasVideo:O,nb:1,dropped:0,encrypted:!!p.audio&&p.audio.encrypted||!!p.video&&p.video.encrypted};c.audio=C&&!O?M:void 0, c.video=O?M:void 0;var U=null==_?void 0:_.sampleCount;if(U){var F=_.keyFrameIndex,B=-1!==F;M.nb=U,M.dropped=0===F||this.isVideoContiguous?0:B?F:U,M.independent=B,M.firstKeyFrame=F,B&&_.keyFrameStart&&(M.firstKeyFramePTS= (_.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(c.independent=B),this.isVideoContiguous||(this.isVideoContiguous=B),M.dropped&&this.warn("fmp4 does not start with IDR: firstIDR "+F+"/"+ U+" dropped: "+M.dropped+" start: "+(M.firstKeyFramePTS||"NA"))}return c.initSegment=h,c.id3=hf(n,i,u,u),r.samples.length&&(c.text=ff(r,i,u)),c},t}(zs); function gf(e,t,n){return void 0===n&&(n=!1),void 0!==(null==e?void 0:e.start)?(e.start+(n?e.duration:0))/e.timescale:t} function yf(e,t,n){var r=e.codec;return r&&r.length>4?r:t===ou?"ec-3"===r||"ac-3"===r||"alac"===r?r:"fLaC"===r||"Opus"===r?Xu(r,!1):(n.warn('Unhandled audio codec "'+r+'" in mp4 MAP'),r||"mp4a"):(n.warn('Unhandled video codec "'+ r+'" in mp4 MAP'),r||"avc1")} try{var mf;pf=l(mf=self.performance.now).call(mf,self.performance)}catch(go){pf=hs}var _f=[{demux:Bh,remux:vf},{demux:qh,remux:cf},{demux:Dh,remux:cf},{demux:Uh,remux:cf}];s(_f).call(_f,2,0,{demux:Nh,remux:cf}); var Ef=function(){function e(e,t,n,r,i,o){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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.observer=e,this.typeSupported=t,this.config=n,this.id=i,this.logger= o} var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,n,r){var i=this,o=n.transmuxing; o.executeStart=pf();var a=new Uint8Array(e),s=this.currentTransmuxState,u=this.transmuxConfig;r&&(this.currentTransmuxState=r);var l=r||s,c=l.contiguous,d=l.discontinuity,h=l.trackSwitch,f=l.accurateTimeOffset, p=l.timeOffset,v=l.initSegmentChange,g=u.audioCodec,y=u.videoCodec,m=u.defaultInitPts,_=u.duration,E=u.initSegmentData,T=function(e,t){var n=null;return e.byteLength>0&&null!=(null==t?void 0:t.key)&&null!== t.iv&&null!=t.method&&(n=t),n}(a,t); if(T&&wc(T.method)){var b=this.getDecrypter(),S=Ac(T.method);if(!b.isSync())return this.asyncResult=!0,this.decryptionPromise=b.webCryptoDecrypt(a,T.key.buffer,T.iv.buffer,S).then(function(e){var t=i.push(e, null,n);return i.decryptionPromise=null,t}),this.decryptionPromise; var w=b.softwareDecrypt(a,T.key.buffer,T.iv.buffer,S);if(n.part>-1){var A=b.flush();w=A?A.buffer:A}if(!w)return o.executeEnd=pf(),Tf(n);a=new Uint8Array(w)}var R=this.needsProbing(d,h);if(R){var L=this.configureTransmuxer(a); if(L)return this.logger.warn("[transmuxer] "+L.message),this.observer.emit(Ns.ERROR,Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.FRAG_PARSING_ERROR,fatal:!1,error:L,reason:L.message}),o.executeEnd=pf(),Tf(n)}(d|| h||v||R)&&this.resetInitSegment(E,g,y,_,t),(d||v||R)&&this.resetInitialTimestamp(m),c||this.resetContiguity();var I=this.transmux(a,T,p,f,n);this.asyncResult=bf(I);var C=this.currentTransmuxState;return C.contiguous= !0,C.discontinuity=!1,C.trackSwitch=!1,o.executeEnd=pf(),I},t.flush=function(e){var t=this,n=e.transmuxing; n.executeStart=pf();var r=this.decrypter,i=this.currentTransmuxState,o=this.decryptionPromise;if(o)return this.asyncResult=!0,o.then(function(){return t.flush(e)}); var a=[],s=i.timeOffset;if(r){var u=r.flush();u&&a.push(this.push(u.buffer,null,e))}var l=this.demuxer,c=this.remuxer;if(!l||!c){n.executeEnd=pf();var h=[Tf(e)];return this.asyncResult?d.resolve(h):h}var f= l.flush(s);return bf(f)?(this.asyncResult=!0,f.then(function(n){return t.flushRemux(a,n,e),a})):(this.flushRemux(a,f,e),this.asyncResult?d.resolve(a):a)},t.flushRemux=function(e,t,n){var r=t.audioTrack, i=t.videoTrack,o=t.id3Track,a=t.textTrack,s=this.currentTransmuxState,u=s.accurateTimeOffset,l=s.timeOffset; this.logger.log("[transmuxer.ts]: Flushed "+this.id+" sn: "+n.sn+(n.part>-1?" part: "+n.part:"")+" of "+(this.id===Vs?"level":"track")+" "+n.level);var c=this.remuxer.remux(r,i,o,a,l,u,!0,this.id);e.push({remuxResult:c, chunkMeta:n}),n.transmuxing.executeEnd=pf()},t.resetInitialTimestamp=function(e){var t=this.demuxer,n=this.remuxer; t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer; e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,n,r,i){var o=this.demuxer,a=this.remuxer; o&&a&&(o.resetInitSegment(e,t,n,r),a.resetInitSegment(e,t,n,i))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}, t.transmux=function(e,t,n,r,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i)},t.transmuxUnencrypted=function(e,t,n,r){var i=this.demuxer.demux(e, t,!1,!this.config.progressive),o=i.audioTrack,a=i.videoTrack,s=i.id3Track,u=i.textTrack; return{remuxResult:this.remuxer.remux(o,a,s,u,t,n,!1,this.id),chunkMeta:r}},t.transmuxSampleAes=function(e,t,n,r,i){var o=this; return this.demuxer.demuxSampleAes(e,t,n).then(function(e){return{remuxResult:o.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,o.id),chunkMeta:i}})},t.configureTransmuxer=function(e){for(var t, n=this.config,r=this.observer,i=this.typeSupported,o=0,a=_f.length;o1&&u.id===(null==y?void 0:y.stats.chunkCount),S=!_&&(1===E||0===E&&(1===T||b&&T<=0)),w=self.performance.now();(_||E||0===i.stats.parsing.start)&&(i.stats.parsing.start= w),!o||!T&&S||(o.stats.parsing.start=w);var A=!(y&&(null==(c=i.initSegment)?void 0:c.url)===(null==(d=y.initSegment)?void 0:d.url)),R=new wf(m,S,s,_,v,A);if(!S||m||A){this.hls.logger.log("[transmuxer-interface]: Starting new transmux session for "+ i.type+" sn: "+u.sn+(u.part>-1?" part: "+u.part:"")+" "+(this.id===Vs?"level":"track")+": "+u.level+" id: "+u.id+"\n discontinuity: "+m+"\n trackSwitch: "+_+"\n contiguous: "+S+"\n accurateTimeOffset: "+ s+"\n timeOffset: "+v+"\n initSegmentChange: "+A);var L=new Sf(n,r,t,a,l);this.configureTransmuxer(L)}if(this.frag=i,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:f, cmd:"demux",data:e,decryptdata:g,chunkMeta:u,state:R},e instanceof ArrayBuffer?[e]:[]);else if(p){var I=p.push(e,g,u,R);bf(I)?I.then(function(e){h.handleTransmuxComplete(e)})["catch"](function(e){h.transmuxerError(e, u,"transmuxer-interface push error")}):this.handleTransmuxComplete(I)}},t.flush=function(e){var t=this; e.transmuxing.start=self.performance.now();var n=this.instanceNo,r=this.transmuxer;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:n,cmd:"flush",chunkMeta:e});else if(r){var i=r.flush(e); bf(i)?i.then(function(n){t.handleFlushResult(n,e)})["catch"](function(n){t.transmuxerError(n,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}},t.transmuxerError=function(e,t,n){this.hls&& (this.error=e,this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR, details:xs.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))},t.handleFlushResult=function(e,t){var n=this; f(e).call(e,function(e){n.handleTransmuxComplete(e)}),this.onFlush(t)},t.configureTransmuxer=function(e){var t=this.instanceNo,n=this.transmuxer; this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(), this.onTransmuxComplete(e)},e}(); function Lf(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function If(e){for(var t=1;t=0?this.nextLoadPosition:e.prototype.getLoadPosition.call(this)},n.syncWithAnchor=function(e, t){var n,r=(null==(n=this.mainFragLoading)?void 0:n.frag)||null; if(!t||(null==r?void 0:r.cc)!==t.cc){var i=(r||e).cc,o=Il(this.getLevelDetails(),i,this.getLoadPosition());o&&(this.log("Syncing with main frag at "+o.start+" cc "+o.cc),this.startFragRequested=!1,this.nextLoadPosition= o.start,this.resetLoadingState(),this.state===kd&&this.doTickIdle())}},n.startLoad=function(e,t){if(!this.levels)return this.startPosition=e,void(this.state=Pd); var n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+n.toFixed(3)),e=n,this.state=kd):this.state=Md,this.nextLoadPosition= this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()},n.doTick=function(){switch(this.state){case kd:this.doTickIdle(); break;case Md:var t=this.levels,n=this.trackId,r=null==t?void 0:t[n],i=null==r?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=Hd}break;case Nd:this.checkRetryDate(); break;case Hd:var o=this.waitingData;if(o){var a=o.frag,s=o.part,u=o.cache,l=o.complete,c=this.mainAnchor;if(void 0!==this.initPTS[a.cc]){this.waitingData=null,this.state=xd;var d={frag:a,part:s,payload:u.flush().buffer, networkDetails:null};this._handleFragmentLoadProgress(d),l&&e.prototype._handleFragmentLoadComplete.call(this,d)}else c&&c.cc!==o.frag.cc&&this.syncWithAnchor(c,o.frag)}else this.state=kd}this.onTickEnd()}, n.resetLoadingState=function(){var t=this.waitingData; t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),e.prototype.resetLoadingState.call(this)},n.onTickEnd=function(){var e=this.media; null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)},n.doTickIdle=function(){var e,t=this.hls,n=this.levels,r=this.media,i=this.trackId,o=t.config; if(this.buffering&&(r||this.primaryPrefetch||!this.startFragRequested&&o.startFragPrefetch)&&null!=n&&n[i]){var a=n[i],s=a.details;if(!s||this.waitForLive(a)||this.waitForCdnTuneIn(s))return this.state= Md,void(this.startFragRequested=!1);var u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,ou,Hs));var l=this.getFwdBufferInfo(u,Hs); if(null!==l){if(!this.switchingTrack&&this._streamEnded(l,s))return t.trigger(Ns.BUFFER_EOS,{type:"audio"}),void(this.state=Bd);var c=l.len,d=t.maxBufferLength,h=s.fragments,f=h[0].start,p=this.getLoadPosition(), v=this.flushing?p:l.end;if(this.switchingTrack&&r){var g=p;s.PTSKnown&&gf||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=f+.05)}if(!(c>= d&&!this.switchingTrack&&vm.end){var _=this.fragmentTracker.getFragAtPos(v,Vs);_&&_.end>m.end&&(m=_,this.mainFragLoading={frag:_,targetBufferTime:null})}if(y.start>m.end)return}this.loadFragment(y, a,v)}}else this.bufferFlushed=!0}}}},n.onMediaDetaching=function(t,n){this.bufferFlushed=this.flushing=!1,e.prototype.onMediaDetaching.call(this,t,n)},n.onAudioTracksUpdated=function(e,t){var n=t.audioTracks; this.resetTransmuxer(),this.levels=Ma(n).call(n,function(e){return new hl(e)})},n.onAudioTrackSwitching=function(e,t){var n=!!t.url; this.trackId=t.id;var r=this.fragCurrent;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==Pd&&(this.setInterval(100), this.state=kd,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())},n.onManifestLoading=function(){e.prototype.onManifestLoading.call(this),this.bufferFlushed= this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1},n.onLevelLoaded=function(e,t){this.mainDetails=t.details; var n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(Ns.AUDIO_TRACK_LOADED,n))},n.onAudioTrackLoaded=function(e,t){var n,r=this.levels,i=t.details,o=t.id,a=t.groupId, s=t.track; if(r){var u=this.mainDetails;if(!u||i.endCC>u.endCC||u.expired)return this.cachedTrackLoadedData=t,void(this.state!==Pd&&(this.state=Md));this.cachedTrackLoadedData=null,this.log("Audio track "+o+' "'+ s.name+'" of "'+a+'" loaded ['+i.startSN+","+i.endSN+"]"+(i.lastPartSn?"[part-"+i.lastPartSn+"-"+i.lastPartIndex+"]":"")+",duration:"+i.totalduration);var l=r[o],c=0;if(i.live||null!=(n=l.details)&&n.live){if(this.checkLiveUpdate(i), i.deltaUpdateFailed)return;var d;l.details&&(c=this.alignPlaylists(i,l.details,null==(d=this.levelLastLoaded)?void 0:d.details)),i.alignedSliding||(Ld(i,u),i.alignedSliding||Id(i,u),c=i.fragmentStart)}l.details= i,this.levelLastLoaded=l,this.startFragRequested||this.setStartPosition(u,c),this.hls.trigger(Ns.AUDIO_TRACK_UPDATED,{details:i,id:o,groupId:t.groupId}),this.state!==Md||this.waitForCdnTuneIn(i)||(this.state= kd),this.tick()}else this.warn("Audio tracks reset while loading track "+o+' "'+s.name+'" of "'+a+'"')},n._handleFragmentLoadProgress=function(e){var t,n=e.frag,r=e.part,i=e.payload,o=this.config,a=this.trackId, s=this.levels; if(s){var u=s[a];if(u){var c=u.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);var d,h,f=o.defaultAudioCodec||u.audioCodec|| "mp4a.40.2",p=this.transmuxer;p||(p=this.transmuxer=new Rf(this.hls,Hs,l(d=this._handleTransmuxComplete).call(d,this),l(h=this._handleTransmuxerFlush).call(h,this)));var v=this.initPTS[n.cc],g=null==(t= n.initSegment)?void 0:t.data;if(void 0!==v){var y=r?r.index:-1,m=-1!==y,_=new sc(n.level,n.sn,n.stats.chunkCount,i.byteLength,y,m);p.push(i,g,f,"",n,r,c.totalduration,!1,_,v)}else this.log("Unknown video PTS for cc "+ n.cc+", waiting for video PTS before demuxing audio frag "+n.sn+" of ["+c.startSN+" ,"+c.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:n,part:r,cache:new zd,complete:!1}).cache.push(new Uint8Array(i)), this.state!==Pd&&(this.state=Hd)}else this.warn("Audio track is undefined on fragment load progress")}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+n.sn+" of level "+ n.level+" will not be buffered")},n._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},n.onBufferReset=function(){this.mediaBuffer= null},n.onBufferCreated=function(e,t){this.bufferFlushed=this.flushing=!1; var n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)},n.onFragLoading=function(e,t){!this.audioOnly&&t.frag.type===Vs&&lu(t.frag)&&(this.mainFragLoading=t,this.state===kd&&this.tick())},n.onFragBuffered= function(e,t){var n=t.frag,r=t.part; if(n.type===Hs)if(this.fragContextChanged(n))this.warn("Fragment "+n.sn+(r?" p: "+r.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+(this.switchingTrack? this.switchingTrack.name:"false"));else{if(lu(n)){this.fragPrevious=n;var i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(Ns.AUDIO_TRACK_SWITCHED,If({},i)))}this.fragBufferedComplete(n, r),this.media&&this.tick()}else this.audioOnly||n.type!==Vs||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)},n.onError=function(t,n){var r; if(n.fatal)this.state=Vd;else switch(n.details){case xs.FRAG_GAP:case xs.FRAG_PARSING_ERROR:case xs.FRAG_DECRYPT_ERROR:case xs.FRAG_LOAD_ERROR:case xs.FRAG_LOAD_TIMEOUT:case xs.KEY_LOAD_ERROR:case xs.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Hs, n);break;case xs.AUDIO_TRACK_LOAD_ERROR:case xs.AUDIO_TRACK_LOAD_TIMEOUT:case xs.LEVEL_PARSING_ERROR:n.levelRetry||this.state!==Md||(null==(r=n.context)?void 0:r.type)!==Fs||(this.state=kd);break;case xs.BUFFER_ADD_CODEC_ERROR:case xs.BUFFER_APPEND_ERROR:if("audio"!== n.parent)return;this.reduceLengthAndFlushBuffer(n)||this.resetLoadingState();break;case xs.BUFFER_FULL_ERROR:if("audio"!==n.parent)return;this.reduceLengthAndFlushBuffer(n)&&(this.bufferedTrack=null,e.prototype.flushMainBuffer.call(this, 0,Number.POSITIVE_INFINITY,"audio"));break;case xs.INTERNAL_EXCEPTION:this.recoverWorkerError(n)}},n.onBufferFlushing=function(e,t){t.type!==au&&(this.flushing=!0)},n.onBufferFlushed=function(e,t){var n= t.type; if(n!==au){this.flushing=!1,this.bufferFlushed=!0,this.state===Bd&&(this.state=kd);var r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,n,Hs),this.tick())}},n._handleTransmuxComplete=function(e){var t, n="audio",r=this.hls,i=e.remuxResult,o=e.chunkMeta,a=this.getCurrentContext(o); if(a){var s=a.frag,u=a.part,l=a.level,c=l.details,d=i.audio,h=i.text,f=i.id3,p=i.initSegment;if(this.fragContextChanged(s)||!c)return this.fragmentTracker.removeFragment(s),void(null!=p&&p.tracks&&this.resetTransmuxer()); if(this.state=Ud,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){var v=s.initSegment||s;if(this.unhandledEncryptionError(p,s))return;this._bufferInitSegment(l,p.tracks, v,o),r.trigger(Ns.FRAG_PARSING_INIT_SEGMENT,{frag:v,id:n,tracks:p.tracks})}if(d){var g=d.startPTS,y=d.endPTS,m=d.startDTS,_=d.endDTS;u&&(u.elementaryStreams[ou]={startPTS:g,endPTS:y,startDTS:m,endDTS:_}), s.setElementaryStreamInfo(ou,g,y,m,_),this.bufferFragmentData(d,s,u,o)}if(null!=f&&null!=(t=f.samples)&&t.length){var E=Ya({id:n,frag:s,details:c},f);r.trigger(Ns.FRAG_PARSING_METADATA,E)}if(h){var T=Ya({id:n, frag:s,details:c},h);r.trigger(Ns.FRAG_PARSING_USERDATA,T)}}else this.resetWhenMissingContext(o)},n._bufferInitSegment=function(e,t,n,r){if(this.state===Ud&&(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo, t.audio)){var i=t.audio; i.id=Hs;var o=e.audioCodec;this.log("Init audio buffer, container:"+i.container+", codecs[level/parsed]\x3d["+o+"/"+i.codec+"]"),o&&1===o.split(",").length&&(i.levelCodec=o),this.hls.trigger(Ns.BUFFER_CODECS, t);var a=i.initSegment;if(null!=a&&a.byteLength){var s={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:a};this.hls.trigger(Ns.BUFFER_APPENDING,s)}this.tickImmediate()}},n.loadFragment=function(t, n,r){var i,o=this.fragmentTracker.getState(t); if(this.switchingTrack||o===Hl||o===Gl)if(lu(t))if(null!=(i=n.details)&&i.live&&!this.initPTS[t.cc]){this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+ t.sn+" of level "+this.trackId),this.state=Hd;var a=this.mainDetails;a&&a.fragmentStart!==n.details.fragmentStart&&Id(n.details,a)}else e.prototype.loadFragment.call(this,t,n,r);else this._loadInitSegment(t, n);else this.clearTrackerIfNeeded(t)},n.flushAudioIfNeeded=function(t){if(this.media&&this.bufferedTrack){var n=this.bufferedTrack; _l({name:n.name,lang:n.lang,assocLang:n.assocLang,characteristics:n.characteristics,audioCodec:n.audioCodec,channels:n.channels},t,El)||(bl(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"), e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}},n.completeAudioSwitch=function(e){var t=this.hls; this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(Ns.AUDIO_TRACK_SWITCHED,If({},e))},t}(Gd),Of=function(e){function t(t,n){var r; return(r=e.call(this,n,t.logger)||this).hls=void 0,r.canLoad=!1,r.timer=-1,r.hls=t,r} Ka(t,e);var n=t.prototype;return n.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},n.clearTimer=function(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)},n.startLoad= function(){this.canLoad=!0,this.loadPlaylist()},n.stopLoad=function(){this.canLoad=!1,this.clearTimer()},n.switchParams=function(e,t,n){var r=null==t?void 0:t.renditionReports; if(r){for(var i=-1,o=0;o=0&&d>t.partTarget&&(c+=1)}var h=n&&cl(n);return new dl(l,c>=0?c:void 0,h)}}},n.loadPlaylist=function(e){this.clearTimer()},n.loadingPlaylist=function(e,t){this.clearTimer()},n.shouldLoadPlaylist=function(e){return this.canLoad&& !!e&&!!e.url&&(!e.details||e.details.live)},n.getUrlWithDirectives=function(e,t){if(t)try{return t.addDirectives(e)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}return e}, n.playlistLoaded=function(e,t,n){var r=t.details,i=t.stats,o=self.performance.now(),a=i.loading.first?Math.max(0,o-i.loading.first):0; r.advancedDateTime=hs()-a;var s=this.hls.config.timelineOffset;if(s!==r.appliedTimelineOffset){var u,l=Math.max(s||0,0);r.appliedTimelineOffset=l,f(u=r.fragments).call(u,function(e){e.setStart(e.playlistOffset+ l)})}if(r.live||null!=n&&n.live){var c="levelInfo"in t?t.levelInfo:t.track; if(r.reloaded(n),n&&r.fragments.length>0){!function(e,t,n){if(e!==t){for(var r,i=null,o=e.fragments,a=o.length-1;a>=0;a--){var s=o[a].initSegment;if(s){i=s;break}}e.fragmentHint&&delete e.fragmentHint.endPTS, function(e,t,n){for(var r,i,o,a=t.skippedSegments,s=Math.max(e.startSN,t.startSN)-t.startSN,u=(e.fragmentHint?1:0)+(a?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,l=t.startSN-e.startSN,c=t.fragmentHint? ls(r=t.fragments).call(r,t.fragmentHint):t.fragments,d=null!=(i=e.fragmentHint)&&i.duration?ls(o=e.fragments).call(o,e.fragmentHint):e.fragments,h=s;h<=u;h++){var f=d[l+h],p=c[h];if(a&&!p&&f&&(p=t.fragments[h]= f),f&&p){n(f,p,h,c);var v=f.relurl,g=p.relurl;if(v&&bd(v,g))return void(t.playlistParsingError=pd("media sequence mismatch "+p.sn+":",e,t,0,p));if(f.cc!==p.cc)return void(t.playlistParsingError=pd("discontinuity sequence mismatch ("+ f.cc+"!\x3d"+p.cc+")",e,t,0,p))}}}(e,t,function(e,n,o,a){if((!t.startCC||t.skippedSegments)&&n.cc!==e.cc){for(var s=e.cc-n.cc,u=o;u0){if(I>3* r.targetduration)this.log("Playlist last advanced "+L.toFixed(2)+"s ago. Omitting segment and part directives."),E=void 0,T=void 0;else if(null!=n&&n.tuneInGoal&&I-r.partTarget>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+ n.tuneInGoal+" to: "+C+" with playlist age: "+r.age),C=0;else{var O=Math.floor(C/r.targetduration);E+=O,void 0!==T&&(T+=Math.round(C%r.targetduration/r.partTarget)),this.log("CDN Tune-in age: "+r.ageHeader+ "s last advanced "+L.toFixed(2)+"s goal: "+C+" skip sn "+O+" to part "+T)}r.tuneInGoal=C}if(g=this.getDeliveryDirectives(r,t.deliveryDirectives,E,T),b||!R)return r.requestScheduled=o,void this.loadingPlaylist(c, g)}else(r.canBlockReload||r.canSkipUntil)&&(g=this.getDeliveryDirectives(r,t.deliveryDirectives,E,T));g&&void 0!==E&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(_-2*a,_/2)),this.scheduleLoading(c, g,r)}else this.clearTimer()},n.scheduleLoading=function(e,t,n){var r=this,i=n||e.details; if(i){var o=self.performance.now(),a=i.requestScheduled;if(o>=a)this.loadingPlaylist(e,t);else{var s=a-o;this.log("reload live playlist "+(e.name||e.bitrate+"bps")+" in "+Math.round(s)+" ms"),this.clearTimer(), this.timer=T(function(){return r.loadingPlaylist(e,t)},s)}}else this.loadingPlaylist(e,t)},n.getDeliveryDirectives=function(e,t,n,r){var i=cl(e); return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=""),new dl(n,r,i)},n.checkRetry=function(e){var t=this,n=e.details,r=Pl(e),i=e.errorAction,o=i||{},a=o.action,s=o.retryCount,u=void 0=== s?0:s,l=o.retryConfig,c=!!i&&!!l&&(5===a||!i.resolved&&2===a); if(c){var d;if(u>=l.maxNumRetry)return!1;if(r&&null!=(d=e.context)&&d.deliveryDirectives)this.warn("Retrying playlist loading "+(u+1)+"/"+l.maxNumRetry+' after "'+n+'" without delivery-directives'),this.loadPlaylist(); else{var h=Nl(l,u);this.clearTimer(),this.timer=T(function(){return t.loadPlaylist()},h),this.warn("Retrying playlist loading "+(u+1)+"/"+l.maxNumRetry+' after "'+n+'" in '+h+"ms")}e.levelRetry=!0,i.resolved= !0}return c},t}(zs); function Pf(e,t){if(e.length!==t.length)return!1;for(var n=0;n-1)i=s[l];else{var c=ml(u,this.tracks);i=this.tracks[c]}}var d=this.findTrackId(i); -1===d&&i&&(d=this.findTrackId(null));var h={audioTracks:s};this.log("Updating audio tracks, "+s.length+" track(s) found in group(s): "+(null==n?void 0:n.join(","))),this.hls.trigger(Ns.AUDIO_TRACKS_UPDATED, h);var p=this.trackId;if(-1!==d&&-1===p)this.setAudioTrack(d);else if(s.length&&-1===p){var v,g=new Error("No audio track selected for current audio group-ID(s): "+(null==(v=this.groupIds)?void 0:v.join(","))+ " track count: "+s.length);this.warn(g.message),this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:g})}}}},n.onError=function(e,t){var n; !t.fatal&&t.context&&(t.context.type!==Fs||t.context.id!==this.trackId||this.groupIds&&-1===o(n=this.groupIds).call(n,t.context.groupId)||this.checkRetry(t))},n.setAudioOption=function(e){var t=this.hls; if(t.config.audioPreference=e,e){var n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){var r=this.currentTrack;if(r&&_l(e,r,El))return r;var i=ml(e,this.tracksInGroup,El);if(i>-1){var a=this.tracksInGroup[i]; return this.setAudioTrack(i),a}if(r){var s=t.loadLevel;-1===s&&(s=t.firstAutoLevel);var u=function(e,t,n,r,i){var a=t[r],s=ba(t).call(t,function(e,t,n){var r=t.uri;return(e[r]||(e[r]=[])).push(n),e},{})[a.uri]; s.length>1&&(r=Math.max.apply(Math,s));var u=a.videoRange,l=a.frameRate,c=a.codecSet.substring(0,4),d=Tl(t,r,function(t){if(t.videoRange!==u||t.frameRate!==l||t.codecSet.substring(0,4)!==c)return!1;var r= t.audioGroups,a=Oa(n).call(n,function(e){return!r||-1!==o(r).call(r,e.groupId)}); return ml(e,a,i)>-1}); return d>-1?d:Tl(t,r,function(t){var r=t.audioGroups,a=Oa(n).call(n,function(e){return!r||-1!==o(r).call(r,e.groupId)}); return ml(e,a,i)>-1})}(e,t.levels,n,s,El); if(-1===u)return null;t.nextLoadLevel=u}if(e.channels||e.audioCodec){var l=ml(e,n);if(l>-1)return n[l]}}}return null},n.setAudioTrack=function(e){var t=this.tracksInGroup; if(e<0||e>=t.length)this.warn("Invalid audio track id: "+e);else{this.selectDefaultTrack=!1;var n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(!(e===this.trackId&&r===n&&i||(this.log("Switching to audio-track "+ e+' "'+r.name+'" lang:'+r.lang+" group:"+r.groupId+" channels:"+r.channels),this.trackId=e,this.currentTrack=r,this.hls.trigger(Ns.AUDIO_TRACK_SWITCHING,function(e){for(var t=1;t0},n.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend= null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose= null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null},n.registerListeners=function(){var e=this.hls; e.on(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.MANIFEST_PARSED,this.onManifestParsed, this),e.on(Ns.BUFFER_RESET,this.onBufferReset,this),e.on(Ns.BUFFER_APPENDING,this.onBufferAppending,this),e.on(Ns.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Ns.BUFFER_EOS,this.onBufferEos,this),e.on(Ns.BUFFER_FLUSHING, this.onBufferFlushing,this),e.on(Ns.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Ns.FRAG_PARSED,this.onFragParsed,this),e.on(Ns.FRAG_CHANGED,this.onFragChanged,this),e.on(Ns.ERROR,this.onError,this)},n.unregisterListeners= function(){var e=this.hls; e.off(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.MANIFEST_PARSED,this.onManifestParsed, this),e.off(Ns.BUFFER_RESET,this.onBufferReset,this),e.off(Ns.BUFFER_APPENDING,this.onBufferAppending,this),e.off(Ns.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Ns.BUFFER_EOS,this.onBufferEos,this),e.off(Ns.BUFFER_FLUSHING, this.onBufferFlushing,this),e.off(Ns.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Ns.FRAG_PARSED,this.onFragParsed,this),e.off(Ns.FRAG_CHANGED,this.onFragChanged,this),e.off(Ns.ERROR,this.onError,this)}, n.transferMedia=function(){var e=this,t=this.media,n=this.mediaSource; if(!t)return null;var r={};if(this.operationQueue){var i=this.isUpdating();i||this.operationQueue.removeBlockers();var o=this.isQueued();(i||o)&&this.warn("Transfering MediaSource with"+(o?" operations in queue": "")+(i?" updating SourceBuffer(s)":"")+" "+this.operationQueue),this.operationQueue.destroy()}var a,s=this.transferData;return!this.sourceBufferCount&&s&&s.mediaSource===n?Ya(r,s.tracks):f(a=this.sourceBuffers).call(a, function(t){var n=t[0];n&&(r[n]=Ya({},e.tracks[n]),e.removeBuffer(n)),t[0]=t[1]=null}),{media:t, mediaSource:n,tracks:r}},n.initTracks=function(){this.sourceBuffers=[[null, null],[null,null]],this.tracks={},this.resetQueue(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0},n.onManifestLoading=function(){this.bufferCodecEventsTotal=0,this.details= null,this.resetAppendErrors()},n.onManifestParsed=function(e,t){var n,r=2; (t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(r+" bufferCodec event(s) expected."),null!=(n=this.transferData)&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}, n.onMediaAttaching=function(e,t){var n=this.media=t.media; this.transferData=this.overrides=void 0;var r=Js(this.appendSource);if(r){var i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);var o=this.mediaSource=t.mediaSource|| new r;if(this.assignMediaSource(o),i)this._objectUrl=n.src,this.attachTransferred();else{var a=this._objectUrl=ga.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");var s=self.ManagedMediaSource; n.disableRemotePlayback=n.disableRemotePlayback||s&&o instanceof s,Hf(n),function(e,t){var n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,a),n.load()}catch(e){n.src= a}else n.src=a}n.addEventListener("emptied",this._onMediaEmptied)}},n.assignMediaSource=function(e){var t,n; this.log(((null==(t=this.transferData)?void 0:t.mediaSource)===e?"transferred":"created")+" media source: "+(null==(n=e.constructor)?void 0:n.name)),e.addEventListener("sourceopen",this._onMediaSourceOpen), e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming", this._onEndStreaming))},n.attachTransferred=function(){var e=this,t=this.media,n=this.transferData; if(n&&t){var r=this.tracks,i=n.tracks,o=i?Fa(i):null,a=o?o.length:0,s=function s(){d.resolve().then(function(){e.media&&e.mediaSourceOpenOrEnded&&e._onMediaSourceOpen()})}; if(i&&o&&a){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log("attachTransferred: (bufferCodecEventsTotal "+ this.bufferCodecEventsTotal+")\nrequired tracks: "+pl(r,function(e,t){return"initSegment"===e?void 0:t})+";\ntransfer tracks: "+pl(i,function(e,t){return"initSegment"===e?void 0:t})+"}"),!$s(i,r)){n.mediaSource= null,n.tracks=void 0; var u=t.currentTime,l=this.details,c=Math.max(u,(null==l?void 0:l.fragments[0].start)||0);return c-u>1?void this.log("attachTransferred: waiting for playback to reach new tracks start time "+u+" -\x3e "+ c):(this.warn('attachTransferred: resetting MediaSource for incompatible tracks ("'+Fa(i)+'"-\x3e"'+Fa(r)+'") start time: '+c+" currentTime: "+u),this.onMediaDetaching(Ns.MEDIA_DETACHING,{}),this.onMediaAttaching(Ns.MEDIA_ATTACHING, n),void(t.currentTime=c))}this.transferData=void 0,f(o).call(o,function(t){var n=t,r=i[n];if(r){var o=r.buffer;if(o){var a=e.fragmentTracker,s=r.id;if(a.hasFragments(s)||a.hasParts(s)){var u=lc.getBuffered(o); a.detectEvictedFragments(n,u,s,null,!0)}var l=jf(n),c=[n,o];e.sourceBuffers[l]=c,o.updating&&e.operationQueue&&e.operationQueue.prependBlocker(n),e.trackSourceBuffer(n,r)}}}),s(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"), s()}},n.onMediaDetaching=function(e,t){var n=this,r=!!t.transferMedia; this.transferData=this.overrides=void 0;var i=this.media,o=this.mediaSource,a=this._objectUrl;if(o){if(this.log("media source "+(r?"transferring":"detaching")),r){var s;f(s=this.sourceBuffers).call(s,function(e){var t= e[0];t&&n.removeBuffer(t)}),this.resetQueue()}else{if(this.mediaSourceOpenOrEnded){var u="open"===o.readyState; try{for(var l=o.sourceBuffers,c=l.length;c--;)u&&l[c].abort(),o.removeSourceBuffer(l[c]);u&&o.endOfStream()}catch(e){this.warn("onMediaDetaching: "+e.message+" while calling endOfStream")}}this.sourceBufferCount&& this.onBufferReset()}o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose), this.appendSource&&(o.removeEventListener("startstreaming",this._onStartStreaming),o.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied", this._onMediaEmptied),r||(a&&ga.revokeObjectURL(a),this.mediaSrc===a?(i.removeAttribute("src"),this.appendSource&&Hf(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")), this.media=null),this.hls.trigger(Ns.MEDIA_DETACHED,t)},n.onBufferReset=function(){var e,t=this; f(e=this.sourceBuffers).call(e,function(e){var n=e[0];n&&t.resetBuffer(n)}),this.initTracks()},n.resetBuffer=function(e){var t,n=null==(t=this.tracks[e])?void 0:t.buffer; if(this.removeBuffer(e),n)try{var r;null!=(r=this.mediaSource)&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(t){this.warn("onBufferReset "+e,t)}delete this.tracks[e]},n.removeBuffer= function(e){this.removeBufferListeners(e),this.sourceBuffers[jf(e)]=[null, null];var t=this.tracks[e];t&&(t.buffer=void 0)},n.resetQueue=function(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Mf(this.tracks)},n.onBufferCodecs=function(e,t){var n, r=this,i=this.tracks,o=Fa(t); this.log('BUFFER_CODECS: "'+o+'" (current SB count '+this.sourceBufferCount+")");var a="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),s=!a&&this.sourceBufferCount&&this.media&& qa(o).call(o,function(e){return!i[e]}); a||s?this.warn('Unsupported transition between "'+Fa(i)+'" and "'+o+'" SourceBuffers'):(f(o).call(o,function(e){var n,o,a=t[e],s=a.id,u=a.codec,l=a.levelCodec,c=a.container,d=a.metadata,h=a.supplemental, f=i[e],p=null==(n=r.transferData)||null==(n=n.tracks)?void 0:n[e],v=null!=p&&p.buffer?p:f,g=(null==v?void 0:v.pendingCodec)||(null==v?void 0:v.codec),y=null==v?void 0:v.levelCodec;f||(f=i[e]={buffer:void 0, listeners:[],codec:u,supplemental:h,container:c,levelCodec:l,metadata:d,id:s});var m=Qu(g,y),_=null==m?void 0:m.replace(Uf,"$1"),E=Qu(u,l),T=null==(o=E)?void 0:o.replace(Uf,"$1");E&&m&&_!==T&&("audio"=== Ea(e).call(e,0,5)&&(E=Xu(E,r.appendSource)),r.log("switching codec "+g+" to "+E),E!==(f.pendingCodec||f.codec)&&(f.pendingCodec=E),f.container=c,r.appendChangeType(e,c,E))}),(this.tracksReady||this.sourceBufferCount)&& (t.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&"main"===(null==(n=t.audio)?void 0:n.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal= 1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))},n.appendChangeType=function(e,t,n){var r=this,i=t+";codecs\x3d"+n,o={label:"change-type\x3d"+i, execute:function execute(){var o=r.tracks[e];if(o){var a=o.buffer;null!=a&&a.changeType&&(r.log("changing "+e+" sourceBuffer type to "+i),a.changeType(i),o.codec=n,o.container=t)}r.shiftAndExecuteNext(e)}, onStart:function onStart(){}, onComplete:function onComplete(){}, onError:function onError(t){r.warn("Failed to change "+e+" SourceBuffer type",t)}}; this.append(o,e,this.isPending(this.tracks[e]))},n.blockAudio=function(e){var t,n=this,r=e.start,i=r+.05*e.duration; if(!0!==(null==(t=this.fragmentTracker.getAppendedFrag(r,Vs))?void 0:t.gap)){var o={label:"block-audio",execute:function execute(){var e,t=n.tracks.video;(n.lastVideoAppendEnd>i||null!=t&&t.buffer&&lc.isBuffered(t.buffer, i)||!0===(null==(e=n.fragmentTracker.getAppendedFrag(i,Vs))?void 0:e.gap))&&(n.blockedAudioAppend=null,n.shiftAndExecuteNext("audio"))}, onStart:function onStart(){}, onComplete:function onComplete(){}, onError:function onError(e){n.warn("Error executing block-audio operation",e)}}; this.blockedAudioAppend={op:o,frag:e},this.append(o,"audio",!0)}},n.unblockAudio=function(){var e=this.blockedAudioAppend,t=this.operationQueue; e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))},n.onBufferAppending=function(e,t){var n=this,r=this.tracks,i=t.data,o=t.type,a=t.parent,s=t.frag,u=t.part,l=t.chunkMeta,c=t.offset,d=l.buffering[o], h=s.sn,p=s.cc,v=self.performance.now(); d.start=v;var g=s.stats.buffering,y=u?u.stats.buffering:null;0===g.start&&(g.start=v),y&&0===y.start&&(y.start=v);var m=r.audio,_=!1;"audio"===o&&"audio/mpeg"===(null==m?void 0:m.container)&&(_=!this.lastMpegAudioChunk|| 1===l.id||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);var E=r.video,T=null==E?void 0:E.buffer;if(T&&"initSegment"!==h){var b=u||s,S=this.blockedAudioAppend;if("audio"!==o||"main"===a|| this.blockedAudioAppend||E.ending||E.ended){if("video"===o){var w=b.end;if(S){var A=S.frag.start;(w>A||w=d&&(i.fatal=!r)}n.hls.trigger(Ns.ERROR,i),r&&n.hls&&n.trimBuffers(s.start,1)}}; this.log('queuing "'+o+'" append sn: '+h+(u?" p: "+u.index:"")+" of "+(s.type===Vs?"level":"track")+" "+s.level+" cc: "+p),this.append(O,o,this.isPending(this.tracks[o]))},n.getFlushOp=function(e,t,n){var r= this; return this.log('queuing "'+e+'" remove '+t+"-"+n),{label:"remove",execute:function execute(){r.removeExecutor(e,t,n)}, onStart:function onStart(){}, onComplete:function onComplete(){r.hls.trigger(Ns.BUFFER_FLUSHED,{type:e})}, onError:function onError(i){r.warn("Failed to remove "+t+"-"+n+' from "'+e+'" SourceBuffer',i)}}},n.onBufferFlushing=function(e,t){var n,r=this,i=t.type,o=t.startOffset,a=t.endOffset; i?this.append(this.getFlushOp(i,o,a),i):f(n=this.sourceBuffers).call(n,function(e){var t=e[0];t&&r.append(r.getFlushOp(t,o,a),t)})},n.onFragParsed=function(e,t){var n=this,r=t.frag,i=t.part,o=[],a=i?i.elementaryStreams: r.elementaryStreams; a[su]?o.push("audiovideo"):(a[ou]&&o.push("audio"),a[au]&&o.push("video")),0===o.length&&this.log("Fragments must have at least one ElementaryStreamType set. "+r.type+" "+r.level+" "+(i?"part: "+i.index+ " of ":"")+"sn: "+r.sn),this.blockBuffers(function(){var e=self.performance.now();r.stats.buffering.end=e,i&&(i.stats.buffering.end=e);var t=i?i.stats:r.stats;n.hls.trigger(Ns.FRAG_BUFFERED,{frag:r,part:i, stats:t,id:r.type}),!i&&r.gap&&t.retry&&n.log("Nothing buffered for "+r.type+" level: "+r.level+" sn: "+r.sn+" retries "+t.retry)},o)["catch"](function(e){n.warn("Fragment buffered callback "+e),n.stepOperationQueue(n.sourceBufferTypes)})}, n.onFragChanged=function(e,t){var n,r=null==(n=this.hls)?void 0:n.config; if(r){var i=r.backBufferLength,o=r.frontBufferFlushThreshold;this.trimBuffers(o,i)}},n.onBufferEos=function(e,t){var n,r,i,o=this; f(n=this.sourceBuffers).call(n,function(e){var n=e[0];if(n){var r=o.tracks[n];t.type&&t.type!==n||(r.ending=!0,r.ended||(r.ended=!0,o.log(n+" buffer reached EOS")))}}); var a=!1!==(null==(r=this.overrides)?void 0:r.endOfStream);this.sourceBufferCount>0&&!qa(i=this.sourceBuffers).call(i,function(e){var t,n=e[0];return n&&!(null!=(t=o.tracks[n])&&t.ended)})?a?(this.log("Queueing EOS"), this.blockUntilOpen(function(){o.tracksEnded(); var e=o.mediaSource;e&&"open"===e.readyState?(o.log("Calling mediaSource.endOfStream()"),e.endOfStream(),o.hls.trigger(Ns.BUFFERED_TO_END,void 0)):e&&o.log("Could not call mediaSource.endOfStream(). mediaSource.readyState: "+ e.readyState)})):(this.tracksEnded(),this.hls.trigger(Ns.BUFFERED_TO_END,void 0)):"video"===t.type&&this.unblockAudio()},n.tracksEnded=function(){var e,t=this; f(e=this.sourceBuffers).call(e,function(e){var n=e[0];if(null!==n){var r=t.tracks[n];r&&(r.ending=!1)}})},n.onLevelUpdated=function(e,t){var n=t.details; n.fragments.length&&(this.details=n,this.updateDuration())},n.updateDuration=function(){var e=this; this.blockUntilOpen(function(){var t=e.getDurationAndRange();t&&e.updateMediaSource(t)})},n.onError=function(e,t){if(t.details===xs.BUFFER_APPEND_ERROR&&t.frag){var n,r=null==(n=t.errorAction)?void 0:n.nextAutoLevel; Os(r)&&r!==t.frag.level&&this.resetAppendErrors()}},n.resetAppendErrors=function(){this.appendErrors={audio:0, video:0,audiovideo:0}},n.trimBuffers=function(e,t){var n=this.hls,r=this.details,i=this.media; if(i&&null!==r&&this.sourceBufferCount){var o=n.config,a=i.currentTime,s=r.levelTargetDuration;if(t=r.live&&null!==o.liveBackBufferLength?o.liveBackBufferLength:t,Os(t)&&t>=0){var u=Math.max(t,s),l=Math.floor(a/ s)*s-u;this.flushBackBuffer(a,s,l)}if(Os(e)&&e>0){var c=Math.max(o.maxBufferLength,e),d=Math.max(c,s),h=Math.floor(a/s)*s+d;this.flushFrontBuffer(a,s,h)}}},n.flushBackBuffer=function(e,t,n){var r,i=this; f(r=this.sourceBuffers).call(r,function(e){var t=e[0],r=e[1];if(r){var o=lc.getBuffered(r);if(o.length>0&&n>o.start(0)){var a;i.hls.trigger(Ns.BACK_BUFFER_REACHED,{bufferEnd:n});var s=i.tracks[t];if(null!= (a=i.details)&&a.live)i.hls.trigger(Ns.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=s&&s.ended)return void i.log("Cannot flush "+t+" back buffer while SourceBuffer is in ended state");i.hls.trigger(Ns.BUFFER_FLUSHING, {startOffset:0,endOffset:n,type:t})}}})},n.flushFrontBuffer=function(e,t,n){var r,i=this; f(r=this.sourceBuffers).call(r,function(t){var r=t[0],o=t[1];if(o){var a=lc.getBuffered(o),s=a.length;if(s<2)return;var u=a.start(s-1),l=a.end(s-1);if(n>u||e>=u&&e<=l)return;i.hls.trigger(Ns.BUFFER_FLUSHING, {startOffset:u,endOffset:1/0,type:r})}})},n.getDurationAndRange=function(){var e,t=this.details,n=this.mediaSource; if(!t||!this.media||"open"!==(null==n?void 0:n.readyState))return null;var r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){var i=Math.max(0,t.fragmentStart); return{duration:1/0,start:i,end:Math.max(i,r)}}return{duration:1/0}}var o=null==(e=this.overrides)?void 0:e.duration;if(o)return Os(o)?{duration:o}:null;var a=this.media.duration;return r>(Os(n.duration)? n.duration:0)&&r>a||!Os(a)?{duration:r}:null},n.updateMediaSource=function(e){var t=e.duration,n=e.start,r=e.end,i=this.mediaSource; this.media&&i&&"open"===i.readyState&&(i.duration!==t&&(Os(t)&&this.log("Updating MediaSource duration to "+t.toFixed(3)),i.duration=t),void 0!==n&&void 0!==r&&(this.log("MediaSource duration is set to "+ i.duration+". Setting seekable range to "+n+"-"+r+"."),i.setLiveSeekableRange(n,r)))},n.checkPendingTracks=function(){var e=this.bufferCodecEventsTotal,t=this.pendingTrackCount,n=this.tracks; if(this.log("checkPendingTracks (pending: "+t+" codec events expected: "+e+") "+pl(n)),this.tracksReady){var r,i=null==(r=this.transferData)?void 0:r.tracks;i&&Fa(i).length?this.attachTransferred():this.createSourceBuffers()}}, n.bufferCreated=function(){var e=this; if(this.sourceBufferCount){var t,n,r={};f(t=this.sourceBuffers).call(t,function(t){var n=t[0],i=t[1];if(n){var o=e.tracks[n];r[n]={buffer:i,container:o.container,codec:o.codec,supplemental:o.supplemental, levelCodec:o.levelCodec,id:o.id,metadata:o.metadata}}}),this.hls.trigger(Ns.BUFFER_CREATED,{tracks:r}),this.log("SourceBuffers created. Running queue: "+this.operationQueue),f(n=this.sourceBuffers).call(n, function(t){var n=t[0]; e.executeNext(n)})}else{var i=new Error("could not create source buffer for media codec(s)"); this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:i,reason:i.message})}},n.createSourceBuffers=function(){var e=this.tracks,t=this.sourceBuffers, n=this.mediaSource; if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(var r in e){var i=r,o=e[i];if(this.isPending(o)){var a=this.getTrackCodec(o,i),s=o.container+";codecs\x3d"+a;o.codec=a, this.log("creating sourceBuffer("+s+")"+(this.currentOp(i)?" Queued":"")+" "+pl(o));try{var u=n.addSourceBuffer(s),l=jf(i),c=[i,u];t[l]=c,o.buffer=u}catch(e){var d;return this.error("error while trying to add sourceBuffer: "+ e.message),this.shiftAndExecuteNext(i),null==(d=this.operationQueue)||d.removeBlockers(),delete this.tracks[i],void this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.BUFFER_ADD_CODEC_ERROR,fatal:!1, error:e,sourceBufferName:i,mimeType:s,parent:o.id})}this.trackSourceBuffer(i,o)}}this.bufferCreated()},n.getTrackCodec=function(e,t){var n=e.supplemental,r=e.codec; n&&("video"===t||"audiovideo"===t)&&Gu(n,"video")&&(r=function(e,t){var n=[];if(e)for(var r=e.split(","),i=0;i=n&&(this.log("Updating "+r+" SourceBuffer timestampOffset to "+t+" (sn: "+i+" cc: "+o+")"),e.timestampOffset=t)},n.removeExecutor=function(e,t,n){var r=this.media,i=this.mediaSource,o=this.tracks[e], a=null==o?void 0:o.buffer; if(!r||!i||!a)return this.warn("Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void this.shiftAndExecuteNext(e);var s=Os(r.duration)?r.duration:1/0,u=Os(i.duration)?i.duration: 1/0,l=Math.max(0,t),c=Math.min(n,s,u);c>l&&(!o.ending||o.ended)?(o.ended=!1,this.log("Removing ["+l+","+c+"] from the "+e+" SourceBuffer"),a.remove(l,c)):this.shiftAndExecuteNext(e)},n.appendExecutor=function(e, t){var n=this.tracks[t],r=null==n?void 0:n.buffer; if(!r)throw new Bf("Attempting to append to the "+t+" SourceBuffer, but it does not exist");n.ending=!1,n.ended=!1,r.appendBuffer(e)},n.blockUntilOpen=function(e){var t=this; if(this.isUpdating()||this.isQueued())this.blockBuffers(e)["catch"](function(e){t.warn("SourceBuffer blocked callback "+e),t.stepOperationQueue(t.sourceBufferTypes)}); else try{e()}catch(e){this.warn("Callback run without blocking "+this.operationQueue+" "+e)}},n.isUpdating=function(){var e; return qa(e=this.sourceBuffers).call(e,function(e){var t=e[0],n=e[1];return t&&n.updating})},n.isQueued=function(){var e,t=this; return qa(e=this.sourceBuffers).call(e,function(e){var n=e[0];return n&&!!t.currentOp(n)})},n.isPending=function(e){return!!e&&!e.buffer},n.blockBuffers=function(e,t){var n=this; if(void 0===t&&(t=this.sourceBufferTypes),!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),d.resolve().then(e);var r=this.operationQueue,i=Ma(t).call(t,function(e){return n.appendBlocker(e)}); return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),d.all(i).then(function(t){r===n.operationQueue&&(e(),n.stepOperationQueue(n.sourceBufferTypes))})},n.stepOperationQueue=function(e){var t= this; f(e).call(e,function(e){var n,r=null==(n=t.tracks[e])?void 0:n.buffer;r&&!r.updating&&t.shiftAndExecuteNext(e)})},n.append=function(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)},n.appendBlocker= function(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)},n.currentOp=function(e){return this.operationQueue?this.operationQueue.current(e):null},n.executeNext=function(e){e&&this.operationQueue&& this.operationQueue.executeNext(e)},n.shiftAndExecuteNext=function(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)},n.addBufferListener=function(e,t,n){var r=this.tracks[e]; if(r){var i=r.buffer;if(i){var o=l(n).call(n,this,e);r.listeners.push({event:t,listener:o}),i.addEventListener(t,o)}}},n.removeBufferListeners=function(e){var t,n=this.tracks[e]; if(n){var r=n.buffer;r&&(f(t=n.listeners).call(t,function(e){r.removeEventListener(e.event,e.listener)}),n.listeners.length=0)}},Ra(t,[{key:"mediaSourceOpenOrEnded", get:function get(){var e,t=null==(e=this.mediaSource)?void 0:e.readyState;return"open"===t||"ended"===t}}, {key:"sourceBufferTracks",get:function get(){var e,t=this;return ba(e=Fa(this.tracks)).call(e,function(e,n){var r=t.tracks[n];return e[n]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec}, e},{})}}, {key:"bufferedToEnd",get:function get(){var e,t=this;return this.sourceBufferCount>0&&!qa(e=this.sourceBuffers).call(e,function(e){var n=e[0];if(n){var r=t.tracks[n];if(r)return!r.ended||r.ending}return!1})}}, {key:"tracksReady",get:function get(){var e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}}, {key:"mediaSrc",get:function get(){var e,t,n=(null==(e=this.media)||null==(t=e.querySelector)?void 0:t.call(e,"source"))||this.media;return null==n?void 0:n.src}}, {key:"pendingTrackCount",get:function get(){var e,t=this;return ba(e=Fa(this.tracks)).call(e,function(e,n){return e+(t.isPending(t.tracks[n])?1:0)},0)}}, {key:"sourceBufferCount",get:function get(){var e;return ba(e=this.sourceBuffers).call(e,function(e,t){return e+(t[0]?1:0)},0)}}, {key:"sourceBufferTypes",get:function get(){var e,t;return Oa(e=Ma(t=this.sourceBuffers).call(t,function(e){return e[0]})).call(e,function(e){return!!e})}}])}(zs); function Hf(e){var t,n=e.querySelectorAll("source");f(t=Ea([]).call(n)).call(t,function(t){e.removeChild(t)})} function jf(e){return"audio"===e?1:0} var Gf=function(){function e(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController= void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()} var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.destroy=function(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect= null,this.hls=this.streamController=null},t.registerListeners=function(){var e=this.hls; e.on(Ns.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ns.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ns.LEVELS_UPDATED,this.onLevelsUpdated, this),e.on(Ns.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Ns.MEDIA_DETACHING,this.onMediaDetaching,this)},t.unregisterListener=function(){var e=this.hls; e.off(Ns.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ns.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ns.LEVELS_UPDATED,this.onLevelsUpdated, this),e.off(Ns.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this)},t.onFpsDropLevelCapping=function(e,t){var n=this.hls.levels[t.droppedLevel]; this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})},t.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect= null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()},t.onManifestParsed=function(e,t){var n=this.hls; this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()},t.onLevelsUpdated=function(e,t){this.timer&&Os(this.autoLevelCapping)&&this.detectPlayerSize()}, t.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},t.onMediaDetaching=function(){this.stopCapping(),this.media=null},t.detectPlayerSize=function(){if(this.media){if(this.mediaHeight<= 0||this.mediaWidth<=0)return void(this.clientRect=null); var e=this.hls.levels;if(e.length){var t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log("Setting autoLevelCapping to "+n+": "+e[n].height+"p@"+e[n].bitrate+" for media "+ this.mediaWidth+"x"+this.mediaHeight),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping= t.autoLevelCapping}}},t.getMaxLevel=function(t){var n=this,r=this.hls.levels; if(!r.length)return-1;var i=Oa(r).call(r,function(e,r){return n.isLevelAllowed(e)&&r<=t}); return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},t.startCapping=function(){var e; this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=za(l(e=this.detectPlayerSize).call(e,this),1E3),this.detectPlayerSize())},t.stopCapping=function(){this.restrictedLevels= [],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},t.getDimensions=function(){if(this.clientRect)return this.clientRect; var e=this.media,t={width:0,height:0};if(e){var n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect= t,t},t.isLevelAllowed=function(e){var t=this.restrictedLevels; return!qa(t).call(t,function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height})},e.getMaxLevelByMediaSize=function(e,t,n){if(null==e||!e.length)return-1; for(var r=function r(e,t){return!t||e.width!==t.width||e.height!==t.height},i=e.length-1,o=Math.max(t,n),a=0;a=o||s.height>=o)&&r(s,e[a+1])){i=a;break}}return i},Ra(e,[{key:"mediaWidth", get:function get(){return this.getDimensions().width*this.contentScaleFactor}}, {key:"mediaHeight",get:function get(){return this.getDimensions().height*this.contentScaleFactor}}, {key:"contentScaleFactor",get:function get(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}}])}(),Kf="a", zf="av",Wf=function e(t,n){Na(t)&&(t=Ma(t).call(t,function(t){return t instanceof e?t:new e(t)})),this.value=t,this.params=n}; function qf(e,t,n){return function(e,t,n,r){return new Error('failed to serialize "'+(Na(i=t)?_(i):i instanceof Zo?"Map{}":i instanceof _s?"Set{}":"object"==_typeof(i)?_(i):String(i))+'" as '+n,{cause:r}); var i}(0,e,t,n)} var Zf=function Zf(e){this.description=e},Yf="Bare Item"; function Xf(e){if(function(e){return e<-999999999999999||99999999999999912)throw qf(e,"Decimal");var n=t.toString();return gs(n).call(n,".")?n:n+".0"} var $f=/[\x00-\x1f\x7f]+/;function ep(e){var t=function(e){var t;return e.description||Ea(t=e.toString()).call(t,7,-1)}(e); if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw qf(t,"Token");return t} function tp(e){switch(_typeof(e)){case "number":if(!Os(e))throw qf(e,Yf);return Ts(e)?Xf(e):Jf(e);case "string":return function(e){if($f.test(e))throw qf(e,"String");return'"'+e.replace(/\\/g,"\\\\").replace(/"/g, '\\"')+'"'}(e); case "symbol":return ep(e);case "boolean":return function(e){if("boolean"!=typeof e)throw qf(e,"Boolean");return e?"?1":"?0"}(e); case "object":if(e instanceof Date)return function(e){return"@"+Xf(e.getTime()/1E3)}(e); if(e instanceof Uint8Array)return function(e){if(!1===ArrayBuffer.isView(e))throw qf(e,"Byte Sequence");return":"+(t=e,btoa(String.fromCharCode.apply(String,t))+":");var t}(e); if(e instanceof Zf)return ep(e);default:throw qf(e,Yf);}} function np(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw qf(e,"Key");return e} function rp(e){var t;return null==e?"":Ma(t=v(e)).call(t,function(e){var t=e[0],n=e[1];return!0===n?";"+np(t):";"+np(t)+"\x3d"+tp(n)}).join("")} function ip(e){return e instanceof Wf?""+tp(e.value)+rp(e.params):tp(e)} function op(e,t){return function(e,t){var n;if(void 0===t&&(t={whitespace:!0}),"object"!=_typeof(e)||null==e)throw qf(e,"Dict");var r=e instanceof Zo?ms(e).call(e):v(e),i=(null==t?void 0:t.whitespace)? " ":"";return Ma(n=ps(r)).call(n,function(e){var t=e[0],n=e[1];n instanceof Wf==0&&(n=new Wf(n));var r=np(t);return!0===n.value?r+=rp(n.params):(r+="\x3d",Na(n.value)?r+=function(e){var t;return"("+Ma(t= e.value).call(t,ip).join(" ")+")"+rp(e.params)}(n):r+=ip(n)),r}).join(","+i)}(e,t)} var ap="CMCD-Object",sp="CMCD-Request",up="CMCD-Session",lp="CMCD-Status",cp={br:ap,ab:ap,d:ap,ot:ap,tb:ap,tpb:ap,lb:ap,tab:ap,lab:ap,url:ap,pb:sp,bl:sp,tbl:sp,dl:sp,ltc:sp,mtp:sp,nor:sp,nrr:sp,rc:sp,sn:sp, sta:sp,su:sp,ttfb:sp,ttfbb:sp,ttlb:sp,cmsdd:sp,cmsds:sp,smrt:sp,df:sp,cs:sp,ts:sp,cid:up,pr:up,sf:up,sid:up,st:up,v:up,msd:up,bs:lp,bsd:lp,cdn:lp,rtp:lp,bg:lp,pt:lp,ec:lp,e:lp},dp=sp,hp="event",fp=function fp(e){return Math.round(e)}, pp=function pp(e,t){return Na(e)?Ma(e).call(e,function(e){return pp(e,t)}):e instanceof Wf&&"string"==typeof e.value?new Wf(pp(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){var n,r,i=new ga(e),o=new ga(t); if(i.origin!==o.origin)return e;for(var a=Ea(n=i.pathname.split("/")).call(n,1),s=Ea(r=o.pathname.split("/")).call(r,1,-1);a[0]===s[0];)a.shift(),s.shift();for(;s.length;)s.shift(),a.unshift("..");return a.join("/")+ i.search+i.hash}(e,t.baseUrl)),1===t.version?encodeURIComponent(e):e)},vp=function vp(e){return 100*fp(e/100)},gp={br:fp, d:fp,bl:vp,dl:vp,mtp:vp,nor:function nor(e,t){var n=e;return t.version>=2&&(e instanceof Wf&&"string"==typeof e.value?n=new Wf([e]):"string"==typeof e&&(n=[e])),pp(n,t)}, rtp:vp,tb:fp},yp="request",mp="response",_p=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts", "v"],Ep=["e"],Tp=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function bp(e){return Tp.test(e)} var Sp,wp=["d","dl","nor","ot","rtp","su"],Ap=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"],Rp=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"]; function Lp(e){return gs(Rp).call(Rp,e)||bp(e)} var Ip=((Sp={})[mp]=function(e){return gs(_p).call(_p,e)||gs(wp).call(wp,e)||gs(Ap).call(Ap,e)||bp(e)},Sp[hp]=function(e){return gs(_p).call(_p,e)||gs(Ep).call(Ep,e)||bp(e)},Sp[yp]=function(e){return gs(_p).call(_p, e)||gs(wp).call(wp,e)||bp(e)},Sp); function Cp(e,t){var n,r;void 0===t&&(t={});var i={};if(null==e||"object"!=_typeof(e))return i;var o=t.version||e.v||1,a=t.reportingMode||yp,s=1===o?Lp:Ip[a],u=Oa(n=Fa(e)).call(n,s),l=Oa(t);"function"== typeof l&&(u=Oa(u).call(u,l));var c=a===mp||a===hp;c&&!gs(u).call(u,"ts")&&u.push("ts"),o>1&&!gs(u).call(u,"v")&&u.push("v");var d=Ya({},gp,t.formatters),h={version:o,reportingMode:a,baseUrl:t.baseUrl}; return f(r=ma(u).call(u)).call(r,function(t){var n=e[t],r=d[t];if("function"==typeof r&&(n=r(n,h)),"v"===t){if(1===o)return;n=o}"pr"==t&&1===n||(c&&"ts"===t&&!Os(n)&&(n=hs()),function(e){return"number"== typeof e?Os(e):null!=e&&""!==e&&!1!==e}(n)&&(function(e){var t; return gs(t=["ot","sf","st","e","sta"]).call(t,e)}(t)&&"string"==typeof n&&(n=new Zf(n)),i[t]=n))}),i} var Op=/CMCD=[^&#]+/;var Pp=function(){function e(e){var t=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized= !1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized= !0),t.buffering=!1},this.applyPlaylistData=function(e){try{t.apply(e,{ot:"m", su:!t.initialized})}catch(e){t.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var n=e.frag,r=e.part,i=t.hls.levels[n.level],o=t.getObjectType(n),a= {d:1E3*(r||n).duration, ot:o};"v"!==o&&o!==Kf&&o!=zf||(a.br=i.bitrate/1E3,a.tb=t.getTopBandwidth(o)/1E3,a.bl=t.getBufferLength(o));var s=r?t.getNextPart(r):t.getNextFrag(n);null!=s&&s.url&&s.url!==n.url&&(a.nor=s.url),t.apply(e, a)}catch(e){t.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e; var n=this.config=e.config,r=n.cmcd;null!=r&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=!0===r.useHeaders, this.includeKeys=r.includeKeys,this.registerListeners())} var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ns.MEDIA_DETACHED,this.onMediaDetached,this),e.on(Ns.BUFFER_CREATED,this.onBufferCreated, this)},t.unregisterListeners=function(){var e=this.hls; e.off(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ns.MEDIA_DETACHED,this.onMediaDetached,this),e.off(Ns.BUFFER_CREATED,this.onBufferCreated,this)},t.destroy=function(){this.unregisterListeners(), this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting", this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing", this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var n,r; this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer},t.createData=function(){var e; return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1E3}},t.apply=function(e,t){void 0===t&&(t={}),Ya(t,this.createData()); var n="i"===t.ot||"v"===t.ot||t.ot===zf;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);var r,i=this.includeKeys;i&&(t=ba(r=Fa(t)).call(r,function(e,n){return gs(i).call(i, n)&&(e[n]=t[n]),e},{})); var o={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),function(e,t,n){Ya(e,function(e,t){var n;void 0===t&&(t={});var r={};if(!e)return r;var i=function(e,t){var n={};if(!e)return n;var r=Fa(e), i=t?function(e){var t;return ba(t=Fa(e)).call(t,function(t,n){var r;return null===(r=e[n])||void 0===r||f(r).call(r,function(e){return t[e]=n}),t},{})}(t):{}; return ba(r).call(r,function(t,n){var r,o=cp[n]||i[n]||dp;return(null!==(r=t[o])&&void 0!==r?r:t[o]={})[n]=e[n],t},n)}(Cp(e,t),null==t?void 0:t.customHeaderMap); return ba(n=v(i)).call(n,function(e,t){var n=t[0],r=op(t[1],{whitespace:!1});return r&&(e[n]=r),e},r)}(t,n))}(e.headers,t,o)):e.url=function(e,t,n){var r=function(e,t){return void 0===t&&(t={}),e?"CMCD\x3d"+ function(e,t){if(void 0===t&&(t={}),!e)return""; var n=function(e,t){return void 0===t&&(t={}),e?op(Cp(e,t),{whitespace:!1}):""}(e,t); return encodeURIComponent(n)}(e,t):""}(t,n); return r?Op.test(e)?e.replace(Op,r):e+(gs(e).call(e,"?")?"\x26":"?")+r:e}(e.url,t,o)},t.getNextFrag=function(e){var t,n=null==(t=this.hls.levels[e.level])?void 0:t.details; if(n){var r=e.sn-n.startSN;return n.fragments[r+1]}},t.getNextPart=function(e){var t,n=e.index,r=e.fragment,i=null==(t=this.hls.levels[r.level])||null==(t=t.details)?void 0:t.partList; if(i)for(var o=r.sn,a=i.length-1;a>=0;a--){var s=i[a];if(s.index===n&&s.fragment.sn===o)return i[a+1]}},t.getObjectType=function(e){var t=e.type; return"subtitle"===t?"tt":"initSegment"===e.sn?"i":"audio"===t?Kf:"main"===t?this.hls.audioTracks.length?"v":zf:void 0},t.getTopBandwidth=function(e){var t,n=0,r=this.hls; if(e===Kf)t=r.audioTracks;else{var i,o=r.maxAutoLevel,a=o>-1?o+1:r.levels.length;t=Ea(i=r.levels).call(i,0,a)}return f(t).call(t,function(e){e.bitrate>n&&(n=e.bitrate)}),n>0?n:NaN},t.getBufferLength=function(e){var t= this.media,n=e===Kf?this.audioBuffer:this.videoBuffer; return n&&t?1E3*lc.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,n=e||this.config.loader; return function(){function e(e){this.loader=void 0,this.loader=new n(e)} var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},Ra(e,[{key:"stats", get:function get(){return this.loader.stats}}, {key:"context",get:function get(){return this.loader.context}}])}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,n=e||this.config.loader; return function(){function e(e){this.loader=void 0,this.loader=new n(e)} var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},Ra(e,[{key:"stats", get:function get(){return this.loader.stats}}, {key:"context",get:function get(){return this.loader.context}}])}()},e}(),kp=function(e){function t(t){var n; return(n=e.call(this,"content-steering",t.logger)||this).hls=void 0,n.loader=null,n.uri=null,n.pathwayId=".",n._pathwayPriority=null,n.timeToLoad=300,n.reloadTimer=-1,n.updated=0,n.started=!1,n.enabled= !0,n.levels=null,n.audioTracks=null,n.subtitleTracks=null,n.penalizedPathways={},n.hls=t,n.registerListeners(),n} Ka(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ns.MANIFEST_PARSED, this.onManifestParsed,this),e.on(Ns.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls; e&&(e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ns.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ns.ERROR,this.onError,this))}, n.pathways=function(){var e; return ba(e=this.levels||[]).call(e,function(e,t){return-1===o(e).call(e,t.pathwayId)&&e.push(t.pathwayId),e},[])},n.startLoad=function(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){var e= 1E3*this.timeToLoad-(performance.now()-this.updated); if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}},n.stopLoad=function(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}, n.clearTimeout=function(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)},n.destroy=function(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks= this.subtitleTracks=null},n.removeLevel=function(e){var t=this.levels; t&&(this.levels=Oa(t).call(t,function(t){return t!==e}))},n.onManifestLoading=function(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels= this.audioTracks=this.subtitleTracks=null},n.onManifestLoaded=function(e,t){var n=t.contentSteering; null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())},n.onManifestParsed=function(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks},n.onError=function(e, t){var n=t.errorAction; if(2===(null==n?void 0:n.action)&&1===ns(n)){var r=this.levels,i=this._pathwayPriority,o=this.pathwayId;if(t.context){var a=t.context,s=a.groupId,u=a.pathwayId,l=a.type;s&&r?o=this.getPathwayForGroupId(s, l,o):u&&(o=u)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!i&&r&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==o),t.details!== xs.BUFFER_APPEND_ERROR||t.fatal?n.resolved||this.warn("Could not resolve "+t.details+' ("'+t.error.message+'") with content-steering for Pathway: '+o+" levels: "+(r?r.length:r)+" priorities: "+pl(i)+" penalized: "+ pl(this.penalizedPathways)):n.resolved=!0}},n.filterParsedLevels=function(e){this.levels=e; var t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){var n=e[0].pathwayId;this.log("No levels found in Pathway "+this.pathwayId+'. Setting initial Pathway to "'+n+'"'),t=this.getLevelsForPathway(n), this.pathwayId=n}return t.length!==e.length&&this.log("Found "+t.length+"/"+e.length+' levels in Pathway "'+this.pathwayId+'"'),t},n.getLevelsForPathway=function(e){var t; return null===this.levels?[]:Oa(t=this.levels).call(t,function(t){return e===t.pathwayId})},n.updatePathwayPriority=function(e){var t,n; this._pathwayPriority=e;var r=this.penalizedPathways,i=performance.now();f(t=Fa(r)).call(t,function(e){i-r[e]>3E5&&delete r[e]}); for(var o=0;o0){this.log('Setting Pathway to "'+ a+'"'),this.pathwayId=a,Td(n),this.hls.trigger(Ns.LEVELS_UPDATED,{levels:n});var l=this.hls.levels[s];u&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==u.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==u.bitrate&& this.log("Unstable Pathways change from bitrate "+u.bitrate+" to "+l.bitrate),this.hls.nextLoadLevel=s);break}}}},n.getPathwayForGroupId=function(e,t,n){for(var r,i=ls(r=this.getLevelsForPathway(n)).call(r, this.levels||[]),o=0;o0)for(var o,a=0,s=i.length;a d||s.status>=400&&s.status<500)o(new Vp({type:Ds.KEY_SYSTEM_ERROR,details:xs.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:s,response:{url:a,data:void 0,code:s.status, text:s.statusText}},"License Request XHR failed ("+a+"). Status: "+s.status+" ("+s.statusText+")"));else{var h=d-n._requestLicenseFailureCount+1;n.warn("Retrying license request, "+h+" attempts left"), n.requestLicense(e,t).then(i,o)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=s,n.setupLicenseXHR(s,a,e,t).then(function(t){var r=t.xhr,i=t.licenseChallenge; e.keySystem==Dc&&(i=n.unpackPlayReadyKeyMessage(r,i)),r.send(i)})["catch"](o)})},n.onDestroying=function(){this.unregisterListeners(),this._clear()},n.onMediaAttached=function(e,t){if(this.config.emeEnabled){var n= t.media; this.media=n,Cd(n,"encrypted",this.onMediaEncrypted),Cd(n,"waitingforkey",this.onWaitingForKey)}},n.onMediaDetached=function(){var e=this.media; e&&(Od(e,"encrypted",this.onMediaEncrypted),Od(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)},n._clear=function(){var e,n,r,i=this; if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={},this.mediaKeys||this.mediaKeySessions.length){var o=this.media,a=Ea(e=this.mediaKeySessions).call(e);this.mediaKeySessions= [],this.mediaKeys=null,qc.clearKeyUriToKeyIdMap();var s=a.length;t.CDMCleanupPromise=d.all(ls(n=Ma(a).call(a,function(e){return i.removeSession(e)})).call(n,(null==o||null==(r=o.setMediaKeys(null))?void 0: r["catch"](function(e){i.log("Could not clear media keys: "+e),i.hls&&i.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR, details:xs.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error("Could not clear media keys: "+e)})}))||d.resolve()))["catch"](function(e){i.log("Could not close sessions and clear media keys: "+ e),i.hls&&i.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR, details:xs.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error("Could not close sessions and clear media keys: "+e)})}).then(function(){s&&i.log("finished closing key sessions and clearing media keys")})}}, n.onManifestLoading=function(){this.keyFormatPromise=null,this.bannedKeyIds={}},n.onManifestLoaded=function(e,t){var n=t.sessionKeys; if(n&&this.config.emeEnabled&&!this.keyFormatPromise){var r=ba(n).call(n,function(e,t){return-1===o(e).call(e,t.keyFormat)&&e.push(t.keyFormat),e},[]); this.log("Selecting key-system from session-keys "+r.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(r)}},n.removeSession=function(e){var t=this,n=e.mediaKeysSession,r=e.licenseXhr,i=e.decryptdata; if(n){var a;this.log('Remove licenses and keys and close session "'+n.sessionId+'" keyId: '+tu((null==i?void 0:i.keyId)||[])),e._onmessage&&(n.removeEventListener("message",e._onmessage),e._onmessage=void 0), e._onkeystatuseschange&&(n.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata= e.licenseXhr=void 0;var u,l=o(a=this.mediaKeySessions).call(a,e);l>-1&&s(u=this.mediaKeySessions).call(u,l,1);var c,h=e.keyStatusTimeouts;h&&f(c=Fa(h)).call(c,function(e){return self.clearTimeout(h[e])}); var p=function(e){var t;return!(!e||"persistent-license"!==e.sessionType&&(null==(t=e.sessionTypes)||!qa(t).call(t,function(e){return"persistent-license"===e})))}(this.config.drmSystemOptions)?new d(function(e, t){T(function(){return t(new Error("MediaKeySession.remove() timeout"))},8E3),n.remove().then(e)["catch"](t)}):d.resolve(); return p["catch"](function(e){t.log("Could not remove session: "+e),t.hls&&t.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR,details:xs.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error("Could not remove session: "+ e)})}).then(function(){return n.close()})["catch"](function(e){t.log("Could not close session: "+e),t.hls&&t.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR, details:xs.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error("Could not close session: "+e)})})}return d.resolve()},t}(zs); function Fp(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return tu(e.keyId)} function Bp(e,t){return e.keyId&&t.mediaKeysSession.keyStatuses.has(e.keyId)?t.mediaKeysSession.keyStatuses.get(e.keyId):e.matches(t.decryptdata)?t.keyStatus:void 0} Up.CDMCleanupPromise=void 0;var Vp=function(e){function t(t,n){var r;return(r=e.call(this,n)||this).data=void 0,t.error||(t.error=new Error(n)),r.data=t,t.err=t.error,r} return Ka(t,e),t}(ds(Error)); function Hp(e,t){var n="output-restricted"===e,r=n?xs.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:xs.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Vp({type:Ds.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:t},n? "HDCP level output restricted":'key status changed to "'+e+'"')} var jp=function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController= void 0,this.hls=e,this.registerListeners()} var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(Ns.MEDIA_DETACHING, this.onMediaDetaching,this)},t.unregisterListeners=function(){this.hls.off(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this)},t.destroy=function(){this.timer&& clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var n=this.hls.config; if(n.capLevelOnFPSDrop){var r,i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer), this.timer=za(l(r=this.checkFPSInterval).call(r,this),n.fpsDroppedMonitoringPeriod)}},t.onMediaDetaching=function(){this.media=null},t.checkFPS=function(e,t,n){var r=performance.now(); if(t){if(this.lastTime){var i=r-this.lastTime,o=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,s=1E3*o/i,u=this.hls;if(u.trigger(Ns.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:n}), s>0&&o>u.config.fpsDroppedMonitoringThreshold*a){var l=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>= l)&&(l-=1,u.trigger(Ns.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:u.currentLevel}),u.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames= t}},t.checkFPSInterval=function(){var e=this.media; if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}, e}(); function Gp(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()} var Kp=.025,zp=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({}); function Wp(e,t,n){return e.identifier+"-"+(n+1)+"-"+Gp(t)} var qp=function(){function e(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1, this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,"in":!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse= null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)} var t=e.prototype;return t.setDateRange=function(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT", this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)},t.reset=function(){var e; this.appendInPlaceStarted=!1,null==(e=this.assetListLoader)||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)},t.isAssetPastPlayoutLimit= function(e){var t; if(e>0&&e>=this.assetList.length)return!0;var n=this.playoutLimit;return!(e<=0||isNaN(n))&&(0===n||((null==(t=this.assetList[e])?void 0:t.startOffset)||0)>n)},t.findAssetIndex=function(e){var t; return o(t=this.assetList).call(t,e)},t.toString=function(){return'["'+(e=this).identifier+'" '+(e.cue.pre?"\x3cpre\x3e":e.cue.post?"\x3cpost\x3e":"")+e.timelineStart.toFixed(2)+"-"+e.resumeTime.toFixed(2)+ "]"; var e},Ra(e,[{key:"identifier", get:function get(){return this.dateRange.id}}, {key:"startDate",get:function get(){return this.dateRange.startDate}}, {key:"startTime",get:function get(){var e=this.dateRange.startTime;if(this.snapOptions.out){var t=this.dateRange.tagAnchor;if(t)return Zp(e,t)}return e}}, {key:"startOffset",get:function get(){return this.cue.pre?0:this.startTime}}, {key:"startIsAligned",get:function get(){if(0===this.startTime||this.snapOptions.out)return!0;var e=this.dateRange.tagAnchor;if(e){var t=this.dateRange.startTime;return t-Zp(t,e)<.1}return!1}}, {key:"resumptionOffset",get:function get(){var e=this.resumeOffset,t=Os(e)?e:this.duration;return this.cumulativeDuration+t}}, {key:"resumeTime",get:function get(){var e=this.startOffset+this.resumptionOffset;if(this.snapOptions["in"]){var t=this.resumeAnchor;if(t)return Zp(e,t)}return e}}, {key:"appendInPlace",get:function get(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)|| this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)0||null!==this.assetListResponse}}])}(); function Zp(e,t){return e-t.start= n-.02},t.reachedPlayout=function(e){var t=this.interstitial.playoutLimit; return this.startOffset+e>=t},t.getAssetTime=function(e){var t=this.timelineOffset,n=this.duration; return Math.min(Math.max(0,e-t),n)},t.removeMediaListeners=function(){var e=this.mediaAttached; e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))},t.bufferSnapShot=function(){var e; this.mediaAttached&&null!=(e=this.hls)&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)},t.destroy=function(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks= this.mediaAttached=this.checkPlayout=null},t.attachMedia=function(e){var t; this.loadSource(),null==(t=this.hls)||t.attachMedia(e)},t.detachMedia=function(){var e; this.removeMediaListeners(),this.mediaAttached=null,null==(e=this.hls)||e.detachMedia()},t.resumeBuffering=function(){var e; null==(e=this.hls)||e.resumeBuffering()},t.pauseBuffering=function(){var e; null==(e=this.hls)||e.pauseBuffering()},t.transferMedia=function(){var e; return this.bufferSnapShot(),(null==(e=this.hls)?void 0:e.transferMedia())||null},t.resetDetails=function(){var e=this.hls; if(e&&this.hasDetails){var t,n,r;e.stopLoad();var i=function i(e){return delete e.details}; f(t=e.levels).call(t,i),f(n=e.allAudioTracks).call(n,i),f(r=e.allSubtitleTracks).call(r,i),this.hasDetails=!1}},t.on=function(e,t,n){var r; null==(r=this.hls)||r.on(e,t)},t.once=function(e,t,n){var r; null==(r=this.hls)||r.once(e,t)},t.off=function(e,t,n){var r; null==(r=this.hls)||r.off(e,t)},t.toString=function(){var e; return"HlsAssetPlayer: "+Qp(this.assetItem)+" "+(null==(e=this.hls)?void 0:e.sessionId)+" "+(this.appendInPlace?"append-in-place":"")},Ra(e,[{key:"appendInPlace", get:function get(){return this.interstitial.appendInPlace}}, {key:"destroyed",get:function get(){var e;return!(null!=(e=this.hls)&&e.userConfig)}}, {key:"assetId",get:function get(){return this.assetItem.identifier}}, {key:"interstitialId",get:function get(){return this.assetItem.parentIdentifier}}, {key:"media",get:function get(){var e;return(null==(e=this.hls)?void 0:e.media)||null}}, {key:"bufferedEnd",get:function get(){var e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;var t=lc.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}}, {key:"currentTime",get:function get(){var e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}}, {key:"duration",get:function get(){var e=this.assetItem.duration;if(!e)return 0;var t=this.interstitial.playoutLimit;if(t){var n=t-this.startOffset;if(n>0&&n1/9E4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset= e}}}}])}(),$p=function(e){function t(t,n){var r; return(r=e.call(this,"interstitials-sched",n)||this).onScheduleUpdate=void 0,r.eventMap={},r.events=null,r.items=null,r.durations={primary:0,playout:0,integrated:0},r.onScheduleUpdate=t,r} Ka(t,e);var n=t.prototype;return n.destroy=function(){this.reset(),this.onScheduleUpdate=null},n.reset=function(){var e; this.eventMap={},this.setDurations(0,0,0),this.events&&f(e=this.events).call(e,function(e){return e.reset()}),this.events=this.items=null},n.resetErrorsInRange=function(e,t){var n; return this.events?ba(n=this.events).call(n,function(n,r){return e<=r.startOffset&&t>r.startOffset?(delete r.error,n+1):n},0):0},n.getEvent=function(e){return e&&this.eventMap[e]||null},n.hasEvent=function(e){return e in this.eventMap},n.findItemIndex=function(e,t){if(e.event)return this.findEventIndex(e.event.identifier); var n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);var r=this.items;if(r)for(r[n]||(void 0===t&&(t=e.start),n=this.findItemIndexAtTime(t));n>= 0&&null!=(i=r[n])&&i.event;){var i;n--}return n},n.findItemIndexAtTime=function(e,t){var n=this.items; if(n)for(var r=0;ri.start&&e1)for(var i=0;ia&&(t.005||Math.abs(e.playout.end-i[t].playout.end)>.005}))&&(this.items=o,this.onScheduleUpdate(t,i))}},n.parseDateRanges=function(e,t,n){for(var r=[],i=Fa(e),o=0;o.033){var b=a,S=s;s+=T;var w=o;o+=T;var A={previousEvent:e[r-1]||null,nextEvent:t,start:b,end:b+T,playout:{start:w,end:o},integrated:{start:S,end:s}};n.push(A)}else T>0&& c&&(c.cumulativeDuration+=T,n[n.length-1].end=h)}l&&(m=y),t.timelineStart=y;var R=s;s+=p;var L=o;o+=f,n.push({event:t,start:y,end:m,playout:{start:L,end:o},integrated:{start:R,end:s}})}var I=t.resumeTime; a=l||I>i?i:I}),aKp)return this.log('"'+e.identifier+'" resumption '+r+" not aligned with estimated timeline end "+i),!1;var o=Fa(t);return!qa(o).call(o,function(i){var o=t[i].details,a=o.edge;if(r>=a)return n.log('"'+ e.identifier+'" resumption '+r+" past "+i+" playlist end "+a),!1;var s=Al(null,o.fragments,r);if(!s)return n.log('"'+e.identifier+'" resumption '+r+" does not align with any fragments in "+i+" playlist ("+ o.fragStart+"-"+o.fragmentEnd+")"),!0;var u="audio"===i?.175:0;return!(Math.abs(s.start-r)=i.end){var o,a=r.findItemIndex(i),s=r.schedule.findItemIndexAtTime(e);if(-1===s&&(s=a+(n?-1:1),r.log("seeked "+(n?"back ":"")+"to position not covered by schedule "+ e+" (resolving from "+a+" to "+s+")")),!r.isInterstitial(i)&&null!=(o=r.media)&&o.paused&&(r.shouldPlay=!1),!n&&s>a){var u=r.schedule.findJumpRestrictedIndex(a+1,s);if(u>a)return void r.setSchedulePosition(u)}r.setSchedulePosition(s)}else{var l= r.playingAsset;if(l){var c,d=l.timelineStart,h=l.duration||0;(n&&e=d+h)&&(null!=(c=i.event)&&c.appendInPlace&&(r.clearInterstitial(i.event,i),r.flushFrontBuffer(e)),r.setScheduleToAssetAtTime(e,l))}else if(r.playingLastItem&& r.isInterstitial(i)){var f=i.event.assetList[0];f&&(r.endedItem=r.playingItem,r.playingItem=null,r.setScheduleToAssetAtTime(e,f))}}else r.checkBuffer()}}},r.onTimeupdate=function(){var e=r.currentTime; if(void 0!==e&&!r.playbackDisabled&&e>r.timelinePos){r.timelinePos=e,e>r.bufferedPos&&r.checkBuffer();var t=r.playingItem;if(t&&!r.playingLastItem){if(e>=t.end){r.timelinePos=t.end;var n=r.findItemIndex(t); r.setSchedulePosition(n+1)}var i=r.playingAsset;i&&e>=i.timelineStart+(i.duration||0)&&r.setScheduleToAssetAtTime(e,i)}}},r.onScheduleUpdate=function(e,t){var n,i=r.schedule; if(i){var o=r.playingItem,a=i.events||[],s=i.items||[],u=i.durations,l=Ma(e).call(e,function(e){return e.identifier}),c=!(!a.length&&!l.length); (c||t)&&r.log("INTERSTITIALS_UPDATED ("+a.length+"): "+a+"\nSchedule: "+Ma(s).call(s,function(e){return ev(e)})+" pos: "+r.timelinePos),l.length&&r.log("Removed events "+l); var d=null,h=null;o&&(d=r.updateItem(o,r.timelinePos),r.itemsMatch(o,d)?r.playingItem=d:r.waitingItem=r.endedItem=null),r.waitingItem=r.updateItem(r.waitingItem),r.endedItem=r.updateItem(r.endedItem);var p= r.bufferingItem;if(p&&(h=r.updateItem(p,r.bufferedPos),r.itemsMatch(p,h)?r.bufferingItem=h:p.event&&(r.bufferingItem=r.playingItem,r.clearInterstitial(p.event,null))),f(e).call(e,function(e){var t;f(t= e.assetList).call(t,function(e){r.clearAssetPlayer(e.identifier,null)})}),f(n=r.playerQueue).call(n,function(e){if(e.interstitial.appendInPlace){var t=e.assetItem.timelineStart,n=e.timelineOffset-t; if(n)try{e.timelineOffset=t}catch(i){Math.abs(n)>Kp&&r.warn(i+' ("'+e.assetId+'" '+e.timelineOffset+"-\x3e"+t+")")}}}),c||t){if(r.hls.trigger(Ns.INTERSTITIALS_UPDATED,{events:Ea(a).call(a,0), schedule:Ea(s).call(s,0),durations:u,removedIds:l}),r.isInterstitial(o)&&gs(l).call(l,o.event.identifier))return r.warn('Interstitial "'+o.event.identifier+'" removed while playing'),void r.primaryFallback(o.event); o&&r.trimInPlace(d,o),p&&h!==d&&r.trimInPlace(h,p),r.checkBuffer()}}},r.hls=t,r.HlsPlayerClass=n,r.assetListLoader=new tv(t),r.schedule=new $p(r.onScheduleUpdate,t.logger),r.registerListeners(),r} Ka(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e&&(e.on(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ns.MEDIA_DETACHING, this.onMediaDetaching,this),e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Ns.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Ns.AUDIO_TRACK_UPDATED, this.onAudioTrackUpdated,this),e.on(Ns.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Ns.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(Ns.EVENT_CUE_ENTER,this.onInterstitialCueEnter, this),e.on(Ns.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(Ns.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Ns.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Ns.BUFFERED_TO_END,this.onBufferedToEnd, this),e.on(Ns.MEDIA_ENDED,this.onMediaEnded,this),e.on(Ns.ERROR,this.onError,this),e.on(Ns.DESTROYING,this.onDestroying,this))},n.unregisterListeners=function(){var e=this.hls; e&&(e.off(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading, this),e.off(Ns.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Ns.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Ns.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(Ns.SUBTITLE_TRACK_SWITCH, this.onSubtitleTrackSwitch,this),e.off(Ns.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(Ns.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(Ns.ASSET_LIST_LOADED,this.onAssetListLoaded, this),e.off(Ns.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Ns.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Ns.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Ns.BUFFERED_TO_END,this.onBufferedToEnd, this),e.off(Ns.MEDIA_ENDED,this.onMediaEnded,this),e.off(Ns.ERROR,this.onError,this),e.off(Ns.DESTROYING,this.onDestroying,this))},n.startLoad=function(){this.resumeBuffering()},n.stopLoad=function(){this.pauseBuffering()}, n.resumeBuffering=function(){var e; null==(e=this.getBufferingPlayer())||e.resumeBuffering()},n.pauseBuffering=function(){var e; null==(e=this.getBufferingPlayer())||e.pauseBuffering()},n.destroy=function(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(), this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null, this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null},n.onDestroying=function(){var e=this.primaryMedia||this.media; e&&this.removeMediaListeners(e)},n.removeMediaListeners=function(e){Od(e,"play",this.onPlay),Od(e,"pause",this.onPause),Od(e,"seeking",this.onSeeking),Od(e,"timeupdate",this.onTimeupdate)},n.onMediaAttaching= function(e,t){var n=this.media=t.media; Cd(n,"seeking",this.onSeeking),Cd(n,"timeupdate",this.onTimeupdate),Cd(n,"play",this.onPlay),Cd(n,"pause",this.onPause)},n.onMediaAttached=function(e,t){var n=this.effectivePlayingItem,r=this.detachedData; if(this.detachedData=null,null===n)this.checkStart();else if(!r){this.clearScheduleState();var i=this.findItemIndex(n);this.setSchedulePosition(i)}},n.clearScheduleState=function(){this.log("clear schedule state"), this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null},n.onMediaDetaching=function(e,t){var n=!!t.transferMedia,r=this.media; if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){var i=this.getBufferingPlayer();i&&(this.log("Removing schedule state for detachedData and "+i),this.playingAsset=this.endedAsset= this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}},n.isInterstitial=function(e){return!(null==e||!e.event)},n.retreiveMediaSource=function(e, t){var n=this.getAssetPlayer(e); n&&this.transferMediaFromPlayer(n,t)},n.transferMediaFromPlayer=function(e,t){var n=e.interstitial.appendInPlace,r=e.media; if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r)return void(this.detachedData={media:r});var i=e.transferMedia();this.log("transfer MediaSource from "+ e+" "+pl(i)),this.detachedData=i}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))},n.transferMediaTo=function(e,t){var n,r,i=this; if(e.media!==t){var o,a=null,s=this.hls,u=e!==s,l=u&&e.interstitial.appendInPlace,c=null==(n=this.detachedData)?void 0:n.mediaSource;if(s.media)l&&(a=s.transferMedia(),this.detachedData=a),o="Primary"; else if(c){var d=this.getBufferingPlayer();d?(a=d.transferMedia(),o=""+d):o="detached MediaSource"}else o="detached media";if(!a)if(c)a=this.detachedData,this.log("using detachedData: MediaSource "+pl(a)); else if(!this.detachedData||s.media===t){var h=this.playerQueue;h.length>1&&f(h).call(h,function(e){if(u&&e.interstitial.appendInPlace!==l){var t=e.interstitial;i.clearInterstitial(e.interstitial,null), t.appendInPlace=!1,t.appendInPlace&&i.warn("Could not change append strategy for queued assets "+t)}}),this.hls.detachMedia(),this.detachedData={media:t}}var p=a&&"mediaSource"in a&&"closed"!==(null==(r= a.mediaSource)?void 0:r.readyState),v=p&&a?a:t; this.log((p?"transfering MediaSource":"attaching media")+" to "+(u?e:"Primary")+" from "+o+" (media.currentTime: "+t.currentTime+")");var g=this.schedule;if(v===a&&g){var y=u&&e.assetId===g.assetIdAtEnd; v.overrides={duration:g.duration,endOfStream:!u||y,cueRemoval:!u}}e.attachMedia(v)}},n.onInterstitialCueEnter=function(){this.onTimeupdate()},n.checkStart=function(){var e=this.schedule,t=null==e?void 0: e.events; if(t&&!this.playbackDisabled&&this.media){-1===this.bufferedPos&&(this.bufferedPos=0);var n=this.timelinePos,r=this.effectivePlayingItem;if(-1===n){var i=this.hls.startPosition;if(this.log(ov("checkStart", i)),this.timelinePos=i,t.length&&t[0].cue.pre){var o=e.findEventIndex(t[0].identifier);this.setSchedulePosition(o)}else if(i>=0||!this.primaryLive){var a=this.timelinePos=i>0?i:0,s=e.findItemIndexAtTime(a); this.setSchedulePosition(s)}}else if(r&&!this.playingItem){var u=e.findItemIndex(r);this.setSchedulePosition(u)}}},n.advanceAssetBuffering=function(e,t){var n=e.event,r=n.findAssetIndex(t),i=Xp(n,r); if(n.isAssetPastPlayoutLimit(i)){if(this.schedule){var o,a=null==(o=this.schedule.items)?void 0:o[this.findItemIndex(e)+1];a&&this.bufferedToItem(a)}}else this.bufferedToEvent(e,i)},n.advanceAfterAssetEnded= function(e,t,n){var r=Xp(e,n); if(e.isAssetPastPlayoutLimit(r)){if(this.schedule){var i=this.schedule.items;if(i){var o=t+1;if(o>=i.length)return void this.setSchedulePosition(-1);var a=e.resumeTime;this.timelinePos=0?r[e]:null;this.log("setSchedulePosition "+e+", "+t+" ("+(i?ev(i):i)+") pos: "+this.timelinePos);var o=this.waitingItem||this.playingItem,a=this.playingLastItem; if(this.isInterstitial(o)){var s=o.event,u=this.playingAsset,l=null==u?void 0:u.identifier,c=l?this.getAssetPlayer(l):null;if(c&&l&&(!this.eventItemsMatch(o,i)||void 0!==t&&l!==s.assetList[t].identifier)){var d, h=s.findAssetIndex(u);if(this.log("INTERSTITIAL_ASSET_ENDED "+(h+1)+"/"+s.assetList.length+" "+Qp(u)),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(Ns.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:h, event:s,schedule:Ea(r).call(r,0),scheduleIndex:e,player:c}),o!==this.playingItem)return void(this.itemsMatch(o,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(s,this.findItemIndex(this.playingItem), h));this.retreiveMediaSource(l,i),!c.media||null!=(d=this.detachedData)&&d.mediaSource||c.detachMedia()}if(!this.eventItemsMatch(o,i)&&(this.endedItem=o,this.playingItem=null,this.log("INTERSTITIAL_ENDED "+ s+" "+ev(o)),s.hasPlayed=!0,this.hls.trigger(Ns.INTERSTITIAL_ENDED,{event:s,schedule:Ea(r).call(r,0),scheduleIndex:e}),s.cue.once)){var f;this.updateSchedule();var p=null==(f=this.schedule)?void 0:f.items; if(i&&p){var v=this.findItemIndex(i);this.advanceSchedule(v,p,t,o,a)}return}}this.advanceSchedule(e,r,t,o,a)}},n.advanceSchedule=function(e,t,n,r,i){var o=this,a=this.schedule; if(a){var s=t[e]||null,u=this.primaryMedia,l=this.playerQueue;if(l.length&&f(l).call(l,function(t){var n=t.interstitial,r=a.findEventIndex(n.identifier);(re+1)&&o.clearInterstitial(n,s)}),this.isInterstitial(s)){this.timelinePos= Math.min(Math.max(this.timelinePos,s.start),s.end); var c=s.event;if(void 0===n){var d=Xp(c,(n=a.findAssetIndex(c,this.timelinePos))-1);if(c.isAssetPastPlayoutLimit(d)||c.appendInPlace&&this.timelinePos===s.end)return void this.advanceAfterAssetEnded(c, e,n);n=d}var h=this.waitingItem;this.assetsBuffered(s,u)||this.setBufferingItem(s);var p=this.preloadAssets(c,n);if(this.eventItemsMatch(s,h||r)||(this.waitingItem=s,this.log("INTERSTITIAL_STARTED "+ev(s)+ " "+(c.appendInPlace?"append in place":"")),this.hls.trigger(Ns.INTERSTITIAL_STARTED,{event:c,schedule:Ea(t).call(t,0),scheduleIndex:e})),!c.assetListLoaded)return void this.log("Waiting for ASSET-LIST to complete loading "+ c);if(c.assetListLoader&&(c.assetListLoader.destroy(),c.assetListLoader=void 0),!u)return void this.log("Waiting for attachMedia to start Interstitial "+c);this.waitingItem=this.endedItem=null,this.playingItem= s;var v=c.assetList[n];if(!v)return void this.advanceAfterAssetEnded(c,e,n||0);if(p||(p=this.getAssetPlayer(v.identifier)),null===p||p.destroyed){var g=c.assetList.length;this.warn("asset "+(n+1)+"/"+g+ " player destroyed "+c),(p=this.createAssetPlayer(c,v,n)).loadSource()}if(!this.eventItemsMatch(s,this.bufferingItem)&&c.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(p,n,t,e,u),this.shouldPlay&& iv(p.media)}else s?(this.resumePrimary(s,e,r),this.shouldPlay&&iv(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(a.durations.primary, null))}},n.resumePrimary=function(e,t,n){var r,i; if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log("resuming "+ev(e)),null==(r=this.detachedData)||!r.mediaSource){var o=this.timelinePos; (o=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(ov("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(n){var a=null==(i=this.schedule)?void 0:i.items;a&&(this.log("INTERSTITIALS_PRIMARY_RESUMED "+ ev(e)),this.hls.trigger(Ns.INTERSTITIALS_PRIMARY_RESUMED,{schedule:Ea(a).call(a,0),scheduleIndex:t}),this.checkBuffer())}},n.getPrimaryResumption=function(e,t){var n=e.start; if(this.primaryLive){var r=this.primaryDetails;if(0===t)return this.hls.startPosition;if(r&&(nr.edge))return this.hls.liveSyncPosition||-1}return n},n.isAssetBuffered=function(e){var t= this.getAssetPlayer(e.identifier); return null!=t&&t.hls?t.hls.bufferedToEnd:lc.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)},n.attachPrimary=function(e,t,n){t?this.setBufferingItem(t):this.bufferingItem= this.playingItem,this.bufferingAsset=null; var r=this.primaryMedia;if(r){var i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log(ov("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e, n))}},n.startLoadingPrimaryAt=function(e,t){var n,r=this.hls; !r.loadingEnabled||!r.media||Math.abs(((null==(n=r.mainForwardBufferInfo)?void 0:n.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()},n.onManifestLoading=function(){var e; this.stopLoad(),null==(e=this.schedule)||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager= this.requiredTracks=null,this.hls.off(Ns.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(Ns.BUFFER_CODECS,this.onBufferCodecs,this)},n.onLevelUpdated=function(e,t){if(-1!==t.level&&this.schedule){var n= this.hls.levels[t.level]; if(n.details){var r=rv(rv({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&& this.schedule.items&&this.checkStart()}}},n.onAudioTrackUpdated=function(e,t){var n=this.hls.audioTracks[t.id],r=this.mediaSelection; if(r){var i=rv(rv({},r),{},{audio:n});this.mediaSelection=i}else this.altSelection=rv(rv({},this.altSelection),{},{audio:n})},n.onSubtitleTrackUpdated=function(e,t){var n=this.hls.subtitleTracks[t.id], r=this.mediaSelection; if(r){var i=rv(rv({},r),{},{subtitles:n});this.mediaSelection=i}else this.altSelection=rv(rv({},this.altSelection),{},{subtitles:n})},n.onAudioTrackSwitching=function(e,t){var n,r=yl(t); f(n=this.playerQueue).call(n,function(e){var n=e.hls;return n&&(n.setAudioOption(t)||n.setAudioOption(r))})},n.onSubtitleTrackSwitch=function(e,t){var n,r=yl(t); f(n=this.playerQueue).call(n,function(e){var n=e.hls;return n&&(n.setSubtitleOption(t)||-1!==t.id&&n.setSubtitleOption(r))})},n.onBufferCodecs=function(e,t){var n=t.tracks; n&&(this.requiredTracks=n)},n.onBufferAppended=function(e,t){this.checkBuffer()},n.onBufferFlushed=function(e,t){var n=this.playingItem; if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){var r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}},n.onBufferedToEnd=function(e){if(this.schedule){var t=this.schedule.events; if(this.bufferedPos.25){var r;f(r=e.event.assetList).call(r,function(t,r){e.event.isAssetPastPlayoutLimit(r)&&n.clearAssetPlayer(t.identifier,null)}); var i=e.end+.25,o=lc.bufferInfo(this.primaryMedia,i,0);(o.end>i||(o.nextStart||0)>i)&&(this.log("trim buffered interstitial "+ev(e)+" (was "+ev(t)+")"),this.attachPrimary(i,null,!0),this.flushFrontBuffer(i))}}, n.itemsMatch=function(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))},n.eventItemsMatch=function(e,t){var n; return!!t&&(e===t||e.event.identifier===(null==(n=t.event)?void 0:n.identifier))},n.findItemIndex=function(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1},n.updateSchedule=function(e){var t; void 0===e&&(e=!1);var n=this.mediaSelection;n&&(null==(t=this.schedule)||t.updateSchedule(n,[],e))},n.checkBuffer=function(e){var t,n=null==(t=this.schedule)?void 0:t.items; if(n){var r=lc.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=r.len<1),this.updateBufferedPos(r.end,n,e)}},n.updateBufferedPos=function(e,t,n){var r=this.schedule, i=this.bufferingItem; if(!(this.bufferedPos>e)&&r)if(1===t.length&&this.itemsMatch(t[0],i))this.bufferedPos=e;else{var o=this.playingItem,a=this.findItemIndex(o),s=r.findItemIndexAtTime(e);if(this.bufferedPos=i.end||null!=(u=d.event)&&u.appendInPlace&&e+.01>=d.start)&&(s=c),this.isInterstitial(i)){var h=i.event;if(c-a>1&&!1===h.appendInPlace)return;if(0=== h.assetList.length&&h.assetListLoader)return}if(this.bufferedPos=e,s>l&&s>a)this.bufferedToItem(d);else{var f=this.primaryDetails;this.primaryLive&&f&&e>f.edge-f.targetduration&&d.start0&&(a=Math.round(1E3*d)/1E3)}if(this.log("Load interstitial asset "+ (t+1)+"/"+(n?1:r)+" "+e+(a?" live-start: "+c+" start-offset: "+a:"")),n)return this.createAsset(e,0,0,s,e.duration,n);var h=this.assetListLoader.loadAssetList(e,a);h&&(e.assetListLoader=h)}else if(!o&& r){for(var f=t;f1){var h=t.duration;h&&dc)&&(y=!1,r.log('Interstitial asset "'+ f+'" duration change '+c+" \x3e "+l),t.duration=l,r.updateSchedule())}}; g.on(Ns.LEVEL_UPDATED,function(e,t){var n=t.details;return m(n)}),g.on(Ns.LEVEL_PTS_UPDATED,function(e,t){var n=t.details; return m(n)}),g.on(Ns.EVENT_CUE_ENTER,function(){return r.onInterstitialCueEnter()}); var _=function _(e,t){var n=r.getAssetPlayer(f);if(n&&t.tracks){n.off(Ns.BUFFER_CODECS,_),n.tracks=t.tracks;var i=r.primaryMedia;r.bufferingAsset===n.assetItem&&i&&!n.media&&r.bufferAssetPlayer(n,i)}}; g.on(Ns.BUFFER_CODECS,_),g.on(Ns.BUFFERED_TO_END,function(){var n,i=r.getAssetPlayer(f);if(r.log("buffered to end of asset "+i),i&&r.schedule){var o=r.schedule.findEventIndex(e.identifier),a=null==(n=r.schedule.items)? void 0:n[o];r.isInterstitial(a)&&r.advanceAssetBuffering(a,t)}}); var E=function E(t){return function(){if(r.getAssetPlayer(f)&&r.schedule){r.shouldPlay=!0;var n=r.schedule.findEventIndex(e.identifier);r.advanceAfterAssetEnded(e,n,t)}}}; return g.once(Ns.MEDIA_ENDED,E(n)),g.once(Ns.PLAYOUT_LIMIT_REACHED,E(1/0)),g.on(Ns.ERROR,function(t,i){if(r.schedule){var o=r.getAssetPlayer(f);if(i.details===xs.BUFFER_STALLED_ERROR)return null!=o&&o.appendInPlace? void r.handleInPlaceStall(e):(r.onTimeupdate(),void r.checkBuffer(!0));r.handleAssetItemError(i,e,r.schedule.findEventIndex(e.identifier),n,"Asset player error "+i.error+" "+e)}}),g.on(Ns.DESTROYING,function(){if(r.getAssetPlayer(f)&& r.schedule){var t=new Error("Asset player destroyed unexpectedly "+f),i={fatal:!0, type:Ds.OTHER_ERROR,details:xs.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};r.handleAssetItemError(i,e,r.schedule.findEventIndex(e.identifier),n,t.message)}}),this.log("INTERSTITIAL_ASSET_PLAYER_CREATED "+Qp(t)), this.hls.trigger(Ns.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t, assetListIndex:n,event:e,player:g}),g},n.clearInterstitial=function(e,t){var n,r=this; f(n=e.assetList).call(n,function(e){r.clearAssetPlayer(e.identifier,t)}),e.reset()},n.resetAssetPlayer=function(e){var t=this.getAssetPlayerQueueIndex(e); if(-1!==t){this.log('reset asset player "'+e+'" after error');var n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}},n.clearAssetPlayer=function(e,t){var n=this.getAssetPlayerQueueIndex(e); if(-1!==n){var r,i=this.playerQueue[n];this.log("clear "+i+" toSegment: "+(t?ev(t):t)),this.transferMediaFromPlayer(i,t),s(r=this.playerQueue).call(r,n,1),i.destroy()}},n.emptyPlayerQueue=function(){for(var e;e= this.playerQueue.pop();)e.destroy(); this.playerQueue=[]},n.startAssetPlayer=function(e,t,n,r,i){var o=e.interstitial,a=e.assetItem,s=e.assetId,u=o.assetList.length,l=this.playingAsset; this.endedAsset=null,this.playingAsset=a,l&&l.identifier===s||(l&&(this.clearAssetPlayer(l.identifier,n[r]),delete l.error),this.log("INTERSTITIAL_ASSET_STARTED "+(t+1)+"/"+u+" "+Qp(a)),this.hls.trigger(Ns.INTERSTITIAL_ASSET_STARTED, {asset:a,assetListIndex:t,event:o,schedule:Ea(n).call(n,0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,i)},n.bufferAssetPlayer=function(e,t){var n,r; if(this.schedule){var i=e.interstitial,o=e.assetItem,a=this.schedule.findEventIndex(i.identifier),s=null==(n=this.schedule.items)?void 0:n[a];if(s){e.loadSource(),this.setBufferingItem(s),this.bufferingAsset= o;var u=this.getBufferingPlayer();if(u!==e){var l=i.appendInPlace;if(!l||!1!==(null==u?void 0:u.interstitial.appendInPlace)){var c=(null==u?void 0:u.tracks)||(null==(r=this.detachedData)?void 0:r.tracks)|| this.requiredTracks;if(l&&o!==this.playingAsset){if(!e.tracks)return void this.log("Waiting for track info before buffering "+e);if(c&&!$s(c,e.tracks)){var d=new Error("Asset "+Qp(o)+" SourceBuffer tracks ('"+ Fa(e.tracks)+"') are not compatible with primary content tracks ('"+Fa(c)+"')"),h={fatal:!0,type:Ds.OTHER_ERROR,details:xs.INTERSTITIAL_ASSET_ITEM_ERROR,error:d},f=i.findAssetIndex(o);return void this.handleAssetItemError(h, i,a,f,d.message)}}this.transferMediaTo(e,t)}}}}},n.handleInPlaceStall=function(e){var t=this.schedule,n=this.primaryMedia; if(t&&n){var r=n.currentTime,i=t.findAssetIndex(e,r),o=e.assetList[i];if(o){var a=this.getAssetPlayer(o.identifier);if(a){var s=a.currentTime||r-o.timelineStart,u=a.duration-s;if(this.warn("Stalled at "+ s+" of "+(s+u)+" in "+a+" "+e+" (media.currentTime: "+r+")"),s&&(u/n.playbackRate<.5||a.bufferedInPlaceToEnd(n))&&a.hls){var l=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,l,i)}}}}},n.advanceInPlace= function(e){var t=this.primaryMedia; t&&t.currentTimey.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==g)return o.error=new Error("Interstitial no longer within playback range "+this.timelinePos+ " "+o),this.updateSchedule(!0),void this.primaryFallback(o);this.setBufferingItem(y)}this.setSchedulePosition(g)}else if((null==p?void 0:p.identifier)===a){var m=o.assetList[0];if(m){var _=this.getAssetPlayer(m.identifier); if(p.appendInPlace){var E=this.primaryMedia;_&&E&&this.bufferAssetPlayer(_,E)}else _&&_.loadSource()}}}},n.onError=function(e,t){if(this.schedule)switch(t.details){case xs.ASSET_LIST_PARSING_ERROR:case xs.ASSET_LIST_LOAD_ERROR:case xs.ASSET_LIST_LOAD_TIMEOUT:var n= t.interstitial; n&&(this.updateSchedule(!0),this.primaryFallback(n));break;case xs.BUFFER_STALLED_ERROR:var r=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&r.event.appendInPlace)return void this.handleInPlaceStall(r.event); this.log("Primary player stall @"+this.timelinePos+" bufferedPos: "+this.bufferedPos),this.onTimeupdate(),this.checkBuffer(!0)}},Ra(t,[{key:"interstitialsManager", get:function get(){if(!this.hls)return null;if(this.manager)return this.manager;var e=this,t=function t(){return e.bufferingItem||e.waitingItem},n=function n(t){return t?e.getAssetPlayer(t.identifier): t},r=function r(t,_r32,o,a,s){if(t){var u=t[_r32].start,l=t.event; if(l){if("playout"===_r32||l.timelineOccupancy!==zp.Point){var c=n(o);(null==c?void 0:c.interstitial)===l&&(u+=c.assetItem.startOffset+c[s])}}else u+=("bufferedPos"===a?i():e[a])-t.start;return u}return 0}, i=function i(){var t=e.bufferedPos; return t===Number.MAX_VALUE?o("primary"):Math.max(t,0)},o=function o(t){var n,r; return null!=(n=e.primaryDetails)&&n.live?e.primaryDetails.edge:(null==(r=e.schedule)?void 0:r.durations[t])||0},a=function a(t,i){var o,a,s=e.effectivePlayingItem; if((null==s||null==(o=s.event)||!o.restrictions.skip)&&e.schedule){e.log("seek to "+t+' "'+i+'"');var u=e.effectivePlayingItem,l=e.schedule.findItemIndexAtTime(t,i),c=null==(a=e.schedule.items)?void 0: a[l],d=e.getBufferingPlayer(),h=null==d?void 0:d.interstitial,f=null==h?void 0:h.appendInPlace,p=u&&e.itemsMatch(u,c);if(u&&(f||p)){var v=n(e.playingAsset),g=(null==v?void 0:v.media)||e.primaryMedia;if(g){var y= "primary"===i?g.currentTime:r(u,i,e.playingAsset,"timelinePos","currentTime"),m=t-y,_=(f?y:g.currentTime)+m;if(_>=0&&(!v||f||_<=v.duration))return void(g.currentTime=_)}}if(c){var E=t;if("primary"!==i){var T= t-c[i].start;E=c.start+T}var b=!e.isInterstitial(c);if(e.isInterstitial(u)&&!u.event.appendInPlace||!b&&!c.event.appendInPlace){if(u){var S=e.findItemIndex(u);if(l>S){var w=e.schedule.findJumpRestrictedIndex(S+ 1,l);if(w>S)return void e.setSchedulePosition(w)}var A=0;if(b)e.timelinePos=E,e.checkBuffer();else for(var R=c.event.assetList,L=t-(c[i]||c).start,I=R.length;I--;){var C=R[I];if(C.duration&&L>=C.startOffset&& L0?t:0},set currentTime(e){a(e,"primary")},get duration(){return o("primary")},get seekableStart(){var t;return(null==(t=e.primaryDetails)?void 0:t.fragmentStart)|| 0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos", "currentTime")},set currentTime(e){a(e,"integrated")},get duration(){return o("integrated")},get seekableStart(){var t;return function(t,n){var r;if(0!==t&&null!=(r=e.schedule)&&r.length){var i,o=e.schedule.findItemIndexAtTime(t), a=null==(i=e.schedule.items)?void 0:i[o];if(a)return t+(a.integrated.start-a.start)}return t}((null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0)}}, skip:function skip(){var t=e.effectivePlayingItem,n=null==t?void 0:t.event;if(n&&!n.restrictions.skip){var r=e.findItemIndex(t);if(n.appendInPlace){var i=t.playout.start+t.event.duration;a(i+.001,"playout")}else e.advanceAfterAssetEnded(n, r,1/0)}}}}}, {key:"effectivePlayingItem",get:function get(){return this.waitingItem||this.playingItem||this.endedItem}}, {key:"effectivePlayingAsset",get:function get(){return this.playingAsset||this.endedAsset}}, {key:"playingLastItem",get:function get(){var e,t=this.playingItem,n=null==(e=this.schedule)?void 0:e.items;return!!(this.playbackStarted&&t&&n)&&this.findItemIndex(t)===n.length-1}}, {key:"playbackStarted",get:function get(){return null!==this.effectivePlayingItem}}, {key:"currentTime",get:function get(){var e,t;if(null!==this.mediaSelection){var n=this.waitingItem||this.playingItem;if(!this.isInterstitial(n)||n.event.appendInPlace){var r=this.media;!r&&null!=(e=this.bufferingItem)&& null!=(e=e.event)&&e.appendInPlace&&(r=this.primaryMedia);var i=null==(t=r)?void 0:t.currentTime;if(void 0!==i&&Os(i))return i}}}}, {key:"primaryMedia",get:function get(){var e;return this.media||(null==(e=this.detachedData)?void 0:e.media)||null}}, {key:"playbackDisabled",get:function get(){return!1===this.hls.config.enableInterstitialPlayback}}, {key:"primaryDetails",get:function get(){var e;return null==(e=this.mediaSelection)?void 0:e.main.details}}, {key:"primaryLive",get:function get(){var e;return!(null==(e=this.primaryDetails)||!e.live)}}])}(zs),sv=function(e){function t(t,n,r){var i; return(i=e.call(this,t,n,r,"subtitle-stream-controller",js)||this).currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i.cachedTrackLoadedData=null,i.registerListeners(),i} Ka(t,e);var n=t.prototype;return n.onHandlerDestroying=function(){this.unregisterListeners(),e.prototype.onHandlerDestroying.call(this),this.mainDetails=null,this.cachedTrackLoadedData=null},n.registerListeners= function(){e.prototype.registerListeners.call(this); var t=this.hls;t.on(Ns.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ns.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(Ns.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(Ns.SUBTITLE_TRACK_LOADED, this.onSubtitleTrackLoaded,this),t.on(Ns.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(Ns.BUFFER_FLUSHING,this.onBufferFlushing,this)},n.unregisterListeners=function(){e.prototype.unregisterListeners.call(this); var t=this.hls;t.off(Ns.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ns.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(Ns.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(Ns.SUBTITLE_TRACK_LOADED, this.onSubtitleTrackLoaded,this),t.off(Ns.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(Ns.BUFFER_FLUSHING,this.onBufferFlushing,this)},n.startLoad=function(e,t){this.stopLoad(),this.state= kd,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()},n.onManifestLoading=function(){e.prototype.onManifestLoading.call(this), this.mainDetails=null,this.cachedTrackLoadedData=null},n.onMediaDetaching=function(t,n){this.tracksBuffered=[],e.prototype.onMediaDetaching.call(this,t,n)},n.onLevelLoaded=function(e,t){this.mainDetails= t.details; var n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,n.id===this.currentTrackId&&this.onSubtitleTrackLoaded(Ns.SUBTITLE_TRACK_LOADED,n))},n.onSubtitleFragProcessed=function(e,t){var n=t.frag, r=t.part,i=this.tracksBuffered[this.currentTrackId]; if(i){for(var o,a=(r||n).start,s=0;s=i[s].start&&a<=i[s].end){o=i[s];break}var u=a+(r||n).duration;o?o.end=u:(o={start:a,end:u},i.push(o));var l=!n.relurl,c=!r||!lu(n)||u>=n.end&&!l; this.fragBufferedComplete(n,r),c&&(this.fragContextChanged(n)||lu(n)&&(this.fragmentTracker.fragBuffered(n),this.fragPrevious=n),this.media&&this.tickImmediate())}},n.onBufferFlushing=function(e,t){var n= t.startOffset,r=t.endOffset; if(0===n&&r!==Number.POSITIVE_INFINITY){var i,o=r-1;if(o<=0)return;t.endOffsetSubtitles=Math.max(0,o),f(i=this.tracksBuffered).call(i,function(e){if(e)for(var t=0;t=i.length)&&s){this.log("Subtitle track "+a+" loaded ["+o.startSN+","+o.endSN+"]"+(o.lastPartSn?"[part-"+o.lastPartSn+"-"+o.lastPartIndex+"]":"")+",duration:"+o.totalduration),this.mediaBuffer= this.mediaBufferTimeRanges;var u=0;if(o.live||null!=(n=s.details)&&n.live){if(o.deltaUpdateFailed)return;var l=this.mainDetails;if(!l)return this.cachedTrackLoadedData=t,void(this.startFragRequested=!1); this.cachedTrackLoadedData=null;var c,d=l.fragments[0];s.details?0===(u=this.alignPlaylists(o,s.details,null==(c=this.levelLastLoaded)?void 0:c.details))&&d&&gd(o,u=d.start):o.hasProgramDateTime&&l.hasProgramDateTime? (Id(o,l),u=o.fragmentStart):d&&gd(o,u=d.start),l&&!this.startFragRequested&&this.setStartPosition(l,u)}s.details=o,this.levelLastLoaded=s,a===r&&(this.hls.trigger(Ns.SUBTITLE_TRACK_UPDATED,{details:o,id:a, groupId:t.groupId}),this.tickImmediate())}}else this.warn("Subtitle tracks were reset while loading level "+a)},n._handleFragmentLoadProgress=function(e){var t=e.frag,n=e.part,r=e.payload; n&&null!=r&&r.byteLength&&this.shouldDecrypt(t)&&this.decryptPayload(r,t,n)},n._handleFragmentLoadComplete=function(e){var t=e.frag,n=e.payload; !this.fragContextChanged(t)&&null!=n&&n.byteLength&&this.shouldDecrypt(t)&&this.decryptPayload(n,t,null)},n.shouldDecrypt=function(e){var t=e.decryptdata; return!!(null!=t&&t.key&&t.iv&&wc(t.method))},n.decryptPayload=function(e,t,n){var r=this,i=t.decryptdata,o=performance.now(); this.decrypter.decrypt(new Uint8Array(e),i.key.buffer,i.iv.buffer,Ac(i.method)).then(function(e){r.fragContextChanged(t)||r.hls.trigger(Ns.FRAG_DECRYPTED,{frag:t,part:n,payload:e,stats:{tstart:o,tdecrypt:performance.now()}})})["catch"](function(e){r.hls.trigger(Ns.ERROR, {type:Ds.MEDIA_ERROR, details:xs.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t,part:n}),n||(r.warn(e.name+": "+e.message),r.state=kd)})},n.doTick=function(){if(this.state===kd){if(!this.media&&!this.primaryPrefetch&& (this.startFragRequested||!this.config.startFragPrefetch))return; var e=this.currentTrackId,t=this.levels,n=null==t?void 0:t[e],r=null==n?void 0:n.details;if(!r||this.waitForLive(n)||this.waitForCdnTuneIn(r))return void(this.startFragRequested=!1);var i=this.config,o= this.getLoadPosition(),a=lc.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],o,i.maxBufferHole),s=a.end,u=a.len;if(u>this.hls.maxBufferLength+r.levelTargetDuration||u&&!this.buffering)return;var l= this.getNextFragment(s,r);if(!l)return;if(lu(l)){var c,d=l.sn-r.startSN,h=r.fragments[d-1];!h||h.cc!==l.cc||null!=(c=r.partList)&&c.length||this.fragmentTracker.getState(h)!==Hl||(l=h)}this.loadFragment(l, n,s)}},n.loadFragment=function(t,n,r){(this.fragmentTracker.getState(t)===Hl||this.loadingParts&&lu(t))&&(lu(t)?e.prototype.loadFragment.call(this,t,n,r):this._loadInitSegment(t,n))},Ra(t,[{key:"mediaBufferTimeRanges", get:function get(){return new uv(this.tracksBuffered[this.currentTrackId]||[])}}])}(Gd),uv=function uv(e){this.buffered=void 0; var t=function t(_t8,n,r){if((n>>>=0)>r-1)throw new DOMException("Failed to execute '"+_t8+"' on 'TimeRanges': The index provided ("+n+") is greater than the maximum bound ("+r+")");return e[n][_t8]}; this.buffered={get length(){return e.length},end:function end(n){return t("end",n,e.length)}, start:function start(n){return t("start",n,e.length)}}}; function lv(e,t){var n;try{n=new Event("addtrack")}catch(e){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)} function cv(e,t){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t);}catch(n){Qs.debug("[texttrack-utils]: "+ n);try{var r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,function(e,t){try{e.addCue(t)}catch(o){for(var n=[t],r=e.cues,i=r.length-1;i>=0&&r[i].startTime>t.startTime;i--)n.push(r[i]),e.removeCue(r[i]); f(n).call(n,function(t){return e.addCue(t)})}}(e,r)}catch(e){Qs.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+e)}}"disabled"===n&&(e.mode=n)} function dv(e,t){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues)for(var r=e.cues.length;r--;)t&&e.cues[r].removeEventListener("enter",t),e.removeCue(e.cues[r]);"disabled"===n&&(e.mode=n)} function hv(e,t,n,r){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var o=function(e,t,n){var r=[],i=function(e,t){if(t<=e[0].startTime)return 0;var n=e.length-1;if(t>e[n].endTime)return-1; for(var r,i=0,o=n;i<=o;)if(te[r].startTime&&i-1)for(var o=i,a=e.length;o=t&&s.endTime<=n)r.push(s);else if(s.startTime>n)return r}return r}(e.cues,t,n),a=0;a-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))},n.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval), this.subtitlePollingInterval=za(this.onTextTracksChanged,e)},n.onMediaDetaching=function(e,t){var n=this.media; if(n){var r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack= this.trackId),this.subtitleTrack=-1,this.media=null,!r){var i=fv(n.textTracks);f(i).call(i,function(e){dv(e)})}}},n.onManifestLoading=function(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[], this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0},n.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},n.onSubtitleTrackLoaded=function(e,t){var n=t.id,r=t.groupId,i=t.details, o=this.tracksInGroup[n]; if(o&&o.groupId===r){var a=o.details;o.details=t.details,this.log("Subtitle track "+n+' "'+o.name+'" lang:'+o.lang+" group:"+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),n===this.trackId&&this.playlistLoaded(n, t,a)}else this.warn("Subtitle track with id:"+n+" and group:"+r+" not found in active group "+(null==o?void 0:o.groupId))},n.onLevelLoading=function(e,t){this.switchLevel(t.level)},n.onLevelSwitching=function(e, t){this.switchLevel(t.level)},n.switchLevel=function(e){var t=this.hls.levels[e]; if(t){var n=t.subtitleGroups||null,r=this.groupIds,i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&qa(n).call(n,function(e){return-1===(null==r?void 0:o(r).call(r, e))})){var a; this.groupIds=n,this.trackId=-1,this.currentTrack=null;var s=Oa(a=this.tracks).call(a,function(e){return!n||-1!==o(n).call(n,e.groupId)}); if(s.length)this.selectDefaultTrack&&!qa(s).call(s,function(e){return e["default"]})&&(this.selectDefaultTrack=!1),f(s).call(s,function(e,t){e.id=t}); else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;var u=this.hls.config.subtitlePreference;if(!i&&u){this.selectDefaultTrack=!1;var l=ml(u,s);if(l>-1)i=s[l];else{var c=ml(u,this.tracks); i=this.tracks[c]}}var d=this.findTrackId(i);-1===d&&i&&(d=this.findTrackId(null));var h={subtitleTracks:s};this.log("Updating subtitle tracks, "+s.length+' track(s) found in "'+(null==n?void 0:n.join(","))+ '" group-id'),this.hls.trigger(Ns.SUBTITLE_TRACKS_UPDATED,h),-1!==d&&-1===this.trackId&&this.setSubtitleTrack(d)}}},n.findTrackId=function(e){for(var t=this.tracksInGroup,n=this.selectDefaultTrack,r=0;r< t.length;r++){var i=t[r]; if((!n||i["default"])&&(n||e)&&(!e||_l(i,e)))return r}if(e){for(var o=0;o-1){var i=this.tracksInGroup[r];return this.setSubtitleTrack(r), i}if(n)return null;var o=ml(e,t);if(o>-1)return t[o]}}return null},n.loadPlaylist=function(t){e.prototype.loadPlaylist.call(this),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack, t)},n.loadingPlaylist=function(t,n){e.prototype.loadingPlaylist.call(this,t,n); var r=t.id,i=t.groupId,o=this.getUrlWithDirectives(t.url,n),a=t.details,s=null==a?void 0:a.age;this.log("Loading subtitle "+r+' "'+t.name+'" lang:'+t.lang+" group:"+i+(void 0!==(null==n?void 0:n.msn)?" at sn "+ n.msn+" part "+n.part:"")+(s&&a.live?" age "+s.toFixed(1)+(a.type&&" "+a.type||""):"")+" "+o),this.hls.trigger(Ns.SUBTITLE_TRACK_LOADING,{url:o,id:r,groupId:i,deliveryDirectives:n||null,track:t})},n.toggleTrackModes= function(){var e,t=this.media; if(t){var n,r=fv(t.textTracks),i=this.currentTrack;if(i&&((n=Oa(r).call(r,function(e){return Df(i,e)})[0])||this.warn('Unable to find subtitle TextTrack with name "'+i.name+'" and language "'+i.lang+'"')), f(e=Ea([]).call(r)).call(e,function(e){"disabled"!==e.mode&&e!==n&&(e.mode="disabled")}),this.hls.config.toggleTextTrackModeNatively&&n){var o=this.subtitleDisplay?"showing":"hidden"; n.mode!==o&&(n.mode=o)}}},n.setSubtitleTrack=function(e){var t=this.tracksInGroup; if(this.media||(this.queuedDefaultTrack=e),e<-1||e>=t.length||!Os(e))this.warn("Invalid subtitle track id: "+e);else{this.selectDefaultTrack=!1;var n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack= r,this.toggleTrackModes(),r){var i=!!r.details&&!r.details.live;if(e!==this.trackId||r!==n||!i){this.log("Switching to subtitle-track "+e+(r?' "'+r.name+'" lang:'+r.lang+" group:"+r.groupId:""));var o= r.id,a=r.groupId,s=void 0===a?"":a,u=r.name,l=r.type,c=r.url;this.hls.trigger(Ns.SUBTITLE_TRACK_SWITCH,{id:o,groupId:s,name:u,type:l,url:c});var d=this.switchParams(r.url,null==n?void 0:n.details,r.details); this.loadPlaylist(d)}}else this.hls.trigger(Ns.SUBTITLE_TRACK_SWITCH,{id:e})}},Ra(t,[{key:"subtitleDisplay", get:function get(){return this._subtitleDisplay}, set:function set(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}}, {key:"allSubtitleTracks",get:function get(){return this.tracks}}, {key:"subtitleTracks",get:function get(){return this.tracksInGroup}}, {key:"subtitleTrack",get:function get(){return this.trackId}, set:function set(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}}])}(Of),vv={42:225, 92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193, 145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239, 170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246, 196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},gv=function gv(e){return String.fromCharCode(vv[e]||e)},yv=15,mv=100,_v={17:1, 18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ev={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Tv={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},bv={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Sv=["white","green","blue","cyan", "red","yellow","magenta","black","transparent"],wv=function(){function e(){this.time=null,this.verboseLevel=0} return e.prototype.log=function(e,t){if(this.verboseLevel>=e){var n="function"==typeof t?t():t;Qs.log(this.time+" ["+e+"] "+n)}},e}(),Av=function Av(e){for(var t=[],n=0;nmv&&(this.logger.log(3,"Too large cursor position "+ this.pos),this.pos=mv)},t.moveCursor=function(e){var t=this.pos+e; if(e>1)for(var n=this.pos+1;n=144&&this.backSpace();var n=gv(e);this.pos>=mv?this.logger.log(0,function(){return"Cannot insert "+e.toString(16)+" ("+n+") at position "+t.pos+". Skipping it!"}):(this.chars[this.pos].setChar(n,this.currPenState), this.moveCursor(1))},t.clearFromPos=function(e){var t; for(t=e;t0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},t.getTextAndFormat= function(){return this.rows},e}(),Ov=function(){function e(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0, this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory= new Cv(n),this.nonDisplayedMemory=new Cv(n),this.lastOutputScreen=new Cv(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null, this.logger=n} var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14], this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)}, t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,function(){return"MODE\x3d"+e}),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory: (this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars= function(e){for(var t=this,n=0;n=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}this.logger.log(2,"MIDROW: "+ pl(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1); var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime, t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}, t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(), Pv=function(){function e(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null, b:null},this.logger=void 0;var r=this.logger=new wv;this.channels=[null,new Ov(e,t,r),new Ov(e+1,n,r)]} var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var n=this; this.logger.time=e;for(var r=function r(e){var r=127&t[e],i=127&t[e+1],o=!1,a=null;if(0===r&&0===i)return 0;n.logger.log(3,function(){return"["+Av([t[e],t[e+1]])+"] -\x3e ("+Av([r,i])+")"}); var s=n.cmdHistory;if(r>=16&&r<=31){if(function(e,t,n){return n.a===e&&n.b===t}(r,i,s))return kv(null,null,s),n.logger.log(3,function(){return"Repeated command ("+Av([r, i])+") is dropped"}),0; kv(r,i,n.cmdHistory),(o=n.parseCmd(r,i))||(o=n.parseMidrow(r,i)),o||(o=n.parsePAC(r,i)),o||(o=n.parseBackgroundAttributes(r,i))}else kv(null,null,s);if(!o&&(a=n.parseChars(r,i))){var u=n.currentChannel; u&&u>0?n.channels[u].insertChars(a):n.logger.log(2,"No channel found yet. TEXT-MODE?")}o||a||n.logger.log(2,function(){return"Couldn't parse cleaned data "+Av([r,i])+" orig: "+Av([t[e],t[e+1]])})},i=0;i< t.length;i+=2)r(i)},t.parseCmd=function(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1; var n=20===e||21===e||23===e?1:2,r=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3): 39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0},t.parseMidrow= function(e,t){var n=0; if((17===e||25===e)&&t>=32&&t<=47){if((n=17===e?1:2)!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;var r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3, function(){return"MIDROW ("+Av([e,t])+")"}),!0)}return!1},t.parsePAC=function(e,t){var n; if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;var r=e<=23?1:2;n=t>=64&&t<=95?1===r?_v[e]:Tv[e]:1===r?Ev[e]:bv[e];var i=this.channels[r];return!!i&&(i.setPAC(this.interpretPAC(n, t)),this.currentChannel=r,!0)},t.interpretPAC=function(e,t){var n,r={color:null, italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=!(1&~n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0, r.color="white"):r.indent=4*Math.floor((n-16)/2),r},t.parseChars=function(e,t){var n,r,i=null,o=null; return e>=25?(n=2,o=e-8):(n=1,o=e),o>=17&&o<=19?(r=17===o?t+80:18===o?t+112:t+144,this.logger.log(2,function(){return"Special char '"+gv(r)+"' in channel "+n}),i=[r]):e>=32&&e<=127&&(i=0===t?[e]:[e, t]),i&&this.logger.log(3,function(){return"Char codes \x3d "+Av(i).join(",")}),i},t.parseBackgroundAttributes=function(e,t){var n; if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=Sv[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background= "transparent":(r.foreground="black",47===t&&(r.underline=!0));var i=e<=23?1:2;return this.channels[i].setBkgData(r),!0},t.reset=function(){for(var e=0;e1?t-1:0),r=1;r100)throw new Error("Position must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),y(s,"positionAlign",i({},u,{get:function get(){return T}, set:function set(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),y(s,"size",i({},u,{get:function get(){return b}, set:function set(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),y(s,"align",i({},u,{get:function get(){return S}, set:function set(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");S=t,this.hasBeenReset=!0}})),s.displayState=void 0} return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}(),xv=function(){function e(){} return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}(); function Nv(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+Ja(r||0)} var n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?Ja(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null} var Mv=function(){function e(){this.values=wo(null)} var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(ws(this)[e]=t)},t.get=function(e,t,n){return n?this.has(e)?ws(this)[e]:t[n]:this.has(e)?ws(this)[e]:t},t.has=function(e){return e in ws(this)}, t.alt=function(e,t,n){for(var r=0;r=0&&n<=100)return this.set(e,n),!0}return!1},e}(); function Uv(e,t,n,r){var i=r?e.split(r):[e];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(n);2===a.length&&t(a[0],a[1])}} var Fv=new Dv(0,0,""),Bv="middle"===Fv.align?"middle":"center";function Vv(e,t,n){var r=e;function i(){var t=Nv(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/, ""),t} function o(){e=e.replace(/^\s+/,"")} if(o(),t.startTime=i(),o(),"--\x3e"!==Ea(e).call(e,0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=Ea(e).call(e,3),o(),t.endTime=i(),o(),function(e,t){var r= new Mv;Uv(e,function(e,t){var i;switch(e){case "region":for(var o=n.length-1;o>=0;o--)if(n[o].id===t){r.set(e,n[o].region);break}break;case "vertical":r.alt(e,t,["rl","lr"]);break;case "line":i=t.split(","), r.integer(e,i[0]),r.percent(e,i[0])&&r.set("snapToLines",!1),r.alt(e,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",Bv,"end"]);break;case "position":i=t.split(","),r.percent(e,i[0]),2===i.length&& r.alt("positionAlign",i[1],["start",Bv,"end","line-left","line-right","auto"]);break;case "size":r.percent(e,t);break;case "align":r.alt(e,t,["start",Bv,"end","left","right"])}},/:/,/\s/),t.region=r.get("region", null),t.vertical=r.get("vertical",""); var i=r.get("line","auto");"auto"===i&&-1===Fv.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",Bv);var o= r.get("position","auto");"auto"===o&&50===Fv.position&&(o="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=o}(e,t)} function Hv(e){return e.replace(//gi,"\n")} var jv=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new xv,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0} var t=e.prototype;return t.parse=function(e){var t=this;function n(){var e=t.buffer,n=0;for(e=Hv(e);ne)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges= [],this.startTime=null},e}(),rg=function(){function e(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags= [],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0, presentationOffset:0,0:{start:0,prevCC:-1,"new":!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label, languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label, languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(Ns.MEDIA_ATTACHING,this.onMediaAttaching, this),e.on(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ns.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated, this),e.on(Ns.FRAG_LOADING,this.onFragLoading,this),e.on(Ns.FRAG_LOADED,this.onFragLoaded,this),e.on(Ns.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Ns.FRAG_DECRYPTED,this.onFragDecrypted, this),e.on(Ns.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Ns.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Ns.BUFFER_FLUSHING,this.onBufferFlushing,this)} var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(Ns.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading, this),e.off(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ns.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Ns.FRAG_LOADING,this.onFragLoading,this),e.off(Ns.FRAG_LOADED,this.onFragLoaded, this),e.off(Ns.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Ns.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Ns.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Ns.SUBTITLE_TRACKS_CLEARED, this.onSubtitleTracksCleared,this),e.off(Ns.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0},t.initCea608Parsers=function(){var e= new ng(this,"textTrack1"),t=new ng(this,"textTrack2"),n=new ng(this,"textTrack3"),r=new ng(this,"textTrack4"); this.cea608Parser1=new Pv(1,e,t),this.cea608Parser2=new Pv(3,n,r)},t.addCues=function(e,t,n,r,i){for(var o=!1,a=i.length;a--;){var s=i[a],u=ag(s[0],s[1],t,n); if(u>=0&&(s[0]=Math.min(s[0],t),s[1]=Math.max(s[1],n),o=!0,u/(n-t)>.5))return}if(o||i.push([t,n]),this.config.renderTextTracksNatively){var l=this.captionsTracks[e];this.Cues.newCue(l,t,n,r)}else{var c= this.Cues.newCue(null,t,n,r);this.hls.trigger(Ns.CUES_PARSED,{type:"captions",cues:c,track:e})}},t.onInitPtsFound=function(e,t){var n=this,r=t.frag,i=t.id,o=t.initPTS,a=t.timescale,s=t.trackId,u=this.unparsedVttFrags; i===Vs&&(this.initPTS[r.cc]={baseTime:o,timescale:a,trackId:s}),u.length&&(this.unparsedVttFrags=[],f(u).call(u,function(e){n.initPTS[e.frag.cc]?n.onFragLoaded(Ns.FRAG_LOADED,e):n.hls.trigger(Ns.SUBTITLE_FRAG_PROCESSED, {success:!1,frag:e.frag,part:null,error:new Error("Subtitle discontinuity domain does not match main")})}))},t.getExistingTrack=function(e,t){var n=this.media; if(n)for(var r=0;r0&&v.push(e)},h.onparsingerror=function(e){d=e},h.onflush=function(){d?s(d):a(v)},f(p).call(p,function(e){if(E){if(es(e).call(e, "X-TIMESTAMP-MAP\x3d")){var t; E=!1,f(t=Ea(e).call(e,16).split(",")).call(t,function(e){es(e).call(e,"LOCAL:")?y=Ea(e).call(e,6):es(e).call(e,"MPEGTS:")&&(m=Xa(Ea(e).call(e,7)))}); try{_=function(e){var t=Xa(Ea(e).call(e,-3)),n=Xa(Ea(e).call(e,-6,-4)),r=Xa(Ea(e).call(e,-9,-7)),i=e.length>9?Xa(e.substring(0,o(e).call(e,":"))):0;if(!(Os(t)&&Os(n)&&Os(r)&&Os(i)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+ e);return t+=1E3*n,(t+=6E4*r)+36E5*i}(y)/1E3}catch(e){d=e}return}""===e&&(E=!1)}h.parse(e+"\n")}),h.flush()}(d?Du(d,new Uint8Array(i)).buffer:i,this.initPTS[r.cc],this.vttCCs,r.cc,(a&&!d?a:r).start,function(e){n._appendCues(e, r.level),c.trigger(Ns.SUBTITLE_FRAG_PROCESSED,{success:!0, frag:r,part:a})},function(t){var i="Missing initPTS for VTT MPEGTS"===t.message; i?u.push(e):n.config.enableIMSC1&&n._fallbackToIMSC1(e),c.logger.log("Failed to parse VTT cue: "+t),i&&l>r.cc||c.trigger(Ns.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,part:a,error:t})})}else u.push(e)}, t._fallbackToIMSC1=function(e){var t=this,n=e.frag,r=e.payload,i=this.tracks[n.level]; i.textCodec||Yv(r,this.initPTS[n.cc],function(){i.textCodec=zv,t._parseIMSC1(e)},function(){i.textCodec="wvtt"})},t._appendCues=function(e,t){var n=this.hls; if(this.config.renderTextTracksNatively){var r=this.textTracks[t];if(!r||"disabled"===r.mode)return;f(e).call(e,function(e){return cv(r,e)})}else{var i=this.tracks[t]; if(!i)return;var o=i["default"]?"default":"subtitles"+t;n.trigger(Ns.CUES_PARSED,{type:"subtitles",cues:e,track:o})}},t.onFragDecrypted=function(e,t){t.frag.type===js&&this.onFragLoaded(Ns.FRAG_LOADED, t)},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){if(this.enabled&&this.config.enableCEA708Captions){var n=t.frag,r=t.samples; if(n.type!==Vs||"NONE"!==this.closedCaptionsForLevel(n))for(var i=0;i=16?s--:s++;var v=Hv(fa(u).call(u)),g=Kv(t,n,v);null!=e&&null!=(h=e.cues)&&h.getCueById(g)||((o=new c(t,n,v)).id=g,o.line=d+1,o.align="left",o.position=10+Math.min(80, 10*Math.floor(8*s/32)),l.push(o))}return e&&l.length&&(ma(l).call(l,function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line}),f(l).call(l,function(t){return cv(e, t)})),l}},fg=/(\d+)-(\d+)\/(\d+)/,pg=function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config= null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||vg,this.controller=new self.AbortController,this.stats=new iu} var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}, t.abortInternal=function(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e; this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,n){var r=this,i=this.stats; if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();var o=function(e,t){var n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(Ya({}, e.headers))};return e.rangeEnd&&n.headers.set("Range","bytes\x3d"+e.rangeStart+"-"+String(e.rangeEnd-1)),n}(e,this.controller.signal),a="arraybuffer"===e.responseType,s=a?"byteLength":"length",u=t.loadPolicy, l=u.maxTimeToFirstByteMs,c=u.maxLoadTimeMs; this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),t.timeout=l&&Os(l)?l:c,this.requestTimeout=T(function(){r.callbacks&&(r.abortInternal(), r.callbacks.onTimeout(i,e,r.response))},t.timeout),(bf(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(function(n){var o; r.response=r.loader=n;var s=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(r.requestTimeout),t.timeout=c,r.requestTimeout=T(function(){r.callbacks&&(r.abortInternal(),r.callbacks.onTimeout(i, e,r.response))},c-(s-i.loading.start)),!n.ok){var u=n.status,l=n.statusText; throw new gg(l||"fetch, bad network response",u,n);}i.loading.first=s,i.total=function(e){var t=e.get("Content-Range");if(t){var n=function(e){var t=fg.exec(e);if(t)return Xa(t[2])-Xa(t[1])+1}(t); if(Os(n))return n}var r=e.get("Content-Length");if(r)return Xa(r)}(n.headers)||i.total; var d=null==(o=r.callbacks)?void 0:o.onProgress;return d&&Os(t.highWaterMark)?r.loadProgressively(n,i,e,t.highWaterMark,d):a?n.arrayBuffer():"json"===e.responseType?n.json():n.text()}).then(function(n){var o, a,u=r.response; if(!u)throw new Error("loader destroyed");self.clearTimeout(r.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);var l=n[s];l&&(i.loaded=i.total=l);var c={url:u.url,data:n,code:u.status}, d=null==(o=r.callbacks)?void 0:o.onProgress;d&&!Os(t.highWaterMark)&&d(i,e,n,u),null==(a=r.callbacks)||a.onSuccess(c,i,e,u)})["catch"](function(t){var n; if(self.clearTimeout(r.requestTimeout),!i.aborted){var o=t&&t.code||0,a=t?t.message:null;null==(n=r.callbacks)||n.onError({code:o,text:a},e,t?t.details:null,i)}})},t.getCacheAge=function(){var e=null; if(this.response){var t=this.response.headers.get("age");e=t?Ja(t):null}return e},t.getResponseHeader=function(e){return this.response?this.response.headers.get(e):null},t.loadProgressively=function(e, t,n,r,i){void 0===r&&(r=0); var o=new zd,a=e.body.getReader(),s=function s(){return a.read().then(function(a){if(a.done)return o.dataLength&&i(t,n,o.flush().buffer,e),d.resolve(new ArrayBuffer(0));var u=a.value,l=u.length;return t.loaded+= l,l=r&&i(t,n,o.flush().buffer,e)):i(t,n,u.buffer,e),s()})["catch"](function(){return d.reject()})}; return s()},e}(); function vg(e,t){return new self.Request(e.url,t)} var gg=function(e){function t(t,n,r){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=n,i.details=r,i} return Ka(t,e),t}(ds(Error)),yg=/^age:\s*[\d.]+\s*$/im,mg=function(){function e(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks= null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new iu,this.retryDelay=0} var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null},t.abortInternal=function(){var e=this.loader; self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e; this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once."); this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()},t.loadInternal=function(){var e=this,t=this.config,n=this.context; if(t&&n){var r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;var o=this.xhrSetup;o?d.resolve().then(function(){if(e.loader===r&&!e.stats.aborted)return o(r, n.url)})["catch"](function(t){if(e.loader===r&&!e.stats.aborted)return r.open("GET",n.url,!0),o(r,n.url)}).then(function(){e.loader!==r||e.stats.aborted||e.openAndSendXhr(r,n,t)})["catch"](function(t){var o; null==(o=e.callbacks)||o.onError({code:r.status,text:t.message},n,r,i)}):this.openAndSendXhr(r,n,t)}},t.openAndSendXhr=function(e,t,n){var r,i,o; e.readyState||e.open("GET",t.url,!0);var a=t.headers,s=n.loadPolicy,u=s.maxTimeToFirstByteMs,c=s.maxLoadTimeMs;if(a)for(var d in a)e.setRequestHeader(d,a[d]);t.rangeEnd&&e.setRequestHeader("Range","bytes\x3d"+ t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=l(r=this.readystatechange).call(r,this),e.onprogress=l(i=this.loadprogress).call(i,this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout), n.timeout=u&&Os(u)?u:c,this.requestTimeout=T(l(o=this.loadtimeout).call(o,this),n.timeout),e.send()},t.readystatechange=function(){var e=this.context,t=this.loader,n=this.stats; if(e&&t){var r,i=t.readyState,o=this.config;if(!n.aborted&&i>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),o.timeout!==o.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout), o.timeout=o.loadPolicy.maxLoadTimeMs,this.requestTimeout=T(l(r=this.loadtimeout).call(r,this),o.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===i)){self.clearTimeout(this.requestTimeout), t.onreadystatechange=null,t.onprogress=null;var a=t.status,s="text"===t.responseType?t.responseText:null;if(a>=200&&a<300){var u=null!=s?s:t.response;if(null!=u){var c,d;n.loading.end=Math.max(self.performance.now(), n.loading.first);var h="arraybuffer"===t.responseType?u.byteLength:u.length;n.loaded=n.total=h,n.bwEstimate=8E3*n.total/(n.loading.end-n.loading.first);var f=null==(c=this.callbacks)?void 0:c.onProgress; f&&f(n,e,u,t);var p={url:t.responseURL,data:u,code:a};return void(null==(d=this.callbacks)||d.onSuccess(p,n,e,t))}}var v,g=o.loadPolicy.errorRetry;Ul(g,n.retry,!1,{url:e.url,data:void 0,code:a})?this.retry(g): (Qs.error(a+" while loading "+e.url),null==(v=this.callbacks)||v.onError({code:a,text:t.statusText},e,t,n))}}},t.loadtimeout=function(){if(this.config){var e=this.config.loadPolicy.timeoutRetry; if(Ul(e,this.stats.retry,!0))this.retry(e);else{var t;Qs.warn("timeout while loading "+(null==(t=this.context)?void 0:t.url));var n=this.callbacks;n&&(this.abortInternal(),n.onTimeout(this.stats,this.context, this.loader))}}},t.retry=function(e){var t,n=this.context,r=this.stats; this.retryDelay=Nl(e,r.retry),r.retry++,Qs.warn((status?"HTTP Status "+status:"Timeout")+" while loading "+(null==n?void 0:n.url)+", retrying "+r.retry+"/"+e.maxNumRetry+" in "+this.retryDelay+"ms"),this.abortInternal(), this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=T(l(t=this.loadInternal).call(t,this),this.retryDelay)},t.loadprogress=function(e){var t=this.stats; t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null; if(this.loader&&yg.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?Ja(t):null}return e},t.getResponseHeader=function(e){return this.loader&&(new RegExp("^"+e+":\\s*[\\d.]+\\s*$", "im")).test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null},e}(); function _g(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function Eg(e){for(var t=1;tt&&this.nudgeOnVideoHole(e,t)),void(0===this.waiting&&this.stallResolved(e));if(u||s)s&&this.stallResolved(e);else{if(l)return this.nudgeRetry=0,this.stallResolved(e),void(!this.ended&& o.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(Ns.MEDIA_ENDED,{stalled:!1})));if(lc.getBuffered(o).length){var c=lc.bufferInfo(o,e,0),d=c.nextStart||0,h=this.fragmentTracker;if(a&&h&&this.hls){var f= wg(this.hls.inFlightFragments,e),p=c.len>2,v=!d||f||d-e>2&&!h.getPartialFragment(e);if(p||v)return void(p||h.getPartialFragment(e)||this.hls.trigger(Ns.CUSTOM_GAP_TOOFAR_AHEAD,{nextStart:d,stalled:this.stalled})); this.moved=!1}var g=null==(r=this.hls)?void 0:r.latestLevelDetails;if(!this.moved&&null!==this.stalled&&h){if(!(c.len>0||d))return;var y=Math.max(d,c.start||0)-e,m=null!=g&&g.live?2*g.targetduration:2, _=Rg(e,h);if(y>0&&(y<=m||_))return void(o.paused||this._trySkipBufferHole(_))}var E=i.detectStallWithCurrentTimeMs,T=self.performance.now(),b=this.waiting,S=this.stalled;if(null===S){if(!(b>0&&T-b=E||b)&&this.hls){var A;if("ended"===(null==(A=this.mediaSource)?void 0:A.readyState)&&(null==g||!g.live)&&Math.abs(e-((null==g?void 0:g.edge)||0))<1){if(this.ended)return; return this.ended=e||1,void this.hls.trigger(Ns.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(c),!this.media||!this.hls)return}var R=lc.bufferInfo(o,e,i.maxBufferHole);this._tryFixBufferStall(R,w,e)}else this.nudgeRetry= 0}}}},n.stallResolved=function(e){var t=this.stalled; if(t&&this.hls&&(this.stalled=null,this.stallReported)){var n=self.performance.now()-t;this.log("playback not stuck anymore @"+e+", after "+Math.round(n)+"ms"),this.stallReported=!1,this.waiting=0,this.hls.trigger(Ns.STALL_RESOLVED, {})}},n.nudgeOnVideoHole=function(e,t){var n,r=this.buffered.video; if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&r&&r.length>1&&e>r.end(0)){var i=lc.bufferedInfo(lc.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){var o= lc.timeRangesToArray(r),a=lc.bufferedInfo(o,t,0).bufferedIndex;if(a>-1&&aa)&&l-u<1&&e-u<2){var c=new Error("nudging playhead to flush pipeline after video hole. currentTime: "+ e+" hole: "+u+" -\x3e "+l+" buffered index: "+s);this.warn(c.message),this.media.currentTime+=1E-6;var d=Rg(e,this.fragmentTracker);d&&"fragment"in d?d=d.fragment:d||(d=void 0);var h=lc.bufferInfo(this.media, e,0);this.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:c,reason:c.message,frag:d,buffer:h.len,bufferInfo:h})}}}}},n._tryFixBufferStall=function(e,t,n){var r, i,o=this.fragmentTracker,a=this.media,s=null==(r=this.hls)?void 0:r.config; if(a&&o&&s){var u=null==(i=this.hls)?void 0:i.latestLevelDetails,l=Rg(n,o);if((l||null!=u&&u.live&&n1&&e.len>s.maxBufferHole||e.nextStart&&(e.nextStart-n1E3*s.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}}, n.adjacentTraversal=function(e,t){var n=this.fragmentTracker,r=e.nextStart; if(n&&r){var i=n.getFragAtPos(t,Vs),o=n.getFragAtPos(r,Vs);if(i&&o)return o.sn-i.sn<2}return!1},n._reportStall=function(e){var t=this.hls,n=this.media,r=this.stallReported,i=this.stalled; if(!r&&null!==i&&n&&t){this.stallReported=!0;var o=new Error("Playback stalling at @"+n.currentTime+" due to low buffer ("+pl(e)+")");this.warn(o.message),t.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.BUFFER_STALLED_ERROR, fatal:!1,error:o,buffer:e.len,bufferInfo:e,stalled:{start:i}})}},n._trySkipBufferHole=function(e){var t,n=this.fragmentTracker,r=this.media,i=null==(t=this.hls)?void 0:t.config; if(!r||!n||!i)return 0;var o=r.currentTime,a=lc.bufferInfo(r,o,0),s=o0&&a.len<1&&r.readyState<3,c=s-o;if(c>0&&(u||l)){if(c> i.maxBufferHole){var d=!1;if(0===o){var h=n.getAppendedFrag(0,Vs);h&&s0}}])}(ac); function wg(e,t){var n=Ag(e.main);if(n&&n.start<=t)return n;var r=Ag(e.audio);return r&&r.start<=t?r:null} function Ag(e){if(!e)return null;switch(e.state){case kd:case Pd:case Bd:case Vd:return null}return e.frag} function Rg(e,t){return t.getAppendedFrag(e,Vs)||t.getPartialFragment(e)} function Lg(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} function Ig(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue} function Cg(e,t,n,r,i){var o=new e(t,n,"");try{o.value=r,i&&(o.type=i)}catch(a){o=new e(t,n,pl(i?function(e){for(var t=1;tOg&&(d=Og),d-c<=0&&(d=c+.25);for(var h=0;h.01&&this.updateDateRangeCues(t.details)},t.updateDateRangeCues=function(e,t){var n=this; if(this.hls&&this.media){var r=this.hls.config,i=r.assetPlayerId,o=r.timelineOffset,a=r.enableDateRangeMetadataCues,s=r.interstitialsController;if(a){var u=Ig();if(i&&o&&!s){var l=e.fragmentStart,c=e.fragmentEnd, d=this.assetCue;d?(d.startTime=l,d.endTime=c):u&&(d=this.assetCue=Cg(u,l,c,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"))&&(d.id=i,this.id3Track||(this.id3Track=this.createTrack(this.media)), this.id3Track.addCue(d),d.addEventListener("enter",this.onEventCueEnter))}if(e.hasProgramDateTime){var h,p=this.id3Track,v=e.dateRanges,g=Fa(v),y=this.dateRangeCuesAppended;if(p&&t)if(null!=(h=p.cues)&& h.length)for(var m,_=Oa(m=Fa(y)).call(m,function(e){return!gs(g).call(g,e)}),E=function E(){var e,t,r=_[T],i=null==(e=y[r])?void 0:e.cues; delete y[r],i&&f(t=Fa(i)).call(t,function(e){var t=i[e];if(t){t.removeEventListener("enter",n.onEventCueEnter);try{p.removeCue(t)}catch(e){}}})},T=_.length;T--;)E(); else y=this.dateRangeCuesAppended={};var b=e.fragments[e.fragments.length-1];if(0!==g.length&&Os(null==b?void 0:b.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var S= function S(){var e=g[w],t=v[e],r=t.startTime,i=y[e],o=(null==i?void 0:i.cues)||{},a=(null==i?void 0:i.durationKnown)||!1,l=Og,c=t.duration;if(t.endDate&&null!==c)l=r+c,a=!0;else if(t.endOnNext&&!a){var d= ba(g).call(g,function(e,n){if(n!==t.id){var r=v[n];if(r["class"]===t["class"]&&r.startDate>t.startDate&&(!e||t.startDate.01&&(m.startTime=r,m.endTime=l):m.endTime=l;else if(u){var _= t.attr[p];_c(p)&&(_=nu(_));var E=Cg(u,r,l,{key:p,data:_},nh.dateRange);E&&(E.id=e,n.id3Track.addCue(E),o[p]=E,s&&("X-ASSET-LIST"!==p&&"X-ASSET-URL"!==p||E.addEventListener("enter",n.onEventCueEnter)))}}}y[e]= {cues:o,dateRange:t,durationKnown:a}},w=0;w.05&&t.forwardBufferLength>1){var h= Math.min(2,Math.max(1,a)),f=Math.round(2/(1+Math.exp(-.75*d-t.edgeStalled))*20)/20,p=Math.min(h,Math.max(1,f));t.changeMediaPlaybackRate(e,p)}else 1!==e.playbackRate&&0!==e.playbackRate&&t.changeMediaPlaybackRate(e, 1)}}}}}},this.hls=e,this.config=e.config,this.registerListeners()} var t=e.prototype;return t.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null,this.timeupdate=this.ratechangeHandler=null},t.registerListeners=function(){var e=this.hls; e&&(e.on(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.LEVEL_UPDATED,this.onLevelUpdated, this),e.on(Ns.ERROR,this.onError,this))},t.unregisterListeners=function(){var e=this.hls; e&&(e.off(Ns.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ns.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.LEVEL_UPDATED,this.onLevelUpdated, this),e.off(Ns.ERROR,this.onError,this))},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate),this.media.addEventListener("ratechange",this.ratechangeHandler)}, t.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media.removeEventListener("ratechange",this.ratechangeHandler),this.media=null)},t.onManifestLoading= function(){this._latency=null,this.stallCount=0},t.onLevelUpdated=function(e,t){var n=t.details; n.advanced&&this.onTimeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)},t.onError=function(e,t){var n; t.details===xs.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(n=this.levelDetails)&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))},t.changeMediaPlaybackRate= function(e,t){var n,r; e.playbackRate!==t&&(null==(n=this.hls)||n.logger.debug("[latency-controller]: latency\x3d"+this.latency.toFixed(3)+", targetLatency\x3d"+(null==(r=this.targetLatency)?void 0:r.toFixed(3))+", forwardBufferLength\x3d"+ this.forwardBufferLength.toFixed(3)+": adjusting playback rate from "+e.playbackRate+" to "+t),e.playbackRate=t)},t.timeupdate2=function(e,t){var n=this.media,r=this.levelDetails; if(n&&r&&!n.paused&&!n.seeking&&r.live){var i=this.forwardBufferLength,o=i<(this.config.explictInLiveRange?this.config.explictInLiveRange:e+t+r.targetduration),a=performance.now();o?1===n.playbackRate&& i>t&&a-this._playbackRateChangedTime>(this.config.minDurationToRetainAfterLiveSync||3E3)?n.playbackRate=this.config.maxLiveSyncPlaybackRate:1!==n.playbackRate&&0!==n.playbackRate&&i<=e&&a-this._playbackRateChangedTime> (this.config.minDurationToRetainAfterCatchup||3E3)&&(n.playbackRate=1):1!==n.playbackRate&&0!==n.playbackRate&&(n.playbackRate=1)}},t.onPlaybackRateChanged=function(e){this._playbackRateChangedTime=performance.now()}, t.estimateLiveEdge=function(){var e=this.levelDetails; return null===e?null:e.edge+e.age},t.computeLatency=function(){var e=this.estimateLiveEdge(); return null===e?null:e-this.currentTime},Ra(e,[{key:"levelDetails", get:function get(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}}, {key:"latency",get:function get(){return this._latency||0}}, {key:"maxLatency",get:function get(){var e=this.config;if(void 0!==e.liveMaxLatencyDuration)return e.liveMaxLatencyDuration;var t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration: 0}}, {key:"targetLatency",get:function get(){var e=this.levelDetails;if(null===e||null===this.hls)return null;var t=e.holdBack,n=e.partHoldBack,r=e.targetduration,i=this.config,o=i.liveSyncDuration,a=i.liveSyncDurationCount, s=i.lowLatencyMode,u=this.hls.userConfig,l=s&&n||t;(this._targetLatencyUpdated||u.liveSyncDuration||u.liveSyncDurationCount||0===l)&&(l=void 0!==o?o:a*r);var c=r;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease, c)}, set:function set(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}}, {key:"liveSyncPosition",get:function get(){var e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t)return null;var n=this.levelDetails;if(null===n)return null;var r=n.edge,i=e-t-this.edgeStalled, o=r-n.totalduration,a=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,i),a)}}, {key:"drift",get:function get(){var e=this.levelDetails;return null===e?1:e.drift}}, {key:"edgeStalled",get:function get(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}}, {key:"forwardBufferLength",get:function get(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}}])}(),Dg=function(e){function t(t, n){var r; return(r=e.call(this,t,"level-controller")||this)._levels=[],r._firstLevel=-1,r._maxAutoLevel=-1,r._startLevel=void 0,r.currentLevel=null,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.steering=void 0, r.onParsedComplete=void 0,r.steering=n,r._registerListeners(),r} Ka(t,e);var n=t.prototype;return n._registerListeners=function(){var e=this.hls;e.on(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ns.LEVEL_LOADED, this.onLevelLoaded,this),e.on(Ns.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Ns.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Ns.ERROR,this.onError,this)},n._unregisterListeners=function(){var e=this.hls; e.off(Ns.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ns.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ns.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ns.LEVELS_UPDATED,this.onLevelsUpdated,this), e.off(Ns.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Ns.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),e.prototype.destroy.call(this)}, n.stopLoad=function(){var t=this._levels; f(t).call(t,function(e){e.loadError=0,e.fragmentError=0}),e.prototype.stopLoad.call(this)},n.resetLevels=function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel= null,this._levels=[],this._maxAutoLevel=-1},n.onManifestLoading=function(e,t){this.resetLevels()},n.onManifestLoaded=function(e,t){var n,r=this,i=this.hls.config.preferManagedMediaSource,o=[],a={},s={}, u=!1,l=!1,c=!1; f(n=t.levels).call(n,function(e){var t=e.attrs,n=e.audioCodec,d=e.videoCodec;n&&(e.audioCodec=n=Xu(n,i)||void 0),d&&(d=e.videoCodec=function(e){for(var t=e.split(","),n=0;n2&&"avc1"===i[0]&&(t[n]="avc1."+Xa(i[1]).toString(16)+Ea(r="000"+Xa(i[2]).toString(16)).call(r,-4))}return t.join(",")}(d)); var h=e.width,f=e.height,p=e.unknownCodecs,v=(null==p?void 0:p.length)||0;if(u||(u=!(!h||!f)),l||(l=!!d),c||(c=!!n),v||n&&!r.isAudioSupported(n)||d&&!r.isVideoSupported(d))r.log('Some or all CODECS not supported "'+ t.CODECS+'"');else{var g=t.CODECS,y=t["FRAME-RATE"],m=t["HDCP-LEVEL"],_=t["PATHWAY-ID"],E=t.RESOLUTION,T=t["VIDEO-RANGE"],b=(_||".")+"-"+e.bitrate+"-"+E+"-"+y+"-"+g+"-"+T+"-"+m;if(a[b])if(a[b].uri===e.url|| e.attrs["PATHWAY-ID"])a[b].addGroupId("audio",t.AUDIO),a[b].addGroupId("text",t.SUBTITLES);else{var S=s[b]+=1;e.attrs["PATHWAY-ID"]=(new Array(S+1)).join(".");var w=r.createLevel(e);a[b]=w,o.push(w)}else{var A= r.createLevel(e);a[b]=A,s[b]=1,o.push(A)}}}),this.filterAndSortMediaOptions(o,t,u,l,c)},n.createLevel=function(e){var t=new hl(e),n=e.supplemental; if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){var r=new Error('SUPPLEMENTAL-CODECS not supported "'+n.videoCodec+'"');this.log(r.message),t.supportedResult=il(r,[])}return t},n.isAudioSupported= function(e){return Gu(e,"audio",this.hls.config.preferManagedMediaSource)},n.isVideoSupported=function(e){return Gu(e,"video",this.hls.config.preferManagedMediaSource)},n.filterAndSortMediaOptions=function(e, t,n,r,i){var a,s,u=this,l=[],c=[],h=e,f=(null==(a=t.stats)?void 0:a.parsing)||{}; if((n||r)&&i&&(h=Oa(h).call(h,function(e){var t,n=e.videoCodec,r=e.videoRange,i=e.width,a=e.height;return(!!n||!(!i||!a))&&!!(t=r)&&o(ll).call(ll,t)>-1})),0===h.length)return d.resolve().then(function(){if(u.hls){var e, n,r="no level with compatible codecs found in manifest",i=r; t.levels.length&&(i="one or more CODECS in variant not supported: "+pl(Oa(e=Ma(n=t.levels).call(n,function(e){return e.attrs.CODECS})).call(e,function(e,t,n){return o(n).call(n,e)===t})),u.warn(i),r+=" ("+ i+")"); var a=new Error(r);u.hls.trigger(Ns.ERROR,{type:Ds.MEDIA_ERROR,details:xs.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:a,reason:i})}}),void(f.end=performance.now()); t.audioTracks&&xg(l=Oa(s=t.audioTracks).call(s,function(e){return!e.audioCodec||u.isAudioSupported(e.audioCodec)})),t.subtitles&&xg(c=t.subtitles); var p=Ea(h).call(h,0);ma(h).call(h,function(e,t){if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height- t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return o(ll).call(ll,e.videoRange)-o(ll).call(ll,t.videoRange);if(e.videoCodec!==t.videoCodec){var r= Wu(e.videoCodec),i=Wu(t.videoCodec);if(r!==i)return i-r}if(e.uri===t.uri&&e.codecSet!==t.codecSet){var a=qu(e.codecSet),s=qu(t.codecSet);if(a!==s)return s-a}return e.averageBitrate!==t.averageBitrate?e.averageBitrate- t.averageBitrate:0}); var v=p[0];if(this.steering&&(h=this.steering.filterParsedLevels(h)).length!==p.length)for(var g=0;gE&&E===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=T)}break}var b=i&&!r,S=this.hls.config,w=!(!S.audioStreamController||!S.audioTrackController), A={levels:h,audioTracks:l,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:w&&!b&&qa(l).call(l,function(e){return!!e.url})}; f.end=performance.now(),this.hls.trigger(Ns.MANIFEST_PARSED,A)},n.onError=function(e,t){!t.fatal&&t.context&&t.context.type===Us&&t.context.level===this.level&&this.checkRetry(t)},n.onFragBuffered=function(e, t){var n=t.frag; if(void 0!==n&&n.type===Vs){var r,i=n.elementaryStreams;if(!qa(r=Fa(i)).call(r,function(e){return!!i[e]}))return; var o=this._levels[n.level];null!=o&&o.loadError&&(this.log("Resetting level error count of "+o.loadError+" on frag buffered"),o.loadError=0)}},n.onLevelLoaded=function(e,t){var n,r,i=t.level,o=t.details, a=t.levelInfo; if(!a)return this.warn("Invalid level index "+i),void(null!=(r=t.deliveryDirectives)&&r.skip&&(o.deltaUpdateFailed=!0));if(a===this.currentLevel||t.withoutMultiVariant){0===a.fragmentError&&(a.loadError= 0);var s=a.details;s===t.details&&s.advanced&&(s=void 0),this.playlistLoaded(i,t,s)}else null!=(n=t.deliveryDirectives)&&n.skip&&(o.deltaUpdateFailed=!0)},n.loadPlaylist=function(t){e.prototype.loadPlaylist.call(this), this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)},n.loadingPlaylist=function(t,n){e.prototype.loadingPlaylist.call(this,t,n); var r=this.getUrlWithDirectives(t.uri,n),i=this.currentLevelIndex,o=t.attrs["PATHWAY-ID"],a=t.details,s=null==a?void 0:a.age;this.log("Loading level index "+i+(void 0!==(null==n?void 0:n.msn)?" at sn "+ n.msn+" part "+n.part:"")+(o?" Pathway "+o:"")+(s&&a.live?" age "+s.toFixed(1)+(a.type&&" "+a.type||""):"")+" "+r),this.hls.trigger(Ns.LEVEL_LOADING,{url:r,level:i,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"], id:0,deliveryDirectives:n||null})},n.removeLevel=function(e){var t,n,r=this; if(1!==this._levels.length){var i=Oa(t=this._levels).call(t,function(t,n){return n!==e||(r.steering&&r.steering.removeLevel(t),t===r.currentLevel&&(r.currentLevel=null,r.currentLevelIndex=-1,t.details&& f(i=t.details.fragments).call(i,function(e){return e.level=-1})),!1); var i}); Td(i),this._levels=i,this.currentLevelIndex>-1&&null!=(n=this.currentLevel)&&n.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex= this.currentLevelIndex);var o=i.length-1;this._firstLevel=Math.min(this._firstLevel,o),this._startLevel&&(this._startLevel=Math.min(this._startLevel,o)),this.hls.trigger(Ns.LEVELS_UPDATED,{levels:i})}}, n.onLevelsUpdated=function(e,t){var n=t.levels; this._levels=n},n.checkMaxAutoUpdated=function(){var e=this.hls,t=e.autoLevelCapping,n=e.maxAutoLevel,r=e.maxHdcpLevel; this._maxAutoLevel!==n&&(this._maxAutoLevel=n,this.hls.trigger(Ns.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:n,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))},Ra(t, [{key:"levels", get:function get(){return 0===this._levels.length?null:this._levels}}, {key:"loadLevelObj",get:function get(){return this.currentLevel}}, {key:"level",get:function get(){return this.currentLevelIndex}, set:function set(e){var t=this._levels;if(0!==t.length){if(e<0||e>=t.length){var n=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(Ns.ERROR,{type:Ds.OTHER_ERROR,details:xs.LEVEL_SWITCH_ERROR,level:e, fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}var i=this.currentLevelIndex,o=this.currentLevel,a=o?o.attrs["PATHWAY-ID"]:void 0,s=t[e],u=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex= e,this.currentLevel=s,i!==e||!o||a!==u){this.log("Switching to level "+e+" ("+(s.height?s.height+"p ":"")+(s.videoRange?s.videoRange+" ":"")+(s.codecSet?s.codecSet+" ":"")+"@"+s.bitrate+")"+(u?" with Pathway "+ u:"")+" from level "+i+(a?" with Pathway "+a:""));var l={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width, height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError, name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(Ns.LEVEL_SWITCHING,l);var c=s.details;if(!c||c.live){var d=this.switchParams(s.uri, null==o?void 0:o.details,c);this.loadPlaylist(d)}}}}}, {key:"manualLevel",get:function get(){return this.manualLevelIndex}, set:function set(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}}, {key:"firstLevel",get:function get(){return this._firstLevel}, set:function set(e){this._firstLevel=e}}, {key:"startLevel",get:function get(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}, set:function set(e){this._startLevel=e}}, {key:"pathways",get:function get(){return this.steering?this.steering.pathways():[]}}, {key:"pathwayPriority",get:function get(){return this.steering?this.steering.pathwayPriority:null}, set:function set(e){if(this.steering){var t=this.steering.pathways(),n=Oa(e).call(e,function(e){return-1!==o(t).call(t,e)}); if(e.length<1)return void this.warn("pathwayPriority "+e+" should contain at least one pathway from list: "+t);this.steering.pathwayPriority=n}}}, {key:"nextLoadLevel",get:function get(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}, set:function set(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])}(Of); function xg(e){var t={};f(e).call(e,function(e){var n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++})} function Ng(){return self.SourceBuffer||self.WebKitSourceBuffer} function Mg(){if(!Js())return!1;var e=Ng();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove} var Ug=function(e){function t(t,n,r){var i;return(i=e.call(this,t,n,r,"stream-controller",Vs)||this).audioCodecSwap=!1,i.level=-1,i._forceStartLoad=!1,i._hasEnoughToStart=!1,i.altAudio=0,i.audioOnly=!1, i.fragPlaying=null,i.fragLastKbps=0,i.couldBacktrack=!1,i.backtrackFragment=null,i.audioCodecSwitch=!1,i.videoBuffer=null,i.onMediaPlaying=function(){i.tick()},i.onMediaSeeked=function(){var e=i.media, t=e?e.currentTime:null; if(null!==t&&Os(t)&&(i.log("Media seeked to "+t.toFixed(3)),i.getBufferedFrag(t))){var n=i.getFwdBufferInfoAtPos(e,t,Vs,0);null!==n&&0!==n.len?i.tick():i.warn("Main forward buffer length at "+t+' on "seeked" event '+ (n?n.len:"empty")+")")}},i.registerListeners(),i} Ka(t,e);var n=t.prototype;return n.registerListeners=function(){e.prototype.registerListeners.call(this);var t=this.hls;t.on(Ns.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ns.LEVEL_LOADING,this.onLevelLoading, this),t.on(Ns.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ns.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(Ns.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(Ns.AUDIO_TRACK_SWITCHED, this.onAudioTrackSwitched,this),t.on(Ns.BUFFER_CREATED,this.onBufferCreated,this),t.on(Ns.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(Ns.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(Ns.FRAG_BUFFERED, this.onFragBuffered,this)},n.unregisterListeners=function(){e.prototype.unregisterListeners.call(this); var t=this.hls;t.off(Ns.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ns.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ns.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(Ns.AUDIO_TRACK_SWITCHING, this.onAudioTrackSwitching,this),t.off(Ns.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(Ns.BUFFER_CREATED,this.onBufferCreated,this),t.off(Ns.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(Ns.LEVELS_UPDATED, this.onLevelsUpdated,this),t.off(Ns.FRAG_BUFFERED,this.onFragBuffered,this)},n.onHandlerDestroying=function(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),e.prototype.onHandlerDestroying.call(this)}, n.startLoad=function(e,t){if(this.levels){var n=this.lastCurrentTime,r=this.hls; if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){var i=r.startLevel;-1===i&&(r.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=r.firstAutoLevel),r.nextLoadLevel= i,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&-1===e&&!t&&(this.log("Override startPosition with lastCurrentTime @"+n.toFixed(3)),e=n),this.state=kd,this.nextLoadPosition=this.lastCurrentTime= e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Pd},n.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},n.doTick=function(){switch(this.state){case jd:var e= this.levels,t=this.level,n=null==e?void 0:e[t],r=null==n?void 0:n.details; if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=kd;break}if(this.hls.nextLoadLevel!==this.level){this.state=kd;break}break;case Nd:this.checkRetryDate()}this.state=== kd&&this.doTickIdle(),this.onTickEnd()},n.onTickEnd=function(){var t; e.prototype.onTickEnd.call(this),null!=(t=this.media)&&t.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()},n.doTickIdle=function(){var e=this.hls, t=this.levelLastLoaded,n=this.levels,r=this.media; if(null!==t&&(r||this.primaryPrefetch||!this.startFragRequested&&e.config.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)){var i=this.buffering?e.nextLoadLevel:e.loadLevel;if(null!=n&&n[i]){var o= n[i],a=this.getMainFwdBufferInfo();if(null!==a){var s=this.getLevelDetails();if(s&&this._streamEnded(a,s)){var u={};return 2===this.altAudio&&(u.type="video"),this.hls.trigger(Ns.BUFFER_EOS,u),void(this.state= Bd)}if(this.buffering){e.loadLevel!==i&&-1===e.manualLevel&&this.log("Adapting to level "+i+" from level "+this.level),this.level=e.nextLoadLevel=i;var l=o.details;if(!l||this.state===jd||this.waitForLive(o))return this.level= i,this.state=jd,void(this.startFragRequested=!1);var c=a.len,d=this.getMaxBufferLength(o.maxBitrate);if(!(c>=d)){this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null); var h=this.backtrackFragment?this.backtrackFragment.start:a.end,f=this.getNextFragment(h,l);if(this.couldBacktrack&&!this.fragPrevious&&f&&lu(f)&&this.fragmentTracker.getState(f)!==Kl){var p,v=(null!=(p= this.backtrackFragment)?p:f).sn-l.startSN,g=l.fragments[v-1];g&&f.cc===g.cc&&(f=g,this.fragmentTracker.removeFragment(g))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f, h)){if(!f.gap){var y=this.audioOnly&&!this.altAudio?ou:au,m=(y===au?this.videoBuffer:this.mediaBuffer)||this.media;m&&this.afterBufferFlushed(m,y,Vs)}f=this.getNextFragmentLoopLoading(f,l,a,Vs,d)}f&&(this.exceedsMaxBuffer(a, d,f)||(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,o,h)))}}}}}},n.loadFragment=function(t,n,r){var i=this.fragmentTracker.getState(t); i===Hl||i===Gl?lu(t)?this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t,n)):e.prototype.loadFragment.call(this, t,n,r):this._loadInitSegment(t,n):this.clearTrackerIfNeeded(t)},n.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,Vs)},n.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+ .5):null},n.immediateLevelSwitch=function(){var t; this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY),0!==this.altAudio&&((null==(t=this.getLevelDetails())?void 0:t.fragmentStart)||0)>this.lastCurrentTime&&e.prototype.flushMainBuffer.call(this, 0,Number.POSITIVE_INFINITY,"audio")},n.nextLevelSwitch=function(){var e=this.levels,t=this.media; if(null!=t&&t.readyState){var n,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);var i=this.getLevelDetails();if(null!=i&&i.live){var o=this.getMainFwdBufferInfo(); if(!o||o.len<2*i.targetduration)return}if(!t.paused&&e){var a=e[this.hls.nextLoadLevel],s=this.fragLastKbps;n=s&&this.fragCurrent?this.fragCurrent.duration*a.maxBitrate/(1E3*s)+1:0}else n=0;var u=this.getBufferedFrag(t.currentTime+ n);if(u){var l=this.followingBufferedFrag(u);if(l){var c;this.abortCurrentFrag();var d=l.maxStartPTS?l.maxStartPTS:l.start,h=l.duration,f=Math.max(u.end,d+Math.min(Math.max(h-this.config.maxFragLookUpTolerance, h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));if(((null==(c=this.getLevelDetails())?void 0:c.fragmentStart)||0)>f)return;this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}},n.abortCurrentFrag= function(){var e=this.fragCurrent; switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Dd:case xd:case Nd:case Ud:case Fd:this.state=kd}this.nextLoadPosition= this.getLoadPosition()},n.flushMainBuffer=function(t,n){e.prototype.flushMainBuffer.call(this,t,n,2===this.altAudio?"video":null)},n.onMediaAttached=function(t,n){e.prototype.onMediaAttached.call(this, t,n); var r=n.media;Cd(r,"playing",this.onMediaPlaying),Cd(r,"seeked",this.onMediaSeeked)},n.onMediaDetaching=function(t,n){var r=this.media; r&&(Od(r,"playing",this.onMediaPlaying),Od(r,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,e.prototype.onMediaDetaching.call(this,t,n),n.transferMedia||(this._hasEnoughToStart= !1)},n.onManifestLoading=function(){e.prototype.onManifestLoading.call(this),this.log("Trigger BUFFER_RESET"),this.hls.trigger(Ns.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying= this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1},n.onManifestParsed=function(e,t){for(var n,r,i=!1,a=!1,s=0;s=o-t.maxFragLookUpTolerance&&i<=a;if(null!==r&&n.duration>r&&(i-1&&this.fragCurrent&& (this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels},n.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},n.seekToStartPos= function(){var e=this.media; if(e){var t=e.currentTime,n=this.startPosition;if(n>=0&&t0&&(sT.cc;if(!1!==r.independent){var w=l.startPTS,A=l.endPTS, R=l.startDTS,L=l.endDTS;if(s)s.elementaryStreams[l.type]={startPTS:w,endPTS:A,startDTS:R,endDTS:L};else if(l.firstKeyFrame&&l.independent&&1===i.id&&!S&&(this.couldBacktrack=!0),l.dropped&&l.independent){var I= this.getMainFwdBufferInfo(),C=(I?I.end:this.getLoadPosition())+this.config.maxBufferHole,O=l.firstKeyFramePTS?l.firstKeyFramePTS:w;if(!b&&C2&&(a.gap=!0);a.setElementaryStreamInfo(l.type,w,A,R,L),this.backtrackFragment&&(this.backtrackFragment= a),this.bufferFragmentData(l,a,s,i,b||S)}else{if(!b&&!S)return void this.backtrack(a);a.gap=!0}}if(p){var P=p.startPTS,k=p.endPTS,D=p.startDTS,x=p.endDTS;s&&(s.elementaryStreams[ou]={startPTS:P,endPTS:k, startDTS:D,endDTS:x}),a.setElementaryStreamInfo(ou,P,k,D,x),this.bufferFragmentData(p,a,s,i)}if(f&&null!=d&&d.samples.length){var N={id:t,frag:a,details:f,samples:d.samples};n.trigger(Ns.FRAG_PARSING_METADATA, N)}if(f&&c){var M={id:t,frag:a,details:f,samples:c.samples};n.trigger(Ns.FRAG_PARSING_USERDATA,M)}}}else this.resetWhenMissingContext(i)},n.logMuxedErr=function(e){this.warn((lu(e)?"Media":"Init")+" segment with muxed audiovideo where only video expected: "+ e.url)},n._bufferInitSegment=function(e,t,n,r){var i=this; if(this.state===Ud){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));var a=t.audio,s=t.video,u=t.audiovideo;if(a){var l=e.audioCodec, c=Qu(a.codec,l);"mp4a"===c&&(c="mp4a.40.5");var d=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){c&&(c=-1!==o(c).call(c,"mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");var h=a.metadata;h&&"channelCount"in h&&1!==(h.channelCount||1)&&-1===o(d).call(d,"firefox")&&(c="mp4a.40.5")}c&&-1!==o(c).call(c,"mp4a.40.5")&&-1!==o(d).call(d,"android")&&"audio/mpeg"!==a.container&&(c="mp4a.40.2",this.log("Android: force audio codec to "+ c)),l&&l!==c&&this.log('Swapping manifest audio codec "'+l+'" for "'+c+'"'),a.levelCodec=c,a.id=Vs,this.log("Init audio buffer, container:"+a.container+", codecs[selected/level/parsed]\x3d["+(c||"")+"/"+ (l||"")+"/"+a.codec+"]"),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=Vs;var p=s.codec;if(4===(null==p?void 0:p.length))switch(p){case "hvc1":case "hev1":s.codec="hvc1.1.6.L120.90";break;case "av01":s.codec= "av01.0.04M.08";break;case "avc1":s.codec="avc1.42e01e"}this.log("Init video buffer, container:"+s.container+", codecs[level/parsed]\x3d["+(e.videoCodec||"")+"/"+p+"]"+(s.codec!==p?" parsed-corrected\x3d"+ s.codec:"")+(s.supplemental?" supplemental\x3d"+s.supplemental:"")),delete t.audiovideo}u&&(this.log("Init audiovideo buffer, container:"+u.container+", codecs[level/parsed]\x3d["+e.codecs+"/"+u.codec+ "]"),delete t.video,delete t.audio);var v=Fa(t);if(v.length){if(this.hls.trigger(Ns.BUFFER_CODECS,t),!this.hls)return;f(v).call(v,function(e){var o=t[e].initSegment;null!=o&&o.byteLength&&i.hls.trigger(Ns.BUFFER_APPENDING, {type:e,data:o,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}},n.getMainFwdBufferInfo=function(){var e=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media; return this.getFwdBufferInfo(e,Vs)},n.backtrack=function(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious= null,this.nextLoadPosition=e.start,this.state=kd},n.checkFragmentChanged=function(){var e=this.media,t=null; if(e&&e.readyState>1&&!1===e.seeking){var n=e.currentTime;if(lc.isBuffered(e,n)?t=this.getAppendedFrag(n):lc.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;var r=this.fragPlaying, i=t.level;r&&t.sn===r.sn&&r.level===i||(this.fragPlaying=t,this.hls.trigger(Ns.FRAG_CHANGED,{frag:t}),r&&r.level===i||this.hls.trigger(Ns.LEVEL_SWITCHED,{level:i}))}}},Ra(t,[{key:"hasEnoughToStart", get:function get(){return this._hasEnoughToStart}}, {key:"maxBufferLength",get:function get(){var e=this.levels,t=this.level,n=null==e?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}}, {key:"nextLevel",get:function get(){var e=this.nextBufferedFrag;return e?e.level:-1}}, {key:"currentFrag",get:function get(){var e;if(this.fragPlaying)return this.fragPlaying;var t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;return Os(t)?this.getAppendedFrag(t):null}}, {key:"currentProgramDateTime",get:function get(){var e,t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;if(Os(t)){var n=this.getLevelDetails(),r=this.currentFrag||(n?Al(null,n.fragments, t):null);if(r){var i=r.programDateTime;if(null!==i){var o=i+1E3*(t-r.start);return new Date(o)}}}return null}}, {key:"currentLevel",get:function get(){var e=this.currentFrag;return e?e.level:-1}}, {key:"nextBufferedFrag",get:function get(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}}, {key:"forceStartLoad",get:function get(){return this._forceStartLoad}}])}(Gd); function Fg(e,t){var n=Fa(e);if(Ca){var r=Ca(e);t&&(r=Oa(r).call(r,function(t){return xo(e,t).enumerable})),n.push.apply(n,r)}return n} var Bg=function(e){function t(t,n){var r;return(r=e.call(this,"key-loader",n)||this).config=void 0,r.keyIdToKeyInfo={},r.emeController=null,r.config=t,r} Ka(t,e);var n=t.prototype;return n.abort=function(e){for(var t in this.keyIdToKeyInfo){var n=this.keyIdToKeyInfo[t].loader;if(n){var r;if(e&&e!==(null==(r=n.context)?void 0:r.frag.type))return;n.abort()}}}, n.detach=function(){for(var e in this.keyIdToKeyInfo){var t=this.keyIdToKeyInfo[e]; (t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}},n.destroy=function(){for(var e in this.detach(),this.keyIdToKeyInfo){var t=this.keyIdToKeyInfo[e].loader; t&&t.destroy()}this.keyIdToKeyInfo={}},n.createKeyLoadError=function(e,t,n,r,i){return void 0===t&&(t=xs.KEY_LOAD_ERROR),new oc({type:Ds.NETWORK_ERROR, details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})},n.loadClear=function(e,t,n){var r=this; if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(var i,o=function o(){var i=t[a];if(e.cc<=i.cc&&(!lu(e)||!lu(i)||e.sn1&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(function(n){return t.loadInternal(e,n)}):this.loadInternal(e)}, n.loadInternal=function(e,t){var n,r,i; t&&e.setKeyFormat(t);var o=e.decryptdata;if(!o){var a=new Error(t?"Expected frag.decryptdata to be defined after setting format "+t:"Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: "+ (this.emeController&&this.config.emeEnabled)+")");return d.reject(this.createKeyLoadError(e,xs.KEY_LOAD_ERROR,a))}var s=o.uri;if(!s)return d.reject(this.createKeyLoadError(e,xs.KEY_LOAD_ERROR,new Error('Invalid key URI: "'+ s+'"')));var u=Vg(o),l=this.keyIdToKeyInfo[u];if(null!=(n=l)&&n.decryptdata.key)return o.key=l.decryptdata.key,d.resolve({frag:e,keyInfo:l});if(this.emeController&&null!=(r=l)&&r.keyLoadPromise)switch(this.emeController.getKeyStatus(l.decryptdata)){case "usable":case "usable-in-future":return l.keyLoadPromise.then(function(t){var n= t.keyInfo;return o.key=n.decryptdata.key,{frag:e,keyInfo:n}})}if(null!=(i=l)&&i.keyLoadPromise&&function(e){switch(e.method){case "AES-128":case "AES-256":case "AES-256-CTR":return!0; case "SAMPLE-AES":case "SAMPLE-AES-CENC":case "SAMPLE-AES-CTR":return"identity"===e.keyFormat;default:return!1}}(o))return l.keyLoadPromise.then(function(t){return o.key=t.keyInfo.decryptdata.key,{frag:e, keyInfo:t.keyInfo}}); if(this.log((this.keyIdToKeyInfo[u]?"Rel":"L")+"oading"+(o.keyId?" keyId: "+tu(o.keyId):"")+" URI: "+o.uri+" from "+e.type+" "+e.level),l=this.keyIdToKeyInfo[u]={decryptdata:o,keyLoadPromise:null,loader:null, mediaKeySessionContext:null},o.size>1&&!this.config.emeEnabled){var c=this.keyIdToKeyInfo[s]={decryptdata:o,keyLoadPromise:null,loader:null,mediaKeySessionContext:null};return d.resolve({frag:e,keyInfo:c})}switch(o.method){case "SAMPLE-AES":case "SAMPLE-AES-CENC":case "SAMPLE-AES-CTR":return"identity"=== o.keyFormat?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case "AES-128":case "AES-256":case "AES-256-CTR":return this.loadKeyHTTP(l,e);default:return d.reject(this.createKeyLoadError(e,xs.KEY_LOAD_ERROR, new Error('Key supplied with unsupported METHOD: "'+o.method+'"')))}},n.loadKeyEME=function(e,t){var n={frag:t, keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&null!=(r=t.initSegment)&&r.data){var i=function(e){var t=[];return Pu(e,function(e){return t.push(e.subarray(8,24))}), t}(t.initSegment.data); if(i.length){var o=i[0];qa(o).call(o,function(e){return 0!==e})&&(this.log("Using keyId found in init segment "+tu(o)),e.decryptdata.keyId=o,qc.setKeyIdForUri(e.decryptdata.uri,o))}}var a=this.emeController.loadKey(n); return(e.keyLoadPromise=a.then(function(t){return e.mediaKeySessionContext=t,n}))["catch"](function(n){throw e.keyLoadPromise=null,"data"in n&&(n.data.frag=t),n; })}return d.resolve(n)},n.loadKeyHTTP=function(e,t){var n=this,r=this.config,i=new (0,r.loader)(r); return t.keyLoader=e.loader=i,e.keyLoadPromise=new d(function(o,a){var s={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=r.keyLoadPolicy["default"],l={loadPolicy:u,timeout:u.maxLoadTimeMs, maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:function onSuccess(e,t,r,i){var s=r.frag,u=r.keyInfo,l=Vg(u.decryptdata);if(!s.decryptdata||u!==n.keyIdToKeyInfo[l])return a(n.createKeyLoadError(s, xs.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),i));u.decryptdata.key=s.decryptdata.key=new Uint8Array(e.data),s.keyLoader=null,u.loader=null,o({frag:s,keyInfo:u})}, onError:function onError(e,r,i,o){n.resetLoader(r),a(n.createKeyLoadError(t,xs.KEY_LOAD_ERROR,new Error("HTTP Error "+e.code+" loading key "+e.text),i,function(e){for(var t=1;t-1?this.abrController.forcedAutoLevel:e}, set:function set(e){this.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}}, {key:"capLevelToPlayerSize",get:function get(){return this.config.capLevelToPlayerSize}, set:function set(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()), this.config.capLevelToPlayerSize=t)}}, {key:"autoLevelCapping",get:function get(){return this._autoLevelCapping}, set:function set(e){this._autoLevelCapping!==e&&(this.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}}, {key:"bandwidthEstimate",get:function get(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}, set:function set(e){this.abrController.resetEstimator(e)}}, {key:"abrEwmaDefaultEstimate",get:function get(){var e=this.abrController.bwEstimator;return e?e.defaultEstimate:NaN}}, {key:"ttfbEstimate",get:function get(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}}, {key:"maxHdcpLevel",get:function get(){return this._maxHdcpLevel}, set:function set(e){(function(e){return o(ul).call(ul,e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}}, {key:"autoLevelEnabled",get:function get(){return-1===this.levelController.manualLevel}}, {key:"manualLevel",get:function get(){return this.levelController.manualLevel}}, {key:"minAutoLevel",get:function get(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var n=e.length,r=0;r=t)return r;return 0}}, {key:"maxAutoLevel",get:function get(){var e,t=this.levels,n=this.autoLevelCapping,r=this.maxHdcpLevel;if(e=-1===n&&null!=t&&t.length?t.length-1:n,r)for(var i=e;i--;){var o=t[i].attrs["HDCP-LEVEL"];if(o&& o<=r)return i}return e}}, {key:"firstAutoLevel",get:function get(){return this.abrController.firstAutoLevel}}, {key:"nextAutoLevel",get:function get(){return this.abrController.nextAutoLevel}, set:function set(e){this.abrController.nextAutoLevel=e}}, {key:"playingDate",get:function get(){return this.streamController.currentProgramDateTime}}, {key:"mainForwardBufferInfo",get:function get(){return this.streamController.getMainFwdBufferInfo()}}, {key:"maxBufferLength",get:function get(){return this.streamController.maxBufferLength}}, {key:"allAudioTracks",get:function get(){var e=this.audioTrackController;return e?e.allAudioTracks:[]}}, {key:"audioTracks",get:function get(){var e=this.audioTrackController;return e?e.audioTracks:[]}}, {key:"audioTrack",get:function get(){var e=this.audioTrackController;return e?e.audioTrack:-1}, set:function set(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}}, {key:"allSubtitleTracks",get:function get(){var e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}}, {key:"subtitleTracks",get:function get(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}}, {key:"subtitleTrack",get:function get(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1}, set:function set(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}, {key:"media",get:function get(){return this._media}}, {key:"subtitleDisplay",get:function get(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}, set:function set(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}}, {key:"lowLatencyMode",get:function get(){return this.config.lowLatencyMode}, set:function set(e){this.config.lowLatencyMode=e}}, {key:"liveSyncPosition",get:function get(){return this.latencyController.liveSyncPosition}}, {key:"latency",get:function get(){return this.latencyController.latency}}, {key:"maxLatency",get:function get(){return this.latencyController.maxLatency}}, {key:"targetLatency",get:function get(){return this.latencyController.targetLatency}, set:function set(e){this.latencyController.targetLatency=e}}, {key:"drift",get:function get(){return this.latencyController.drift}}, {key:"forceStartLoad",get:function get(){return this.streamController.forceStartLoad}}, {key:"pathways",get:function get(){return this.levelController.pathways}}, {key:"pathwayPriority",get:function get(){return this.levelController.pathwayPriority}, set:function set(e){this.levelController.pathwayPriority=e}}, {key:"bufferedToEnd",get:function get(){var e;return!(null==(e=this.bufferController)||!e.bufferedToEnd)}}, {key:"interstitialsManager",get:function get(){var e;return(null==(e=this.interstitialsController)?void 0:e.interstitialsManager)||null}}],[{key:"version", get:function get(){return Wd}}, {key:"Events",get:function get(){return Ns}}, {key:"MetadataSchema",get:function get(){return nh}}, {key:"ErrorTypes",get:function get(){return Ds}}, {key:"ErrorDetails",get:function get(){return xs}}, {key:"DefaultConfig",get:function get(){return e.defaultConfig?e.defaultConfig:Tg}, set:function set(t){e.defaultConfig=t}}])}(); Hg.defaultConfig=void 0;var jg=n(45424),Gg=n.n(jg),Kg=n(76588),zg=n(69901),Wg=n(2203),qg=function(){function e(e){var t,n,r;this.callback=e,this._mediaKeyEventMap={sessioncreate:c()(t=this._onSessionCreated).call(t, this)},this._sessionEventMap={requestgenerate:c()(n=this._onRequestGenerated).call(n,this),sessionupdate:c()(r=this._onSessionUpdated).call(r,this)}} return e.prototype.observe=function(e){this.disconnect(),this._mediaKey=e,this._mediaKey&&this._addEvents(this._mediaKey,this._mediaKeyEventMap)},e.prototype.disconnect=function(){this._releaseSession(), this._mediaKeySession=void 0,this._mediaKey&&(this._removeEvents(this._mediaKey,this._mediaKeyEventMap),this._mediaKey=void 0)},e.prototype._setMediaKeySession=function(e){this._releaseSession(this._mediaKeySession), this._mediaKeySession=e,this._mediaKeySession&&this._addEvents(this._mediaKeySession,this._sessionEventMap)},e.prototype._releaseSession=function(e){e&&this._removeEvents(e,this._sessionEventMap)},e.prototype._addEvents= function(e,t){for(var n=0,r=g()(t);n=this._ranges.length)throw new Error("The index provided (".concat(e,") is greater than or equal to the maximum bound"));return this._ranges[e].start}, e.prototype.end=function(e){if(!this._ranges||e>=this._ranges.length)throw new Error("The index provided (".concat(e,") is greater than or equal to the maximum bound")); return this._ranges[e].end},m()(e.prototype,"length",{get:function get(){return this._ranges?this._ranges.length:0}, enumerable:!1,configurable:!0}),e}(),ey=n(43623); function ty(e,t){var n=g()(e);return!!n.length&&ss()(n).call(n,function(e){var n=e[0],r=e[1];return void 0!==t[n]&&r===t[n]})} var ny,ry=n(78990),iy=n(17602),_oy=function oy(){return _oy=i()||function(e){for(var t,n=1,r=arguments.length;n0)},e.getStreamProtocol=function(t,n){return e.isLowLatencyStream(t,n)?"LL-HLS":"HLS"},e}(),hy={enabled:!1, styles:{info:"color: skyblue; font-weight: bold",warn:"color: orange; font-weight: bold",error:"color: red; font-weight: bold"}};function fy(e,t){if(void 0===t&&(t="info"),hy.enabled){var n=hy.styles[t]; console.log("%c".concat(e),n)}} var py,vy=function(){function e(e){this.totalStallCount=0,this._stallEvents=[],this._healthMonitor=e} return e.prototype.recordStallEvent=function(e){this._stallEvents.push({timestamp:e}),this.totalStallCount++},e.prototype.expireStallEvents=function(e){var t,n=this,r=Pa()(t=this._stallEvents).call(t,function(t){return e- t.timestamp=this.stallThreshold&&this.dispatchEvent(new Vo.x(py.UNHEALTHY_STALL,{detail:{stallCount:t}}))},t.prototype.calculateFragmentMetrics=function(e,t,n){var r,i,o,a,s=e.frag,u=e.part,l=s.stats.loading.end- s.stats.loading.start,c=s.level||0,d=null!==(r=null==u?void 0:u.index)&&void 0!==r?r:0,h=(null===(i=null==u?void 0:u.stats)||void 0===i?void 0:i.loaded)||s.stats.loaded||0,f=null!==(a=null!==(o=null==u? void 0:u.duration)&&void 0!==o?o:s.duration)&&void 0!==a?a:0; this._totalFragmentCount++;var p=this._baseThreshold;return t0&&(p=this._stallFactor),{loadTime:l,level:c,partIndex:d,fileSize:h,partDuration:f,windowStallCount:n, forwardBufferLength:t,loadTimeFactorThreshold:p,isHealthy:!0,totalUnhealthyPct:this._calculateTotalPctInfo().totalPct,fragLoadedData:e}},t.prototype.stepFragHealth=function(e){var t=e.loadTime,n=e.level, r=e.partIndex,i=e.forwardBufferLength,o=e.fragLoadedData,a=ithis._stallThreshold; return{isUnhealthy:t||n,isUnhealthyEma:t,isUnhealthyStall:n}},t.prototype._updateUnhealthyCounts=function(e,t){e&&this._unhealthyFragmentCount++; var n=this.getWindowSize(t);this._recentFragmentHealthStatus.push(!e),this._recentFragmentHealthStatus.length>n&&this._recentFragmentHealthStatus.shift()},t.prototype._getUnhealthyReasons=function(e,t){var n= []; return e&&n.push("EMA_THRESHOLD"),t&&n.push("STALL_THRESHOLD"),n},t.prototype._dispatchHealthEvents=function(e,t,n,r){t&&this.dispatchEvent(new Vo.x(py.FRAGMENT_UNHEALTHY,{detail:{metrics:e, reasons:n}})),e.windowStallCount>this._stallThreshold&&this.dispatchEvent(new Vo.x(py.UNHEALTHY_STALL,{detail:{stallCount:e.windowStallCount}})),this._dispatchPctUnhealthyEvent(e,n,r)},t.prototype._dispatchPctUnhealthyEvent= function(e,t,n){var r,i,o,a=n.slidingWindowUnhealthyPct,s=n.slidingWindowUnhealthyCount,u=n.slidingWindowSize,l=this.getWindowSize(e.partDuration),c=$a()(a.toFixed(1)); u>=l&&a>this._pctUnhealthyThreshold&&c!==this._lastPctUnhealthyValue&&(this._lastPctUnhealthyValue=c,this.dispatchEvent(new Vo.x(py.PCT_UNHEALTHY,{detail:{slidingWindowUnhealthyPct:c,unhealthyCountInWindow:s, windowSize:u,currentFragmentMetrics:e,fragLoadedData:e.fragLoadedData,reasons:t}})),fy(cs()(r=cs()(i=cs()(o="[fragment-monitor] PCT_UNHEALTHY event dispatched. Sliding Window PCT: ".concat(c,"% \x3e ")).call(o, this._pctUnhealthyThreshold,"%. Unhealthy in window: ")).call(i,s,"/")).call(r,u),"warn"))},t.prototype.handleHlsError=function(e){var t,n,r,i,o,a,s=this,u=!1; switch(e.details){case xs.FRAG_LOAD_ERROR:case xs.FRAG_LOAD_TIMEOUT:case xs.KEY_LOAD_ERROR:case xs.KEY_LOAD_TIMEOUT:case xs.LEVEL_LOAD_ERROR:case xs.LEVEL_LOAD_TIMEOUT:case xs.FRAG_PARSING_ERROR:case xs.LEVEL_EMPTY_ERROR:var l; u=!0,fy(cs()(t=cs()(n="[fragment-monitor] Monitored HLS Error detected: ".concat(e.details," (type: ")).call(n,e.type,"), fatal: ")).call(t,e.fatal),"error"),e.fatal&&fy(cs()(l="[fragment-monitor] FATAL HLS Error: ".concat(e.details, " (type: ")).call(l,e.type,")"),"error");break;case xs.BUFFER_STALLED_ERROR:this.recordStallEvent(),fy(cs()(r=cs()(i="[fragment-monitor] Buffer stalled error detected: ".concat(e.details," (type: ")).call(i, e.type,"), fatal: ")).call(r,e.fatal),"warn");break;default:fy(cs()(o=cs()(a="[fragment-monitor] Unmonitored HLS Error detected: ".concat(e.details," (type: ")).call(a,e.type,"), fatal: ")).call(o,e.fatal), "info")}if(u){var c,d=fs()();this._errorEventTimestamps.push({timestamp:d,details:e.details}),this._errorEventTimestamps=Pa()(c=this._errorEventTimestamps).call(c,function(e){return d-e.timestamp=this._errorCountThreshold){var f,p,v,g=Ua()(f=this._errorEventTimestamps).call(f,function(e){return e.details}); this.dispatchEvent(new Vo.x(py.ERROR_RATE_UNHEALTHY,{detail:{count:h,windowMs:this._unhealthyWindowMs,errorDetailsList:g,lastErrorDetails:e.details}})),fy(cs()(p=cs()(v="[fragment-monitor] ERROR_RATE_UNHEALTHY event dispatched. Error count ".concat(h, " within ")).call(v,this._unhealthyWindowMs,"ms. Details: ")).call(p,E()(g)),"error")}}},t.prototype._calculateTotalPctInfo=function(){var e=this._unhealthyFragmentCount,t=this._totalFragmentCount; return{totalPct:t>0?e/t*100:0,totalUnhealthyFragments:e,totalFragmentCounts:t}},t.prototype._calculateSlidingWindowPct=function(){var e,t=this._recentFragmentHealthStatus.length; if(0===t)return{slidingWindowUnhealthyPct:0,slidingWindowUnhealthyCount:0,slidingWindowSize:t};var n=Pa()(e=this._recentFragmentHealthStatus).call(e,function(e){return!e}).length; return{slidingWindowUnhealthyPct:n/t*100,slidingWindowUnhealthyCount:n,slidingWindowSize:t}},t.prototype.logFragmentInfo=function(e,t,n,r,i,o,a,s){var u,l,c,d,h,f,p,v,g,y,m,_=e.level,E=e.partIndex,T=e.fileSize, b=e.partDuration,S=e.isHealthy,w=e.loadTime,A=e.loadTimeFactorThreshold,R=e.forwardBufferLength,L=e.fragLoadedData,I=this.getWindowSize(b),C=this._emaMap.get(_),O=(null===(f=null==C?void 0:C.parts.get(E))|| void 0===f?void 0:f.ema)||0,P=(O*A).toFixed(1),k=S?"HEALTHY":"UNHEALTHY",D=""; !S&&o&&(D=cs()(g=cs()(y=cs()(m=" [LoadTime(".concat(w.toFixed(1),"ms) \x3e Limit(")).call(m,P,"ms \x3d EMA(")).call(y,O.toFixed(1),"ms) \u00d7 Factor(")).call(g,A,"))]"),fy("[fragment-monitor] Unhealthy fragment detected", "warn"));var x,N=cs()(u="".concat(i,"/")).call(u,e.windowStallCount),M=s.slidingWindowUnhealthyPct,U=s.slidingWindowUnhealthyCount,F=s.slidingWindowSize,B=cs()(l=cs()(c="Sliding PCT: ".concat(M.toFixed(1), "% (")).call(c,U,"/")).call(l,F,")"),V=[cs()(d="[fragment-monitor] ".concat(L.part?"PART":"SEGMENT"," ")).call(d,E,", "),"SN: ".concat(L.frag.sn,", "),"Load: ".concat(w.toFixed(1),"ms, "),"EMA: ".concat(O.toFixed(1), "ms, "),"Part Duration: ".concat(b.toFixed(2),"s, "),"Buffer: ".concat(R.toFixed(2),"s, "),"Level: ".concat(_,", "),"Stall: ".concat(N,", "),"Total Unhealthy: ".concat(this._unhealthyFragmentCount,", "), "".concat(B,", "),"windowSizeInParts: ".concat(I,", "),"Size: ".concat(this._formatBytes(T),", "),"Independent: ".concat((null===(p=L.part)||void 0===p?void 0:p.independent)?"YES":"NO",", "),"Rate: ".concat(t, "x, ")];(!S||i>0)&&V.push(cs()(x="Catchup (NORMAL/SPEED_UP): ".concat(n,"/")).call(x,r,", "),"Samples: ".concat(null!==(v=null==C?void 0:C.sampleCount)&&void 0!==v?v:0,", ")),V.push("BwEstimateMb: ".concat((this.bandwidthEstimate/ 1E6).toFixed(2),", "),cs()(h="Status: ".concat(k)).call(h,a.length>0?" (".concat(a.join("|"),")"):""),D),fy(V.join(""),"info")},t.prototype._formatBytes=function(e){return"".concat((e/1024).toFixed(1), " KB")},t.prototype.getWindowSize=function(e){return Math.ceil(this._unhealthyWindowMs/(1E3*e))},t.prototype.destroy=function(){this.removeEventListener(py.PCT_UNHEALTHY,this._onPctUnhealthy),this._currentFragmentMetrics= null,this._currentEmaValue=0,this._lastPctUnhealthyValue=0},t}(Kg.Z),_Sy=function Sy(){return _Sy=i()||function(e){for(var t,n=1,r=arguments.length;n0&&1!==n&&n!==Ay}},e.prototype.processTimeUpdate=function(e,t,n){if(this._video&&!this._video.paused&&!this._video.seeking){var r=performance.now(); if(!this._handleCatchupSkip(r)){var i=this._getConfigValues(e,n),o=i.minBuffer,a=i.maxBuffer,s=i.maxPlaybackRate,u=i.liveRange,l=i.minDurationToLiveSync,c=i.minDurationToCatchup;this._isInLiveRange(u)? this._handleCatchUp(t,o,a,s,l,c,r):this._handleDvrZone()}}},e.prototype.processRateChange=function(){if(this._video){var e=this._video.playbackRate; if(this._isUserCustomRate=1!==e&&e!==Ay,this._previousRate!==e){var t=this._isCatchUpMode;this._previousRate=e,this._playbackRateChangedTime=performance.now(),this._isCatchUpMode=e===Ay,this._logRateChange(e, t)}}},e.prototype._handleCatchupSkip=function(e){return this._isUserCustomRate?(fy("[handleCatchupSkip] User custom rate detected: ".concat(this._video.playbackRate),"warn"),!0):e0&&e>=this._skipCatchUpUntil&&(fy("[CatchUp] Unhealthy skip END. catch-up resumed | _isCatchUpMode\x3d".concat(this._isCatchUpMode), "warn"),this._skipCatchUpUntil=0),!1)},e.prototype._isInLiveRange=function(e){return!!this._video&&(0===this._video.seekable.length||this._video.seekable.end(this._video.seekable.length-1)-this._video.currentTime< e)},e.prototype._handleDvrZone=function(){this._video.playbackRate===Ay&&this._updatePlaybackRate(1)},e.prototype._handleCatchUp=function(e,t,n,r,i,o,a){if(this._isUserCustomRate)fy("[handleCatchUp] User custom rate detected: ".concat(this._video.playbackRate), "warn"); else{var s=a-this._playbackRateChangedTime;if(!this._isCatchUpMode&&e>n&&s>i)return fy("[fragment-monitor] Catch-up mode activated","warn"),void this._updatePlaybackRate(r);this._isCatchUpMode&&e<=t&&s> o&&(fy("[fragment-monitor] Catch-up mode deactivated","warn"),this._updatePlaybackRate(1))}},e.prototype._updatePlaybackRate=function(e){if(this._video){var t=this._isCatchUpMode; this._isCatchUpMode=e===Ay,this._isInternalRateChange=!0,this._video.playbackRate=e,this._playbackRateChangedTime=performance.now(),this._previousRate=e,this._logRateChange(e,t)}},e.prototype._logRateChange= function(e,t){1!==e&&e!==Ay||(t&&1===e?this._normalRateCount++:e===Ay&&this._speedUpRateCount++,this._catchUpLogger.logRateChange({playbackRate:e, timestamp:fs()(),normalTotalCount:this._normalRateCount,speedUpTotalCount:this._speedUpRateCount}))},e.prototype._getConfigValues=function(e,t){var n=e.minLiveSyncBufferLength||0,r=e.maxLiveSyncBufferLength|| 0; return{minBuffer:n,maxBuffer:r,maxPlaybackRate:e.maxLiveSyncPlaybackRate||1,liveRange:"number"==typeof e.explictInLiveRange?e.explictInLiveRange:n+r+t,minDurationToLiveSync:e.minDurationToRetainAfterLiveSync|| 0,minDurationToCatchup:e.minDurationToRetainAfterCatchup||0}},e.prototype.destroy=function(){this._video&&(this._video.removeEventListener("ratechange",this._handleRateChange),this._video.playbackRate=== Ay&&(this._video.playbackRate=1)),this._catchUpLogger.destroy(),this._healthMonitor.removeEventListener(py.FRAGMENT_UNHEALTHY,this._onUnhealthy)},m()(e.prototype,"normalRateCount",{get:function get(){return this._normalRateCount}, enumerable:!1,configurable:!0}),m()(e.prototype,"speedUpRateCount",{get:function get(){return this._speedUpRateCount}, enumerable:!1,configurable:!0}),m()(e.prototype,"isCatchUpMode",{get:function get(){return this._isCatchUpMode}, enumerable:!1,configurable:!0}),e}(),Ly=n(45928); function Iy(e){var t;return Sa()(t=e.split(",")).call(t,function(e,t){var n=Ly.K.video[t];return n?(2*n+e)/(e?3:2):(Ly.K.audio[t]+e)/(e?2:1)},0)} var Cy=n(98824),Oy=["SDR","PQ","HLG"];function Py(e,t){var n=e.attrs.optionalFloat("FRAME-RATE",0),r=t.attrs.optionalFloat("FRAME-RATE",0);if(n!==r)return n-r;var i=e.attrs["VIDEO-RANGE"]||"SDR",o=t.attrs["VIDEO-RANGE"]|| "SDR";if(i!==o)return a()(Oy).call(Oy,i)-a()(Oy).call(Oy,o);if(e.videoCodec!==t.videoCodec){var s=(0,Cy.U)(e.videoCodec),u=(0,Cy.U)(t.videoCodec);if(s!==u)return s-u}if(e.uri===t.uri&&e.codecSet!==t.codecSet){var l= Iy(e.codecSet),c=Iy(t.codecSet);if(l!==c)return l-c}return e.bitrate!==t.bitrate?e.bitrate-t.bitrate:0} var ky=n(28871);function Dy(e){for(var t,n,r=[],i=1;i0}))),a.set(e.groupId,i)}}),(0,zy.EJ)(o,Ky.T,a)}},t.prototype.createTextTrack=function(e, t,n){var r=this.media; if(r){var i=document.createElement("track");i.src="data:text/vtt,WEBVTT",i.kind=e,i.label=t,n&&(i.srclang=n),r.appendChild(i);for(var o=!1,a=0;!o&&a-1&&this._hls.levels[d]?this._hls.levels[d]:null,f=null!==(s=null==h?void 0:h.height)&&void 0!==s?s:null,p=this._healthMonitor.healthDataModel.getSlidingWindowUnhealthyCount(),v=this._healthMonitor.healthDataModel.getTotalUnhealthyFragmentCount(), g=this._healthMonitor.healthDataModel.getFragmentDetails(),y=null!==(u=null==g?void 0:g.loadTime)&&void 0!==u?u:0,m=null!==(l=null==g?void 0:g.ema)&&void 0!==l?l:0,_=null!==(c=null==g?void 0:g.forwardBuffer)&& void 0!==c?c:0,E={tid:this._healthMonitor.healthDataModel.tid,isP2P:this._healthMonitor.healthDataModel.isP2P,currentLevelHeight:f,forwardBuffer:_,loadTimeMs:y,emaMs:m,triggerReason:e,switchTotalCount:this._switchTotalCount, slidingUnhealthyCount:p,totalUnhealthyCount:v,bwEstimateMb:$a()((this._hls.bandwidthEstimate/1E6).toFixed(2))};e===py.ERROR_RATE_UNHEALTHY&&(null==i?void 0:i.errorDetailsList)&&(E.triggerErrorDetails=i.errorDetailsList), this._semiAbrLogger.logSwitch(E),this._activeDebounceEndTime=r+t.DEBOUNCE_TIME_MS,this._debouncingPriority=n},t.prototype.destroy=function(){var e,t=this; p()(e=this._monitoredEvents).call(e,function(e){t._healthMonitor.removeEventListener(e,t._handleUnhealthyEvent)})},t.DEBOUNCE_TIME_MS=18E4,t}(Kg.Z),lm=function(){function e(){} return e.prototype.create=function(e,t,n){return new by(e,t,n)},e}(),cm=function(){var _e34=function e(t,n){return _e34=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e34(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e34(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),dm=function(e){function t(t){var n=e.call(this)||this; return n._onHealthDataModelFragmentUnhealthy=function(e){n.dispatchEvent(new Vo.x(py.FRAGMENT_UNHEALTHY,{detail:e.detail}))},n._onHealthDataModelUnhealthyStall=function(e){n.dispatchEvent(new Vo.x(py.UNHEALTHY_STALL, {detail:e.detail}))},n._onHealthDataModelErrorRateUnhealthy=function(e){n.dispatchEvent(new Vo.x(py.ERROR_RATE_UNHEALTHY,{detail:e.detail}))},n._onHealthDataModelPctUnhealthy=function(e){n.dispatchEvent(new Vo.x(py.PCT_UNHEALTHY, {detail:e.detail}))},n._healthDataModel=t,n._healthDataModel.addEventListener(py.FRAGMENT_UNHEALTHY,n._onHealthDataModelFragmentUnhealthy),n._healthDataModel.addEventListener(py.UNHEALTHY_STALL,n._onHealthDataModelUnhealthyStall), n._healthDataModel.addEventListener(py.ERROR_RATE_UNHEALTHY,n._onHealthDataModelErrorRateUnhealthy),n._healthDataModel.addEventListener(py.PCT_UNHEALTHY,n._onHealthDataModelPctUnhealthy),n} return cm(t,e),m()(t.prototype,"healthDataModel",{get:function get(){return this._healthDataModel}, enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this._healthDataModel.removeEventListener(py.FRAGMENT_UNHEALTHY,this._onHealthDataModelFragmentUnhealthy),this._healthDataModel.removeEventListener(py.UNHEALTHY_STALL, this._onHealthDataModelUnhealthyStall),this._healthDataModel.removeEventListener(py.ERROR_RATE_UNHEALTHY,this._onHealthDataModelErrorRateUnhealthy),this._healthDataModel.removeEventListener(py.PCT_UNHEALTHY, this._onHealthDataModelPctUnhealthy)},t}(Kg.Z),_hm=function hm(){return _hm=i()||function(e){for(var t,n=1,r=arguments.length;n=this._maxRetries?vm:pm:gm},e.prototype.recover=function(e){var t,n=this; if(null===this._timeoutId){var r=this._selectStrategy(),i=r.getStageName();this._lastRecoveryStrategy=i,0===this._retryCount&&this._logger.logErrorDetected({errorDetails:e.details,errorMessage:null===(t= e.error)||void 0===t?void 0:t.message,retryCount:this._retryCount,recoveryStrategy:i});var o=this._calculateDelay(this._retryCount);this._timeoutId=b()(function(){var e;n._retryCount+=1,n._attempts.push({strategy:i, retry:n._retryCount,delayMs:o}),n._logger.logRecoveryAttempt(n._retryCount,i);try{r.execute()}catch(t){return console.error("[DecodeErrorRecovery] Strategy execution failed:",t),n._timeoutId=null,void(n._retryCount>= n._maxRetries&&(n.logFailed(),null===(e=n._onRecoveryFailed)||void 0===e||e.call(n)))}n._timeoutId=null,n._retryCount>=n._maxRetries&&n._scheduleFailureDetection()},o)}},e.prototype.reset=function(){this._clearTimeout(), this._clearFailureDetectionTimeout(),this._retryCount>0&&this._logger.logRecoverySuccess(this._retryCount,this._lastRecoveryStrategy,this._attempts),this._retryCount=0,this._exhausted=!1,this._lastRecoveryStrategy= "start-load",this._attempts=[]},e.prototype.logFailed=function(){this._retryCount>0&&this._logger.logRecoveryFailed(this._retryCount,this._lastRecoveryStrategy,this._attempts)},e.prototype.destroy=function(){this._clearTimeout(), this._clearFailureDetectionTimeout(),this._exhausted=!0,this._retryCount=0,this._lastRecoveryStrategy="start-load",this._attempts=[]},e.prototype._selectStrategy=function(){var e=this._retryCount<2?0:1; return this._strategies[e]},e.prototype._matches=function(e){return e.details===xs.BUFFER_APPEND_ERROR},e.prototype._calculateDelay=function(e){return 1E3+1E3*Math.pow(e,2)},e.prototype._clearTimeout=function(){null!== this._timeoutId&&(window.clearTimeout(this._timeoutId),this._timeoutId=null)},e.prototype._clearFailureDetectionTimeout=function(){null!==this._failureDetectionTimeoutId&&(window.clearTimeout(this._failureDetectionTimeoutId), this._failureDetectionTimeoutId=null)},e.prototype._scheduleFailureDetection=function(){var e=this; this._failureDetectionTimeoutId=b()(function(){e.logFailed(),e._onRecoveryFailed&&e._onRecoveryFailed()},3E3)},function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=No()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);o>3&&a&&m()(t,n,a)}([(0,zg.z)(243)],e.prototype,"recover",null),e}(),Sm=function(){var _e37=function e(t,n){return _e37=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e37(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e37(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),wm=function(e){function t(t){var n=this,r=t.getHlsInstance(); if(!r)throw new Error("HLS instance not available");return(n=e.call(this,r)||this)._hlsController=t,n} return Sm(t,e),t.prototype.execute=function(){this._hlsController.reloadSource()},t.prototype.getStageName=function(){return"reload-source"},t}(ym),Am=function(){function e(e,t,n){var r; if(void 0===n&&(n={}),this._retryCount=0,this._exhausted=!1,this._timeoutId=null,this._failureDetectionTimeoutId=null,this._healthMonitor=t,this._maxRetries=null!==(r=n.maxRetries)&&void 0!==r?r:1,this._onRecoveryFailed= n.onRecoveryFailed,this._logger=new fm(t,$y.vz.experimental["hls.js"].enableRecoveryLogging),!n.hlsController)throw new Error("ManifestErrorRecoveryHandler requires hlsController for reloadSource strategy"); this._strategy=new wm(n.hlsController)} return e.prototype.canHandle=function(e){return this._matches(e)?this._exhausted||this._retryCount>=this._maxRetries?vm:pm:gm},e.prototype.recover=function(e){var t,n=this; if(null===this._timeoutId){var r=this._calculateDelay(this._retryCount);this._logger.logManifestErrorDetected({errorDetails:e.details,errorMessage:null===(t=e.error)||void 0===t?void 0:t.message,retryCount:this._retryCount, recoveryStrategy:"reload-source"}),this._timeoutId=b()(function(){var e;n._retryCount+=1,n._logger.logManifestRecoveryAttempt(n._retryCount,"reload-source");try{n._strategy.execute()}catch(t){return console.error("[ManifestErrorRecovery] Strategy execution failed:", t),n._timeoutId=null,void(n._retryCount>=n._maxRetries&&(n.logFailed(),null===(e=n._onRecoveryFailed)||void 0===e||e.call(n)))}n._timeoutId=null,n._retryCount>=n._maxRetries&&n._scheduleFailureDetection()}, r)}},e.prototype.reset=function(){this._clearTimeout(),this._clearFailureDetectionTimeout(),this._retryCount>0&&this._logger.logManifestRecoverySuccess(this._retryCount,"reload-source"),this._retryCount= 0,this._exhausted=!1},e.prototype.logFailed=function(){this._retryCount>0&&this._logger.logManifestRecoveryFailed(this._retryCount,"reload-source")},e.prototype.destroy=function(){this._clearTimeout(), this._clearFailureDetectionTimeout(),this._exhausted=!0,this._retryCount=0},e.prototype._calculateDelay=function(e){return 1E3+1E3*Math.pow(e,2)},e.prototype._matches=function(e){return e.details===xs.MANIFEST_PARSING_ERROR}, e.prototype._clearTimeout=function(){null!==this._timeoutId&&(window.clearTimeout(this._timeoutId),this._timeoutId=null)},e.prototype._clearFailureDetectionTimeout=function(){null!==this._failureDetectionTimeoutId&& (window.clearTimeout(this._failureDetectionTimeoutId),this._failureDetectionTimeoutId=null)},e.prototype._scheduleFailureDetection=function(){var e=this; this._failureDetectionTimeoutId=b()(function(){e.logFailed(),e._onRecoveryFailed&&e._onRecoveryFailed()},3E3)},function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=No()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);o>3&&a&&m()(t,n,a)}([(0,zg.z)(244)],e.prototype,"recover",null),e}(),Rm=function(){function e(e,t){void 0===t&&(t=10),this._retryCount=0,this._exhausted=!1,this._timeoutId=null,this._strategy= new _m(e),this._maxRetries=t} return e.prototype.canHandle=function(e){return this._matches(e)?this._exhausted||this._retryCount>=this._maxRetries?vm:pm:gm},e.prototype.recover=function(e){var t=this; if(null===this._timeoutId){var n=this._calculateDelay(this._retryCount);this._timeoutId=b()(function(){t._retryCount+=1;try{t._strategy.execute()}catch(e){return console.error("[GeneralErrorRecovery] Strategy execution failed:", e),void(t._timeoutId=null)}t._timeoutId=null},n)}},e.prototype.reset=function(){this._clearTimeout(),this._retryCount=0,this._exhausted=!1},e.prototype.destroy=function(){this._clearTimeout(),this._exhausted= !0,this._retryCount=0},e.prototype.getRetryCount=function(){return this._retryCount},e.prototype._calculateDelay=function(e){return 1E3+1E3*Math.pow(e,2)},e.prototype._matches=function(e){return e.fatal&& e.details!==xs.BUFFER_APPEND_ERROR&&e.details!==xs.MANIFEST_PARSING_ERROR},e.prototype._clearTimeout=function(){null!==this._timeoutId&&(window.clearTimeout(this._timeoutId),this._timeoutId=null)},function(e, t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=No()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);o>3&&a&&m()(t,n,a)}([(0,zg.z)(116)],e.prototype,"recover",null),e}(),Lm=((sm={})[Hg.ErrorDetails.MANIFEST_LOAD_ERROR]="MLE",sm[Hg.ErrorDetails.MANIFEST_LOAD_TIMEOUT]="MLT",sm[Hg.ErrorDetails.MANIFEST_PARSING_ERROR]= "MPE",sm[Hg.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR]="ICE",sm[Hg.ErrorDetails.LEVEL_LOAD_ERROR]="LLE",sm[Hg.ErrorDetails.LEVEL_LOAD_TIMEOUT]="LLT",sm[Hg.ErrorDetails.AUDIO_TRACK_LOAD_ERROR]="ALE", sm[Hg.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT]="ALT",sm[Hg.ErrorDetails.SUBTITLE_LOAD_ERROR]="SLE",sm[Hg.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT]="SLT",sm[Hg.ErrorDetails.FRAG_LOAD_ERROR]="FLE",sm[Hg.ErrorDetails.FRAG_LOAD_TIMEOUT]= "FLT",sm); function Im(e,t){var n,r,i;switch(e){case !0:i="L";break;case !1:i="V";break;default:i="U"}var o=Lm[t.details]||"UNK";return cs()(n=cs()(r="".concat(i)).call(r,"H")).call(n,o)} var Cm=function(){function e(e,t,n,r){void 0===r&&(r={});var i=this;this._errorFragmentSn=null,this._pendingReset=!1,this.isRecovering=!1,this._hls=e,this._generalErrorHandler=new Rm(e),this._decodeErrorHandler= new bm(e,t,{onRecoveryFailed:function onRecoveryFailed(){return i._handleDecodeErrorRecoveryFailure()}}),this._manifestErrorHandler=new Am(e,t,{onRecoveryFailed:function onRecoveryFailed(){return i._handleManifestErrorRecoveryFailure()}, hlsController:n}),this._onRecoveryFailed=r.onRecoveryFailed,this._recoveryHandlers=[this._decodeErrorHandler,this._manifestErrorHandler,this._generalErrorHandler],Gg().setOwnership(this._generalErrorHandler, this),Gg().setOwnership(this._decodeErrorHandler,this),Gg().setOwnership(this._manifestErrorHandler,this)} return e.prototype.recover=function(e){var t,n,r,i;if(this._pendingReset)return!1;if(this._lastErrorData=e,null===this._errorFragmentSn){var o=null===(t=e.frag)||void 0===t?void 0:t.sn;"number"==typeof o&& (this._errorFragmentSn=o)}void 0===this._lastIsLiveState&&(this._lastIsLiveState=null===(r=null===(n=this._hls.levels[this._hls.currentLevel])||void 0===n?void 0:n.details)||void 0===r?void 0:r.live),this.isRecovering|| (Gg().mark(this,"hls.errorRecoveryStart"),this.isRecovering=!0);for(var a=0,s=this._recoveryHandlers;akm&&e.length<=600?n=e.substring(km):e.length>600&&(n=e.substring(e.length-km)),{headText:t,tailText:n}} var _xm=function xm(){return _xm=i()||function(e){for(var t,n=1,r=arguments.length;n=50){var a,s=Pm()(a=this._lastLogTimes).call(a).next().value;void 0!==s&& this._lastLogTimes["delete"](s)}i=null!==(t=null==o?void 0:o.suppressedCount)&&void 0!==t?t:0,this._lastLogTimes.set(n,{lastLogTime:r,suppressedCount:0})}var u=Dm(e.content),l=u.headText,c=u.tailText,d= {logLevel:"ERROR",type:"event",event:e.event,tid:e.tid,isP2P:e.isP2P,currentLevel:this._healthMonitor.getCurrentLevelHeight(),url:e.url,corruptionDetails:e.corruptionDetails,mimeType:e.mimeType,headText:l, tailText:c,byteLength:e.byteLength,timestamp:e.timestamp,suppressedCount:i};"fragment-corrupted"===e.event&&e.fragmentType&&(d.fragmentType=e.fragmentType),void 0!==e.encrypted&&(d.encrypted=e.encrypted), e.manifestSnapshot&&(d.manifestUrl=e.manifestSnapshot.manifestUrl,d.manifestHeadText=e.manifestSnapshot.manifestHeadText,d.manifestTailText=e.manifestSnapshot.manifestTailText,d.manifestHasKeyTag=e.manifestSnapshot.manifestHasKeyTag), this._send(d)},e}(),Mm=n(54804),Um=n.n(Mm); function Fm(e,t){return"manifest"===t?function(e){switch(e){case "text/json":return"Missing #EXTM3U header (received JSON)";case "text/html":return"Missing #EXTM3U header (received HTML)";case "text/xml":return"Missing #EXTM3U header (received XML)"; case "text/error":return"Missing #EXTM3U header (received error message)";case "text/truncated":return"Truncated manifest (incomplete #EXTM3U header)";default:return"Missing #EXTM3U header"}}(e):function(e){switch(e){case "text/json":return"Invalid fragment format (received JSON response)"; case "text/html":return"Invalid fragment format (received HTML response)";case "text/xml":return"Invalid fragment format (received XML response)";case "text/error":return"Invalid fragment format (received error message)"; case "text/truncated":return"Truncated fragment (incomplete data)";case "binary/hex":return"Invalid binary format (missing media signature)";default:return"Invalid fragment format (unexpected content type)"}}(e)} var Bm=n(54903),Vm=n.n(Bm);function Hm(e){var t,n,r=Math.min(200,e.length),i=function(e){return Ua()(Array.prototype).call(e,function(e){var t;return Vm()(t=e.toString(16)).call(t,2,"0")}).join("")}(Ta()(e).call(e, 0,r)); return null!==(n=null===(t=i.match(/.{1,2}/g))||void 0===t?void 0:t.join(" "))&&void 0!==n?n:""} function jm(e){var t=e.split(/\r\n|\n/)[0],n=e.toLowerCase();return ts()(t).call(t,"{")||ts()(t).call(t,"[")?"text/json":ts()(t).call(t,"\x3c?xml")||ys()(n).call(n,"\x3cerror")?"text/xml":ts()(t).call(t, "\x3c!DOCTYPE")||ys()(n).call(n,"\x3chtml")||ts()(t).call(t,"\x3c")?"text/html":ys()(n).call(n,"error")||ys()(n).call(n,"not found")||ys()(n).call(n,"forbidden")?"text/error":ts()(t).call(t,"#EXT")&&!ts()(t).call(t, "#EXTM3U")?"text/truncated":"text/plain"} function Gm(e){var t=new Uint8Array(e),n=function(e){try{return(new TextDecoder("utf-8",{fatal:!0})).decode(e)}catch(e){return null}}(e); if(null!==n){var r=pa()(n).call(n);return{mimeType:jm(r),content:r,byteLength:e.byteLength}}return function(e,t){return function(e){return function(e){return 71===e[0]&&e.length>=188&&71===e[188]}(e)|| function(e){if(e.length<8)return!1; var t=e[0]<<24|e[1]<<16|e[2]<<8|e[3],n=String.fromCharCode(e[4],e[5],e[6],e[7]),r=["ftyp","moof","mdat","styp","free","skip","wide","pnot"];return!!ys()(r).call(r,n)&&function(e,t){return e>8&&e<=t||1=== e||0===e}(t,e.length)}(e)}(e)?{mimeType:"binary/media", content:Hm(e),byteLength:t}:{mimeType:"binary/hex",content:Hm(e),byteLength:t}}(t,e.byteLength)} var Km,zm=function(){function e(){} return e.validate=function(e,t){if(0===e.byteLength)return{isValid:!1,corruptionDetails:"Empty fragment response",content:"",byteLength:0,url:t};var n=Gm(e);return"binary/media"===n.mimeType?{isValid:!0, content:n.content,byteLength:n.byteLength,url:t}:{isValid:!1,corruptionDetails:Fm(n.mimeType,"fragment"),mimeType:n.mimeType,content:n.content,byteLength:n.byteLength,url:t}},e}(),_Wm=function Wm(){return _Wm= i()||function(e){for(var t,n=1,r=arguments.length;n=50){var v,g=Pm()(v=this._validations).call(v).next().value;this._validations["delete"](g)}this._validations.set(c,{state:"awaiting_validation",sn:e.frag.sn, partIndex:u,url:l,fragmentType:d,timestamp:fs()()})}else{var y=_Wm(_Wm({},p),{state:"logged"});this._logFragmentCorruption(y)}}}}},e.prototype._extractUrl=function(e,t){return(null==t?void 0:t.url)?t.url: e.url||"unknown"},e.prototype._savePending=function(e,t){var n=t.sn,r=t.partIndex,i=t.result,o=t.url,a=t.manifestSnapshot; if(this._validations.size>=50){var s,u=Pm()(s=this._validations).call(s).next().value;this._validations["delete"](u)}var l={state:"pending",sn:n,partIndex:r,url:o,fragmentType:this._detectFragmentType(o, n),corruptionDetails:i.corruptionDetails||"Unknown corruption",mimeType:i.mimeType,content:i.content,byteLength:i.byteLength,timestamp:fs()(),manifestSnapshot:a};this._validations.set(e,l)},e.prototype._logFragmentCorruption= function(e){this._logger.logCorruption({event:"fragment-corrupted", tid:this._healthMonitor.tid,isP2P:this._healthMonitor.isP2P,url:e.url,fragmentType:e.fragmentType,corruptionDetails:e.corruptionDetails||"Unknown corruption",mimeType:e.mimeType,content:e.content||"",byteLength:e.byteLength|| 0,timestamp:e.timestamp,manifestSnapshot:e.manifestSnapshot});var t=this._createFragmentKey(e.sn,e.partIndex);this._validations["delete"](t)},e.prototype._logEncryptedParsingError=function(e,t,n,r){this._logger.logCorruption({event:"fragment-corrupted", tid:this._healthMonitor.tid,isP2P:this._healthMonitor.isP2P,url:e,fragmentType:t,corruptionDetails:"Encrypted content parsing error",content:"",byteLength:n,timestamp:fs()(),encrypted:!0,manifestSnapshot:r})}, e.prototype._detectFragmentType=function(e,t){if("initSegment"===t)return"init"; var n=e.split("?")[0].toLowerCase();return Um()(n).call(n,".m4s")?"m4s":Um()(n).call(n,".m4v")?"m4v":Um()(n).call(n,".m4a")?"m4a":Um()(n).call(n,".mp4")?"mp4":Um()(n).call(n,".ts")?"ts":"unknown"},e.prototype.destroy= function(){this._validations.clear()},e}(),Zm=n(85418),Ym=function(){function e(){} return e.validate=function(t,n){var r=pa()(t).call(t);return 0===r.length?{isValid:!1,corruptionDetails:"Empty response",content:"",byteLength:0,url:n}:e._validateM3U8Format(r,n)},e._validateM3U8Format= function(e,t){var n=e.split(/\r\n|\n/)[0]; if(Zm.Yq.test(n))return{isValid:!0,content:e,byteLength:(new TextEncoder).encode(e).length,url:t};var r=jm(e);return{isValid:!1,corruptionDetails:Fm(r,"manifest"),mimeType:r,content:e,byteLength:(new TextEncoder).encode(e).length, url:t}},e}(),Xm=function(){function e(e,t){this._logger=e,this._healthMonitor=t} return e.prototype.validate=function(e){if(e.details===xs.MANIFEST_PARSING_ERROR){var t=e.response;if(t){var n="string"==typeof t.data?t.data:t.text||"";if(n){var r=e.url||"unknown",i=Ym.validate(n,r); i.isValid||this._logger.logCorruption({event:"manifest-corrupted",tid:this._healthMonitor.tid,isP2P:this._healthMonitor.isP2P,url:i.url,corruptionDetails:i.corruptionDetails||"Unknown corruption",mimeType:i.mimeType, content:i.content,byteLength:i.byteLength,timestamp:fs()()})}}}},e}(),Qm=function(){function e(e,t){var n,r,i,o=this; this._hls=e,this._healthMonitor=t,this._logger=new Nm(t,$y.vz.experimental["hls.js"].enableValidationLogging),this._manifestSnapshots=new (Yo()),this._fragmentHandler=new qm(this._logger,this._healthMonitor, function(e){var t;return null!==(t=o._manifestSnapshots.get(e))&&void 0!==t?t:null}),this._manifestHandler=new Xm(this._logger,this._healthMonitor),this._onFragLoadedHandler=c()(n=this._handleFragLoaded).call(n, this),this._onErrorHandler=c()(r=this._handleError).call(r,this),this._onLevelLoadedHandler=c()(i=this._handleLevelLoaded).call(i,this),Gg().setOwnership(this._logger,this),this._hls.on(Hg.Events.FRAG_LOADED, this._onFragLoadedHandler),this._hls.on(Hg.Events.ERROR,this._onErrorHandler),this._hls.on(Hg.Events.LEVEL_LOADED,this._onLevelLoadedHandler)} return e.prototype._handleFragLoaded=function(e,t){this._fragmentHandler.validate(t)},e.prototype._handleError=function(e,t){this._manifestHandler.validate(t),this._fragmentHandler.handleParsingError(t)}, e.prototype._handleLevelLoaded=function(e,t){var n=t.details,r=t.level; n.m3u8&&this._manifestSnapshots.set(r,function(e,t){var n=Dm(t);return{manifestUrl:e,manifestHeadText:n.headText,manifestTailText:n.tailText,manifestHasKeyTag:ys()(t).call(t,"#EXT-X-KEY")}}(n.url,n.m3u8))}, e.prototype.destroy=function(){this._hls.off(Hg.Events.FRAG_LOADED,this._onFragLoadedHandler),this._hls.off(Hg.Events.ERROR,this._onErrorHandler),this._hls.off(Hg.Events.LEVEL_LOADED,this._onLevelLoadedHandler), this._fragmentHandler.destroy(),this._manifestSnapshots.clear(),Gg().setOwnership(this._logger,void 0)},e}(); function Jm(e,t,n){e.addEventListener(t,n)} function $m(e,t,n){e.removeEventListener(t,n)} function e_(e){if(!e)return null;switch(e.state){case "IDLE":case "STOPPED":case "ENDED":case "ERROR":return null;default:return e.frag}} var t_=n(23690),n_=n(32571),r_=n(36206),i_=function(){var _e38=function e(t,n){return _e38=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e38(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e38(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),_o_=function o_(){return _o_=i()||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&m()(t,n,a),a},s_=function s_(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},u_=function u_(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(y=[])},E=function E(e,t){var n; "main"===(null===(n=t.details.fragmentHint)||void 0===n?void 0:n.type)&&(f=t.details.startSN,p=t.details.endSN,v=t.details.targetduration,g=t.details.partTarget)},T=function T(t,n){var r,i,o,a,s; if(e.seeking){if(n.part?(r=n.part.url,a=n.part.start,s=n.part.start+n.part.duration,i=n.frag.sn,o=n.part.index):(r=n.frag.url,a=n.frag.start,s=n.frag.start+n.frag.duration,i=n.frag.sn,o=void 0),"number"== typeof c&&isFinite(c)&&y.length-c>0)return;y.push({url:r,sn:i,index:o,start:a,end:s})}},b=function b(n,r){var i=e.currentTime; if(null!==r.stalled||function(e,t){var n=e_(e.main);if(n&&n.start<=t)return n;var r=e_(e.audio);return r&&r.start<=t?r:null}(t.inFlightFragments,i))_(); else if(!d){var a=performance.now();if(null!==h){var s=(a-h)/1E3;s0&&o.height>0&&t.add(cs()(i="".concat(o.width,"x")).call(i,o.height))}return t.size>1}(r)){var c=Dy(r,Yy(o)); -1!==c&&(this._hls.firstLevel=c,this._hls.startLevel=c,this._lastLevel=c)}else if(r.length>1){var d,h=_a()(d=Ta()(r).call(r,0)).call(d,Py).shift();this._hls.firstLevel=a()(r).call(r,h)}var f=null!=u&&isFinite(u)? u:this._maxBitrate;(null!==f||s)&&this._calculateAutoLevelCapping(f),this._maxBitrate=null!=u?u:null;var p=this._srcHashParams.streamType;if(p&&"fixed"===p.type)for(var v,g=Sa()(v=p.conditions).call(v, function(e,t){var n;return _o_(_o_({},e),((n={})[t.name]=t.value.replace(/"/g,""),n))},{}),y=function y(e){var t; if(ty(g,e.attrs))return"continue";var n=Aa()(t=m._hls.levels).call(t,function(t){return t===e}); if(-1===n)return"continue";m._hls.removeLevel(n)},m=this,_=0,E=this._hls.levels;_= 0){var e=this._hls.levels[this._hls.currentLevel]; e&&e.height&&this._healthMonitorDataModel.setCurrentLevelHeight(e.height)}},t.prototype._onError=function(e,t){if(this.dispatchEvent(new Vo.x(Qg.Z.HLS_JS_ERROR,{detail:t})),this.isLowLatency()&&this._healthMonitorDataModel&& this._healthMonitorDataModel.handleHlsError(t),t.details===xs.BUFFER_STALLED_ERROR&&this.dispatchEvent(new Vo.x(rm.Z.STALLED)),Xy(t)){var n; if(function(e){switch(e.details){case Hg.ErrorDetails.KEY_SYSTEM_NO_KEYS:case Hg.ErrorDetails.KEY_SYSTEM_NO_ACCESS:case Hg.ErrorDetails.KEY_SYSTEM_NO_SESSION:case Hg.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED:case Hg.ErrorDetails.FRAG_DECRYPT_ERROR:case Hg.ErrorDetails.KEY_LOAD_ERROR:case Hg.ErrorDetails.KEY_LOAD_TIMEOUT:return!1; case Hg.ErrorDetails.MANIFEST_PARSING_ERROR:return!0;case Hg.ErrorDetails.FRAG_PARSING_ERROR:case Hg.ErrorDetails.LEVEL_SWITCH_ERROR:return!1;case Hg.ErrorDetails.MANIFEST_LOAD_ERROR:case Hg.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case Hg.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR:case Hg.ErrorDetails.LEVEL_LOAD_ERROR:case Hg.ErrorDetails.LEVEL_LOAD_TIMEOUT:case Hg.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case Hg.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case Hg.ErrorDetails.SUBTITLE_LOAD_ERROR:case Hg.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:case Hg.ErrorDetails.FRAG_LOAD_ERROR:case Hg.ErrorDetails.FRAG_LOAD_TIMEOUT:return!0; case Hg.ErrorDetails.BUFFER_ADD_CODEC_ERROR:case Hg.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR:return!1;case Hg.ErrorDetails.BUFFER_STALLED_ERROR:return!0;case Hg.ErrorDetails.REMUX_ALLOC_ERROR:case Hg.ErrorDetails.BUFFER_NUDGE_ON_STALL:case Hg.ErrorDetails.BUFFER_SEEK_OVER_HOLE:case Hg.ErrorDetails.LEVEL_EMPTY_ERROR:case Hg.ErrorDetails.BUFFER_APPENDING_ERROR:case Hg.ErrorDetails.BUFFER_FULL_ERROR:case Hg.ErrorDetails.INTERNAL_ABORTED:return!1; case Hg.ErrorDetails.BUFFER_APPEND_ERROR:return!0;case Hg.ErrorDetails.INTERNAL_EXCEPTION:case Hg.ErrorDetails.UNKNOWN:return!1}return!e.fatal}(t)&&this._tryToRecoverError(t))return; switch(t.type){case Hg.ErrorTypes.NETWORK_ERROR:n=Yg.Z.MEDIA_ERR_NETWORK;break;case Hg.ErrorTypes.MEDIA_ERROR:case Hg.ErrorTypes.MUX_ERROR:default:n=Yg.Z.MEDIA_ERR_DECODE}n&&(this._error={code:n,message:t.details}, this.dispatchEvent(new Vo.x("error")))}},t.prototype._tryToRecoverError=function(e){var t,n; return!this.videoElement||!!dy.isP2PStream(this._src)||null!==(n=null===(t=this._errorController)||void 0===t?void 0:t.recover(e))&&void 0!==n&&n},t.prototype._dispatchFatalError=function(e,t){var n=t; if(!n)switch(e.type){case Hg.ErrorTypes.NETWORK_ERROR:n=Yg.Z.MEDIA_ERR_NETWORK;break;case Hg.ErrorTypes.MEDIA_ERROR:case Hg.ErrorTypes.MUX_ERROR:default:n=Yg.Z.MEDIA_ERR_DECODE}n&&(this._error={code:n, message:e.details},this.dispatchEvent(new Vo.x("error")))},t.prototype.getRecoveryController=function(){return this._errorController},t.prototype._onLevelLoaded=function(e,t){var n,r,i,o,a; if(this.dispatchEvent(new Vo.x(Qg.Z.LEVEL_LOADED,{detail:t})),t.details.live){if(this._duration=1/0,this._hls.config.lowLatencyMode&&(null===(n=t.details.partList)||void 0===n?void 0:n.length)){var s=this._hls, u=s.config,l=s.userConfig,c=$y.vz.experimental["hls.js"],d=c.maxLiveSyncPlaybackRate,h=c.explictInLiveRange,f=c.maxLiveSyncBufferLength,p=c.minLiveSyncBufferLength,v=c.minDurationToRetainAfterLiveSync, g=c.minDurationToRetainAfterCatchup,y=c.liveMaxLatencyDurationCount,m=c.liveMaxLatencyDuration,_=c.liveSyncDuration,E=c.liveSyncDurationCount,T=c.preferManagedMediaSource;void 0!==T&&(u.preferManagedMediaSource= T,l.preferManagedMediaSource=T),void 0!==_&&this._updateHlsConfig({liveSyncDuration:_}),void 0!==E&&this._updateHlsConfig({liveSyncDurationCount:E}),void 0!==v&&this._updateHlsConfig({minDurationToRetainAfterLiveSync:v}), void 0!==g&&this._updateHlsConfig({minDurationToRetainAfterCatchup:g}),void 0!==p&&this._updateHlsConfig({minLiveSyncBufferLength:p}),void 0!==f&&this._updateHlsConfig({maxLiveSyncBufferLength:f}),void 0!== d&&this._updateHlsConfig({maxLiveSyncPlaybackRate:d}),void 0!==m&&this._updateHlsConfig({liveMaxLatencyDuration:m}),void 0!==y&&this._updateHlsConfig({liveMaxLatencyDurationCount:y}),void 0!==h&&this._updateHlsConfig({explictInLiveRange:h}); var b=1E3*Math.min(t.details.totalduration,60);u.fragLoadPolicy={"default":{maxTimeToFirstByteMs:b,maxLoadTimeMs:b,timeoutRetry:{maxNumRetry:3,retryDelayMs:1E3*t.details.partTarget,maxRetryDelayMs:1E3* t.details.partTarget},errorRetry:{maxNumRetry:3,retryDelayMs:1E3*t.details.partTarget,maxRetryDelayMs:1E3*t.details.partTarget}}},l.fragLoadPolicy={"default":{maxTimeToFirstByteMs:b,maxLoadTimeMs:b,timeoutRetry:{maxNumRetry:3, retryDelayMs:1E3*t.details.partTarget,maxRetryDelayMs:1E3*t.details.partTarget},errorRetry:{maxNumRetry:3,retryDelayMs:1E3*t.details.partTarget,maxRetryDelayMs:1E3*t.details.partTarget}}},this._disableLiveSyncDurationCount&& (u.liveSyncDurationCount=4)}var S=this._hls.config;S.levelLoadingMaxRetry=5,S.levelLoadingMaxRetryTimeout=1E4,S.fragLoadingMaxRetry=5,"ie"!==(null===(r=(0,ey.Xh)())||void 0===r?void 0:r.toLowerCase())&& (S.liveDurationInfinity=!0)}else this._duration=t.details.totalduration;if(isNaN(this._earliestProgramDateTime)){var w=null===(o=null===(i=t.details.fragments)||void 0===i?void 0:i[0])||void 0===o?void 0: o.programDateTime;w&&(this._earliestProgramDateTime=w)}if(this._currentLevelInfo=t,this._serverTimingsCollector&&t.details.live){var A=null!==(a=t.details.averagetargetduration)&&void 0!==a?a:t.details.targetduration; this._serverTimingsCollector.setDurations(A,t.details.partTarget||null),this._serverTimingsCollector.start()}if(!this._validationController&&t.details.live&&(this._validationController=new Qm(this._hls, this._healthMonitorDataModel)),this.isLowLatency()&&(!this._catchUpController&&this._video&&this._healthMonitorDataModel&&(this._catchUpController=new Ry(this._video,this._healthMonitor),this._attachCatchUpEvents(this._video)), $y.vz.experimental["hls.js"].enableSemiAbr&&!this._semiAbrController&&this._healthMonitorDataModel&&(this._semiAbrController=new um(this._healthMonitor,this._hls)),this._catchUpController&&(this._catchUpController.setLowLatencyMode(t), this._hls.currentLevel>=0))){var R=this._hls.levels[this._hls.currentLevel];R&&R.height&&this._healthMonitorDataModel.setCurrentLevelHeight(R.height)}},t.prototype._attachCatchUpEvents=function(e){this._catchUpController&& e.addEventListener("timeupdate",this._onTimeUpdateForCatchUp)},t.prototype._detachCatchUpEvents=function(e){this._catchUpController&&e.removeEventListener("timeupdate",this._onTimeUpdateForCatchUp)},t.prototype._getForwardBufferLength= function(){var e,t; if(!this._video)return 0;var n=this._video;return n.buffered&&n.buffered.length>0?n.buffered.end(n.buffered.length-1)-n.currentTime:(null===(t=null===(e=this._currentLevelInfo)||void 0===e?void 0:e.details)|| void 0===t?void 0:t.edge)?this._currentLevelInfo.details.edge-n.currentTime:0},t.prototype._onBufferCodecUpdated=function(e,t){var n,r,i; if(t.video&&(this.codecs.video=null===(n=t.video)||void 0===n?void 0:n.codec),t.audio&&(this.codecs.audio=null===(r=null==t?void 0:t.audio)||void 0===r?void 0:r.codec),null===(i=t.audiovideo)||void 0=== i?void 0:i.codec){var o=(0,Zg.S)(t.audiovideo.codec),a=o.video,s=o.audio;a&&(this.codecs.video=a),s&&(this.codecs.audio=s)}},t.prototype._onMediaPlayed=function(){this._shouldPlayThrough=!0},t.prototype._onMediaPlaying= function(){var e; (null===(e=this._errorController)||void 0===e?void 0:e.isRecovering)&&this._errorController.requestReset(),this._shouldPlayThrough=!0},t.prototype._onMediaPaused=function(){this._disableLiveSyncDurationCount= !1,this._shouldPlayThrough=!1},m()(t.prototype,"subtitleDisplay",{get:function get(){return this._hls.subtitleDisplay}, set:function set(e){this._hls.subtitleDisplay=e}, enumerable:!1,configurable:!0}),t.prototype.setDisableLiveSyncDurationCount=function(e){this._disableLiveSyncDurationCount=e},t.prototype.getCurrentLevelInfo=function(){return this._currentLevelInfo},t.prototype.reloadSource= function(){this._loadSource()},t.prototype.setError=function(e){this._error=e},m()(t.prototype,"maxBitrate",{get:function get(){return this._maxBitrate}, set:function set(e){this._maxBitrate!==e&&(this._maxBitrate=e,this._calculateAutoLevelCapping(e))}, enumerable:!1,configurable:!0}),t.prototype._calculateAutoLevelCapping=function(e){var t,n=this._hls.levels,r=null===(t=this._srcHashParams)||void 0===t?void 0:t.levelCap,i=function(e){for(var t,n,r=[], i=1;i0&&s>0){var c=Math.max(2*s,1),d=Math.max(c,a);l=Math.max(0,t-d)}else{if((l=Math.max(0,t-Math.max(r,1)))-u<3*r)return new $g}else l=t;return new $g([{start:u,end:l}])}, enumerable:!1,configurable:!0}),m()(t.prototype,"dvrOffset",{get:function get(){if(!this.videoElement)return NaN;if(isFinite(this.duration))return 0;var e=(0,Wg.Z)(this.videoElement.seekable);if(isFinite(e))return 0; var t=(0,Wg.Z)(this.seekable||null);return Math.max(0,e-t)}, enumerable:!1,configurable:!0}),t.prototype.getStartDate=function(){return new Date(this._earliestProgramDateTime)},t.prototype._dumpState=function(){var e,t; return{type:"HLS",error:this.error,hls:null===(t=null===(e=this._hls)||void 0===e?void 0:e._dumpState)||void 0===t?void 0:t.call(e)}},m()(t.prototype,"mediaKeysController",{get:function get(){return this._mediaKeysController}, set:function set(e){this._mediaKeysController=e,this._mediaKeysController?this.dispatchEvent(new Vo.x("mediakeyallocated")):this.dispatchEvent(new Vo.x("mediakeydeallocated"))}, enumerable:!1,configurable:!0}),m()(t.prototype,"isCatchUpRateActive",{get:function get(){var e,t;return null!==(t=null===(e=this._catchUpController)||void 0===e?void 0:e.isCatchUpMode)&&void 0!==t&&t}, enumerable:!1,configurable:!0}),m()(t.prototype,"targetLatency",{get:function get(){var e,t,n=null,r=null===(e=this._currentLevelInfo)||void 0===e?void 0:e.details;return r&&(n=this._hls.config.lowLatencyMode&& (null===(t=r.partList)||void 0===t?void 0:t.length)?this._hls.targetLatency||r.partHoldBack||3*r.partTarget:r.holdBack||3*(r.averagetargetduration||r.targetduration)),n||0}, enumerable:!1,configurable:!0}),t.prototype._getTid=function(){var e;return(null===(e=this._srcHashParams)||void 0===e?void 0:e.tid)||""},n=jg.logDimensions,a_([(0,zg.z)(118)],t.prototype,"destroy",null), a_([(0,zg.z)(107)],t.prototype,"load",null),a_([(0,zg.z)(108)],t.prototype,"_loadInternal",null),a_([(0,zg.z)(109)],t.prototype,"_loadSource",null),a_([(0,zg.z)(110)],t.prototype,"_onManifestLoading",null), a_([(0,zg.z)(111)],t.prototype,"_onManifestLoaded",null),a_([(0,zg.z)(112)],t.prototype,"_onManifestParsed",null),a_([(0,zg.z)(113)],t.prototype,"_onFragChanged",null),a_([(0,zg.z)(114)],t.prototype,"_onFragLoaded", null),a_([(0,zg.z)(115)],t.prototype,"_onError",null),a_([(0,zg.z)(117)],t.prototype,"_onLevelLoaded",null),a_([(0,zg.z)(219)],t.prototype,"_onBufferCodecUpdated",null),a_([(0,zg.z)(221)],t.prototype,"_onMediaPlayed", null),a_([(0,zg.z)(220)],t.prototype,"_onMediaPlaying",null),a_([(0,zg.z)(222)],t.prototype,"_onMediaPaused",null),a_([(0,zg.u)(223)],t.prototype,"maxBitrate",null),t}(Kg.Z),d_=c_,h_=n(57027),f_=n(14370), p_=n(1558),v_=n(51015),g_=n(36296),y_=n(74506),m_=n(66376),__=n(33612),E_=n(79296),T_=n(50507); function b_(e){return Za()(e).call(e,T_.Lx)} var S_=n(82174),w_=n(13E3);function A_(e,t){var n;return void 0===t&&(t="application/x-mpegURL"),cs()(n="data:".concat(t,",")).call(n,encodeURIComponent(e),"\n")} var R_=["dvh1","hvc1","avc1"];function L_(e,t){var n,r;if(!(0,T_.sS)(e)||!(0,T_.sS)(t))return 0;var i=null===(n=e.value.attrs)||void 0===n?void 0:Po()(n).call(n,function(e){return"CODECS"===e.name}),o= null===(r=t.value.attrs)||void 0===r?void 0:Po()(r).call(r,function(e){return"CODECS"===e.name}); return i&&o?Aa()(R_).call(R_,function(e){var t;return ys()(t=i.value).call(t,e)})-Aa()(R_).call(R_,function(e){var t; return ys()(t=o.value).call(t,e)}):0} var I_=n(13272);function C_(e){var t,n,r,i,o,a,s;return i=this,o=void 0,s=function s(){var i;return function(e,t){var n,r,i,o,a={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=r?r:n} var q_=function(e){function t(){var t=e.call(this)||this;return t._serverTimingsCollector=null,t.codecs={video:void 0,audio:void 0,audioChannel:"2"},t._onLoadedMetadata=function(){t._video&&t._subtitleCharacteristics&& (0,zy.EJ)(t._video,Ky.T,t._subtitleCharacteristics)},t[F_]={hlsMuxed:function hlsMuxed(){return t._muxed}, internalPlayerName:function internalPlayerName(){return"Safari"}},t._src="",t._caches=null,t._video=null,t._error=null,t._maxBitrate=null,t._srcHashParams=null,t.mediaKeysController=null,t._m3u8Loader= new B_.Z(null),t._serverTimingsCollector=n_.fA.create($y.vz.experimental["hls.js"]),t} return V_(t,e),t.prototype.destroy=function(){var e;this._video&&((0,zy.yM)(this._video,Ky.T),this._video.removeEventListener("loadedmetadata",this._onLoadedMetadata)),null===(e=this._serverTimingsCollector)|| void 0===e||e.drainAndDisconnect(),this._serverTimingsCollector=null,this._src="",this._caches=null,this._video=null,this._error=null},t.prototype.load=function(){if(!this._video)throw new Error("VideoElement is not assigned"); this._loading&&this._loading.abort(),this._loading=new g_.v;var e=(0,Jg.Z)(this._src),t=e?e.uri:this._src;this._srcHashParams=e,this._loadInternal(t,e,this._loading.signal)["catch"](function(e){"AbortError"!== e.name&&console.error(e)})},t.prototype._loadInternal=function(e,t,n){var r; return j_(this,void 0,void 0,function(){var i,o;return G_(this,function(a){switch(a.label){case 0:return[4,null===(r=this._caches)||void 0===r?void 0:r.match(e)];case 1:return i=a.sent(),n.aborted?[2]: i||t||this.mediaKeysController?[3,2]:(this._loadSync(e),[3,5]);case 2:return a.trys.push([2,4,,5]),[4,this._parseAndLoad(e,t,n)];case 3:return a.sent(),[3,5];case 4:return"AbortError"===(o=a.sent()).name? [2]:(console.error(o),[3,5]);case 5:return[2]}})})},m()(t.prototype,"src",{get:function get(){return this._src}, set:function set(e){this._error=null,this._src=e;var t=(0,Jg.Z)(this._src);this._srcHashParams=t,this._maxBitrate=(null==t?void 0:t.maxBitrate)||null}, enumerable:!1,configurable:!0}),m()(t.prototype,"videoElement",{get:function get(){return this._video}, set:function set(e){var t,n;null===(t=this._video)||void 0===t||t.removeEventListener("loadedmetadata",this._onLoadedMetadata),this._video=e,null===(n=this._video)||void 0===n||n.addEventListener("loadedmetadata", this._onLoadedMetadata)}, enumerable:!1,configurable:!0}),m()(t.prototype,"error",{get:function get(){return this._error}, enumerable:!1,configurable:!0}),m()(t.prototype,"caches",{get:function get(){return this._caches}, set:function set(e){this._caches=e,this._m3u8Loader.caches=e,e&&this._serverTimingsCollector&&(0,n_.XE)(e,this._serverTimingsCollector)}, enumerable:!1,configurable:!0}),m()(t.prototype,"maxBitrate",{get:function get(){return this._maxBitrate}, set:function set(e){var t=this,n="number"!=typeof e||isFinite(e)?e:null;if(this._maxBitrate!==n&&(this._maxBitrate=n,this.load(),this.videoElement&&!this.videoElement.paused)){var r=(0,h_.R)(this.videoElement, "loadedmetadata"),i=(0,f_.T)((0,h_.R)(this.videoElement,"abort"),(0,h_.R)(this.videoElement,"ended"),(0,h_.R)(this.videoElement,"error"));r.pipe((0,p_.R)(i),(0,v_.q)(1)).subscribe(function(){var e;null=== (e=t.videoElement)||void 0===e||e.play()})}}, enumerable:!1,configurable:!0}),t.prototype._loadSync=function(e){this._video&&(this._video.src===e||(this._video.src=e,this._video.currentTime=0),this._video.load())},t.prototype._parseAndLoad=function(e, t,n){return j_(this,void 0,void 0,function(){var r,i,o,a=this; return G_(this,function(s){switch(s.label){case 0:return[4,this._parse(e,t)];case 1:return r=s.sent(),n.aborted?[2]:this._video?(i=this._video.paused,o=function o(){var e;a._loadSync(r),i||null===(e=a._video)|| void 0===e||e.play()["catch"](console.error)},this._runningPlayPromise?this._runningPlayPromise["finally"]().then(o):o(),[2]):[2]}})})},t.prototype._decryptUrl=function(e){return j_(this,void 0,void 0, function(){return G_(this,function(t){return[2, this.mediaKeysController?this.mediaKeysController.decryptRequestUri(e):e]})})},t.prototype._parse=function(e,t){return j_(this,void 0,void 0,function(){var n,r,i,o,a,s; return G_(this,function(u){switch(u.label){case 0:return n=new y_.Z,[4,this._decryptUrl(e)];case 1:return r=u.sent(),[4,this._m3u8Loader.load(r)];case 2:return i=u.sent(),o=n.parse(i),[4,h().all(Ua()(o).call(o, C_))];case 3:return a=u.sent(),l=s=Pa()(o).call(o,function(e,t){return a[t]}),Za()(l).call(l,T_.UL)?b_(s)?[2, this._parseMediaPlaylist(r,s,t)]:[2,e]:[2,this._parseMasterPlaylist(r,s,t)]}var l})})},t.prototype._parseMediaPlaylist=function(e,t,n){var r; return j_(this,void 0,void 0,function(){var n,i,o,a,s=this;return G_(this,function(u){var l;switch(u.label){case 0:return(n=new m_.ZP(t)).baseUrl=(0,w_.Z)(e),[4,null===(r=this.caches)||void 0===r?void 0: r.match(e)];case 1:return u.sent()?(i=Pa()(t).call(t,T_.UL),o=Pa()(t).call(t,T_._q),a=Ua()(l=K_(K_([],i,!0),o,!0)).call(l,function(e){return j_(s,void 0,void 0,function(){var t;return G_(this,function(n){switch(n.label){case 0:return e.value.uri? (t=e.value,[4,this._decryptUrl(e.value.uri)]):[3,2];case 1:t.uri=n.sent(),n.label=2;case 2:return[2]}})})}),[4, h().all(a)]):[3,3];case 2:u.sent(),u.label=3;case 3:return[2,A_(n.buildToString())]}})})},t.prototype._parseMasterPlaylist=function(e,t,n){var r,i; return j_(this,void 0,void 0,function(){var o,s,l,d,f,v,g,y,m,_,E,T,b,S,w,A,R,L,I,C,O,P,k,D=this;return G_(this,function(x){var N,M,U,F,B;switch(x.label){case 0:var V;if(o=t,n&&(o=Pa()(V=Pa()(o).call(o, (B=n.levelCap,"number"!=typeof B?function(){return!0}:function(e){var t=(0,E_.Z)(e,"RESOLUTION"); if(!t)return!0;var n=W_(t);return-1===n||n<=B}))).call(V,function(e){var t,r=n.streamType; return!r||"EXT-X-STREAM-INF"!==e.name||ss()(t=r.conditions).call(t,function(t){var n,r;return null===(r=null===(n=e.value)||void 0===n?void 0:n.attrs)||void 0===r?void 0:Po()(r).call(r,c()(ty).call(ty, null,t))})})),(null==n?void 0:n.track)?(s=n.track,o=Pa()(o).call(o,function(e){var t,n; if(!(0,T_.sS)(e))return!0;var r=null===(n=null===(t=(0,E_.Z)(e,"X-CLIENT-STREAM-ID"))||void 0===t?void 0:t.value.match(/^"(.+)"$/))||void 0===n?void 0:n[1];return!!r&&s.has(r)})):this._maxBitrate&&isFinite(this._maxBitrate)&& (o=Pa()(o).call(o,"number"!=typeof(F=this._maxBitrate)?function(){return!0}:function(e){var t=(0,E_.Z)(e,"BANDWIDTH"); if(!t)return!0;var n=Qa()(t.value,10);return!!isNaN(n)||n<=F})),o=Pa()(o).call(o,function(e){return"EXT-X-I-FRAME-STREAM-INF"!==e.type}),this._subtitleCharacteristics=$y.vz.experimental.avplayer.enableTextTrackCharacteristics? function(e,t){void 0===t&&(t=["SUBTITLES", "CLOSED-CAPTIONS","VIDEO","AUDIO"]);var n=(0,ky.Z)(e,function(e){if((0,T_.sS)(e))return D_;if(!(0,T_.nm)(e))return N_;var n=U_(e,"TYPE");return n&&-1!==a()(t).call(t,n)&&U_(e,P_)&&U_(e,O_)&&U_(e,k_)?x_: N_}),r=n[D_],i=void 0===r?[]:r,o=n[x_],s=void 0===o?[]:o,u=new (Es()); p()(i).call(i,function(e){p()(t).call(t,function(t){var n=U_(e,t);n&&"NONE"!==n&&u.add(n)})}); var l=new (Yo());return p()(s).call(s,function(e){var t,n,r,i=U_(e,P_);if(u.has(i)){var o=M_(i),a=M_(U_(e,O_)),s=Pa()(t=Ua()(n=M_(U_(e,k_)).split(",")).call(n,function(e){return pa()(e).call(e)})).call(t, function(e){return e.length>0}),c=null!==(r=l.get(o))&&void 0!==r?r:new (Yo()); c.has(a)||c.set(a,Gy()(s)),l.set(o,c)}}),l}(o,["SUBTITLES", "CLOSED-CAPTIONS"]):void 0,l=_a()(N=Pa()(o).call(o,T_.sS)).call(N,L_),d=cs()(k=[]).apply(k,Pa()(M=Ua()(o).call(o,function(e){var t,n;return null===(n=null===(t=e.value)||void 0===t?void 0:t.attrs)||void 0=== n?void 0:Pa()(n).call(n,function(e){return"URI"===e.name})})).call(M,Boolean)),(f=(0,S_.D)(l))&&(this.codecs.video=f.video,this.codecs.audio=f.audio),"iOS"===(0,ey.os)()&&Qa()("".concat((0,ey.MM)()),10)>= 11)p()(l).call(l,z_); else if("Mac OS"===(0,ey.os)()&&"Safari"===(0,ey.Xh)()){var H;v=Ua()(H=(null===(r=(0,ey.x_)())||void 0===r?void 0:r.split("."))||[]).call(H,function(e){return Qa()(e,10)}),g=v[0],y=void 0===g?0:g,m=v[1], _=void 0===m?0:m,E=v[2],T=void 0===E?0:E,(y>14||14===y&&_>1||14===y&&1===_&&T>=2)&&p()(l).call(l,z_)}return l.length>0&&this._serverTimingsCollector&&(this._serverTimingsCollector.setManifestUrl(e),b=(new (ya())(l[0].value.uri, (0,w_.Z)(e))).href,this._detectDurationsInBackground(b)),(S=new m_.ZP(o)).baseUrl=(0,w_.Z)(e),n&&function(e,t){var n; if("number"==typeof t){var r=Pa()(e).call(e,T_.sS),i=Ua()(n=Ua()(r).call(r,function(e){return(0,E_.Z)(e,"RESOLUTION")})).call(n,function(e){return e?W_(e):-1}),o=Aa()(i).call(i,function(e){return e===t}); if(-1!==o&&0!==o){var s=a()(e).call(e,r[o]),l=u()(e).call(e,s,1)[0],c=a()(e).call(e,r[0]);u()(e).call(e,c,0,l)}}}(o,n.levelStart),w=!1,l.length>0&&this.mediaKeysController?(L=(R=this._m3u8Loader).fetch, [4, this._decryptUrl(l[0].value.uri)]):[3,3];case 1:return[4,L.apply(R,[x.sent()])];case 2:A=x.sent(),I=(new y_.Z).parse(A),C=Pa()(I).call(I,(0,T_.F7)("EXT-X-PLAYLIST-TYPE")),(Pa()(I).call(I,(0,T_.F7)("EXT-X-ENDLIST")).length> 0||"VOD"===(null===(i=C[0])||void 0===i?void 0:i.value))&&(w=!0),x.label=3;case 3:return[4,h().all(Ua()(l).call(l,function(e){return j_(D,void 0,void 0,function(){var t,n,r,i,o,a,s;return G_(this,function(u){switch(u.label){case 0:return w? (n=(t=this._m3u8Loader).load,[4,this._decryptUrl(e.value.uri)]):[3,3];case 1:return[4,n.apply(t,[u.sent()])];case 2:return u.sent(),[2,!0];case 3:return null!==(s=this._caches)&&void 0!==s?[3,4]:(i=void 0, [3,6]);case 4:return a=(o=s).match,[4,this._decryptUrl(e.value.uri)];case 5:i=a.apply(o,[u.sent()]),u.label=6;case 6:return[4,i];case 7:return r=u.sent(),[2,Boolean(r)]}})})}))]; case 4:return ss()(U=x.sent()).call(U,Boolean)?(O=h().all(Ua()(l).call(l,function(e,t){return D._parse(e.value.uri,n).then(function(e){l[t].value.uri=e})})),P=h().all(Ua()(d).call(d,function(e,t){return D._parse(JSON.parse(e.value), n).then(function(e){d[t].value='"'.concat(pa()(e).call(e),'"')})})),[4, h().all([P,O])]):[3,6];case 5:x.sent(),x.label=6;case 6:return this._muxed=0===Pa()(t).call(t,function(e){var t,n;return(0,T_.F7)("EXT-X-MEDIA")&&"AUDIO"===(null===(t=(0,E_.Z)(e,"TYPE"))||void 0===t?void 0: t.value)&&"YES"===(null===(n=(0,E_.Z)(e,"AUTOSELECT"))||void 0===n?void 0:n.value)&&(0,E_.Z)(e,"URI")}).length,[2, A_(S.buildToString())]}})})},t.prototype._dumpState=function(){return{type:"HLSNative", error:this.error}},t.prototype.setPlayPromise=function(e){this._runningPlayPromise=e},t.prototype._detectDurationsInBackground=function(e){return j_(this,void 0,void 0,function(){var t,n,r,i; return G_(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._decryptUrl(e)];case 1:return t=o.sent(),[4,(new B_.Z(null)).load(t)];case 2:return n=o.sent(),r=(new y_.Z).parse(n), this._updateDurationsFromStatements(r),[3,4];case 3:return i=o.sent(),(0,t_.jd)("hls_native_duration_detect_failed","Failed to detect duration from chunklist. Only MANIFEST and ERROR events will be collected.", _H_(_H_({},this._dumpState()),{rawUri:e,error:i instanceof Error?i.message:String(i)})),[3,4];case 4:return[2]}})})},t.prototype._updateDurationsFromStatements=function(e){if(this._serverTimingsCollector&& !b_(e)){var t=Pa()(e).call(e,T_.UL),n=0; if(t.length>0&&(n=Sa()(t).call(t,function(e,t){return e+t.value.duration},0)/t.length),!(n<=0)){var r=this._parsePartDuration(e); this._serverTimingsCollector.setDurations(n,r),this._serverTimingsCollector.start()}}},t.prototype._parsePartDuration=function(e){var t=Po()(e).call(e,T_.Lj); return!t||t.value<=0?null:t.value},t}(Kg.Z),Z_=q_; F_=jg.logDimensions;var Y_=function(){function e(e){this._state={p2pBandwidth:null,overrideBandwidth:null,isOverridden:!1},this._getHlsInstance=e} return e.prototype.getEstimatedBandwidth=function(){var e,t=this._getHlsInstance();return null!==(e=null==t?void 0:t.bandwidthEstimate)&&void 0!==e?e:$y.vz.experimental["hls.js"].abrEwmaDefaultEstimate}, e.prototype.setBandwidthOverride=function(e){var t=this._validateBandwidthInput(e); this._state.overrideBandwidth!==t&&(this._state.overrideBandwidth=t,null!==this._state.p2pBandwidth&&this._applyBandwidthOverride())},e.prototype.setP2PBandwidth=function(e){var t=this._validateBandwidthInput(e); null!==t?(this._state.p2pBandwidth=t,this._applyBandwidthOverride()):null!==this._state.p2pBandwidth&&(this._state.p2pBandwidth=null,this._restoreOriginalEstimator())},e.prototype.destroy=function(){this._restoreOriginalEstimator(), this._state.p2pBandwidth=null,this._state.overrideBandwidth=null,this._state.originalEstimator=void 0},e.prototype._getEffectiveBandwidth=function(){var e,t,n; return null!==this._state.overrideBandwidth?this._state.overrideBandwidth:null!==this._state.p2pBandwidth?this._state.p2pBandwidth:null!==(n=null===(t=(e=this._state).originalEstimator)||void 0===t?void 0: t.call(e))&&void 0!==n?n:$y.vz.experimental["hls.js"].abrEwmaDefaultEstimate},e.prototype._applyBandwidthOverride=function(){var e=this,t=this._getHlsInstance(); if(t){var n=null==t?void 0:t.abrController,r=null==n?void 0:n.bwEstimator;if(null==r?void 0:r.getEstimate){this._state.isOverridden||(this._state.originalEstimator=r.getEstimate.bind(r),this._state.isOverridden= !0),r.getEstimate=function(){return e._getEffectiveBandwidth()},t.nextLevel=-1; for(var i=this._getEffectiveBandwidth(),o=0,a=0;a=0?e._hls.startLevel:0);var i=e._hls.levels[r];if(i){var o=e._currentChannelId,a="unknown",s=Array.isArray(i.url)?i.url[0]:i.url;"string"==typeof s&&(a=e._extractChannelId(s)), o!==a&&(e._currentChannelId=a,fy("[P2PPrefetchTracker] Channel changed: ".concat(o," \u2192 ").concat(a),"info"))}else e._currentChannelId="unknown"}}} return e.prototype.initialize=function(e){var t,n=this;this._hls!==e&&(this._cleanup(),e&&(this._hls=e,this._hls.on(Ns.LEVEL_SWITCHED,this._updateCurrentChannelId),this._hls.on(Ns.MANIFEST_PARSED,this._updateCurrentChannelId), (null===(t=this._hls.levels)||void 0===t?void 0:t.length)?(this._updateCurrentChannelId(),fy("[P2PPrefetchTracker] Initialized with HLS instance","info")):this._hls.once(Ns.MANIFEST_PARSED,function(){n._updateCurrentChannelId(), fy("[P2PPrefetchTracker] Initialized with HLS instance","info")})))},e.prototype.shouldPrefetch=function(e){var t=this._extractChannelId(e),n="unknown"===this._currentChannelId||"unknown"===t||this._currentChannelId!== t; return fy("[P2PPrefetchTracker] segment(channel_id\x3d".concat(t,") vs playing(").concat(this._currentChannelId,") \x3e prefetch\x3d").concat(n),"info"),n},e.prototype._cleanup=function(){this._hls&&(this._hls.off(Ns.LEVEL_SWITCHED, this._updateCurrentChannelId),this._hls.off(Ns.MANIFEST_PARSED,this._updateCurrentChannelId),this._hls=null),this._currentChannelId="unknown"},e.prototype.destroy=function(){this._cleanup(),fy("[P2PPrefetchTracker] Destroyed", "info")},e.prototype._extractChannelId=function(e){try{return(new URL(e)).searchParams.get("channel_id")||"unknown"}catch(e){return"unknown"}},e}(),Q_=n(63862),J_=function(){var _e40=function e(t,n){return _e40= Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e40(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e40(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$_=n(11189); var eE,tE="piece",nE="partial",rE="initial",iE="peer",_oE=function oE(){return _oE=i()||function(e){for(var t,n=1,r=arguments.length;n0?r[0]:void 0},e.prototype._resetP2PLoadContext=function(){var e=this._p2pLoadContext.runnings; this._p2pLoadContext=_oE(_oE({},this._createP2PLoadContext()),{runnings:e})},e.prototype._startP2PBandwidthEstimation=function(){var e=this; this._p2pBandwidthEstimationTimer||(this._p2pBandwidthEstimationTimer=Wa()(function(){e._updateP2PBandwidthFromQoE()},5E3),fy("[P2P QoE] Started bandwidth estimation with ".concat(5E3,"ms interval"),"info"))}, e.prototype._stopP2PBandwidthEstimation=function(){this._p2pBandwidthEstimationTimer&&(clearInterval(this._p2pBandwidthEstimationTimer),this._p2pBandwidthEstimationTimer=void 0,fy("[P2P QoE] Stopped bandwidth estimation", "info"))},e.prototype._updateP2PBandwidthFromQoE=function(){try{var e=this._calculateP2PBandwidth(); if(e>0){var t,n;this._bandwidthEstimator.setP2PBandwidth(e);var r=(e/1E6).toFixed(2),i=this._p2pLoadContext.peerSegmentCount,o=(this._p2pLoadContext.peerSize/1024).toFixed(2);fy(cs()(t=cs()(n="[P2P QoE] Bandwidth updated: ".concat(r, " Mbps (")).call(n,i," segments, ")).call(t,o," KB)"),"info")}else this._p2pLoadContext.peerSegmentCount>0&&fy("[P2P QoE] No bandwidth calculated despite segments received","warn");this._resetP2PLoadContext()}catch(e){fy("[P2P QoE] Error updating bandwidth: ".concat(e), "error")}},e.prototype._calculateP2PBandwidth=function(){if(this._p2pLoadContext.peerTime<=0||this._p2pLoadContext.peerSize<=0)return 0; try{var e=8*this._p2pLoadContext.peerSize,t=Math.max(this._p2pLoadContext.peerTime/1E3,1);return Math.floor(e/t)}catch(e){return fy("[P2P Event] Error calculating bandwidth: ".concat(e),"error"),0}},e.prototype.getStartDate= function(){return this._hlsController.getStartDate()},e.prototype.applyStreamingProfile=function(e){this._hlsController.applyStreamingProfile(e)},e}(),sE=aE; function uE(e,t){if("p2p"===e){var n=new d_(t);return new sE(n)}return new d_(t)} eE=jg.logDimensions;var lE=["application/x-mpegURL","vnd.apple.mpegURL","vnd.naver.mpegURL"],cE=/^([^;]+)/,dE=function(){function e(){} return e.prototype.canPlayType=function(e){var t="".concat(e).match(cE);if(!t)return!1;var n=t[1];return-1!==a()(lE).call(lE,pa()(n).call(n))},e.prototype.createController=function(e){return(0,va.Z)()? $y.vz.experimental.coreplayer.webkitUseHlsJs&&d_.isSupported()?uE("cdn",e):new Z_:uE("cdn",e)},e}(),hE=dE,fE=n(81536),pE=function(){function e(){} return e.prototype.canPlayUrl=function(e){if(!e)return!1;if(dy.isP2PStream(e)){var t=(0,fE.Z)("nliveconnector:".concat(e));return this.canPlayType(t||"")}return!1},e.prototype.canPlayType=function(e){var t; return"application/vnd.naver.nliveconnector"===pa()(t="".concat(e).split(";")[0]).call(t)},e.prototype.createController=function(e){return uE("p2p",e)},e}(),vE=pE,gE="@[[sourceplayer-hls.js]",yE=function(){function e(){} return e.prototype.initialize=function(e){this._target=e;var t=e.constructor;if(!Object.prototype.hasOwnProperty.call(t,gE)&&(m()(t,gE,{value:1}),d_.isSupported()||(0,da.Z)()||ha())){var n=new vE;t.mediaCapabilities.push(n); var r=new hE;t.mediaCapabilities.push(r)}},e.prototype.resolvePrecondition=function(){return h().resolve(!0)},e.prototype.isPreconditionSatisfied=function(){return!0},e.prototype.configure=function(){throw new Error("configure does not support yet"); },m()(e.prototype,"control",{get:function get(){var e=this._target._mediaController; return{enable:function enable(e){throw new Error("HLS.enable API does not support yet.");}, enabled:function enabled(){throw new Error("HLS.enable API does not support yet.");}, set subtitleDisplay(t){e&&(e.subtitleDisplay=t)},get subtitleDisplay(){return!!e&&e.subtitleDisplay},set maxBitrate(t){e&&(e.maxBitrate=t)},get maxBitrate(){return e?e.maxBitrate:null},get codecs(){if(e)return e.codecs}, get dvrOffset(){return e?e.dvrOffset:NaN},get isCatchUpRateActive(){var t;return null!==(t=null==e?void 0:e.isCatchUpRateActive)&&void 0!==t&&t}}}, enumerable:!1,configurable:!0}),e[no.B]="hls",e}(),mE=n(58617); function _E(e){e.registerProcessor(yE),mE.Z.getInstance().define(new ca)} function EE(e){var t,n,r,i,o={type:"",subtype:"",parameters:{},complete:!1},a=/^([^/]+)\//g,s=/^([^;]+)/g,u=/^([^=;]+)/g,l=/^([^"]+)"/g,c=pa()(t=e||"").call(t);if(!(r=a.exec(c)))return o;if(o.type=r[1], c=Ta()(c).call(c,a.lastIndex),!(r=s.exec(c)))return o;if(o.subtype=pa()(n=r[1]).call(n),c.length===s.lastIndex)return o.complete=!0,o;if(!(c=Ta()(c).call(c,s.lastIndex+1)).length)return o;for(;c.length;){var d; if(u.lastIndex=0,!(r=u.exec(c)))break;if(i=pa()(d=r[1]).call(d),"\x3d"===(c=Ta()(c).call(c,u.lastIndex))[0])if('"'===c[1]){var h;if(c=Ta()(c).call(c,2),l.lastIndex=0,!(r=l.exec(c)))break;o.parameters[i]= pa()(h=r[1]).call(h),c=Ta()(c).call(c,l.lastIndex+1)}else{var f;c=Ta()(c).call(c,1),s.lastIndex=0,(r=s.exec(c))?o.parameters[i]=pa()(f=r[1]).call(f):o.parameters[i]=null,c=";"===c[s.lastIndex]?Ta()(c).call(c, s.lastIndex+1):Ta()(c).call(c,s.lastIndex)}else{if(";"!==c[0]){o.parameters[i]=null;break}o.parameters[i]=null,c=Ta()(c).call(c,1)}}return o.complete=0===c.length,o} function TE(e,t){return Sa()(e).call(e,function(e,n,r){return t(n)?r:e},-1)} _E.config=$y.vz;var bE,SE,wE=function(){var _e41=function e(t,n){return _e41=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e41(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e41(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),AE=Lo()(),RE=Lo()(),LE=Lo()(),IE=function(e){function t(t){var n=e.call(this,t)||this; return n[RE]=t,n[AE](),n} return wE(t,e),t.prototype.destroy=function(){this[RE].off(Hg.Events.ERROR,this[LE],this),e.prototype.destroy.call(this)},t.prototype[AE]=function(){this[RE].on(Hg.Events.ERROR,this[LE],this)},t.prototype[LE]= function(e,t){var n; if(t.errorAction&&t.details===xs.FRAG_LOAD_ERROR){var r=this[RE],i=null===(n=t.response)||void 0===n?void 0:n.code,o=t.frag,a="main"===(null==o?void 0:o.type)?o.level:r.loadLevel,s=r.levels[a];if("number"== typeof i&&i>=400&&i<500&&s&&2===t.errorAction.action&&0===rs()(t.errorAction)){var u,l,c=r.config,d=c.fragLoadPolicy,h=c.keyLoadPolicy,f=(ts()(u=t.details).call(u,"key")?h:d)["default"].errorRetry,p=Sa()(l= r.levels).call(l,function(e,t){return e+t.fragmentError},0); f&&p0&&u()(o).call(o,0,o.length);var m,_=y["@indexRange"],E=y["@startNumber"]||1,T=y["@timescale"]||1,b=n.period["@start"]|| 0,S=n.period["@duration"]||n.manifest["@mediaPresentationDuration"],w=(null===(s=null===(a=n.representation.BaseURL)||void 0===a?void 0:a[0])||void 0===s?void 0:s["#text"])||(null===(c=null===(l=n.adaptation.BaseURL)|| void 0===l?void 0:l[0])||void 0===c?void 0:c["#text"])||(null===(h=null===(d=n.period.BaseURL)||void 0===d?void 0:d[0])||void 0===h?void 0:h["#text"])||"";if(null===(f=y.Initialization)||void 0===f?void 0: f[0]){var A=y.Initialization[0];if(m={url:A["@sourceURL"]||w},A["@range"]){var R=NE(A["@range"]);if(_){var L=NE(_);m.byteRange=[Math.min(R[0],L[0]),Math.max(R[1],L[1])]}else m.byteRange=R}}if(!m)throw new Error("Init must be exist"); if(!y.SegmentURL)throw new Error("No SegmentURL Element");var I,C=E,O=b;if(null===(g=null===(v=y.SegmentTimeline)||void 0===v?void 0:v[0])||void 0===g?void 0:g.S){var P;I=[];var k=O,D=E;p()(P=y.SegmentTimeline[0].S).call(P, function(e,t,n){var r,i=e["@r"]||0,o=e["@d"]/T;if(k="number"==typeof e["@t"]?e["@t"]/T:k,i>=0)r=i+1;else{var a,s=Aa()(a=Ta()(n).call(n,t)).call(a,function(e){return e["@t"]}); r=-1===s?Math.ceil((S-O)/o):s-t}for(var u=0;u=0)r=o+1;else{var u,c=Aa()(u=Ta()(n).call(n, t)).call(u,function(e){return e["@t"]}); r=-1===c?Math.ceil((g-E)/s):c-t}for(var d=0;d.1&&console.warn("duration gap is too big"),console.debug("presentationStartTime",v), console.debug("segmentTimelineLength",_),console.debug("numberOfSegments",0),void c.emit(bE.DASH_SEGMENT_LIST_UPDATED,bE.DASH_SEGMENT_LIST_UPDATED,_zE(_zE({},d),{segmentType:"SegmentTemplate"}))}throw console.error("This representation not contain information about segment duration"), console.error("and we are not support init.mp4 yet"),new Error("NotSupportedError"); }(a,n,0,0,s,l,o,0,d,e,t):function(e,t,n,r,i,o,a,s,l,c,d){var h,f,p,v,g=e["@duration"],y=(null===(h=t.manifest["@availabilityStartTime"])||void 0===h?void 0:h.getTime())||0,m=t.period["@start"]||0,_=g/i, E=1/0; if("dynamic"===t.manifest["@type"]){f=t.manifest["@timeShiftBufferDepth"]||-1/0;var T=n+r-y,b=Math.max(T-1E3*f,0);p=o+Math.ceil((b-m)/1E3/_),v=o+Math.floor((T-m)/1E3/_)}else E=t.period["@duration"]||t.manifest["@mediaPresentationDuration"], f=0,p=o,v=o+Math.floor(E/_);if(a.length>0){var S=a[0],w=a[a.length-1],A=p-S.index,R=v-w.index;if(A>0&&u()(a).call(a,0,A),R>0)for(var L=function L(e){var t=m+e*_,n=m+(e+1)*_,r=_;a.push({index:e,url:s.replace(jE, function(t,n){var r;return n?Vm()(r="".concat(e)).call(r,Qa()(n,10),"0"):"".concat(e)}), init:l,duration:r,startTime:t,endTime:n,presentationStart:y+1E3*t,presentationEnd:y+1E3*n})},I=w.index+1;I<=v;++I)L(I); c.emit(bE.DASH_SEGMENT_LIST_UPDATED,bE.DASH_SEGMENT_LIST_UPDATED,_KE(_KE({},d),{segmentType:"SegmentTemplate"}))}else{var C=m+p*_,O=function O(e){var t=m+e*_,n=m+(e+1)*_,r=_;n>E+C&&(r=(n=E+C)-t),a.push({index:e, url:s.replace(jE,function(t,n){var r;return n?Vm()(r="".concat(e)).call(r,Qa()(n,10),"0"):"".concat(e)}), init:l,duration:r,startTime:t,endTime:n,presentationStart:y+1E3*t,presentationEnd:y+1E3*n})}; for(I=p;I<=v;++I)O(I);c.emit(bE.DASH_SEGMENT_LIST_UPDATED,bE.DASH_SEGMENT_LIST_UPDATED,_KE(_KE({},d),{segmentType:"SegmentTemplate"}))}}(a,n,r,i,s,l,o,c,d,e,t)},e}(),_qE=function qE(){return _qE=i()||function(e){for(var t, n=1,r=arguments.length;n=0&&(S=b+1),!bs()(S)||S<=0)throw new Error("InvalidSegmentDuration"); for(var w=0;w0&&this.dash2hls.trigger(bE.DASH_FOUND_UTC_TIMING,{mpd:e,stats:t,networkDetails:r,timingInformations:o,url:n.url})}e.type},t.prototype.getManifestParsedData=function(e){var t,n,r,i,o,a=(0,ky.Z)(e.getRepresentations(), function(e){var t,n=e.contentType; if("video"===n||"audio"===n)return n;var r=null===(t=e.mimeType)||void 0===t?void 0:t.substr(0,5);return"video"===r||"audio"===r?r:"text"===n&&"caption"===e.role?"captions":"text"===n||"subtitle"===e.role|| "text/vtt"===e.mimeType||"stpp"===e.codec?"subtitles":"unknown"}); return a.video?a.audio?(r=this.getAudioTracks(a.audio),n=this.getSubtitleTracks(a.subtitles),i=this.getCaptionTracks(a.captions),t=this.getLevelsMuxed(a.video,r,n,i),o=this.getSessionData()):(r=[],n=this.getSubtitleTracks(a.subtitles), i=this.getCaptionTracks(a.captions),t=this.getLevelsVideoOnly(a.video,n,i),o=this.getSessionData()):(r=[],n=this.getSubtitleTracks(a.subtitles),i=this.getCaptionTracks(a.captions),t=this.getLevelsAudioOnly(a.audio, n,i),o=this.getSessionData()),{levels:t,subtitles:n,audioTracks:r,captions:i,sessionData:o}},t.prototype.handleSegmentListUpdate=function(e,t,n){var r=this,i=new iu; this.dash2hls.config,i.loading.start=self.performance.now();var o=this.getInternalLoader(t);if(o){var a=o.context;if(a&&a.url===t.url)return;o.abort()}b()(function(){r.dash2hls.trigger(bE.DASH_SEGMENT_LIST_UPDATING, {representationId:e,context:t,stats:i,type:n,networkDetails:null})},0)},t.prototype.getLevelDetails=function(e,t,n){var r,i=e.representation.BaseURL||e.adaptation.BaseURL||e.period.BaseURL||e.manifest.BaseURL; if(i){var o=i[0]["#text"];if(ts()(o).call(o,"/")||/^https?/.test(o))r=o;else{var a,s,u,l=Um()(a=this.mpd.baseUrl).call(a,"/")?"":"/";r=cs()(s=cs()(u="".concat(this.mpd.baseUrl)).call(u,l)).call(s,o)}}else r= this.mpd.baseUrl;var c,d=this.levelMap[e.id],h=new Tc(r),f=this.segmentsMap[e.id];"static"===e.manifest["@type"]?(h.type="VOD",h.live=!1):(h.live=!0,e.manifest["@timeShiftBufferDepth"]||(h.type="EVENT")), h.targetduration=f[0].endTime-f[0].startTime,h.m3u8="";var v,g,y=0,m=Ha()(t.id)?t.id:0,_=Ha()(t.level)?t.level:m;if(f[0].init&&((v=new cu(n,r)).sn="initSegment",v.level=_,v.relurl=f[0].init.url,v.programDateTime= f[0].presentationStart,f[0].init.byteRange)){var E,T=f[0].init.byteRange,b=T[0],S=T[1];v.setByteRange(cs()(E="".concat(S-b+1,"@")).call(E,b))}if(d){var w,A,R,L=f.length,I=f[0],C=f[L-1],O=d.fragments[0], P=d.fragments[d.fragments.length-1],k=I.index-O.sn,D=C.index-P.sn,x=Sa()(w=Ta()(A=d.fragments).call(A,0,k)).call(w,function(e,t){return e+t.duration},0); h.fragments=Ta()(R=d.fragments).call(R,k),g=h.fragments,y=d.totalduration-x;for(var N=D;N>0;--N)F=f[L-N],(c=new cu(n,r)).level=_,c.urlId=m,c.tagList.push(["INF",String(F.duration)]),c.sn=F.index,c.cc=0, c.relurl=F.url,c.duration=F.duration,c.programDateTime=F.presentationStart,v&&(c.initSegment=v),y+=F.duration,g.push(c);p()(g).call(g,function(e,t,n){e.start=t>0?n[t-1].duration+n[t-1].start:0})}else{g= h.fragments; for(var M=0,U=f;M-1&&(b.videoCodec=S[A]),R>-1&&(b.audioCodec=S[R])}else b.videoCodec=g;if(b.url=E,b.id=0,isNaN(v)||(T.BANDWIDTH="".concat(v),b.bitrate=v),g&&(T.CODECS="".concat(g)),y&&(T["FRAME-RATE"]="".concat(y)),_&& (T.RESOLUTION=_,b.width=f,b.height=p),(null==m?void 0:m.supplementalProfiles)&&m.supplementalCodecs&&(T["SUPPLEMENTAL-CODECS"]=cs()(c="".concat(m.supplementalCodecs,"/")).call(c,m.supplementalProfiles), b.supplemental={videoCodec:m.supplementalCodecs}),t.length)for(var L=0,I=o;L1?i+o:r;if(tT(e.subarray(i+4,i+8))===t[0])if(1===t.length)n.push(e.subarray(i+8,a));else{var s=nT(e.subarray(i+ 8,a),Ta()(t).call(t,1));s.length&&Array.prototype.push.apply(n,s)}i=a}return n} function rT(e){var t=[],n=e[0],r=8,i=eT(e,r);r+=4,r+=0===n?8:16,r+=2;var o,a,s,u=e.length+0,l=(s=(o=e)[a=r]<<8|o[a+1])<0?65536+s:s;r+=2;for(var c=0;c>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var p=eT(e,d);d+=4,t.push({referenceSize:f,subsegmentDuration:p,info:{duration:p/i,start:u,end:u+f-1}}), u+=f,r=d+=4}return{earliestPresentationTime:0,timescale:i,version:n,referencesCount:l,references:t,byteLength:e.byteLength+8,rangeStart:0}} var _iT=function iT(){return _iT=i()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(n=Ny(n,this._findCapLevelIndex(this._dash2hls.levels))),n>=0&&(this._dash2hls.capLevelToPlayerSize=!1,this._dash2hls.autoLevelCapping=n)}}, enumerable:!1,configurable:!0}),m()(t.prototype,"error",{get:function get(){return this._error}, enumerable:!1,configurable:!0}),m()(t.prototype,"caches",{get:function get(){return this._caches}, set:function set(e){this._caches=e}, enumerable:!1,configurable:!0}),m()(t.prototype,"seekable",{get:function get(){if(!this.videoElement||!this._currentLevelInfo)return new $g;var e,t=this.videoElement.seekable,n=t.length?t.end(t.length- 1):this.videoElement.duration,r=this._currentLevelInfo.details,i=r.targetduration,o=r.totalduration,a=Math.max(0,n-o);if(this._duration===1/0){if((e=Math.max(0,n-i))-a<3*i)return new $g}else e=n;return new $g([{start:a, end:e}])}, enumerable:!1,configurable:!0}),m()(t.prototype,"duration",{get:function get(){return this._duration}, enumerable:!1,configurable:!0}),m()(t.prototype,"dvrOffset",{get:function get(){if(!this.videoElement)return NaN;if(isFinite(this.duration))return 0;var e=(0,Wg.Z)(this.videoElement.seekable);if(isFinite(e))return 0; var t=(0,Wg.Z)(this.seekable||null);return Math.max(0,e-t)}, enumerable:!1,configurable:!0}),t.prototype.load=function(){if(null!==this._videoElement&&this._dash2hls.media!==this._videoElement){var e=this._caches,t=this.mediaKeysController;this._dash2hls.config.loader= function(n){function r(){var r=null!==n&&n.apply(this,arguments)||this;return r.load=function(e,n,i){t?r._loadWithKey(e,n,i)["catch"](console.error):r._loadWithoutKey(e,n,i)},r._loadFromCache=function(e, t,i,o){return IT(r,void 0,void 0,function(){var r,a,s; return CT(this,function(u){var l;switch(u.label){case 0:return r=Ia()(l=e.url).call(l,"#"),a=r>-1?e.url.substring(0,r):e.url,[4,o.match(a)];case 1:return(s=u.sent())?("string"==typeof s?s.length:s.byteLength, i.onSuccess({url:e.url,data:s},this.stats,e,this),[2]):(n.prototype.load.call(this,e,t,i),[2])}})})},r._loadWithKey=function(e,n,i){return IT(r,void 0,void 0,function(){var r,o; return CT(this,function(a){switch(a.label){case 0:return[4,t.decryptRequestUri(e.url)];case 1:return r=a.sent(),o=_LT(_LT({},e),{url:r}),this._loadWithoutKey(o,n,i),[2]}})})},r._loadWithoutKey=function(t, i,o){e?r._loadFromCache(t,i,o,e)["catch"](console.error):n.prototype.load.call(r,t,i,o)},r} return RT(r,n),r}(wT.DefaultConfig.loader),this._detachMediaListeners(this._videoElement),this._dash2hls.attachMedia(this._videoElement),this._dash2hls.loadSource(this._srcHashParams?this._srcHashParams.uri: this._src),this._attachMediaListeners(this._videoElement)}},t.prototype.destroy=function(){this._dash2hls.destroy()},t.prototype._attachMediaListeners=function(e){e.addEventListener("play",this._onMediaPlayed), e.addEventListener("pause",this._onMediaPaused),e.addEventListener("stalled",this._onMediaStalled)},t.prototype._detachMediaListeners=function(e){e.removeEventListener("play",this._onMediaPlayed),e.removeEventListener("pause", this._onMediaPaused),e.removeEventListener("stalled",this._onMediaStalled)},t.prototype._onFragChanged=function(e,t){var n=this._dash2hls.levels[this._dash2hls.currentLevel]; if(n){var r=n.width,i=n.height;r&&i&&(this._lastLevel!==this._dash2hls.currentLevel&&this.dispatchEvent(new Jy.Z(Qg.Z.LEVEL_SWITCHED,{videoWidth:r,videoHeight:i})),this._lastLevel=this._dash2hls.currentLevel)}}, t.prototype._onLevelSwitched=function(){},t.prototype._onError=function(e,t){var n; if(t.fatal){switch(t.type){case Hg.ErrorTypes.NETWORK_ERROR:n=MediaError.MEDIA_ERR_NETWORK;break;case Hg.ErrorTypes.MEDIA_ERROR:case Hg.ErrorTypes.MUX_ERROR:default:n=Yg.Z.MEDIA_ERR_DECODE}n&&(this._error= {code:n,message:t.details},this.dispatchEvent(new Vo.x("error")))}},t.prototype._onDashManifestLoaded=function(e,t){var n,r,i,o,s,u,l,c,d,h; if(this._srcHashParams){var f=null===(n=this._srcHashParams)||void 0===n?void 0:n.videoBitrate,p=null===(r=this._srcHashParams)||void 0===r?void 0:r.audioBitrate,v=null===(i=this._srcHashParams)||void 0=== i?void 0:i.track;if(v&&(_=null===(o=t.mpd.document.Period)||void 0===o?void 0:o[0].AdaptationSet)){for(var g=0,y=_;g0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=2)return"HLG"}return"SDR"}(t.codec):"SDR")}var y=i.get(t.adaptation),m=zT(e,t,p).then(function(){n.push({uri:f, representation:t,adaptationSetId:y,contentType:v,type:"media",body:p.buildToString(),audioChannels:d,videoRange:h})},function(e){switch(e.message){case "UnknownSegmentElement":case "PlaylistEmpty":case "Failed to parse sidx":return void console.warn("representation#%s ignored: %s", t.id,e.message); default:throw e;}}); o.push(m)}else console.warn("representation#%s ignored: unknown content type")}),[4, h().all(o)];case 1:return s.sent(),[2,n]}})},new ((i=void 0)||(i=h()))(function(e,t){function a(e){try{u(o.next(e))}catch(e){t(e)}} function s(e){try{u(o["throw"](e))}catch(e){t(e)}} function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(a,s)} u((o=o.apply(n,r||[])).next())}); var n,r,i,o} var JT,$T=function $T(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1)return void console.warn("Representation#%s ignored: some of audio variant don't have indistinguishable characteristic.", e.representation.id);d[o].push(u)}c.push(r)}),function(e,t,n,r,i){e=(null==e?void 0:e.length)?e:[void 0],t=(null==t?void 0:t.length)?t:[void 0],n=(null==n?void 0:n.length)?n:[void 0],r=(null==r?void 0: r.length)?r:[void 0]; var o=[];p()(e).call(e,function(e){p()(t).call(t,function(t){p()(n).call(n,function(n){p()(r).call(r,function(r){o.push([e,t,n,r])})})})}),p()(o).call(o,function(e){i.apply(void 0,e)})}(u,s.AUDIO,s.SUBTITLES, s["CLOSED-CAPTIONS"],function(e,t,n,r){var i=new xT.f,o=[],a=[],s=0; if(e){var u;i.value={uri:A_(e.body),attrs:o},s+=e.representation.bandwidth;var l,d=e.representation.codec||e.representation.adaptation["@codecs"];if(d){if(ts()(d).call(d,"dvh1.")){var h,f=d.split("."), p=f[0],v=f[1],g=f[2],y=Qa()(v,10);5===y||y<=7||(d=cs()(h="".concat(p,".05.")).call(h,g))}a.push(d)}if(o.push(new __.Z("RESOLUTION",cs()(u="".concat(e.representation.width,"x")).call(u,e.representation.height))), o.push(new __.Z("FRAME-RATE","".concat(e.representation.frameRate))),t?(s+=t.representation.bandwidth,(b=t.representation.codec||t.representation.adaptation["@codecs"])&&a.push(b),o.push(new __.Z("AUDIO", cs()(l='"'.concat(t.adaptationSetId,"_")).call(l,t.representation.id,'"'))),2===a.length&&o.push(new __.Z("CODECS",'"'.concat(a.join(","),'"')))):1===a.length&&o.push(new __.Z("CODECS",'"'.concat(a[0], '"'))),e.videoRange&&o.push(new __.Z("VIDEO-RANGE",e.videoRange)),e.representation.scte214){var m,_=e.representation.scte214,E=_.supplementalCodecs,T=_.supplementalProfiles;E&&T&&o.push(new __.Z("SUPPLEMENTAL-CODECS", cs()(m='"'.concat(E,"/")).call(m,T,'"')))}}else{if(!t)return;var b;i.value={uri:A_(t.body),attrs:o},(b=t.representation.codec||t.representation.adaptation["@codecs"])&&o.push(new __.Z("CODECS",'"'.concat(b, '"'))),s+=t.representation.bandwidth}n&&(o.push(new __.Z("SUBTITLES",'"'.concat(n.adaptationSetId,'"'))),n.representation.bandwidth>0&&(s+=n.representation.bandwidth)),r&&(o.push(new __.Z("SUBTITLES",'"'.concat(r.adaptationSetId, '"'))),r.representation.bandwidth>0&&(s+=r.representation.bandwidth)),s>0&&(o.push(new __.Z("BANDWIDTH","".concat(Math.ceil(1.1*s)))),o.push(new __.Z("AVERAGE-BANDWIDTH","".concat(Math.ceil(s))))),c.push(i)}), c.baseUrl=e,[2, c]}})},new ((o=void 0)||(o=h()))(function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}} function a(e){try{u(s["throw"](e))}catch(e){t(e)}} function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o(function(e){e(r)})).then(n,a)} u((s=s.apply(r,i||[])).next())})},e}(),tb=function tb(e,t,n,r){return new (n||(n=h()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},nb=function nb(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(this[hb]="SegmentBase"),a()(r).call(r,"\x3cSegmentList ")>-1&&(this[hb]="SegmentList"),a()(r).call(r,"\x3cSegmentTemplate ")> -1&&(this[hb]="SegmentTemplate")),t&&(t.src=A_(i.buildToString())),[2]}})})},e}(); JT=jg.logDimensions;var gb=function(){function e(){} return e.prototype.canPlayType=function(e){var t=EE(e);if("application"!==t.type)return!1;if("dash+xml"!==t.subtype&&"vnd.naver.dash"!==t.subtype)return!1;var n="urn:mpeg:dash:profile:isoff-live:2011"!== t.parameters.profiles;return(0,va.Z)()?n:OT.isSupported()},e.prototype.createController=function(){return(0,va.Z)()?new vb:new OT},e}(),yb="@[[sourceplayer-dashjs]",mb=function(){function e(){} return e.prototype.initialize=function(e){this._target=e;var t=e.constructor;Object.prototype.hasOwnProperty.call(t,yb)||(m()(t,yb,{value:1}),(Hg.isSupported()||(0,da.Z)()||ha())&&t.mediaCapabilities.push(new gb))}, e.prototype.resolvePrecondition=function(){return h().resolve(!0)},e.prototype.isPreconditionSatisfied=function(){return!0},e.prototype.configure=function(){throw new Error("Method not implemented."); },m()(e.prototype,"control",{get:function get(){var e=this._target._mediaController; return{enable:function enable(e){throw new Error("DASH.enable API does not support yet.");}, enabled:function enabled(){throw new Error("DASH.enable API does not support yet.");}, set subtitleDisplay(t){e&&(e.subtitleDisplay=t)},get subtitleDisplay(){return!!e&&e.subtitleDisplay},set maxBitrate(t){e&&(e.maxBitrate=t)},get maxBitrate(){return e?e.maxBitrate:null},get codecs(){if(e)return e.codecs}, get dvrOffset(){return e?e.dvrOffset:NaN}}}, enumerable:!1,configurable:!0}),e[no.B]="dash2hls",e}(); function _b(e){e.registerProcessor(mb)} _b.config=AT;var Eb=function(){var _e45=function e(t,n){return _e45=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e45(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e45(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),Tb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return Eb(t,e),t.prototype.canPlayType=function(e){var t=EE(e);if("application"!==t.type)return!1;if("dash+xml"!==t.subtype&&"vnd.naver.dash"!==t.subtype)return!1;var n="urn:mpeg:dash:profile:isoff-live:2011"!== t.parameters.profiles;return(!t.parameters.profiles||!n)&&((0,va.Z)()?n:OT.isSupported())},t}(gb),bb=function(){var _e46=function e(t,n){return _e46=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e46(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e46(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),Sb="@[[sourceplayer-dashlive]",wb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return bb(t,e),t.prototype.initialize=function(e){this._target=e;var t=e.constructor;Object.prototype.hasOwnProperty.call(t,Sb)||(m()(t,Sb,{value:1}),(Hg.isSupported()||(0,da.Z)()||ha())&&t.mediaCapabilities.push(new Tb))}, t[no.B]="dashlive",t}(mb); function Ab(e){e.registerProcessor(wb)} Ab.config=AT;var Rb=function(){var _e47=function e(t,n){return _e47=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e47(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e47(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),Lb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return Rb(t,e),t.prototype.canPlayType=function(e){var t=EE(e);if("application"!==t.type)return!1;if("dash+xml"!==t.subtype&&"vnd.naver.dash"!==t.subtype)return!1;var n="urn:mpeg:dash:profile:isoff-on-demand:2011"!== t.parameters.profiles;return(!t.parameters.profiles||!n)&&(OT.isSupported()||(0,va.Z)())},t}(gb),Ib=function(){var _e48=function e(t,n){return _e48=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e48(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e48(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),Cb="@[[sourceplayer-dashvod]",Ob=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return Ib(t,e),t.prototype.initialize=function(e){this._target=e;var t=e.constructor;Object.prototype.hasOwnProperty.call(t,Cb)||(m()(t,Cb,{value:1}),(Hg.isSupported()||(0,da.Z)()||ha())&&t.mediaCapabilities.push(new Lb))}, t[no.B]="dashvod",t}(mb); function Pb(e){e.registerProcessor(Ob)} Pb.config=AT;var kb=n(97348),Db="gaudio",xb="transparent",Nb="youtube-like",_Mb=function Mb(){return _Mb=i()||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&m()(t,n,a),a},Xb=Lo()("definedLen"),Qb=Lo()("updateIndexGetter"); function Jb(e){for(var t=e[Xb],n=e.items.length,r=function r(t){if(e[t]===e.items[t])return"continue";m()(e,"".concat(t),{get:function get(){return this.items[t]}, configurable:!0,enumerable:!0,writable:!1})},i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1}))return!1; var r=Sa()(t=g()(n.parameters)).call(t,function(e,t){var n=t[0],r=t[1];return e&&function(e,t){return"switching"===e&&"seamless"===t&&!(0,va.Z)()&&Hg.isSupported()}(n,r)},!0); return r},e.prototype.createController=function(){return(0,va.Z)()?new Z_:new oS},e}(),uS=sS,lS=function(){function e(e){this.target=e} return e.prototype.getNativeVideoElement=function(){return this.target.getNativeVideoElement()},e.prototype.enable=function(){throw new Error("enable API does not support yet"); },e.prototype.enabled=function(){throw new Error("enable API does not support yet"); },e}(),cS=function(){var _e51=function e(t,n){return _e51=So()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]= t[n])},_e51(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e51(t,n),t.prototype=null===n?Ao()(n):(r.prototype=n.prototype,new r)}}(),dS="@[[sourceplayer-multiview.js]",hS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return cS(t,e),t.prototype.initialize=function(e){this._target=e;var t=e.constructor;Object.prototype.hasOwnProperty.call(t,dS)||(m()(t,dS,{value:1}),t.mediaCapabilities.push(new uS))},t.prototype.configure= function(){throw new Error("configure does not support yet"); },t.prototype.resolvePrecondition=function(){return e=this,t=void 0,r=function r(){return function(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof Lo()&&(o[Co()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;l--)(o=e[l])&&(u=(s<3?o(u):s>3?o(t, n,u):o(t,n))||u);return s>3&&u&&a()(t,n,u),u}([S.Metric.metadata({id:"core-plugin-instrumentation-".concat(R++), filter:{test:function test(e){for(var n=E()(t).call(t),r=n.next();!r.done;r=n.next())if(r.value.marks.has(e))return!0;return!1}}, dimensions:w([],e,!0)})],n)}(); return S.defaultLogMonitor.register(n),t}(r),A.set(o,s)),s} function I(e){for(var t=E()(A).call(A),n=t.next();!n.done;n=t.next())for(var r,i=E()(r=n.value).call(r),o=i.next();!o.done;o=i.next())if(o.value.marks.has(e))return!0;return!1} function C(){return{subscribe:function subscribe(e,t){var n=L(e),r={marks:new (m())(e.marks),listener:t};return n.add(r),function(){n["delete"](r)}}}} }, 63938:function _(e,t,n){n.d(t,{R:function R(){return i}}); var r=n(65420),i=n.n(r)()("postprocessor-type")}, 20310:function _(e,t,n){n.d(t,{s:function s(){return g}}); var r,i=n(26295),o=n.n(i),a=n(77766),s=n.n(a),u=n(63978),l=n.n(u),c=n(39392),d=n.n(c),h=n(74866),f=n(21036),p=n(61516),v=n(27849),g=((r={})["data:"]=function(e){return new f.F(e)},r["vod:"]=function(e){return new h.Ct(e)}, r["live:"]=function(e){return new p.nu(e)},r["vod3:"]=function(e){return new v.zG(e)},r),y=function(){function e(){} return e.registerMediaProviderFactory=function(t,n){var r=e._mediaProviderFactories;if(r.has(t))throw new Error("Registration failed for protocol '".concat(t,"'. A protocol with that name is already registered.")); r.set(t,n)},e.registerMediaProviderFactories=function(t){for(var n=0,r=o()(t);n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[4,this._updateTextTracks(e)]: [3,7];case 6:r.sent(),r.label=7;case 7:return t=this._createTracks(),[4,this._onBeforeUpdatePlayer()];case 8:return r.sent(),[4,this._updatePlayer(t)];case 9:return r.sent(),[4,this._postProcessing()]; case 10:return r.sent(),[3,12];case 11:throw n=r.sent(),this._handleLoadError(n),n;case 12:return[2]}})})},t.prototype.close=function(){this._requestingMetadata&&(this._requestingMetadata.abort(),this._requestingMetadata= null),this._cancel$.next(),this._cancel$.complete(),this._providerCoreKit.cleanup(),this._cleanupResources()},t.prototype.loop=function(){return O(this,void 0,void 0,function(){var e; return P(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this._loop$.next(),[4,this._handleLoop()];case 1:return[2,t.sent()];case 2:return e=t.sent(),this._setError(1,"\ub8e8\ud504 \uc7ac\uc0dd \uc2e4\ud328", e instanceof Error?e.message:String(e)),[2,!1];case 3:return[2]}})})},t.prototype._setError=function(e,t,n){this._providerCoreKit.errors.setError(e,t,n),this._logError(this._providerCoreKit.errors.error)}, t.prototype._dumpState=function(){return{id:this._id, protocol:this.protocol,uri:this._uri,config:this._config,data:this._data,error:this._providerCoreKit.errors.error,hasPlayer:!!this._player}},t.prototype._requestServerDataImpl=function(){return O(this, void 0,void 0,function(){return P(this,function(e){return[2]})})},t.prototype._parseMetadataImpl=function(){return O(this,void 0,void 0,function(){return P(this,function(e){return[2, {}]})})},t.prototype._setRawData=function(e){this._responseData="string"==typeof e?e:y()(e)},t.prototype._getRawData=function(){return this._responseData||""},t.prototype._onBeforeLoading=function(){return O(this, void 0,void 0,function(){return P(this,function(e){return[2]})})},t.prototype._onBeforeGeneratingTracks=function(){return O(this,void 0,void 0,function(){return P(this,function(e){return[2]})})},t.prototype._onBeforeUpdatePlayer= function(){return O(this,void 0,void 0,function(){return P(this,function(e){return[2]})})},t.prototype._postProcessing=function(){return O(this,void 0,void 0,function(){return P(this,function(e){return[2]})})}, t.prototype._cleanupResources=function(){},t.prototype._initializeLogging=function(){},t.prototype._setupObservables=function(){this._setupPlayerObservables()},t.prototype._setupPlayerObservables=function(){}, t.prototype._setupEventHandlers=function(){},t.prototype._createTextTracks=function(){return O(this,void 0,void 0,function(){return P(this,function(e){return[2, []]})})},t.prototype._updateTextTracks=function(e){return O(this,void 0,void 0,function(){return P(this,function(t){return this._player&&e.length>0&&this._player._setTextTracks(e),[2]})})},t.prototype._handleLoadError= function(e){this._setError(1,"\ub85c\ub4dc \uc2e4\ud328",e.message)},t.prototype._logError=function(e){this._providerCoreKit.log.sendNeloLog(this.protocol,e.code,e.message)},t.prototype[A.N]=function(e, t,n,r){return[!1, !1]},t.prototype._onPlayerChanged=function(){},t.prototype._requestServerData=function(){return O(this,void 0,void 0,function(){var e,t,n,r,i,o=this; return P(this,function(a){switch(a.label){case 0:if(!this._dataLoader)return[3,8];e=new L.v,this._requestingMetadata=e,t={uri:this._uri,overrideSearchParams:this._createOverrideSearchParams(),isPlayerConnected:Boolean(this._player), signal:e.signal,resolve:function resolve(e){o._setRawData(e),o._requestingMetadata=null}, reject:function reject(e){throw o._requestingMetadata=null,e;}},a.label=1; case 1:return a.trys.push([1,3,,8]),[4,this._dataLoader.load(t)];case 2:return n=a.sent(),this._setRawData(n),this._requestingMetadata=null,[2];case 3:if(r=a.sent(),!this._dataLoader.loadWithCallback)return[3, 7];a.label=4;case 4:return a.trys.push([4,6,,7]),[4,new (l())(function(e,n){t.resolve=function(t){o._setRawData(t),o._requestingMetadata=null,e()},t.reject=function(e){o._requestingMetadata=null,n(e)}, o._dataLoader.loadWithCallback(t)})]; case 5:return a.sent(),[2];case 6:throw i=a.sent(),this._requestingMetadata=null,i;case 7:throw this._requestingMetadata=null,r;case 8:return this._hasOwnRequestServerData()?[4,this._callOriginalRequestServerData()]: [3,10];case 9:return a.sent(),[2];case 10:return[4,this._requestServerDataImpl()];case 11:return a.sent(),[2]}})})},t.prototype._parseMetadata=function(){return O(this,void 0,void 0,function(){var e,t, n; return P(this,function(r){switch(r.label){case 0:return this._metadataParser?(e=this._getRawData(),t={rawData:e,config:this._config,isPlayerConnected:Boolean(this._player),metadata:{}},n=this,[4,this._metadataParser.parse(t)]): [3,2];case 1:return n._data=r.sent(),[2,this._data];case 2:return this._hasOwnParseMetadata()?[2,this._callOriginalParseMetadata()]:[2,this._parseMetadataImpl()]}})})},t.prototype._hasOwnRequestServerData= function(){var e=_()(this); return e&&e.constructor!==t&&Object.prototype.hasOwnProperty.call(e,"_requestServerData")},t.prototype._hasOwnParseMetadata=function(){var e=_()(this); return e&&e.constructor!==t&&Object.prototype.hasOwnProperty.call(e,"_parseMetadata")},t.prototype._callOriginalRequestServerData=function(){return O(this,void 0,void 0,function(){var e; return P(this,function(n){switch(n.label){case 0:return(e=this._requestServerData)&&e!==t.prototype._requestServerData?[4,e.call(this)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},t.prototype._callOriginalParseMetadata= function(){return O(this,void 0,void 0,function(){var e; return P(this,function(n){return(e=this._parseMetadata)&&e!==t.prototype._parseMetadata?[2,e.call(this)]:[2,{}]})})},t.prototype._createOverrideSearchParams=function(){return new (T())},t}(w.Z)}, 21036:function _(e,t,n){n.d(t,{F:function F(){return w}}); var _r34,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(93476),l=n.n(u),c=n(65420),d=n.n(c),h=n(98341),f=n.n(h),p=n(63978),v=n.n(p),g=n(94473),y=n.n(g),m=n(12594),_=n(58302),E=n(75191),T=(_r34=function r(e, t){return _r34=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r34(e,t)},function(e,t){if("function"!= typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r34(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),b=function b(e,t,n,r){return new (n||(n=l()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},S=function S(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof d()&&(o[f()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1})},t.prototype.decryptUri=function(e){if(!this._keyInfo)return""; if(this._isTokenAvailable(e)){var t=(new RegExp("".concat(this._keyInfo.key,"\x3d([^\x26?#]{1,})"),"g")).exec(e);return t&&(this._token=t[1]),e}var n;return this._token&&(0,Yt.D)(e)?(0,Xt.Z)(e,L()(n="".concat(this._keyInfo.target, "\x3d")).call(n,this._token)):e},t.prototype.hasUsableLicenseKey=function(){return null!==this._keyInfo},t}(Qt.z),en=function(){var _e54=function e(t,n){return _e54=o()||{__proto__:[]}instanceof Array&& function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e54(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e54(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),tn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return en(t,e),t.prototype.createKeySessionController=function(e){return new $t(e)},function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=d()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&f()(t,n,a),a}([(0,qt.Pv)("SMPKeysController")],t)}(Zt.B),nn=n(17458),rn=function(){var _e55=function e(t,n){return _e55=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e55(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e55(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),on=function(e){function t(){return e.call(this,{keySystemIdentifiers:["com.naver.lip.smp", "com.naver.lip.smp.1_0"],keysController:tn})||this} return rn(t,e),t.prototype.requestMediaKeySystemAccess=function(t,n){if((0,$e.Z)()&&!nn.vz.experimental.coreplayer.webkitUseHlsJs)throw new Error("Not Supported");return e.prototype.requestMediaKeySystemAccess.call(this, t,n)},t}(Wt.B),an=n(54994),sn=n(14327),un=n(82222),ln=function(){var _e56=function e(t,n){return _e56=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_e56(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e56(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),_cn=function cn(){return _cn=l()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=150&&(t-=t%10),t} !function(e){e[e.DEFAULT_ABR_START_LEVEL=480]="DEFAULT_ABR_START_LEVEL",e[e.DEFAULT_ABR_MAX_LEVEL=720]="DEFAULT_ABR_MAX_LEVEL",e[e.DEFAULT_PD_INITIAL_QUALITY=720]="DEFAULT_PD_INITIAL_QUALITY"}(Hn||(Hn= {})); var Kn,zn=function zn(e,t,n,r){return new (n||(n=v()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},Wn=function Wn(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof y()&&(o[_()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"".concat(n.frameRate):void 0},f=t[0].resolution, p=q()(u=P()(l=Q()(d)).call(l,function(e){return[e,(0,On.U)(e)]})).call(u,function(e,t){return e[1]-t[1]})[0],v=Rn()(t).call(t,function(e,t){return Math.max(e,t.bandwidth)},0),g=p[0].split(","),y=g[0],m= g[1]; h.videoCodec=y,h.audioCodec=m;var _=NaN;if((0,jn.S)(f,h)&&(_=Gn(h)),isNaN(_))h.label="unk";else{var E="".concat(_,"p");c.has("dolby")&&(E+=" DolbyVision"),h.label=E}for(var T,b,S,w,A=s._encodingTracks, R=s._encodingTracks,I=[(S=h.width,w=h.height,function(e){return e.videoWidth===S&&e.videoHeight===w}), Un(v),Mn(h.audioCodec)];!T&&I.length>0;)switch(b=I.shift(),(A=C()(A).call(A,b)).length){case 0:A=R;break;case 1:T=A[0];break;default:R=A}T?(h.dataset=T,h.videoBitrate=T.videoBitRate/1E3,h.audioBitrate= T.audioBitRate/1E3,h.dolbyVisionProfile=T.dolbyVisionProfile,n.frameRate||(h.videoFrameRate=T.videoFrameRate)):(h.videoBitrate=v/1E3-1,h.audioBitrate=1),-1!==G()(i).call(i,"lowlatency")&&(h.kind=_t.X), r.push(new Dn.Z(h))}}} return e.prototype.filterTracks=function(){return zn(this,void 0,void 0,function(){var e;return Wn(this,function(t){switch(t.label){case 0:return this._filteredTrackSets?[2,this._filteredTrackSets]:(e= this,[4,v().all([this._filterMuxedTracks(),this._filterAudioOnlyTracks()])]);case 1:return[2,e._filteredTrackSets=t.sent()]}})})},e.prototype._filterMuxedTracks=function(){return zn(this,void 0,void 0, function(){var e,t,n,r,i; return Wn(this,function(o){var a,s,u,l,c;switch(o.label){case 0:e=C()(a=C()(s=this._encodingTracks).call(s,kn)).call(a,(u={maxResolution:this._config.maxResolution,maxBitrate:this._config.maxBitrate},l= u.maxBitrate||1/0,c=u.maxResolution||1/0,function(e){var t=e.videoBitRate<=l,n=(0,yt.Z)(e.videoWidth,e.videoHeight)<=c;return t&&n})),t=[],n=0,r=e,o.label=1; case 1:return n0&&(o="".concat(t.length," audio-only track(s) excluded due to missing path \u2014 graceful fallback"), (0,Ln.jd)("live_radio_mode_audio_only_path_missing",o,{droppedCount:t.length})),[2,e]})})},e.prototype.manipulate=function(){var e; return zn(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,l,c,d;return Wn(this,function(h){switch(h.label){case 0:return this._encodingTracks&&0!==(null===(e=this._encodingTracks)||void 0===e?void 0: e.length)?[4,this.filterTracks()]:[2,v().resolve([[],[]])];case 1:return t=h.sent(),n=t[0],r=t[1],i=[],this._config.useTrackPath&&(f=n,Y()(f).call(f,function(e){return!!e.path}))?[3, 3]:(a=(o=i.push).apply,s=[i],[4,this._manipulateMediaTracksFromStreams(this._path,this._cache,"lowLatency"===this._latency?["lowlatency"]:[])]);case 2:return a.apply(o,L()(s).call(s,[h.sent()])),[3,4]; case 3:i.push.apply(i,this._manipulateMediaTracksWithTrackPath(n)),h.label=4;case 4:return l=(u=i).unshift,[4,this._createABRTrack(i)];case 5:return l.apply(u,[h.sent()]),c=this._sanitizeTracks(i),[4,this._manipulateAudioTracks(r, c)];case 6:return d=h.sent(),[2,[c,d]]}var f})})},e.prototype._manipulateAudioTracks=function(e,t){return zn(this,void 0,void 0,function(){var n,r=this; return Wn(this,function(i){return this._config.disableAudioTrack?[2,[]]:(n=[],te()(e).call(e,function(e){var t,i,o=oe()(t=r._encodingTracks).call(t,function(t){return t.encodingTrackId===e.encodingTrackId}), a=new it.s; a.dataset=e,a.setProperty("id",L()(i="".concat(r.idPrefix,"/encodingTrack/")).call(i,o)),a.setProperty("kind","lowLatency"===r._latency?_t.I:"alternative"),n.push(a)}),te()(t).call(t,function(e){if(e.audioCodec|| "abr"===e.encodingOptionID){var t=new it.s,i="".concat(r.lastGroupId++); t.setProperty("id",e.id),t.setProperty("kind",e.kind),t.setProperty("label",e.label),t.setProperty("language",e.language),t.setProperty("enabled",e.selected),t.setProperty("pzpGroupId",i),e.pzpGroupId= i,n.push(t)}}),[2, n])})})},e.prototype._getVideoCodecIdentifier=function(e){for(var t=new (wn()),n=0,r=e;n=e})).length?[2, (new Cn.ZP(r)).buildToString()]:[2,""]}})})},e.prototype._createABRTrack=function(e){return zn(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,l,c=this; return Wn(this,function(d){var h,f,p,v,g,y,m,_,E;switch(d.label){case 0:return E=this._config.startLevel,t=isFinite(E)?E:480,_=this._config.maxLevel,n=isFinite(_)?_:720,m=this._livePollingStatus,r=m&&m.playableStatus!== It.PLAYABLE&&m.trafficThrottling>0?m.trafficThrottling:NaN,f=this._path,y=(g=(p={levelStart:t,levelCap:n,maxBitrate:r})?function(e){var t=[];return e.levelStart&&t.push("level_start\x3d".concat(e.levelStart)), e.levelCap&&t.push("level_cap\x3d".concat(e.levelCap)),e.maxBitrate&&t.push("max-bitrate\x3d".concat(e.maxBitrate)),t.join("\x26")}(p):"").length>0?"#".concat(g):"",i=L()(v="".concat(f)).call(v,y),(o=this._getVideoCodecIdentifier(e)).size> 0?(a=Rn()(h=Q()(o)).call(h,function(e,t){var n=c.getCodecEfficiency(t); return n>e?n:e},0),[4, this._removeInefficientStreamInf(a)]):[3,2];case 1:(s=d.sent())&&this._cache.put(this._path,s),d.label=2;case 2:return u=function(e,t){return z()(e).call(e,function(e){return function(e,t,n){void 0===t&& (t=1/0),void 0===n&&(n=Vn);var r=Math.min(e,t);if(Bn()(r))return 0;if(r===1/0)return n[0];for(var i=1/0,o=0;o=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&f()(t,n,a),a},or=function or(e,t,n,r){return new (n||(n=v()))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}} function s(e){try{u(r["throw"](e))}catch(e){o(e)}} function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)} u((r=r.apply(e,t||[])).next())})},ar=function ar(e,t){var n,r,i,o,a={label:0, sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof y()&&(o[_()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"#".concat(o):"",s=L()(r="".concat(e.path)).call(r,a),u=t.getInitialTrack(e.encodingTrack,n),l={src:s,label:"ABR",selected:!1,id:L()(i="".concat(e.protocol,"_")).call(i,e.drm||"nondrm", "_ABR"),width:u?u.videoWidth:-1,height:u?u.videoHeight:-1,encodingOptionID:"abr",videoCodec:null==u?void 0:u.videoCodec,videoProfile:null==u?void 0:u.videoProfile,audioCodec:null==u?void 0:u.audioCodec, audioProfile:null==u?void 0:u.audioProfile,dolbyVisionProfile:null==u?void 0:u.dolbyVisionProfile};return"DASH"!==e.protocol&&"lowLatency"!==e.latency||(l.kind=mt.c.LOW_LATENCY),new Dn.Z(l)},t.getTracksFromTrackInfo= function(e,n){return P()(n).call(n,function(n){return new Dn.Z(_rr({},t._getTrackParam(n.path,e,n)))})},t.getTracksFromMPD=function(e,n,r,i){return or(this,void 0,void 0,function(){var i; return ar(this,function(o){return i=G()(n).call(n,"#")>-1?"\x26":"#",[2,P()(r).call(r,function(r){var o,a,s=(0,tt.Z)({"experimental-video-bitrate":r.videoBitRate,"experimental-audio-bitrate":r.audioBitRate}); return new Dn.Z(_rr({kind:mt.c.LOW_LATENCY},t._getTrackParam(L()(o=L()(a="".concat(n)).call(a,i)).call(o,s),e,r)))})]})})},t.getP2PTracksFromTrackInfo=function(e,n,r){return or(this,void 0,void 0,function(){var i, o; return ar(this,function(a){return 0===(i=C()(n).call(n,function(e){return!!e.p2pPath})).length?[2, []]:(e.latency?"lowLatency"===e.latency&&(o=mt.c.LOW_LATENCY_P2P):o=mt.c.P2P,o?[2,P()(i).call(i,function(n){return new Kt.Z(r,n.p2pPath,_rr(_rr({},t._getTrackParam(Ct.ZP.convertHlsUrl(n.p2pPath),e,n)), {kind:o}))})]:[2, []])})})},t._getTrackParam=function(e,t,n){var r,i,o,a,s,u,l,c=t.protocol,d=t.latency,h=t.drm?"DRM":"DRM_FREE",f=d?d.toLowerCase():"normal",p=n.videoCodec,v=void 0===p?"UNK":p,g=n.audioCodec,y=void 0=== g?"UNK":g,m=n.videoDynamicRange,_=void 0===m?"SDR":m,E=n.videoFrameRate,T=n.videoWidth,b=n.videoHeight,S=n.videoProfile,w=n.encodingTrackId,A=n.videoBitRate,R=n.audioProfile,I=n.audioBitRate,C=n.dolbyVisionProfile, O=Gn({width:T, height:b});return{src:e,id:L()(r=L()(i=L()(o=L()(a=L()(s=L()(u=L()(l="".concat(c,"_")).call(l,h,"_")).call(u,w,"_")).call(s,v,"_")).call(a,y,"_")).call(o,_,"_")).call(i,E,"_")).call(r,f),audioProfile:R, audioCodec:y,dolbyVisionProfile:C,videoProfile:S,videoCodec:v,videoFrameRate:E,label:"".concat(O.toString(),"p"),selected:!1,width:T,height:b,videoBitrate:A/1E3,audioBitrate:I/1E3,dataset:n}},t.getInitialTrack= function(e,t){var n; return t&&t.levelStart?z()(e).call(e,function(e){return Math.min(e.videoWidth,e.videoHeight)===t.levelStart}):q()(n=ur([],e,!0)).call(n,function(e,t){var n=Math.min(e.videoWidth,e.videoHeight),r=Math.min(t.videoWidth, t.videoHeight); return nr)})[0]},t.hasTrackPath=function(e){return Y()(e).call(e,function(e){return!!e.path})},t.hasP2PPath=function(e){return Y()(e).call(e,function(e){return!!e.p2pPath})},t._filterRestrictedVideo= function(e){var t=e.maxBitrate||1/0,n=e.maxResolution||1/0; return function(e){var r=e.videoBitRate<=t,i=(0,yt.Z)(e.videoWidth,e.videoHeight)<=n;return r&&i}},t._filterAudioOnlyTrack=function(e){return!e.audioOnly},t.pickInitialTrackFromVideoTracks=function(e,t, n){var r,i=e; if(n&&(i=C()(e).call(e,function(e){return e.kind===n})),"number"==typeof t&&isFinite(t)){var o=C()(i).call(i,function(e){return"abr"!==e.label.toLowerCase()}); o.length>0&&(r=(0,gt.Z)(o,t))}return r||z()(i).call(i,ct)||i[0]||e[0]},f()(t,(n=cr,dr),{set:function set(e){yr=e,e?pe().mark(window,"plugout.log"):pe().mark(window,"plugout.nolog")}, enumerable:!1,configurable:!0}),f()(t,dr,{get:function get(){return yr}, enumerable:!1,configurable:!0}),t.prototype._injectPlaybackResponse=function(e,t){var n,r,i,o;this._param=t,(null===(n=this._param)||void 0===n?void 0:n.mediaType)&&(this._mediaType=this._validateMediaType(t.mediaType)), this._config.setParam(t),this._data=JSON.parse(U()(e)),this._watchingLog.url=t.watchingApiUrl,this._shouldRequestLivePlaybackAPI=!1,this._liveRewind=null===(r=e.meta)||void 0===r?void 0:r.liveRewind,this._liveRewindDuration= null===(i=e.meta)||void 0===i?void 0:i.duration,this._liveSpriteSeekingThumbnail=null===(o=null==e?void 0:e.thumbnail)||void 0===o?void 0:o.spriteSeekingThumbnail,!1===t[hr]&&vr(this,!gr())},f()(t.prototype, "config",{get:function get(){return this._config}, enumerable:!1,configurable:!0}),f()(t.prototype,"player",{get:function get(){return this._player}, set:function set(e){if(this._player&&pe().mark(this,"mediaProvider.player.detach"),this._player=e,this._player){var t=dt.ZP.sharedOnWeakMap(this.player);this._nelo&&t.add(this._nelo.data),this._nelo=t, pe().mark(this,"mediaProvider.player.attach"),this._attachPlayer(e),this._streamingProfileHolder.attach(e)}}, enumerable:!1,configurable:!0}),t.prototype.createStreamingProfile=function(){return this._streamingProfileHolder.create()},t.prototype.applyStreamingProfile=function(e){this._streamingProfileHolder.apply(e, this._player)},f()(t.prototype,"data",{get:function get(){return this._data}, enumerable:!1,configurable:!0}),f()(t.prototype,"error",{get:function get(){return this._error}, enumerable:!1,configurable:!0}),f()(t.prototype,"p2pClientDownloadUrl",{get:function get(){return Pt.De.getSetupFileUrl((0,Pt.vY)(this.config.env))}, enumerable:!1,configurable:!0}),f()(t.prototype,"_startLevel",{get:function get(){return this.config.startLevel||480}, enumerable:!1,configurable:!0}),f()(t.prototype,"_maxLevel",{get:function get(){return this.config.maxLevel||720}, enumerable:!1,configurable:!0}),t.prototype.load=function(){var e,t;return or(this,void 0,void 0,function(){var n,r;return ar(this,function(i){var o;switch(i.label){case 0:if(pe().mark(this,"debug.liveprovider.load", {message:L()(o="liveId\x3d".concat(this._liveId,", rewind\x3d")).call(o,!0===this._liveRewind)}),this._verifyAuths(),this._cancel$.next(),null===(e=this._qoeProcessor)||void 0===e||e.cancel$.next(),(n= null===(t=this._player)||void 0===t?void 0:t._getSourceCaches())&&Ot.qQ.getInstance(n).closeEventStream(),this._shouldRequestLivePlaybackAPI)throw this._setError(110,"not exist playinfo");if(!this._data)throw this._setError(110, "not exist playinfo");return(r=this._data).live&&this._verifyLiveStatus(r.live.status),[4,this._updateMetadata(this._data)];case 1:return i.sent(),[2]}})})},t.prototype.close=function(){var e,t,n; this._beforeUnloadHandler&&(window.removeEventListener("beforeunload",this._beforeUnloadHandler),this._beforeUnloadHandler=null),this._cancel$.next(),null===(e=this._qoeProcessor)||void 0===e||e.cancel$.next(), null===(t=this._qoeProcessor)||void 0===t||t.clear(),this._player.setMediaKeys(null);var r=null===(n=this._player)||void 0===n?void 0:n._getSourceCaches();r&&Ot.qQ.getInstance(r).reset();var i=this._claimCollector(); i&&this._encodeAndSendServerTimings(i)},t.prototype.loop=function(){var e; return or(this,void 0,void 0,function(){return ar(this,function(t){return this.dispatchEvent(new jt.Z(jt.Z.Types.Loop))?this._shouldRequestLivePlaybackAPI?[2,!1]:(this.player._resetSession(),pe().mark(this.player, "player.action.loop"),this._loop$.next(),null===(e=this._qoeProcessor)||void 0===e||e.loop$.next(),[2,this._updateMetadata(this._data,{enablePosterChanges:!1,enableMediaChanges:!1,enableAdInfoChanges:!0}).then(function(){return!0})]): [2, !1]})})},t.prototype.updateLiveStatus=function(e){this._updatePlayableStatus(e.playableStatus,e.trafficThrottling)},t.prototype._updatePlayableStatus=function(e,t){var n,r; switch(void 0===t&&(t=-1),e){case It.PLAYABLE:var i=this._updateMediaControlsMaxBitrate(null),o=this._removeOverTrafficTrack(1/0);(i||o)&&this.dispatchEvent(new jt.Z(jt.Z.Types.TrafficRestored));break; case It.PLAYABLE_LOW_RESOLUTION:if(this._isRadioMode())break;if(t>-1){i=!1,this.isABRTrackSelected()&&(i=this._updateMediaControlsMaxBitrate(t));var a=this._removeOverTrafficTrack(t);(i||a)&&(this.dispatchEvent(new jt.Z(jt.Z.Types.TrafficThrottled, {detail:{bandwidthLimit:t,enforceABS:!1,playableStatus:e}})),null===(n=this._nelo)||void 0===n||n.send({type:"trafficthrottled",bandwidthLimit:t,enforceABS:!1,playableStatus:e,liveId:this._liveId}))}break; case It.FORCE_LOW_RESOLUTION:if(this._isRadioMode())break;if(t>-1){i=!1;var s=!1;this.isABRTrackSelected()?i=this._updateMediaControlsMaxBitrate(t):s=this._enforceChangeToABRTrack(t),a=this._removeOverTrafficTrack(t), (i||s||a)&&(this.dispatchEvent(new jt.Z(jt.Z.Types.TrafficThrottled,{detail:{bandwidthLimit:t,enforceABS:s,playableStatus:e}})),null===(r=this._nelo)||void 0===r||r.send({type:"trafficthrottled",bandwidthLimit:t, enforceABS:s,playableStatus:e,liveId:this._liveId}))}}},t.prototype._isRadioMode=function(){var e,t,n; return""===(null===(t=null===(e=this.player.audioTracks)||void 0===e?void 0:e.pzpFirstEnabledTrack)||void 0===t?void 0:t.pzpGroupId)&&-1===(null===(n=this.player.videoTracks)||void 0===n?void 0:n.selectedIndex)}, t.prototype.isABRTrackSelected=function(){return!(!this.player.videoTracks||0===this.player.videoTracks.length)&&ct(this.player.videoTracks[this.player.videoTracks.selectedIndex])},t.prototype._updateMediaControlsMaxBitrate= function(e){var t=this.player.getPreProcessorControl("hls"); return!!t&&t.maxBitrate!==e&&(t.maxBitrate=e,!0)},t.prototype._shouldChangeToABRTrack=function(e,t){return!e||!Lt(e)&&!(!e.videoBitrate||1E3*e.videoBitrate<=t)},t.prototype.getThumbnailUrlAsync=function(e){var t, n,r,i,o; if(!isFinite(e))return v().reject(new TypeError("Invalid media time"));if(!this._liveSpriteSeekingThumbnail)return v().resolve(null);var a=this._liveSpriteSeekingThumbnail,s=a.spriteFormat,u=s.intervalType, l=s.columnCount,c=s.rowCount,d=s.thumbnailHeight,h=s.thumbnailWidth,f=a.urlTemplate,p=this._liveSpriteSeekingThumbnail.spriteFormat.interval,g=1E3*(null!==(o=this._liveSpriteSeekingThumbnail.processingSeconds)&& void 0!==o?o:60);kt.q.SECOND===u&&(p*=1E3);var y=this.player.getStartDate(),m=y.getTime()+1E3*e,_=this.player.seekable;if((null==_?void 0:_.length)>0&&!this._liveRewind){var E=_.end(_.length-1),T=new Date(y.getTime()+ 1E3*E),b=new Date(y.getTime()+1E3*_.start(0)),S=new Date(T.getTime()-(p*c*l+g));if(!(b.getTime()e}},t.prototype._mutateTrackList=function(e,t){for(var n=0,r=t;n0&&this._processQoE(), this._watchingLog.url&&this._isValidWatchingLogUrl(this._watchingLog.url)&&this._initWatchingLog(),this._observePlayback(),this._observeVideoTracks(),this.config.audioSyncFixer&&this._initAudioSyncFixer(), (null===(a=e.meta)||void 0===a?void 0:a.paidLive)&&(this._playbackAuthType=t.DEFAULT_CDN_AUTH_TYPE),this._playbackAuthType||(this._playbackAuthType=null===(s=e.meta)||void 0===s?void 0:s.playbackAuthType), this._isSMPStream(e)?[4,this._setMediaKeys("com.naver.lip.smp","uri-redirect","application/x-mpegURL","temporary",e.meta.liveId.toString())]:[3,2];case 1:u.sent(),u.label=2;case 2:return pe().mark(this, "mediaProvider.encrypt.ok"),this._error?[2]:[4,this._updatePlayer(e,n)];case 3:return u.sent(),this._postProcessing(),this._registerBeforeUnloadHandler(),[2]}})})},t.prototype._postProcessing=function(){try{this.player.configurePostProcessor((0, Tt.z)({enable:!0}))}catch(e){this._nelo.send({type:"error", code:199,message:e.message,stack:e.stack||"not tracable"})}},t.prototype._setMediaKeys=function(e,t,n,r,i){return or(this,void 0,void 0,function(){var o,a,s; return ar(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,Ke.o.requestMediaKeySystemAccess(e,[{initDataTypes:[t],videoCapabilities:[{contentType:n}]}])];case 1:return o=u.sent(), [3,3];case 2:return u.sent(),this._setError(109,"video track load fail"),this.player._setError(4),[2];case 3:return u.trys.push([3,7,,8]),[4,o.createMediaKeys()];case 4:return a=u.sent(),[4,this._player.setMediaKeys(a)]; case 5:return u.sent(),(s=a.createSession(r)).onmessage=function(){s.update((new TextEncoder).encode(U()({kid:i,key:"hdnts",target:"__bgda__"})))},[4, s.generateRequest(t,(new TextEncoder).encode(U()({kid:i,type:"dynamic"})))];case 6:return u.sent(),[3,8];case 7:return u.sent(),this._setError(109,"video track load fail"),this._player._setError(3),[3, 8];case 8:return[2]}})})},t.prototype._updatePlayer=function(e,t){return or(this,void 0,void 0,function(){return ar(this,function(n){switch(n.label){case 0:return this.player?(this._cleanUpPreProcessing(), t.enablePosterChanges&&this._updatePoster(e),t.enableMediaChanges?[4, this._updateVideoTracks(e)]:[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return t.enableAdInfoChanges?[4,this._updateAdInfo()]:[3,4];case 3:n.sent(),n.label=4;case 4:return[2]}})})},t.prototype._updatePoster= function(e){var t; (null===(t=e.serviceMeta)||void 0===t?void 0:t.coverImgUrl)&&(this.player.poster=e.serviceMeta.coverImgUrl)},t.prototype._isSupportedMedia=function(e){switch(e.toUpperCase()){case "HLS":return""!==this.player.canPlayType("application/x-mpegURL"); case "DASH":return""!==this.player.canPlayType('application/vnd.naver.dash; profiles\x3d"urn:mpeg:dash:profile:isoff-live:2011"')}return!1},t.prototype._requestMediaKeySystemAccess=function(e){var t,n; return or(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c;return ar(this,function(d){switch(d.label){case 0:if(r=null,h=e.drm,o=C()(f=P()(p=P()(v=h.split(",")).call(v,function(e){return D()(e).call(e)})).call(p, He)).call(f,function(e){return null!==e}),"HLS"===(a=e.protocol.toUpperCase())?i=["skd", "cenc"]:"DASH"===a&&(i=["cenc"]),!i)return[2,null];q()(o).call(o,function(e,t){return Ve(e)-Ve(t)}),d.label=1; case 1:d.trys.push([1,9,10,15]),s=sr(o),d.label=2;case 2:return[4,s.next()];case 3:if((u=d.sent()).done)return[3,8];l=u.value,d.label=4;case 4:return d.trys.push([4,6,,7]),[4,Ke.o.requestMediaKeySystemAccess(l, [{videoCapabilities:[{contentType:'video/mp4; codecs\x3d"avc1.640033"'}],initDataTypes:i}])];case 5:return r=d.sent(),[3,8];case 6:return d.sent(),[3,7];case 7:return[3,2];case 8:return[3,15];case 9:return c= d.sent(),t={error:c},[3,15];case 10:return d.trys.push([10,,13,14]),u&&!u.done&&(n=s["return"])?[4,n.call(s)]:[3,12];case 11:d.sent(),d.label=12;case 12:return[3,14];case 13:if(t)throw t.error;return[7]; case 14:return[7];case 15:return[2,r]}var h,f,p,v})})},t.prototype._updateVideoTracks=function(e){var n,r,i; return or(this,void 0,void 0,function(){var o,a,s,u,l,c,d,h,f,p,v,g,y,m,_,E,T,b,S,w,A,R,I,O=this;return ar(this,function(P){var k,D;switch(P.label){case 0:o=[],a=[],s=null,u=0,P.label=1;case 1:P.trys.push([1, 10,11,16]),l=sr(e.media),P.label=2;case 2:return[4,l.next()];case 3:return(c=P.sent()).done?[3,9]:(d=c.value,h=d.protocol.toUpperCase(),this._isSupportedMedia(h)?d.drm?[4,this._requestMediaKeySystemAccess(d)]: [3,5]:(this._handleUnsupportedMedia(d),[3,8]));case 4:return(s=P.sent())?(this._drmKeySystem=s.keySystem,pe().mark(this,"mediaProvider.encrypt.ok"),[3,6]):(this._handleUnsupportedMedia(d),[3,8]);case 5:d.aes&& (this._isAESEncryptedMedia=!0,pe().mark(this,"mediaProvider.encrypt.ok")),P.label=6;case 6:return[4,this._handleMedia(d,h,e,u)];case 7:f=P.sent(),p=f[0],v=f[1],g=f[2],u=g,p.length>0&&(o=L()(o).call(o,p)), v.length>0&&(a=L()(a).call(a,v)),P.label=8;case 8:return[3,2];case 9:return[3,16];case 10:return y=P.sent(),n={error:y},[3,16];case 11:return P.trys.push([11,,14,15]),c&&!c.done&&(r=l["return"])?[4,r.call(l)]: [3,13];case 12:P.sent(),P.label=13;case 13:return[3,15];case 14:if(n)throw n.error;return[7];case 15:return[7];case 16:return(null==o?void 0:o.length)&&(o=C()(o).call(o,function(e){return ct(e)||(0,yt.Z)(e.width, e.height)<=(O.config.maxResolution||1/0)})),[4, Ot.qQ.getInstance(this.player._getSourceCaches()).prepareTracks(o,a,e.media,this.config.env)];case 17:switch((m=P.sent())&&(o=m.videoTracks,a=m.audioTracks),e.meta.cmcdEnabled&&this._configureCmcd(o),this._originalTracks= ur([],o,!0),_=(null===(i=e.livePollingStatus)||void 0===i?void 0:i.trafficThrottling)||0,E=this._isOverTrafficTrack(_<=0?NaN:_),o=C()(o).call(o,function(e){return!E(e)}),T=Y()(k=e.media).call(k,function(e){var t; return Y()(t=e.encodingTrack||[]).call(t,function(e){return Boolean(e.videoCodec)})}),b=this._handleInitialRadioMode(a,T)){case Er:return[2]; case _r:case Tr:break;default:throw new Error("Unhandled InitialRadioModeResult: ".concat(b));}return b===_r?[3,21]:(S=z()(o).call(o,function(e){return e.selected})||t.pickInitialTrackFromVideoTracks(o, this.config.track,this.config.trackKind))?(S.selected=!0,Lt(S)?[4, S.prepare().toPromise()]:[3,19]):[3,20];case 18:P.sent(),P.label=19;case 19:this._player._setCurrentSrc(S.src,{width:S.width,height:S.height,kind:S.kind}),P.label=20;case 20:e.livePollingStatus&&e.livePollingStatus.playableStatus!== It.PLAYABLE&&(w=e.livePollingStatus.trafficThrottling,e.livePollingStatus.playableStatus===It.FORCE_LOW_RESOLUTION)&&this._shouldChangeToABRTrack(S,w)&&(A=z()(o).call(o,ct),S&&(S.selected=!1),A&&(A.selected= !0,S=A)),P.label=21;case 21:return o.length||a.length?((R=null==S?void 0:S.pzpGroupId)&&(null==(I=z()(a).call(a,function(e){return e.getProperty("pzpGroupId")===R}))||I.setProperty("enabled",!0)),te()(D= C()(o).call(o,function(e){return void 0===e.pzpGroupId})).call(D,function(e){e.pzpGroupId="".concat(u++); var t=new it.s;t.setProperty("id",e.id),t.setProperty("kind",e.kind),t.setProperty("label",e.label),t.setProperty("language",e.language),t.setProperty("enabled",e.selected),t.setProperty("pzpGroupId",e.pzpGroupId), a.push(t)}),this._videoTracks=o,this._audioTrackPrivs=a,this._player._setVideoTracks(o),this._player._setAudioTrackPrivates(a),b===_r&&this._player.audioTracks.dispatchEvent(new lt.x("change")),this._player._setDuration(1/ 0),b!==_r&&this._updateDimension(o),s&&this._observeEncryptedEvent(s),[2]):(this._handleNoAvailTracks(),[2])}})})},t.prototype._handleInitialRadioMode=function(e,t){var n,r=C()(e).call(e,function(e){if(""!== e.getProperty("pzpGroupId"))return!1; var t=e.dataset;return Boolean(null==t?void 0:t.path)}),i="audio"===this.config.track,o=!t&&r.length>0,a=i||o; if(i&&0===r.length)return this._setError(200,"".concat("no track matches the requested track identifier"," (track\x3d'audio' requested but no audio-only track in response)")),this.player._setError(We.Z.MEDIA_ERR_SRC_NOT_SUPPORTED), Er;if(!a)return Tr;var s=this.config.trackKind===mt.c.LOW_LATENCY||this.config.trackKind===mt.c.LOW_LATENCY_P2P?_t.I:"alternative",u=z()(r).call(r,function(e){return e.getProperty("kind")===s}),l=u||r[0]; if(!u){var c,d,h=l.getProperty("kind"),f=L()(c=L()(d="trackKind\x3d".concat(null!==(n=this.config.trackKind)&&void 0!==n?n:"unset",": '")).call(d,s,"' audio-only track not found \u2014 fallback to '")).call(c, h,"'");(0,Ln.jd)("live_radio_mode_kind_fallback",f,this._dumpState())}l.setProperty("enabled",!0);var p=l.dataset;return this._applyAudioOnlySrc(p),_r},t.prototype._applyAudioOnlySrc=function(e){this._player._setCurrentSrc(e.path, {width:0, height:0}),this._player._setVideoSize(0,0)},t.prototype._handleNoAvailTracks=function(){this._setError(111,"not exist mediainfo"),this.player._setError(We.Z.MEDIA_ERR_SRC_NOT_SUPPORTED)},t.prototype._handleMedia= function(e,t,n,r){return or(this,void 0,void 0,function(){var i,o,a,s,u,l,c,d,h,f; return ar(this,function(p){switch(p.label){case 0:switch(i=[],o=[],a=r,t){case "HLS":return[3,1];case "DASH":return[3,6]}return[3,9];case 1:return this._isMultiViewStream()?[4,this._updateMultiviewTrack(n)]: [3,3];case 2:return o=p.sent(),[3,5];case 3:return s=this._createHLSTrackManipulator(e,n,r),[4,this._updateHlsVideoTrack(s,n,e)];case 4:u=p.sent(),l=u[0],c=u[1],o.push.apply(o,l),i.push.apply(i,c),a=s.lastGroupId, p.label=5;case 5:return[3,9];case 6:return!e.drm&&(0,$e.Z)()?[3,8]:(h=(d=o.push).apply,f=[o],[4,this._updateDashVideoTrack(n,e)]);case 7:h.apply(d,L()(f).call(f,[p.sent()])),p.label=8;case 8:return[3,9]; case 9:return[2,[o,i,a]]}})})},t.prototype._handleUnsupportedMedia=function(e){},t.prototype._configureCmcd=function(e){for(var t,n=this._getCmcdConfig(),r=0,i=e;r0},t.prototype._updateDashVideoTrack=function(e,n){return or(this,void 0,void 0,function(){var r,i,o,a,s,u,l; return ar(this,function(c){switch(c.label){case 0:return[4,this._filterTracks(n)];case 1:r=c.sent(),i=t.getABRTrackFromMediaInfo(n,{levelStart:$()(this._getLevelStart(e),10),levelCap:$()(this._getMaxLevel(e), 10),maxBitrate:this._getMaxBitrate(e)}),o=[i],c.label=2;case 2:return c.trys.push([2,6,,7]),t.hasTrackPath(r)?(o.push.apply(o,t.getTracksFromTrackInfo(n,r)),[3,5]):[3,3];case 3:return s=(a=o.push).apply, u=[o],[4,t.getTracksFromMPD(n,n.path,r,this._player._getSourceCaches())];case 4:s.apply(a,L()(u).call(u,[c.sent()])),c.label=5;case 5:return[3,7];case 6:throw l=c.sent(),this._setError(l);case 7:return[2, o]}})})},t.prototype._updateHlsVideoTrack=function(e,n,r){var i; return or(this,void 0,void 0,function(){var o,a,s,u,l,c,d,h;return ar(this,function(f){var p;switch(f.label){case 0:return f.trys.push([0,5,,6]),[4,e.manipulate()];case 1:return o=f.sent(),a=o[0],s=o[1], [4,e.filterTracks()];case 2:return u=f.sent()[0],pr(this)||!t.hasP2PPath(u)?[3,4]:(Ct.ZP.setConfigUrl(null===(i=z()(p=n.api).call(p,function(e){return"p2p-config"===e.name}))||void 0===i?void 0:i.path), c=(l=a.push).apply,d=[a],[4, t.getP2PTracksFromTrackInfo(r,u,this.config.env)]);case 3:c.apply(l,L()(d).call(d,[f.sent()])),f.label=4;case 4:return[2,[a,s]];case 5:throw h=f.sent(),this._setError(h);case 6:return[2]}})})},t.prototype._createHLSTrackManipulator= function(e,t,n){var r,i=new qn(e.encodingTrack,e.path,t.livePollingStatus,this.config,this.player._getSourceCaches(),!1,e.latency); return i.lastGroupId=n,i.idPrefix="media/".concat(oe()(r=t.media).call(r,function(t){return t===e})),i},t.prototype._getMaxBitrate=function(e){if(e.livePollingStatus&&e.livePollingStatus.playableStatus!== It.PLAYABLE&&e.livePollingStatus.trafficThrottling>0)return e.livePollingStatus.trafficThrottling},t.prototype._updateAdInfo=function(){var e; return or(this,void 0,void 0,function(){var t,n;return ar(this,function(r){switch(r.label){case 0:return t=this._player._getSession().sessionId,n=this._estimateAdsBitrate(),[4,this.player.adsController.initAd(this.player.clientWidth, this.player.clientHeight,he.AdViewModeTypes.NORMAL,n,_rr(_rr({},this._liveRewind?{contentDuration:this._liveRewindDuration}:{}),{transactionId:t,serviceId:this.config.serviceId||"",videoId:(null===(e=this.data)|| void 0===e?void 0:e.meta.videoId)||"",ownerServiceId:"",live:!0,vr:!1}),{playerId:this.player.id})];case 1:return r.sent(),[2]}})})},t.prototype._estimateAdsBitrate=function(){for(var e,t=null,n=0,r=0;r< (null===(e=this.player.videoTracks)||void 0===e?void 0:e.length);++r)this.player.videoTracks[r].selected&&(t=this.player.videoTracks[r]); if(t){var i=t.videoBitrate,o=t.audioBitrate,a=(isFinite(i)?i:0)+(isFinite(o)?o:0);a>0&&(n=a)}return n},t.prototype._observePlayback=function(){var e=this,t=this._player; if(t){var n=(0,me.R)(t,at.Z.ABORT),r=(0,me.R)(t,at.Z.ENDED),i=(0,me.R)(t,at.Z.RESIZE),o=(0,me.R)(t,at.Z.EMPTIED),a=(0,_e.S3)(n,this._cancel$,this._loop$,o);r.pipe((0,Ae.R)(a)).subscribe(function(){e._replay= !0}),(0,vt.N)(this.player,{tolerances:.5}).pipe((0,Ae.R)(a)).subscribe({next:function next(){e.loop()["catch"](et.Z)}}),i.pipe((0,Ae.R)(a)).subscribe(function(){var e=Q()(t.videoTracks),n=e[t.videoTracks.selectedIndex]; if(n)if(se()(e).call(e,function(e){return e instanceof Dn.Z}))if("abr"===(null==n?void 0:n.encodingOptionID)){var r=n.width,i=n.height,o=n.kind,a=C()(e).call(e,function(e){return e!==n&&e.kind===o&&e.width=== r&&e.height===i}); 1===a.length?n.videoFrameRate=a[0].videoFrameRate:n.videoFrameRate=void 0}else for(var s=0,u=C()(e).call(e,function(e){return"abr"===e.encodingOptionID});s=r[i])o=r[i];else for(var a=0;a<=i;a++){if(e===r[a]){o=r[a];break}if(e0){var l=u.end(u.length-1);isFinite(l)&&(e.currentTime=l)}}})},t.prototype._dumpState= function(){return{protocol:this.protocol, error:this.error,cid:this._clientId}},t.prototype._getLiveLatency=function(){if(!this.player||isFinite(this.player.duration))return NaN; var e=function(e,t){for(var n,r=null,i=0,o=e.length;!r&&i0){var i,o=z()(i=this._videoTracks).call(i,function(t){return t.id===e[0]}); return o?(this._player._setCurrentSrc(o.src,o),this._player._switchCurrentSrc(),[!0,"number"==typeof o.audioBitrate]):[!1,!1]}if(r&&t.length>0){var a,s=z()(a=this._audioTrackPrivs).call(a,function(e){return e.getProperty("id")=== t[0]}); if(!s)return[!1,!1];var u=s.dataset;if(null==u?void 0:u.audioOnly)return this._applyAudioOnlySrc(u),this._player._switchCurrentSrc(),[!0,!0]}return[!1,!1]},t.prototype[st.J]=function(e){if(function(e){return"dataset"in e}(e)){var t,n=(0,er.FX)((t=this._player,Ke.o.unwrap(t.player)),tr.T); if(n){var r=[];if(te()(n).call(n,function(t){var n=t.get(e.label);n&&r.push(n)}),1===r.length){var i,o=r[0]; o.length&&(f()(e.dataset,"characteristics",{value:o,enumerable:!0,configurable:!0}),B()(o).call(o,"public.translation")?i="auto":B()(o).call(o,"public.machine-generated")&&(i="stt"),i&&f()(e.dataset,"type", {value:i,enumerable:!0,configurable:!0}))}}}},t.DEFAULT_CDN_AUTH_TYPE="SMP_ADVANCED_SEGMENT",t.PLAYER_FEATURE_FLAG_SERVER_URL=mr,t.MediaPresets=zt,t[n]=Ct.ZP.DEFAULT_STATE_QUERY_OPTIONS.experimentals.testUserAgentString, t.DISABLE_QOE_DELAY=!1,ir([(0,ut.z)(156)],t.prototype,"load",null),ir([(0,ut.z)(191)],t.prototype,"close",null),ir([(0,ut.z)(192)],t.prototype,"updateLiveStatus",null),ir([(0,ut.z)(187)],t.prototype,"_mutateTrackList", null),ir([(0,ut.z)(188)],t.prototype,"_removeOverTrafficTrack",null),ir([(0,ut.z)(159)],t.prototype,"_updateMetadata",null),ir([(0,ut.z)(179)],t.prototype,"_updatePlayer",null),ir([(0,ut.z)(180)],t.prototype, "_updatePoster",null),ir([(0,ut.z)(181)],t.prototype,"_updateVideoTracks",null),ir([(0,ut.z)(185)],t.prototype,"_handleNoAvailTracks",null),ir([(0,ut.z)(183)],t.prototype,"_handleMedia",null),ir([(0,ut.z)(182)], t.prototype,"_handleUnsupportedMedia",null),ir([(0,ut.z)(184)],t.prototype,"_configureCmcd",null),ir([(0,ut.z)(189)],t.prototype,"_updateAdInfo",null),ir([(0,ut.z)(190)],t.prototype,"_estimateAdsBitrate", null),ir([(0,ut.z)(122)],t.prototype,"_prepareP2PTrack",null),ir([(0,ut.z)(166)],t.prototype,"_fixAudioSync",null),ir([(0,ut.z)(162)],t.prototype,"_onLiveConnectorEventLog",null),ir([(0,ut.z)(169)],t.prototype, "_onLiveConnectorEventError",null),ir([(0,ut.z)(163)],t.prototype,"_onLiveConnectorInvokeVersion",null),ir([(0,ut.z)(165)],t.prototype,"_onLiveConnectorInvokeValidVersion",null),ir([(0,ut.z)(164)],t.prototype, "_liveConnectorVerifyVersion",null),ir([(0,ut.z)(186)],t.prototype,"_updateDimension",null),ir([(0,ut.z)(161)],t.prototype,"_initWatchingLog",null),ir([(0,ut.z)(158)],t.prototype,"_setError",null),ir([(0, ut.z)(178)],t.prototype,"_cleanUpPreProcessing",null),ir([(0,ut.z)(160)],t.prototype,"_processQoE",null),ir([(0,ut.z)(124)],t.prototype,"_onEnableP2P",null),ir([(0,ut.z)(123)],t.prototype,"_onDisableP2P", null),t}(rt.Z)}, 47070:function _(e,t,n){var _r36,i,o=n(85507),a=n.n(o),s=n(54943),u=n.n(s),l=n(43001),c=(_r36=function r(e,t){return _r36=a()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_r36(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r36(e,t),e.prototype=null===t?u()(t):(n.prototype=t.prototype,new n)}); !function(e){e.Loop="loop",e.WatchData="watchdata",e.TrafficThrottled="trafficthrottled",e.TrafficRestored="trafficrestored",e.VerifyingLiveStatus="verifyinglivestatus",e.P2PEnabled="p2penabled",e.P2PDisabled= "p2pdisabled",e.RequestQoE="requestqoe"}(i||(i={})); var d=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.detail=null==n?void 0:n.detail,r} return c(t,e),t.Types=i,t}(l.x); t.Z=d}, 60556:function _(e,t,n){n.d(t,{h:function h(){return y}}); var _r37,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(63978),l=n.n(u),c=n(18170),d=n(66008),h=n(13068),f=n(52626),p=n(63560),v=(_r37=function r(e,t){return _r37=o()||{__proto__:[]}instanceof Array&&function(e, t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r37(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+ String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r37(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(t,n,r){var i=e.call(this,r)||this; return i.env=t,i.p2pPath=n,i} return v(t,e),t.prototype.prepare=function(){var e=this;return f.ZP.getInstance().prepare(this.env,this.p2pPath).pipe((0,d.h)(function(t){return e.src!==t&&!0===e.selected}),(0,h.b)(function(t){l()(e,"src", {value:t, enumerable:!1,configurable:!0,writable:!1})}))},t}(p.Z); t.Z=g;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return v(t,e),t.prototype.prepare=function(){return(0,c.of)(this.src)},t}(g)}, 35542:function _(e,t){var n;!function(e){e[e.INSTALLED=3]="INSTALLED",e[e.EXT_NOT_INSTALLED=1]="EXT_NOT_INSTALLED",e[e.CLIENT_NOT_INSTALLED=2]="CLIENT_NOT_INSTALLED",e[e.CONNECTING=0]="CONNECTING",e[e.UNAVAILABLE= -1]="UNAVAILABLE",e[e.CLIENT_ERROR_OFFSET=-2147483647]="CLIENT_ERROR_OFFSET",e[e.CLIENT_NEED_UPDATE=-2147483646]="CLIENT_NEED_UPDATE",e[e.CLIENT_NO_VERSION_INFO=-2147483645]="CLIENT_NO_VERSION_INFO"}(n|| (n={})),t.Z=n}, 42798:function _(e,t,n){var r;n.d(t,{c:function c(){return r}}),function(e){e.MAIN="main",e.P2P="p2p",e.LOW_LATENCY="low-latency",e.LOW_LATENCY_P2P="low-latency-p2p"}(r||(r={}))}, 79958:function _(e,t,n){n.d(t,{I:function I(){return i}, X:function X(){return r}}); var r="low-latency",i="low-latency-alt"}, 54300:function _(e,t,n){var r;n.d(t,{x:function x(){return r}}),function(e){e.PLAYREADY="PLAYREADY",e.WIDEVINE="WIDEVINE",e.FAIRPLAY="FAIRPLAY",e.SMP="SMP",e.AES="AES"}(r||(r={}))}, 16075:function _(e,t,n){n.d(t,{$:function $(){return i.Z}, $G:function $G(){return a.Z}, Ct:function Ct(){return s.C}, Iq:function Iq(){return r.Iq}, OG:function OG(){return r.OG}, T1:function T1(){return r.T1}, WH:function WH(){return u.Z}, m7:function m7(){return o.b$}, nu:function nu(){return r.nu}, q0:function q0(){return s.q}}); var r=n(61516),i=n(35542),o=n(82293),a=n(81048),s=n(70672),u=n(47070)}, 14327:function _(e,t,n){n.d(t,{j:function j(){return _j}}); var r=n(93476),i=n.n(r),o=n(65420),a=n.n(o),s=n(98341),u=n.n(s),l=n(63978),c=n.n(l),d=n(59340),h=n.n(d),f=n(11128),p=n.n(f),v=n(78914),g=n.n(v),y=n(16032),m=n(70211),_=n(57027),E=n(14370),T=n(55760),b= n(18170),S=n(26564),w=n(38821),A=n(33306),R=n(70540),L=n(71198),I=n(1558),C=n(96381),O=n(66008),P=n(55709),k=n(13251),D=n(55022),x=n(92582),N=n(74446),M=n(25971),U=n(93783),F=n(59455),B=n(61219),V=n(91679), H=n(82222),_j=function(){function e(e,t){this._player=e,this._adsPlayer=t,this._initialized=!1,this._prepared=!1,this._playing=!1,this._pauseSent=!1,this._adOrMain=!1,this.timeToAggregate=new m.xQ,this.subscriptions= [],this._abort$=(0,_.R)(this._player,B.Z.ABORT),this._playing$=(0,_.R)(this._player,B.Z.PLAYING),this._pause$=(0,_.R)(this._player,B.Z.PAUSE),this._timeupdate$=(0,_.R)(this._player,B.Z.TIME_UPDATE),this._ended$= (0,_.R)(this._player,B.Z.ENDED),this._error$=(0,_.R)(this._player,B.Z.ERROR),this._adStarted$=(0,_.R)(this._adsPlayer,y.AdEventTypes.AdStarted),this._contentResumeRequest$=(0,_.R)(this._adsPlayer,y.AdEventTypes.ContentResumeRequested), this._adPaused$=(0,_.R)(this._adsPlayer,y.AdEventTypes.AdPaused),this._adStopped$=(0,_.R)(this._adsPlayer,y.AdEventTypes.AdStopped),this._adRemainingTimeChanged$=(0,_.R)(this._adsPlayer,y.AdEventTypes.AdRemainingTimeChange)} return e.prototype.prepare=function(){return e=this,t=void 0,r=function r(){var e=this;return function(e,t){var n,r,i,o,s={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:l(0),"throw":l(1),"return":l(2)},"function"==typeof a()&&(o[u()]=function(){return this}),o; function l(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o= s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0){var c;s=A()(c="".concat(i)).call(c,t)}else l&&(s=l[0].replace(/[a-z]/i,t));return s},Ye=n(14327),Xe=(_r41=function r(e,t){return _r41= o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r41(e,t)},function(e,t){if("function"!=typeof t&& null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r41(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),_Qe=function Qe(){return _Qe=l()||function(e){for(var t,n=1,r=arguments.length;n0?"\x26":"#")).call(i,d),label:"ABR",selected:!1,id:"ABR",width:h?h.encodingOption.width:-1,height:h?h.encodingOption.height:-1, encodingOptionID:"abr"})} var xt=n(73302);function Nt(e,t,n){if(void 0===n&&(n=!0),!e||(null==e?void 0:e.length)<=0)return NaN;var r=0;if(It()(t)){var i=(0,xt.Z)(U()(e).call(e,function(e){var t;return"abr"!==(null===(t=e.label)|| void 0===t?void 0:t.toLowerCase())}),t); if(i)return D()(e).call(e,i)}if(n){var o=Y()(e).call(e,function(e){var t;return"abr"===(null===(t=e.label)||void 0===t?void 0:t.toLowerCase())}); r=o>=0?o:r}return r} var Mt,Ut,Ft=n(95684),Bt=n(34074),Vt=n.n(Bt),Ht=n(3579),jt=n(44109),Gt=n(11189),Kt=n(38311),zt=function(){var _e58=function e(t,n){return _e58=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e58(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e58(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),Wt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t._keys=null,t} return zt(t,e),t.prototype.update=function(e){return t=this,n=void 0,i=function i(){var t,n,r;return function(e,t){var n,r,i,o,a={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},"function"==typeof f()&&(o[v()]=function(){return this}),o; function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1?(r=e.substring(0,o),i=e.substring(o)):(r=e,i="");var a=T()(t=U()(n=this._keys).call(n,function(e){return"param"===e.type})).call(t, function(e){var t; return A()(t="".concat(e.name,"\x3d")).call(t,e.value)}).join("\x26"); return(0,Gt.Z)(r,a)+i},t.prototype.hasUsableLicenseKey=function(){return null!==this._keys},t}(Kt.z),qt=function(){var _e59=function e(t,n){return _e59=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e59(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e59(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),Zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return qt(t,e),t.prototype.createKeySessionController=function(e){return new Wt(e)},function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Vt()(t,n):r; if("object"==(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t, n,a):i(t,n))||a);return o>3&&a&&Q()(t,n,a),a}([(0,Ht.Pv)("VodKeysController")],t)}(jt.B),Yt=function(){var _e60=function e(t,n){return _e60=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__= t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_e60(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e60(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),Xt=function(e){function t(){return e.call(this,{keySystemIdentifiers:["com.naver.vod", "com.naver.vod.1_0"],keysController:Zt})||this} return Yt(t,e),t}(Ft.B),Qt=n(51246),Jt=n(21371); !function(e){e[e.ENABLE_HLS_TEMPLATE=1]="ENABLE_HLS_TEMPLATE"}(Mt||(Mt={})),function(e){e[e.DEFAULT_ABR_INITIAL_QUALITY=480]="DEFAULT_ABR_INITIAL_QUALITY",e[e.DEFAULT_ABR_MAX_QUALITY=720]="DEFAULT_ABR_MAX_QUALITY", e[e.DEFAULT_PD_INITIAL_QUALITY=720]="DEFAULT_PD_INITIAL_QUALITY"}(Ut||(Ut={})); var $t=function(){function e(){this._env="real"} return e.prototype.set=function(e){var t,n,r=e.query,i=e.hash;if(r){var o=(null===(t=e.query)||void 0===t?void 0:t.env)||(null===(n=e.query)||void 0===n?void 0:n.providerEnv);this._env=o}i&&(this.track= (0,Qt.q)(i.track),this.maxBitrate=P()(i["max-bitrate"],10),this.startTime=P()(i.t,10),this.maxResolution=P()(i["max-resolution"],10),this.startLevel=P()(i["start-level"],10),this.maxLevel=P()(i["max-level"]|| i["cap-track"]||i.capTrack,10),this.experimentalFlags=function(e,t){void 0===t&&(t=0);var n=P()(e,10);return isNaN(n)&&(n=t),n}(i["--vod-experimental"],0),this._pop=i.pop)},e.prototype.setByParam=function(e){e.startTime&& (this.startTime=e.startTime),e.track&&(this.track=e.track),e.maxResolution&&(this.maxResolution=e.maxResolution),e.maxBitrate&&(this.maxBitrate=e.maxBitrate),e.startLevel&&(this.startLevel=e.startLevel), e.maxLevel&&(this.maxLevel=e.maxLevel)},Q()(e.prototype,"pop",{get:function get(){return this._pop}, enumerable:!1,configurable:!0}),Q()(e.prototype,"playAPIDomain",{get:function get(){return e=this._env,"VODCLOUD_PLAYBACK2_API",(null===(t=Jt.T["com.navercorp.vodcloud.v2.config.".concat(e)])||void 0=== t?void 0:t.VODCLOUD_PLAYBACK2_API)||"apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0";var e,t}, enumerable:!1,configurable:!0}),e.prototype.getPlayAPIUrl=function(e,t,n,r){var i,o,a,s,u={key:n,sid:e};r&&l()(u,r);var c=window.location.protocol,d=T()(i=S()(u)).call(i,function(e){var t,n=e[0],r=e[1]; return A()(t="".concat(n,"\x3d")).call(t,encodeURIComponent(r))}).join("\x26"),h=A()(o=A()(a=A()(s="".concat(c,"//")).call(s,this.playAPIDomain,"/")).call(a,t,"?")).call(o,d); return(0,Re.Z)(h,this.pop)},e.prototype.testExperimentalFlags=function(e){return(this.experimentalFlags&e)===e},e}(),en=n(64348),tn=n(54400),nn=n(83157),rn=n(12928),on=n(89121),an=n(74802),sn=n(13210), un=n(97972),ln=function(){var _e61=function e(t,n){return _e61=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&& (e[n]=t[n])},_e61(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e61(t,n),t.prototype=null===n?s()(n):(r.prototype=n.prototype,new r)}}(),_cn2=function cn(){return _cn2=l()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e&&this._throwError(112,"playback session expired")}},t.prototype._readServerTime=function(){var e=this._data.serverTime; if(this._clientStartTime=L()(),e)try{var t=new Date(e);if(isNaN(t.getTime()))return void(this._serverTime=null);this._serverTime=t}catch(e){this._serverTime=null}else this._serverTime=null},t.prototype._readExpireTime= function(){var e=this._data.expireTime; if(e)try{var t=new Date(e);if(this._expireTime&&this._expireTime.getTime()===t.getTime())return;if(isNaN(t.getTime()))return void(this._expireTime=null);if(t.getTime()=1?((i=new Je(this._player,this._player.adsController,this._data.trackings["stat-policy"],this.config.pop)).loop$=this._loop$,i.cancel$=this._cancel$,[4,i.initialize()]): [2];case 1:return s.sent(),[4,i.prepare()];case 2:return o=s.sent(),null===(r=this._qoeSubscription)||void 0===r||r.unsubscribe(),this._qoeSubscription=o.subscribe(function(e){var t;e?(te().mark(a,"statistic.event.qoetickend"), te().mark(a.player.adsController,"statistic.event.qoetickend"),(t=te().aggregate("quality-log",[a,a.player.adsController])).incrementalSnapshot=te().aggregate("qoe-inc-snapshot",[a.player]),te().mark(a, "statistic.event.qoetickstart"),te().mark(a.player.adsController,"statistic.event.qoetickstart")):(te().mark(a,"statistic.event.qoetickend"),te().mark(a.player,"statistic.event.qoetickend"),t=te().aggregate("quality-log", [a,a.player]),te().mark(a,"statistic.event.qoetickstart"),te().mark(a.player,"statistic.event.qoetickstart")),i.send(t)}),(0,ie.R)(this._player,ze.Z.ERROR).pipe((0,me.q)(1),(0,fe.R)((0,ae.T)(this._cancel$, (0,ie.R)(this._player,"abort")))).subscribe(function(){a._qoeSubscription.unsubscribe(),te().mark(a,"statistic.event.qoetickend"),te().mark(a.player,"statistic.event.qoetickend"); var e=te().aggregate("quality-log",[a,a.player]);te().mark(a,"statistic.event.qoetickstart"),te().mark(a.player,"statistic.event.qoetickstart"),i.sendError(e)}),[2]}})})},t.prototype._processVTS=function(){var e, t=this,n=this._data; if(null===(e=null==n?void 0:n.trackings)||void 0===e?void 0:e["default"]){var r=(0,ie.R)(this._player,ze.Z.ABORT),i=(0,ie.R)(this._player,ze.Z.TIME_UPDATE),o=(0,oe.S3)(r,this._cancel$,this._loop$),a=i.pipe((0, ye.U)(function(){return Math.floor(te().aggregate("watch-time",[t.player])/1E3)})); (0,se.D)(n.trackings["default"]).pipe((0,pe.h)(function(e){return"progress"===e.event||"repetition"===e.event}),(0,ye.U)(function(e){return _cn2(_cn2({},e),{offset:P()("".concat(e.offset),10)})}),(0,_e.zg)(function(e){if("progress"=== e.event)return a.pipe((0,pe.h)(function(t){return t>=e.offset}),(0,pe.h)(function(){return!t.player.paused}),(0,ve.P)(),(0,ye.U)(function(){return e.url})); var n=e.offset;return a.pipe((0,pe.h)(function(e){return n<=e}),(0,pe.h)(function(){return!t.player.paused}),(0,Ee.b)(function(){n+=e.offset}),(0,ye.U)(function(t){var n; return A()(n="".concat(e.url,"?vts_time\x3d")).call(n,t)}))}),(0,fe.R)(o)).subscribe(function(e){(0,de.h)({url:(0,Gt.Z)(e,(0,Pt.Z)({tid:t.player._getSession().sessionId})), method:"GET",responseType:"text",withCredentials:!0}).subscribe()})}},t.prototype._observePlayback=function(){var e=this; if(this._player){var t=(0,ie.R)(this._player,ze.Z.ABORT),n=(0,ie.R)(this._player,ze.Z.ENDED),r=(0,oe.S3)(t,this._cancel$,this._loop$);n.pipe((0,fe.R)(r)).subscribe(function(){e._replay=!0}),(0,tn.N)(this.player, {tolerances:.5}).pipe((0,fe.R)(r)).subscribe({next:function next(){e.loop()["catch"](nn.Z)}})}},t.prototype.close=function(){this._cancel$.next(),this._player.setMediaKeys(null),this._clearCaches(),this._cleanUpPreProcessing()}, t.prototype.loop=function(){return dn(this,void 0,void 0,function(){return hn(this,function(e){return this.dispatchEvent(new tt.Z(tt.Z.Types.Loop))?(this._loop$.next(),this.player._resetSession(),te().mark(this.player, "player.action.loop"),[2, this._updateMetadata(this._data,{enableAdInfoChanges:!0,enableVideoTrackChanges:!1,enableTextTrackChanges:!1,enablePosterChanges:!1,enableDurationChanges:!1}).then(function(){return!0})]):[2, !1]})})},t.prototype._clearCaches=function(){return dn(this,void 0,void 0,function(){var e,t,n,r,i; return hn(this,function(o){switch(o.label){case 0:if(!(this._caches.length>0))return[3,4];for(e=this._player._getSourceCaches(),t=[],n=0,r=this._caches;n-1?(this._aegisInitDataType="aegis"===this._params.drm?Oe.U9:this._params.drm,[4,(0,nt.Z)()]):[3,2];case 1:if(!(n=a.sent()))throw new Error("No available key system access");return this._params.drm= (0,Ce.I)(n),[3,3];case 2:this._throwError(110,"invalid drm type"),a.label=3;case 3:return a.trys.push([3,5,,6]),te().mark(this,"mediaProvider.request.start",{api:"playApi"}),r=this._getPlayInfo(),i=r.pipe((0, Te.K)(function(){return(0,ue.H)(1E3).pipe((0,be.c)(r)).pipe((0,Se.X)(1))})),[4, (0,oe.S3)(i,this._cancel$.pipe((0,be.c)((0,le._)(new Error("Abort"))))).toPromise()];case 4:return t=a.sent(),[3,6];case 5:if("Abort"===(o=a.sent()).message)throw o;throw te().mark(this,"mediaProvider.request.fail", {api:"playApi"}),this._throwError(103,"api request failed"),this._error;case 6:return(0,et.X)(t)&&(te().mark(this,"mediaProvider.response.error",{api:"playApi",code:null==t?void 0:t.errorCode}),this._data= t,this._throwError(104,t&&t.errorCode?t.errorCode:"error response",null!==(e=null==t?void 0:t.errorMessage)&&void 0!==e?e:"error response","error-response")),this._data=t,te().mark(this,"mediaProvider.request.ok", {api:"playApi"}),[2,t]}})})},t.prototype._updatePlayer=function(e,t){return dn(this,void 0,void 0,function(){return hn(this,function(n){switch(n.label){case 0:return this.player?(t.enablePosterChanges&& this._updatePoster(e),this._updatePreProcessing(e),t.enableDurationChanges&&this._updateDuration(e),t.enableTextTrackChanges&&this._updateTextTracks(e),t.enableVideoTrackChanges?[4, this._updateVideoTracks(e)]:[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return t.enableAdInfoChanges?[4,this._updateAdInfo(e)]:[3,4];case 3:n.sent(),n.label=4;case 4:return this._updatePostProcessing(e), [2]}})})},t.prototype._updateAdInfo=function(e){var t,n,r; return dn(this,void 0,void 0,function(){var i,o,a,s,u,l,c,d,h,f,p,v,g,y;return hn(this,function(m){switch(m.label){case 0:for(i=null,o=0,a=0;a=r[i])o=r[i];else for(var a=0;a<=i;a++){if(e===r[a]){o=r[a];break}if(e0){var i,o,s,u=D()(i=e.source).call(i,"?")>-1?"\x26":"?";r=A()(o=A()(s="".concat(e.source)).call(s,u)).call(o,a)}else r=e.source;var l=e.template.body,c=l.bandwidth,d=l.resolution;return{url:r, body:Rt(l),indexTag:A()(t=A()(n="#EXT-X-STREAM-INF:BANDWIDTH\x3d".concat(c,",RESOLUTION\x3d")).call(n,d,"\n")).call(t,e.source)}}),u=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i< o;i++)!r&&i in t||(r||(r=bt()(Array.prototype).call(t,0,i)),r[i]=t[i]); return A()(e).call(e,r||bt()(Array.prototype).call(t))}(["#EXTM3U", "#EXT-X-VERSION:3"],T()(s).call(s,function(e){return e.indexTag}),!0).join("\n"); return{playListURL:A()(i=A()(o="".concat(e)).call(o,D()(e).call(e,"?")>0?"\x26":"?")).call(i,a),playListTag:u,chunks:s}}(o,u,s),N()(y=p.chunks).call(y,function(e){f.push(h.put(e.url,e.body)),v._caches.push(e.url)}), f.push(h.put(p.playListURL,p.playListTag)),this._caches.push(p.playListURL),[4, d().all(f)]):[3,4];case 3:g.sent(),g.label=4;case 4:return[2,l]}})})},t.prototype._setMediaKeys=function(e,t,n,r,i,o){return dn(this,void 0,void 0,function(){var a,s; return hn(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),[4,Pe.o.requestMediaKeySystemAccess(e,[{initDataTypes:[t],videoCapabilities:[{contentType:n}]}])];case 1:return[4,u.sent().createMediaKeys()]; case 2:return a=u.sent(),[4,this._player.setMediaKeys(a)];case 3:return u.sent(),(s=a.createSession(r)).onmessage=function(){s.update((new TextEncoder).encode(G()({kid:i,keys:o})))},[4, s.generateRequest(t,(new TextEncoder).encode(G()({kid:i,type:"static"})))];case 4:return u.sent(),[3,6];case 5:return u.sent(),this._throwError(109,"video track load fail"),[3,6];case 6:return[2]}})})}, t.prototype._updateVideoTracks=function(e){var t,n; return dn(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c,d,h,f,p,v,g,y;return hn(this,function(m){var _;switch(m.label){case 0:return z()(_=e.videos.list).call(_,fn)?(r=null===(t=e.streams)||void 0=== t?void 0:C()(t).call(t,function(e){return"HLS"===e.type}),i=this.player.canPlayType("application/x-mpegURL")||this.player.canPlayType("vnd.apple.mpegURL"),o=!!(null===(n=null==r?void 0:H()(r))||void 0=== n?void 0:C()(n).call(n,function(e){return"param"===e.type})),a=!!this.player.canPlayType("vnd.naver.mpegURL"),s=this.player.canPlayType('application/vnd.naver.dash; profiles\x3d"urn:mpeg:dash:profile:isoff-on-demand:2011"'), u=Boolean(r&&i&&(!o||a)),l=function(e){var t,n,r=-1; if(e.errorCode)return r;var i=e;return z()(t=i.videos.list).call(t,function(e){return e.drm&&e.drm.type&&e.drm.source})&&(r=1),(null===(n=i.streams)||void 0===n?void 0:z()(n).call(n,function(e){var t; return D()(t=_t()(Ie.Q)).call(t,e.type)>-1}))&&(r=2),r}(e),this._drmSchemeVersion=l,this._aegisInitDataType&&this._params.drm&&l>0?"FairPlay"===this._params.drm&&!a||("Widevine"===this._params.drm||"PlayReady"=== this._params.drm)&&!s?(this._throwError(111,"not support encrypted media"),[2]):[4, this._createDrmTracks(l)]:[3,2]):(this._throwError(62277026294,"NOW_ENCODING"),[2]);case 1:return(c=m.sent())&&0!==c.length?(d="number"==typeof this.config.track?this.config.track:NaN,h=Nt(c,d),(y=c[h])&& (y.selected=!0,this._player._setCurrentSrc(y.src,y)),this._videoTracks=c,this._player._setVideoTracks(c),this._updateDimension(c),this._observeEncryptedEvent(),[2]):(this._throwError(109,"video track load fail"), [2]);case 2:var E,b,S,w;if(!u)return 0===(f=T()(E=U()(b=U()(S=U()(w=e.videos.list).call(w,pt)).call(S,fn)).call(b,yt({maxBitrate:this.config.maxBitrate,maxResolution:this.config.maxResolution}))).call(E, Et)).length?(this._throwError(109,"video track load fail"),[2]):(g=Nt(f,"number"==typeof this.config.track&&this.config.track||720),(y=f[g]).selected=!0,this._videoTracks=f,this._player._setVideoTracks(f), this._updateDimension(f),this._player._setCurrentSrc(y.src,y),[2]);m.label=3;case 3:return m.trys.push([3,5,,6]),p={level_start:P()(this._getStartLevel(e),10),level_cap:P()(this._getMaxLevel(e),10)},[4, this._convertHlsStreamToTracks(e.meta.masterVideoId,r,p,{maxResolution:this.config.maxResolution,maxBitrate:this.config.maxBitrate},{canUseTemplate:this._config.testExperimentalFlags(1)})];case 4:return(v= m.sent()).length<=0?(this._throwError(109,"video track load fail"),[2]):(g=Nt(v,"number"==typeof this.config.track?this.config.track:NaN),(y=v[g]).selected=!0,this._videoTracks=v,this._player._setVideoTracks(v), this._player._setCurrentSrc(y.src,y),this._updateDimension(v),[3,6]);case 5:return m.sent(),[3,6];case 6:return[2]}})})},t.prototype._createDrmTracksV1=function(e){var t,n; return null===(n=e.videos.list)||void 0===n?void 0:T()(t=U()(n).call(n,function(e){var t,n;return Boolean((null===(t=e.drm)||void 0===t?void 0:t.licenseUrl)&&(null===(n=e.drm)||void 0===n?void 0:n.source))})).call(t, function(e){var t; return new Ge.Z({label:e.encodingOption.name,src:String(null===(t=e.drm)||void 0===t?void 0:t.source),selected:!1,id:e.id,width:e.encodingOption.width,height:e.encodingOption.height,encodingOptionID:e.id, videoBitrate:e.bitrate.video,audioBitrate:e.bitrate.audio})})},t.prototype._createDrmTracksV2=function(e){var t,n,r; return dn(this,void 0,void 0,function(){var i,o,a,s,u,l,c,h=this;return hn(this,function(f){switch(f.label){case 0:if(!(null==(i=null===(r=null==e?void 0:e.streams)||void 0===r?void 0:U()(r).call(r,function(e){return Boolean(Ie.Q[e.type])}))? void 0:i.length))return[2, []];o=[],f.label=1;case 1:f.trys.push([1,7,8,13]),a=function a(){var t,n,r,i;return hn(this,function(a){var u,c;switch(a.label){case 0:return"FairPlay"!==(t=l.value).type?[3,3]:[4,(0,de.h)({url:t.source, responseType:"text"}).toPromise()];case 1:return i=a.sent(),o.push(Dt(t.source,(null==e?void 0:e.videos.list)||[],{startLevel:P()(s._getStartLevel(e),10),capLevel:P()(s._getMaxLevel(e),10)})),n=function n(e, t){h.player._getSourceCaches().put(e,t)},r=function r(n,_r42,i){var a,s,u,l="".concat((0,gt.Z)(i.width,i.height),"p"),c=null==e?void 0:C()(a=e.videos.list).call(a,function(e){return e.encodingOption.width=== i.width&&e.encodingOption.height===i.height}),d=null!==(u=null==c?void 0:c.encodingOption.id)&&void 0!==u?u:n; o.push(new Ge.Z({label:l,src:A()(s="".concat(t.source,"#track\x3d")).call(s,n),selected:!1,id:n,width:i.width,height:i.height,encodingOptionID:d,videoBitrate:q()(_r42).call(_r42,function(e,t){return Math.max(e, t.bandwidth)},0), audioBitrate:0}))},[4, (new at.r({onWriteManifest:n,onFoundTrackGroup:r})).read(i.response,t.source)];case 2:a.sent(),a.label=3;case 3:return"Widevine"!==t.type&&"PlayReady"!==t.type?[3,5]:[4,(0,de.h)({url:t.source,responseType:"text"}).toPromise()]; case 4:i=a.sent(),o.push(Dt(t.source,(null==e?void 0:e.videos.list)||[],{startLevel:P()(s._getStartLevel(e),10),capLevel:P()(s._getMaxLevel(e),10)})),N()(u=U()(c=(new ke.Z(t.source,i.response)).getRepresentations()).call(c, function(e){var t,n,r=null===(t=e.codec)||void 0===t?void 0:t.substring(0,4);return!(!r||!De.K.video[r])||"video"===e.contentType||0===(null===(n=e.mimeType)||void 0===n?void 0:D()(n).call(n,"video"))})).call(u, function(n){var r,i,a,s="".concat((0,gt.Z)(n.width,n.height),"p"),u=null==e?void 0:C()(r=e.videos.list).call(r,function(e){return e.encodingOption.width===n.width&&e.encodingOption.height===n.height}), l=null!==(a=null==u?void 0:u.encodingOption.id)&&void 0!==a?a:n.id; o.push(new Ge.Z({label:s,src:A()(i="".concat(t.source,"#track\x3d")).call(i,n.id),selected:!1,id:n.id,width:n.width,height:n.height,encodingOptionID:l,videoBitrate:n.bandwidth,audioBitrate:0}))}),a.label= 5; case 5:return[2]}})},s=this,u=function(e){if(!y())throw new TypeError("Symbol.asyncIterator is not defined."); var t,n=e[y()];return n?n.call(e):(e="function"==typeof __values?__values(e):_()(e),t={},r("next"),r("throw"),r("return"),t[y()]=function(){return this},t); function r(n){t[n]=e[n]&&function(t){return new (d())(function(r,i){!function(e,t,n,r){d().resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}} }(i),f.label=2; case 2:return[4,u.next()];case 3:return(l=f.sent()).done?[3,6]:[5,a()];case 4:f.sent(),f.label=5;case 5:return[3,2];case 6:return[3,13];case 7:return c=f.sent(),t={error:c},[3,13];case 8:return f.trys.push([8, ,11,12]),l&&!l.done&&(n=u["return"])?[4,n.call(u)]:[3,10];case 9:f.sent(),f.label=10;case 10:return[3,12];case 11:if(t)throw t.error;return[7];case 12:return[7];case 13:return[2,o]}})})},t.prototype._createDrmTracks= function(e){return dn(this,void 0,void 0,function(){var t,n; return hn(this,function(r){switch(r.label){case 0:return t=this.data,n=[],1!==e?[3,1]:(n=this._createDrmTracksV1(t),[3,3]);case 1:return 2!==e?[3,3]:[4,this._createDrmTracksV2(t)];case 2:n=r.sent(),r.label= 3;case 3:return n?(B()(n).call(n,function(e,t){var n=Math.min(e.width,e.height),r=Math.min(t.width,t.height);return n>r?-1:Number(nd,f=h?"width":"height", p=h?c:d,v=1/0,g=null;return N()(u).call(u,function(e){var t=e.encodingOption[f],n=Math.abs(t-p);isNaN(n)||0===e.encodingOption[f]||(!g||v>n)&&(g=e,v=n)}),g}return u[Y()(u).call(u,function(e){return e.encodingOption.id=== s.encodingOptionID})]||null},Q()(t.prototype,"error",{get:function get(){return this._error}, enumerable:!1,configurable:!0}),Q()(t.prototype,"player",{get:function get(){return this._player}, set:function set(e){if(this._player&&te().mark(this,"mediaProvider.player.detach"),this._player=e,this._player){var t=qe.ZP.sharedOnWeakMap(this.player);this._nelo&&t.add(this._nelo.data),this._nelo=t, te().mark(this,"mediaProvider.player.attach"),this._streamingProfileHolder.attach(e)}}, enumerable:!1,configurable:!0}),t.prototype.createStreamingProfile=function(){return this._streamingProfileHolder.create()},t.prototype.applyStreamingProfile=function(e){this._streamingProfileHolder.apply(e, this._player)},Q()(t.prototype,"config",{get:function get(){return this._config}, enumerable:!1,configurable:!0}),Q()(t.prototype,"masterVideoId",{get:function get(){return this._data&&!(0,et.X)(this.data)?this._data.meta.masterVideoId:""}, enumerable:!1,configurable:!0}),Q()(t.prototype,"serviceId",{get:function get(){return this._data&&!(0,et.X)(this.data)?this._data.meta.serviceId.toString():""}, enumerable:!1,configurable:!0}),Q()(t.prototype,"data",{get:function get(){return this._data}, enumerable:!1,configurable:!0}),Q()(t.prototype,"key",{get:function get(){return this._key}, enumerable:!1,configurable:!0}),t.prototype._dumpState=function(){var e;return{tid:null===(e=this._data)||void 0===e?void 0:e.tId,cid:this._clientId,protocol:this.protocol,error:this._error}},t.prototype[We.N]= function(e){var t,n=e[0],r=C()(t=this._videoTracks).call(t,function(e){return e.id===n}); return r?(this.player._setCurrentSrc(r.src,{width:r.width,height:r.height}),this.player._switchCurrentSrc(),[!0,!1]):[!1,!1]},t}(He.Z)}, 64348:function _(e,t,n){var _r43,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=(_r43=function r(e,t){return _r43=o()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t, n)&&(e[n]=t[n])},_r43(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r43(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t,n,r,i){void 0===n&&(n="unknown error"),void 0===r&&(r="unknown error"); var o=e.call(this)||this;return o.code=t,o.message=n,o.detailMessage=r,o.errorOrigin=i,o.code=t,o.message=n,o} return u(t,e),t}(Error); t.Z=l}, 81838:function _(e,t,n){n.d(t,{Z:function Z(){return c}}); var r=n(51942),i=n.n(r),o=n(61146),_a5=function a(){return _a5=i()||function(e){for(var t,n=1,r=arguments.length;n0&&a[0]){var s=a[0],u=new (F())(g()(a).call(a,1));n.push({codec:s, compatibilityBrands:u})}}catch(e){}}return n} var z,W=n(82174),q=n(29828),Z=n.n(q);!function(e){e.ANY="ANY",e.VIDEO="VIDEO",e.AUDIO="AUDIO"}(z||(z={})); var Y=["dvhe.","dvh1.","dvav."],X=n(69240);var _Q2=function Q(){return _Q2=i()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&& S.height>0&&(a.video.width=S.width,a.video.height=S.height),isFinite(s)&&(a.video.bitrate=s),isFinite(l)?a.video.framerate=l:a.video.framerate=30}b.audio&&(f=b.audio)}}return{baseUrl:e,streamInfs:o,nonStreamStatements:n, decodingPreset:a,bandwidth:s,resolution:c,videoCodec:h,audioCodec:f,videoRange:d,frameRate:l,originalUri:r,characteristics:i,videoGroup:p,audioGroup:v,subtitlesGroup:g,closedCaptionsGroup:y,supplementalCodecs:m}}(t, e,s)}),c=[],[4, a().all(E()(l).call(l,function(e){return J(y,void 0,void 0,function(){var t,r,i,o,s,u,l,d,f;return $(this,function(v){switch(v.label){case 0:if(!e.decodingPreset.video&&!e.decodingPreset.audio)return[3, 25];if(!e.supplementalCodecs)return[3,20];v.label=1;case 1:v.trys.push([1,14,15,20]),r=function(e){if(!h())throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[h()];return n?n.call(e): (e="function"==typeof __values?__values(e):p()(e),t={},r("next"),r("throw"),r("return"),t[h()]=function(){return this},t); function r(n){t[n]=e[n]&&function(t){return new (a())(function(r,i){!function(e,t,n,r){a().resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}} }(e.supplementalCodecs),v.label=2; case 2:return[4,r.next()];case 3:if((i=v.sent()).done)return[3,13];if(o=i.value,!e.decodingPreset.video)return[3,8];s=_Q2(_Q2({},e.decodingPreset),{video:_Q2(_Q2({},e.decodingPreset.video),{contentType:'video/mp4; codecs\x3d"'.concat(o.codec, '"')})}),v.label=4;case 4:return v.trys.push([4,6,,7]),[4,M.Z.instance.decodingInfo(s)];case 5:return(l=v.sent()).supported?(e.decodingPreset.video=s.video,e.videoCodec=o.codec,t=!0,[3,13]):[3,7];case 6:return v.sent(), [3,7];case 7:return[3,12];case 8:if(!e.decodingPreset.audio)return[3,12];s=_Q2(_Q2({},e.decodingPreset),{audio:_Q2(_Q2({},e.decodingPreset.audio),{contentType:'audio/mp4; codecs\x3d"'.concat(o.codec,'"')})}), v.label=9;case 9:return v.trys.push([9,11,,12]),[4,M.Z.instance.decodingInfo(s)];case 10:return(l=v.sent()).supported?(e.decodingPreset.audio=s.audio,e.audioCodec=o.codec,t=!0,[3,13]):[3,12];case 11:return v.sent(), [3,12];case 12:return[3,2];case 13:return[3,20];case 14:return u=v.sent(),d={error:u},[3,20];case 15:return v.trys.push([15,,18,19]),i&&!i.done&&(f=r["return"])?[4,f.call(r)]:[3,17];case 16:v.sent(),v.label= 17;case 17:return[3,19];case 18:if(d)throw d.error;return[7];case 19:return[7];case 20:if(void 0!==t)return[3,24];v.label=21;case 21:return v.trys.push([21,23,,24]),[4,M.Z.instance.decodingInfo(e.decodingPreset)]; case 22:return l=v.sent(),t=l.supported,[3,24];case 23:return v.sent(),t=!1,[3,24];case 24:return[3,26];case 25:t=!(null==n?void 0:n.strictMode),v.label=26;case 26:return t&&c.push(e),[2]}})})}))]; case 1:var S;return _.sent(),b()(c).call(c,function(e){var t;b()(t=function(e){var t=new (F()),n=e.videoCodec,r=e.audioCodec,i=e.bandwidth,o=e.resolution,a=e.frameRate,s=e.videoRange;return t.size>0&&t.clear(), n&&r?t.add("muxed"):n?t.add("nosnd"):r&&t.add("audio"),t.add("bw_".concat(i)),n&&(t.add(n.substring(0,4)),o?t.add("size_".concat(o)):t.add("size_unk"),isNaN(a)?t.add("fps_unk"):t.add("fps_".concat(a)), s&&(t.add("color_".concat(s.toLowerCase())),function(e,t){var n;void 0===t&&(t="ANY");for(var r=0,i=Y;rn}(e, t,l)}))).pipe((0,u.q)(1))}))} }, 67752:function _(e,t,n){n.d(t,{K:function K(){return u}}); var r=n(57027),i=n(66008),o=n(55709),a=n(91679),s=n(25971);function u(e,t,n){return void 0===n&&(n=0),(0,r.R)(e,"timeupdate").pipe((0,i.h)(function(){return!e.paused&&0!==e.playbackRate}),(0,o.U)(t),(0, i.h)(function(e){return e>=n}),(0,a.j)(3),(0,s.P)())} }, 52091:function _(e,t,n){n.d(t,{Z:function Z(){return a}}); var r=n(57027),i=n(25971),o=n(61219);function a(e){return(0,r.R)(e,o.Z.PLAYING).pipe((0,i.P)())} }, 44610:function _(e,t,n){n.d(t,{Z:function Z(){return s}}); var r=n(94435),i=n.n(r),o=n(59340),a=n.n(o);function s(e,t){return!!window.navigator.sendBeacon&&(n=void 0!==i()?new (i())({p:a()(t)}):new Blob(["p\x3d".concat(encodeURIComponent(a()(t)))],{type:"application/x-www-form-urlencoded;charset\x3dUTF-8"}), window.navigator.sendBeacon(e,n));var n} }, 15751:function _(e,t,n){n.d(t,{Z:function Z(){return a}}); var r=n(59340),i=n.n(r),o=n(70540);function a(e,t){return(0,o.h)({url:e,method:"POST",responseType:"text",headers:{"Content-Type":"application/x-www-form-urlencoded;charset\x3dUTF-8"},body:{p:i()(t)},withCredentials:!0}).toPromise()} }, 8411:function _(e,t,n){n.d(t,{f:function f(){return g}}); var _r44,i=n(85507),o=n.n(i),a=n(54943),s=n.n(a),u=n(63978),l=n.n(u),c=n(94473),d=n.n(c),h=n(81772),f=n(50),p=n(6272),v=(_r44=function r(e,t){return _r44=o()||{__proto__:[]}instanceof Array&&function(e, t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_r44(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+ String(t)+" is not a constructor or null"); function n(){this.constructor=e} _r44(e,t),e.prototype=null===t?s()(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(t,n,r){var i=e.call(this,{language:"", label:n},t,"metadata")||this;return i._inBandMetadataTrackDispatchType=r,i._readyState=0,i} return v(t,e),t.prototype._getComponentMajorVersion=function(e){var t;return(null===(t=/^(\d+)/.exec(e.version||""))||void 0===t?void 0:t[1])||"1"},t.prototype._addTextTrackCues=function(e){var t; if(this.trackElement){var n=this._getComponentMajorVersion(e);(null===(t=e.events)||void 0===t?void 0:t.length)?this._addTextTrackCuesByEvent(e):e.customData&&this._addMetadataCue(0,.25,e.customData,n)}}, t.prototype._addTextTrackCuesByEvent=function(e){var t; if((null===(t=e.events)||void 0===t?void 0:t.length)&&this.trackElement)for(var n=this._getComponentMajorVersion(e),r=0,i=e.events;rMath.abs(t-i)?n:e})} }, 5875:function _(e,t,n){function r(e,t,n){return n-e>t-n?t:e} n.d(t,{Z:function Z(){return o}}); var i=[144,270,360,480,720,1080,1440,2160,2880,4380];function o(e,t){return function(e,t){var n=t.length,i=0,o=n-1,a=0;if(e<=t[i])return t[i];if(e>=t[o])return t[o];for(;i0&&e>t[a-1])return r(t[a-1],t[a],e);o=a}else{if(a=e.length)return!1; for(var n=t+1;n8||!cn(e[n]))return!1}return!0} function fn(e){return 3===e.length&&un(e)} function pn(e){return 4===e.length&&un(e)} function vn(e){var t=e.length;return 2===t&&un(e)||3===t&&ln(e)} function gn(e){var t=e.length;return t>=5&&t<=8&&cn(e)||4===t&&ln(e[0])&&cn(e)} function yn(e){if(1!==e.length)return!1;var t=e.toLowerCase();return"x"!==t&&cn(t)} function mn(e){var t=e.length;return t>=2&&t<=8&&cn(e)} function _n(e){return e.toLowerCase()} function En(e){return e.toLowerCase()} function Tn(e){return e.toLowerCase()} function bn(e){return function(e){return!!dn[e.toLowerCase()]}(e)||function(e){var t=e.split("-"); return"x"===t[0].toLowerCase()&&hn(t,0)}(e)||function(e){var t=e.split("-"); return 0!==t.length&&!J()(t).call(t,function(e){return""===e})&&function(e){var t,n,r=0; if(n=(t=e[r]).length,!(un(t)&&n>=2&&n<=8))return!1;var i=e[r].length;if(4===i&&r+1=2&&i<=3)for(var o=0;r=e.length||!mn(e[r]))return!1;for(;r0){var s,u=[];ue()(s=me()(a)).call(s,function(e){var t=e.getAttribute("schemeIdUri"),n=e.getAttribute("value");t&&n&&u.push({"@schemeIdUri":t, "@value":n})}),t.ContentProtections=u}}if(e.parentElement&&"MPD"!==e.parentElement.tagName){var l,c=lr(e.parentElement),d=t.ContentProtections&&c.ContentProtections?w()(l=t.ContentProtections).call(l,c.ContentProtections): c.ContentProtections; return _sr(_sr(_sr({},c),t),d&&{ContentProtections:d})}return t} var cr=/\$([^$]+)\$/g;function dr(e){return e.width 0,s=ae()(i).call(i,function(e,t){return Math.max(e,Number(t["@bandwidth"])||0)},0),u=a?s||128E3:0,l=new st.ZP; l.version=6,l.push(new yr.t),ue()(i).call(i,function(e,t){var n=new dt.r;n.value={attrs:[new ut.Z("TYPE",'"AUDIO"'),new ut.Z("GROUP-ID",'"'.concat(_r,'"')),new ut.Z("NAME",'"audio-'.concat(t,'"')),new ut.Z("AUTOSELECT", "YES"),new ut.Z("DEFAULT","NO"),new ut.Z("URI",'"'.concat(e["@nvod:m3u"],'"'))]},l.push(n)}); var c=[];ue()(r).call(r,function(e){var t,n,r,i,s,d=a&&!function(e){var t,n;return J()(t=String(null!==(n=e["@codecs"])&&void 0!==n?n:"").split(",")).call(t,function(e){return"audio"===qn(O()(e).call(e))})}(e), h=ie()(t=[e["@codecs"], d?o:void 0]).call(t,Boolean).join(","),f=new ht.f,p=Number(e["@bandwidth"])||0,v=(p||function(e){var t,n=e["@width"]||0,r=e["@height"]||0,i=Number(e["@frameRate"]),o=isNaN(i)?30:i,a=null!==(t=mr[function(e){var t, n,r,i,o,a=ie()(t=I()(n=String(null!==(r=e["@codecs"])&&void 0!==r?r:"").split(",")).call(n,function(e){return O()(e).call(e)})).call(t,Boolean); return(null!==(o=null!==(i=x()(a).call(a,function(e){return"video"===qn(e)}))&&void 0!==i?i:a[0])&&void 0!==o?o:"").split(".")[0].toLowerCase()}(e)])&&void 0!==t?t:1; return Math.round(n*r*(o/30)*a)}(e))+(d?u:0); p||c.push(w()(i="".concat(null!==(n=e["@width"])&&void 0!==n?n:"?","x")).call(i,null!==(r=e["@height"])&&void 0!==r?r:"?")),f.value={attrs:[new ut.Z("BANDWIDTH","".concat(v))],uri:e["@nvod:m3u"]},e["@width"]&& e["@height"]&&f.value.attrs.push(new ut.Z("RESOLUTION",w()(s="".concat(e["@width"],"x")).call(s,e["@height"]))),e["@frameRate"]&&f.value.attrs.push(new ut.Z("FRAME-RATE","".concat(e["@frameRate"]))),f.value.attrs.push(new ut.Z("CODECS", '"'.concat(h,'"'))),d&&f.value.attrs.push(new ut.Z("AUDIO",'"'.concat(_r,'"'))),l.push(f)}); var d=r[0]["@nvod:m3u"].split("?")[0].replace(/[^/]+$/,"nmc-individual-master.m3u8");return{body:l.buildToString(),masterUrl:d,estimatedBandwidthVariants:c}} var br=n(56474),Sr=n.n(br),wr=function(){function e(e){var t,n,r,i;this._primaries=null!==(t=e.primaries)&&void 0!==t?t:null,this._transfer=null!==(n=e.transfer)&&void 0!==n?n:null,this._matrix=null!== (r=e.matrix)&&void 0!==r?r:null,this._fullRange=null!==(i=e.fullRange)&&void 0!==i?i:null} return K()(e.prototype,"primaries",{get:function get(){return this._primaries}, enumerable:!1,configurable:!0}),K()(e.prototype,"transfer",{get:function get(){return this._transfer}, enumerable:!1,configurable:!0}),K()(e.prototype,"matrix",{get:function get(){return this._matrix}, enumerable:!1,configurable:!0}),K()(e.prototype,"fullRange",{get:function get(){return this._fullRange}, enumerable:!1,configurable:!0}),e}(),Ar=n(4142),Rr=function(){function e(e){var t,n,r,i,o; this._colourPrimaries=null!==(t=e.colourPrimaries)&&void 0!==t?t:null,this._transferCharacteristics=null!==(n=e.transferCharacteristics)&&void 0!==n?n:null,this._matrixCoefficients=null!==(r=e.matrixCoefficients)&& void 0!==r?r:null,this._supplementalCodec=null!==(i=e.supplementalCodec)&&void 0!==i?i:null,this._supplementalProfiles=Sr()(function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0)return o[0].isDefault=!0,o[0];var u=(0,Ht.C)(null!==(r=null==a?void 0:I()(a).call(a,dr))&&void 0!==r?r:[],(s?n.track:NaN)||e.DEFAULT_VIDEO_SCANLINE_STATIC, zn);return u>-1?(a[u].isDefault=!0,a[u]):null},e.prototype.processVideoTracks=function(e,t,n){return this.processTracksInternal(e,t,n)},e.prototype.processTracksInternal=function(e,t,n){var r,i,o,a,s=this; if(!e)throw new Error("Track not parsed");var u=ie()(e).call(e,function(e){return!("dash"===e.protocol&&!t.dash)&&!("hls"===e.protocol&&!t.hls)&&s._filterTracks(e,n)}),l=(0,Xt.Z)(u,function(e){var t; return he()(t=e.components).call(t,"video")>-1}),c=l[0],d=l[1],h=(0,Gt.Z)(c,function(e){var t,r; if(!1!==n.disableHdrTrack)return e.qualityLabel;var i=(0,xr.u)(e.configuration,null===(t=e.codecs)||void 0===t?void 0:x()(t).call(t,function(e){return(0,Dr.Z)(e,"video")})); return[e.qualityLabel,null!==(r=e.frameRate)&&void 0!==r?r:"","SDR"===i?"SDR":"HDR"].join("\x00")}); ue()(r=M()(h)).call(r,function(e){var t;R()(t=h[e]).call(t,function(e,t){return s._measureTrackPriority(t)-s._measureTrackPriority(e)})}); var f=ae()(i=M()(h)).call(i,function(e,t){return w()(e).call(e,h[t][0])},[]),p=[]; ue()(o=ie()(a=ie()(f).call(f,function(e){return void 0===e.groupId})).call(a,function(e){var t; return he()(t=e.components).call(t,"audio")>-1})).call(o,function(e){var t=s._nextTrackGroupId(); p.push(s._createAudioTrackPrivate({id:e.id,pzpGroupId:t,enabled:e.isDefault,label:"audio_".concat(t)})),e.groupId=t}); var v=0===c.length;ue()(d).call(d,function(e){var t="".concat(s._lastIncrementalTrackGroupId++),n=s._createAudioTrackPrivate({id:t,pzpGroupId:"",enabled:!1,label:"audio_".concat(t),kind:v?"main":e.role}); n.dataset=e,p.push(n)}); var g=this._selectDefaultTrack(f,n);return{videoTracks:I()(f).call(f,Mr),audioTracks:p,defaultTrack:g,qualityTracks:f,audioOnlyStreams:d,videoStreams:c}},e.DEFAULT_VIDEO_SCANLINE_STATIC=720,e}(),Fr=n(93164), Br=n(97972),Vr=function(){var _e62=function e(t,n){return _e62=a()||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&& (e[n]=t[n])},_e62(t,n)}; return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t} _e62(t,n),t.prototype=null===n?u()(n):(r.prototype=n.prototype,new r)}}(),_Hr=function Hr(){return _Hr=c()||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e&&(this._error=new Bn.Z(112,"playback session expired","playback session expired"))}},t.prototype._load=function(){return jr(this,void 0,void 0,function(){return Gr(this,function(e){switch(e.label){case 0:return[4, this._onBeforeLoading()];case 1:return e.sent(),[4,this._requestServerData()];case 2:return e.sent(),[4,this._parseMetadata()];case 3:return e.sent(),this._player&&this._responseData?[4,this._onBeforeGeneratingTracks(this._player)]: [3,9];case 4:return e.sent(),[4,this._readAdaptationSets(this._player)];case 5:return e.sent(),[4,this._onBeforeUpdatePlayer()];case 6:return e.sent(),[4,this._updatePlayer(this._player)];case 7:return e.sent(), this._postProcessing(),[4,this._updateAdInfo(this._player)];case 8:e.sent(),e.label=9;case 9:return[2]}})})},t.prototype._parseUriScheme=function(){var e,n,r,i,o=(0,Zt.Z)(this._uri),a=o.username,s=void 0=== a?"":a,u=o.password,l=void 0===u?"":u,c=o.host,d=void 0===c?"":c,h=o.query,f=o.hash,p=Z()(f.startTime),v=(0,Yt.q)(f.track),g=X()(f["abr-begin"]||f["start-level"],10)||t.DEFAULT_VIDEO_SCANLINE_ADAPTIVE_BEGIN, y=X()(f["abr-max"]||f["max-label"]||f["max-level"]||f["cap-track"],10)||t.DEFAULT_VIDEO_SCANLINE_ADAPTIVE_MAX,m=null!==(e=f["drm-key-type"])&&void 0!==e?e:null,_=X()(f["max-bitrate"],10),E=X()(f["max-resolution"], 10),T="false"!==f["disable-hdr-track"],b=h.env||h.providerEnv||"real",S=(null===(n=h.scc)||void 0===n?void 0:n.split(","))||null,w=h.stid,A=void 0===w?null:w,R=h.scid,L=void 0===R?null:R,I=h.devt,C=void 0=== I?(0,sn._)():I,O=h.drm,P=void 0===O?null:O; delete h.drm,delete h.env,delete h.providerEnv,this._serviceId=s,this._requestVideoId=d,this._requestAuthKey=l,this._requestQueryParams=h,this._startTime=isFinite(p)?p:0,this._env=b,this._track=v,this._abrBegin= g,this._abrMax=y,this._maxBitrate=_,this._maxDimension=E,this._serviceTrackingId=A,this._serviceContentId=L,this._serviceCategoryCode=S,this._deviceType=C,this._drmType=P,this._drmKeyType=m,this._disableHdrTrack= T,h.adt||(null!==(r=h.adi)&&void 0!==r||(h.adi='[{"adSystem":"null"}]'),null!==(i=h.adu)&&void 0!==i||(h.adu="/")),h.glad&&(this._gladOpt=h.glad,delete h.glad)},t.prototype._postProcessing=function(){this._player.configurePostProcessor((0, jn.z)({enable:!0}))},t.prototype._createRequestObj=function(){var e,t,n,r=this._requestVideoId,i=this._requestAuthKey,o=this._env; if(!r)throw new Bn.Z(100,"invalid url","videoId is missing");if(!i)throw new Bn.Z(100,"invalid url","key is missing");if(!Wr(o,"VODCLOUD_API_VERSION"))throw new Bn.Z(113,"INVALID_ENV","Invalid environment"); var a=Wr(o,"VODCLOUD_PLAYBACK3_HOST"),s=w()(e="".concat(Wr(o,"VODCLOUD_PLAYBACK3_ENDPOINT"))).call(e,r),u=(0,qt.Z)(_Hr({key:i,sid:this._serviceId,devt:this._deviceType},this._requestQueryParams));return new Gn.a(w()(t= w()(n="".concat("https:","//").concat(a,"/")).call(n,s,"?")).call(t,u),{headers:{accept:"application/xml"},withCredentials:!0})},t.prototype._requestServerData=function(){return jr(this,void 0,void 0,function(){var e, t; return Gr(this,function(n){switch(n.label){case 0:return this._responseData?[2]:(e=this._createRequestObj(),this._requestingMetadata=e,[4,new (h())(function(t,n){return e.addListener({onSuccess:t,onError:n, onAbort:function onAbort(){n(new Hn("Abort"))}}),e.run()})]); case 1:return t=n.sent(),this._requestingMetadata=null,this._responseData=t,[2]}})})},t.prototype._parseMetadata=function(){return jr(this,void 0,void 0,function(){var e,t,n=this; return Gr(this,function(r){if(!(e=this._responseData))throw new Error("ServerDataNotLoaded");if(t=(0,Dt.Z)(e).MPD[0],this._rawData=e,"urn:naver:vod:2020"!==t["@xmlns:nvod"])throw console.warn("@error: unknown scheme uri : ".concat(t["@xmlns:nvod"])), new TypeError("UnknownVodSchemeUri");return this._mpd=t,this._readVideoId(t),this._readServerTime(t),this._readExpireTime(t),this._readContentDuration(t),this._readSupplementalProperty(t),this._player&& (0,ke.R)(this._player,nn.Z.ERROR).pipe((0,He.R)(this._cancel$)).subscribe(function(){n._checkExpireTime()}),[2, t]})})},t.prototype._readVideoId=function(e){this._videoId=e["@nvod:videoId"]||null},t.prototype._readServerTime=function(e){var t=e["@nvod:serverTime"]; if(this._clientStartTime=W()(),t)try{var n=new Date(t);if(isNaN(n.getTime()))return void(this._serverTime=null);this._serverTime=n}catch(e){this._serverTime=null}else this._serverTime=null},t.prototype._readExpireTime= function(e){var t=e["@nvod:expireTime"]; if(t)try{var n=new Date(t);if(isNaN(n.getTime()))return void(this._expireTime=null);if(n.getTime()0,_=this._handleInitialRadioMode(p,m)){case ri:return[2];case ni:case ii:break;default:throw new Error("Unhandled InitialRadioModeResult: ".concat(_));}var P,k;if(g&&g.length>0&&"attributes"in(b= g[0])&&b.attributes&&(b.attributes.loudnessNormalize&&(E=b.attributes.loudnessNormalize),b.attributes.dimension&&(k=(P=b.attributes).sphericalStereoscopic,T={projectionType:P.sphericalProjectionType,stereoMode:k, pitch:P.sphericalProjectionPitch,yaw:P.sphericalProjectionYaw,roll:P.sphericalProjectionRoll})),S={},g)for(w=0,A=g;w0)for(var n=0,r=this._vtsTrackings;n=t.offset}),(0,Xe.h)(function(){return!e.paused}),(0,je.P)(),(0,Ge.U)(function(){return t.url}),(0,He.R)(c)); var n=t.offset;return d.pipe((0,Xe.h)(function(e){return n<=e}),(0,Xe.h)(function(){return!e.paused}),(0,Je.b)(function(){n+=t.offset}),(0,Ge.U)(function(e){var n; return w()(n="".concat(t.url,"?vts_time\x3d")).call(n,e)}),(0,He.R)(c))}),(0,He.R)(c)).subscribe(function(t){(0,Ve.h)({url:(0,Ft.Z)(t,(0,qt.Z)({tid:e._getSession().sessionId})), method:"GET",responseType:"text",withCredentials:!0}).subscribe()})}else console.warn("@warn: No timeTable for progress tracking"); else console.warn('@warn: unknown tracking type "'.concat(a,'". this will be ignored.'))},t.prototype._observeEncryptedEvent=function(e,t,n){var r=this,i=function i(t){return new Be.y(function(n){var r= function r(e){return n.next(e)}; return e._addEventListener(t,r),function(){e._removeEventListener(t,r)}})},o=(0,ke.R)(e,"abort"),a=(0,ke.R)(e,"error"),s=(0,xe.S3)(o,a).pipe((0,je.P)()),u=i("encrypted"),l=i("loadstart"); u.pipe((0,He.R)(s),(0,et.E)(function(e){return(0,Vt.L)(new Uint8Array(e.initData))},l)).subscribe(function(i){var o=i,a=o.initData,s=o.initDataType; r._emitEncryptedEvent(e,n,a,s,t)})},t.prototype._getProtectionSystem=function(){return this._isAESEncryptedMedia?Sn.x.AES:void 0},t.prototype._emitEncryptedEvent=function(e,t,n,r,i){var o,a,s,u,l,c,d=e.videoTracks[e.videoTracks.selectedIndex], h=null===(a=this._representationContentProtectionMap)||void 0===a?void 0:a[d.id]; if(null==h?void 0:h.length){var f=_t[t],p=ie()(h).call(h,function(e){var t=e["@schemeIdUri"],n=e["@value"];return!(!f||t!==f)||"urn:naver:vod:drm:2020"===t&&"nvod-drm1.0"===n}); if(p[0]){var v=p[0],g=null===(u=null===(s=v["dashif:laurl"])||void 0===s?void 0:s[0])||void 0===u?void 0:u["#text"],y=null===(c=null===(l=v["nvod:certurl"])||void 0===l?void 0:l[0])||void 0===c?void 0: c["#text"],m={version:2,drmType:t,initData:n,initDataType:r};(g||y)&&(m.licenseRequestInfo=((o={})[t]={licenseUrl:g,certificateUrl:y},o)),e.dispatchEvent(new Mt.$({initDataType:i,initData:(new it.$).encode(m)}))}}else console.debug("No ContentProtection Element for current representation(".concat(d.id, ")"))},t.prototype._onBeforeLoading=function(){return jr(this,void 0,void 0,function(){var e,t; return Gr(this,function(n){var r;switch(n.label){case 0:if(Ce().mark(this,"mediaProvider.request.start",{api:"playApi"}),this._cancel$.next(),!this._drmType)return[3,7];switch(!0){case "aegis"===this._drmType:case Boolean(this._drmType=== ot.OA):return[3,1];case Boolean(this._drmType===ot.U9):return[3,3];case Boolean(he()(r=M()(rt.Q)).call(r,this._drmType)>-1):return[3,5]}return[3,6];case 1:return[4,(0,Wn.Z)()];case 2:return(e=n.sent())? (t=(0,at.I)(e),this._drmKeySystem=t,this._drmKeyType||(this._drmKeyType=ot.OA),[3,6]):[3,6];case 3:return[4,(0,Wn.Z)()];case 4:return(e=n.sent())?(t=(0,at.I)(e),this._drmKeySystem=t,this._drmKeyType||(this._drmKeyType= ot.U9),[3,6]):[3,6];case 5:return this._drmKeySystem=this._drmType,this._drmKeyType||(this._drmKeyType=ot.OA),[3,6];case 6:if(!this._drmKeySystem)throw new Error("No available key system access");this._requestQueryParams= _Hr(_Hr({},this._requestQueryParams),{drm:this._drmKeySystem}),n.label=7;case 7:return[2]}})})},t.prototype._followCustomXLink=function(e,t){var n; return jr(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c,d,h,f,p,v,g,y,m,_,E,T,b,S,A=this;return Gr(this,function(R){var L,C,O,P,k,D,x,N,M;switch(R.label){case 0:return[4,(0,Ve.h)({url:t,responseType:"text"}).toPromise()]; case 1:return r=R.sent(),i=r.xhr.getResponseHeader("content-type"),o="","application/dash+xml"===i?o="mpd":"application/vnd.apple.mpegurl"===i?o="m3u8":he()(L=r.response).call(L,mt)>-1?o="mpd":he()(C=r.response).call(C, "#EXTM3U")>-1&&(o="m3u8"),o?(a=[],s=new (pe()),u=0,l=0,d=function d(){if(c=isFinite(A._abrMax)?ie()(a).call(a,function(e){return dr(e)<=A._abrMax}):zr([],a,!0),isFinite(A._abrBegin)){var e=(0,Ht.C)(I()(c).call(c, dr),A._abrBegin,zn); if(e>-1){var t=ge()(c).call(c,e,1);t&&t[0]&&(c.unshift(t[0]),u=t[0].width,l=t[0].height)}}},"mpd"!==o?[3, 2]:(h=I()(O=[_t.PlayReady,_t.Widevine]).call(O,function(e){return{"@value":"cenc","@schemeIdUri":e}}),f=new xt.Z(t,r.response),p=f.getRepresentations(),v=ie()(p).call(p,function(e){var t,n,r=null===(t= e.codec)||void 0===t?void 0:t.substring(0,4); return!(!r||!Nt.K.video[r])||"video"===e.contentType||0===(null===(n=e.mimeType)||void 0===n?void 0:he()(n).call(n,"video"))}),g=ie()(p).call(p,function(e){var t,n,r=null===(t=e.codec)||void 0===t?void 0: t.substring(0,4); return!(!r||!Nt.K.audio[r])||"audio"===e.contentType||0===(null===(n=e.mimeType)||void 0===n?void 0:he()(n).call(n,"audio"))}),v.length>0&&s.add("video"),g.length&&s.add("audio"),ue()(v).call(v,function(e){var n, r=e.width,i=e.height,o="".concat((0,Fn.Z)(r,i),"p"); a.push({id:e.id,abr:!1,baseUrl:w()(n="".concat(t,"#track\x3d")).call(n,e.id),frameRate:"".concat(e.frameRate),bandwidth:e.bandwidth,attributes:[],isDefault:!1,contentProtections:h,width:r,height:i,qualityLabel:o, components:me()(s)})}),d(),this._drmTracks=w()(P=this._drmTracks||[]).call(P,{id:"abr", abr:!0,baseUrl:w()(k=w()(D="".concat(t,"#level_start\x3d")).call(D,this._abrBegin,"\x26level_cap\x3d")).call(k,this._abrMax),attributes:[],isDefault:!1,contentProtections:h,width:u,height:l,qualityLabel:"ABR", components:me()(s)},a),[3,5])):[2];case 2:return"m3u8"!==o?[3,4]:(y={"@schemeIdUri":_t.FairPlay,"@value":"skd"},m=new (pe()),_=function _(t,n){e._getSourceCaches().put(t,n)},E=function E(e,n,r){var i,o= r.width,u=r.height,l="".concat((0,Fn.Z)(o,u),"p"),c=["video"]; s.add("video"),J()(n).call(n,function(e){return e.audioCodec})&&(c.push("audio"),s.add("audio")),a.push({id:e, abr:!1,baseUrl:w()(i="".concat(t,"#track\x3d")).call(i,e),frameRate:"".concat(r.frameRate),bandwidth:Zn(n,"bandwidth"),attributes:[],isDefault:!1,contentProtections:[y],width:o,height:u,qualityLabel:l, components:c})},T=function T(e){m.add(e.value.uri)},[4, (new In.r({onWriteManifest:_,onFoundTrackGroup:E,onFoundSessionKeyTag:T})).read(r.response,t)]);case 3:var U;return R.sent(),d(),b=!0,m.size<2&&(0,Kt.Z)()&&("iOS"===(0,Bt.os)()&&X()("".concat((0,Bt.MM)()), 10)<18&&(b=!1),"Mac OS"===(0,Bt.os)()&&(void 0===(S=I()(U=(null===(n=(0,Bt.x_)())||void 0===n?void 0:n.split("."))||[]).call(U,function(e){return X()(e,10)})[0])?0:S)<18&&(b=!1)),this._hlsTracks=w()(x= this._hlsTracks||[]).call(x,b?[{id:"abr", abr:!0,baseUrl:w()(N=w()(M="".concat(t,"#level_start\x3d")).call(M,this._abrBegin,"\x26level_cap\x3d")).call(N,this._abrMax),attributes:[],isDefault:!0,contentProtections:[y],qualityLabel:"Auto",width:u, height:l,components:me()(s)}]:[],a),[3,5];case 4:console.warn("ignored unknown file format: ".concat(t)),R.label=5;case 5:return[2]}})})},t.prototype._buildTracksFromNmcMaster=function(e,n,r,i){return void 0=== i&&(i={}),jr(this,void 0,void 0,function(){var o,a,s,u,l,c,d,h,f,p,v,g,y=this; return Gr(this,function(m){var _,E,T;switch(m.label){case 0:if(o=r)return[3,4];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,(0,Ve.h)({url:n,responseType:"text"}).pipe((0,He.R)(this._cancel$),(0,tt.V)(t.HLS_MASTER_FETCH_TIMEOUT_MS)).toPromise()]; case 2:if(void 0===(a=m.sent()))throw new Hn("Abort");return o=a.response,[3,4];case 3:if((s=m.sent())instanceof Hn)throw s;return(0,Ot.jd)("vod_nmc_master_fetch_failed","Failed to fetch NMC HLS master.m3u8: ".concat(String(s)), {videoId:this._videoId,uri:this._uri,masterUrl:n}),[2];case 4:if(!o)return[2];u=[],l=new (pe()),c=!1,d=new In.r({onWriteManifest:function onWriteManifest(t,n){e._getSourceCaches().put(t,n)}, onFoundTrackGroup:function onFoundTrackGroup(e,t,r){var o,a,s,d=r.width,h=r.height,f=null===(a=x()(t).call(t,function(e){return e.videoCodec}))||void 0===a?void 0:a.videoCodec,p=null===(s=x()(t).call(t, function(e){return e.audioCodec}))||void 0===s?void 0:s.audioCodec,v=[],g=[]; f&&(v.push("video"),l.add("video"),g.push(f)),p&&(v.push("audio"),l.add("audio"),g.push(p)),0===v.length&&isFinite(d)&&d>0&&(v.push("video"),l.add("video"));var y=J()(t).call(t,function(e){return null!= e.audioGroup}); y&&(c=!0),u.push({protocol:"hls",attributes:_Hr({demuxed:y},i),id:e,abr:!1,baseUrl:w()(o="".concat(n,"#track\x3d")).call(o,e),frameRate:"".concat(r.frameRate),bandwidth:Zn(t,"bandwidth"),codecs:g,isDefault:!1, width:d,height:h,qualityLabel:"".concat((0,Fn.Z)(d,h),"p"),components:v})}}),m.label=5; case 5:return m.trys.push([5,7,,8]),[4,d.read(o,n)];case 6:return m.sent(),[3,8];case 7:return h=m.sent(),(0,Ot.jd)("vod_nmc_master_parse_failed","Failed to parse NMC HLS master.m3u8: ".concat(String(h)), {videoId:this._videoId,uri:this._uri,masterUrl:n}),[2];case 8:return 0===u.length||(f=isFinite(this._abrMax)?ie()(u).call(u,function(e){return dr(e)<=y._abrMax}):u,p=f.length>0?f:u,v=isFinite(this._abrBegin)? (0,Ht.C)(I()(p).call(p,dr),this._abrBegin,zn):-1,g=v>-1?p[v]:p[0],this._hlsTracks=w()(_=this._hlsTracks||[]).call(_,{protocol:"hls", attributes:_Hr({demuxed:c},i),id:"abr",abr:!0,baseUrl:w()(E=w()(T="".concat(n,"#level_start\x3d")).call(T,this._abrBegin,"\x26level_cap\x3d")).call(E,this._abrMax),isDefault:!1,qualityLabel:"Auto",width:g.width, height:g.height,components:me()(l)},u)),[2]}})})},t.prototype._buildIndividualHlsFromSourceless=function(e){var t,n,r,i; return jr(this,void 0,void 0,function(){var o,a,s,u,l,c,d,h,f,p;return Gr(this,function(v){var g,y,m;switch(v.label){case 0:return(o=null===(r=null===(n=null===(t=this._mpd)||void 0===t?void 0:t.Period)|| void 0===n?void 0:n[0])||void 0===r?void 0:r.AdaptationSet)?(a=ie()(o).call(o,function(e){return"video/mp4"===e["@mimeType"]&&pr(e)}),s=ie()(g=Ee()(y=ie()(o).call(o,function(e){return"audio/mp4"===e["@mimeType"]&& pr(e)})).call(y,function(e){var t; return null!==(t=e.Representation)&&void 0!==t?t:[]})).call(g,function(e){return e["@nvod:m3u"]}),0===a.length?[2]:(u=function(e){var t=I()(e).call(e,function(e,t){return t}),n=function n(e){for(var n= e;t[n]!==n;)t[n]=t[t[n]],n=t[n]; return n},r=new (j()); ue()(e).call(e,function(e,t){null!=e["@id"]&&r.set(String(e["@id"]),t)}),ue()(e).call(e,function(e,i){var o; ue()(o=function(e){var t,n,r,i,o=null===(i=null===(r=e.SupplementalProperty)||void 0===r?void 0:x()(r).call(r,function(e){return"urn:mpeg:dash:adaptation-set-switching:2016"===e["@schemeIdUri"]}))||void 0=== i?void 0:i["@value"]; return o?ie()(t=I()(n=String(o).split(",")).call(n,function(e){return O()(e).call(e)})).call(t,Boolean):[]}(e)).call(o,function(e){var o,a=r.get(e); void 0!==a&&(o=a,t[n(i)]=n(o))})}); var i=new (j());return ue()(e).call(e,function(e,t){var r=n(t),o=i.get(r);o?o.push(e):i.set(r,[e])}),me()(Xn()(i).call(i))}(a),l=null!==(i=x()(u).call(u,function(e){return be()(e).call(e,a[0])}))&&void 0!== i?i:a,u.length>1&&(0,Ot.jd)("vod_nmc_multiple_sourceless_video_groups","Excluded ".concat(u.length-1," non-switchable sourceless video group(s); kept primary"),{videoId:this._videoId, uri:this._uri,groupCount:u.length}),c=ie()(m=Ee()(l).call(l,function(e){var t;return null!==(t=e.Representation)&&void 0!==t?t:[]})).call(m,function(e){return e["@nvod:m3u"]}),0===c.length?[2]:(d=Tr(c, s),h=d.body,f=d.masterUrl,(p=d.estimatedBandwidthVariants).length>0&&(0,Ot.jd)("vod_nmc_synthesized_bandwidth_estimated",w()(_="Estimated BANDWIDTH for ".concat(p.length," synthesized HLS variant(s) missing @bandwidth: ")).call(_, p.join(", ")),{videoId:this._videoId, uri:this._uri}),[4,this._buildTracksFromNmcMaster(e,f,h,this._nmcMasterRoleAttributes(l))]))):[2];var _;case 1:return v.sent(),[2]}})})},t.prototype._onBeforeGeneratingTracks=function(e){var t,n,r,i; return jr(this,void 0,void 0,function(){var o,a;return Gr(this,function(s){switch(s.label){case 0:return(o=null===(n=null===(t=this._mpd)||void 0===t?void 0:t.Period)||void 0===n?void 0:n[0])?(a=function(e){var t= null==e?void 0:e.SupplementalProperty;if(!t)return null;for(var n=0,r=t;n0)return o}}return null}(o),a&&e?[4, this._buildTracksFromNmcMaster(e,a,void 0,this._nmcMasterRoleAttributes(o.AdaptationSet))]:[3,2]):[2];case 1:s.sent(),s.label=2;case 2:return!o.AdaptationSet&&(null===(r=this._hlsTracks)||void 0===r?void 0: r.length)?[3,4]:[4,this._processDrmAndCapabilities(e)];case 3:s.sent(),s.label=4;case 4:return(null===(i=this._hlsTracks)||void 0===i?void 0:i.length)||!e?[3,6]:[4,this._buildIndividualHlsFromSourceless(e)]; case 5:s.sent(),s.label=6;case 6:return this._mpd=function(e){var t,n,r,i,o=null===(i=null==e?void 0:e.Period)||void 0===i?void 0:i[0];if(!(null==o?void 0:o.AdaptationSet))return e;var a=I()(t=ie()(n=o.AdaptationSet).call(n, function(e){return!(pr(e)&&"video/mp4"===e["@mimeType"])})).call(t,function(e){if(pr(e)&&"audio/mp4"===e["@mimeType"]&&e["@subsegmentAlignment"]){var t=_vr({},e); return delete t["@subsegmentAlignment"],t}return e}),s=e; return _vr(_vr({},s),{Period:gr([_vr(_vr({},o),{AdaptationSet:a})],b()(r=s.Period||[]).call(r,1),!0)})}(this._mpd),[2]}})})},t.prototype._processDrmAndCapabilities=function(e){var t,n,r,i; return jr(this,void 0,void 0,function(){var o,a,s,u,l,c,d,h,f,p;return Gr(this,function(v){switch(v.label){case 0:return(o=null===(i=null===(r=this._mpd)||void 0===r?void 0:r.Period)||void 0===i?void 0: i[0])?this._drmKeyType!==ot.OA?[3,3]:o["@xlink:href"]?[4,this._followCustomXLink(e,o["@xlink:href"])]:[3,2]:[2];case 1:return v.sent(),[2];case 2:if("aegis"!==this._drmType)throw new Bn.Z(62277026291,"No media source for Aegis DRM"); this._drmKeyType=ot.U9,v.label=3;case 3:if(this._drmKeyType===ot.U9&&!o.AdaptationSet)throw new Bn.Z(62277026291,"No AdaptationSet for Aegis DRM");if(!o.AdaptationSet)throw new Bn.Z(62277026291,"No AdaptationSet"); a=(0,jt.V)(o.AdaptationSet,function(e){var t;return(null===(t=null==e?void 0:e.Representation)||void 0===t?void 0:I()(t).call(t,function(t){return _Hr(_Hr({},t),{adaptationSet:e})}))||[]}),s=new (j()), v.label=4; case 4:v.trys.push([4,11,12,17]),u=Kr(a),v.label=5;case 5:return[4,u.next()];case 6:return(l=v.sent()).done?[3,10]:(c=l.value,d=c["@codecs"],h=c["@mimeType"],d||(d=c.adaptationSet["@codecs"]),h||(h=c.adaptationSet["@mimeType"]), "video/mp2t"===h&&Boolean(c.SegmentList||c.SegmentTemplate||c.SegmentBase||c["@nvod:m3u"])&&(h="video/mp4"),h||(console.warn("No mimeType"),h="video/mp4"),d?(f=function(e,t){var n=Jr(e,t,St.i.SUPPLEMENTAL_CODECS); if(n)return e[n]}(c,this._mpd),[4, this._updateDecodingInfoCache(s,c,h,d)]):[3,9]);case 7:return v.sent(),f?[4,this._updateDecodingInfoCache(s,c,h,f)]:[3,9];case 8:v.sent(),v.label=9;case 9:return[3,5];case 10:return[3,17];case 11:return p= v.sent(),t={error:p},[3,17];case 12:return v.trys.push([12,,15,16]),l&&!l.done&&(n=u["return"])?[4,n.call(u)]:[3,14];case 13:v.sent(),v.label=14;case 14:return[3,16];case 15:if(t)throw t.error;return[7]; case 16:return[7];case 17:return this._mediaCapabilitesDecodingInfos=s,[2]}})})},t.prototype._updateDecodingInfoCache=function(e,t,n,r){return jr(this,void 0,void 0,function(){var i,o,a,s,u,l,c,d,h,f=this; return Gr(this,function(p){var v,g;switch(p.label){case 0:if(i=k()(r).call(r,"dvhe.")?r.replace(/^dvhe/,"dvh1"):r,o=Zr(i),a=w()(v="".concat(n,'; codecs\x3d"')).call(v,o,'"'),e.get(a))return[2];l=I()(g= i.split(",")).call(g,function(e){return O()(e).call(e)}),ue()(l).call(l,function(e){var r; switch(nr(e)){case "video":var i,o=void 0;s||(s={}),s.contentType=w()(i="".concat(n,'; codecs\x3d"')).call(i,e,'"'),k()(e).call(e,"dvh1")&&(o=null!==(r=function(e,t){var n,r,i=null!==(r=null!==(n=ei(e))&& void 0!==n?n:ei(e.adaptationSet))&&void 0!==r?r:function(e,t){var n=Jr(e,t,St.i.SUPPLEMENTAL_PROFILES),r=n?e[n]:void 0;if("string"==typeof r)for(var i=0,o=r.split(/[\s,]+/);i400)return void(this._error=new Bn.Z(103,"error response"))}if(e instanceof Hn)throw e;this._error=new Bn.Z(62277026291,"unknown error")}},t.prototype._parseHlsTracks= function(e,t,n,r){var i,o,a,s,u,l,d,h,f,p,v,g,y; return jr(this,void 0,void 0,function(){var n,r,m,_,E,T,b,S,A,R,L,C,O,P,D,N,M,U,F,B,V,H,j,G,K,z,W,q,Z,Y,X,Q,J,$,ee,te,ne,re,oe,ae,se,ue,le,ce,de,he,fe,pe,ve,ye,me,_e,Ee,Te,Se,we,Ae,Re,Le,Ie,Ce,Oe=this; return Gr(this,function(Pe){var ke,De,xe,Ne,Me,Ue,Fe;switch(Pe.label){case 0:if(Kn("video/mp2t"===t["@mimeType"]),(0,Kt.Z)()&&this._contentDuration<.25)return[2,[]];if(!t.Representation)return[2,[]];n= [],r=[],m=[],_=e._getSourceCaches(),E={},t.Role&&c()(E,this._parseAdaptationRoles(t.Role)),Pe.label=1;case 1:Pe.trys.push([1,9,10,15]),T=Kr(t.Representation),Pe.label=2;case 2:return[4,T.next()];case 3:return(b= Pe.sent()).done?[3,8]:(S=b.value,A=S["@codecs"]||t["@codecs"],k()(A).call(A,"dvhe")&&(A="hvc1"),R='video/mp4; codecs\x3d"'.concat(Zr(A),'"'),(L=this._mediaCapabilitesDecodingInfos.get(R))&&L.supported? (C=null,S.SegmentTemplate?[4,this._generateHlsPlaylist(_,S)]:[3,5]):[3,7]);case 4:return C=Pe.sent(),[3,6];case 5:S["@nvod:m3u"]?C=S["@nvod:m3u"]:console.warn("Representation element does not contain HLS playlist info"), Pe.label=6;case 6:if(!C)return[3,7];if(O={},P=S["nvod:Label"])for(D=0,N=P;D0))return[3,17];for(Z=0,Y=0,X= void 0,X=isFinite(this._abrMax)?ie()(n).call(n,function(e){return dr(e)<=Oe._abrMax}):zr([],n,!0),isFinite(this._abrBegin)&&(Q=(0,Ht.C)(I()(X).call(X,dr),this._abrBegin,zn))>-1&&(J=ge()(X).call(X,Q,1))&& J[0]&&(X.unshift(J[0]),Z=J[0].width,Y=J[0].height),W=0,q=X;W0))return[3,19];for(Z=0,Y=0,X=void 0,X=isFinite(this._abrMax)?ie()(r).call(r,function(e){return dr(e)<=Oe._abrMax}):zr([],r,!0),isFinite(this._abrBegin)&&(Q=(0, Ht.C)(I()(X).call(X,dr),this._abrBegin,zn))>-1&&(J=ge()(X).call(X,Q,1))&&J[0]&&(X.unshift(J[0]),Z=J[0].width,Y=J[0].height),$=0,ee=X;$0))return[3,21];for(te=0,ne=m;te0&&m.length>0))return[3,46]; Pe.label=22;case 22:Pe.trys.push([22,39,40,45]),le=Kr(m),Pe.label=23;case 23:return[4,le.next()];case 24:if((ce=Pe.sent()).done)return[3,38];Se=ce.value,Pe.label=25;case 25:Pe.trys.push([25,31,32,37]), u=void 0,de=Kr(r),Pe.label=26;case 26:return[4,de.next()];case 27:return(he=Pe.sent()).done?[3,30]:(me=he.value,we=w()(Fe="".concat(me.id,"/")).call(Fe,Se.id),Ae=new st.ZP,Re="vod3://".concat(we,"/index.m3u8"), Ae.version=3,Ae.push(this._createHlsMediaForAudio(Se)),Ae.push(this._createDemuxedStreamInf(me,Se)),[4,_.put(Re,Ae.buildToString())]);case 28:Pe.sent(),Le=me.bandwidth||0+(Se.bandwidth||0)||NaN,Ie=_Hr(_Hr({}, me),{abr:!1,id:we,baseUrl:Re,bandwidth:Le,attributes:_Hr(_Hr({},Se.attributes),me.attributes),codecs:zr(zr([],me.codecs,!0),Se.codecs,!0),kind:"hls"}),n.push(Ie),Pe.label=29;case 29:return[3,26];case 30:return[3, 37];case 31:return fe=Pe.sent(),u={error:fe},[3,37];case 32:return Pe.trys.push([32,,35,36]),he&&!he.done&&(l=de["return"])?[4,l.call(de)]:[3,34];case 33:Pe.sent(),Pe.label=34;case 34:return[3,36];case 35:if(u)throw u.error; return[7];case 36:return[7];case 37:return[3,23];case 38:return[3,45];case 39:return pe=Pe.sent(),a={error:pe},[3,45];case 40:return Pe.trys.push([40,,43,44]),ce&&!ce.done&&(s=le["return"])?[4,s.call(le)]: [3,42];case 41:Pe.sent(),Pe.label=42;case 42:return[3,44];case 43:if(a)throw a.error;return[7];case 44:return[7];case 45:return[3,73];case 46:if(!(r.length>0))return[3,60];Pe.label=47;case 47:Pe.trys.push([47, 53,54,59]),ve=Kr(r),Pe.label=48;case 48:return[4,ve.next()];case 49:return(ye=Pe.sent()).done?[3,52]:(me=ye.value,we="".concat(me.id,"/anullsrc"),Ae=new st.ZP,Re="vod3://".concat(we,"/index.m3u8"),Ae.version= 3,Ae.push(this._createStreamInf(me)),[4,_.put(Re,Ae.buildToString())]);case 50:Pe.sent(),Le=me.bandwidth||NaN,Ie=_Hr(_Hr({},me),{abr:!1,id:we,baseUrl:Re,bandwidth:Le,attributes:_Hr({},me.attributes),codecs:zr([], me.codecs,!0),kind:"hls"}),n.push(Ie),Pe.label=51;case 51:return[3,48];case 52:return[3,59];case 53:return _e=Pe.sent(),d={error:_e},[3,59];case 54:return Pe.trys.push([54,,57,58]),ye&&!ye.done&&(h=ve["return"])? [4,h.call(ve)]:[3,56];case 55:Pe.sent(),Pe.label=56;case 56:return[3,58];case 57:if(d)throw d.error;return[7];case 58:return[7];case 59:return[3,73];case 60:if(!(m.length>0))return[3,73];Pe.label=61;case 61:Pe.trys.push([61, 67,68,73]),Ee=Kr(m),Pe.label=62;case 62:return[4,Ee.next()];case 63:return(Te=Pe.sent()).done?[3,66]:(Se=Te.value,we="".concat(Se.id,"/vnullsrc"),Ae=new st.ZP,Re="vod3://".concat(we,"/index.m3u8"),Ae.version= 3,Ae.push(this._createStreamInf(Se)),[4,_.put(Re,Ae.buildToString())]);case 64:Pe.sent(),Le=Se.bandwidth||NaN,Ie=_Hr(_Hr({},Se),{abr:!1,id:we,baseUrl:Re,bandwidth:Le,attributes:_Hr({},Se.attributes),codecs:zr([], Se.codecs,!0),protocol:"hls"}),n.push(Ie),Pe.label=65;case 65:return[3,62];case 66:return[3,73];case 67:return Ce=Pe.sent(),f={error:Ce},[3,73];case 68:return Pe.trys.push([68,,71,72]),Te&&!Te.done&&(p= Ee["return"])?[4,p.call(Ee)]:[3,70];case 69:Pe.sent(),Pe.label=70;case 70:return[3,72];case 71:if(f)throw f.error;return[7];case 72:return[7];case 73:return[2,n]}})})},t.prototype._parseAudioRepresentation= function(e,t){var n; return jr(this,void 0,void 0,function(){var r,i,o,a,s,u,l,d,f,p,v,g,y;return Gr(this,function(m){switch(m.label){case 0:if(r=null!==(n=t.Representation)&&void 0!==n?n:[],i=ie()(r).call(r,function(e){return Boolean(e["@nvod:m3u"])}), 0===i.length)return[2, []];for(o=e._getSourceCaches(),a={},t.Role&&c()(a,this._parseAdaptationRoles(t.Role)),s=function s(e){var t=new ht.f;return t.value={attrs:[new ut.Z("BANDWIDTH","".concat(e["@bandwidth"]||0))],uri:e["@nvod:m3u"]}, e["@codecs"]&&t.value.attrs.push(new ut.Z("CODECS",'"'.concat(e["@codecs"],'"'))),t},u=I()(i).call(i,function(e){var t=e["@id"]||(0,nt.v4)(),n=new st.ZP; n.push(s(e));var r="vod3://audio-".concat(t,"/index.m3u8"),i=e["@codecs"],o={id:"HLS_AUDIO_".concat(t),attributes:_Hr({},a),baseUrl:r,abr:!1,isDefault:!1,qualityLabel:"",protocol:"hls",role:"alternative", codecs:i?i.split(","):void 0,components:["audio"],groupId:"",width:0,height:0,bandwidth:e["@bandwidth"]};return{url:r,body:n.buildToString(),trackInfo:o}}),l=new st.ZP,d=0,f=i;d=0&&(T=E+1),!we()(T)||T<=0)throw new Error("InvalidSegmentDuration"); for(b=0;b1&&(this._contentDuration=v)}return r.push(new lt.s),A=r.buildToString(),R=t["@nvod:m3u"]?t["@nvod:m3u"]:w()(C="vod3://".concat(this._videoId, "/")).call(C,t["@id"],"/playlist.m3u8"),[4,e.put(R,A)];case 1:return L.sent(),[2,R]}})})},t.prototype._createStreamInf=function(e){var t,n=new ht.f; return n.value={attrs:[new ut.Z("RESOLUTION",w()(t="".concat(e.width,"x")).call(t,e.height)),new ut.Z("BANDWIDTH","".concat(e.bandwidth))],uri:e.baseUrl},e.codecs&&e.codecs.length>0&&n.value.attrs.push(new ut.Z("CODECS", '"'.concat(e.codecs.join(","),'"'))),n},t.prototype._createDemuxedStreamInf=function(e,t){var n,r,i=new ht.f,o=(e.bandwidth||0)+(t.bandwidth||0); return i.value={attrs:[],uri:e.baseUrl},o>0&&i.value.attrs.push(new ut.Z("BANDWIDTH","".concat(o))),e.width&&e.height&&i.value.attrs.push(new ut.Z("RESOLUTION",w()(r="".concat(e.width,"x")).call(r,e.height))), i.value.attrs.push(new ut.Z("CODECS",w()(n='"'.concat(e.codecs,",")).call(n,t.codecs,'"'))),i.value.attrs.push(new ut.Z("AUDIO",'"audio"')),i},t.prototype._createHlsMediaForVideo=function(e){var t=new dt.r; return t.value={attrs:[new ut.Z("TYPE",'"VIDEO"'),new ut.Z("GROUP-ID",'"video"'),new ut.Z("NAME",'"'.concat(e.id,'"')),new ut.Z("AUTOSELECT","YES"),new ut.Z("DEFAULT","NO"),new ut.Z("URI",'"'.concat(e.baseUrl, '"'))]},t},t.prototype._createHlsMediaForAudio=function(e){var t,n=new dt.r; return n.value={attrs:[new ut.Z("TYPE",'"AUDIO"'),new ut.Z("GROUP-ID",'"audio"'),new ut.Z("NAME",'"'.concat(e.id,'"')),new ut.Z("AUTOSELECT","YES"),new ut.Z("DEFAULT","NO"),new ut.Z("URI",'"'.concat(e.baseUrl, '"'))]},(null===(t=e.attributes)||void 0===t?void 0:t.audioChannels)&&n.value.attrs.push(new ut.Z("CHANNELS",'"'.concat(e.attributes.audioChannels,'"'))),n},t.prototype._nmcMasterRoleAttributes=function(e){var t= null==e?void 0:x()(e).call(e,function(e){return"video/mp4"===e["@mimeType"]&&e.Role}); return(null==t?void 0:t.Role)?this._parseAdaptationRoles(t.Role):{}},t.prototype._parseAdaptationRoles=function(e){var t=this,n={}; return ue()(e).call(e,function(e){switch(e["@schemeIdUri"]){case "urn:naver:vod:loudnessnormalize:2019-0":n.loudnessNormalize=t._readLoudnessNormalizeParameterSet(e["nvod:LoudnessNormalize"][0]);break; case "urn:naver:vod:video:spherical:dimension:2019":n.dimension=e["@value"];break;case "urn:naver:vod:video:spherical:stereoscopic:2019":n.sphericalStereoscopic=e["@value"];break;case "urn:naver:vod:video:spherical:projection:type:2019":n.sphericalProjectionType= e["@value"];break;case "urn:naver:vod:video:spherical:projection:header:pitch:2019":n.sphericalProjectionPitch=e["@value"]?Z()(e["@value"]):0;break;case "urn:naver:vod:video:spherical:projection:header:yaw:2019":n.sphericalProjectionYaw= e["@value"]?Z()(e["@value"]):0;break;case "urn:naver:vod:video:spherical:projection:header:roll:2019":n.sphericalProjectionRol=e["@value"]?Z()(e["@value"]):0;break;default:console.warn("@warn: unknown role: ".concat(e["@schemeIdUri"]))}}), n},t.prototype._setMediaKeys=function(e,t,n,r,i,o){return jr(this,void 0,void 0,function(){var a,s; return Gr(this,function(u){switch(u.label){case 0:return[4,Pt.o.requestMediaKeySystemAccess(t,[{initDataTypes:[n],videoCapabilities:[{contentType:r}]}])];case 1:return[4,u.sent().createMediaKeys()];case 2:return a= u.sent(),[4,e.setMediaKeys(a)];case 3:return u.sent(),(s=a.createSession(i)).onmessage=function(){s.update((new TextEncoder).encode(ne()({kid:o,keys:[]})))},[4, s.generateRequest(n,(new TextEncoder).encode(ne()({kid:o,type:"static"})))];case 4:return u.sent(),[2]}})})},t.prototype._parsePdTracks=function(e){return jr(this,void 0,void 0,function(){var t,n,r=this; return Gr(this,function(i){var o;return Kn("video/mp4"===e["@mimeType"]),e.Representation?(t={},e.Role&&c()(t,this._parseAdaptationRoles(e.Role)),n=[],ue()(o=e.Representation).call(o,function(i){var o, a,s,u,l=i["@id"],c=i["@bandwidth"],d=i["@frameRate"],h=i["@width"],f=i["@height"],p=i["@mimeType"],v=i.BaseURL,g=i["nvod:Label"];if(null===(u=null==v?void 0:v[0])||void 0===u?void 0:u["#text"]){var y=i["@codecs"]|| e["@codecs"];k()(y).call(y,"dvhe")&&(y="hvc1");var m=w()(o="".concat(p||e["@mimeType"],'; codecs\x3d"')).call(o,Zr(y),'"'),_=r._mediaCapabilitesDecodingInfos.get(m);if(null==_?void 0:_.supported){var E, T={};if(g)for(var b=0,S=g;b-1?L="hls":he()(v).call(v,".mpd")>-1&&(L="dash"), R=T.resolution?isFinite(T.resolution)?"".concat(T.resolution,"p"):T.resolution:"".concat((0,Fn.Z)(i["@width"],i["@height"]),"p"),n.push({id:c,bandwidth:d,frameRate:h,width:f,height:p,abr:!1,attributes:_Hr(_Hr({}, t),T),codecs:m.split(","),baseUrl:v,isDefault:!1,contentProtections:i.ContentProtection,qualityLabel:R,protocol:L,components:ie()(u=I()(l=m.split(",")).call(l,qn)).call(u,Boolean)})}}}),[2, n]):[2,[]]})})},t.prototype._parseDashTracks=function(e){var t,n,r,i,o,a; return jr(this,void 0,void 0,function(){var s,u,l,c,d,h,f,p,v,g,y,m,_,E,T,b,S,A,R,L,I,C,O,P,k,D,x;return Gr(this,function(N){var M,U;switch(N.label){case 0:return(0,Kt.Z)()&&this._contentDuration<.25?[2, []]:(s=[],u=e._getSourceCaches(),l={},c=this._getClearMPD(),d=c[0],h=c[1],f=ie()(h).call(h,function(e){var t;return!!function(e){return e.getElementsByTagName("SegmentList").length>0||e.getElementsByTagName("SegmentBase").length> 0||e.getElementsByTagName("SegmentTemplate").length>0}(e)||(null===(t=e.parentNode)||void 0===t||t.removeChild(e),!1)}),p=(0,Gt.Z)(f,function(e){switch(e.getAttribute("mimeType")||e.getAttribute("contentType")){case "video":case "video/mp4":return"video"; case "audio":case "audio/mp4":return"audio";default:return"unknown"}}),v=p.video,g=void 0===v?[]:v,y=p.audio,m=void 0===y?[]:y,_=[],g.length>0&&_.push("video"),m.length>0&&_.push("audio"),E=this._applyDashConstraints(f), ue()(f).call(f,function(e,t){e.hasAttribute("id")||e.setAttribute("id","".concat(t))}),(0,jt.V)(g,function(e){return me()(e.getElementsByTagName("Representation"))}).length>0?(T=w()(M=w()(U="vod3://".concat(this._videoId, "/stream.mpd#level_start\x3d")).call(U,this._abrBegin,"\x26level_cap\x3d")).call(M,this._abrMax),b=(new XMLSerializer).serializeToString(d),S={id:"DASH_".concat(this._videoId,"_"), attributes:_Hr({},l),baseUrl:T,abr:!0,width:-1,height:-1,isDefault:!1,qualityLabel:"Auto",protocol:"dash",components:zr([],_,!0)},s.push(S),[4,u.put(T,b)]):[3,2]);case 1:N.sent(),N.label=2;case 2:ue()(E).call(E, function(e,t){ue()(e).call(e,function(e){t.appendChild(e)})}),ue()(f).call(f,function(e){e.parentNode.removeChild(e)}),A=d.getElementsByTagName("Period")[0],N.label=3; case 3:N.trys.push([3,9,10,15]),R=function R(){var e,t,n,o,a,l;return Gr(this,function(c){switch(c.label){case 0:e=I.value,t=me()(e.getElementsByTagName("Representation")),ue()(t).call(t,function(t){e.removeChild(t)}), c.label=1; case 1:c.trys.push([1,7,8,13]),n=function n(){var t,n,r,i,o,l,c,h,f,p,v,g,y,E,T,b;return Gr(this,function(S){var R,L,I,C,O,P,k,D;switch(S.label){case 0:return t=a.value,ue()(m).call(m,function(e){A.appendChild(e)}), e.appendChild(t),A.appendChild(e),n=(new XMLSerializer).serializeToString(d),r=_Hr(_Hr({},lr(t)),(k={},D=t.getElementsByTagName("EssentialProperty"),ue()(P=me()(D)).call(P,function(e){var t,n=e.getAttribute("schemeIdUri"), r=null!==(t=e.getAttribute("value"))&&void 0!==t?t:""; n&&r&&(k[n]=r)}),k)),i=new Rr(function(e){var t,n,r,i,o=null!==(i=e.lookupPrefix(St.V))&&void 0!==i?i:void 0,a=Pr(e,o&&w()(t="".concat(o,":")).call(t,St.i.SUPPLEMENTAL_PROFILES)); return{colourPrimaries:Or(e,Lt.u.CICP_COLOUR_PRIMARIES),transferCharacteristics:Or(e,Lt.u.CICP_TRANSFER_CHARACTERISTICS),matrixCoefficients:Or(e,Lt.u.CICP_MATRIX_COEFFICIENTS),supplementalCodec:Pr(e,o&& w()(n="".concat(o,":")).call(n,St.i.SUPPLEMENTAL_CODECS)),supplementalProfiles:null==a?void 0:ie()(r=a.split(/\s+/)).call(r,Boolean)}}(t)),o=r.id,l=r.width,c=r.height,h=r.frameRate,f=r.bandwidth,p=r.codecs, v="vod3://".concat(o,"/stream.mpd"),g=t.getElementsByTagNameNS("urn:naver:vod:2020","Label"),ue()(Array.prototype).call(g,function(e){r[e.getAttribute("kind")]=e.textContent}),[4, u.put(v,n)];case 1:return S.sent(),ue()(m).call(m,function(e){A.removeChild(e)}),e.removeChild(t),A.removeChild(e),void 0,y=r.resolution?isFinite(r.resolution)?"".concat(r.resolution,"p"):r.resolution: "".concat((0,Fn.Z)(l,c),"p"),E=t.lookupPrefix(St.V),(T=r[w()(R="".concat(E,":")).call(R,St.i.SUPPLEMENTAL_CODECS)])&&(p=T),b={id:w()(L=w()(I=w()(C=w()(O="DASH_".concat(o,"_")).call(O,f,"_")).call(C,l,"_")).call(I, c,"_")).call(L,h), attributes:r,configuration:i,contentProtections:r.ContentProtections,frameRate:h,baseUrl:v,abr:!1,width:l,height:c,isDefault:!1,qualityLabel:y,protocol:"dash",codecs:p?[p]:void 0,components:zr([],_,!0)}, s.push(b),[2]}})},r=void 0,o=Kr(t),c.label=2; case 2:return[4,o.next()];case 3:return(a=c.sent()).done?[3,6]:[5,n()];case 4:c.sent(),c.label=5;case 5:return[3,2];case 6:return[3,13];case 7:return l=c.sent(),r={error:l},[3,13];case 8:return c.trys.push([8, ,11,12]),a&&!a.done&&(i=o["return"])?[4,i.call(o)]:[3,10];case 9:c.sent(),c.label=10;case 10:return[3,12];case 11:if(r)throw r.error;return[7];case 12:return[7];case 13:return[2]}})},L=Kr(g),N.label=4; case 4:return[4,L.next()];case 5:return(I=N.sent()).done?[3,8]:[5,R()];case 6:N.sent(),N.label=7;case 7:return[3,4];case 8:return[3,15];case 9:return C=N.sent(),t={error:C},[3,15];case 10:return N.trys.push([10, ,13,14]),I&&!I.done&&(n=L["return"])?[4,n.call(L)]:[3,12];case 11:N.sent(),N.label=12;case 12:return[3,14];case 13:if(t)throw t.error;return[7];case 14:return[7];case 15:N.trys.push([15,21,22,27]),O=function O(){var e, t,n,r,i,o;return Gr(this,function(a){var l,c;switch(a.label){case 0:return e=D.value,ue()(l=me()(d.getElementsByName("AdaptationSet"))).call(l,function(t){t!==e&&d.removeChild(t)}),0===e.getElementsByTagName("Representation").length? [2, "continue"]:(A.appendChild(e),t=e.getAttribute("id"),n=lr(e),r=(new XMLSerializer).serializeToString(d),i=w()(c="vod3://".concat(P._videoId,"/stream.mpd?track\x3d")).call(c,t),[4,u.put(i,r)]);case 1:return a.sent(), o={id:"DASH_AUDIO_".concat(t),attributes:n,contentProtections:n.ContentProtections,baseUrl:"".concat(i),abr:!1,isDefault:!1,qualityLabel:"",protocol:"dash",role:"alternative",codecs:void 0,components:["audio"], groupId:"",width:0,height:0},s.push(o),[2]}})},P=this,k=Kr(m),N.label=16; case 16:return[4,k.next()];case 17:return(D=N.sent()).done?[3,20]:[5,O()];case 18:N.sent(),N.label=19;case 19:return[3,16];case 20:return[3,27];case 21:return x=N.sent(),o={error:x},[3,27];case 22:return N.trys.push([22, ,25,26]),D&&!D.done&&(a=k["return"])?[4,a.call(k)]:[3,24];case 23:N.sent(),N.label=24;case 24:return[3,26];case 25:if(o)throw o.error;return[7];case 26:return[7];case 27:return[2,s]}})})},t.prototype._getClearMPD= function(){var e,t,n=this,r=(new DOMParser).parseFromString(this._rawData,"text/xml"),i=r.getElementsByTagName("AdaptationSet"),o=(0,Xt.Z)(i,function(e){return!("true"===e.getAttribute("subsegmentAlignment")|| "true"===e.getAttribute("segmentAlignment"))}),a=o[0],s=o[1]; ue()(a).call(a,function(e){e.parentNode.removeChild(e)}); var u=r.querySelector('SupplementalProperty[schemeIdUri\x3d"urn:naver:vod:information:2019"]');u&&(null===(t=u.parentNode)||void 0===t||t.removeChild(u));var l=(0,jt.V)(s,function(e){return me()(e.getElementsByTagName("Representation"))}), c=new (pe()); return ue()(l).call(l,function(e){var t,n,r,i,o,a,s,u,d,h,f=e.getAttribute("codecs");if(f&&Tt.w[f.substring(0,4).toUpperCase()]){var p=e.getAttribute("id"),v=x()(l).call(l,function(t){return t!==e&&p=== t.getAttribute("id")}); if(v){var g=v.getAttribute("codecs");if(g&&(y=f,m=g,(_=Tt.W[m.substring(0,4).toUpperCase()])&&be()(_).call(_,y.substring(0,4).toLowerCase()))){var y,m,_;c.add(e);var E=v.lookupPrefix(St.i.SUPPLEMENTAL_CODECS); E||(E="scte214",v.setAttributeNS(kt.k,"xmlns:".concat(E),St.V));var T=w()(t="".concat(E,":")).call(t,St.i.SUPPLEMENTAL_CODECS),b=w()(n="".concat(E,":")).call(n,St.i.SUPPLEMENTAL_PROFILES),S=v.getAttribute(T), A=v.getAttribute(b),R=(null===(o=v.querySelector(Lt.M.CICP_TRANSFER_CHARACTERISTICS))||void 0===o?void 0:o.getAttribute("value"))||(null===(a=e.querySelector(Lt.M.CICP_TRANSFER_CHARACTERISTICS))||void 0=== a?void 0:a.getAttribute("value")),L=(null===(s=v.querySelector(Lt.M.CICP_COLOUR_PRIMARIES))||void 0===s?void 0:s.getAttribute("value"))||(null===(u=e.querySelector(Lt.M.CICP_COLOUR_PRIMARIES))||void 0=== u?void 0:u.getAttribute("value"))||"9",I=(null===(d=v.querySelector(Lt.M.CICP_MATRIX_COEFFICIENTS))||void 0===d?void 0:d.getAttribute("value"))||(null===(h=e.querySelector(Lt.M.CICP_MATRIX_COEFFICIENTS))|| void 0===h?void 0:h.getAttribute("value"))||"9";S||(S=f),R||A&&(R=Rt(A)),R||(R=Et.G.HDR_HLG10_BT2100_HLG),A||(A=function(e){var t;return null!==(t=wt[e])&&void 0!==t?t:null}(R)),A||(A=bt.A.CROSS_COMPATIBILITY_WITH_HLG_VUI_18), ue()(r=ie()(i=me()(v.getElementsByTagNameNS(e.namespaceURI,"SupplementalProperty"))).call(i,function(e){return e.getAttribute("schemeIdUri")===Lt.u.CICP_TRANSFER_CHARACTERISTICS||e.getAttribute("schemeIdUri")=== Lt.u.CICP_COLOUR_PRIMARIES||e.getAttribute("schemeIdUri")===Lt.u.CICP_MATRIX_COEFFICIENTS})).call(r,function(e){var t; null===(t=e.parentNode)||void 0===t||t.removeChild(e)}); var C=me()(v.getElementsByTagNameNS(e.namespaceURI,"EssentialProperty")),O=x()(C).call(C,function(e){return e.getAttribute("schemeIdUri")===Lt.u.CICP_TRANSFER_CHARACTERISTICS}); O||((O=e.ownerDocument.createElementNS(e.namespaceURI,"EssentialProperty")).setAttribute("schemeIdUri",Lt.u.CICP_TRANSFER_CHARACTERISTICS),v.insertBefore(O,null));var P=x()(C).call(C,function(e){return e.getAttribute("schemeIdUri")=== Lt.u.CICP_COLOUR_PRIMARIES}); P||((P=e.ownerDocument.createElementNS(e.namespaceURI,"EssentialProperty")).setAttribute("schemeIdUri",Lt.u.CICP_COLOUR_PRIMARIES),v.insertBefore(P,null));var k=x()(C).call(C,function(e){return e.getAttribute("schemeIdUri")=== Lt.u.CICP_MATRIX_COEFFICIENTS}); k||((k=e.ownerDocument.createElementNS(e.namespaceURI,"EssentialProperty")).setAttribute("schemeIdUri",Lt.u.CICP_MATRIX_COEFFICIENTS),v.insertBefore(k,null)),v.setAttributeNS(St.V,T,S),v.setAttributeNS(St.V, b,A),O.setAttribute("value",R),P.setAttribute("value",L),k.setAttribute("value",I)}}}}),ue()(c).call(c,function(e){e.parentNode&&e.parentNode.removeChild(e)}),ue()(s).call(s,function(e){0===e.getElementsByTagName("Representation").length&& e.parentNode&&e.parentNode.removeChild(e)}),ue()(e=ie()(l).call(l,function(e){return!c.has(e)})).call(e,function(e,t,r){var i,o=Qr(e,0,n._mediaCapabilitesDecodingInfos); o&&o.supported||(console.debug("Remove representation#%s: unsupported codec (%s)",e.getAttribute("id"),Xr(e)),null===(i=e.parentNode)||void 0===i||i.removeChild(e))}),[r, ie()(s).call(s,function(e){return e.getElementsByTagName("Representation").length>0})]},t.prototype._applyDashConstraints=function(e){var t=new (j()),n=this._createDashConstraints(); return ue()(e).call(e,function(e){if("video/mp4"===e.getAttribute("mimeType")){var r=me()(e.getElementsByTagName("Representation")),i=[];ue()(r).call(r,function(t){if(J()(n).call(n,function(n){return!0=== n(e,t)}))return e.removeChild(t),void i.push(t); var r=t.getAttribute("codecs");(null==r?void 0:k()(r).call(r,"dvhe."))&&t.setAttribute("codecs",r.replace(/^dvhe/,"dvh1"))}),t.set(e,i)}}),t},t.prototype._createDashConstraints=function(){var e=this,t= []; return isFinite(this._maxBitrate)&&t.push(function(t,n){var r=X()(n.getAttribute("bandwidth"),10);return e._maxBitratei?i:r; return e._abrMax=2&&o<=3)for(var a=0;in.height?"width":"height",i=n[r],o=null,a=1/0,s=0,u=this._hlsTracks||[];s0){var c="".concat(o.length," audio-only track(s) excluded due to missing baseUrl \u2014 graceful fallback"); (0,Ot.jd)("vod_radio_mode_audio_only_base_url_missing",c,{droppedCount:o.length})}var d="audio"===this._track,h=!t&&i.length>0,f=d||h;if(d&&0===i.length){var p="".concat("no track matches the requested track identifier", " (track\x3d'audio' requested but no audio-only track in response)");return this._error=new Bn.Z(200,"no track matches the requested track identifier",p),null===(n=this._player)||void 0===n||n._setError(Ut.Z.MEDIA_ERR_SRC_NOT_SUPPORTED), (0,Ot.jd)("vod_radio_mode_no_match_track",p,{code:200,videoId:this._videoId,uri:this._uri}),ri}if(!f)return ii;var v=i[0];null===(r=this._videoTracks)||void 0===r||ue()(r).call(r,function(e){e.selected&& (e.selected=!1)}),v.setProperty("enabled",!0); var g=v.dataset;return this._applyAudioOnlySrc(g),ni},t.prototype._applyAudioOnlySrc=function(e){var t,n; null===(t=this._player)||void 0===t||t._setCurrentSrc(e.baseUrl,{width:0,height:0}),null===(n=this._player)||void 0===n||n._setVideoSize(0,0)},t.prototype._selectDefaultTrack=function(e){var n=(0,Gt.Z)(e, function(e){return e.abr?"abr":"static"}),r=n.abr,i=n["static"],o="number"==typeof this._track; if((!o||isNaN(this._track))&&(null==r?void 0:r.length)>0)return r[0].isDefault=!0,r[0];var a=(0,Ht.C)(I()(i).call(i,dr),(o?this._track:NaN)||t.DEFAULT_VIDEO_SCANLINE_STATIC,zn);return a>-1?(i[a].isDefault= !0,i[a]):null},t.prototype._dumpState=function(){return{protocol:this.protocol, error:this.error,cid:this._clientId}},t.prototype._evaluateAesEncryption=function(e,t){var n,r=this._representationContentProtectionMap,i=null==r?void 0:r[e]; if(!i&&r&&"video"===t)for(var o=0,a=null!==(n=this._videoTracks)&&void 0!==n?n:[];o0){var c=null===(i=this._videoTracks)||void 0===i?void 0:x()(i).call(i,function(t){return t.id===e[0]}); return c?(this._evaluateAesEncryption(c.id,"video"),null===(o=this._player)||void 0===o||o._setCurrentSrc(c.src,c),null===(a=this._player)||void 0===a||a._switchCurrentSrc(),[!0,"main"===c.kind]):[!1,!1]}if(r&& (null==t?void 0:t.length)>0){var d=null===(s=this._audioTracks)||void 0===s?void 0:x()(s).call(s,function(e){return e.getProperty("id")===t[0]}); if(!d)return[!1,!1];var h=d.dataset;if(h)return this._evaluateAesEncryption(d.getProperty("id"),"audio"),null===(u=this._player)||void 0===u||u._setCurrentSrc(h.baseUrl,h),null===(l=this._player)||void 0=== l||l._switchCurrentSrc(),[!0,!0]}return[!1,!1]},t.DEFAULT_VIDEO_SCANLINE_STATIC=720,t.DEFAULT_VIDEO_SCANLINE_ADAPTIVE_BEGIN=480,t.DEFAULT_VIDEO_SCANLINE_ADAPTIVE_MAX=720,t.HLS_MASTER_FETCH_TIMEOUT_MS=1E4, t.TEXT_TRACK_LANGUAGE_TAG_OVERRIDES=ti,t.TEXT_TRACK_LANGUAGE_TAG_DISABLE_INTL_LOCALE=!1,t}(Qt.Z)}, 3937:function _(e,t,n){n.d(t,{Z:function Z(){return w}}); var r,i=n(93476),o=n.n(i),a=n(65420),s=n.n(a),u=n(98341),l=n.n(u),c=n(34967),d=n.n(c),h=n(16976),f=n.n(h),p=n(3649),v=n.n(p),g=n(77766),y=n.n(g),m=n(89400),_=n.n(m),E=n(36384),T=n.n(E),b=n(84740),S=n(32472); function w(){var e,t,n,i,a,u;return n=this,i=void 0,u=function u(){var n,i,a,u,c;return function(e,t){var n,r,i,o,a={label:0,sent:function sent(){if(1&i[0])throw i[1];return i[1]}, trys:[],ops:[]};return o={next:u(0),"throw":u(1),"return":u(2)},"function"==typeof s()&&(o[l()]=function(){return this}),o; function u(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r), 0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o= a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]30?"".concat(u):"";return _()(t=T()(n=T()(r="".concat(o)).call(r,c," ")).call(n, l)).call(t)}, enumerable:!1,configurable:!0}),f()(t.prototype,"par",{get:function get(){return null}, enumerable:!1,configurable:!0}),f()(t.prototype,"width",{get:function get(){return this._width}, set:function set(e){this._width=e}, enumerable:!1,configurable:!0}),f()(t.prototype,"height",{get:function get(){return this._height}, set:function set(e){this._height=e}, enumerable:!1,configurable:!0}),f()(t.prototype,"minWidth",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.min(t.videoWidth, e)},A()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"minHeight",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.min(t.videoHeight, e)},A()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"maxWidth",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.max(t.videoWidth, e)},L()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"maxHeight",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.max(t.videoHeight, e)},L()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"maxFrameRate",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.max(t.videoFrameRate, e)},L()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"minFrameRate",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.min(t.videoFrameRate, e)},A()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"maxBandwidth",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.max(t.videoBitrate, e)},L()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"minBandwidth",{get:function get(){var e,t;return(null===(e=this._variants)||void 0===e?void 0:e.length)?S()(t=this._variants).call(t,function(e,t){return Math.min(t.videoBitrate, e)},A()):NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoCodec",{get:function get(){return this._videoCodec||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"codecs",{get:function get(){return this._videoCodec?{video:this._videoCodec}:{}}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoBitrate",{get:function get(){var e;return null!==(e=this._videoBitrate)&&void 0!==e?e:NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoQuality",{get:function get(){return this._videoQuality||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoFrameRate",{get:function get(){return this._videoFrameRate||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoProjectionType",{get:function get(){return this._videoProjectionType||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"videoColorspaceInfo",{get:function get(){return this._videoColorspaceInfo||null}, set:function set(e){e&&(this._videoColorspaceInfo=d()(_x2({},e)))}, enumerable:!1,configurable:!0}),f()(t.prototype,"configuration",{get:function get(){return this._configuration}, enumerable:!1,configurable:!0}),f()(t.prototype,"pzpHdrFormat",{get:function get(){return this._hdrFormat}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioLanguage",{get:function get(){return this._audioLanguage||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioCodec",{get:function get(){return this._audioCodec||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioBitrate",{get:function get(){var e;return null!==(e=this._audioBitrate)&&void 0!==e?e:NaN}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioQuality",{get:function get(){return this._audioQuality||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioSampleRate",{get:function get(){return this._audioSampleRate||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"audioChannelLayout",{get:function get(){return this._audioChannelLayout||null}, enumerable:!1,configurable:!0}),f()(t.prototype,"pzpGroupId",{get:function get(){return this._groupId}, enumerable:!1,configurable:!0}),f()(t.prototype,"protectionTypes",{get:function get(){var e;return(null===(e=this._protectionTypes)||void 0===e?void 0:C()(e).call(e,function(e){return e.toLowerCase()}))|| null}, enumerable:!1,configurable:!0}),t._setHdrFormat=function(e,t){var n,r,i;"Auto"===e._videoQuality&&(e._hdrFormat=(0,k.u)({colorSpace:{primaries:null!==(n=t.primaries)&&void 0!==n?n:null,transfer:null!== (r=t.transferCharacteristics)&&void 0!==r?r:null,matrix:null!==(i=t.colorspace)&&void 0!==i?i:null,fullRange:"full"===t.range},pzpColorPrimaries:null,pzpTransferCharacteristics:null,pzpMatrixCoefficients:null, pzpSupplementalCodec:null,pzpSupplementalProfiles:[]},e._videoCodec))},t}(O.Z)}, 21371:function _(e,t,n){n.d(t,{T:function T(){return r}}); var r={}}, 37886:function _(e,t,n){n.d(t,{vV:function vV(){return T}}); var r,i,o=n(51942),a=n.n(o),s=n(86902),u=n.n(s),l=n(93476),c=n.n(l),d=n(63978),h=n.n(d),f=n(59340),p=n.n(f),v=n(52424),g=n.n(v),y=n(70540),m=n(51015),_=n(13210),_E2=function E(){return _E2=a()||function(e){for(var t, n=1,r=arguments.length;n-1?(0,s._)(new Error("Unexpected error while exit fullscreen")):(0,u.of)(void 0)})).toPromise()}}, 2203:function _(e,t,n){function r(e){if(!e)return NaN;if(0===e.length)return NaN;for(var t=0,n=0;n-1?(0,d._)(new Error("Unexpected error while switch to fullscreen")):(0,h.of)(void 0)})).toPromise()}}, 76489:function _(e,t){t.Q=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var o={},a=t||{},s=e.split(r),u=a.decode||n,l=0;l1?arguments[1]:void 0)}}, 11354:function _(e,t,n){var r=n(86843),i=n(89678),o=n(75196),a=n(6782),s=n(43057),u=n(55449),l=n(22902);e.exports=function(e){var t,n,c,d,h,f,p=i(e),v="function"==typeof this?this:Array,g=arguments.length, y=g>1?arguments[1]:void 0,m=void 0!==y,_=l(p),E=0;if(m&&(y=r(y,g>2?arguments[2]:void 0,2)),null==_||v==Array&&a(_))for(n=new v(t=s(p.length));t>E;E++)f=m?y(p[E],E):p[E],u(n,E,f);else for(h=(d=_.call(p)).next, n=new v;!(c=h.call(d)).done;E++)f=m?o(d,y,[c.value,E],!0):c.value,u(n,E,f);return n.length=E,n}}, 31692:function _(e,t,n){var r=n(74529),i=n(43057),o=n(59413),a=function a(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n)for(;l>c;){if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e|| c in u)&&u[c]===n)return e||c||0;return!e&&-1}}; e.exports={includes:a(!0),indexOf:a(!1)}}, 3610:function _(e,t,n){var r=n(86843),i=n(37026),o=n(89678),a=n(43057),s=n(64692),u=[].push,l=function l(e){var t=1==e,n=2==e,l=3==e,c=4==e,d=6==e,h=7==e,f=5==e||d;return function(p,v,g,y){for(var m,_, E=o(p),T=i(E),b=r(v,g,3),S=a(T.length),w=0,A=y||s,R=t?A(p,S):n||h?A(p,0):void 0;S>w;w++)if((f||w in T)&&(_=b(m=T[w],w,E),e))if(t)R[w]=_;else if(_)switch(e){case 3:return!0;case 5:return m;case 6:return w; case 2:u.call(R,m)}else switch(e){case 4:return!1;case 7:u.call(R,m)}return d?-1:l||c?c:R}}; e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterOut:l(7)}}, 67145:function _(e,t,n){var r=n(74529),i=n(68459),o=n(43057),a=n(34194),s=n(65486),u=Math.min,l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0,d=a("lastIndexOf"),h=s("indexOf",{ACCESSORS:!0,1:0}),f=c|| !d||!h;e.exports=f?function(e){if(c)return l.apply(this,arguments)||0;var t=r(this),n=o(t.length),a=n-1;for(arguments.length>1&&(a=u(a,i(arguments[1]))),a<0&&(a=n+a);a>=0;a--)if(a in t&&t[a]===e)return a|| 0;return-1}:l}, 50568:function _(e,t,n){var r=n(95981),i=n(99813),o=n(53385),a=i("species");e.exports=function(e){return o>=51||!r(function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo})}}, 34194:function _(e,t,n){var r=n(95981);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1;},1)})}}, 65486:function _(e,t,n){var r=n(55746),i=n(95981),o=n(47457),a=Object.defineProperty,s={},u=function u(e){throw e;}; e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var n=[][e],l=!!o(t,"ACCESSORS")&&t.ACCESSORS,c=o(t,0)?t[0]:u,d=o(t,1)?t[1]:void 0;return s[e]=!!n&&!i(function(){if(l&&!r)return!0;var e={length:-1}; l?a(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,c,d)})}}, 46499:function _(e,t,n){var r=n(33916),i=n(89678),o=n(37026),a=n(43057),s=function s(e){return function(t,n,s,u){r(n);var l=i(t),c=o(l),d=a(l.length),h=e?d-1:0,f=e?-1:1;if(s<2)for(;;){if(h in c){u=c[h], h+=f;break}if(h+=f,e?h<0:d<=h)throw TypeError("Reduce of empty array with no initial value");}for(;e?h>=0:d>h;h+=f)h in c&&(u=n(u,c[h],h,l));return u}}; e.exports={left:s(!1),right:s(!0)}}, 64692:function _(e,t,n){var r=n(10941),i=n(1052),o=n(99813)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&& (n=void 0):n=void 0),new (void 0===n?Array:n)(0===t?0:t)}}, 75196:function _(e,t,n){var r=n(96059),i=n(7609);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){throw i(e),t;}}}, 21385:function _(e,t,n){var r=n(99813)("iterator"),i=!1;try{var o=0,a={next:function next(){return{done:!!o++}}, "return":function _return(){i=!0}}; a[r]=function(){return this},Array.from(a,function(){throw 2; })}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1; var n=!1;try{var o={};o[r]=function(){return{next:function next(){return{done:n=!0}}}},e(o)}catch(e){}return n}}, 82532:function _(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}}, 9697:function _(e,t,n){var r=n(22885),i=n(82532),o=n(99813)("toStringTag"),a="Arguments"==i(function(){return arguments}()); e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:a?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee? "Arguments":r}}, 28984:function _(e,t,n){var r=n(96059),i=n(33916);e.exports=function(){for(var e,t=r(this),n=i(t["delete"]),o=!0,a=0,s=arguments.length;a1?arguments[1]:void 0;return r(this),(t=void 0!==l)&&r(l),null==e?new this:(n=[],t? (a=0,s=i(l,u>2?arguments[2]:void 0,2),o(e,function(e){n.push(s(e,a++))})):o(e,n.push,{that:n}),new this(n))}}, 45226:function _(e){e.exports=function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}}, 85616:function _(e,t,n){var r=n(65988).f,i=n(29290),o=n(87524),a=n(86843),s=n(5743),u=n(93091),l=n(47771),c=n(94431),d=n(55746),h=n(21647).fastKey,f=n(45402),p=f.set,v=f.getterFor;e.exports={getConstructor:function getConstructor(e, t,n,l){var c=e(function(e,r){s(e,c,t),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),d||(e.size=0),null!=r&&u(r,e[l],{that:e,AS_ENTRIES:n})}),f=v(t),g=function g(e,t,n){var r,i,o=f(e),a=y(e, t); return a?a.value=n:(o.last=a={index:i=h(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),d?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},y=function y(e,t){var n, r=f(e),i=h(t); if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n}; return o(c.prototype,{clear:function clear(){for(var e=f(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,d?e.size= 0:this.size=0}, "delete":function _delete(e){var t=this,n=f(t),r=y(t,e);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o), d?n.size--:t.size--}return!!r}, forEach:function forEach(e){for(var t,n=f(this),r=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous}, has:function has(e){return!!y(this,e)}}),o(c.prototype,n?{get:function get(e){var t=y(this,e); return t&&t.value}, set:function set(e,t){return g(this,0===e?0:e,t)}}:{add:function add(e){return g(this,e=0===e?0:e,e)}}),d&&r(c.prototype,"size",{get:function get(){return f(this).size}}),c}, setStrong:function setStrong(e,t,n){var r=t+" Iterator",i=v(t),o=v(r);l(e,t,function(e,t){p(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n= n.previous; return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},n?"entries": "values",!n,!0),c(t)}}}, 8850:function _(e,t,n){var r=n(87524),i=n(21647).getWeakData,o=n(96059),a=n(10941),s=n(5743),u=n(93091),l=n(3610),c=n(47457),d=n(45402),h=d.set,f=d.getterFor,p=l.find,v=l.findIndex,g=0,y=function y(e){return e.frozen|| (e.frozen=new m)},m=function m(){this.entries=[]},_=function _(e,t){return p(e.entries,function(e){return e[0]===t})}; m.prototype={get:function get(e){var t=_(this,e);if(t)return t[1]}, has:function has(e){return!!_(this,e)}, set:function set(e,t){var n=_(this,e);n?n[1]=t:this.entries.push([e,t])}, "delete":function _delete(e){var t=v(this.entries,function(t){return t[0]===e}); return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function getConstructor(e,t,n,l){var d=e(function(e,r){s(e,d,t),h(e,{type:t, id:g++,frozen:void 0}),null!=r&&u(r,e[l],{that:e,AS_ENTRIES:n})}),p=f(t),v=function v(e,t,n){var r=p(e),a=i(o(t),!0); return!0===a?y(r).set(t,n):a[r.id]=n,e}; return r(d.prototype,{"delete":function _delete(e){var t=p(this);if(!a(e))return!1;var n=i(e);return!0===n?y(t)["delete"](e):n&&c(n,t.id)&&delete n[t.id]}, has:function has(e){var t=p(this);if(!a(e))return!1;var n=i(e);return!0===n?y(t).has(e):n&&c(n,t.id)}}),r(d.prototype,n?{get:function get(e){var t=p(this); if(a(e)){var n=i(e);return!0===n?y(t).get(e):n?n[t.id]:void 0}}, set:function set(e,t){return v(this,e,t)}}:{add:function add(e){return v(this,e,!0)}}),d}}}, 24683:function _(e,t,n){var r=n(76887),i=n(21899),o=n(21647),a=n(95981),s=n(32029),u=n(93091),l=n(5743),c=n(10941),d=n(90904),h=n(65988).f,f=n(3610).forEach,p=n(55746),v=n(45402),g=v.set,y=v.getterFor; e.exports=function(e,t,n){var v,m=-1!==e.indexOf("Map"),_=-1!==e.indexOf("Weak"),E=m?"set":"add",T=i[e],b=T&&T.prototype,S={};if(p&&"function"==typeof T&&(_||b.forEach&&!a(function(){(new T).entries().next()}))){v= t(function(t,n){g(l(t,v,e),{type:e, collection:new T}),null!=n&&u(n,t[E],{that:t,AS_ENTRIES:m})}); var w=y(e);f(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(e){var t="add"==e||"set"==e;!(e in b)||_&&"clear"==e||s(v.prototype,e,function(n,r){var i=w(this).collection; if(!t&&_&&!c(n))return"get"==e&&void 0;var o=i[e](0===n?0:n,r);return t?this:o})}),_||h(v.prototype,"size",{configurable:!0, get:function get(){return w(this).collection.size}})}else v=n.getConstructor(t,e,m,E),o.REQUIRED=!0; return d(v,e,!1,!0),S[e]=v,r({global:!0,forced:!0},S),_||n.setStrong(v,e,m),v}}, 67772:function _(e,t,n){var r=n(99813)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}}, 64160:function _(e,t,n){var r=n(95981);e.exports=!r(function(){function e(){} return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}, 31046:function _(e,t,n){var r=n(35143).IteratorPrototype,i=n(29290),o=n(31887),a=n(90904),s=n(12077),u=function u(){return this}; e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=i(r,{next:o(1,n)}),a(e,l,!1,!0),s[l]=u,e}}, 32029:function _(e,t,n){var r=n(55746),i=n(65988),o=n(31887);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}}, 31887:function _(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}, 55449:function _(e,t,n){var r=n(46935),i=n(65988),o=n(31887);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}}, 47771:function _(e,t,n){var r=n(76887),i=n(31046),o=n(249),a=n(88929),s=n(90904),u=n(32029),l=n(99754),c=n(99813),d=n(82529),h=n(12077),f=n(35143),p=f.IteratorPrototype,v=f.BUGGY_SAFARI_ITERATORS,g=c("iterator"), y="keys",m="values",_="entries",E=function E(){return this}; e.exports=function(e,t,n,c,f,T,b){i(n,t,c);var S,w,A,R=function R(e){if(e===f&&P)return P;if(!v&&e in C)return C[e];switch(e){case y:case m:case _:return function(){return new n(this,e)}}return function(){return new n(this)}}, L=t+" Iterator",I=!1,C=e.prototype,O=C[g]||C["@@iterator"]||f&&C[f],P=!v&&O||R(f),k="Array"==t&&C.entries||O; if(k&&(S=o(k.call(new e)),p!==Object.prototype&&S.next&&(d||o(S)===p||(a?a(S,p):"function"!=typeof S[g]&&u(S,g,E)),s(S,L,!0,!0),d&&(h[L]=E))),f==m&&O&&O.name!==m&&(I=!0,P=function P(){return O.call(this)}), d&&!b||C[g]===P||u(C,g,P),h[t]=P,f)if(w={values:R(m), keys:T?P:R(y),entries:R(_)},b)for(A in w)(v||I||!(A in C))&&l(C,A,w[A]);else r({target:t,proto:!0,forced:v||I},w);return w}}, 66349:function _(e,t,n){var r=n(54058),i=n(47457),o=n(11477),a=n(65988).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||a(t,e,{value:o.f(e)})}}, 55746:function _(e,t,n){var r=n(95981);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function get(){return 7}})[1]})}, 61333:function _(e,t,n){var r=n(21899),i=n(10941),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}}, 63281:function _(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0, HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0, SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}, 22749:function _(e,t,n){var r=n(2861);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)}, 6049:function _(e,t,n){var r=n(82532),i=n(21899);e.exports="process"==r(i.process)}, 58045:function _(e,t,n){var r=n(2861);e.exports=/web0s(?!.*chrome)/i.test(r)}, 2861:function _(e,t,n){var r=n(626);e.exports=r("navigator","userAgent")||""}, 53385:function _(e,t,n){var r,i,o=n(21899),a=n(2861),s=o.process,u=s&&s.versions,l=u&&u.v8;l?i=(r=l.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]), e.exports=i&&+i}, 35703:function _(e,t,n){var r=n(54058);e.exports=function(e){return r[e+"Prototype"]}}, 56759:function _(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}, 76887:function _(e,t,n){var r=n(21899),i=n(49677).f,o=n(37252),a=n(54058),s=n(86843),u=n(32029),l=n(47457),c=function c(e){var t=function t(_t0,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e; case 1:return new e(_t0);case 2:return new e(_t0,n)}return new e(_t0,n,r)}return e.apply(this,arguments)}; return t.prototype=e.prototype,t}; e.exports=function(e,t){var n,d,h,f,p,v,g,y,m=e.target,_=e.global,E=e.stat,T=e.proto,b=_?r:E?r[m]:(r[m]||{}).prototype,S=_?a:a[m]||(a[m]={}),w=S.prototype;for(h in t)n=!o(_?h:m+(E?".":"#")+h,e.forced)&& b&&l(b,h),p=S[h],n&&(v=e.noTargetGet?(y=i(b,h))&&y.value:b[h]),f=n&&v?v:t[h],n&&_typeof(p)==_typeof(f)||(g=e.bind&&n?s(f,r):e.wrap&&n?c(f):T&&"function"==typeof f?s(Function.call,f):f,(e.sham||f&&f.sham|| p&&p.sham)&&u(g,"sham",!0),S[h]=g,T&&(l(a,d=m+"Prototype")||u(a,d,{}),a[d][h]=f,e.real&&w&&!w[h]&&u(w,h,f)))}}, 95981:function _(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}}, 13092:function _(e,t,n){var r=n(1052),i=n(43057),o=n(86843),a=function a(e,t,n,s,u,l,c,d){for(var h,f=u,p=0,v=!!c&&o(c,d,3);p0&&r(h))f=a(e,t,h,i(h.length),f,l- 1)-1;else{if(f>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[f]=h}f++}p++}return f}; e.exports=a}, 45602:function _(e,t,n){var r=n(95981);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})}, 86843:function _(e,t,n){var r=n(33916);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)}; case 1:return function(n){return e.call(t,n)}; case 2:return function(n,r){return e.call(t,n,r)}; case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}}, 98308:function _(e,t,n){var r=n(33916),i=n(10941),o=[].slice,a={},s=function s(e,t,n){if(!(t in a)){for(var r=[],i=0;ih;h++)if((p=S(e[h]))&&p instanceof l)return p;return new l(!1)}c=d.call(e)}for(v=c.next;!(g= v.call(c)).done;){try{p=S(g.value)}catch(e){throw u(c),e;}if("object"==_typeof(p)&&p&&p instanceof l)return p}return new l(!1)}}, 7609:function _(e,t,n){var r=n(96059);e.exports=function(e){var t=e["return"];if(void 0!==t)return r(t.call(e)).value}}, 35143:function _(e,t,n){var r,i,o,a=n(95981),s=n(249),u=n(32029),l=n(47457),c=n(99813),d=n(82529),h=c("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(i=s(s(o)))!==Object.prototype&&(r=i):f=!0);var p= null==r||a(function(){var e={};return r[h].call(e)!==e}); p&&(r={}),d&&!p||l(r,h)||u(r,h,function(){return this}),e.exports={IteratorPrototype:r, BUGGY_SAFARI_ITERATORS:f}}, 12077:function _(e){e.exports={}}, 48721:function _(e,t,n){var r=n(96059);e.exports=function(e,t){var n=r(this),i=n.has(e)&&"update"in t?t.update(n.get(e),e,n):t.insert(e,n);return n.set(e,i),i}}, 20716:function _(e,t,n){var r=n(96059);e.exports=function(e,t){var n,i=r(this),o=arguments.length>2?arguments[2]:void 0;if("function"!=typeof t&&"function"!=typeof o)throw TypeError("At least one callback required"); return i.has(e)?(n=i.get(e),"function"==typeof t&&(n=t(n),i.set(e,n))):"function"==typeof o&&(n=o(),i.set(e,n)),n}}, 66132:function _(e,t,n){var r,i,o,a,s,u,l,c,d=n(21899),h=n(49677).f,f=n(42941).set,p=n(22749),v=n(58045),g=n(6049),y=d.MutationObserver||d.WebKitMutationObserver,m=d.document,_=d.process,E=d.Promise,T= h(d,"queueMicrotask"),b=T&&T.value;b||(r=function r(){var e,t;for(g&&(e=_.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e;}}o=void 0,e&&e.enter()},p||g||v||!y||!m?E&&E.resolve? (l=E.resolve(void 0),c=l.then,a=function a(){c.call(l,r)}):a=g?function(){_.nextTick(r)}:function(){f.call(d,r)}:(s=!0,u=m.createTextNode(""),(new y(r)).observe(u,{characterData:!0}),a=function a(){u.data= s=!s})),e.exports=b||function(e){var t={fn:e, next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}}, 19297:function _(e,t,n){var r=n(21899);e.exports=r.Promise}, 72497:function _(e,t,n){var r=n(95981);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!String(Symbol())})}, 28468:function _(e,t,n){var r=n(95981),i=n(99813),o=n(82529),a=i("iterator");e.exports=!r(function(){var e=new URL("b?a\x3d1\x26b\x3d2\x26c\x3d3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d", t.forEach(function(e,r){t["delete"]("b"),n+=r+e}),o&&!e.toJSON||!t.sort||"http://a/c%20d?a\x3d1\x26c\x3d3"!==e.href||"3"!==t.get("c")||"a\x3d1"!==String(new URLSearchParams("?a\x3d1"))||!t[a]||"a"!==(new URL("https://a@b")).username|| "b"!==(new URLSearchParams(new URLSearchParams("a\x3db"))).get("a")||"xn--e1aybc"!==(new URL("http://\u0442\u0435\u0441\u0442")).host||"#%D0%B1"!==(new URL("http://a#\u0431")).hash||"a1c3"!==n||"x"!==(new URL("http://x", void 0)).host})}, 38019:function _(e,t,n){var r=n(21899),i=n(81302),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))}, 69520:function _(e,t,n){var r=n(33916),i=function i(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject= r(n)}; e.exports.f=function(e){return new i(e)}}, 70344:function _(e,t,n){var r=n(60685);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}}, 72534:function _(e,t,n){var r=n(21899).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}}, 81942:function _(e,t,n){var r=n(21899),i=n(74853).trim,o=n(73483),a=r.parseFloat,s=1/a(o+"-0")!=-1/0;e.exports=s?function(e){var t=i(String(e)),n=a(t);return 0===n&&"-"==t.charAt(0)?-0:n}:a}, 29806:function _(e,t,n){var r=n(21899),i=n(74853).trim,o=n(73483),a=r.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");e.exports=u?function(e,t){var n=i(String(e));return a(n,t>>>0||(s.test(n)? 16:10))}:a}, 24420:function _(e,t,n){var r=n(55746),i=n(95981),o=n(14771),a=n(87857),s=n(36760),u=n(89678),l=n(37026),c=Object.assign,d=Object.defineProperty;e.exports=!c||i(function(){if(r&&1!==c({b:1},c(d({},"a", {enumerable:!0,get:function get(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0; var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||o(c({},t)).join("")!=i})?function(e,t){for(var n=u(e),i=arguments.length,c=1,d=a.f, h=s.f;i>c;)for(var f,p=l(arguments[c++]),v=d?o(p).concat(d(p)):o(p),g=v.length,y=0;g>y;)f=v[y++],r&&!h.call(p,f)||(n[f]=p[f]); return n}:c}, 29290:function _(e,t,n){var r,i=n(96059),o=n(59938),a=n(56759),s=n(27748),u=n(15463),l=n(61333),c=n(44262),d="prototype",h="script",f=c("IE_PROTO"),p=function p(){},v=function v(e){return"\x3c"+h+"\x3e"+ e+"\x3c/"+h+"\x3e"},_g2=function g(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n; _g2=r?function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):(t=l("iframe"),n="java"+h+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(), e.write(v("document.F\x3dObject")),e.close(),e.F); for(var i=a.length;i--;)delete _g2[d][a[i]];return _g2()}; s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[d]=i(e),n=new p,p[d]=null,n[f]=e):n=_g2(),void 0===t?n:o(n,t)}}, 59938:function _(e,t,n){var r=n(55746),i=n(65988),o=n(96059),a=n(14771);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=r.length,u=0;s>u;)i.f(e,n=r[u++],t[n]);return e}}, 65988:function _(e,t,n){var r=n(55746),i=n(2840),o=n(96059),a=n(46935),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(o(e),t=a(t,!0),o(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported"); return"value"in n&&(e[t]=n.value),e}}, 49677:function _(e,t,n){var r=n(55746),i=n(36760),o=n(31887),a=n(74529),s=n(46935),u=n(47457),l=n(2840),c=Object.getOwnPropertyDescriptor;t.f=r?c:function(e,t){if(e=a(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(u(e, t))return o(!i.f.call(e,t),e[t])}}, 684:function _(e,t,n){var r=n(74529),i=n(10946).f,o={}.toString,a="object"==(typeof window==="undefined"?"undefined":_typeof(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window): [];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}}, 10946:function _(e,t,n){var r=n(55629),i=n(56759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}}, 87857:function _(e,t){t.f=Object.getOwnPropertySymbols}, 249:function _(e,t,n){var r=n(47457),i=n(89678),o=n(44262),a=n(64160),s=o("IE_PROTO"),u=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&& e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}}, 55629:function _(e,t,n){var r=n(47457),i=n(74529),o=n(31692).indexOf,a=n(27748);e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)!r(a,n)&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l, n)||l.push(n));return l}}, 14771:function _(e,t,n){var r=n(55629),i=n(56759);e.exports=Object.keys||function(e){return r(e,i)}}, 36760:function _(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n}, 88929:function _(e,t,n){var r=n(96059),i=n(11851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n, []),t=n instanceof Array}catch(e){}return function(n,o){return r(n),i(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)}, 88810:function _(e,t,n){var r=n(55746),i=n(14771),o=n(74529),a=n(36760).f,s=function s(e){return function(t){for(var n,s=o(t),u=i(s),l=u.length,c=0,d=[];l>c;)n=u[c++],r&&!a.call(s,n)||d.push(e?[n,s[n]]: s[n]);return d}}; e.exports={entries:s(!0),values:s(!1)}}, 95623:function _(e,t,n){var r=n(22885),i=n(9697);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}}, 31136:function _(e,t,n){var r=n(626),i=n(10946),o=n(87857),a=n(96059);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?t.concat(n(e)):t}}, 54058:function _(e){e.exports={}}, 40002:function _(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}}, 56584:function _(e,t,n){var r=n(96059),i=n(10941),o=n(69520);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}}, 87524:function _(e,t,n){var r=n(99754);e.exports=function(e,t,n){for(var i in t)n&&n.unsafe&&e[i]?e[i]=t[i]:r(e,i,t[i],n);return e}}, 99754:function _(e,t,n){var r=n(32029);e.exports=function(e,t,n,i){i&&i.enumerable?e[t]=n:r(e,t,n)}}, 66777:function _(e,t,n){var r=n(96059);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+= "y"),t}}, 48219:function _(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}}, 57309:function _(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}}, 4911:function _(e,t,n){var r=n(21899),i=n(32029);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}}, 94431:function _(e,t,n){var r=n(626),i=n(65988),o=n(99813),a=n(55746),s=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function get(){return this}})}}, 90904:function _(e,t,n){var r=n(22885),i=n(65988).f,o=n(32029),a=n(47457),s=n(95623),u=n(99813)("toStringTag");e.exports=function(e,t,n,l){if(e){var c=n?e:e.prototype;a(c,u)||i(c,u,{configurable:!0,value:t}), l&&!r&&o(c,"toString",s)}}}, 44262:function _(e,t,n){var r=n(68726),i=n(99418),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}}, 63030:function _(e,t,n){var r=n(21899),i=n(4911),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a}, 68726:function _(e,t,n){var r=n(82529),i=n(63030);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.3", mode:r?"pure":"global",copyright:"\u00a9 2021 Denis Pushkarev (zloirock.ru)"})}, 70487:function _(e,t,n){var r=n(96059),i=n(33916),o=n(99813)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}}, 64620:function _(e,t,n){var r=n(68459),i=n(48219),o=function o(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l|| (a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}; e.exports={codeAt:o(!1),charAt:o(!0)}}, 4887:function _(e,t,n){var r=n(2861);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)}, 6930:function _(e,t,n){var r=n(43057),i=n(16178),o=n(48219),a=Math.ceil,s=function s(e){return function(t,n,s){var u,l,c=String(o(t)),d=c.length,h=void 0===s?" ":String(s),f=r(n);return f<=d||""==h?c:(u= f-d,(l=i.call(h,a(u/h.length))).length>u&&(l=l.slice(0,u)),e?c+l:l+c)}}; e.exports={start:s(!1),end:s(!0)}}, 73291:function _(e){var t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",o=Math.floor,a=String.fromCharCode,s=function s(e){return e+22+75*(e< 26)},u=function u(e,t,n){var r=0; for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},l=function l(e){var n=[]; e=function(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n=d&&lo((t- h)/y))throw RangeError(i);for(h+=(g-d)*y,d=g,r=0;rt)throw RangeError(i);if(l==d){for(var m=h,_=36;;_+=36){var E=_<=f?1:_>=f+26?26:_-f;if(m0;(o>>>=1)&&(t+= t))1&o&&(n+=t);return n}}, 93093:function _(e,t,n){var r=n(95981),i=n(73483);e.exports=function(e){return r(function(){return!!i[e]()||"\u200b\u0085\u180e"!="\u200b\u0085\u180e"[e]()||i[e].name!==e})}}, 74853:function _(e,t,n){var r=n(48219),i="["+n(73483)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function s(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(a, "")),n}}; e.exports={start:s(1),end:s(2),trim:s(3)}}, 42941:function _(e,t,n){var r,i,o,a=n(21899),s=n(95981),u=n(86843),l=n(15463),c=n(61333),d=n(22749),h=n(6049),f=a.location,p=a.setImmediate,v=a.clearImmediate,g=a.process,y=a.MessageChannel,m=a.Dispatch, _=0,E={},T="onreadystatechange",b=function b(e){if(E.hasOwnProperty(e)){var t=E[e];delete E[e],t()}},S=function S(e){return function(){b(e)}},w=function w(e){b(e.data)},A=function A(e){a.postMessage(e+ "",f.protocol+"//"+f.host)}; p&&v||(p=function p(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return E[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(_),_},v=function v(e){delete E[e]},h? r=function r(e){g.nextTick(S(e))}:m&&m.now?r=function r(e){m.now(S(e))}:y&&!d?(o=(i=new y).port2,i.port1.onmessage=w,r=u(o.postMessage,o,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&& f&&"file:"!==f.protocol&&!s(A)?(r=A,a.addEventListener("message",w,!1)):r=T in c("script")?function(e){l.appendChild(c("script"))[T]=function(){l.removeChild(this),b(e)}}:function(e){setTimeout(S(e),0)}), e.exports={set:p, clear:v}}, 59413:function _(e,t,n){var r=n(68459),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}}, 74529:function _(e,t,n){var r=n(37026),i=n(48219);e.exports=function(e){return r(i(e))}}, 68459:function _(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}}, 43057:function _(e,t,n){var r=n(68459),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}}, 89678:function _(e,t,n){var r=n(48219);e.exports=function(e){return Object(r(e))}}, 46935:function _(e,t,n){var r=n(10941);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i; if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value");}}, 22885:function _(e,t,n){var r={};r[n(99813)("toStringTag")]="z",e.exports="[object z]"===String(r)}, 99418:function _(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}}, 32302:function _(e,t,n){var r=n(72497);e.exports=r&&!Symbol.sham&&"symbol"==_typeof(Symbol.iterator)}, 11477:function _(e,t,n){var r=n(99813);t.f=r}, 99813:function _(e,t,n){var r=n(21899),i=n(68726),o=n(47457),a=n(99418),s=n(72497),u=n(32302),l=i("wks"),c=r.Symbol,d=u?c:c&&c.withoutSetter||a;e.exports=function(e){return o(l,e)||(s&&o(c,e)?l[e]=c[e]: l[e]=d("Symbol."+e)),l[e]}}, 73483:function _(e){e.exports="\t\n\x0B\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"}, 47627:function _(e,t,n){var r=n(76887),i=n(249),o=n(88929),a=n(29290),s=n(32029),u=n(31887),l=n(93091),c=function c(e,t){var n=this;if(!(n instanceof c))return new c(e,t);o&&(n=o(new Error(void 0),i(n))), void 0!==t&&s(n,"message",String(t));var r=[];return l(e,r.push,{that:r}),s(n,"errors",r),n}; c.prototype=a(Error.prototype,{constructor:u(5,c),message:u(5,""),name:u(5,"AggregateError")}),r({global:!0},{AggregateError:c})}, 85906:function _(e,t,n){var r=n(76887),i=n(95981),o=n(1052),a=n(10941),s=n(89678),u=n(43057),l=n(55449),c=n(64692),d=n(50568),h=n(99813),f=n(53385),p=h("isConcatSpreadable"),v=9007199254740991,g="Maximum allowed index exceeded", y=f>=51||!i(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),m=d("concat"),_=function _(e){if(!a(e))return!1; var t=e[p];return void 0!==t?!!t:o(e)}; r({target:"Array",proto:!0,forced:!y||!m},{concat:function concat(e){var t,n,r,i,o,a=s(this),d=c(a,0),h=0;for(t=-1,r=arguments.length;tv)throw TypeError(g); for(n=0;n=v)throw TypeError(g);l(d,h++,o)}return d.length=h,d}})}, 48851:function _(e,t,n){var r=n(76887),i=n(3610).every,o=n(34194),a=n(65486),s=o("every"),u=a("every");r({target:"Array",proto:!0,forced:!s||!u},{every:function every(e){return i(this,e,arguments.length> 1?arguments[1]:void 0)}})}, 21501:function _(e,t,n){var r=n(76887),i=n(3610).filter,o=n(50568),a=n(65486),s=o("filter"),u=a("filter");r({target:"Array",proto:!0,forced:!s||!u},{filter:function filter(e){return i(this,e,arguments.length> 1?arguments[1]:void 0)}})}, 44929:function _(e,t,n){var r=n(76887),i=n(3610).findIndex,o=n(18479),a=n(65486),s="findIndex",u=!0,l=a(s);s in[]&&Array(1)[s](function(){u=!1}),r({target:"Array", proto:!0,forced:u||!l},{findIndex:function findIndex(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)}, 80833:function _(e,t,n){var r=n(76887),i=n(3610).find,o=n(18479),a=n(65486),s="find",u=!0,l=a(s);s in[]&&Array(1)[s](function(){u=!1}),r({target:"Array", proto:!0,forced:u||!l},{find:function find(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)}, 22065:function _(e,t,n){var r=n(76887),i=n(13092),o=n(89678),a=n(43057),s=n(33916),u=n(64692);r({target:"Array",proto:!0},{flatMap:function flatMap(e){var t,n=o(this),r=a(n.length);return s(e),(t=u(n,0)).length= i(t,n,n,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}})}, 2437:function _(e,t,n){var r=n(76887),i=n(56837);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})}, 53242:function _(e,t,n){var r=n(76887),i=n(11354);r({target:"Array",stat:!0,forced:!n(21385)(function(e){Array.from(e)})},{from:i})}, 97690:function _(e,t,n){var r=n(76887),i=n(31692).includes,o=n(18479);r({target:"Array",proto:!0,forced:!n(65486)("indexOf",{ACCESSORS:!0,1:0})},{includes:function includes(e){return i(this,e,arguments.length> 1?arguments[1]:void 0)}}),o("includes")}, 99076:function _(e,t,n){var r=n(76887),i=n(31692).indexOf,o=n(34194),a=n(65486),s=[].indexOf,u=!!s&&1/[1].indexOf(1,-0)<0,l=o("indexOf"),c=a("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:u|| !l||!c},{indexOf:function indexOf(e){return u?s.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})}, 92737:function _(e,t,n){n(76887)({target:"Array",stat:!0},{isArray:n(1052)})}, 66274:function _(e,t,n){var r=n(74529),i=n(18479),o=n(12077),a=n(45402),s=n(47771),u="Array Iterator",l=a.set,c=a.getterFor(u);e.exports=s(Array,"Array",function(e,t){l(this,{type:u,target:r(e),index:0, kind:t})},function(){var e=c(this),t=e.target,n=e.kind,r=e.index++; return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),o.Arguments=o.Array,i("keys"),i("values"), i("entries")}, 75915:function _(e,t,n){var r=n(76887),i=n(67145);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})}, 68787:function _(e,t,n){var r=n(76887),i=n(3610).map,o=n(50568),a=n(65486),s=o("map"),u=a("map");r({target:"Array",proto:!0,forced:!s||!u},{map:function map(e){return i(this,e,arguments.length>1?arguments[1]: void 0)}})}, 81876:function _(e,t,n){var r=n(76887),i=n(46499).left,o=n(34194),a=n(65486),s=n(53385),u=n(6049),l=o("reduce"),c=a("reduce",{1:0});r({target:"Array",proto:!0,forced:!l||!c||!u&&s>79&&s<83},{reduce:function reduce(e){return i(this, e,arguments.length,arguments.length>1?arguments[1]:void 0)}})}, 11490:function _(e,t,n){var r=n(76887),i=n(1052),o=[].reverse,a=[1,2];r({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function reverse(){return i(this)&&(this.length=this.length), o.call(this)}})}, 60186:function _(e,t,n){var r=n(76887),i=n(10941),o=n(1052),a=n(59413),s=n(43057),u=n(74529),l=n(55449),c=n(99813),d=n(50568),h=n(65486),f=d("slice"),p=h("slice",{ACCESSORS:!0,0:0,1:2}),v=c("species"), g=[].slice,y=Math.max;r({target:"Array",proto:!0,forced:!f||!p},{slice:function slice(e,t){var n,r,c,d=u(this),h=s(d.length),f=a(e,h),p=a(void 0===t?h:t,h);if(o(d)&&("function"!=typeof(n=d.constructor)|| n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return g.call(d,f,p);for(r=new (void 0===n?Array:n)(y(p-f,0)),c=0;f1?arguments[1]: void 0)}})}, 4115:function _(e,t,n){var r=n(76887),i=n(33916),o=n(89678),a=n(95981),s=n(34194),u=[],l=u.sort,c=a(function(){u.sort(void 0)}),d=a(function(){u.sort(null)}),h=s("sort"); r({target:"Array",proto:!0,forced:c||!d||!h},{sort:function sort(e){return void 0===e?l.call(o(this)):l.call(o(this),i(e))}})}, 98611:function _(e,t,n){var r=n(76887),i=n(59413),o=n(68459),a=n(43057),s=n(89678),u=n(64692),l=n(55449),c=n(50568),d=n(65486),h=c("splice"),f=d("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,v=Math.min,g= 9007199254740991,y="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!h||!f},{splice:function splice(e,t){var n,r,c,d,h,f,m=s(this),_=a(m.length),E=i(e,_),T=arguments.length;if(0===T? n=r=0:1===T?(n=0,r=_-E):(n=T-2,r=v(p(o(t),0),_-E)),_+n-r>g)throw TypeError(y);for(c=u(m,r),d=0;d_-r+n;d--)delete m[d-1]}else if(n>r)for(d=_-r;d>E;d--)f=d+n-1,(h=d+r-1)in m?m[f]=m[h]:delete m[f];for(d=0;dd;)void 0!==(n=i(r,t=l[d++]))&&u(c,t,n);return c}})}, 9816:function _(e,t,n){var r=n(76887),i=n(95981),o=n(684).f;r({target:"Object",stat:!0,forced:i(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:o})}, 17405:function _(e,t,n){var r=n(76887),i=n(95981),o=n(89678),a=n(249),s=n(64160);r({target:"Object",stat:!0,forced:i(function(){a(1)}), sham:!s},{getPrototypeOf:function getPrototypeOf(e){return a(o(e))}})}, 21724:function _(e,t,n){var r=n(76887),i=n(89678),o=n(14771);r({target:"Object",stat:!0,forced:n(95981)(function(){o(1)})},{keys:function keys(e){return o(i(e))}})}, 90108:function _(e,t,n){n(76887)({target:"Object",stat:!0},{setPrototypeOf:n(88929)})}, 55967:function _(){}, 26614:function _(e,t,n){var r=n(76887),i=n(88810).values;r({target:"Object",stat:!0},{values:function values(e){return i(e)}})}, 49718:function _(e,t,n){var r=n(76887),i=n(81942);r({global:!0,forced:parseFloat!=i},{parseFloat:i})}, 14038:function _(e,t,n){var r=n(76887),i=n(29806);r({global:!0,forced:parseInt!=i},{parseInt:i})}, 4560:function _(e,t,n){var r=n(76887),i=n(33916),o=n(69520),a=n(40002),s=n(93091);r({target:"Promise",stat:!0},{allSettled:function allSettled(e){var t=this,n=o.f(t),r=n.resolve,u=n.reject,l=a(function(){var n= i(t.resolve),o=[],a=0,u=1;s(e,function(e){var i=a++,s=!1;o.push(void 0),u++,n.call(t,e).then(function(e){s||(s=!0,o[i]={status:"fulfilled",value:e},--u||r(o))},function(e){s||(s=!0,o[i]={status:"rejected", reason:e},--u||r(o))})}),--u||r(o)}); return l.error&&u(l.value),n.promise}})}, 91302:function _(e,t,n){var r=n(76887),i=n(33916),o=n(626),a=n(69520),s=n(40002),u=n(93091),l="No one promise resolved";r({target:"Promise",stat:!0},{any:function any(e){var t=this,n=a.f(t),r=n.resolve, c=n.reject,d=s(function(){var n=i(t.resolve),a=[],s=0,d=1,h=!1;u(e,function(e){var i=s++,u=!1;a.push(void 0),d++,n.call(t,e).then(function(e){u||h||(h=!0,r(e))},function(e){u||h||(u=!0,a[i]=e,--d||c(new (o("AggregateError"))(a, l)))})}),--d||c(new (o("AggregateError"))(a,l))}); return d.error&&c(d.value),n.promise}})}, 44349:function _(e,t,n){var r=n(76887),i=n(82529),o=n(19297),a=n(95981),s=n(626),u=n(70487),l=n(56584),c=n(99754);r({target:"Promise",proto:!0,real:!0,forced:!!o&&a(function(){o.prototype["finally"].call({then:function then(){}}, function(){})})},{"finally":function _finally(e){var t=u(this,s("Promise")),n="function"==typeof e; return this.then(n?function(n){return l(t,e()).then(function(){return n})}:e,n?function(n){return l(t,e()).then(function(){throw n; })}:e)}}),i||"function"!=typeof o||o.prototype["finally"]||c(o.prototype,"finally",s("Promise").prototype["finally"])}, 98881:function _(e,t,n){var r,i,o,a,s=n(76887),u=n(82529),l=n(21899),c=n(626),d=n(19297),h=n(99754),f=n(87524),p=n(90904),v=n(94431),g=n(10941),y=n(33916),m=n(5743),_=n(81302),E=n(93091),T=n(21385),b=n(70487), S=n(42941).set,w=n(66132),A=n(56584),R=n(34845),L=n(69520),I=n(40002),C=n(45402),O=n(37252),P=n(99813),k=n(6049),D=n(53385),x=P("species"),N="Promise",M=C.get,U=C.set,F=C.getterFor(N),_B=d,V=l.TypeError, H=l.document,j=l.process,G=c("fetch"),K=L.f,z=K,W=!!(H&&H.createEvent&&l.dispatchEvent),q="function"==typeof PromiseRejectionEvent,Z="unhandledrejection",Y=O(N,function(){if(_(_B)===String(_B)){if(66=== D)return!0;if(!k&&!q)return!0}if(u&&!_B.prototype["finally"])return!0;if(D>=51&&/native code/.test(_B))return!1;var e=_B.resolve(1),t=function t(e){e(function(){},function(){})}; return(e.constructor={})[x]=t,!(e.then(function(){})instanceof t)}),X=Y||!T(function(e){_B.all(e)["catch"](function(){})}),Q=function Q(e){var t; return!(!g(e)||"function"!=typeof(t=e.then))&&t},J=function J(e,t){if(!e.notified){e.notified=!0; var n=e.reactions;w(function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s,u,l=n[o++],c=i?l.ok:l.fail,d=l.resolve,h=l.reject,f=l.domain;try{c?(i||(2===e.rejection&&ne(e),e.rejection=1),!0=== c?a=r:(f&&f.enter(),a=c(r),f&&(f.exit(),u=!0)),a===l.promise?h(V("Promise-chain cycle")):(s=Q(a))?s.call(a,d,h):d(a)):h(r)}catch(e){f&&!u&&f.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ee(e)})}}, $=function $(e,t,n){var r,i; W?((r=H.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),l.dispatchEvent(r)):r={promise:t,reason:n},!q&&(i=l["on"+e])?i(r):e===Z&&R("Unhandled promise rejection",n)},ee=function ee(e){S.call(l, function(){var t,n=e.facade,r=e.value; if(te(e)&&(t=I(function(){k?j.emit("unhandledRejection",r,n):$(Z,n,r)}),e.rejection=k||te(e)?2:1,t.error))throw t.value; })},te=function te(e){return 1!==e.rejection&&!e.parent},ne=function ne(e){S.call(l,function(){var t=e.facade; k?j.emit("rejectionHandled",t):$("rejectionhandled",t,e.value)})},re=function re(e,t,n){return function(r){e(t,r,n)}},ie=function ie(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,J(e,!0))},oe= function oe(e,t,n){if(!e.done){e.done=!0,n&&(e=n); try{if(e.facade===t)throw V("Promise can't be resolved itself");var r=Q(t);r?w(function(){var n={done:!1};try{r.call(t,re(oe,n,e),re(ie,n,e))}catch(t){ie(n,t,e)}}):(e.value=t,e.state=1,J(e,!1))}catch(t){ie({done:!1}, t,e)}}}; Y&&(_B=function B(e){m(this,_B,N),y(e),r.call(this);var t=M(this);try{e(re(oe,t),re(ie,t))}catch(e){ie(t,e)}},(r=function r(e){U(this,{type:N, done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(_B.prototype,{then:function then(e,t){var n=F(this),r=K(b(this,_B)); return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=k?j.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&J(n,!1),r.promise}, "catch":function _catch(e){return this.then(void 0,e)}}),i=function i(){var e=new r,t=M(e); this.promise=e,this.resolve=re(oe,t),this.reject=re(ie,t)},L.f=K=function K(e){return e===_B||e===o?new i(e):z(e)},u||"function"!=typeof d||(a=d.prototype.then,h(d.prototype,"then",function(e,t){var n= this; return(new _B(function(e,t){a.call(n,e,t)})).then(e,t)},{unsafe:!0}),"function"==typeof G&&s({global:!0, enumerable:!0,forced:!0},{fetch:function fetch(e){return A(_B,G.apply(l,arguments))}}))),s({global:!0, wrap:!0,forced:Y},{Promise:_B}),p(_B,N,!1,!0),v(N),o=c(N),s({target:N,stat:!0,forced:Y},{reject:function reject(e){var t=K(this);return t.reject.call(void 0,e),t.promise}}),s({target:N, stat:!0,forced:u||Y},{resolve:function resolve(e){return A(u&&this===o?_B:this,e)}}),s({target:N, stat:!0,forced:X},{all:function all(e){var t=this,n=K(t),r=n.resolve,i=n.reject,o=I(function(){var n=y(t.resolve),o=[],a=0,s=1;E(e,function(e){var u=a++,l=!1;o.push(void 0),s++,n.call(t,e).then(function(e){l|| (l=!0,o[u]=e,--s||r(o))},i)}),--s||r(o)}); return o.error&&i(o.value),n.promise}, race:function race(e){var t=this,n=K(t),r=n.reject,i=I(function(){var i=y(t.resolve);E(e,function(e){i.call(t,e).then(n.resolve,r)})}); return i.error&&r(i.value),n.promise}})}, 7453:function _(e,t,n){var r=n(76887),i=n(626),o=n(33916),a=n(96059),s=n(10941),u=n(29290),l=n(98308),c=n(95981),d=i("Reflect","construct"),h=c(function(){function e(){} return!(d(function(){},[],e)instanceof e)}),f=!c(function(){d(function(){})}),p=h||f; r({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function construct(e,t){o(e),a(t);var n=arguments.length<3?e:o(arguments[2]);if(f&&!h)return d(e,t,n);if(e==n){switch(t.length){case 0:return new e; case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new (l.apply(e,r))}var i=n.prototype, c=u(s(i)?i:Object.prototype),p=Function.apply.call(e,c,t);return s(p)?p:c}})}, 42355:function _(e,t,n){var r=n(76887),i=n(10941),o=n(96059),a=n(47457),s=n(49677),u=n(249);r({target:"Reflect",stat:!0},{get:function e(t,n){var r,l,c=arguments.length<3?t:arguments[2];return o(t)===c? t[n]:(r=s.f(t,n))?a(r,"value")?r.value:void 0===r.get?void 0:r.get.call(c):i(l=u(t))?e(l,n,c):void 0}})}, 1502:function _(){}, 94261:function _(){}, 69008:function _(e,t,n){var r=n(24683),i=n(85616);e.exports=r("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i)}, 1293:function _(e,t,n){var r,i=n(76887),o=n(49677).f,a=n(43057),s=n(70344),u=n(48219),l=n(67772),c=n(82529),d="".endsWith,h=Math.min,f=l("endsWith");i({target:"String",proto:!0,forced:!(!c&&!f&&(r=o(String.prototype, "endsWith"),r&&!r.writable)||f)},{endsWith:function endsWith(e){var t=String(u(this));s(e);var n=arguments.length>1?arguments[1]:void 0,r=a(t.length),i=void 0===n?r:h(a(n),r),o=String(e);return d?d.call(t, o,i):t.slice(i-o.length,i)===o}})}, 11035:function _(e,t,n){var r=n(76887),i=n(70344),o=n(48219);r({target:"String",proto:!0,forced:!n(67772)("includes")},{includes:function includes(e){return!!~String(o(this)).indexOf(i(e),arguments.length> 1?arguments[1]:void 0)}})}, 77971:function _(e,t,n){var r=n(64620).charAt,i=n(45402),o=n(47771),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",function(e){s(this,{type:a,string:String(e),index:0})},function(){var e, t=u(this),n=t.string,i=t.index; return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})})}, 92075:function _(e,t,n){var r=n(76887),i=n(6930).start;r({target:"String",proto:!0,forced:n(4887)},{padStart:function padStart(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})}, 94761:function _(e,t,n){var r,i=n(76887),o=n(49677).f,a=n(43057),s=n(70344),u=n(48219),l=n(67772),c=n(82529),d="".startsWith,h=Math.min,f=l("startsWith");i({target:"String",proto:!0,forced:!(!c&&!f&&(r= o(String.prototype,"startsWith"),r&&!r.writable)||f)},{startsWith:function startsWith(e){var t=String(u(this));s(e);var n=a(h(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return d?d.call(t, r,n):t.slice(n,n+r.length)===r}})}, 57398:function _(e,t,n){var r=n(76887),i=n(74853).trim;r({target:"String",proto:!0,forced:n(93093)("trim")},{trim:function trim(){return i(this)}})}, 8555:function _(e,t,n){n(66349)("asyncIterator")}, 52615:function _(){}, 21732:function _(e,t,n){n(66349)("hasInstance")}, 35903:function _(e,t,n){n(66349)("isConcatSpreadable")}, 1825:function _(e,t,n){n(66349)("iterator")}, 35824:function _(e,t,n){var r=n(76887),i=n(21899),o=n(626),a=n(82529),s=n(55746),u=n(72497),l=n(32302),c=n(95981),d=n(47457),h=n(1052),f=n(10941),p=n(96059),v=n(89678),g=n(74529),y=n(46935),m=n(31887), _=n(29290),E=n(14771),T=n(10946),b=n(684),S=n(87857),w=n(49677),A=n(65988),R=n(36760),L=n(32029),I=n(99754),C=n(68726),O=n(44262),P=n(27748),k=n(99418),D=n(99813),x=n(11477),N=n(66349),M=n(90904),U=n(45402), F=n(3610).forEach,B=O("hidden"),V="Symbol",H="prototype",j=D("toPrimitive"),G=U.set,K=U.getterFor(V),z=Object[H],_W2=i.Symbol,q=o("JSON","stringify"),Z=w.f,Y=A.f,X=b.f,Q=R.f,J=C("symbols"),$=C("op-symbols"), ee=C("string-to-symbol-registry"),te=C("symbol-to-string-registry"),ne=C("wks"),re=i.QObject,ie=!re||!re[H]||!re[H].findChild,oe=s&&c(function(){return 7!=_(Y({},"a",{get:function get(){return Y(this,"a", {value:7}).a}})).a})?function(e,t,n){var r=Z(z,t); r&&delete z[t],Y(e,t,n),r&&e!==z&&Y(z,t,r)}:Y,ae=function ae(e,t){var n=J[e]=_(_W2[H]); return G(n,{type:V,tag:e,description:t}),s||(n.description=t),n},se=l?function(e){return"symbol"==_typeof(e)}:function(e){return Object(e)instanceof _W2},ue=function ue(e,t,n){e===z&&ue($,t,n),p(e); var r=y(t,!0);return p(n),d(J,r)?(n.enumerable?(d(e,B)&&e[B][r]&&(e[B][r]=!1),n=_(n,{enumerable:m(0,!1)})):(d(e,B)||Y(e,B,m(1,{})),e[B][r]=!0),oe(e,r,n)):Y(e,r,n)},le=function le(e,t){p(e); var n=g(t),r=E(n).concat(fe(n));return F(r,function(t){s&&!ce.call(n,t)||ue(e,t,n[t])}),e},ce=function ce(e){var t=y(e,!0),n=Q.call(this,t); return!(this===z&&d(J,t)&&!d($,t))&&(!(n||!d(this,t)||!d(J,t)||d(this,B)&&this[B][t])||n)},de=function de(e,t){var n=g(e),r=y(t,!0); if(n!==z||!d(J,r)||d($,r)){var i=Z(n,r);return!i||!d(J,r)||d(n,B)&&n[B][r]||(i.enumerable=!0),i}},he=function he(e){var t=X(g(e)),n=[]; return F(t,function(e){d(J,e)||d(P,e)||n.push(e)}),n},fe=function fe(e){var t=e===z,n=X(t?$:g(e)),r=[]; return F(n,function(e){!d(J,e)||t&&!d(z,e)||r.push(J[e])}),r}; u||(_W2=function W(){if(this instanceof _W2)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=k(e),n=function n(e){this===z&&n.call($, e),d(this,B)&&d(this[B],t)&&(this[B][t]=!1),oe(this,t,m(1,e))}; return s&&ie&&oe(z,t,{configurable:!0,set:n}),ae(t,e)},I(_W2[H],"toString",function(){return K(this).tag}),I(_W2,"withoutSetter",function(e){return ae(k(e),e)}),R.f=ce,A.f=ue,w.f=de,T.f=b.f=he,S.f=fe,x.f= function(e){return ae(D(e),e)},s&&(Y(_W2[H],"description",{configurable:!0, get:function get(){return K(this).description}}),a||I(z,"propertyIsEnumerable",ce,{unsafe:!0}))),r({global:!0, wrap:!0,forced:!u,sham:!u},{Symbol:_W2}),F(E(ne),function(e){N(e)}),r({target:V, stat:!0,forced:!u},{"for":function _for(e){var t=String(e);if(d(ee,t))return ee[t];var n=_W2(t);return ee[t]=n,te[n]=t,n}, keyFor:function keyFor(e){if(!se(e))throw TypeError(e+" is not a symbol");if(d(te,e))return te[e]}, useSetter:function useSetter(){ie=!0}, useSimple:function useSimple(){ie=!1}}),r({target:"Object", stat:!0,forced:!u,sham:!s},{create:function create(e,t){return void 0===t?_(e):le(_(e),t)}, defineProperty:ue,defineProperties:le,getOwnPropertyDescriptor:de}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:he,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:c(function(){S.f(1)})}, {getOwnPropertySymbols:function getOwnPropertySymbols(e){return S.f(v(e))}}),q&&r({target:"JSON", stat:!0,forced:!u||c(function(){var e=_W2();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))})},{stringify:function stringify(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]); if(r=t,(f(t)||void 0!==e)&&!se(e))return h(t)||(t=function t(e,_t1){if("function"==typeof r&&(_t1=r.call(this,e,_t1)),!se(_t1))return _t1}),i[1]=t,q.apply(null,i)}}),_W2[H][j]||L(_W2[H],j,_W2[H].valueOf), M(_W2,V),P[B]=!0}, 45915:function _(e,t,n){n(66349)("matchAll")}, 28394:function _(e,t,n){n(66349)("match")}, 61766:function _(e,t,n){n(66349)("replace")}, 62737:function _(e,t,n){n(66349)("search")}, 89911:function _(e,t,n){n(66349)("species")}, 74315:function _(e,t,n){n(66349)("split")}, 63131:function _(e,t,n){n(66349)("toPrimitive")}, 64714:function _(e,t,n){n(66349)("toStringTag")}, 70659:function _(e,t,n){n(66349)("unscopables")}, 54334:function _(e,t,n){var r,i=n(21899),o=n(87524),a=n(21647),s=n(24683),u=n(8850),l=n(10941),c=n(45402).enforce,d=n(38019),h=!i.ActiveXObject&&"ActiveXObject"in i,f=Object.isExtensible,p=function p(e){return function(){return e(this, arguments.length?arguments[0]:void 0)}},v=e.exports=s("WeakMap",p,u); if(d&&h){r=u.getConstructor(p,"WeakMap",!0),a.REQUIRED=!0;var g=v.prototype,y=g["delete"],m=g.has,_=g.get,E=g.set;o(g,{"delete":function _delete(e){if(l(e)&&!f(e)){var t=c(this);return t.frozen||(t.frozen= new r),y.call(this,e)||t.frozen["delete"](e)}return y.call(this,e)}, has:function has(e){if(l(e)&&!f(e)){var t=c(this);return t.frozen||(t.frozen=new r),m.call(this,e)||t.frozen.has(e)}return m.call(this,e)}, get:function get(e){if(l(e)&&!f(e)){var t=c(this);return t.frozen||(t.frozen=new r),m.call(this,e)?_.call(this,e):t.frozen.get(e)}return _.call(this,e)}, set:function set(e,t){if(l(e)&&!f(e)){var n=c(this);n.frozen||(n.frozen=new r),m.call(this,e)?E.call(this,e,t):n.frozen.set(e,t)}else E.call(this,e,t);return this}})}}, 1773:function _(e,t,n){n(24683)("WeakSet",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},n(8850))}, 9668:function _(e,t,n){n(52595)}, 66591:function _(e,t,n){var r=n(76887),i=n(82529),o=n(28984);r({target:"Map",proto:!0,real:!0,forced:i},{deleteAll:function deleteAll(){return o.apply(this,arguments)}})}, 55121:function _(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:n(82529)},{emplace:n(48721)})}, 14751:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(86843),s=n(79993),u=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{every:function every(e){var t=o(this),n=s(t),r=a(e,arguments.length> 1?arguments[1]:void 0,3);return!u(n,function(e,n,i){if(!r(n,e,t))return i()},{AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})}, 52407:function _(e,t,n){var r=n(76887),i=n(82529),o=n(626),a=n(96059),s=n(33916),u=n(86843),l=n(70487),c=n(79993),d=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{filter:function filter(e){var t= a(this),n=c(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new (l(t,o("Map"))),h=s(i.set);return d(n,function(e,n){r(n,e,t)&&h.call(i,e,n)},{AS_ENTRIES:!0, IS_ITERATOR:!0}),i}})}, 27281:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(86843),s=n(79993),u=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{findKey:function findKey(e){var t=o(this),n=s(t),r=a(e,arguments.length> 1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(e)},{AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).result}})}, 48580:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(86843),s=n(79993),u=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{find:function find(e){var t=o(this),n=s(t),r=a(e,arguments.length> 1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(n)},{AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).result}})}, 52453:function _(e,t,n){n(76887)({target:"Map",stat:!0},{from:n(83590)})}, 36507:function _(e,t,n){var r=n(76887),i=n(93091),o=n(33916);r({target:"Map",stat:!0},{groupBy:function groupBy(e,t){var n=new this;o(t);var r=o(n.has),a=o(n.get),s=o(n.set);return i(e,function(e){var i= t(e);r.call(n,i)?a.call(n,i).push(e):s.call(n,i,[e])}),n}})}, 93647:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(79993),s=n(57309),u=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{includes:function includes(e){return u(a(o(this)),function(t,n, r){if(s(n,e))return r()},{AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})}, 47641:function _(e,t,n){var r=n(76887),i=n(93091),o=n(33916);r({target:"Map",stat:!0},{keyBy:function keyBy(e,t){var n=new this;o(t);var r=o(n.set);return i(e,function(e){r.call(n,t(e),e)}),n}})}, 18552:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(79993),s=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function keyOf(e){return s(a(o(this)),function(t,n,r){if(n===e)return r(t)}, {AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).result}})}, 27693:function _(e,t,n){var r=n(76887),i=n(82529),o=n(626),a=n(96059),s=n(33916),u=n(86843),l=n(70487),c=n(79993),d=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{mapKeys:function mapKeys(e){var t= a(this),n=c(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new (l(t,o("Map"))),h=s(i.set);return d(n,function(e,n){h.call(i,r(n,e,t),n)},{AS_ENTRIES:!0, IS_ITERATOR:!0}),i}})}, 8:function _(e,t,n){var r=n(76887),i=n(82529),o=n(626),a=n(96059),s=n(33916),u=n(86843),l=n(70487),c=n(79993),d=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{mapValues:function mapValues(e){var t= a(this),n=c(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new (l(t,o("Map"))),h=s(i.set);return d(n,function(e,n){h.call(i,e,r(n,e,t))},{AS_ENTRIES:!0, IS_ITERATOR:!0}),i}})}, 48514:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(33916),s=n(93091);r({target:"Map",proto:!0,real:!0,forced:i},{merge:function merge(e){for(var t=o(this),n=a(t.set),r=0;r 1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i()},{AS_ENTRIES:!0, IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})}, 68826:function _(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:n(82529)},{updateOrInsert:n(20716)})}, 78485:function _(e,t,n){var r=n(76887),i=n(82529),o=n(96059),a=n(33916);r({target:"Map",proto:!0,real:!0,forced:i},{update:function update(e,t){var n=o(this),r=arguments.length;a(t);var i=n.has(e);if(!i&& r<3)throw TypeError("Updating absent value");var s=i?n.get(e):a(r>2?arguments[2]:void 0)(e,n);return n.set(e,t(s,e,n)),n}})}, 42256:function _(e,t,n){n(76887)({target:"Map",proto:!0,real:!0,forced:n(82529)},{upsert:n(20716)})}, 7634:function _(e,t,n){n(66274);var r=n(63281),i=n(21899),o=n(9697),a=n(32029),s=n(12077),u=n(99813)("toStringTag");for(var l in r){var c=i[l],d=c&&c.prototype;d&&o(d)!==u&&a(d,u,l),s[l]=s.Array}}, 71249:function _(e,t,n){var r=n(76887),i=n(21899),o=n(2861),a=[].slice,s=function s(e){return function(t,n){var r=arguments.length>2,i=r?a.call(arguments,2):void 0;return e(r?function(){("function"==typeof t? t:Function(t)).apply(this,i)}:t,n)}}; r({global:!0,bind:!0,forced:/MSIE .\./.test(o)},{setTimeout:s(i.setTimeout),setInterval:s(i.setInterval)})}, 95304:function _(e,t,n){n(66274);var r=n(76887),i=n(626),o=n(28468),a=n(99754),s=n(87524),u=n(90904),l=n(31046),c=n(45402),d=n(5743),h=n(47457),f=n(86843),p=n(9697),v=n(96059),g=n(10941),y=n(29290),m=n(31887), _=n(53476),E=n(22902),T=n(99813),b=i("fetch"),S=i("Headers"),w=T("iterator"),A="URLSearchParams",R=A+"Iterator",L=c.set,I=c.getterFor(A),C=c.getterFor(R),O=/\+/g,P=Array(4),k=function k(e){return P[e-1]|| (P[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},D=function D(e){try{return decodeURIComponent(e)}catch(t){return e}},x=function x(e){var t=e.replace(O," "),n=4; try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(k(n--),D);return t}},N=/[!'()~]|%20/g,M={"!":"%21", "'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},U=function U(e){return M[e]},F=function F(e){return encodeURIComponent(e).replace(N,U)},B=function B(e,t){if(t)for(var n,r,i=t.split("\x26"),o=0;o0?arguments[0]:void 0,c=this,f=[];if(L(c,{type:A,entries:f,updateURL:function updateURL(){}, updateSearchParams:V}),void 0!==l)if(g(l))if("function"==typeof(e=E(l)))for(n=(t=e.call(l)).next;!(r=n.call(t)).done;){if((a=(o=(i=_(v(r.value))).next).call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2"); f.push({key:a.value+"",value:s.value+""})}else for(u in l)h(l,u)&&f.push({key:u,value:l[u]+""});else B(f,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")},K=G.prototype; s(K,{append:function append(e,t){H(arguments.length,2);var n=I(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()}, "delete":function _delete(e){H(arguments.length,1);for(var t=I(this),n=t.entries,r=e+"",i=0;ie.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()}, forEach:function forEach(e){for(var t,n=I(this).entries,r=f(e,arguments.length>1?arguments[1]:void 0,3),i=0;i1&&(g(t=arguments[1])&& (n=t.body,p(n)===A&&((r=t.headers?new S(t.headers):new S).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset\x3dUTF-8"),t=y(t,{body:m(0,String(n)),headers:m(0,r)}))),i.push(t)), b.apply(this,i)}}),e.exports={URLSearchParams:G, getState:I}}, 33601:function _(e,t,n){n(77971);var r,i=n(76887),o=n(55746),a=n(28468),s=n(21899),u=n(59938),l=n(99754),c=n(5743),d=n(47457),h=n(24420),f=n(11354),p=n(64620).codeAt,v=n(73291),g=n(90904),y=n(95304),m= n(45402),_=s.URL,E=y.URLSearchParams,T=y.getState,b=m.set,S=m.getterFor("URL"),w=Math.floor,A=Math.pow,R="Invalid scheme",L="Invalid host",I="Invalid port",C=/[A-Za-z]/,O=/[\d+-.A-Za-z]/,P=/\d/,k=/^(0x|0X)/, D=/^[0-7]+$/,x=/^\d+$/,N=/^[\dA-Fa-f]+$/,M=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,U=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,F=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,B=/[\u0009\u000A\u000D]/g,V=function V(e, t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return L;if(!(n=j(t.slice(1,-1))))return L;e.host=n}else if(X(e)){if(t=v(t),M.test(t))return L;if(null===(n=H(t)))return L;e.host=n}else{if(U.test(t))return L; for(n="",r=f(t),i=0;i4)return e;for(n=[],r=0;r1&&"0"==i.charAt(0)&&(o=k.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10== o?x:8==o?D:N).test(i))return e;a=parseInt(i,o)}n.push(a)}for(r=0;r=A(256,5-t))return null}else if(a>255)return null;for(s=n.pop(),r=0;r6)return;for(r= 0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;d++}if(!P.test(h()))return;for(;P.test(h());){if(o=parseInt(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;d++}u[l]=256*u[l]+i,2!=++r&& 4!=r||l++}if(4!=r)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;u[l++]=t}else{if(null!==c)return;d++,c=++l}}if(null!==c)for(a=l-c,l=7;0!=l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!= l)return;return u},G=function G(e){var t,n,r,i; if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=w(e/256);return t.join(".")}if("object"==_typeof(e)){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r, n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":"))); return"["+t+"]"}return e},K={},z=h({},K,{" ":1, '"':1,"\x3c":1,"\x3e":1,"`":1}),W=h({},z,{"#":1,"?":1,"{":1,"}":1}),q=h({},W,{"/":1,":":1,";":1,"\x3d":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Z=function Z(e,t){var n=p(e,0);return n>32&&n<127&&!d(t,e)? e:encodeURIComponent(e)},Y={ftp:21, file:null,http:80,https:443,ws:80,wss:443},X=function X(e){return d(Y,e.scheme)},Q=function Q(e){return""!=e.username||""!=e.password},J=function J(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme}, $=function $(e,t){var n; return 2==e.length&&C.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ee=function ee(e){var t; return e.length>1&&$(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function te(e){var t=e.path,n=t.length; !n||"file"==e.scheme&&1==n&&$(t[0],!0)||t.pop()},ne=function ne(e){return"."===e||"%2e"===e.toLowerCase()},re={},ie={},oe={},ae={},se={},ue={},le={},ce={},de={},he={},fe={},pe={},ve={},ge={},ye={},me={}, _e={},Ee={},Te={},be={},Se={},we=function we(e,t,n,i){var o,a,s,u,l,c=n||re,h=0,p="",v=!1,g=!1,y=!1; for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(F,"")),t=t.replace(B,""),o=f(t);h<=o.length;){switch(a=o[h], c){case re:if(!a||!C.test(a)){if(n)return R;c=oe;continue}p+=a.toLowerCase(),c=ie;break;case ie:if(a&&(O.test(a)||"+"==a||"-"==a||"."==a))p+=a.toLowerCase();else{if(":"!=a){if(n)return R;p="",c=oe,h=0; continue}if(n&&(X(e)!=d(Y,p)||"file"==p&&(Q(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=p,n)return void(X(e)&&Y[e.scheme]==e.port&&(e.port=null));p="","file"==e.scheme?c=ge:X(e)&& i&&i.scheme==e.scheme?c=ae:X(e)?c=ce:"/"==o[h+1]?(c=se,h++):(e.cannotBeABaseURL=!0,e.path.push(""),c=Te)}break;case oe:if(!i||i.cannotBeABaseURL&&"#"!=a)return R;if(i.cannotBeABaseURL&&"#"==a){e.scheme= i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=Se;break}c="file"==i.scheme?ge:ue;continue;case ae:if("/"!=a||"/"!=o[h+1]){c=ue;continue}c=de,h++;break;case se:if("/"== a){c=he;break}c=Ee;continue;case ue:if(e.scheme=i.scheme,a==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&X(e))c= le;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=be;else{if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host, e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=Ee;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Se}break;case le:if(!X(e)|| "/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=Ee;continue}c=he}else c=de;break;case ce:if(c=de,"/"!=a||"/"!=p.charAt(h+1))continue;h++;break;case de:if("/"!= a&&"\\"!=a){c=he;continue}break;case he:if("@"==a){v&&(p="%40"+p),v=!0,s=f(p);for(var m=0;m65535)return I;e.port=X(e)&&T===Y[e.scheme]? null:T,p=""}if(n)return;c=_e;continue}return I}p+=a;break;case ge:if(e.scheme="file","/"==a||"\\"==a)c=ye;else{if(!i||"file"!=i.scheme){c=Ee;continue}if(a==r)e.host=i.host,e.path=i.path.slice(),e.query= i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",c=be;else{if("#"!=a){ee(o.slice(h).join(""))||(e.host=i.host,e.path=i.path.slice(),te(e)),c=Ee;continue}e.host=i.host,e.path=i.path.slice(), e.query=i.query,e.fragment="",c=Se}}break;case ye:if("/"==a||"\\"==a){c=me;break}i&&"file"==i.scheme&&!ee(o.slice(h).join(""))&&($(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=Ee;continue;case me:if(a== r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&$(p))c=Ee;else if(""==p){if(e.host="",n)return;c=_e}else{if(u=V(e,p))return u;if("localhost"==e.host&&(e.host=""),n)return;p="",c=_e}continue}p+=a;break;case _e:if(X(e)){if(c= Ee,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=r&&(c=Ee,"/"!=a))continue}else e.fragment="",c=Se;else e.query="",c=be;break;case Ee:if(a==r||"/"==a||"\\"==a&&X(e)||!n&&("?"==a||"#"== a)){if(".."===(l=(l=p).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(te(e),"/"==a||"\\"==a&&X(e)||e.path.push("")):ne(p)?"/"==a||"\\"==a&&X(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&& $(p)&&(e.host&&(e.host=""),p=p.charAt(0)+":"),e.path.push(p)),p="","file"==e.scheme&&(a==r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=be):"#"==a&&(e.fragment= "",c=Se)}else p+=Z(a,W);break;case Te:"?"==a?(e.query="",c=be):"#"==a?(e.fragment="",c=Se):a!=r&&(e.path[0]+=Z(a,K));break;case be:n||"#"!=a?a!=r&&("'"==a&&X(e)?e.query+="%27":e.query+="#"==a?"%23":Z(a, K)):(e.fragment="",c=Se);break;case Se:a!=r&&(e.fragment+=Z(a,z))}h++}},Ae=function Ae(e){var t,n,r=c(this,Ae,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),s=b(r,{type:"URL"}); if(void 0!==i)if(i instanceof Ae)t=S(i);else if(n=we(t={},String(i)))throw TypeError(n);if(n=we(s,a,null,t))throw TypeError(n);var u=s.searchParams=new E,l=T(u);l.updateSearchParams(s.query),l.updateURL= function(){s.query=String(u)||null},o||(r.href=Le.call(r),r.origin=Ie.call(r),r.protocol=Ce.call(r),r.username=Oe.call(r),r.password=Pe.call(r),r.host=ke.call(r),r.hostname=De.call(r),r.port=xe.call(r), r.pathname=Ne.call(r),r.search=Me.call(r),r.searchParams=Ue.call(r),r.hash=Fe.call(r))},Re=Ae.prototype,Le=function Le(){var e=S(this),t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s= e.query,u=e.fragment,l=t+":"; return null!==i?(l+="//",Q(e)&&(l+=n+(r?":"+r:"")+"@"),l+=G(i),null!==o&&(l+=":"+o)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u), l},Ie=function Ie(){var e=S(this),t=e.scheme,n=e.port; if("blob"==t)try{return(new URL(t.path[0])).origin}catch(e){return"null"}return"file"!=t&&X(e)?t+"://"+G(e.host)+(null!==n?":"+n:""):"null"},Ce=function Ce(){return S(this).scheme+":"},Oe=function Oe(){return S(this).username}, Pe=function Pe(){return S(this).password},ke=function ke(){var e=S(this),t=e.host,n=e.port; return null===t?"":null===n?G(t):G(t)+":"+n},De=function De(){var e=S(this).host; return null===e?"":G(e)},xe=function xe(){var e=S(this).port; return null===e?"":String(e)},Ne=function Ne(){var e=S(this),t=e.path; return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Me=function Me(){var e=S(this).query; return e?"?"+e:""},Ue=function Ue(){return S(this).searchParams},Fe=function Fe(){var e=S(this).fragment; return e?"#"+e:""},Be=function Be(e,t){return{get:e, set:t,configurable:!0,enumerable:!0}}; if(o&&u(Re,{href:Be(Le,function(e){var t=S(this),n=String(e),r=we(t,n);if(r)throw TypeError(r);T(t.searchParams).updateSearchParams(t.query)}), origin:Be(Ie),protocol:Be(Ce,function(e){var t=S(this);we(t,String(e)+":",re)}), username:Be(Oe,function(e){var t=S(this),n=f(String(e));if(!J(t)){t.username="";for(var r=0;r=0&&e=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0, done:!0}},e.prototype["throw"]=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e; },e.prototype["return"]=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e, done:!0}},e}(); return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2} return Object.defineProperty(t.prototype,"size",{get:function get(){return this._keys.length}, enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1); return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0); return this._values[n]=t,this},t.prototype["delete"]=function(t){var n=this._find(t,!1); if(n>=0){for(var r=this._keys.length,i=n+1;i=0;--n){var r=(0,e[n])(t);if(!S(r)&&!w(r)){if(!O(r))throw new TypeError; t=r}}return t}(e,t)}if(!I(e))throw new TypeError; if(!A(t))throw new TypeError;if(!A(r)&&!S(r)&&!w(r))throw new TypeError;return w(r)&&(r=void 0),function(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!S(o)&&!w(o)){if(!A(o))throw new TypeError; r=o}}return r}(e,t,n=L(n),r)}),e("metadata",function(e,t){return function(n,r){if(!A(n))throw new TypeError; if(!S(r)&&!function(e){switch(b(e)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError; _(e,t,n,r)}}),e("defineMetadata",function(e,t,n,r){if(!A(n))throw new TypeError; return S(r)||(r=L(r)),_(e,t,n,r)}),e("hasMetadata",function(e,t,n){if(!A(t))throw new TypeError; return S(n)||(n=L(n)),v(e,t,n)}),e("hasOwnMetadata",function(e,t,n){if(!A(t))throw new TypeError; return S(n)||(n=L(n)),g(e,t,n)}),e("getMetadata",function(e,t,n){if(!A(t))throw new TypeError; return S(n)||(n=L(n)),y(e,t,n)}),e("getOwnMetadata",function(e,t,n){if(!A(t))throw new TypeError; return S(n)||(n=L(n)),m(e,t,n)}),e("getMetadataKeys",function(e,t){if(!A(e))throw new TypeError; return S(t)||(t=L(t)),E(e,t)}),e("getOwnMetadataKeys",function(e,t){if(!A(e))throw new TypeError; return S(t)||(t=L(t)),T(e,t)}),e("deleteMetadata",function(e,t,n){if(!A(t))throw new TypeError; S(n)||(n=L(n));var r=p(t,n,!1);if(S(r))return!1;if(!r["delete"](e))return!1;if(r.size>0)return!0;var i=f.get(t);return i["delete"](n),i.size>0||f["delete"](t),!0})}(i)}()}(r||(r={}))}, 38334:function _(e,t,n){n.r(t),n.d(t,{ArgumentOutOfRangeError:function ArgumentOutOfRangeError(){return P.W}, AsyncSubject:function AsyncSubject(){return c.c}, BehaviorSubject:function BehaviorSubject(){return u.X}, ConnectableObservable:function ConnectableObservable(){return i.c}, EMPTY:function EMPTY(){return X.E}, EmptyError:function EmptyError(){return k.K}, GroupedObservable:function GroupedObservable(){return o.T}, NEVER:function NEVER(){return le}, Notification:function Notification(){return R.P}, NotificationKind:function NotificationKind(){return R.W}, ObjectUnsubscribedError:function ObjectUnsubscribedError(){return D.N}, Observable:function Observable(){return r.y}, ReplaySubject:function ReplaySubject(){return l.t}, Scheduler:function Scheduler(){return S.b}, Subject:function Subject(){return s.xQ}, Subscriber:function Subscriber(){return A.L}, Subscription:function Subscription(){return w.w}, TimeoutError:function TimeoutError(){return N.W}, UnsubscriptionError:function UnsubscriptionError(){return x.B}, VirtualAction:function VirtualAction(){return b}, VirtualTimeScheduler:function VirtualTimeScheduler(){return T}, animationFrame:function animationFrame(){return E}, animationFrameScheduler:function animationFrameScheduler(){return _}, asap:function asap(){return d.e}, asapScheduler:function asapScheduler(){return d.E}, async:function async(){return h.P}, asyncScheduler:function asyncScheduler(){return h.z}, bindCallback:function bindCallback(){return V}, bindNodeCallback:function bindNodeCallback(){return G}, combineLatest:function combineLatest(){return q.aj}, concat:function concat(){return Z.z}, config:function config(){return we.v}, defer:function defer(){return Y.P}, empty:function empty(){return X.c}, forkJoin:function forkJoin(){return $}, from:function from(){return J.D}, fromEvent:function fromEvent(){return te.R}, fromEventPattern:function fromEventPattern(){return re}, generate:function generate(){return ie}, identity:function identity(){return C.y}, iif:function iif(){return ae}, interval:function interval(){return se.F}, isObservable:function isObservable(){return O}, merge:function merge(){return ue.T}, never:function never(){return ce}, noop:function noop(){return I.Z}, observable:function observable(){return a.L}, of:function of(){return de.of}, onErrorResumeNext:function onErrorResumeNext(){return he}, pairs:function pairs(){return fe}, partition:function partition(){return ve.u}, pipe:function pipe(){return L.z}, queue:function queue(){return f.c}, queueScheduler:function queueScheduler(){return f.N}, race:function race(){return ge.S3}, range:function range(){return ye}, scheduled:function scheduled(){return Se.x}, throwError:function throwError(){return _e._}, timer:function timer(){return Ee.H}, using:function using(){return Te}, zip:function zip(){return be.$R}}); var r=n(92772),i=n(33140),o=n(11120),a=n(15050),s=n(70211),u=n(89233),l=n(12630),c=n(60364),d=n(6650),h=n(90964),f=n(92546),p=n(70655),v=n(96114),g=function(e){function t(t,n){var r=e.call(this,t,n)||this; return r.scheduler=t,r.work=n,r} return p.ZT(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(function(){return t.flush(null)})))}, t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r); 0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},t}(v.o),y=n(78399),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return p.ZT(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do if(t=e.execute(e.state,e.delay))break;while(++rt.index?1:-1:e.delay>t.delay?1:-1},t}(v.o),S=n(38725),w=n(98760),A=n(10979),R=n(42632),L=n(62561),I=n(33306),C=n(43608); function O(e){return!!e&&(e instanceof r.y||"function"==typeof e.lift&&"function"==typeof e.subscribe)} var P=n(76565),k=n(26929),D=n(41016),x=n(28782),N=n(81462),M=n(55709),U=n(93642),F=n(59026),B=n(17507);function V(e,t,n){if(t){if(!(0,B.K)(t))return function(){for(var r=[],i=0;i= t){r.complete();break}if(r.next(o++),r.closed)break}})} function me(e){var t=e.start,n=e.index,r=e.count,i=e.subscriber;n>=r?i.complete():(i.next(t),i.closed||(e.index=n+1,e.start=t+1,this.schedule(e)))} var _e=n(64944),Ee=n(69604);function Te(e,t){return new r.y(function(n){var r,i;try{r=e()}catch(e){return void n.error(e)}try{i=t(r)}catch(e){return void n.error(e)}var o=(i?(0,J.D)(i):X.E).subscribe(n); return function(){o.unsubscribe(),r&&r.unsubscribe()}})} var be=n(25080),Se=n(38107),we=n(30150)}, 60364:function _(e,t,n){n.d(t,{c:function c(){return a}}); var r=n(70655),i=n(70211),o=n(98760),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t} return r.ZT(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),o.w.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),o.w.EMPTY):e.prototype._subscribe.call(this, t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted= !0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.xQ)}, 89233:function _(e,t,n){n.d(t,{X:function X(){return a}}); var r=n(70655),i=n(70211),o=n(41016),a=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n} return r.ZT(t,e),Object.defineProperty(t.prototype,"value",{get:function get(){return this.getValue()}, enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError; if(this.closed)throw new o.N;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.xQ)}, 42632:function _(e,t,n){n.d(t,{P:function P(){return s}, W:function W(){return r}}); var r,i=n(5631),o=n(18170),a=n(64944);r||(r={});var s=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e} return e.prototype.observe=function(e){switch(this.kind){case "N":return e.next&&e.next(this.value);case "E":return e.error&&e.error(this.error);case "C":return e.complete&&e.complete()}},e.prototype["do"]= function(e,t,n){switch(this.kind){case "N":return e&&e(this.value); case "E":return t&&t(this.error);case "C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this["do"](e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case "N":return(0, o.of)(this.value); case "E":return(0,a._)(this.error);case "C":return(0,i.c)()}throw new Error("unexpected notification kind value");},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}, e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()}, 92772:function _(e,t,n){n.d(t,{y:function y(){return c}}); var r=n(93642),i=n(10979),o=n(23142),a=n(32174),s=n(15050),u=n(62561),l=n(30150),c=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)} return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,s=function(e,t,n){if(e){if(e instanceof i.L)return e; if(e[o.b])return e[o.b]()}return e||t||n?new i.L(e,t,n):new i.L(a.c)}(e,t,n); if(r?s.add(r.call(s,this.source)):s.add(this.source||l.v.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),l.v.useDeprecatedSynchronousErrorHandling&& s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){l.v.useDeprecatedSynchronousErrorHandling&& (e.syncErrorThrown=!0,e.syncErrorValue=t),(0,r._)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this; return new (t=d(t))(function(t,r){var i;i=n.subscribe(function(t){try{e(t)}catch(e){r(e),i&&i.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source; return t&&t.subscribe(e)},e.prototype[s.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;tthis._bufferSize&&n.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow= function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow, r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length; if(this.closed)throw new u.N;if(this.isStopped||this.hasError?t=a.w.EMPTY:(this.observers.push(e),t=new l.W(this,e)),i&&e.add(e=new s.ht(e,i)),n)for(var c=0;ct&&(o=Math.max(o,i-t)),o>0&&r.splice(0,o),r},t}(i.xQ),d=function(){return function(e,t){this.time=e,this.value=t}}()}, 38725:function _(e,t,n){n.d(t,{b:function b(){return r}}); var r=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n} return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),(new this.SchedulerAction(this,e)).schedule(n,t)},e.now=function(){return Date.now()},e}()}, 70211:function _(e,t,n){n.d(t,{Yc:function Yc(){return c}, xQ:function xQ(){return d}}); var r=n(70655),i=n(92772),o=n(10979),a=n(98760),s=n(41016),u=n(18253),l=n(23142),c=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n} return r.ZT(t,e),t}(o.L),d=function(e){function t(){var t=e.call(this)||this; return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t} return r.ZT(t,e),t.prototype[l.b]=function(){return new c(this)},t.prototype.lift=function(e){var t=new h(this,this); return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.N; if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i1?r.next(Array.prototype.slice.call(arguments)):r.next(e)},r,n)})} function u(e,t,n,r,i){var o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var a=e; e.addEventListener(t,n,i),o=function o(){return a.removeEventListener(t,n,i)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var s=e; e.on(t,n),o=function o(){return s.off(t,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var l=e; e.addListener(t,n),o=function o(){return l.removeListener(t,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target"); for(var c=0,d=e.length;c1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof u&&(n=e.pop()),null===s&&1===e.length&&e[0]instanceof r.y?e[0]:(0,o.J)(n)((0,a.n)(e,s))} }, 18170:function _(e,t,n){n.d(t,{of:function of(){return a}}); var r=n(17507),i=n(43375),o=n(53109);function a(){for(var e=[],t=0;tthis.index},e.prototype.hasCompleted=function(){return this.array.length===this.index}, e}(),p=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i} return r.ZT(t,e),t.prototype[s.hZ]=function(){return this},t.prototype.next=function(){var e=this.buffer; return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&& this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e), this.parent.checkIterators()},t.prototype.subscribe=function(){return(0,u.ft)(this.observable,new u.IY(this))},t}(u.Ds)}, 91679:function _(e,t,n){n.d(t,{j:function j(){return o}}); var r=n(70655),i=n(10979);function o(e,t){return void 0===t&&(t=null),function(n){return n.lift(new a(e,t))}} var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?u:s} return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this; return r.bufferSize=n,r.buffer=[],r} return r.ZT(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer; t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(i.L),u=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i} return r.ZT(t,e),t.prototype._next=function(e){var t=this,n=t.bufferSize,r=t.startBufferEvery,i=t.buffers,o=t.count;this.count++,o%r==0&&i.push([]);for(var a=i.length;a--;){var s=i[a];s.push(e),s.length=== n&&(i.splice(a,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift(); r.length>0&&n.next(r)}e.prototype._complete.call(this)},t}(i.L)}, 40486:function _(e,t,n){n.d(t,{K:function K(){return o}}); var r=n(70655),i=n(17604);function o(e){return function(t){var n=new a(e),r=t.lift(n);return n.caught=r}} var a=function(){function e(e){this.selector=e} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.selector=n,i.caught=r,i} return r.ZT(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var r= new i.IY(this);this.add(r);var o=(0,i.ft)(n,r);o!==r&&this.add(o)}},t}(i.Ds)}, 52257:function _(e,t,n){n.d(t,{u:function u(){return i}}); var r=n(22556);function i(){return(0,r.J)(1)} }, 13251:function _(e,t,n){n.d(t,{b:function b(){return i}}); var r=n(47746);function i(e,t){return(0,r.zg)(e,t,1)} }, 92086:function _(e,t,n){n.d(t,{d:function d(){return o}}); var r=n(70655),i=n(10979);function o(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}} var a=function(){function e(e){this.defaultValue=e} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this; return r.defaultValue=n,r.isEmpty=!0,r} return r.ZT(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}, t}(i.L)}, 55022:function _(e,t,n){n.d(t,{g:function g(){return u}}); var r=n(70655),i=n(90964),o=n(69914),a=n(10979),s=n(42632);function u(e,t){void 0===t&&(t=i.P);var n=(0,o.J)(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new l(n,t))}} var l=function(){function e(e,t){this.delay=e,this.scheduler=t} return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i} return r.ZT(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time- r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this, destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new d(t.now()+this.delay,e); this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(s.P.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e), this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(s.P.createComplete()),this.unsubscribe()},t}(a.L),d=function(){return function(e,t){this.time=e,this.notification=t}}()}, 34181:function _(e,t,n){n.d(t,{E:function E(){return o}}); var r=n(70655),i=n(17604);function o(e,t){return function(n){return n.lift(new a(e,t))}} var a=function(){function e(e,t){this.keySelector=e,this.flushes=t} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this; return o.keySelector=n,o.values=new Set,r&&o.add((0,i.ft)(r,new i.IY(o))),o} return r.ZT(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e, e)},t.prototype._useKeySelector=function(e){var t,n=this.destination; try{t=this.keySelector(e)}catch(e){return void n.error(e)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values; n.has(e)||(n.add(e),this.destination.next(t))},t}(i.Ds)}, 66008:function _(e,t,n){n.d(t,{h:function h(){return o}}); var r=n(70655),i=n(10979);function o(e,t){return function(n){return n.lift(new a(e,t))}} var a=function(){function e(e,t){this.predicate=e,this.thisArg=t} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.predicate=n,i.thisArg=r,i.count=0,i} return r.ZT(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(i.L)}, 49580:function _(e,t,n){n.d(t,{x:function x(){return a}}); var r=n(70655),i=n(10979),o=n(98760);function a(e){return function(t){return t.lift(new s(e))}} var s=function(){function e(e){this.callback=e} return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.callback))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this; return r.add(new o.w(n)),r} return r.ZT(t,e),t}(i.L)}, 25971:function _(e,t,n){n.d(t,{P:function P(){return l}}); var r=n(26929),i=n(66008),o=n(51015),a=n(92086),s=n(39266),u=n(43608);function l(e,t){var n=arguments.length>=2;return function(l){return l.pipe(e?(0,i.h)(function(t,n){return e(t,n,l)}):u.y,(0,o.q)(1), n?(0,a.d)(t):(0,s.T)(function(){return new r.K}))}} }, 11120:function _(e,t,n){n.d(t,{T:function T(){return h}, v:function v(){return u}}); var r=n(70655),i=n(10979),o=n(98760),a=n(92772),s=n(70211);function u(e,t,n,r){return function(i){return i.lift(new l(e,t,n,r))}} var l=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r} return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,n,r,i,o){var a=e.call(this, t)||this; return a.keySelector=n,a.elementSelector=r,a.durationSelector=i,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a} return r.ZT(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups; n||(n=this.groups=new Map);var r,i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new s.xQ,n.set(t,i); var o=new h(t,i,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new h(t,i))}catch(e){return void this.error(e)}this.add(a.subscribe(new d(t,i,this)))}}i.closed|| i.next(r)},t.prototype._error=function(e){var t=this.groups; t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups; e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups["delete"](e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe= !0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.L),d=function(e){function t(t,n,r){var i=e.call(this,n)||this; return i.key=t,i.group=n,i.parent=r,i} return r.ZT(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key; this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.L),h=function(e){function t(t,n,r){var i=e.call(this)||this; return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i} return r.ZT(t,e),t.prototype._subscribe=function(e){var t=new o.w,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new f(n)),t.add(r.subscribe(e)),t},t}(a.y),f=function(e){function t(t){var n= e.call(this)||this; return n.parent=t,t.count++,n} return r.ZT(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(o.w)}, 92582:function _(e,t,n){n.d(t,{Z:function Z(){return l}}); var r=n(26929),i=n(66008),o=n(58273),a=n(39266),s=n(92086),u=n(43608);function l(e,t){var n=arguments.length>=2;return function(l){return l.pipe(e?(0,i.h)(function(t,n){return e(t,n,l)}):u.y,(0,o.h)(1), n?(0,s.d)(t):(0,a.T)(function(){return new r.K}))}} }, 55709:function _(e,t,n){n.d(t,{U:function U(){return o}}); var r=n(70655),i=n(10979);function o(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new a(e,t))}} var a=function(){function e(e,t){this.project=e,this.thisArg=t} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}(),s=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.project=n,i.count=0,i.thisArg=r||i,i} return r.ZT(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(i.L)}, 5602:function _(e,t,n){n.d(t,{h:function h(){return o}}); var r=n(70655),i=n(10979);function o(e){return function(t){return t.lift(new a(e))}} var a=function(){function e(e){this.value=e} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this; return r.value=n,r} return r.ZT(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(i.L)}, 22556:function _(e,t,n){n.d(t,{J:function J(){return o}}); var r=n(47746),i=n(43608);function o(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),(0,r.zg)(i.y,e)} }, 47746:function _(e,t,n){n.d(t,{VS:function VS(){return c}, zg:function zg(){return s}}); var r=n(70655),i=n(55709),o=n(55760),a=n(17604);function s(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?function(r){return r.pipe(s(function(n,r){return(0,o.D)(e(n,r)).pipe((0, i.U)(function(e,i){return t(n,e,r,i)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new u(e,n))})} var u=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t} return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.project,this.concurrent))},e}(),l=function(e){function t(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY); var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i} return r.ZT(t,e),t.prototype._next=function(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(a.Ds),c=s}, 33756:function _(e,t,n){n.d(t,{j:function j(){return i}}); var r=n(47746);function i(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?(0,r.zg)(function(){return e},t,n):("number"==typeof t&&(n=t),(0,r.zg)(function(){return e},n))} }, 78113:function _(e,t,n){n.d(t,{O:function O(){return i}}); var r=n(33140);function i(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new o(i,t)); var a=Object.create(n,r.N);return a.source=n,a.subjectFactory=i,a}} var o=function(){function e(e,t){this.subjectFactory=e,this.selector=t} return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(e);return i.add(t.subscribe(r)),i},e}()}, 89276:function _(e,t,n){n.d(t,{QV:function QV(){return a}, ht:function ht(){return u}}); var r=n(70655),i=n(10979),o=n(42632);function a(e,t){return void 0===t&&(t=0),function(n){return n.lift(new s(e,t))}} var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t} return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.scheduler,this.delay))},e}(),u=function(e){function t(t,n,r){void 0===r&&(r=0); var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i} return r.ZT(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch, this.delay,new l(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(o.P.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(o.P.createError(e)),this.unsubscribe()}, t.prototype._complete=function(){this.scheduleMessage(o.P.createComplete()),this.unsubscribe()},t}(i.L),l=function(){return function(e,t){this.notification=e,this.destination=t}}()}, 93783:function _(e,t,n){n.d(t,{j:function j(){return i}}); var r=n(55709);function i(){for(var e=[],t=0;t1)this.connection=null;else{var n= this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(i.L)}, 72876:function _(e,t,n){n.d(t,{X:function X(){return o}}); var r=n(70655),i=n(10979);function o(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}} var a=function(){function e(e,t){this.count=e,this.source=t} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.count=n,i.source=r,i} return r.ZT(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}}, t}(i.L)}, 80665:function _(e,t,n){n.d(t,{a:function a(){return _a7}}); var r=n(70655),i=n(70211),o=n(17604);function _a7(e){return function(t){return t.lift(new s(e,t))}} var s=function(){function e(e,t){this.notifier=e,this.source=t} return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.notifier,this.source))},e}(),u=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.notifier=n,i.source=r,i} return r.ZT(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,a=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new i.xQ;try{r= (0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}a=(0,o.ft)(r,new o.IY(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=a,n.next(t)}},t.prototype._unsubscribe= function(){var e=this.errors,t=this.retriesSubscription; e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe; this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(o.Ds)}, 22807:function _(e,t,n){n.d(t,{R:function R(){return o}}); var r=n(70655),i=n(10979);function o(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new a(e,t,n))}} var a=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n} return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,n,r,i){var o=e.call(this,t)||this; return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o} return r.ZT(t,e),Object.defineProperty(t.prototype,"seed",{get:function get(){return this._seed}, set:function set(e){this.hasSeed=!0,this._seed=e}, enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++; try{t=this.accumulator(this.seed,e,n)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(i.L)}, 96381:function _(e,t,n){n.d(t,{w:function w(){return s}}); var r=n(70655),i=n(55709),o=n(55760),a=n(17604);function s(e,t){return"function"==typeof t?function(n){return n.pipe(s(function(n,r){return(0,o.D)(e(n,r)).pipe((0,i.U)(function(e,i){return t(n,e,r,i)}))}))}: function(t){return t.lift(new u(e))}} var u=function(){function e(e){this.project=e} return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.project))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this; return r.project=n,r.index=0,r} return r.ZT(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription; t&&t.unsubscribe();var n=new a.IY(this),r=this.destination;r.add(n),this.innerSubscription=(0,a.ft)(e,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},t.prototype._complete=function(){var t= this.innerSubscription; t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0, this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(a.Ds)}, 71198:function _(e,t,n){n.d(t,{c:function c(){return i}}); var r=n(96381);function i(e,t){return t?(0,r.w)(function(){return e},t):(0,r.w)(function(){return e})} }, 51015:function _(e,t,n){n.d(t,{q:function q(){return s}}); var r=n(70655),i=n(10979),o=n(76565),a=n(5631);function s(e){return function(t){return 0===e?(0,a.c)():t.lift(new u(e))}} var u=function(){function e(e){if(this.total=e,this.total<0)throw new o.W;} return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.total))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this; return r.total=n,r.count=0,r} return r.ZT(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(i.L)}, 58273:function _(e,t,n){n.d(t,{h:function h(){return s}}); var r=n(70655),i=n(10979),o=n(76565),a=n(5631);function s(e){return function(t){return 0===e?(0,a.c)():t.lift(new u(e))}} var u=function(){function e(e){if(this.total=e,this.total<0)throw new o.W;} return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.total))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this; return r.total=n,r.ring=new Array,r.count=0,r} return r.ZT(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=(u=t.flush.bind(t, null),l=i++,a[l]=!0,o.then(function(){return s(l)&&u()}),l))); var u,l},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r); 0===t.actions.length&&(s(n),t.scheduled=void 0)},t}(n(96114).o),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return r.ZT(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do if(t=e.execute(e.state,e.delay))break;while(++r0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t, n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this, t,n,r):t.flush(this)},t}(n(96114).o),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return r.ZT(t,e),t}(n(78399).v),a=new o(i),s=a}, 999:function _(e,t,n){function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"} n.d(t,{hZ:function hZ(){return i}}); var i=r()}, 15050:function _(e,t,n){n.d(t,{L:function L(){return r}}); var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()}, 23142:function _(e,t,n){n.d(t,{b:function b(){return r}}); var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()}, 76565:function _(e,t,n){n.d(t,{W:function W(){return r}}); var r=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this} return e.prototype=Object.create(Error.prototype),e}()}, 26929:function _(e,t,n){n.d(t,{K:function K(){return r}}); var r=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this} return e.prototype=Object.create(Error.prototype),e}()}, 41016:function _(e,t,n){n.d(t,{N:function N(){return r}}); var r=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this} return e.prototype=Object.create(Error.prototype),e}()}, 81462:function _(e,t,n){n.d(t,{W:function W(){return r}}); var r=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this} return e.prototype=Object.create(Error.prototype),e}()}, 28782:function _(e,t,n){n.d(t,{B:function B(){return r}}); var r=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError", this.errors=e,this} return e.prototype=Object.create(Error.prototype),e}()}, 93642:function _(e,t,n){n.d(t,{_:function _(){return i}}); var r=n(10979);function i(e){for(;e;){var t=e,n=t.closed,i=t.destination,o=t.isStopped;if(n||o)return!1;e=i&&i instanceof r.L?i:null}return!0} }, 71644:function _(e,t,n){function r(e){setTimeout(function(){throw e;},0)} n.d(t,{z:function z(){return r}})}, 43608:function _(e,t,n){function r(e){return e} n.d(t,{y:function y(){return r}})}, 59026:function _(e,t,n){n.d(t,{k:function k(){return r}}); var r=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()}, 39217:function _(e,t,n){n.d(t,{z:function z(){return r}}); var r=function r(e){return e&&"number"==typeof e.length&&"function"!=typeof e}}, 69914:function _(e,t,n){function r(e){return e instanceof Date&&!isNaN(+e)} n.d(t,{J:function J(){return r}})}, 14156:function _(e,t,n){function r(e){return"function"==typeof e} n.d(t,{m:function m(){return r}})}, 35812:function _(e,t,n){n.d(t,{k:function k(){return i}}); var r=n(59026);function i(e){return!(0,r.k)(e)&&e-parseFloat(e)+1>=0} }, 92009:function _(e,t,n){function r(e){return null!==e&&"object"==_typeof(e)} n.d(t,{K:function K(){return r}})}, 70336:function _(e,t,n){function r(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then} n.d(t,{t:function t(){return r}})}, 17507:function _(e,t,n){function r(e){return e&&"function"==typeof e.schedule} n.d(t,{K:function K(){return r}})}, 33306:function _(e,t,n){function r(){} n.d(t,{Z:function Z(){return r}})}, 18463:function _(e,t,n){function r(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)} return n.pred=e,n.thisArg=t,n} n.d(t,{f:function f(){return r}})}, 62561:function _(e,t,n){n.d(t,{U:function U(){return o}, z:function z(){return i}}); var r=n(43608);function i(){for(var e=[],t=0;t=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i= arguments[2]),function(t){return t.lift(new m(e,r,i,n))}} var m=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r} return e.prototype.call=function(e,t){return t.subscribe(new E(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),_=function(){return function(){this.buffer=[]}}(), E=function(e){function t(t,n,r,i,o){var a=e.call(this,t)||this; a.bufferTimeSpan=n,a.bufferCreationInterval=r,a.maxBufferSize=i,a.scheduler=o,a.contexts=[];var s=a.openContext();if(a.timespanOnly=null==r||r<0,a.timespanOnly){var u={subscriber:a,context:s,bufferTimeSpan:n}; a.add(s.closeAction=o.schedule(T,n,u))}else{var l={subscriber:a,context:s},c={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:a,scheduler:o};a.add(s.closeAction=o.schedule(S,n,l)),a.add(o.schedule(b, r,c))}return a} return r.ZT(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,i=0;i0;){var r=t.shift(); n.next(r.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e); var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction= this.scheduler.schedule(T,n,r))}},t.prototype.openContext=function(){var e=new _; return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer); var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(v.L); function T(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))} function b(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,i=e.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(S,n,{subscriber:r,context:o})),this.schedule(e,t))} function S(e){var t=e.subscriber,n=e.context;t.closeContext(n)} var w=n(98760),A=n(52080),R=n(62039);function L(e,t){return function(n){return n.lift(new I(e,t))}} var I=function(){function e(e,t){this.openings=e,this.closingSelector=t} return e.prototype.call=function(e,t){return t.subscribe(new C(e,this.openings,this.closingSelector))},e}(),C=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.closingSelector=r,i.contexts=[],i.add((0,A.D)(i,n)),i} return r.ZT(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r0;){var r=n.shift(); r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift(); this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e): this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e); t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts; if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new w.w,r={buffer:[], subscription:n};t.push(r);var i=(0,A.D)(this,e,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},t}(R.L); function O(e){return function(t){return t.lift(new P(e))}} var P=function(){function e(e){this.closingSelector=e} return e.prototype.call=function(e,t){return t.subscribe(new k(e,this.closingSelector))},e}(),k=function(e){function t(t,n){var r=e.call(this,t)||this; return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r} return r.ZT(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer; t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete= function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription; e&&(this.remove(e),e.unsubscribe());var t,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{t=(0,this.closingSelector)()}catch(e){return this.error(e)}e=new w.w,this.closingSubscription= e,this.add(e),this.subscribing=!0,e.add((0,i.ft)(t,new i.IY(this))),this.subscribing=!1},t}(i.Ds),D=n(40486),x=n(75142); function N(e){return function(t){return t.lift(new x.Ms(e))}} var M=n(59026),U=n(55760);function F(){for(var e=[],t=0;t=2;return function(r){return r.pipe((0,ye.h)(function(t,n){return n===e}),(0,_e.q)(1),n? (0,ee.d)(t):(0,me.T)(function(){return new ge.W}))}} var Te=n(18170);function be(){for(var e=[],t=0;t0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(i.Ds),Me=n(49580); function Ue(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new Fe(e,n,!1,t))}} var Fe=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r} return e.prototype.call=function(e,t){return t.subscribe(new Be(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),Be=function(e){function t(t,n,r,i,o){var a=e.call(this,t)||this; return a.predicate=n,a.source=r,a.yieldIndex=i,a.thisArg=o,a.index=0,a} return r.ZT(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++; try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(v.L); function Ve(e,t){return function(n){return n.lift(new Fe(e,n,!0,t))}} var He=n(25971),je=n(11120);function Ge(){return function(e){return e.lift(new Ke)}} var Ke=function(){function e(){} return e.prototype.call=function(e,t){return t.subscribe(new ze(e))},e}(),ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this} return r.ZT(t,e),t.prototype._next=function(e){},t}(v.L); function We(){return function(e){return e.lift(new qe)}} var qe=function(){function e(){} return e.prototype.call=function(e,t){return t.subscribe(new Ze(e))},e}(),Ze=function(e){function t(t){return e.call(this,t)||this} return r.ZT(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)}, t}(v.L),Ye=n(92582),Xe=n(5602),Qe=n(42632); function Je(){return function(e){return e.lift(new $e)}} var $e=function(){function e(){} return e.prototype.call=function(e,t){return t.subscribe(new et(e))},e}(),et=function(e){function t(t){return e.call(this,t)||this} return r.ZT(t,e),t.prototype._next=function(e){this.destination.next(Qe.P.createNext(e))},t.prototype._error=function(e){var t=this.destination; t.next(Qe.P.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination; e.next(Qe.P.createComplete()),e.complete()},t}(v.L),tt=n(22807),nt=n(58273),rt=n(62561); function it(e,t){return arguments.length>=2?function(n){return(0,rt.z)((0,tt.R)(e,t),(0,nt.h)(1),(0,ee.d)(t))(n)}:function(t){return(0,rt.z)((0,tt.R)(function(t,n,r){return e(t,n,r+1)}),(0,nt.h)(1))(t)}} function ot(e){return it("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})} var at=n(14370);function st(){for(var e=[],t=0;t0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(i.Ds); function pt(e){return it("function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}}, t}(v.L),Bt=n(70211); function Vt(e){return function(t){return t.lift(new Ht(e))}} var Ht=function(){function e(e){this.notifier=e} return e.prototype.call=function(e,t){return t.subscribe(new jt(e,this.notifier,t))},e}(),jt=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i} return r.ZT(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)}, t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this); this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription; e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe; return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){var t; this.notifications=new Bt.xQ;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=(0,i.ft)(t,new i.IY(this))},t}(i.Ds),Gt= n(72876),Kt=n(80665),zt=n(3018); function Wt(e){return function(t){return t.lift(new qt(e))}} var qt=function(){function e(e){this.notifier=e} return e.prototype.call=function(e,t){var n=new Zt(e),r=t.subscribe(n);return r.add((0,i.ft)(this.notifier,new i.IY(n))),r},e}(),Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this; return t.hasValue=!1,t} return r.ZT(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue= function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.Ds); function Yt(e,t){return void 0===t&&(t=u.P),function(n){return n.lift(new Xt(e,t))}} var Xt=function(){function e(e,t){this.period=e,this.scheduler=t} return e.prototype.call=function(e,t){return t.subscribe(new Qt(e,this.period,this.scheduler))},e}(),Qt=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(Jt,n,{subscriber:i,period:n})),i} return r.ZT(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(v.L); function Jt(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)} function $t(e,t){return function(n){return n.lift(new en(e,t))}} var en=function(){function e(e,t){this.compareTo=e,this.comparator=t} return e.prototype.call=function(e,t){return t.subscribe(new tn(e,this.compareTo,this.comparator))},e}(),tn=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new nn(t,i))),i} return r.ZT(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0=== this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this,t=e._a,n=e._b,r=e.comparator;t.length>0&&n.length>0;){var i=t.shift(),o=n.shift(), a=!1; try{a=r?r(i,o):i===o}catch(e){this.destination.error(e)}a||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination; t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0=== this._a.length&&0===this._b.length):this._oneComplete=!0},t}(v.L),nn=function(e){function t(t,n){var r=e.call(this,t)||this; return r.parent=n,r} return r.ZT(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()}, t}(v.L); function rn(){return new Bt.xQ} function on(){return function(e){return(0,zt.x)()((0,vt.O)(rn)(e))}} function an(e,t,n){var r;return r=e&&"object"==_typeof(e)?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,r=e.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY: r,o=e.windowTime,a=void 0===o?Number.POSITIVE_INFINITY:o,s=e.refCount,u=e.scheduler,l=0,c=!1,d=!1;return function(e){var r;l++,!t||c?(c=!1,t=new Pt.t(i,a,u),r=t.subscribe(this),n=e.subscribe({next:function next(e){t.next(e)}, error:function error(e){c=!0,t.error(e)}, complete:function complete(){d=!0,n=void 0,t.complete()}})):r=t.subscribe(this),this.add(function(){l--,r.unsubscribe(),n&&!d&&s&&0===l&&(n.unsubscribe(),n=void 0,t=void 0)})}}(r))}} var sn=n(26929);function un(e){return function(t){return t.lift(new ln(e,t))}} var ln=function(){function e(e,t){this.predicate=e,this.source=t} return e.prototype.call=function(e,t){return t.subscribe(new cn(e,this.predicate,this.source))},e}(),cn=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i} return r.ZT(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t= this.index++; this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete= function(){var e=this.destination; this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new sn.K)},t}(v.L); function dn(e){return function(t){return t.lift(new hn(e))}} var hn=function(){function e(e){this.total=e} return e.prototype.call=function(e,t){return t.subscribe(new fn(e,this.total))},e}(),fn=function(e){function t(t,n){var r=e.call(this,t)||this; return r.total=n,r.count=0,r} return r.ZT(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(v.L); function pn(e){return function(t){return t.lift(new vn(e))}} var vn=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new ge.W;} return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new v.L(e)):t.subscribe(new gn(e,this._skipCount))},e}(),gn=function(e){function t(t,n){var r=e.call(this,t)||this; return r._skipCount=n,r._count=0,r._ring=new Array(n),r} return r.ZT(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,o=i.length,a=0;a=0&&s%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new Bt.xQ;i.push(u),n.next(u)}},t.prototype._error=function(e){var t=this.windows; if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows; if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(v.L); function $n(e){var t=u.P,n=null,r=Number.POSITIVE_INFINITY;return(0,g.K)(arguments[3])&&(t=arguments[3]),(0,g.K)(arguments[2])?t=arguments[2]:(0,An.k)(arguments[2])&&(r=Number(arguments[2])),(0,g.K)(arguments[1])? t=arguments[1]:(0,An.k)(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new er(e,n,r,t))}} var er=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r} return e.prototype.call=function(e,t){return t.subscribe(new nr(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),tr=function(e){function t(){var t=null!==e&&e.apply(this, arguments)||this; return t._numberOfNextedValues=0,t} return r.ZT(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function get(){return this._numberOfNextedValues}, enumerable:!0,configurable:!0}),t}(Bt.xQ),nr=function(e){function t(t,n,r,i,o){var a=e.call(this,t)||this; a.destination=t,a.windowTimeSpan=n,a.windowCreationInterval=r,a.maxWindowSize=i,a.scheduler=o,a.windows=[];var s=a.openWindow();if(null!==r&&r>=0){var u={subscriber:a,window:s,context:null},l={windowTimeSpan:n, windowCreationInterval:r,subscriber:a,scheduler:o};a.add(o.schedule(or,n,u)),a.add(o.schedule(ir,r,l))}else{var c={subscriber:a,window:s,windowTimeSpan:n};a.add(o.schedule(rr,n,c))}return a} return r.ZT(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error= function(e){for(var t=this.windows;t.length>0;)t.shift().error(e); this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift(); t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new tr; return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete(); var t=this.windows;t.splice(t.indexOf(e),1)},t}(v.L); function rr(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)} function ir(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,i=e.windowCreationInterval,o=n.openWindow(),a=this,s={action:a,subscription:null},u={subscriber:n,window:o,context:s};s.subscription=r.schedule(or, t,u),a.add(s.subscription),a.schedule(e,i)} function or(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)} function ar(e,t){return function(n){return n.lift(new sr(e,t))}} var sr=function(){function e(e,t){this.openings=e,this.closingSelector=t} return e.prototype.call=function(e,t){return t.subscribe(new ur(e,this.openings,this.closingSelector))},e}(),ur=function(e){function t(t,n,r){var i=e.call(this,t)||this; return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=(0,A.D)(i,n,n)),i} return r.ZT(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next= function(e){if(0===this.toRespond.length){var t=[e].concat(this.values); this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t; try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(R.L),vr=n(25080); function gr(){for(var e=[],t=0;t0?2===s.length?_typeof(s[1])==a?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:3===s.length?_typeof(s[1])!== a||s[1].exec&&s[1].test?this[s[0]]=c?c.replace(s[1],s[2]):o:this[s[0]]=c?s[1].call(this,c,s[2]):o:4===s.length&&(this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):o):this[s]=c||o;d+=2}},W=function W(e, t){for(var n in t)if(_typeof(t[n])===u&&t[n].length>0)for(var r=0;r350? K(e,350):e,this},this.setUA(n),this}; Y.VERSION="0.7.33",Y.BROWSER=H([d,p,"major"]),Y.CPU=H([v]),Y.DEVICE=H([c,f,h,g,y,_,m,E,T]),Y.ENGINE=Y.OS=H([d,p]),_typeof(t)!==s?(e.exports&&(t=e.exports=Y),t.UAParser=Y):n.amdO?(r=function(){return Y}.call(t, n,t,e))===o||(e.exports=r):_typeof(i)!==s&&(i.UAParser=Y); var X=_typeof(i)!==s&&(i.jQuery||i.Zepto);if(X&&!X.ua){var Q=new Y;X.ua=Q.getResult(),X.ua.get=function(){return Q.getUA()},X.ua.set=function(e){Q.setUA(e); var t=Q.getResult();for(var n in t)X.ua[n]=t[n]}}}("object"==(typeof window==="undefined"?"undefined":_typeof(window))?window:this)}, 55877:function _(e,t,n){var r=n(23570),i=n(71171),o=i;o.v1=r,o.v4=i,e.exports=o}, 45327:function _(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]], i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}}, 85217:function _(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto); if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16); e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}}, 23570:function _(e,t,n){var r,i,o=n(85217),a=n(45327),s=0,u=0;e.exports=function(e,t,n){var l=t&&n||0,c=t||[],d=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var f=o();null== d&&(d=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==h&&(h=i=16383&(f[6]<<8|f[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,g=p-s+(v-u)/1E4;if(g<0&&void 0===e.clockseq&& (h=h+1&16383),(g<0||p>s)&&void 0===e.nsecs&&(v=0),v>=1E4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,u=v,i=h;var y=(1E4*(268435455&(p+=122192928E5))+v)%4294967296;c[l++]=y>>> 24&255,c[l++]=y>>>16&255,c[l++]=y>>>8&255,c[l++]=255&y;var m=p/4294967296*1E4&268435455;c[l++]=m>>>8&255,c[l++]=255&m,c[l++]=m>>>24&15|16,c[l++]=m>>>16&255,c[l++]=h>>>8|128,c[l++]=255&h;for(var _=0;_<6;++_)c[l+ _]=d[_];return t||a(c)}}, 71171:function _(e,t,n){var r=n(85217),i=n(45327);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15& a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}}, 6999:function _(e,t,n){function r(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"std";var n=function(e){return i||(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), o=i.slice(0,-2).concat("-","_")),"url"==e?o:i}(t),r="std"==t; var a,s="",u=0,l=0;for(var _t10=0;_t10>2],l=(3&a)<<4,u=1;break;case 1:s+=n[l|a>>4],l=(15&a)<<2,u=2;break;case 2:s+=n[l|a>>6],s+=n[63&a],u=0}return u&& (s+=n[l],r&&(s+="\x3d",1==u&&(s+="\x3d"))),s} var i,o;n.d(t,{h:function h(){return r}})}, 61084:function _(e,t,n){n.d(t,{Z:function Z(){return se}}); var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0, cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function tagValueProcessor(e,t){return t}, attributeValueProcessor:function attributeValueProcessor(e,t){return t}, stopNodes:[],alwaysCreateTextNode:!1,isArray:function isArray(){return!1}, commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function updateTag(e,t,n){return e}, captureMetaData:!1},i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",o=new RegExp("^["+ i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function a(e,t){var n=[];var r=t.exec(e);for(;r;){var _i6=[];_i6.startIndex=t.lastIndex-r[0].length;var _o4=r.length;for(var _e63=0;_e63<_o4;_e63++)_i6.push(r[_e63]); n.push(_i6),r=t.exec(e)}return n} var s=function s(e){return!(null==o.exec(e))}; var u;u="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var l=function(){function l(e){_classCallCheck(this,l);this.tagname=e,this.child=[],this[":@"]={}} _createClass(l,[{key:"add",value:function add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push(_defineProperty({},e,t))}}, {key:"addChild",value:function addChild(e,t){var _this$child$push2;"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push((_this$child$push2={},_defineProperty(_this$child$push2, e.tagname,e.child),_defineProperty(_this$child$push2,":@",e[":@"]),_this$child$push2)):this.child.push(_defineProperty({},e.tagname,e.child)),void 0!==t&&(this.child[this.child.length-1][u]={startIndex:t})}}], [{key:"getMetaDataSymbol", value:function getMetaDataSymbol(){return u}}]); return l}(); var c=function(){function c(e){_classCallCheck(this,c);this.suppressValidationErr=!e} _createClass(c,[{key:"readDocType",value:function readDocType(e,t){var n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE"); t+=9;var _r49=1,_i7=!1,_o5=!1,_a8="";for(;t 1&&arguments[1]!==undefined?arguments[1]:{};if(t=Object.assign({},S,t),!e||"string"!=typeof e)return e;var n=e.trim();if(0===n.length)return e;if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if("0"=== n)return 0;if(t.unicode&&(n=function(e){if("string"!=typeof e)return e;var t=e.length;if(0===t)return e;var n=-1;for(var _r53=0;_r53=48&&_i0<=57||45===_i0))if(_i0< g){if(m.has(_i0)){n=_r53;break}}else if(_i0>=55296&&_i0<=56319){if(_r53+1=56320&&_t11<=57343){var _e65=65536+(_i0-55296<<10)+(_t11-56320);if(v.has(_e65)){n=_r53; break}}}}else if(255!==y[_i0-g]||m.has(_i0)){n=_r53;break}}if(-1===n)return e;var r=[];n>0&&r.push(e.slice(0,n));for(var _i1=n;_i1=48&&_n12<=57||45===_n12){r.push(e[_i1]); continue}if(_n12=55296&&_n12<=56319){if(_i1+1=56320&&_t12<=57343){var _e66=65536+(_n12-55296<<10)+(_t12-56320), _o7=v.get(_e66);if(void 0!==_o7){r.push(String.fromCharCode(_o7+48)),_i1++;continue}}}r.push(e[_i1]);continue}if(m.has(_n12)){r.push("-");continue}var _o6=y[_n12-g];r.push(255!==_o6?String.fromCharCode(_o6+ 48):e[_i1])}return r.join("")}(n),"0"===n))return 0; if(t.hex&&_.test(n))return R(n,16);if(t.binary&&E.test(n))return R(n,2);if(t.octal&&T.test(n))return R(n,8);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(e,t,n){if(!n.eNotation)return e; var r=t.match(A);if(r){var _i10=r[1]||"";var _o8=-1===r[3].indexOf("e")?"E":"e",_a9=r[2],_s5=_i10?e[_a9.length+1]===_o8:e[_a9.length]===_o8;return _a9.length>1&&_s5?e:(1!==_a9.length||!r[3].startsWith(".".concat(_o8))&& r[3][0]!==_o8)&&_a9.length>0?n.leadingZeros&&!_s5?(t=(r[1]||"")+r[3],Number(t)):e:Number(t)}return e}(e,n,t); var _i11=b.exec(n);if(_i11){var _o9=_i11[1]||"",_a0=_i11[2];var _s6=(r=_i11[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substring(0,r.length- 1)),r):r;var _u2=_o9?"."===e[_a0.length+1]:"."===e[_a0.length];if(!t.leadingZeros&&(_a0.length>1||1===_a0.length&&!_u2))return e;var _r54=Number(n),_i12=String(_r54);if(0===_r54)return _r54;if(-1!==_i12.search(/[eE]/))return t.eNotation? _r54:e;if(-1!==n.indexOf("."))return"0"===_i12||_i12===_s6||_i12==="".concat(_o9).concat(_s6)?_r54:e;var _u3=_a0?_s6:n;return _a0?_u3===_i12||_o9+_u3===_i12?_r54:e:_u3===_i12||_u3===_o9+_i12?_r54:e}return e}var r; return function(e,t,n){var r=t===1/0;switch(n.infinity.toLowerCase()){case "null":return null;case "infinity":return t;case "string":return r?"Infinity":"-Infinity";default:return e}}(e,Number(n),t)} var A=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function R(e,t){var n=e.trim();if(2!==t&&8!==t||(e=n.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&& window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");} var L=function L(e){_classCallCheck(this,L);var t;if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g, val:"\x3e"},lt:{regex:/&(lt|#60|#x3C);/g,val:"\x3c"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"\x26"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "}, cent:{regex:/&(cent|#162);/g,val:"\u00a2"},pound:{regex:/&(pound|#163);/g,val:"\u00a3"},yen:{regex:/&(yen|#165);/g,val:"\u00a5"},euro:{regex:/&(euro|#8364);/g,val:"\u20ac"},copyright:{regex:/&(copy|#169);/g, val:"\u00a9"},reg:{regex:/&(reg|#174);/g,val:"\u00ae"},inr:{regex:/&(inr|#8377);/g,val:"\u20b9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function val(e,t){return j(t,10,"\x26#")}}, num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function val(e,t){return j(t,16,"\x26#x")}}},this.addExternalEntities=I,this.parseXml=D,this.parseTextData=C,this.resolveNameSpace=O,this.buildAttributesMap= k,this.isItStopNode=U,this.replaceEntitiesValue=N,this.readStopNodeData=V,this.saveTextToParentTag=M,this.addChild=x,this.ignoreAttributesFn="function"==typeof(t=this.options.ignoreAttributes)?t:Array.isArray(t)? function(e){var _iteratorNormalCompletion=true; var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _n13= _step.value;if("string"==typeof _n13&&e===_n13)return!0;if(_n13 instanceof RegExp&&_n13.test(e))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&& _iterator["return"]!=null)_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}}:function(){return!1},this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set, this.stopNodesWildcard=new Set; for(var _e67=0;_e670)){a||(e=this.replaceEntitiesValue(e));var _r56=this.options.tagValueProcessor(t,e,n,i,o);return null==_r56? e:_typeof(_r56)!=_typeof(e)||_r56!==e?_r56:this.options.trimValues||e.trim()===e?H(e,this.options.parseTagValue,this.options.numberParseOptions):e}} function O(e){if(this.options.removeNSPrefix){var _t14=e.split(":"),_n15="/"===e.charAt(0)?"/":"";if("xmlns"===_t14[0])return"";2===_t14.length&&(e=_n15+_t14[1])}return e} var P=new RegExp("([^\\s\x3d]+)\\s*(\x3d\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function k(e,t){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){var _n16=a(e,P),_r57=_n16.length,_i14={};for(var _e68= 0;_e68<_r57;_e68++){var _r58=this.resolveNameSpace(_n16[_e68][1]);if(this.ignoreAttributesFn(_r58,t))continue;var _o0=_n16[_e68][4],_a1=this.options.attributeNamePrefix+_r58;if(_r58.length)if(this.options.transformAttributeName&& (_a1=this.options.transformAttributeName(_a1)),"__proto__"===_a1&&(_a1="#__proto__"),void 0!==_o0){this.options.trimValues&&(_o0=_o0.trim()),_o0=this.replaceEntitiesValue(_o0);var _e69=this.options.attributeValueProcessor(_r58, _o0,t);_i14[_a1]=null==_e69?_o0:_typeof(_e69)!=_typeof(_o0)||_e69!==_o0?_e69:H(_o0,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(_i14[_a1]= !0)}if(!Object.keys(_i14).length)return;if(this.options.attributesGroupName){var _e70={};return _e70[this.options.attributesGroupName]=_i14,_e70}return _i14}} var D=function D(e){e=e.replace(/\r\n?/g,"\n");var t=new l("!xml");var n=t,r="",i="";var o=new c(this.options.processEntities);for(var _a10=0;_a10 0&&_c3.lastIndexOf("/")===_c3.length-1)"/"===_s9[_s9.length-1]?(_s9=_s9.substr(0,_s9.length-1),i=i.substr(0,i.length-1),_c3=_s9):_c3=_c3.substr(0,_c3.length-1),_a10=_o12.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(_s9))_a10= _o12.closeIndex;else{var _n17=this.readStopNodeData(e,_u5,_h3+1);if(!_n17)throw new Error("Unexpected end of ".concat(_u5));_a10=_n17.i,_t20=_n17.tagContent}var _r59=new l(_s9);_s9!==_c3&&_d4&&(_r59[":@"]= this.buildAttributesMap(_c3,i)),_t20&&(_t20=this.parseTextData(_t20,_s9,i,!0,_d4,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),_r59.add(this.options.textNodeName,_t20),this.addChild(n,_r59,i,_p3)}else{if(_c3.length> 0&&_c3.lastIndexOf("/")===_c3.length-1){if("/"===_s9[_s9.length-1]?(_s9=_s9.substr(0,_s9.length-1),i=i.substr(0,i.length-1),_c3=_s9):_c3=_c3.substr(0,_c3.length-1),this.options.transformTagName){var _e75= this.options.transformTagName(_s9);_c3===_s9&&(_c3=_e75),_s9=_e75}var _e74=new l(_s9);_s9!==_c3&&_d4&&(_e74[":@"]=this.buildAttributesMap(_c3,i)),this.addChild(n,_e74,i,_p3),i=i.substr(0,i.lastIndexOf("."))}else{var _e76= new l(_s9);this.tagsNodeStack.push(n),_s9!==_c3&&_d4&&(_e76[":@"]=this.buildAttributesMap(_c3,i)),this.addChild(n,_e76,i,_p3),n=_e76}r="",_a10=_h3}}else r+=e[_a10];return t.child}; function x(e,t,n,r){this.options.captureMetaData||(r=void 0);var i=this.options.updateTag(t.tagname,n,t[":@"]);!1===i||("string"==typeof i?(t.tagname=i,e.addChild(t,r)):e.addChild(t,r))} var N=function N(e){if(this.options.processEntities){for(var _t21 in this.docTypeEntities){var _n18=this.docTypeEntities[_t21];e=e.replace(_n18.regx,_n18.val)}for(var _t22 in this.lastEntities){var _n19= this.lastEntities[_t22];e=e.replace(_n19.regex,_n19.val)}if(this.options.htmlEntities)for(var _t23 in this.htmlEntities){var _n20=this.htmlEntities[_t23];e=e.replace(_n20.regex,_n20.val)}e=e.replace(this.ampEntity.regex, this.ampEntity.val)}return e}; function M(e,t,n,r){return e&&(void 0===r&&(r=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName, e),e=""),e} function U(e,t,n,r){return!(!t||!t.has(r))||!(!e||!e.has(n))} function F(e,t,n,r){var i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1} function B(e,t,n){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"\x3e";var i=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\x3e";var r,i="";for(var _o13= t;_o13=0&&r<=1114111?String.fromCodePoint(r):n+e+";"} var G=l.getMetaDataSymbol();function K(e,t){return z(e,t)} function z(e,t,n){var r;var i={};for(var _o15=0;_o150&&(i[t.textNodeName]=r):void 0!==r&&(i[t.textNodeName]=r),i} function W(e){var t=Object.keys(e);for(var _e79=0;_e795&&"xml"===_r61)return re("InvalidXml","XML declaration allowed only at the start of the document.", oe(e,t));if("?"==e[t]&&"\x3e"==e[t+1]){t++;break}}return t} function J(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2])for(t+=3;tt+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+ 3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){var _n23=1;for(t+=8;tt+9&&"["===e[t+1]&& "C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t0)return re("InvalidTag","Closing tag '"+_l3+"' can't have attributes or invalid starting.",oe(e,_a13));if(0===n.length)return re("InvalidTag", "Closing tag '"+_l3+"' has not been opened.",oe(e,_a13));var _t27=n.pop();if(_l3!==_t27.tagName){var _n26=oe(e,_t27.tagStartPos);return re("InvalidTag","Expected closing tag '"+_t27.tagName+"' (opened in line "+ _n26.line+", col "+_n26.col+") instead of closing tag '"+_l3+"'.",oe(e,_a13))}0==n.length&&(i=!0)}else{var _s1=te(_d5,t);if(!0!==_s1)return re(_s1.err.code,_s1.err.msg,oe(e,_o18-_d5.length+_s1.err.line)); if(!0===i)return re("InvalidXml","Multiple possible root nodes found.",oe(e,_o18));-1!==t.unpairedTags.indexOf(_l3)||n.push({tagName:_l3,tagStartPos:_a13}),r=!0}for(_o18++;_o180)||re("InvalidXml","Invalid '"+JSON.stringify(n.map(function(e){return e.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1, col:1}):re("InvalidXml","Start tag expected.",1)}(e,t); if(!0!==_n24)throw Error("".concat(_n24.err.msg,":").concat(_n24.err.line,":").concat(_n24.err.col));}var n=new L(this.options);n.addExternalEntities(this.externalEntities);var r=n.parseXml(e);return this.options.preserveOrder|| void 0===r?r:K(r,this.options)}}, {key:"addEntity",value:function addEntity(e,t){if(-1!==t.indexOf("\x26"))throw new Error("Entity value can't have '\x26'");if(-1!==e.indexOf("\x26")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '\x26' and ';'. Eg. use '#xD' for '\x26#xD;'"); if("\x26"===t)throw new Error("An entity with value '\x26' is not permitted");this.externalEntities[e]=t}}],[{key:"getMetaDataSymbol", value:function getMetaDataSymbol(){return l.getMetaDataSymbol()}}]); return se}()}, 59455:function _(e){e.exports=JSON.parse('{"f":"0.35.0","i":"3.8.0"}')}},t={}; function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports} n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e}; return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0, get:t[r]})},n.g=function(){if("object"==(typeof globalThis==="undefined"?"undefined":_typeof(globalThis)))return globalThis; try{return this||(new Function("return this"))()}catch(e){if("object"==(typeof window==="undefined"?"undefined":_typeof(window)))return window}}(),n.hmd=function(e){return(e=Object.create(e)).children|| (e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0, set:function set(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id);}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e, t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}; var r={};return function(){n.r(r),n.d(r,{AEGIS_INIT_DATA_TYPE_FOR_AEDS:function AEGIS_INIT_DATA_TYPE_FOR_AEDS(){return f.U9}, AEGIS_INIT_DATA_TYPE_FOR_TOKEN_AUTH:function AEGIS_INIT_DATA_TYPE_FOR_TOKEN_AUTH(){return f.OA}, AegisInitDataDecoder:function AegisInitDataDecoder(){return f.zb}, AegisInitDataEncoder:function AegisInitDataEncoder(){return f.$E}, AegisInitDataProtectionData:function AegisInitDataProtectionData(){return f.Yr}, AegisInitDataV1:function AegisInitDataV1(){return f.LQ}, AegisInitDataV2:function AegisInitDataV2(){return f.FD}, AegisKeyMessageDecoder:function AegisKeyMessageDecoder(){return f.p6}, AegisKeySystemPlugin:function AegisKeySystemPlugin(){return h.Nw}, AegisMediaKeySystemAccess:function AegisMediaKeySystemAccess(){return f.eW}, BaseMediaProvider:function BaseMediaProvider(){return c.rh}, CorePlayer:function CorePlayer(){return e.Z}, CoreTextTrackCue:function CoreTextTrackCue(){return g.U}, DASH2HLSPlugin:function DASH2HLSPlugin(){return h.rw}, DASHPlugin:function DASHPlugin(){return h.YX}, DashLivePlugin:function DashLivePlugin(){return h.Sj}, DashLiveProcessor:function DashLiveProcessor(){return h.Wr}, DashVodPlugin:function DashVodPlugin(){return h.ed}, DashVodProcessor:function DashVodProcessor(){return h.fK}, DataProvider:function DataProvider(){return c.FW}, DebugLogCollectReason:function DebugLogCollectReason(){return t.g}, EventDispatcher:function EventDispatcher(){return p.p}, GET_CONTENT_TYPE_FLAGS:function GET_CONTENT_TYPE_FLAGS(){return l.hT}, HlsPlugin:function HlsPlugin(){return h.$w}, LIVE_PROVIDER_EXPERIMENTAL_PLUGOUT_JS_LOG:function LIVE_PROVIDER_EXPERIMENTAL_PLUGOUT_JS_LOG(){return s.Iq}, LIVE_PROVIDER_EXPERIMENTAL_USER_AGENT_STRING:function LIVE_PROVIDER_EXPERIMENTAL_USER_AGENT_STRING(){return s.OG}, LIVE_PROVIDER_PARAM_P2P_DISABLED:function LIVE_PROVIDER_PARAM_P2P_DISABLED(){return s.T1}, LangPlugIn:function LangPlugIn(){return h.cq}, LiveConnectorProtocol:function LiveConnectorProtocol(){return s.m7}, LiveMultiViewTrack:function LiveMultiViewTrack(){return s.$G}, LiveProvider:function LiveProvider(){return s.nu}, LiveProviderEvent:function LiveProviderEvent(){return s.WH}, LiveSpriteThumbnailIntervalType:function LiveSpriteThumbnailIntervalType(){return s.q0}, LiveStatus:function LiveStatus(){return s.Ct}, MediaEvent:function MediaEvent(){return p.x}, MultiViewPlugin:function MultiViewPlugin(){return h.BU}, MultiViewPluginControl:function MultiViewPluginControl(){return h.J6}, NLiveConnectorPlugin:function NLiveConnectorPlugin(){return h.rG}, NmcPlugin:function NmcPlugin(){return v.lr}, NmcProvider:function NmcProvider(){return v.G5}, NmcProviderError:function NmcProviderError(){return v.Ao}, NormalizePlugIn:function NormalizePlugIn(){return h.B$}, P2PState:function P2PState(){return s.$}, PlayAPIErrorCode:function PlayAPIErrorCode(){return d.Fm}, PlayAPISubErrorCode:function PlayAPISubErrorCode(){return d.uk}, PlayApi3HttpLoader:function PlayApi3HttpLoader(){return v.vM}, PlayApi3JsonHttpLoader:function PlayApi3JsonHttpLoader(){return v.$0}, PlayApi3JsonLoader:function PlayApi3JsonLoader(){return v.pV}, PlayApi3XmlLoader:function PlayApi3XmlLoader(){return v.j2}, ProviderCoreKit:function ProviderCoreKit(){return c.p6}, VODPlayAPIError:function VODPlayAPIError(){return l._Q}, VODProvider:function VODProvider(){return u.C}, VODProvider3:function VODProvider3(){return l.zG}, VODTrailerProvider:function VODTrailerProvider(){return c.d6}, VRPlugIn:function VRPlugIn(){return h.Tt}, checkDecodingCapabilities:function checkDecodingCapabilities(){return l.wE}, createProviderCoreKit:function createProviderCoreKit(){return c.pw}, getContentType:function getContentType(){return l.wg}, isErrorData:function isErrorData(){return d.XA}, unwrapCoreTextTrackCue:function unwrapCoreTextTrackCue(){return g.a}}); var e=n(12304),t=n(92402),i=n(16032),o={};for(var a in i)["default","CorePlayer","DebugLogCollectReason"].indexOf(a)<0&&(o[a]=function(e){return i[e]}.bind(0,a)); n.d(r,o);var s=n(16075),u=n(83505),l=n(28775),c=n(80844),d=n(21839),h=n(38352),f=n(46776),p=n(55235),v=n(59523),g=n(92342);r["default"]=e.Z}(),r}()}); function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol")_typeof=function _typeof(obj){return typeof obj}; else _typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}; return _typeof(obj)} !function(e,o){"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))&&"object"==(typeof module==="undefined"?"undefined":_typeof(module))?module.exports=o():"function"==typeof define&&define.amd? define([],o):"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))?exports.naver=o():(e.naver=e.naver||{},e.naver.coreplayer=e.naver.coreplayer||{},e.naver.coreplayer.VodCloudPlugin=e.naver.coreplayer.VodCloudPlugin|| {},e.naver.coreplayer.VodCloudPlugin["v0.3.0"]=o())}(self,function(){return function(){var e={d:function d(o,r){for(var n in r)e.o(r,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0, get:r[n]})}, o:function o(e,_o){return Object.prototype.hasOwnProperty.call(e,_o)}},o={}; e.d(o,{"default":function _default(){return t}}); var r,n,t=(r={"com.navercorp.vodcloud.v2.config.real":{VODCLOUD_API_VERSION:2,VODCLOUD_SERVER_GROUP:"real",VODCLOUD_PLAYBACK2_API:"apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0"},"com.navercorp.vodcloud.v3.config.real":{VODCLOUD_API_VERSION:4, VODCLOUD_SERVER_GROUP:"real",VODCLOUD_PLAYBACK3_HOST:"play.vod.naver.com",VODCLOUD_PLAYBACK3_ENDPOINT:"v4/playback/"}},(n=function n(e){Object.assign(e.environments,r)}).protocol=1,n); return o["default"]}()});