can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
58 lines (57 loc) • 139 kB
JavaScript
/*!
* CanJS - 2.3.34
* http://canjs.com/
* Copyright (c) 2018 Bitovi
* Mon, 30 Apr 2018 20:56:51 GMT
* Licensed MIT
*/
/*[global-shim-start]*/
!function(exports,global){var origDefine=global.define,get=function(e){var o,l=e.split("."),n=global;for(o=0;o<l.length&&n;o++)n=n[l[o]];return n},modules=global.define&&global.define.modules||global._define&&global._define.modules||{},ourDefine=global.define=function(e,o,l){var n;"function"==typeof o&&(l=o,o=[]);var r,t=[];for(r=0;r<o.length;r++)t.push(exports[o[r]]?get(exports[o[r]]):modules[o[r]]||get(o[r]));if(!o.length&&l.length){n={exports:{}};var i=function(e){return exports[e]?get(exports[e]):modules[e]};t.push(i,n.exports,n)}else t[0]||"exports"!==o[0]?t[0]||"module"!==o[0]||(t[0]={id:e}):(n={exports:{}},t[0]=n.exports,"module"===o[1]&&(t[1]=n));global.define=origDefine;var a=l?l.apply(null,t):void 0;global.define=ourDefine,modules[e]=n&&n.exports?n.exports:a};global.define.orig=origDefine,global.define.modules=modules,global.define.amd=!0,ourDefine("@loader",[],function(){var noop=function(){};return{get:function(){return{prepareGlobal:noop,retrieveGlobal:noop}},global:global,__exec:function(__load){eval("(function() { "+__load.source+" \n }).call(global);")}}})}({},window);
/*can@2.3.34#util/can*/
define("can/util/can",[],function(){var e="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global,n={};("undefined"==typeof GLOBALCAN||GLOBALCAN!==!1)&&(e.can=n),n.global=e,n.k=function(){},n.isDeferred=function(e){return n.dev&&n.dev.warn("can.isDeferred: this function is deprecated and will be removed in a future release. can.isPromise replaces the functionality of can.isDeferred."),e&&"function"==typeof e.then&&"function"==typeof e.pipe},n.isPromise=function(e){return!!e&&(window.Promise&&e instanceof Promise||n.isFunction(e.then)&&(void 0===n.List||!(e instanceof n.List)))},n.isMapLike=function(e){return n.Map&&(e instanceof n.Map||e&&e.___get)};var t=0;n.cid=function(e,n){return e._cid||(t++,e._cid=(n||"")+t),e._cid},n.VERSION="2.3.34",n.simpleExtend=function(e,n){for(var t in n)e[t]=n[t];return e},n.last=function(e){return e&&e[e.length-1]},n.isDOM=function(e){return(e.ownerDocument||e)===n.global.document},n.childNodes=function(e){var n=e.childNodes;if("length"in n)return n;for(var t=e.firstChild,o=[];t;)o.push(t),t=t.nextSibling;return o};var o=Function.prototype.bind;o?n.proxy=function(e,n){return o.call(e,n)}:n.proxy=function(e,n){return function(){return e.apply(n,arguments)}},n.frag=function(e,t){var o,r=t||n.document||n.global.document;return e&&"string"!=typeof e?11===e.nodeType?e:"number"==typeof e.nodeType?(o=r.createDocumentFragment(),o.appendChild(e),o):"number"==typeof e.length?(o=r.createDocumentFragment(),n.each(e,function(e){o.appendChild(n.frag(e))}),n.childNodes(o).length||o.appendChild(r.createTextNode("")),o):(o=n.buildFragment(""+e,r),n.childNodes(o).length||o.appendChild(r.createTextNode("")),o):(o=n.buildFragment(null==e?"":""+e,r),o.childNodes.length||o.appendChild(r.createTextNode("")),o)},n.scope=n.viewModel=function(e,t,o){e=n.$(e);var r=n.data(e,"scope")||n.data(e,"viewModel");switch(r||(r=new n.Map,n.data(e,"scope",r),n.data(e,"viewModel",r)),arguments.length){case 0:case 1:return r;case 2:return r.attr(t);default:return r.attr(t,o),e}};var r=function(e){var n=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return n?{href:n[0]||"",protocol:n[1]||"",authority:n[2]||"",host:n[3]||"",hostname:n[4]||"",port:n[5]||"",pathname:n[6]||"",search:n[7]||"",hash:n[8]||""}:null};return n.joinURIs=function(e,n){function t(e){var n=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?n.pop():n.push(e)}),n.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return n=r(n||""),e=r(e||""),n&&e?(n.protocol||e.protocol)+(n.protocol||n.authority?n.authority:e.authority)+t(n.protocol||n.authority||"/"===n.pathname.charAt(0)?n.pathname:n.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+n.pathname:e.pathname)+(n.protocol||n.authority||n.pathname?n.search:n.search||e.search)+n.hash:null},n["import"]=function(e,t){var o=new n.Deferred;return"object"==typeof window.System&&n.isFunction(window.System["import"])?window.System["import"](e,{name:t}).then(n.proxy(o.resolve,o),n.proxy(o.reject,o)):window.define&&window.define.amd?window.require([e],function(e){o.resolve(e)}):window.steal?steal.steal(e,function(e){o.resolve(e)}):window.require?o.resolve(window.require(e)):o.resolve(),o.promise()},n.__observe=function(){},n.isNode="object"==typeof process&&"[object process]"==={}.toString.call(process),n.isBrowserWindow="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"==typeof SimpleDOM,n.isWebWorker="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,n});
/*can@2.3.34#util/attr/attr*/
define("can/util/attr/attr",["can/util/can"],function(t){var e={xlink:"http://www.w3.org/1999/xlink"},r=t.global.setImmediate||function(t){return setTimeout(t,0)},n={input:!0,textarea:!0,select:!0},u=function(e,r){return r in e||t.document&&n[e.nodeName.toLowerCase()]},a={MutationObserver:t.global.MutationObserver||t.global.WebKitMutationObserver||t.global.MozMutationObserver,map:{"class":function(t,e){return e=e||"","http://www.w3.org/2000/svg"===t.namespaceURI?t.setAttribute("class",e):t.className=e,e},value:"value",innertext:"innerText",innerhtml:"innerHTML",textcontent:"textContent","for":"htmlFor",checked:!0,disabled:!0,readonly:function(t,e){return t.readOnly=e||"string"==typeof e?!0:!1,e},required:!0,src:function(t,e){return null==e||""===e?(t.removeAttribute("src"),null):(t.setAttribute("src",e),e)},style:function(){var e=t.global.document&&document.createElement("div");return e&&e.style&&"cssText"in e.style?function(t,e){return t.style.cssText=e||""}:function(t,e){return t.setAttribute("style",e)}}()},defaultValue:["input","textarea"],setAttrOrProp:function(t,e,r){e=e.toLowerCase();var n=a.map[e];n!==!0||r?this.set(t,e,r):this.remove(t,e)},setSelectValue:function(t,e){if(null!=e)for(var r=t.getElementsByTagName("option"),n=0;n<r.length;n++)if(e==r[n].value)return void(r[n].selected=!0);t.selectedIndex=-1},set:function(e,r,n){var i=t.isDOM(e)&&a.MutationObserver;r=r.toLowerCase();var o;i||(o=a.get(e,r));var s,l=a.map[r];"function"==typeof l?s=l(e,n):l===!0&&u(e,r)?(s=e[r]=!0,"checked"===r&&"radio"===e.type&&t.inArray((e.nodeName+"").toLowerCase(),a.defaultValue)>=0&&(e.defaultChecked=!0)):"string"==typeof l&&u(e,l)?(s=n,(e[l]!==n||"OPTION"===e.nodeName.toUpperCase())&&(e[l]=n),"value"===l&&t.inArray((e.nodeName+"").toLowerCase(),a.defaultValue)>=0&&(e.defaultValue=n)):a.setAttribute(e,r,n),i||s===o||a.trigger(e,r,o)},setAttribute:function(){var r=t.global.document;if(r&&document.createAttribute)try{r.createAttribute("{}")}catch(n){var u={},a=document.createElement("div");return function(t,r,n){var i,o,s,l=r.charAt(0);"{"!==l&&"("!==l&&"*"!==l||!t.setAttributeNode?(s=r.split(":"),1!==s.length?t.setAttributeNS(e[s[0]],r,n):t.setAttribute(r,n)):(i=u[r],i||(a.innerHTML="<div "+r+'=""></div>',i=u[r]=a.childNodes[0].attributes[0]),o=i.cloneNode(),o.value=n,t.setAttributeNode(o))}}return function(t,e,r){t.setAttribute(e,r)}}(),trigger:function(e,n,u){return t.data(t.$(e),"canHasAttributesBindings")?(n=n.toLowerCase(),r(function(){t.trigger(e,{type:"attributes",attributeName:n,target:e,oldValue:u,bubbles:!1},[])})):void 0},get:function(t,e){e=e.toLowerCase();var r=a.map[e];return"string"==typeof r&&u(t,r)?t[r]:r===!0&&u(t,e)?t[e]:t.getAttribute(e)},remove:function(t,e){e=e.toLowerCase();var r;a.MutationObserver||(r=a.get(t,e));var n=a.map[e];"function"==typeof n&&n(t,void 0),n===!0&&u(t,e)?t[e]=!1:"string"==typeof n&&u(t,n)?t[n]="":t.removeAttribute(e),a.MutationObserver||null==r||a.trigger(t,e,r)},has:function(){var e=t.global.document&&document.createElement("div");return e&&e.hasAttribute?function(t,e){return t.hasAttribute(e)}:function(t,e){return null!==t.getAttribute(e)}}()};return a});
/*can@2.3.34#event/event*/
define("can/event/event",["can/util/can"],function(t){return t.addEvent=function(t,n){var e=this.__bindEvents||(this.__bindEvents={}),i=e[t]||(e[t]=[]);return i.push({handler:n,name:t}),this},t.listenTo=function(n,e,i){var r=this.__listenToEvents;r||(r=this.__listenToEvents={});var s=t.cid(n),o=r[s];o||(o=r[s]={obj:n,events:{}});var a=o.events[e];a||(a=o.events[e]=[]),a.push(i),t.bind.call(n,e,i)},t.stopListening=function(n,e,i){var r=this.__listenToEvents,s=r,o=0;if(!r)return this;if(n){var a=t.cid(n);if((s={})[a]=r[a],!r[a])return this}for(var v in s){var l,h=s[v];n=r[v].obj,e?(l={})[e]=h.events[e]:l=h.events;for(var u in l){var d=l[u]||[];for(o=0;o<d.length;)i&&i===d[o]||!i?(t.unbind.call(n,u,d[o]),d.splice(o,1)):o++;d.length||delete h.events[u]}t.isEmptyObject(h.events)&&delete r[v]}return this},t.removeEvent=function(t,n,e){if(!this.__bindEvents)return this;for(var i,r=this.__bindEvents[t]||[],s=0,o="function"==typeof n;s<r.length;)i=r[s],(e?e(i,t,n):o&&i.handler===n||!o&&(i.cid===n||!n))?r.splice(s,1):s++;return this},t.dispatch=function(t,n){var e=this.__bindEvents;if(e){var i;"string"==typeof t?(i=t,t={type:t}):i=t.type;var r=e[i];if(r){r=r.slice(0);var s=[t];n&&s.push.apply(s,n);for(var o=0,a=r.length;a>o;o++)r[o].handler.apply(this,s);return t}}},t.one=function(n,e){var i=function(){return t.unbind.call(this,n,i),e.apply(this,arguments)};return t.bind.call(this,n,i),this},t.event={on:function(){return 0===arguments.length&&t.Control&&this instanceof t.Control?t.Control.prototype.on.call(this):t.addEvent.apply(this,arguments)},off:function(){return 0===arguments.length&&t.Control&&this instanceof t.Control?t.Control.prototype.off.call(this):t.removeEvent.apply(this,arguments)},bind:t.addEvent,unbind:t.removeEvent,delegate:function(n,e,i){return t.addEvent.call(this,e,i)},undelegate:function(n,e,i){return t.removeEvent.call(this,e,i)},trigger:t.dispatch,one:t.one,addEvent:t.addEvent,removeEvent:t.removeEvent,listenTo:t.listenTo,stopListening:t.stopListening,dispatch:t.dispatch},t.event});
/*can@2.3.34#util/fragment*/
define("can/util/fragment",["can/util/can"],function(e){var t=/^\s*<(\w+)[^>]*>/,i={}.toString,l=function(l,n,r){void 0===n&&(n=t.test(l)&&RegExp.$1),l&&"[object Function]"===i.call(l.replace)&&(l=l.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>"));var d=r.createElement("div"),a=r.createElement("div");"tbody"===n||"tfoot"===n||"thead"===n||"colgroup"===n?(a.innerHTML="<table>"+l+"</table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild):"col"===n?(a.innerHTML="<table><colgroup>"+l+"</colgroup></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"tr"===n?(a.innerHTML="<table><tbody>"+l+"</tbody></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"td"===n||"th"===n?(a.innerHTML="<table><tbody><tr>"+l+"</tr></tbody></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild.firstChild):"option"===n?(a.innerHTML="<select>"+l+"</select>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild):d.innerHTML=""+l;var o={},h=e.childNodes(d);o.length=h.length;for(var c=0;c<h.length;c++)o[c]=h[c];return[].slice.call(o)};return e.buildFragment=function(e,t){if(e&&11===e.nodeType)return e;t?t.length&&(t=t[0]):t=document;for(var i=l(e,void 0,t),n=(t||document).createDocumentFragment(),r=0,d=i.length;d>r;r++)n.appendChild(i[r]);return n},function(){var t="<-\n>",i=e.buildFragment(t,document);if(t!==i.firstChild.nodeValue){var l=e.buildFragment;e.buildFragment=function(e,t){var i=l(e,t);return 1===i.childNodes.length&&3===i.childNodes[0].nodeType&&(i.childNodes[0].nodeValue=e),i}}}(),e});
/*can@2.3.34#util/array/isArrayLike*/
define("can/util/array/isArrayLike",["can/util/can"],function(n){n.isArrayLike=function(n){var e=n&&"boolean"!=typeof n&&"number"!=typeof n&&"length"in n&&n.length;return"function"!=typeof arr&&(0===e||"number"==typeof e&&e>0&&e-1 in n)}});
/*can@2.3.34#util/array/each*/
define("can/util/array/each",["can/util/can","can/util/array/isArrayLike"],function(a){return a.each=function(e,t,r){var i,n,l,c=0;if(e)if(a.isArrayLike(e))if(a.List&&e instanceof a.List)for(n=e.attr("length");n>c&&(l=e.attr(c),t.call(r||l,l,c,e)!==!1);c++);else for(n=e.length;n>c&&(l=e[c],t.call(r||l,l,c,e)!==!1);c++);else if("object"==typeof e)if(a.Map&&e instanceof a.Map||e===a.route){var f=a.Map.keys(e);for(c=0,n=f.length;n>c&&(i=f[c],l=e.attr(i),t.call(r||l,l,i,e)!==!1);c++);}else for(i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t.call(r||e[i],e[i],i,e)===!1)break;return e},a});
/*can@2.3.34#util/object/isplain/isplain*/
define("can/util/object/isplain/isplain",["can/util/can"],function(t){var n=Object.prototype.hasOwnProperty,r=function(t){return null!==t&&t==t.window},o=function(t){if(!t||"object"!=typeof t||t.nodeType||r(t))return!1;try{if(t.constructor&&!n.call(t,"constructor")&&!n.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(o){return!1}var c;for(c in t);return void 0===c||n.call(t,c)};return t.isPlainObject=o,t});
/*can@2.3.34#util/deferred*/
define("can/util/deferred",["can/util/can"],function(t){var e=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},n=function(t){return this instanceof n?(this._doneFuncs=[],this._failFuncs=[],this._resultArgs=null,this._status="",void(t&&t.call(this,this))):new n};t.Deferred=n,t.when=n.when=function(){var e=t.makeArray(arguments);if(e.length<2){var r=e[0];return r&&t.isFunction(r.isResolved)&&t.isFunction(r.isRejected)?r:n().resolve(r)}var s=n(),i=0,u=[];return t.each(e,function(t,n){t.done(function(){u[n]=arguments.length<2?arguments[0]:arguments,++i===e.length&&s.resolve.apply(s,u)}).fail(function(){s.reject(1===arguments.length?arguments[0]:arguments)})}),s};var r=function(t,e){return function(n){var r=this._resultArgs=arguments.length>1?arguments[1]:[];return this.exec(n,this[t],r,e)}},s=function a(e,n){return function(){var r=this;return t.each(Array.prototype.slice.call(arguments),function(t,s,i){t&&(t.constructor===Array?a.apply(r,t):(r._status===n&&t.apply(r,r._resultArgs||[]),r[e].push(t)))}),this}},i=function(t){return t&&t.then&&t.fail&&t.done},u=function(e,n,r,s){i(n)?n.done(t.proxy(e.resolve,e)).fail(t.proxy(e.reject,e)):r.call(e,void 0!==n?n:s)};return e(n.prototype,{then:function(e,n){var r=t.Deferred(),s=r.resolve,i=r.reject;return this.done(function(t){"function"==typeof e?u(r,e.apply(this,arguments),s,t):s.apply(r,arguments)}),this.fail(function(t){"function"==typeof n?u(r,n.apply(this,arguments),i,t):i.apply(r,arguments)}),r},resolveWith:r("_doneFuncs","rs"),rejectWith:r("_failFuncs","rj"),done:s("_doneFuncs","rs"),fail:s("_failFuncs","rj"),always:function(){var e=t.makeArray(arguments);return e.length&&e[0]&&this.done(e[0]).fail(e[0]),this},state:function(){switch(this._status){case"rs":return"resolved";case"rj":return"rejected";default:return"pending"}},isResolved:function(){return"rs"===this._status},isRejected:function(){return"rj"===this._status},reject:function(){return this.rejectWith(this,arguments)},resolve:function(){return this.resolveWith(this,arguments)},exec:function(e,n,r,s){return""!==this._status?this:(this._status=s,t.each(n,function(t){"function"==typeof t.apply&&t.apply(e,r)}),this)},promise:function(){var t=this.then();return t.reject=t.resolve=void 0,t}}),n.prototype.pipe=n.prototype.then,t});
/*can@2.3.34#util/hashchange*/
define("can/util/hashchange",["can/util/can"],function(n){!function(){var t=function(n,t,a){n.addEventListener?n.addEventListener(t,a,!1):n.attachEvent?n.attachEvent("on"+t,a):n["on"+t]=a},a=function(){n.trigger(window,"hashchange")};t(window,"hashchange",a)}()});
/*can@2.3.34#util/inserted/inserted*/
define("can/util/inserted/inserted",["can/util/can"],function(e){e.inserted=function(n,r){if(n.length){n=e.makeArray(n);for(var i,t,a=r||n[0].ownerDocument||n[0],d=!1,o=e.$(a.contains?a:a.body),s=0;void 0!==(t=n[s]);s++){if(!d){if(!t.getElementsByTagName)continue;if(!e.has(o,t).length)return;d=!0}if(d&&t.getElementsByTagName){i=e.makeArray(t.getElementsByTagName("*")),e.trigger(t,"inserted",[],!1);for(var f,c=0;void 0!==(f=i[c]);c++)e.trigger(f,"inserted",[],!1)}}}},e.appendChild=function(n,r,i){var t;t=11===r.nodeType?e.makeArray(e.childNodes(r)):[r],n.appendChild(r),e.inserted(t,i)},e.insertBefore=function(n,r,i,t){var a;a=11===r.nodeType?e.makeArray(e.childNodes(r)):[r],n.insertBefore(r,i),e.inserted(a,t)}});
/*can@2.3.34#util/util*/
define("can/util/util",["can/util/can","can/util/attr/attr","can/yui/yui","can/event/event","can/util/fragment","can/util/array/each","can/util/object/isplain/isplain","can/util/deferred","can/util/hashchange","can/util/inserted/inserted"],function(can,attr,YUI){YUI=YUI||window.YUI,YUI.add("can-modifications",function(e,n){var t=e.DOM.addHTML;e.DOM.addHTML=function(e,n,a){("string"==typeof n||"number"==typeof n)&&(n=can.buildFragment(n,e.ownerDocument||e.getDOMNode().ownerDocument));var i;i=11===n.nodeType?can.makeArray(n.childNodes):[n];var r=t.call(this,e,n,a);return can.inserted(i),r};var a=e.Node.prototype.on;e.Node.prototype.on=function(e,n){if("attributes"===e){var t=can.$(this);can.data(t,"canHasAttributesBindings",(can.data(t,"canHasAttributesBindings")||0)+1);var i=a.apply(this,arguments),r=i.detach;return i.detach=function(){var e=can.data(t,"canHasAttributesBindings")||0;return 0>=e?can.cleanData(t,"canHasAttributesBindings"):can.data(t,"canHasAttributesBindings",e-1),r.apply(this,arguments)},i}return a.apply(this,arguments)}},"3.7.3",{requires:["node-base"]});var Y=can.Y=can.Y||YUI().use("*");can.trim=function(e){return Y.Lang.trim(e)},can.makeArray=function(e){return e?Y.Array(e):[]},can.isArray=Y.Lang.isArray,can.inArray=function(e,n,t){return n?Y.Array.indexOf(n,e,t):-1},can.map=function(e,n){return Y.Array.map(can.makeArray(e||[]),n)},can.extend=function(e){for(var n,t=e===!0?1:0,a=arguments[t],i=t+1;n=arguments[i];i++)Y.mix(a,n,!0,null,null,!!t);return a},can.param=function(e){return Y.QueryString.stringify(e,{arrayKey:!0})},can.isEmptyObject=function(e){return Y.Object.isEmpty(e)},can.proxy=function(e,n){return Y.bind.apply(Y,arguments)},can.isFunction=function(e){return Y.Lang.isFunction(e)};var prepareNodeList=function(e){return e.each(function(n,t){e[t]=n.getDOMNode()}),e.length=e.size(),e};can.$=function(e){return e===window?window:e instanceof Y.NodeList?prepareNodeList(e):"object"!=typeof e||can.isArray(e)||"undefined"!=typeof e.nodeType||e.getDOMNode?prepareNodeList(Y.all(e)):new Y.NodeList(e)},can.get=function(e,n){return e._nodes[n]},can.append=function(e,n){e.each(function(e){"string"==typeof n&&(n=can.buildFragment(n,e.getDOMNode().ownerDocument)),e.append(n)})},can.addClass=function(e,n){return e.addClass(n)},can.data=function(e,n,t){return e.item(0)?void 0===t?e.item(0).getData(n):e.item(0).setData(n,t):void 0},can.remove=function(e){return e.remove()&&e.destroy()},can.has=function(e,n){return Y.DOM.contains(e[0],n)?e:[]},can._yNodeRemove=can._yNodeRemove||Y.Node.prototype.remove,Y.Node.prototype.remove=function(){var e=this.getDOMNode();if(1===e.nodeType){can.trigger(this,"removed",[],!1);for(var n,t=e.getElementsByTagName("*"),a=0;void 0!==(n=t[a]);a++)can.trigger(n,"removed",[],!1)}can._yNodeRemove.apply(this,arguments)},Y.NodeList.addMethod("remove",Y.Node.prototype.remove);var optionsMap={type:"method",success:void 0,error:void 0},updateDeferred=function(e,n){if(e&&e.io){var t=e.io;for(var a in t)"function"==typeof n[a]?n[a]=function(){t[a].apply(t,arguments)}:n[a]=a[t]}};can.ajax=function(options){var d=can.Deferred(),requestOptions=can.extend({},options);for(var option in optionsMap)void 0!==requestOptions[option]&&(requestOptions[optionsMap[option]]=requestOptions[option],delete requestOptions[option]);requestOptions.sync=!options.async;var success=options.success,error=options.error;requestOptions.on={success:function(transactionid,response){var data=response.responseText;"json"===options.dataType&&(data=eval("("+data+")")),updateDeferred(request,d),d.resolve(data),success&&success(data,"success",request)},failure:function(e,n){updateDeferred(request,d),d.reject(request,"error"),error&&error(request,"error")}};var request=Y.io(requestOptions.url,requestOptions);return updateDeferred(request,d),d};var yuiEventId=0,addBinding=function(e,n,t,a){if(e instanceof Y.NodeList||!e.on||e.getDOMNode)e.each(function(e){e=can.$(e);var i=can.data(e,"events"),r=t+":"+n;i||can.data(e,"events",i={}),i[r]||(i[r]={}),void 0===a.__bindingsIds&&(a.__bindingsIds=yuiEventId++),i[r][a.__bindingsIds]=n?e.item(0).delegate(t,a,n):e.item(0).on(t,a)});else{var i=e,r=i.__canEvents=i.__canEvents||{};r[t]||(r[t]={}),void 0===a.__bindingsIds&&(a.__bindingsIds=yuiEventId++),r[t][a.__bindingsIds]=i.on(t,a)}},removeBinding=function(e,n,t,a){if(e instanceof Y.NodeList||!e.on||e.getDOMNode)e.each(function(e){e=can.$(e);var i=can.data(e,"events");if(i){var r=t+":"+n,o=i[r],s=o[a.__bindingsIds];s.detach(),delete o[a.__bindingsIds],can.isEmptyObject(o)&&delete i[t],can.isEmptyObject(i)}});else{var i=e,r=i.__canEvents||{},o=r[t],s=o[a.__bindingsIds];s.detach(),delete o[a.__bindingsIds],can.isEmptyObject(o)&&delete r[t],can.isEmptyObject(r)}};can.bind=function(e,n){return this.bind&&this.bind!==can.bind?this.bind(e,n):this.on||this.nodeType?addBinding(can.$(this),void 0,e,n):this.addEvent?this.addEvent(e,n):can.addEvent.call(this,e,n),this},can.unbind=function(e,n){return this.unbind&&this.unbind!==can.unbind?this.unbind(e,n):this.on||this.nodeType?removeBinding(can.$(this),void 0,e,n):can.removeEvent.call(this,e,n),this},can.on=can.bind,can.off=can.unbind,can.trigger=function(e,n,t,a){e instanceof Y.NodeList&&(e=e.item(0)),e.getDOMNode&&(e=e.getDOMNode()),e.nodeName?(e=Y.Node(e),a===!1&&e.once(n,function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e._stopper&&e._stopper()}),"string"!=typeof n&&(t=n,n=t.type,delete t.type),realTrigger(e.getDOMNode(),n,t||{})):("string"==typeof n&&(n={type:n}),n.target=n.target||e,can.dispatch.call(e,n,can.makeArray(t)))},Y.mix(Y.Node.DOM_EVENTS,{removed:!0,inserted:!0,attributes:!0,foo:!0}),Y.Env.evt.plugins.attributes={on:function(){var e=can.makeArray(arguments);return Y.Event._attach(e,{facade:!1})}},can.delegate=function(e,n,t){return this.on||this.nodeType?addBinding(can.$(this),e,n,t):this.delegate?this.delegate(e,n,t):can.bind.call(this,n,t),this},can.undelegate=function(e,n,t){return this.on||this.nodeType?removeBinding(can.$(this),e,n,t):this.undelegate?this.undelegate(e,n,t):can.unbind.call(this,n,t),this};var realTrigger,realTriggerHandler=function(e,n,t){var a,i=Y.Node(e),r=can.Y.Event.getListeners(i._yuid,n);if(r)for(a=0;a<r.length;a++)if(r[a].fire)r[a].fire(t);else{if(!r[a].handles)throw"can not fire event";can.each(r[a].handles,function(e){e.evt.fire(t)})}},fakeTrigger=function(e,n,t){var a=!1,i=can.extend({type:n,target:e,faux:!0,_stopper:function(){a=this.cancelBubble},stopPropagation:function(){a=this.cancelBubble},preventDefault:function(){}},t);if(realTriggerHandler(e,n,i),"inserted"!==n&&"removed"!==n)for(;!a&&e!==document&&e.parentNode;)e=e.parentNode,realTriggerHandler(e,n,i)};return realTrigger=document.createEvent?function(e,n,t){fakeTrigger(e,n,t)}:function(e,n,t){fakeTrigger(e,n,t)},can.attr=attr,delete attr.MutationObserver,can});
/*can@2.3.34#view/view*/
define("can/view/view",["can/util/util"],function(e){var r=e.isFunction,n=e.makeArray,t=1,i=function(e){var r=function(){return s.frag(e.apply(this,arguments))};return r.render=function(){return e.apply(e,arguments)},r},u=function(e,r){if(!e.length)throw new Error("can.view: No template or empty template:"+r)},o=function(n,t){if(r(n)){var i=e.Deferred();return i.resolve(n)}var o,a,c,d="string"==typeof n?n:n.url,f=n.engine&&"."+n.engine||d.match(/\.[\w\d]+$/);if(d.match(/^#/)&&(d=d.substr(1)),(a=document.getElementById(d))&&(f="."+a.type.match(/\/(x\-)?(.+)/)[2]),f||s.cached[d]||(d+=f=s.ext),e.isArray(f)&&(f=f[0]),c=s.toId(d),d.match(/^\/\//)&&(d=d.substr(2),d=window.steal?steal.config().root.mapJoin(""+steal.id(d)):d),window.require&&require.toUrl&&(d=require.toUrl(d)),o=s.types[f],s.cached[c])return s.cached[c];if(a)return s.registerView(c,a.innerHTML,o);var p=new e.Deferred;return e.ajax({async:t,url:d,dataType:"text",error:function(e){u("",d),p.reject(e)},success:function(e){u(e,d),s.registerView(c,e,o,p)}}),p},a=function(r){var n=[];if(e.isPromise(r))return[r];for(var t in r)e.isPromise(r[t])&&n.push(r[t]);return n},c=function(r){return e.isArray(r)&&"success"===r[1]?r[0]:r},s=e.view=e.template=function(e,n,t,i){return r(t)&&(i=t,t=void 0),s.renderAs("fragment",e,n,t,i)};return e.extend(s,{frag:function(e,r){return s.hookup(s.fragment(e),r)},fragment:function(r){return e.frag(r,document)},toId:function(r){return e.map(r.toString().split(/\/|\./g),function(e){return e?e:void 0}).join("_")},toStr:function(e){return null==e?"":""+e},hookup:function(r,n){var t,i,u=[];return e.each(r.childNodes?e.makeArray(r.childNodes):r,function(r){1===r.nodeType&&(u.push(r),u.push.apply(u,e.makeArray(r.getElementsByTagName("*"))))}),e.each(u,function(e){e.getAttribute&&(t=e.getAttribute("data-view-id"))&&(i=s.hookups[t])&&(i(e,n,t),delete s.hookups[t],e.removeAttribute("data-view-id"))}),r},hookups:{},hook:function(e){return s.hookups[++t]=e," data-view-id='"+t+"'"},cached:{},cachedRenderers:{},cache:!0,register:function(r){this.types["."+r.suffix]=r,e[r.suffix]=s[r.suffix]=function(e,n){var t,u;if(!n)return u=function(){return t||(t=r.fragRenderer?r.fragRenderer(null,e):i(r.renderer(null,e))),t.apply(this,arguments)},u.render=function(){var n=r.renderer(null,e);return n.apply(n,arguments)},u;var o=function(){return t||(t=r.fragRenderer?r.fragRenderer(e,n):r.renderer(e,n)),t.apply(this,arguments)};return r.fragRenderer?s.preload(e,o):s.preloadStringRenderer(e,o)}},types:{},ext:".ejs",registerScript:function(e,r,n){return"can.view.preloadStringRenderer('"+r+"',"+s.types["."+e].script(r,n)+");"},preload:function(r,n){var t=s.cached[r]=(new e.Deferred).resolve(function(e,r){return n.call(e,e,r)});return t.__view_id=r,s.cachedRenderers[r]=n,n},preloadStringRenderer:function(e,r){return this.preload(e,i(r))},render:function(r,n,t,i,u){return e.view.renderAs("string",r,n,t,i,u)},renderTo:function(e,r,n,t,i){return("string"===e&&r.render?r.render:r)(n,t,i)},renderAs:function(t,i,u,d,f,p){void 0!==f&&"string"==typeof f.expression&&(p=f,f=void 0),r(d)&&(f=d,d=void 0);var l,h,v,g,m=a(u);if(m.length)return l=new e.Deferred,h=e.extend({},u),m.push(o(i,!0)),e.when.apply(e,m).then(function(r){var i,o=n(arguments),a=o.pop();if(e.isPromise(u))h=c(r);else for(var s in u)e.isPromise(u[s])&&(h[s]=c(o.shift()));i=e.view.renderTo(t,a,h,d,p),l.resolve(i,h),f&&f(i,h)},function(){l.reject.apply(l,arguments)}),l;if(v=r(f),l=e.__notObserve(o)(i,v),v)g=l,l.then(function(r){f(u?e.view.renderTo(t,r,u,d,p):r)});else{if("resolved"===l.state()&&l.__view_id){var w=s.cachedRenderers[l.__view_id];return u?e.view.renderTo(t,w,u,d,p):w}l.then(function(r){g=u?e.view.renderTo(t,r,u,d,p):r})}return g},registerView:function(r,n,t,u){var o,a="object"==typeof t?t:s.types[t||s.ext];return o=a.fragRenderer?a.fragRenderer(r,n):i(a.renderer(r,n)),u=u||new e.Deferred,s.cache&&(s.cached[r]=u,u.__view_id=r,s.cachedRenderers[r]=o),u.resolve(o)},simpleHelper:function(r){return function(){var n=[],t=arguments;return e.each(t,function(e,r){if(r<=t.length){for(;e&&e.isComputed;)e=e();n.push(e)}}),r.apply(this,n)}}}),e});
/*can@2.3.34#view/callbacks/callbacks*/
define("can/view/callbacks/callbacks",["can/util/util","can/view/view"],function(t){var e=t.view.attr=function(t,e){if(!e){var i=a[t];if(!i)for(var n=0,l=r.length;l>n;n++){var o=r[n];if(o.match.test(t)){i=o.handler;break}}return i}"string"==typeof t?a[t]=e:r.push({match:t,handler:e})},a={},r=[],i=/[-\:]/,n=t.view.tag=function(e,a){if(!a){var r=l[e.toLowerCase()];return!r&&i.test(e)&&(r=function(){}),r}t.global.html5&&(t.global.html5.elements+=" "+e,t.global.html5.shivDocument()),l[e.toLowerCase()]=a},l={};return t.view.callbacks={_tags:l,_attributes:a,_regExpAttributes:r,tag:n,attr:e,tagHandler:function(e,a,r){var i,n=r.options.get("tags."+a,{proxyMethods:!1}),o=n||l[a],s=r.scope;if(i=o?t.__notObserve(o)(e,r):s,i&&r.subtemplate){s!==i&&(s=s.add(i));var c=r.subtemplate(s,r.options),v="string"==typeof c?t.view.frag(c):c;t.appendChild(e,v)}}},t.view.callbacks});
/*can@2.3.34#view/elements*/
define("can/view/elements",["can/util/util","can/view/view"],function(e){var t="undefined"!=typeof document?document:null,n=t&&function(){return 1===e.$(document.createComment("~")).length}(),o={tagToContentPropMap:{option:t&&"textContent"in document.createElement("option")?"textContent":"innerText",textarea:"value"},attrMap:e.attr.map,attrReg:/([^\s=]+)[\s]*=[\s]*/,defaultValue:e.attr.defaultValue,tagMap:{"":"span",colgroup:"col",table:"tbody",tr:"td",ol:"li",ul:"li",tbody:"tr",thead:"tr",tfoot:"tr",select:"option",optgroup:"option"},reverseTagMap:{col:"colgroup",tr:"tbody",option:"select",td:"tr",th:"tr",li:"ul"},selfClosingTags:{col:!0},getParentNode:function(e,t){return t&&11===e.parentNode.nodeType?t:e.parentNode},setAttr:e.attr.set,getAttr:e.attr.get,removeAttr:e.attr.remove,contentText:function(e){return"string"==typeof e?e:e||0===e?""+e:""},after:function(t,n){var o=t[t.length-1];o.nextSibling?e.insertBefore(o.parentNode,n,o.nextSibling,e.document):e.appendChild(o.parentNode,n,e.document)},replace:function(t,r){var a,l=t[0].parentNode;"SELECT"===l.nodeName.toUpperCase()&&l.selectedIndex>=0&&(a=l.value),o.after(t,r),e.remove(e.$(t)).length<t.length&&!n&&e.each(t,function(e){8===e.nodeType&&e.parentNode.removeChild(e)}),void 0!==a&&(l.value=a)}};return e.view.elements=o,o});
/*can@2.3.34#util/bind/bind*/
define("can/util/bind/bind",["can/util/util"],function(i){return i.bindAndSetup=function(){return i.addEvent.apply(this,arguments),this.__inSetup||(this._bindings?this._bindings++:(this._bindings=1,this._bindsetup&&this._bindsetup())),this},i.unbindAndTeardown=function(n,t){if(!this.__bindEvents)return this;var s=this.__bindEvents[n]||[],d=s.length;return i.removeEvent.apply(this,arguments),null===this._bindings?this._bindings=0:this._bindings=this._bindings-(d-s.length),!this._bindings&&this._bindteardown&&this._bindteardown(),this},i});
/*can@2.3.34#util/batch/batch*/
define("can/util/batch/batch",["can/util/can"],function(t){var a=1,n=0,c=null,e=null,s=[],u=!1;t.batch={start:function(t){if(n++,1===n){var c={events:[],callbacks:[],number:a++};s.push(c),t&&c.callbacks.push(t),e=c}},stop:function(a,l){if(a?n=0:n--,0===n){e=null;var h;if(u===!1){u=!0;for(var r,i=[];h=s.shift();){var b=h.events;c=h,t.batch.batchNum=h.number;var p;for(l&&t.batch.start(),r=0,p=b.length;p>r;r++)t.dispatch.apply(b[r][0],b[r][1]);t.batch._onDispatchedEvents(h.number),i.push.apply(i,h.callbacks),c=null,t.batch.batchNum=void 0}for(r=i.length-1;r>=0;r--)i[r]();u=!1}}},_onDispatchedEvents:function(){},trigger:function(a,n,c){a.__inSetup||(n="string"==typeof n?{type:n}:n,e?(n.batchNum=e.number,e.events.push([a,[n,c]])):n.batchNum?t.dispatch.call(a,n,c):s.length?(t.batch.start(),n.batchNum=e.number,e.events.push([a,[n,c]]),t.batch.stop()):t.dispatch.call(a,n,c))},afterPreviousEvents:function(a){var n=t.last(s);if(n){var c={};t.bind.call(c,"ready",a),n.events.push([c,[{type:"ready"},[]]])}else a({})},after:function(t){var a=e||c;a?a.callbacks.push(t):t({})}}});
/*can@2.3.34#compute/read*/
define("can/compute/read",["can/util/util"],function(e){var t=function(e,r,a){a=a||{};for(var o,s,i={foundObservable:!1},u=n(e,0,r,a,i),d=r.length,v=0;d>v;){s=u;for(var l=0,f=t.propertyReaders.length;f>l;l++){var c=t.propertyReaders[l];if(c.test(u)){u=c.read(u,r[v],v,a,i);break}}if(v+=1,u=n(u,v,r,a,i,s),o=typeof u,v<r.length&&(null===u||"function"!==o&&"object"!==o))return a.earlyExit&&a.earlyExit(s,v-1,u),{value:void 0,parent:s}}return void 0===u&&a.earlyExit&&a.earlyExit(s,v-1),{value:u,parent:s}},r=function(e,t){var r=t[e-1];return r&&r.at},n=function(e,r,n,a,o,s){var i;do{i=!1;for(var u=0,d=t.valueReaders.length;d>u;u++)t.valueReaders[u].test(e,r,n,a)&&(e=t.valueReaders[u].read(e,r,n,a,o,s))}while(i);return e};t.valueReaders=[{name:"compute",test:function(e,t,n,a){return e&&e.isComputed&&!r(t,n)},read:function(t,r,n,a,o){return a.readCompute===!1&&r===n.length?t:(!o.foundObservable&&a.foundObservable&&(a.foundObservable(t,r),o.foundObservable=!0),t instanceof e.Compute?t.get():t())}},{name:"function",test:function(t,r,n,a){var o=typeof t;return!("function"!==o||t.isComputed||e.Construct&&t.prototype instanceof e.Construct||e.route&&t===e.route)},read:function(t,n,a,o,s,i){return r(n,a)?n===a.length?e.proxy(t,i):t:o.callMethodsOnObservables&&e.isMapLike(i)?t.apply(i,o.args||[]):o.isArgument&&n===a.length?o.proxyMethods!==!1?e.proxy(t,i):t:t.apply(i,o.args||[])}}],t.propertyReaders=[{name:"map",test:e.isMapLike,read:function(e,t,r,n,a){!a.foundObservable&&n.foundObservable&&(n.foundObservable(e,r),a.foundObservable=!0);var o=e.attr(t.key);return void 0!==o?o:e[t.key]}},{name:"promise",test:function(t){return e.isPromise(t)},read:function(t,r,n,a,o){!o.foundObservable&&a.foundObservable&&(a.foundObservable(t,n),o.foundObservable=!0);var s=t.__observeData;return t.__observeData||(s=t.__observeData={isPending:!0,state:"pending",isResolved:!1,isRejected:!1,value:void 0,reason:void 0},e.cid(s),e.simpleExtend(s,e.event),t.then(function(e){s.isPending=!1,s.isResolved=!0,s.value=e,s.state="resolved",s.dispatch("state",["resolved","pending"])},function(e){s.isPending=!1,s.isRejected=!0,s.reason=e,s.state="rejected",s.dispatch("state",["rejected","pending"])})),e.__observe(s,"state"),r.key in s?s[r.key]:t[r.key]}},{name:"object",test:function(){return!0},read:function(e,t){return null==e?void 0:t.key in e?e[t.key]:t.at&&a[t.key]&&"@"+t.key in e?(t.at=!1,e["@"+t.key]):void 0}}];var a={index:!0,key:!0,event:!0,element:!0,viewModel:!0};return t.write=function(t,r,n,a){return a=a||{},e.isMapLike(t)?!a.isArgument&&t._data&&t._data[r]&&t._data[r].isComputed?t._data[r](n):t.attr(r,n):t[r]&&t[r].isComputed?t[r](n):void("object"==typeof t&&(t[r]=n))},t.reads=function(e){var t=[],r=0,n=!1;"@"===e.charAt(0)&&(r=1,n=!0);for(var a="",o=r;o<e.length;o++){var s=e.charAt(o);"."===s||"@"===s?"\\"!==e.charAt(o-1)?(t.push({key:a,at:n}),n="@"===s,a=""):a=a.substr(0,a.length-1)+".":a+=s}return t.push({key:a,at:n}),t},t});
/*can@2.3.34#compute/get_value_and_bind*/
define("can/compute/get_value_and_bind",["can/util/util"],function(e){function t(t,n,r){this.newObserved={},this.oldObserved=null,this.func=t,this.context=n,this.compute=r,this.onDependencyChange=e.proxy(this.onDependencyChange,this),this.depth=null,this.childDepths={},this.ignore=0,this.inBatch=!1,this.ready=!1,r.observedInfo=this,this.setReady=e.proxy(this._setReady,this)}e.simpleExtend(t.prototype,{getPrimaryDepth:function(){return this.compute._primaryDepth},_setReady:function(){this.ready=!0},getDepth:function(){return null!==this.depth?this.depth:this.depth=this._getDepth()},_getDepth:function(){var e=0,t=this.childDepths;for(var n in t)t[n]>e&&(e=t[n]);return e+1},addEdge:function(e){e.obj.bind(e.event,this.onDependencyChange),e.obj.observedInfo&&(this.childDepths[e.obj._cid]=e.obj.observedInfo.getDepth(),this.depth=null)},removeEdge:function(e){e.obj.unbind(e.event,this.onDependencyChange),e.obj.observedInfo&&(delete this.childDepths[e.obj._cid],this.depth=null)},dependencyChange:function(e){this.bound&&this.ready&&(void 0!==e.batchNum?e.batchNum!==this.batchNum&&(t.registerUpdate(this),this.batchNum=e.batchNum):this.updateCompute(e.batchNum))},onDependencyChange:function(e,t,n){this.dependencyChange(e,t,n)},updateCompute:function(e){if(this.bound){var t=this.value;this.getValueAndBind(),this.compute.updater(this.value,t,e)}},getValueAndBind:function(){this.bound=!0,this.oldObserved=this.newObserved||{},this.ignore=0,this.newObserved={},this.ready=!1,h.push(this),this.value=this.func.call(this.context),h.pop(),this.updateBindings(),e.batch.afterPreviousEvents(this.setReady)},updateBindings:function(){var e,t,n=this.newObserved,r=this.oldObserved;for(e in n)t=n[e],r[e]?r[e]=null:this.addEdge(t);for(e in r)t=r[e],t&&this.removeEdge(t)},teardown:function(){this.bound=!1;for(var e in this.newObserved){var t=this.newObserved[e];this.removeEdge(t)}this.newObserved={}}});var n,r=[],i=1/0,s=0;t.registerUpdate=function(e,t){var n=e.getDepth()-1,h=e.getPrimaryDepth();i=Math.min(h,i),s=Math.max(h,s);var o=r[h]||(r[h]={observeInfos:[],current:1/0,max:0}),a=o.observeInfos[n]||(o.observeInfos[n]=[]);a.push(e),o.current=Math.min(n,o.current),o.max=Math.max(n,o.max)},t.updateUntil=function(e,t){for(var h;;){if(!(s>=i&&e>=i))return;var o=r[i];if(o&&o.current<=o.max){if(o.current>t)return;var a=o.observeInfos[o.current];a&&(h=a.pop())?h.updateCompute(n):o.current++}else i++}},t.batchEnd=function(e){var t;for(n=e;;){if(!(s>=i))return r=[],i=1/0,void(s=0);var h=r[i];if(h&&h.current<=h.max){var o=h.observeInfos[h.current];o&&(t=o.pop())?t.updateCompute(e):h.current++}else i++}};var h=[];return e.__observe=function(e,t){var n=h[h.length-1];if(n&&!n.ignore){var r=t+"",i=e._cid+"|"+r;n.traps?n.traps.push({obj:e,event:r,name:i}):n.newObserved[i]||(n.newObserved[i]={obj:e,event:r})}},e.__reading=e.__observe,e.__trapObserves=function(){if(h.length){var e=h[h.length-1],t=e.traps=[];return function(){return e.traps=null,t}}return function(){return[]}},e.__observes=function(e){var t=h[h.length-1];if(t)for(var n=0,r=e.length;r>n;n++){var i=e[n],s=i.name;t.newObserved[s]||(t.newObserved[s]=i)}},e.__isRecordingObserves=function(){var e=h.length,t=h[e-1];return e&&0===t.ignore&&t},e.__notObserve=function(e){return function(){if(h.length){var t=h[h.length-1];t.ignore++;var n=e.apply(this,arguments);return t.ignore--,n}return e.apply(this,arguments)}},e.batch._onDispatchedEvents=t.batchEnd,t});
/*can@2.3.34#compute/proto_compute*/
define("can/compute/proto_compute",["can/util/util","can/util/bind/bind","can/compute/read","can/compute/get_value_and_bind","can/util/batch/batch"],function(t,e,n,i){t.Compute=function(e,n,i,s){t.cid(this,"compute");for(var u=[],r=0,h=arguments.length;h>r;r++)u[r]=arguments[r];var a=typeof u[1];"function"==typeof u[0]?this._setupGetterSetterFn(u[0],u[1],u[2],u[3]):u[1]?"string"===a?this._setupProperty(u[0],u[1],u[2]):"function"===a?this._setupSetter(u[0],u[1],u[2]):u[1]&&u[1].fn?this._setupAsyncCompute(u[0],u[1]):this._setupSettings(u[0],u[1]):this._setupSimpleValue(u[0]),this._args=u,this._primaryDepth=0,this.isComputed=!0},t.simpleExtend(t.Compute.prototype,{setPrimaryDepth:function(t){this._primaryDepth=t},_setupGetterSetterFn:function(e,n,i){this._set=n?t.proxy(e,n):e,this._get=n?t.proxy(e,n):e,this._canObserve=i===!1?!1:!0;var s=u(this,e,n||this);t.simpleExtend(this,s)},_setupProperty:function(e,n,i){var s,u=t.isMapLike(e),r=this;u?(s=function(t,e,n){r.updater(e,n,t.batchNum)},this.hasDependencies=!0,this._get=function(){return e.attr(n)},this._set=function(t){e.attr(n,t)}):(s=function(){r.updater(r._get(),r.value)},this._get=function(){return t.getObject(n,[e])},this._set=function(i){var s=n.split("."),u=s.pop(),r=t.getObject(s.join("."),[e]);r[u]=i}),this._on=function(u){t.bind.call(e,i||n,s),this.value=this._get()},this._off=function(){return t.unbind.call(e,i||n,s)}},_setupSetter:function(e,n,i){this.value=e,this._set=n,t.simpleExtend(this,i)},_setupSettings:function(t,e){if(this.value=t,this._set=e.set||this._set,this._get=e.get||this._get,!e.__selfUpdater){var n=this,i=this.updater;this.updater=function(){i.call(n,n._get(),n.value)}}this._on=e.on?e.on:this._on,this._off=e.off?e.off:this._off},_setupAsyncCompute:function(e,n){var i=this;this.value=e,this._setUpdates=!0,this.lastSetValue=new t.Compute(e),this._set=function(t){return t===i.lastSetValue.get()?this.value:i.lastSetValue.set(t)},this._get=function(){return r.call(n.context,i.lastSetValue.get())};var s,r=n.fn;if(0===r.length)s=u(this,r,n.context);else if(1===r.length)s=u(this,function(){return r.call(n.context,i.lastSetValue.get())},n);else{var h=this.updater,a=function(t){h.call(i,t,i.value)};this.updater=function(t){h.call(i,t,i.value)},s=u(this,function(){var t=r.call(n.context,i.lastSetValue.get(),a);return void 0!==t?t:this.value},this)}t.simpleExtend(this,s)},_setupSimpleValue:function(t){this.value=t},_bindsetup:t.__notObserve(function(){this.bound=!0,this._on(this.updater)}),_bindteardown:function(){this._off(this.updater),this.bound=!1},bind:t.bindAndSetup,unbind:t.unbindAndTeardown,clone:function(e){return e&&"function"==typeof this._args[0]?this._args[1]=e:e&&(this._args[2]=e),new t.Compute(this._args[0],this._args[1],this._args[2],this._args[3])},_on:t.k,_off:t.k,get:function(){var e=t.__isRecordingObserves();return e&&this._canObserve!==!1&&(t.__observe(this,"change"),this.bound||t.Compute.temporarilyBind(this)),this.bound?(e&&this.getDepth&&this.getDepth()>=e.getDepth()&&i.updateUntil(this.getPrimaryDepth(),this.getDepth()),this.value):this._get()},_get:function(){return this.value},set:function(t){var e=this.value,n=this._set(t,e);return this._setUpdates?this.value:this.hasDependencies?this._get():(void 0===n?this.value=this._get():this.value=n,s(this,this.value,e),this.value)},_set:function(t){return this.value=t},updater:function(t,e,n){this.value=t,s(this,t,e,n)},toFunction:function(){return t.proxy(this._computeFn,this)},_computeFn:function(t){return arguments.length?this.set(t):this.get()}});var s=function(e,n,i,s){var u=n!==i&&!(n!==n&&i!==i);u&&t.batch.trigger(e,{type:"change",batchNum:s},[n,i])},u=function(e,n,s){var u=new i(n,s,e);return{readInfo:u,_on:function(){u.getValueAndBind(),e.value=u.value,e.hasDependencies=!t.isEmptyObject(u.newObserved)},_off:function(){u.teardown()},getDepth:function(){return u.getDepth()},getPrimaryDepth:function(){return u.getPrimaryDepth()}}};t.Compute.temporarilyBind=function(e){var n=e.computeInstance||e;n.bind("change",t.k),r||(r=[],setTimeout(h,10)),r.push(n)};var r,h=function(){for(var e=0,n=r.length;n>e;e++)r[e].unbind("change",t.k);r=null};return t.Compute.async=function(e,n,i){return new t.Compute(e,{fn:n,context:i})},t.Compute.truthy=function(e){return new t.Compute(function(){var t=e.get();return"function"==typeof t&&(t=t.get()),!!t})},t.Compute.read=n,t.Compute.set=n.write,t.Compute});
/*can@2.3.34#compute/compute*/
define("can/compute/compute",["can/util/util","can/util/bind/bind","can/util/batch/batch","can/compute/proto_compute"],function(t,n){return t.compute=function(n,e,u,o){var c=new t.Compute(n,e,u,o),r=c.bind,i=c.unbind,p=function(t){return arguments.length?c.set(t):c.get()},m=t.cid(p,"compute"),a="__handler"+m;return p.bind=function(t,n){var e=n&&n[a];return n&&!e&&(e=n[a]=function(){n.apply(p,arguments)}),r.call(c,t,e)},p.unbind=function(t,n){var e=n&&n[a];return e?(delete n[a],c.unbind(t,e)):i.apply(c,arguments)},p.isComputed=c.isComputed,p.clone=function(u){return"function"==typeof n&&(e=u),t.compute(n,e,u,o)},p.computeInstance=c,p},t.compute.truthy=function(n){return t.compute(function(){var t=n();return"function"==typeof t&&(t=t()),!!t})},t.compute.async=function(n,e,u){return t.compute(n,{fn:e,context:u})},t.compute.read=t.Compute.read,t.compute.set=t.Compute.set,t.compute.temporarilyBind=t.Compute.temporarilyBind,t.compute});
/*can@2.3.34#view/scope/compute_data*/
define("can/view/scope/compute_data",["can/util/util","can/compute/compute","can/compute/get_value_and_bind"],function(e,n,t){var o=function(n){return n.reads&&1===n.reads.length&&n.root instanceof e.Map&&!e.isFunction(n.root[n.reads[0].key])},a=function(n,t,o,a,r){if(!(arguments.length>4)){if(a.root)return e.compute.read(a.root,a.reads,o).value;var u=n.read(t,o);return a.scope=u.scope,a.initialValue=u.value,a.reads=u.reads,a.root=u.rootObserve,a.setRoot=u.setRoot,u.value}var d=a.root||a.setRoot;if(d)if(d.isComputed)d(r);else if(a.reads.length){var c=a.reads.length-1,i=a.reads.length?e.compute.read(d,a.reads.slice(0,c)).value:d;e.compute.set(i,a.reads[c].key,r,o)}};return function(n,r,u){u=u||{args:[]};var d={},c=function(e){return arguments.length?a(n,r,u,d,e):a(n,r,u,d)},i=e.compute(void 0,{on:function(){s.getValueAndBind(),o(d)&&(s.dependencyChange=function(e,n){return"function"!=typeof n?this.newVal=n:(s.dependencyChange=t.prototype.dependencyChange,s.getValueAndBind=t.prototype.getValueAndBind),t.prototype.dependencyChange.call(this,e)},s.getValueAndBind=function(){this.value=this.newVal}),i.computeInstance.value=s.value,i.computeInstance.hasDependencies=!e.isEmptyObject(s.newObserved)},off:function(){s.dependencyChange=t.prototype.dependencyChange,s.getValueAndBind=t.prototype.getValueAndBind,s.teardown()},set:c,get:c,__selfUpdater:!0}),s=new t(c,null,i.computeInstance);return d.compute=i,d}});
/*can@2.3.34#util/string/string*/
define("can/util/string/string",["can/util/util"],function(e){var r=/_|-/,n=/\=\=/,t=/([A-Z]+)([A-Z][a-z])/g,a=/([a-z\d])([A-Z])/g,u=/([a-z\d])([A-Z])/g,i=/\{([^\}]+)\}/g,c=/"/g,o=/'/g,l=/-+(.)?/g,p=/[a-z][A-Z]/g,f=function(e,r,n){var t=e[r];return void 0===t&&n===!0&&(t=e[r]={}),t},g=function(e){return/^f|^o/.test(typeof e)},d=function(e){var r=null===e||void 0===e||isNaN(e)&&""+e=="NaN";return""+(r?"":e)};return e.extend(e,{esc:function(e){return d(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(c,""").replace(o,"'")},getObject:function(r,n,t){var a,u,i,c,o=r?r.split("."):[],l=o.length,p=0;if(n=e.isArray(n)?n:[n||window],c=n.length,!l)return n[0];for(p;c>p;p++){for(a=n[p],i=void 0,u=0;l>u&&g(a);u++)i=a,a=f(i,o[u]);if(void 0!==i&&void 0!==a)break}if(t===!1&&void 0!==a&&delete i[o[u-1]],t===!0&&void 0===a)for(a=n[0],u=0;l>u&&g(a);u++)a=f(a,o[u],!0);return a},capitalize:function(e,r){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return d(e).replace(l,function(e,r){return r?r.toUpperCase():""})},hyphenate:function(e){return d(e).replace(p,function(e,r){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})},underscore:function(e){return e.replace(n,"/").replace(t,"$1_$2").replace(a,"$1_$2").replace(u,"_").toLowerCase()},sub:function(r,n,t){var a=[];return r=r||"",a.push(r.replace(i,function(r,u){var i=e.getObject(u,n,t===!0?!1:void 0);return void 0===i||null===i?(a=null,""):g(i)&&a?(a.push(i),""):""+i})),null===a?a:a.length<=1?a[0]:a},replacer:i,undHash:r}),e});
/*can@2.3.34#construct/construct*/
define("can/construct/construct",["can/util/string/string"],function(t){var n,e=0;try{Object.getOwnPropertyDescriptor({}),n=!0}catch(r){n=!1}var o=function(t,n){var e=Object.getOwnPropertyDescriptor(t,n);return e&&(e.get||e.set)?e:null},s=function(n,e,r){r=r||n;var s;for(var i in n)(s=o(n,i))?this._defineProperty(r,e,i,s):t.Construct._overwrite(r,e,i,n[i])},i=function(n,e,r){r=r||n;for(var o in n)t.Construct._overwrite(r,e,o,n[o])};return t.Construct=function(){return arguments.length?t.Construct.extend.apply(t.Construct,arguments):void 0},t.extend(t.Construct,{constructorExtends:!0,newInstance:function(){var t,n=this.instance();return n.setup&&(n.__inSetup=!0,t=n.setup.apply(n,arguments),delete n.__inSetup),n.init&&n.init.apply(n,t||arguments),n},_inherit:n?s:i,_defineProperty:function(t,n,e,r){Object.defineProperty(t,e,r)},_overwrite:function(t,n,e,r){t[e]=r},setup:function(n,e){this.defaults=t.extend(!0,{},n.defaults,this.defaults)},instance:function(){e=1;var t=new this;return e=0,t},extend:function(n,r,o){function s(){return e?void 0:this.constructor!==a&&arguments.length&&a.constructorExtends?a.extend.apply(a,arguments):a.newInstance.apply(a,arguments)}var i=n,u=r,c=o;"string"!=typeof i&&(c=u,u=i,i=null),c||(c=u,u=null),c=c||{};var a,p,f,l,h,d,y,m,g,v=this,_=this.prototype;g=this.instance(),t.Construct._inherit(c,_,g),i?(p=i.split("."),y=p.pop()):u&&u.shortName?y=u.shortName:this.shortName&&(y=this.shortName),"undefined"==typeof constructorName&&(a=function(){return s.apply(this,arguments)});for(d in v)v.hasOwnProperty(d)&&(a[d]=v[d]);t.Construct._inherit(u,v,a),i&&(f=t.getObject(p.join("."),window,!0),m=f,l=t.underscore(i.replace(/\./g,"_")),h=t.underscore(y),f[y]=a),t.extend(a,{constructor:a,prototype:g,namespace:m,_shortName:h,fullName:i,_fullName:l}),void 0!==y&&(a.shortName=y),a.prototype.constructor=a;var w=[v].concat(t.makeArray(arguments)),C=a.setup.apply(a,w);return a.init&&a.init.apply(a,C||w),a}}),t.Construct.prototype.setup=function(){},t.Construct.prototype.init=function(){},t.Construct});
/*can@2.3.34#map/bubble*/
define("can/map/bubble",["can/util/util"],function(n){var i=n.bubble={bind:function(n,e){if(!n.__inSetup){var b,t=i.events(n,e),r=t.length;n._bubbleBindings||(n._bubbleBindings={});for(var u=0;r>u;u++)b=t[u],n._bubbleBindings[b]?n._bubbleBindings[b]++:(n._bubbleBindings[b]=1,i.childrenOf(n,b))}},unbind:function(e,b){for(var t,r=i.events(e,b),u=r.length,d=0;u>d;d++)t=r[d],e._bubbleBindings&&e._bubbleBindings[t]--,e._bubbleBindings&&!e._bubbleBindings[t]&&(delete e._bubbleBindings[t],i.teardownChildrenFrom(e,t),n.isEmptyObject(e._bubbleBindings)&&delete e._bubbleBindings)},add:function(e,b,t){if(b instanceof n.Map&&e._bubbleBindings)for(var r in e._bubbleBindings)e._bubbleBindings[r]&&(i.teardownFromParent(e,b,r),i.toParent(b,e,t,r))},addMany:function(n,e){for(var b=0,t=e.length;t>b;b++)i.add(n,e[b],b)},remove:function(e,b){if(b instanceof n.Map&&e._bubbleBindings)for(var t in e._bubbleBindings)e._bubbleBindings[t]&&i.teardownFromParent(e,b,t)},removeMany:function(n,e){for(var b=0,t=e.length;t>b;b++)i.remove(n,e[b])},set:function(e,b,t,r){return n.isMapLike(t)&&i.add(e,t,b),n.isMapLike(r)&&i.remove(e,r),t},events:function(n,i){return n.constructor._bubbleRule(i,n)},toParent:function(i,e,b,t){n.listenTo.call(e,i,t,function(){var r=n.makeArray(arguments),u=r.shift();r[0]=(n.List&&e instanceof n.List?e.indexOf(i):b)+(r[0]?"."+r[0]:""),u.triggeredNS=u.triggeredNS||{},u.triggeredNS[e._cid]||(u.tr