text: ﻿window.console&&window.console.log||(window.console={log:function(){},error:function(){},info:function(){},table:function(){}});(function(){var a=false,c=null,b="";"use strict";var j=b,o=Object.prototype.toString,e=Object.prototype.hasOwnProperty,p=function(){},k,g=c,h=function(){if(g==c)g=$('<div style="display:none"></div>');return g},i=0,f=0,d=window.bingo={version:{major:1,minor:1,rev:615,toString:function(){return[this.major,this.minor,this.rev].join(".")}},isDebug:a,prdtVersion:b,stringEmpty:j,noop:p,newLine:"\r\n",hasOwnProp:function(b,a){return e.call(b,a)},trace:function(a){console.error&&console.error(a.stack||a.message||a+b)},isType:function(a,b){return o.apply(b)==="[object "+a+"]"},isUndefined:function(a){return typeof a==="undefined"||a===k},isNull:function(a){return a===c||this.isUndefined(a)},isBoolean:function(a){return this.isType("Boolean",a)},isNullEmpty:function(a){return this.isNull(a)||a===j},isFunction:function(a){return this.isType("Function",a)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},isString:function(a){return this.isType("String",a)},isObject:function(b){var a=this;return!a.isNull(b)&&a.isType("Object",b)&&!a.isElement(b)&&!a.isWindow(b)},isPlainObject:function(b){if(!this.isObject(b))return a;try{if(b.constructor&&!e.call(b,"constructor")&&!e.call(b.constructor.prototype,"isPrototypeOf"))return a}catch(d){return a}var c;for(c in b);return c===k||e.call(b,c)},isArray:function(a){return Array.isArray?Array.isArray(a):this.isType("Array",a)},isWindow:function(a){return!this.isNull(a)&&a==a.window},isElement:function(b){var c=b&&(b.ownerDocument||b).documentElement;return c?true:a},trim:function(a){return this.isString(a)?a.replace(/(^\s*)|(\s*$)|(^\u3000*)|(\u3000*$)|(^\ue4c6*)|(\ue4c6*$)/g,b):this.isNull(a)?b:a.toString()},isStringEquals:function(b,c){return b==c?true:!this.isString(b)||!this.isString(c)?a:b.toUpperCase()==c.toUpperCase()},replaceAll:function(a,b,d,c){if(this.isNullEmpty(a)||this.isNullEmpty(b))return a;b=b.replace(/([^A-Za-z0-9])/g,"\\$1");a=a.replace(new RegExp(b,c||"g"),d);return a},toStr:function(a){return this.isNull(a)?b:a.toString()},inArray:function(d,h,f,g){var e=this.isFunction(d)?d:c,b=-1;this.each(h,function(c,f){if(e){if(e.call(c,c,f)){b=f;return a}}else if(c===d){b=f;return a}},f,g);return b},removeArrayItem:function(d,b){for(var c=[],a=0,e=b.length;a<e;a++)b[a]!=d&&c.push(b[a]);return c},sliceArray:function(c,a,b){isNaN(a)&&(a=0);isNaN(b)&&(b=c.length);if(a<0)a=b+a;if(a<0)a=0;return Array.prototype.slice.call(c,a,a+b)},makeAutoId:function(){var a=(new Date).valueOf();f=a===i?f+1:0;i=a;return[a,f].join("_")},each:function(e,l,k,f){if(this.isNull(e)||!d.isNumeric(e.length))return;var i=c,b=d.isNumeric(k)?k:0;if(b<0)b=e.length+b;if(b<0)b=0;var j=f?b-1:e.length,h=f?e.length-1:b;if(f&&h<=j||!f&&h>=j)return;for(var m=f?-1:1,g=h;g!=j;g+=m){i=e[g];if(l.call(i,i,g)===a)break}},eachProp:function(b,f){if(!b)return;var c;for(var e in b)if(d.hasOwnProp(b,e)){c=b[e];if(f.call(c,c,e)===a)break}},htmlEncode:function(a){if(this.isNullEmpty(a))return b;var c=h();c.text(a);a=c.html();return a},htmlDecode:function(a){if(this.isNullEmpty(a))return b;var c=h();c.html(a);var d=c.text();return d},urlEncode:function(a){return this.isNullEmpty(a)?b:encodeURI(a)},urlDecode:function(a){return this.isNullEmpty(a)?b:decodeURI(a)},clearObject:function(a){for(var b=0,e=arguments.length;b<e;b++){a=arguments[b];d.eachProp(a,function(b,e){b&&b.$clearAuto===true&&d.clearObject(b);a[e]=c})}},extend:function(a){var b=arguments.length;if(b<=0)return a;if(b==1){for(var e in a)d.hasOwnProp(a,e)&&(this[e]=a[e]);return this}for(var f=c,g=1;g<b;g++){f=arguments[g];!this.isNull(f)&&d.eachProp(f,function(b,c){a[c]=b})}return a},clone:function(c,b){b=b!==a;return m.clone(c,b)},proxy:function(b,a){return function(){return a&&a.apply(b,arguments)}}},l=["bingoV"+d.version.major].join(b),n=[l,d.version.minor].join("_");window[l]=window[n]=d;var m={isCloneObject:function(a){return d.isPlainObject(a)},clone:function(a,b){return!a?a:d.isArray(a)?this.cloneArray(a,b):this.isCloneObject(a)?this.cloneObject(a,b):a},cloneObject:function(c,a){var b={};d.eachProp(c,function(c,d){if(a)c=m.clone(c,a);b[d]=c});return b},cloneArray:function(f,e){for(var g=[],b=c,h=f.length,d=0;d<h;d++){b=f[d];if(e!==a)b=this.clone(b,e);g.push(b)}return g}}})();(function(b){var a=null;"use strict";var c=/[\[\.]?[\'\"]?([^\[\]\.\'\"]+)[\'\"]?[\]\.]?/g,d=function(b){c.lastIndex=0;var a=[];b.replace(c,function(c,b){if(g(c)&&a.length>0)a[a.length-1].isArray=true;a.push({attrname:b,isArray:false})});return a},f=function(h,e,k){if(!h||b.isNullEmpty(e))return;if(e.indexOf(".")<0&&e.indexOf("]")<0)h[e]=k;for(var g=d(e),f=h,i=a,l=g.length-1,c=a,j=0;j<l;j++){i=g[j];c=i.attrname;if(b.isNull(f[c]))f[c]=i.isArray?[]:{};f=f[c]}c=g[l].attrname;f[c]=k},g=function(a){return a.indexOf("]")>=0&&(a.indexOf('"')<0&&a.indexOf("'")<0)},e=function(h,e){if(!h||b.isNullEmpty(e))return;if(e.indexOf(".")<0&&e.indexOf("]")<0)return h[e];for(var g=d(e),f=h,j=a,k=g.length-1,c=a,i=0;i<k;i++){j=g[i];c=j.attrname;if(b.isNull(f[c]))return f[c];f=f[c]}c=g[k].attrname;return f[c]};b.extend({datavalue:function(a,b,c){if(arguments.length>=3)f(a,b,c);else return e(a,b)}})})(bingo);(function(c){var b=null,a=true;"use strict";c.Event=function(f,e){var b=function(a){a&&b.on(a);return arguments.length==0?b:this};b.__bg_isEvent__=a;b.__eventList__=e||[];c.extend(b,d);b.owner(f);return b};c.isEvent=function(b){return b&&b.__bg_isEvent__===a};var d={_end:false,_endArg:undefined,owner:function(a){if(arguments.length==0)return this.__owner__;else{this.__owner__=a;return this}},_this:function(){return this.owner()||this},on:function(a){if(a)this._checkEnd(a)||this.__eventList__.push({one:false,callback:a});return this},one:function(b){if(b)this._checkEnd(b)||this.__eventList__.push({one:a,callback:b});return this},off:function(b){var a=this;if(b){var d=[];c.each(a.__eventList__,function(){this.callback!=b&&d.push(this)});a.__eventList__=d}else a.__eventList__=[];return a},_checkEnd:function(b){var a=this;if(a._end){var d=a._endArg||[],c=a._this();setTimeout(function(){b.apply(c,d)},1)}return a._end},end:function(c){var b=this;b._end=a;b._endArg=c;b.trigger(c);b.off();return b},trigger:function(){var f=this;for(var h=f.__eventList__,i=b,e=b,d=b,j=f._this(),g=0,k=h.length;g<k;g++){e=h[g];if(e.one===a){d||(d=f.__eventList__);d=c.removeArrayItem(e,d)}if((i=e.callback.apply(j,arguments[0]||[]))===false)break}d&&(f.__eventList__=d);return i},triggerHandler:function(){var e=this,f=e.__eventList__,d=b,g=e._this();if(f.length==0)return;d=f[0];var h=d.callback.apply(g,arguments[0]||[]);if(d.one===a)e.__eventList__=c.removeArrayItem(d,e.__eventList__);return h},clone:function(a){return c.Event(a||this.owner(),this.__eventList__)},size:function(){return this.__eventList__.length}}})(bingo);(function(a){var c=true,b=false;"use strict";var e="isVar1212";a.isVariable=function(a){return a&&a._isVar_==e};a.variableOf=function(b){return a.isVariable(b)?b():b};var g=a.variable=function(k,h,j){var i=a.variableOf(k),g=function(c){g.owner=this;if(arguments.length==0){var f=g._get_?g.$get():g.value;g.owner=null;return f}else{c=a.variableOf(c);var e=a.clone(g.$get());if(g._set_)g._set_.call(g,c);else g.value=c;c=g.$get();var d=!a.equals(c,e);if(d)g.$setChange();else g._triggerFn([c],b);g.owner=null;return g.$owner()||this}};g._isVar_=e;g._isChanged=c;a.extend(g,f);d&&a.extend(g,d);g.$owner(h).$view(j);g(i);return g},d=null;g.extend=function(b){if(!b)return;d=a.extend(d||{},b)};var f={size:function(){var a=this.$get();return a&&a.length||0},_triggerChange:function(){var a=this.$get();this._triggerFn([a],c)},_addFn:function(c,b,a){(this._fnList||(this._fnList=[])).push({fn:c,change:b,disposer:a});return this},_triggerFn:function(h,f){var d=this;if(d._fnList){var g=d,e=b;a.each(d._fnList,function(){var b=this;if(b.disposer&&b.disposer.isDisposed){e=c;a.clearObject(b);return}(f||!b.change)&&b.fn.apply(g,h)});if(e)d._fnList=a.linq(d._fnList).where(function(){return this.fn}).toArray()}},$off:function(e){var d=this;if(arguments.length>0)d._fnList=a.linq(d._fnList).where(function(){if(this.fn==e){a.clearObject(this);return b}else return c}).toArray();else{a.each(d._fnList,function(){a.clearObject(this)});d._fnList=[]}},$assign:function(a,c){return this._addFn(a,b,c||this.$view())},$subs:function(a,b){return this._addFn(a,c,b||this.$view())},$setChange:function(c){var a=this;a._isChanged=c!==b;a._isChanged&&a._triggerChange();return a},_obsCheck:function(){var a=this._isChanged;this._isChanged=b;return a},$get:function(c){var b=this;if(arguments.length==0)return b._get_?b._get_.call(b):b.value;else{a.isFunction(c)&&(b._get_=c);return b}},$set:function(c){var b=this;if(a.isFunction(c)){b._set_=c;b(b.$get())}return b},$view:function(a){if(arguments.length==0)return this._view_;else{this._view_=a;return this}},$owner:function(a){if(arguments.length==0)return this._owner_;else{this._owner_=a;return this}},$linq:function(){return a.linq(this.$get())},clone:function(d){var b=this,c=a.variable(b.value);c._get_=b._get_;c._set_=b._set_;c.$owner(d||b.$owner()).$view(b.$view());return c}}})(bingo);(function(a){var c=true,b=null;"use strict";var e=function(d,e){var b=d.prototype,c=b.__bg_property__||(b.__bg_property__={});a.eachProp(e,function(d,e){if(!(a.isPlainObject(d)||a.isArray(d)))b[e]=d;else c[e]=d})},g=function(d,b){var c=d.prototype;a.eachProp(b,function(d,a){d=b[a];c[a]=k(a,d)})},k=function(c,d){var h=a.isObject(d),f=h&&d.$set,e=h&&d.$get,g=b;if(f||e)g=function(j){var h=i(this),g=a.hasOwnProp(h,c)?h[c]:(h[c]={value:a.clone(d.value)});g.owner=this;if(arguments.length==0){var k=e?e.call(g):g.value;g.owner=b;return k}else{if(f)f.call(g,j);else g.value=j;g.owner=b;return this}};else g=function(e){var b=i(this);if(arguments.length==0)return a.hasOwnProp(b,c)?b[c]:d;else{b[c]=e;return this}};return g},i=function(a){return a._bg_prop_||(a._bg_prop_={})},d="NewObject_define",f=function(b,a){this._define=b;a&&this._Base(a)};a.extend(f.prototype,{_Base:function(e){var b=this._define;b.prototype=new e(d);b.prototype.constructor=b;var c=b.prototype.__bg_property__;if(c)b.prototype.__bg_property__=a.clone(c);b.prototype.base=function(){var b=this,c=e.prototype;b.base=c.base;if(c.___Initialization__==a.noop)b.base.apply(b,arguments);else c.___Initialization__.apply(b,arguments)}},Define:function(a){e(this._define,a);return this},Initialization:function(a){this._define.prototype.___Initialization__=a;return this},Static:function(b){a.extend(this._define,b);return this},Prop:function(a){g(this._define,a);return this}});a.isClassObject=function(a){return a&&a.__bg_isObject__===c};a.isClass=function(a){return a&&a.__bg_isClass__===c};a.Class=function(){for(var l,k,m,j=b,n=0,p=arguments.length;n<p;n++){j=arguments[n];if(j)if(a.isClass(j))k=j;else if(a.isFunction(j))m=j;else if(a.isString(j))l=j}k||(k=a.Class.Base);var i=function(){if(arguments[0]!=d)return i.NewObject.apply(window,arguments)};i.__bg_isClass__=c;i.prototype.___Initialization__=a.noop;i.prototype.base=a.noop;i.extend=function(a){e(i,a)};i.extendProp=function(a){g(i,a)};i.NewObject=function(){var b=new i(d);if(b.__bg_property__){var c=a.clone(b.__bg_property__);a.extend(b,c)}if(b.___Initialization__==a.noop)b.base&&b.base.apply(b,arguments);else b.___Initialization__.apply(b,arguments);b.___Initialization__=a.noop;b.base=a.noop;return b};var o=new f(i,k);m&&m.call(o);o=b;!a.isNullEmpty(l)&&h(l,i);return i};var h=function(h,g){for(var c=h.split("."),b=window,d="",e=c.length-1,f=0;f<e;f++){d=c[f];if(!a.isNullEmpty(d)){if(a.isNull(b[d]))b[d]={};b=b[d]}}b[c[e]]&&j(b[c[e]],g);return b[c[e]]=g},j=function(c,b){a.eachProp(c,function(d,c){if(!a.hasOwnProp(b,c))b[c]=d})};a.Class.makeDefine=function(a,b){h(a,b)};a.Class.Base=a.Class(function(){var d="$dispose";this.Initialization(function(){this.__init_args__=a.sliceArray(arguments,0)});this.Define({__bg_isObject__:c,isDisposed:false,disposeStatus:0,dispose:function(){var b=this;if(b.disposeStatus===0)try{b.disposeStatus=1;b.trigger(d)}finally{a.clearObject(b);b.disposeStatus=2;b.isDisposed=c;b.dispose=a.noop}},onDispose:function(a){return this.on(d,a)},disposeByOther:function(b){if(b&&b.dispose&&!b.isDisposed){var c=a.proxy(this,function(){this.dispose()});b.onDispose(c);this.onDispose(function(){b.isDisposed||b.onDispose().off(c)})}return this},clone:function(){var b=this.constructor.NewObject.apply(window,this.__init_args__);a.eachProp(this,function(c,d){if(d!="__events__"){c=this[d];if(a.isVariable(c))b[d](c());else if(a.isClassObject(c))b[d]=c.clone();else if(a.isObject(c)||a.isArray(c))b[d]=a.clone(c);else b[d]=c}});return b}});this.Define({getEvent:function(d){var c=this;if(d){c.__events__||(c.__events__={});var e=c.__events__;return e[d]||(e[d]=a.Event(c))}return b},hasEvent:function(a){return this.__events__&&this.__events__[a]&&this.__events__[a].size()>0},on:function(b,a){if(b&&a)this.getEvent(b).on(a);return this},one:function(b,a){if(b&&a)this.getEvent(b).one(a);return this},off:function(a,b){this.hasEvent(a)&&this.getEvent(a).off(b);return this},end:function(a,b){a&&this.getEvent(a).end(b);return this},trigger:function(a){if(this.hasEvent(a)){var b=arguments.length>1?arguments[1]:[];return this.getEvent(a).trigger(b)}},triggerHandler:function(a){if(this.hasEvent(a)){var b=arguments.length>1?arguments[1]:[];return this.getEvent(a).triggerHandler(b)}}})});a.Class.Define=function(b){if(a.isObject(b)){var g=b.$base,d=b.$init,c=b.$dispose,e=b.$static,f=b.$prop;g&&delete b.$base;d&&delete b.$init;c&&delete b.$dispose;e&&delete b.$static;f&&delete b.$prop;return a.Class(g||a.Class.Base,function(){var a=this;f&&a.Prop(f);a.Define(b);(d||c)&&a.Initialization(function(){if(c)this.onDispose(c);d&&d.apply(this,arguments)});e&&a.Static(e)})}}})(bingo);(function(a){"use strict";var b=a.linqClass=a.Class(function(){var b=null,c=true;this.Define({concat:function(d,e){var b=this;b._doLastWhere();e=e===c;!a.isArray(d)&&(d=[d]);var f=e?d:b._datas,g=e?b._datas:d;b._datas=f.concat(g);return b},_backup:b,backup:function(){var a=this;a._doLastWhere();a._backup=a._datas;return a},restore:function(b){var a=this;if(b===c){var d=a.toArray();if(d.length==0)a._datas=a._backup}else a._datas=a._backup;return a},each:function(d,b,c){this._doLastWhere();a.each(this._datas,d,b,c);return this},where:function(e,c,b,d){this._doLastWhere();this._lastWhere={fn:e,index:c,count:a.isNumeric(b)?b:-1,rever:d};return this},_lastWhere:b,_doLastWhere:function(f,e,g){var d=this,c=d._lastWhere;if(c){d._lastWhere=b;var i=c.fn,f=a.isNumeric(f)?f:c.index,e=a.isNumeric(e)?e:c.count,g=!a.isUndefined(g)?g:c.rever,h=[];d.each(function(a,b){if(i.call(a,a,b)){h.push(a);if(e!=-1){e--;if(e==0)return false}}},f,g);d._datas=h}return d},select:function(d,e){var a=this;a._doLastWhere();var b=[];a.each(function(a,f){if(e===c)b=b.concat(d.call(a,a,f));else b.push(d.call(a,a,f))});a._datas=b;return a},sort:function(b){var a=this;a._doLastWhere();a._datas=a._datas.sort(function(d,e){var a=b(d,e);return a>0||a===c?1:a<0||a===false?-1:0});return a},sortAsc:function(b){var c=a.isFunction(b);return this.sort(function(a,d){return c?b.call(a,a)-b.call(d,d):b?a[b]-d[b]:a-d})},sortDesc:function(b){var c=a.isFunction(b);return this.sort(function(a,d){return c?b.call(d,d)-b.call(a,a):b?d[b]-a[b]:d-a})},unique:function(b){var c=this;c._doLastWhere();var e=[],d=[];if(!a.isFunction(b))if(arguments.length==0)b=function(a){return a};else{var f=b;b=function(a){return a[f]}}c.each(function(c,g){var f=b.call(c,c,g);if(a.inArray(f,d)<0){e.push(c);d.push(f)}});c._datas=e;return c},count:function(){this._doLastWhere();return this._datas.length},first:function(a){this._doLastWhere(0,1);return this._datas[0]||a},last:function(a){this._doLastWhere(0,1,c);return this._datas[0]||a},contain:function(){this._doLastWhere(0,1);return this.count()>0},sum:function(b){this._doLastWhere();if(!a.isFunction(b)){var c=b;b=function(a){return c?a[c]:a}}var d=0;this.each(function(a,c){d+=b?b.call(a,a,c):a});return d},avg:function(b){this._doLastWhere();if(!a.isFunction(b)){var d=b;b=function(a){return d?a[d]:a}}var c=0;this.each(function(a,d){c+=b?b.call(a,a,d):a});return c==0?0:c/this._datas.length},take:function(c,b){this._doLastWhere();if(isNaN(b)||b<0)b=this.count();return a.sliceArray(this._datas,c,b)},toArray:function(){this._doLastWhere();return this._datas},toPage:function(f,a){var b=this.toArray(),d=1,c=1,a=a,e=b.length,b=b;if(b.length>0){c=parseInt(e/a)+(e%a!=0?1:0);d=f>c?c:f<1?1:f;b=this.take((d-1)*a,a)}return{currentPage:d,totalPage:c,pageSize:a,totals:e,list:b}},_getGroupByValue:function(e,c,d){for(var a=0,f=c.length;a<f;a++)if(c[a][d]==e)return c[a];return b},group:function(g,f,h){var d=this;f||(f="group");h||(h="items");if(!a.isFunction(g)){var m=g;g=function(a){return a[m]}}d._doLastWhere();for(var j=[],l=d._datas,n=l.length,e=b,c=b,k=b,i=0;i<n;i++){e=l[i];k=g.call(e,e,i);c=d._getGroupByValue(k,j,f);if(c==b){c={};c[f]=k;c[h]=[e];j.push(c)}else c[h].push(e)}d._datas=j;return d}});this.Initialization(function(a){this._datas=a||[]})});a.linq=function(a){return b.NewObject(a)}})(bingo);(function(a){var b=false;"use strict";var c=function(b,c){return a.isNull(b)||a.isNull(c)?b===c:a.isArray(b)?f(b,c):b instanceof RegExp?e(b,c):a.isFunction(b)?a.isFunction(c)&&b.valueOf()===c.valueOf():a.isObject(b)?d(b,c):typeof b===typeof c&&b.valueOf()===c.valueOf()},e=function(b,a){return a instanceof RegExp&&b.source===a.source&&b.global===a.global&&b.ignoreCase===a.ignoreCase&&b.multiline===a.multiline},f=function(d,e){if(d===e)return true;if(!a.isArray(e)||d.length!=e.length)return b;for(var f=0,g=d.length;f<g;f++)if(!c(d[f],e[f]))return b;return true},d=function(d,e){if(d===e)return true;if(!a.isObject(e))return b;var f=0;for(var g in d){f++;if(a.hasOwnProp(d,g)&&!c(d[g],e[g]))return b}for(var h in e)f--;return f===0};a.extend({equals:function(a,b){return c(a,b)}})})(bingo);(function(a){"use strict";var b=window.document,c=b.head||b.getElementsByTagName("head")[0]||b.documentElement,d=c.getElementsByTagName("base")[0],e=/loaded|complete|undefined/i,h=/SCRIPT/i,g=function(h,k,j,g){var e=b.createElement("script");e.importurl=h;e.imporid=j||a.makeAutoId();e.async="async";e.src=h;if(g){var i=a.isFunction(g)?g(h):g;i&&(e.charset=i)}f(e,k||a.noop);d?c.insertBefore(e,d):c.appendChild(e);return j},f=function(b,c){var d=function(){if(!b)return;if(e.test(b.readyState)){b.onload=b.onerror=b.onreadystatechange=null;!a.isDebug&&b.parentNode&&b.parentNode.removeChild(b);setTimeout(function(){if(!b)return;try{c&&c(b.importurl,b.imporid,b)}finally{b=undefined;c=null}},1)}};b.onload=b.onerror=b.onreadystatechange=function(){d()}};a.extend({fetch:function(c,a,d,b){return g(c,a,d,b)}})})(bingo);(function(a){var c=null,b="?";"use strict";var j,v=[],f=[],e=[],d=[[],[]],m=function(b,c){return a.inArray(function(c){return a.isStringEquals(c,b)},c)},F=function(a){return m(a,v)>=0||m(a,f)>=0||m(a,e)>=0},C=function(f,c,b){!a.isNumeric(b)&&(b=a.usingPriority.Normal);z(f);d[b]||(d[b]=[]);d[b].push(c);if(e.length>0)E();else setTimeout(function(){i()&&l()},1)},z=function(d){var c=a.stringEmpty;a.each(d,function(d){if(a.isNull(d))return;c=a.route(d);c=A(c);if(!a.isNullEmpty(a.prdtVersion))c=[c.indexOf(b)?"&":b,prdtVersion,"=",a.prdtVersion];!F(c)&&e.push(c)})},E=function(){if(e.length>0){var b=e;e=[];a.each(b,function(b){f.push(b);a.fetch(b,y)})}},i=function(){return e.length<=0&&f.length<=0},g=j,y=function(b){v.push(b);f=a.removeArrayItem(b,f);g!=j&&clearTimeout(g);g=setTimeout(function(){g=j;i()&&l()},5)},l=function(){var b=true;a.each(d,function(f,c){var e=d[c];d[c]=[];a.each(e,function(b){a.isFunction(b)&&b()});if(d[c].length>0){b=false;return false}});if(!b)i()&&l()},n=[],x=function(b,a){return{path:a,mapPath:b,pathReg:p(a)}},D=function(b,c){b=a.route(b);c=a.route(c);var d=w(c);if(a.isNull(d))n.push(x(b,c));else d.mapPath=b},w=function(d,e){var b=a.inArray(function(b){if(e===true&&b.pathReg){b.pathReg.lastIndex=0;return b.pathReg.test(d)}else return a.isStringEquals(b.path,d)},n);return b>=0?n[b]:c},A=function(b){var a=w(b,true);return a&&a.mapPath||b},h=/(\W)/g,r=/(\\([?*]))/g,q=/\\\*\\\*/g,u=/\?[^?=]+\=.*$/,B=/[?*]+/,s=function(b){return!a.isNullEmpty(b)&&B.test(b.replace(u,""))},p=function(b){if(!s(b))return c;var a=b.match(u);if(a){a=a[0];b=b.replace(a,"");a=a.replace(h,"\\$1")}else a="";h.lastIndex=0;r.lastIndex=0;q.lastIndex=0;var d=b.replace(h,"\\$1").replace(q,".*").replace(r,"[^./]$2");d=["^",d,a,"$"].join("");return new RegExp(d)};a.extend({using:function(){if(arguments.length<=0)return;for(var f=[],d=c,g=0,b=c,e=0,h=arguments.length;e<h;e++){b=arguments[e];if(b)if(a.isFunction(b))d=b;else if(a.isNumeric(b))g=b;else f.push(b)}C(f,function(){d&&d()},g)},makeRegexMapPath:p,isRegexMapPath:s,usingMap:function(c,b){if(a.isNullEmpty(c)||!b||b.length<=0)return;a.each(b,function(b){if(a.isNullEmpty(b))return;D(c,b)})},usingPriority:{First:0,NormalBefore:45,Normal:50,NormalAfter:55,Last:100},path:function(c){if(this.isObject(c))this.extend(o,c);else if(arguments.length>1)o[arguments[0]]=arguments[1];else{var d=c.split(b);c=d[0];c=k(c);if(d.length>1)c+=b+a.sliceArray(d,1).join(b);return c}}});var o={},t=/%([^%]*)%/i,k=function(d){if(a.isNullEmpty(d)||d.indexOf("%")<0)return d;var h="";if(d.indexOf(b)){var i=d.split(b);d=i[0];h=i[1]}t.lastIndex=0;var e=d.match(t),f=a.stringEmpty,g=o;if(e)if(g[e[1]])f=k(d.replace(e[0],g[e[1]]));else f=k(d.replace(e[0],a.stringEmpty));e=c;g=c;return!h?f:[f,h].join(b)}})(bingo);(function(b){var g="list",f="user",d="system",c=null,a="";"use strict";b.route=function(a,c){if(arguments.length==1)return b.routeContext(a).toUrl;else a&&c&&h.add(a,c)};b.routeContext=function(a){return h.getRouteByUrl(a)};b.routeLink=function(c,d){var b=h.getRuote(c);return b?i(b.context.url,d,1):a};var e=/\{([^}]+)\}/gi,l=function(m,d){if(!m||!d.url)return c;var g=d.url,i=b.isRegexMapPath(g);if(i){var j=g.indexOf("$")>=0?g.split("$")[0]:g;e.lastIndex=0;j=j.replace(e,"*");d._reg||(d._reg=b.makeRegexMapPath(j));if(!d._reg.test(m))return c}var f=m.split("$"),o=f[0].split("/"),n=d._matchUrlList||(d._matchUrlList=g.split("/"));if(o.length!=n.length)return i?{}:c;var l={},h=true,k;b.each(n,function(c,d){k=o[d];if(!(i&&b.isRegexMapPath(c))){e.lastIndex=0;if(e.test(c))l[c.replace(e,"$1")]=decodeURIComponent(k||a);else{h=c==k;if(!h)return false}}});if(h&&f.length>1){f=b.sliceArray(f,1);b.each(f,function(d){var b=d.split(":"),c=b[0],e=decodeURIComponent(b[1]||a);c&&(l[c]=e)})}return h?l:c},j=function(){var e={module:c,controller:c,action:c},d=this.params;if(d){var a=b.module(d.module),f=a?a.controller(d.controller):c,g=f?f.action(d.action):a?a.action(d.action):c;e.module=a;e.controller=f;e.action=g}return e},k=function(c,d,b,a){return{name:c,params:a,url:d,toUrl:b,actionContext:j}},i=function(c,i,h){e.lastIndex=0;if(!c||!i)return b.path(c);var d=a,g=a,f=a;b.eachProp(i,function(i,e){g=["{",e,"}"].join(a);f=encodeURIComponent(i||a);if(c.indexOf(g)>=0)c=b.replaceAll(c,g,f);else if(e!="module"&&e!="controller"&&e!="action"&&e!="service")if(h==1)d=[d,"$",e,":",f].join(a);else d=[d,"&",e,"=",f].join(a)});if(d)if(h==1)c=[c,d].join(a);else if(c.indexOf("?")>=0)c=[c,d].join(a);else c=[c,d.substr(1)].join("?");return b.path(c)},h={datas:[],defaultRoute:{url:"**",toUrl:function(a){return a}},add:function(e,a){var c=this,d=c.getRuote(e);if(b.isUndefined(a.priority))a.priority=100;if(d)d.context=a;else c.datas.push({name:e,context:a});c.datas=b.linq(c.datas).sort(function(a,b){return b.context.priority-a.context.priority}).toArray()},getRuote:function(d){var a=c;b.each(this.datas,function(){if(this.name==d){a=this;return false}});return a},getRouteByUrl:function(f){if(!f)return a;var g=f.split("?");if(g.length>1)f=g[0];var e=c,j=a,d=c;b.each(this.datas,function(){e=this.context;d=l(f,e);if(d){j=this.name;return false}});if(!d){e=h.defaultRoute;j="defaultRoute"}if(d||e.defaultValue)d=b.extend({},e.defaultValue,d);if(b.isFunction(e.toUrl))e.toUrl;var m=b.isFunction(e.toUrl)?e.toUrl.call(e,f,d):e.toUrl;if(g.length>1){d||(d={});g[1].replace(/([^=&]+)\=([^=&]*)/g,function(c,b,a){d[b]=a})}var m=i(m,d);return k(j,f,m,d)}};b.route("view",{priority:100,url:"view/{module}/{controller}/{action}",toUrl:"modules/{module}/views/{controller}/{action}.html",defaultValue:{module:d,controller:f,action:g}});b.route("action",{url:"action/{module}/{controller}/{action}",toUrl:"modules/{module}/controllers/{controller}.js",defaultValue:{module:d,controller:f,action:g}});b.route("viewS",{url:"view/{module}/{action}",toUrl:"modules/{module}/{action}.html",defaultValue:{module:d,action:g}});b.route("actionS",{url:"action/{module}/{action}",toUrl:"modules/{module}/scripts/{action}.js",defaultValue:{module:d,action:g}});b.route("service",{url:"service/{module}/{service}",toUrl:"modules/{module}/services/{service}.js",defaultValue:{module:d,service:f}});b.route("serviceS",{url:"service/{service}",toUrl:"modules/services/{service}.js",defaultValue:{module:d,service:f}})})(bingo);(function(a){"use strict";a.cacheToObject=function(a){return a&&a.__bg_cache__?a.__bg_cache__:(a.__bg_cache__=c.NewObject())};var f=function(c,d){var b=a.linq(c._datas).where(function(){return this.key==d}).first();b&&(b.t=(new Date).valueOf());return b},b=function(a,f,e,c){c>0&&d(a,c);var b={t:(new Date).valueOf(),key:f,value:e};a._datas.push(b);return b},d=function(b,e){var d=b._datas.length,c=5;if(d>=e+c)b._datas=a.linq(b._datas).sortAsc("t").take(c)},e=function(b,c){b._datas=a.linq(b._datas).where(function(){return this.key!==c}).toArray()},g=function(b,c){return a.linq(b._datas).where(function(){return this.key==c}).contain()},c=a.Class(function(){this.Prop({max:0,context:null});this.Define({key:function(){if(arguments.length==0)return this._key;else{this._key=a.sliceArray(arguments,0).join("_");return this}},_getItem:function(){var c=this,d=c.key();if(d){var h=c._datas,g=f(c,d);if(g)return g;else{var e=c.context();if(a.isFunction(e))return b(c,d,e(),c.max())}}},"get":function(){var a=this._getItem();return a&&a.value},"set":function(c){var a=this,d=a._getItem();if(d)d.value=c;else{var e=a.key();e&&b(a,e,c,a.max())}return a},has:function(){var a=this.key();return a?g(this,a):false},clear:function(){var a=this,b=a.key();a.has()&&e(a,b);return a},clearAll:function(){this._datas=[];return this}});this.Initialization(function(){this._datas=[]})})})(bingo);(function(c,b){var a=true;"use strict";var d="bingoLinkToDom";c.extend({linkToDom:function(f,a){if(f&&c.isFunction(a)){var e=b(f);if(e.size()>0)e.one(d,a);else a.call(e)}return a},unLinkToDom:function(a,c){if(a){var e=b(a);if(c)e.off(d,c);else e.off(d)}},isUnload:false});c.linkToDom.LinkToDomClass=c.Class(function(){this.Define({isDisposeFormDom:false,linkToDom:function(e){var d=this;d.__linkToDomInit();if(e){d.unlinkToDom();var f=d.__bg_lnk_dom=b(e);d.__bg_lnk_fn=c.linkToDom(f,c.proxy(d,function(){this.isDisposeFormDom=a;this.dispose();this.isDisposeFormDom=a}))}return d},unlinkToDom:function(){var b=this;if(b.__bg_lnk_dom&&b.isDisposeFormDom!==a){c.unLinkToDom(b.__bg_lnk_dom,b.__bg_lnk_fn);b.__bg_lnk_dom=null}return b},__linkToDomInit:function(){if(this.__isLinkToDomInit)return;this.__isLinkToDomInit=a;this.onDispose(function(){this.unlinkToDom()})}})});var e=b.cleanData;b.cleanData=function(f){for(var c=0,a;(a=f[c])!=null;c++)try{b(a).triggerHandler(d)}catch(g){}e.apply(b,arguments)};b(window).unload(function(){c.isUnload=a;b(document.body).remove();b(document.documentElement).remove()})})(bingo,window.jQuery);(function(b){var a=null;"use strict";var h=function(a){var c={priority:50,tmpl:"",tmplUrl:"",replace:false,include:false,view:false,compileChild:true};a=a();if(b.isFunction(a)||b.isArray(a))c.link=a;else c=b.extend(c,a);return c},k=function(a,c){if(b.isNullEmpty(a))return;a=a.toLowerCase();return arguments.length==1?f.call(this,"_commands",a):(this._commands[a]=h(c))},o=function(c,d){return b.isNullEmpty(c)?a:arguments.length==1?f.call(this,"_filters",c):(this._filters[c]=d)},l=function(c,d){var e=arguments.length;if(e==0)return this._factorys;else if(e==1){var d=b.isString(c)?f.call(this,"_factorys",c):c;return!d?a:b.factory.factoryClass.NewObject().setFactory(d)}else return this._factorys[c]=d},m=function(a,c){if(b.isNullEmpty(a))return;if(arguments.length==1)return f.call(this,"_services",a);else{c.$owner={module:this};return this._services[a]=c}},i=function(g,i){var f=this;if(b.isNullEmpty(g))return;var d=f._controllers[g];if(!d)d=f._controllers[g]={module:f,name:g,_actions:{},action:n};if(b.isFunction(i)){var h=c;!h&&(c=f);e=d;i.call(d);e=a;!h&&(c=a)}return d},n=function(b,c){var a=this;if(arguments.length==1)return a._actions[b];else{c.$owner={conroller:a,module:a.module};return a._actions[b]=c}},j=function(b,c){if(arguments.length==1)return this._actions[b];else{c.$owner={conroller:a,module:this};return this._actions[b]=c}},p=function(){return c||d},f=function(c,b){return this[c][b]||(this!=d?d[c][b]:a)},g={},c=a,e=a;b.extend({defaultModule:function(){return d},getModuleByView:function(a){return a?a.$getModule():b.defaultModule()},module:function(e,f){if(this.isNullEmpty(e))return a;var d=g[e];if(!d)d=g[e]={name:e,_services:{},_controllers:{},_commands:{},_filters:{},_factorys:{},_actions:{},action:j,service:m,controller:i,command:k,filter:o,factory:l};if(b.isFunction(f)){c=d;f.call(d);c=a}return d},service:function(){var a=c||d;return a.service.apply(a,arguments)},controller:function(){var a=c||d;return a.controller.apply(a,arguments)},action:function(a){if(b.isFunction(a)||b.isArray(a))return a;else if(e)return e.action.apply(e,arguments);else{var f=c||d;return f.action.apply(f,arguments)}},command:function(){var a=c||d;return a.command.apply(a,arguments)},filter:function(){var a=c||d;return a.filter.apply(a,arguments)},factory:function(){var a=c||d;return a.factory.apply(a,arguments)}});var d=b.module("_$defaultModule$_")})(bingo);(function(a){"use strict";var e=a.Class(function(){var c=null;this.Prop({name:"",view:c,viewnode:c,viewnodeAttr:c,widthData:c,node:c,fn:c,params:c});this.Define({reset:function(){this.view(c).viewnode(c).viewnodeAttr(c).widthData(c).node(c).params(c);return this},_newInjectObj:function(){var c=this,d=c.viewnodeAttr(),b=c.viewnode()||d&&d.viewnode(),e=c.view()||b&&b.view()||a.rootView(),g=c.node()||b&&b.node()||e.$node(),f=c.widthData()||b&&b.getWithData();return{node:g,$view:e,$viewnode:b,$attr:d,$withData:f,$command:d&&d.command,$injectParam:c.params()}},inject:function(d){var a=this,e=a.fn(),b=e.$injects,c=b&&b.length>0?a._newInjectObj():{};return a._inject(d||a.viewnodeAttr()||a.viewnode()||a.view(),a.name(),c,true)},_inject:function(h,i,b,k){var d=this.fn();if(!d)throw new Error("not find factory: "+i);var e=d.$injects,g=[],l=this;if(e&&e.length>0){var f=c;a.each(e,function(a){if(a in b)f=b[a];else f=b[a]=l.setFactory(a)._inject(h,a,b,false);g.push(f)})}var j=d.apply(d.$owner||h,g)||{};!k&&(b[i]=j);return j},setFactory:function(d){var e=c;if(a.isFunction(d)||a.isArray(d)){e=b(d);d=""}else{var g=a.getModuleByView(this.view()),f=a.defaultModule(),i=g.factory(),h=f==g?c:f.factory();e=i[d]||h&&h[d]||g.service(d)||(f==g?c:f.service(d));e&&(e=b(e))}return this.name(d).fn(e)}})});a.factory.factoryClass=e;var c=function(){};c.$injects=[];var d=/^\s*function[^(]*?\(([^)]+?)\)/i,b=function(b){if(b&&(b.$injects||b.$fn))return b.$fn||b;var e=c;if(a.isArray(b)){var f=a.clone(b,false);e=b.$fn=f.pop();e.$injects=f;e.$owner=b.$owner}else if(a.isFunction(b)){e=b;var g=e.toString(),f=[];g.replace(d,function(c,b){b&&a.each(b.split(","),function(b){b=a.trim(b);b&&f.push(b)})});e.$injects=f}return e}})(bingo);(function(a){"use strict";var b="isModel1212";a.isModel=function(a){return a&&a._isModel_==b};a.modelOf=function(b){b=a.variableOf(b);return a.isModel(b)?b.toObject():b};var d=function(c){var b=c||{},d;a.eachProp(this,function(d,c){if(a.isVariable(b[c]))b[c](d);else if(c!="_isModel_"&&c!="toObject"&&c!="fromObject")b[c]=a.variableOf(d)});return b},c=function(b,c){b&&a.eachProp(b,a.proxy(this,function(e,d){var b=this;if(d in b)if(a.isVariable(b[d]))b[d](e);else b[d]=a.variableOf(e);else if(c)b[d]=a.variable(e)}));return this};a.model=function(f,g){f=a.modelOf(f);var e={},h;a.eachProp(f,function(b,c){e[c]=a.variable(b,e,g)});e._isModel_=b;e.toObject=d;e.fromObject=c;return e}})(bingo);(function(a){"use strict";var b=a.Class(function(){var c=true,b=false,e=function(k,h,i,l,j){var o=a.isFunction(h),m=function(){var b;if(o)b=h.call(e);else{var c=k._view;b=a.datavalue(c,h);if(a.isUndefined(b))b=a.datavalue(window,h)}return a.isModel(b)?a.modelOf(b):b},g=m(),e={_callback:i,dispose:d};if(a.isVariable(g)){e.check=f;e.isChange=b;var n=k._view;e.varo=g;g.$subs(function(a){if(!n.$isReady)e.isChange=c;else{i.call(e,a);k.publishAsync()}},j||n)}else{if(l)g=a.clone(g);e.check=function(){if(j&&j.isDisposed){e.dispose&&e.dispose();return}var d=m(),f=l?!a.equals(d,g):d!=g;if(f){g=l?a.clone(d):d;i.call(this,d);return c}return b}}return e},f=function(){if(this.isChange){this.varo.$setChange();this.isChange=b}return b},d=function(){a.clearObject(this)};this.Define({unSubscribe:function(e){var d=this;if(arguments.length>0)d._subscribes=a.linq(d._subscribes).where(function(){if(this._callback==e){this.dispose();return b}else return c}).toArray();else{a.each(d._subscribes,function(){this.dispose()});d._subscribes=[]}return d},subscribe:function(d,b,f,c){var a=e(this,d,b,f,c);this._subscribes.push(a);return a},publish:function(){var a=this;a._publishTime=0;a._publish&&a._publish();return a},publishAsync:function(){var a=this;if(!a._pbAsync_){var b=a;a._pbAsync_=setTimeout(function(){b._pbAsync_=null;b.publish()},5)}return a},_publishTime:0,_publish:function(){var d=this,e=b,g=b;a.each(d._subscribes,function(){if(!this.check){g=c;return}if(this.check())e=c});if(g)d._subscribes=a.linq(d._subscribes).where(function(){return this.check}).toArray();if(e){if(d._publishTime<10){d._publishTime++;var f=d;setTimeout(function(){f.isDisposed||f._publish()},5)}}else d._publishTime=0}});this.Initialization(function(c){var b=this;b._view=c,b._subscribes=[];b.disposeByOther(c);b.onDispose(function(){a.each(this._subscribes,function(){this.dispose()})})})});a.observer=function(a){return a&&(a.__observer__||(a.__observer__=b.NewObject(a)))};a.observer.observerClass=b})(bingo);(function(a){var b=null;"use strict";a.ajax=function(b,a){return e.NewObject(b).view(a)};a.ajaxSync=function(b){return c.NewObject().view(b).dependent(a.noop)};a.ajaxSyncAll=function(b,a){return f(b,a)};var d=a.ajax.ajaxBaseClass=a.Class(function(){this.Define({view:function(a){if(arguments.length==0)return this._view;this._view=a;return this},deferred:function(){this._dtd||(this._dtd=$.Deferred());return this._dtd},success:function(a){this.deferred().done(a);return this},error:function(a){this.deferred().fail(a);return this},alway:function(a){this.deferred().always(a);return this}})}),e=a.ajax.ajaxClass=a.Class(d,function(){var f=false,d=true,h=this;h.Static({holdServer:function(d,b,a,c){return[b,a,c]}});var g=function(a){if(!a.isDisposed)return;setTimeout(function(){a.dispose()},1)},i=function(c,r){var h=c.view();if(c.isDisposed||h&&h.isDisposed){g(c);return}var p=a.clone(c.param()||{}),o=c.holdServer()||e.holdServer,k=c.deferred(),j=b,l=c.url(),m=c.cacheTo();if(m){var q=c.cacheQurey()?l:l.split("?")[0];j=a.cacheToObject(m).max(c.cacheMax()).key(q.toLowerCase());if(j.has()){var i=j.get();if(a.isObject(i))i=a.clone(i);c.isCacheData=d;if(c.async())setTimeout(function(){if(!c.isDisposed){h&&h.isDisposed||k.resolveWith(c,[i]);g(c)}});else k.resolveWith(c,[i]);g(c);return}}var n=function(b,e,i){if(!c.isDisposed){if(!(h&&h.isDisposed))try{var l=o(c,b,e,i);b=l[0],e=l[1],i=l[2];if(e===d){j&&j.set(b);k.resolveWith(c,[b])}else k.rejectWith(c,[b,f,i])}catch(m){a.trace(m)}g(c)}};$.ajax({type:r,url:l,data:p,async:c.async(),cache:f,dataType:c.dataType(),success:function(a,c,b){n(a,d,b)},error:function(b,c,a){n(a,f,b)}})};h.Prop({url:{$set:function(b){this.value=a.route(b)}},async:d,dataType:"json",param:{},cacheTo:b,cacheMax:-1,cacheQurey:d,holdServer:b});h.Define({isCacheData:f,addToAjaxSync:function(a){a||(a=c.lastSync(this.view()));a&&a.dependent(this);return this},post:function(){var b=this;b.async()&&b.addToAjaxSync();i(b,"post");b.post=a.noop;return b},"get":function(){var b=this;b.async()&&b.addToAjaxSync();i(b,"get");b.get=a.noop;return b}});h.Initialization(function(a){this.url(a)})}),c=a.ajax.ajaxaSyncClass=a.Class(d,function(){this.Static({_syncList:[],getSyncList:function(a){return a&&a.__syncList_&&(a.__syncList_=[])||this._syncList},lastSync:function(d){var a=this.getSyncList(d),c=a.length;return c>0?a[c-1]:b}});this.Define({resolve:function(){var a=this;a._count=0;a._dtd&&a.deferred().resolve();a.dispose()},reject:function(){var a=this;a._count=0;a._dtd&&a.deferred().reject();a.dispose()},dependent:function(c){var b=this;b.addCount();var d=b;if(a.isFunction(c))try{c.call(b);setTimeout(function(){!d.isDisposed&&d.decCount()},1)}catch(e){a.trace(e);b.reject()}else{b.view()||c.view()||c.view(b.view());c.view()||b.view()||b.view(c.view());c.error(function(){setTimeout(function(){!d.isDisposed&&d.reject()},1)}).success(function(){setTimeout(function(){!d.isDisposed&&d.decCount()},1)})}return b},_count:0,addCount:function(a){this._count+=arguments.length==0?1:a;return this},decCount:function(){this._count--;this._checkResolve();return this},_checkResolve:function(){this._count<=0&&this.resolve()}})}),f=function(g,d){if(!g)return b;var f=c.getSyncList(d),e=c.lastSync(d),a=c.NewObject();e&&e.dependent(a);f.push(a);a.view(d).dependent(g);f.pop();return a}})(bingo);(function(b,f){var h="bingo_cmpwith_",d=false,e=true,a=null,c="";"use strict";b.extend({compile:function(a){return m.NewObject().view(a)},tmpl:function(b,a){return n.NewObject(b).view(a)},_startMvc:function(){b.using(function(){var a=b.rootView(),c=a.$node();b.compile(a).fromNode(c).compile()})}});var o=b.compile.injectTmplWithDataIndex=function(d,f,e){var a="<!--bingo_cmpwith_";return b.isNullEmpty(d)?c:[a,f,"-->",d,a,e,"-->"].join(c)},j=a,i=b.compile.removeNode=function(a){j.append(a);j.html(c)},g={compiledAttrName:["_bg_cpl",b.makeAutoId()].join("_"),isCompileNode:function(a){return a[this.compiledAttrName]=="1"},setCompileNode:function(a){a[this.compiledAttrName]="1"},_makeCommand:function(f,c,g){var a=f;!b.isNullEmpty(a.tmplUrl)&&b.tmpl(a.tmplUrl,c).cacheQurey(e).async(d).success(function(b){a.tmpl=b}).get();a.compilePre&&b.factory(a.compilePre).view(c).node(g).inject();return a},newTraverseParams:function(){return{node:a,parentViewnode:a,view:a,data:a,withData:a,action:a,withDataList:a}},traverseNodes:function(d){var e=this,c=d.node;if(c.nodeType===1){if(!e.isCompileNode(c)){e.setCompileNode(c);if(!e.analyzeNode(c,d))return}var f=c.firstChild;if(f){var g=[];do g.push(f);while(f=f.nextSibling);e.traverseChildrenNodes(g,d)}}else if(c.nodeType===3)if(!d.parentViewnode._isCompileText(c)){var h=b.view;d.parentViewnode._setCompileText(c);var i=c.nodeValue;h.textTagClass.hasTag(i)&&h.textTagClass.NewObject(d.view,d.parentViewnode,c,c.nodeName,i,d.withData)}c=d=a},traverseChildrenNodes:function(k,a){for(var e=[],h=a.withDataList,j=a.withData,c,l=b.clone(a,d),f=-1,g=0,m=k.length;g<m;g++){c=k[g];f=h?this.getTmplWithdataIndex(c):-1;if(f==-1){a.node=c,a.withData=j;this.traverseNodes(a);a=b.clone(l,d)}else{j=a.withData=h[f];e.push(c)}}e.length>0&&i(e)},getTmplWithdataIndex:function(e){if(e.nodeType==8){var a=e.nodeValue;if(!b.isNullEmpty(a)&&a.indexOf(h)>=0){var d=parseInt(a.replace(h,c),10);return d<0?-2:d}}return-1},isTmplWithdataNode:function(c){if(c.nodeType==8){var a=c.nodeValue;return!b.isNullEmpty(a)&&a.indexOf(h)>=0}return d},checkTmplWithdataNode:function(c){var b=[],a=[];c.each(function(){if(g.isTmplWithdataNode(this))a.push(this);else b.push(this)});a.length>0&&i(a);return f(b)},analyzeNode:function(j,c){var w="[bg-include]",l="bg-include",t=j.tagName,h=a;if(b.isNullEmpty(t))return d;t=t.toLowerCase();var D=c.view.$getModule();h=D.command(t);var r=[],z=[],k=e,q=a,v=d,s=d,n=d;if(t=="script")k=d;if(h){h=g._makeCommand(h,c.view,j);v=h.replace;s=h.include;q=h.tmpl;n=h.view;!k||(k=h.compileChild);r.push({aName:t,aVal:a,type:"node",command:h})}else{var x=j.attributes;if(x&&x.length>0)for(var u=a,m=a,y=a,C=0,K=x.length;C<K;C++){m=x[C];u=m&&m.nodeValue;y=m&&m.nodeName;h=D.command(y);if(h){h=g._makeCommand(h,c.view,j);if(h.compilePre)u=m&&m.nodeValue;v=h.replace;s=h.include;q=h.tmpl;n||(n=h.view);!k||(k=h.compileChild);r.push({aName:y,aVal:u,type:"attr",command:h});if(v||s)break}else if(u)b.view.textTagClass.hasTag(u)&&z.push({node:m,aName:y,aVal:u})}}var o=a,p=b.view;if(r.length>0)if(v||s){var B=f(j);if(!b.isNullEmpty(q)){var A=f(f.parseHTML(q));s&&q.indexOf(l)>=0&&A.find(w).add(A.filter(w)).each(function(){var a=f(this);if(b.isNullEmpty(a.attr(l))){var c=B.clone(d);g.setCompileNode(c[0]);a.removeAttr(l);a.append(c)}});var I=c.view,F=c.parentViewnode,J=b.clone(c,d);A.each(function(){var e=this;if(e.nodeType===1){if(n){c.view=p.viewClass.NewObject(e,I);if(c.action){c.view.$addAction(c.action);c.action=a}c.withData=a}o=p.viewnodeClass.NewObject(c.view,e,n?a:F,c.withData);c.parentViewnode=o;var f=r[r.length-1];p.viewnodeAttrClass.NewObject(c.view,o,f.type,f.aName,f.aVal,f.command)}if(k){c.node=e;g.traverseNodes(c)}c=b.clone(J,d)}).insertBefore(B)}i(B);k=d}else{!b.isNullEmpty(q)&&f(j).html(q);if(n){c.view=p.viewClass.NewObject(j,c.view);if(c.action){c.view.$addAction(c.action);c.action=a}c.withData=a}var E=c.parentViewnode;o=p.viewnodeClass.NewObject(c.view,j,n?a:E,c.withData);c.parentViewnode=o;var G=a;b.each(r,function(){var a=this;G=p.viewnodeAttrClass.NewObject(c.view,o,a.type,a.aName,a.aVal,a.command)})}if(!(v||s)&&z.length>0){var H=a;b.each(z,function(){H=p.textTagClass.NewObject(c.view,o||c.parentViewnode,this.node,this.aName,this.aVal,a,j)})}return k}},n=b.compile.tmplClass=b.Class(b.ajax.ajaxClass,function(){var a=b.ajax.ajaxClass.prototype,c={};this.Define({_initAjax:function(){var a=this;if(a._init_tmpl_===e)return;a._init_tmpl_=e;var b=a.view();b&&!b.isDisposed&&b._addReadyDep();a.onDispose(function(){b&&!b.isDisposed&&b._decReadyDep()}).cacheTo(a.cacheTo()||c).cacheMax(a.cacheMax()<=0?350:a.cacheMax()).dataType("text")},"get":function(){this._initAjax();a["get"].call(this)},post:function(){this._initAjax();a.post.call(this)}});this.Initialization(function(a){this.base(a)})}),m=b.compile.templateClass=b.Class(function(){var i="compiled",h="compilePre",j=function(e,b,f,c,d){g.traverseChildrenNodes(e,{node:a,parentViewnode:b,view:f,withData:a,action:d,withDataList:c})},k={};this.Static({cacheMax:100});this.Prop({action:a,async:e,fromUrl:c,withData:a,withDataList:a,stop:d,view:a});this.Define({fromJquery:function(a){this._jo=f(a);return this},appendTo:function(a){this._parentNode=f(a)[0];return this},fromNode:function(a){return this.fromJquery(a)},fromHtml:function(a){return this.fromJquery(f.parseHTML(a,e))},_isEnd:function(){var a=this;return a.isDisposed||a.stop()||a.view()&&a.view().isDisposed},onCompilePre:function(a){return this.on(h,a)},onCompiled:function(a){return this.on(i,a)},_compile:function(){var a=this,c=a._jo,f=a._parentNode||c&&c.parent()[0];if(!f)return;var l=!a._parentNode;try{a.trigger(h,[c]);var d=a.view(),e=b.view.viewnodeClass.getViewnode(f);if(d){if(e.view()!=d)e=d.$viewnode()}else d=b.view(f)||e.view();var n=a.withData(),k=a.withDataList(),m=a.action();j(c,e,d,k,m);k&&k.length>0&&(c=g.checkTmplWithdataNode(c));!l&&c.appendTo(f);d._handel()}catch(o){b.trace(o)}a.trigger(i,[c]);a.dispose()},compile:function(){var a=this;if(a._isEnd())return a;if(a._jo)a._compile();else if(a._parentNode&&a.fromUrl()){var c=a,d=a.view();b.tmpl(a.fromUrl(),d).success(function(a){if(c._isEnd())return;c.fromHtml(a).compile()}).async(a.async()).onDispose(function(){c.dispose()}).get()}return a}})}),k=b.compile.bindClass=b.Class(function(){var f={_cacheName:"__contextFun__",resetContextFun:function(a){a[f._cacheName]={}},evalScriptContextFun:function(j,a,m,l,i){a=a!==d;var e=["content",a].join("_"),g=j[f._cacheName];if(g[e])return g[e];var k=j.$prop();try{var h=[a?"return ":c,k,";"].join(c);return g[e]=new Function("$view","$node","$withData","bingo",["with ($view) {",i?"with ($withData) {":c,"return bingo.proxy($node, function (event) {",a?["try {",h,"} catch (e) {","if (bingo.isDebug) bingo.trace(e);","}"].join(c):h,"});",i?"}":c,"}"].join(c))(m,l,i,b)}catch(n){console.warn(["evalScriptContextFun: ",h].join(c));b.trace(n);return j[e]=function(){return k}}}};this.Prop({view:a,node:a,viewnode:a,_filter:{$set:function(c){var a=this.owner;this.value=b.filter.createFilter(c,a.view(),a.node(),a.getWithData())}},$prop:{$set:function(c){var a=this;if(a.filterVal!=c){a.filterVal=c;var b=a.owner;b._filter(c);var d=b._filter();a.value=d.content;f.resetContextFun(b)}}}});this.Define({$eval:function(c){var a=this,b=a.getWithData(),e=f.evalScriptContextFun(a,d,a.view(),a.node,b);return e(c)},$results:function(c){var a=this,b=a.getWithData(),g=f.evalScriptContextFun(a,e,a.view(),a.node,b),d=g(c);return a.$filter(d)},$value:function(f){var c=this,g=c.$prop(),e=g,d=c.getWithData(),a;if(d)a=b.datavalue(d,e);if(b.isUndefined(a)){d=c.view();a=b.datavalue(d,e)}if(b.isUndefined(a)){d=window;a=b.datavalue(d,e)}if(arguments.length>0){if(b.isVariable(a))a(f);else if(b.isUndefined(a))b.datavalue(c.getWithData()||c.view(),e,f);else b.datavalue(d,e,f);return c}else return c.$filter(a)},$filter:function(a){return this._filter().filter(a)},getWithData:function(){return this._withData}});this.Initialization(function(e,d,b,c){var a=this;a._withData=c;a.view(e).node(d);a.content=b;a.$prop(b)})});b.compile.bind=function(d,c,b,a){return k.NewObject(d,c,b,a)};var l=b.compile.nodeBindClass=b.Class(b.linkToDom.LinkToDomClass,function(){this.Define({$getAttr:function(f){var d=this;if(!b.hasOwnProp(d._attrs,f)){var e=d.node().attributes[f];e=e?e.nodeValue:c;d._attrs[f]=!b.isNullEmpty(e)?k.NewObject(d.view(),d.node(),e,d.withData()):a}return d._attrs[f]},$prop:function(d,e){var a=this;if(arguments.length==1){var b=a.node().attributes[d];return b?a.$getAttr(d).$prop():c}else{var b=a.$getAttr(d);b&&b.$prop(e);return a}},$eval:function(c,b){var a=this.$getAttr(c);return a&&a.$eval(b)},$results:function(c,b){var a=this.$getAttr(c);return a&&a.$results(b)},$value:function(c,b){var a=this.$getAttr(c);if(!a)return;if(arguments.length==1)return a.$value();else{a.$value(b);return this}}});this.Prop({view:a,node:a,withData:a});this.Initialization(function(e,c,d){var a=this;a.base();a.withData(d).view(e).node(c);a.linkToDom(c);a._attrs={};a.onDispose(function(){var a=this._attrs;b.eachProp(a,function(a){a.dispose&&a.dispose()})})})});b.compile.bindNode=function(c,b,a){return l.NewObject(c,b,a)};f(function(){j=f("<div></div>");b._startMvc()})})(bingo,window.jQuery);(function(a){var d=false,c=true,b=null;"use strict";a.view=function(d){var c=$(d);if(c.size()==0)return b;else{var a=e.getViewnode(c[0]);return a?a.view():b}};var g=b;a.rootView=function(){return g};var j=a.view.viewClass=a.Class(a.linkToDom.LinkToDomClass,function(){var g="_readyAll_",f="_initdata_";this.Define({_setParent:function(a){if(a){this.$parentView(a);a._addChild(this)}},_addChild:function(a){this.$children.push(a)},_removeChild:function(c){var b=this.$children;b=a.removeArrayItem(c,b);this.$children=b},_compile:function(){var a=this.$viewnode();!a.isDisposed&&a._compile()},_action:function(){var b=this,d=b;if(b._actions.length>0){var f=b._actions;b._actions=[];a.each(f,function(){a.factory(this).view(d).inject()})}var e=b.$viewnode();!e.isDisposed&&e._action();setTimeout(function(){if(!d.isDisposed&&this._isReadyDec_!==c)this._isReadyDec_=c;d._decReadyDep()},10)},_link:function(){var a=this.$viewnode();!a.isDisposed&&a._link()},_handel:function(){var a=this;a._compile();a._action();a._link();a._handleChild()},_handleChild:function(){a.each(this.$children,function(){!this.isDisposed&&this._handel()})},$isReady:d,_sendReady:function(){this._sendReady=a.noop;var b=this;a.ajaxSyncAll(function(){b.end(f)},this).alway(function(){b.end("_ready_");b.$isReady=c;b._decReadyParentDep();b.$update()})},onInitData:function(a){return this.on(f,a)},onReady:function(a){return this.on("_ready_",a)},onReadyAll:function(a){return this.on(g,a)},_addReadyDep:function(){var b=this,c=b.__readySync;if(!c)c=b.__readySync=a.ajaxSync(b).success(a.proxy(b,function(){if(this.isDisposed)return;this._sendReady()}));!c.isDisposed&&c.addCount();return b},_decReadyDep:function(){var a=this.__readySync;a&&!a.isDisposed&&a.decCount();return this},_addReadyParentDep:function(){var b=this,c=b.__readyParentSync;if(!c)c=b.__readyParentSync=a.ajaxSync(b).success(a.proxy(b,function(){if(this.isDisposed)return;this.end(g);var a=this.$parentView();a&&a.disposeStatus==0&&a._decReadyParentDep()}));!c.isDisposed&&c.addCount();return b},_decReadyParentDep:function(){var a=this.__readyParentSync;a&&!a.isDisposed&&a.decCount();return this},$setModule:function(a){a&&(this._module=a);return this},$getModule:function(){return this._module||a.defaultModule()},$addAction:function(a){a&&this._actions.push(a);return this},$getViewnode:function(a){return e.getViewnode(a||this.$node())},$getNode:function(a){var b=this.__$node||(this.__$node=$(this.$node()));return a?b.find(a):b},$update:function(){return this.$publish()},$updateAsync:function(){this.$isReady===c&&this.$observer().publishAsync();return this},$apply:function(b,c){var a=this;if(b){a.$update();b.apply(c||a);a.$updateAsync()}return a},$proxy:function(b,c){var a=this;return function(){a.$update();b.apply(c||this,arguments);a.$updateAsync()}},$publish:function(){this.$isReady&&this.$observer().publish();return this},$observer:function(){return a.observer(this)},$subscribe:function(d,a,c,b){return this.$observer().subscribe(d,a,c,b)},$subs:function(){return this.$subscribe.apply(this,arguments)},$using:function(d,b){this._addReadyDep();var c=this;a.using(d,function(){if(c.isDisposed)return;b&&b();c._decReadyDep()});return this},$timeout:function(a,c){this._addReadyDep();var b=this;return setTimeout(function(){if(!b.isDisposed){a&&a();b.$updateAsync()._decReadyDep()}},c||1)}});this.Prop({$parentView:b,$node:b,$viewnode:b});this.Initialization(function(e,d){var c=this;c.base();c.linkToDom(e);a.extend(c,{$children:[],_module:b,_actions:[]});c.$node(e);if(d){c._setParent(d);d._addReadyParentDep()}c._addReadyDep();c._addReadyParentDep();c.onDispose(function(){var b=this,c=b.$parentView();c&&c.disposeStatus==0&&c._removeChild(b);if(!b.isDisposeFormDom){!b.$viewnode().isDisposed&&b.$viewnode().dispose();a.each(b.$children,function(a){a&&a.dispose()})}})})}),e=a.view.viewnodeClass=a.Class(a.linkToDom.LinkToDomClass,function(){var f=this;f.Static({vnName:["bg_cpl_node",a.makeAutoId()].join("_"),vnDataName:["bg_domnode",a.makeAutoId()].join("_"),getViewnode:function(a){return a?this.isViewnode(a)?$(a).data(this.vnDataName):this.getViewnode(a.parentNode||document.documentElement):b},setViewnode:function(a,b){a[this.vnName]="1";$(a).data(this.vnDataName,b)},removeViewnode:function(b){var a=b.node;a[this.vnName]=="0";$(a).removeData(this.vnDataName)},isViewnode:function(a){return a[this.vnName]=="1"}});f.Define({_setParent:function(b){var a=this;if(b){a.parentViewnode(b);b._addChild(a)}else a.view().$viewnode(a)},_addChild:function(a){this.children.push(a)},_removeChild:function(c){var b=this.children;b=a.removeArrayItem(c,b);this.children=b},_sortAttrs:function(){if(this.attrList.length>1)this.attrList=a.linq(this.attrList).sortDesc("_priority").toArray()},_compile:function(){var b=this;if(!b._isCompiled){b._isCompiled=c;b._sortAttrs();a.each(b.attrList,function(){!this.isDisposed&&this._compile()})}a.each(b.children,function(){!this.isDisposed&&this._compile()});b._resetCmpText()},_action:function(){var b=this;if(!b._isAction){b._isAction=c;a.each(b.attrList,function(){!this.isDisposed&&this._action()})}a.each(b.children,function(){!this.isDisposed&&this._action()})},_link:function(){var b=this;if(!b._isLinked){b._isLinked=c;a.each(b.attrList,function(){!this.isDisposed&&this._link()})}a.each(b.textList,function(){!this.isDisposed&&this._link()});a.each(b.children,function(){!this.isDisposed&&this._link()})},$getAttr:function(c){c=c.toLowerCase();var e=b;a.each(this.attrList,function(){if(this.attrName==c){e=this;return d}});return e},$html:function(c){var b=this.node();if(arguments.length>0){$(b).html("");a.compile(this.view()).fromHtml(c).appendTo(b).compile();return this}else return $(b).html()},getWithData:function(){return this._withData},_isCompileText:function(b){return b?a.inArray(b,this._textNodes)>=0:d},_setCompileText:function(a){this._textNodes.push(a)},_rmCompileText:function(b){this._textNodes=a.removeArrayItem(b,this._textNodes)},_resetCmpText:function(){this._textNodes=a.linq(this._textNodes).where(function(){return!h(this)}).toArray();var b=a.rootView().$viewnode();this!=b&&b._resetCmpText()}});f.Prop({view:b,node:b,parentViewnode:b});f.Initialization(function(h,f,c,g){var b=this;b.base();b.linkToDom(f);e.setViewnode(f,b);a.extend(b,{attrList:[],textList:[],children:[],_isCompiled:d,_isLinked:d,_isAction:d,_textNodes:[]});b._withData=g||c&&c.getWithData();b.view(h).node(f)._setParent(c);b.onDispose(function(){var b=this;if(!b.isDisposeFormDom){e.removeViewnode(b);a.each(b.children,function(a){a&&a.dispose()})}a.each(b.attrList,function(a){a&&a.dispose()});a.each(b.textList,function(a){a&&a.dispose()});var c=b.parentViewnode();if(c)c.disposeStatus==0&&c._removeChild(b);b.attrList=b.children=b.textList=b._textNodes=[]})})}),i=a.view.viewnodeAttrClass=a.Class(a.compile.bindClass,function(){this.Define({_priority:50,_compile:function(){var c=this.command,b=c.compile;b&&a.factory(b).viewnodeAttr(this).widthData(this.getWithData()).inject()},_action:function(){var c=this.command,b=c.action;b&&a.factory(b).viewnodeAttr(this).widthData(this.getWithData()).inject()},_link:function(){var b=this,d=b.command,c=d.link;c&&a.factory(c).viewnodeAttr(b).widthData(b.getWithData()).inject();b._init()},$subs:function(b,c,e){var a=this;if(arguments.length==1){c=b;var d=a;b=function(){return d.$results()}}a.view().$subs(b,c,e,a);return a},$subsResults:function(c,b){return this.$subs(a.proxy(this,function(){return this.$results()}),c,b)},$subsValue:function(c,b){return this.$subs(a.proxy(this,function(){return this.$value()}),c,b)},_init:function(){var d=this;d.__isinit=c;var e=d.__initParam;if(e){var f=e.p,h=e.p1;d.__initParam=b;var g=a.isFunction(f)?f.call(d):f;h.call(d,a.variableOf(g))}},$init:function(b,c){var a=this;if(arguments.length==1){c=b;var d=a;b=function(){return d.$results()}}a.__initParam={p:b,p1:c};a.__isinit&&a._init();return a},$initResults:function(b){return this.$init(a.proxy(this,function(){return this.$results()}),b)},$initValue:function(b){return this.$init(a.proxy(this,function(){return this.$value()}),b)}});this.Initialization(function(g,b,f,e,d,c){var a=this;a.base(g,b.node(),d,b.getWithData());a.viewnode(b);b.attrList.push(a);a.type=f;a.attrName=e.toLowerCase();a.command=c;a._priority=c.priority||50})}),h=function(a){try{return!a||!a.parentNode||!a.parentNode.parentNode||!a.parentNode.parentElement}catch(b){return c}},f=a.view.textTagClass=a.Class(function(){var e=this;e.Static({_regex:/\{\{(.+?)\}\}/gi,_regexRead:/^\s*:\s*/,hasTag:function(a){this._regex.lastIndex=0;return this._regex.test(a)}});e.Define({_link:function(){var e=this;if(!e._isLinked){e._isLinked=c;var n=e.attrValue,j=[],h=e,i=e.node(),s=i.nodeType,u=e.attrName,l=e.view(),r=e.parentNode(),k=d;i.nodeValue="";var g=b,o=function(a){if(s!=3)i.nodeValue=a;else{m();g=$.parseHTML(a);$(g).insertAfter(i)}},m=function(){g&&a.compile.removeNode(g);g=b},p=n.replace(f._regex,function(g,b){var d={};if(f._regexRead.test(b))b=b.replace(f._regexRead,"");else k=c;var e=a.compile.bind(l,i,b,h.getWithData());d.text=g,d.context=e;j.push(d);var m=e.$results();return d.value=a.toStr(a.variableOf(m))});o(p);p="";if(k){a.each(j,function(b){var c=b.context,e=b.text;l.$subs(function(){return h._isRemvoe()?a.makeAutoId():c.$results()},function(c){if(h._isRemvoe()){h.dispose();return}b.value=a.toStr(c);q()},d,h)});var q=function(){var b=n;a.each(j,function(a){var d=a.text,c=a.value;b=b.replace(d,c)});o(b)}}var t=function(){m();a.each(j,function(a){a.context&&a.context.dispose()});j=b};e.onDispose(function(){h=g=i=l=r=b;t()});!k&&setTimeout(a.proxy(e,function(){this.dispose()}),1)}},_isRemvoe:function(){var a=this,b=a.node&&a.node();return a.isDisposed||h(a.parentNode()||b)},getWithData:function(){return this._withData}});e.Prop({view:b,node:b,parentNode:b,viewnode:b});e.Initialization(function(i,c,h,d,f,g,e){var b=this;b._withData=g||c.getWithData();b.view(i).viewnode(c).node(h).parentNode(e);c.textList.push(b);b.attrName=d&&d.toLowerCase();b.attrValue=f;b.onDispose(function(){var c=this;if(c.node().nodeType==3){var b=c.viewnode();if(b&&b.disposeStatus==0){b.textList=a.removeArrayItem(c,b.textList);b._rmCompileText(c.node())}}})})});(function(){var d=document.documentElement,c=a.view;g=c.viewClass.NewObject(d);c.viewnodeClass.NewObject(g,d,b,b)})()})(bingo);(function(a){"use strict";a.filter.createFilter=function(c,e,d,a){return b.createFilter(c,e,d,a)};var b={_filterRegex:/[|]+[ ]?([^|]+)/g,hasFilter:function(a){this._filterRegex.lastIndex=0;return this._filterRegex.test(a)},removerFilterString:function(b){if(a.isNullEmpty(b)||!this.hasFilter(b))return b;this._filterRegex.lastIndex=0;var c=b.replace(this._filterRegex,function(a){return a.indexOf("||")==0?a:""});return a.trim(c)},getFilterStringList:function(b){if(a.isNullEmpty(b)||!this.hasFilter(b))return[];var c=[];this._filterRegex.lastIndex=0;b.replace(this._filterRegex,function(b,a){b.indexOf("||")!=0&&c.push(a)});return c},getScriptContextFun:function(f,e,j,i,d){var b=f._ca||(f._ca={}),c="cont";if(b[c])return b[c];var h=["{",e,"}"].join(""),g=["return ",h,";"].join("");try{return b[c]=new Function("$view","$node","$withData","bingo",["with ($view) {",d?"with ($withData) {":"","return function ($data) {","try {",g,"} catch (e) {","if (bingo.isDebug) bingo.trace(e);","}","};",d?"}":"","}"].join(""))(j,i,d,a)}catch(k){a.trace(k);return b[c]=function(){return e}}},hasFilterParam:function(a){return a.indexOf(":")>=0},getFilterParamName:function(c){var b=c.split(":");return a.trim(b[0])},getFilterByView:function(c,b){return c?c.$getModule(b).filter(b):a.filter(b)},paramFn:function(f,c,e,d,a){return b.getScriptContextFun(f,c,e,d,a)},getFilterObjList:function(c,d,h,g){var e=this.getFilterStringList(h);if(e.length==0)return[];var f=[];a.each(e,function(j){var e=null;j=a.trim(j);if(a.isNullEmpty(j))return;var i={name:e,paramFn:e,fitlerFn:e},h=e;if(b.hasFilterParam(j)){i.name=b.getFilterParamName(j);h=b.getFilterByView(c,i.name);if(!h)return;h=c?a.factory(h).view(c).node(d).inject():h();i.paramFn=b.paramFn(i,j,c,d,g)}else{i.name=j;h=b.getFilterByView(c,i.name);if(!h)return;h=c?a.factory(h).view(c).node(d).inject():h()}i.fitlerFn=h;i.fitlerVal=function(c){var a=this;if(!a.fitlerFn)return c;var b=e;if(a.paramFn){b=a.paramFn(c);b&&(b=b[a.name])}return a.fitlerFn(c,b)};f.push(i)});return f},createFilter:function(d,h,g,f){var c={contentOrg:d},e=b.hasFilter(d);c._filters=e?b.getFilterObjList(h,g,d,f):[];c.content=b.removerFilterString(d);c.contentFT=d.replace(c.content,"");if(c._filters.length>0)c.filter=function(c){var b=a.variableOf(c);a.each(this._filters,function(){b=this.fitlerVal(b)});return b};else c.filter=function(a){return a};return c}}})(bingo);(function(a){var d=false,b=true,c=null;"use strict";a.render=function(b,e,d){g.lastIndex=0;var a=g.test(b)?n(b,e,d):c;a&&(a=i(a));return{render:function(i,h,g,f,c){return!a?b:j(a,e,d,i,h,g,f,c)}}};var g=/\{\{\s*(\/?)(\:|if|else|for|tmpl|header|footer|empty|loading)(.*?)\}\}/g,h=/[ ]*([^ ]+)[ ]+in[ ]+(?:(.+)[ ]+tmpl[ ]*=[ ]*(.+)[/]|(.+))*/g,f=function(e,r,n,o,f,g,m,l,i){var d={isIf:r===b,ifReturn:b,isElse:m===b,isForeach:l===b,isEnd:n===b,isTag:o===b,role:a.isUndefined(i)?0:i,content:e,forParam:c,filterContext:c,fn:a.noop,flt:c,children:[]};if(d.isTag)if(!d.isEnd){d.filterContext=e;if(d.isForeach){var p=d.content;h.lastIndex=0;p.replace(h,function(){var c=d.forParam={};c.itemName=arguments[1];var b=arguments[2];c.tmpl=a.trim(arguments[3]);if(a.isNullEmpty(b))b=arguments[4];b=a.trim(b);var e=a.filter.createFilter(b,f,g);d.content=e.content;d.flt=e;c.dataName=d.content=e.content})}else{var j=a.filter.createFilter(e,f,g);d.content=j.content;d.flt=j}var q=k(d.content,f);d.fn=function(c,b){return q(c,b,a)}}return d},k=function(b,c){if(a.isNullEmpty(b))return a.noop;var d=b;try{return new Function("$view","$data","bingo",["try {",c?"with ($view) {":"","with ($data) {","return "+b+";","}",c?"}":"","} catch (e) {",'return bingo.isDebug ? ("Error: " + (e.message || e)) : e.message;',"} finally {","$data = null;","}"].join(""))}catch(f){if(a.isDebug){var e=["Error:",f.message||f," render:",d].join("");throw new Error(e);}else return function(){return f.message}}},n=function(m,p,o){var l=[],h=0,e=[],j=d,i=0,k=function(a){return a>0?e[a-1].children:l},n=function(a){return a>0?e.pop().children:l};m.replace(g,function(v,E,u,l,w,C){var B=C.slice(h,w),m=a.isNullEmpty(B)?c:f(B),q=e.length,g=k(q),y=E=="/",x=u=="tmpl";if(!j){j=x;if(x){h=w+v.length;i=1;return}}else{if(x)if(y){i--;j=i>0}else i++;m&&g.push(m);j&&g.push(f(v));h=w+v.length;return}var D=l.indexOf(" ")==0;!a.isNullEmpty(l)&&(l=a.trim(l));var s=u=="else";if(s)if(!a.isNullEmpty(l))if(!D)s=d;else{l=a.trim(l);l=a.isNullEmpty(l)?"true":l}else l="true";var z=u=="if"||s,A=u=="for",r=0;switch(u){case"header":r=1;break;case"footer":r=2;break;case"empty":r=3;break;case"loading":r=4}var t=f(l,z,y,b,p,o,s,A,r);if(s){g=n(q);m&&g.push(m);q=e.length;g=k(q);g.push(t);e.push(t)}else if(y){g=n(q);m&&g.push(m);if(z){q=e.length;g=k(q);g.push(t)}}else{g=k(q);m&&g.push(m);g.push(t);(z||A||r>0)&&e.push(t)}h=w+v.length});h<m.length&&l.push(f(m.slice(h)));return l},i=function(d){var b={header:c,footer:c,empty:c,loading:c,body:[]};a.each(d,function(){var a=this;switch(a.role){case 1:b.header=a;break;case 2:b.footer=a;break;case 3:b.empty=a;break;case 4:b.loading=a;break;default:b.body.push(a)}});return b},l=function(e,f){for(var a,c=f;c>=0;c--){a=e[c];if(a.isEnd&&a.isIf)break;if(a.isIf&&a.ifReturn)return b}return d},e=function(n,f,m,c,k,h){var g=[],o=[];a.each(n,function(o,v){if(!o.isTag)g.push(o.content);else if(!o.isEnd)if(o.isForeach){var q=o.forParam;if(!q)return;var r=q.tmpl,t=o.flt.filter(o.fn(f,c),c),p="";if(a.isNullEmpty(r)){var s=o.compileData;if(!s){s=o.compileData=i(o.children);o.children=[]}p=j(s,f,m,t,q.itemName,c,k,h)}else{if(!o.__renderObj){var u=r.indexOf("#")!=0;if(!u)p=$(r).html();else a.tmpl(r,f).success(function(a){p=a}).cacheQurey(b).async(d).get();if(a.isNullEmpty(p))return;o.__renderObj=a.render(p,f,m)}p=o.__renderObj.render(t,q.itemName,c,k,h)}g.push(p)}else if(o.isIf){if(o.isElse){if(l(n,v-1)||!(o.ifReturn=o.flt.filter(o.fn(f,c),c)))return}else if(!(o.ifReturn=o.flt.filter(o.fn(f,c),c)))return;var w=e(o.children,f,m,c,k,h);g.push(w)}else{var x=o.flt.filter(o.fn(f,c),c);g.push(x)}});return g.join("")},m=function(n,r,q,p,f,h,j,i,m,g){var b="_",c=i?a.clone(i,d):{};c[[f,"index"].join(b)]=h;c[[f,"count"].join(b)]=j;c[[f,"first"].join(b)]=h==0;c[[f,"last"].join(b)]=h==j-1;var k=h%2==0;c[[f,"odd"].join(b)]=k;c[[f,"even"].join(b)]=!k;c[f]=p;g&&g.push(c);var o=g?g.length-1:-1,l=e(n,r,q,c,h,g);return g?a.compile.injectTmplWithDataIndex(l,o,m):l},j=function(b,j,i,c,l,h,g,f){a.isString(l)||(l="item");var d=[];b.header&&d.push(e(b.header.children,j,i,h,g,f));if(a.isNull(c)){var k=b.loading||b.empty;k&&d.push(e(k.children,j,i,h,g,f))}else{if(!a.isArray(c))c=[c];if(c.length==0){var k=b.empty||b.loading;k&&d.push(e(k.children,j,i,h,g,f))}else{var n=b.body,o=c.length;a.each(c,function(b,a){d.push(m(n,j,i,b,l,a,o,h,g,f))})}}b.footer&&d.push(e(b.footer.children,j,i,h,g,f));return d.join("")}})(bingo);(function(a,j){var f="$observer",e="$withData",c="node",b="$view";"use strict";a.factory("$rootView",function(){return a.rootView()});a.factory("$compile",[b,function(b){return function(){return a.compile(b)}}]);a.factory("$tmpl",[b,function(b){return function(c){return a.tmpl(c,b)}}]);a.factory("$node",[c,function(a){return j(a)}]);a.factory("$factory",[b,function(b){return function(c){return a.factory(c).view(b)}}]);a.factory("$ajax",[b,function(b){var c=function(c){return a.ajax(c,b)};c.syncAll=function(c){return a.ajaxSyncAll(c,b)};return c}]);a.factory("$filter",[b,c,e,function(c,d,b){return function(f,e){return a.filter.createFilter(f,c,d,e||b)}}]);a.factory("$var",[b,function(b){return function(d,c){return a.variable(d,c,b)}}]);a.factory("$model",[b,function(b){return function(c){return a.model(c,b)}}]);a.factory("$bindContext",[b,c,e,function(c,d,b){return function(g,f,e){f||(f=d);e||(e=b);return a.compile.bind(c,f,g,e)}}]);a.factory("$nodeContext",[b,c,e,function(c,d,b){return function(f,e){f||(f=d);e||(e=b);return a.compile.bindNode(c,f,e)}}]);a.factory(f,[b,function(b){return a.observer(b)}]);a.each(["$subscribe","$subs"],function(b){a.factory(b,[f,"$attr",function(a,b){return function(e,c,d){return a.subscribe(e,c,d,b)}}])});a.factory("$module",[b,function(b){return function(e){var c=null,d=arguments.length==0?b.$getModule():a.module(e);return!d?c:{$service:function(e){var f=d.service(e);return!f?c:a.factory(e).view(b).inject()},$controller:function(f){var e=d.controller(f);return!e?c:{$action:function(f){var d=e.action(f);return!d?c:a.factory(d).view(b).inject()}}}}}}]);a.factory("$route",function(){return function(b){return a.route(b)}});a.factory("$routeContext",function(){return function(b){return a.routeContext(b)}});var g={},i=a.cacheToObject(g).max(100);a.factory("$cache",function(){return i});var h={},d=a.cacheToObject(h).max(20);a.factory("$param",[b,function(){return function(b,a){d.key(b);if(arguments.length<=1){var c=d.get();d.clear();return c}else d.set(a)}}])})(bingo,window.jQuery);(function(a){a.factory("$linq",function(){return function(b){return a.linq(b)}})})(bingo);(function(a){var b="bg-route",c="_bg_location_";a.location=function(f){a.isString(f)&&(f='[bg-name="'+f+'"]');var e=null;if(a.isString(f))e=$(f);else if(f)e=$(f).closest("["+b+"]");var h=e&&e.size()>0?true:false;if(!h)e=$(document.documentElement);var g=e.data(c);if(!g){g=d.NewObject().ownerNode(e).linkToDom(e).isRoute(h).name(e.attr("bg-name")||"");e.data(c,g)}return g};var d=a.location.Class=a.Class(a.linkToDom.LinkToDomClass,function(){var d="onCloseBefore",c="bg-location-change";this.Prop({ownerNode:null,isRoute:false,name:""});this.Define({queryParams:function(){var c=this.url(),b=a.routeContext(c);return b.params},href:function(f,e){var d=a.isNullEmpty(e)?this.isRoute()?this.ownerNode():null:$("["+b+'][bg-name="'+e+'"]');d&&d.size()>0&&d.attr(b,f).trigger(c,[f]);return this},reload:function(a){return this.href(this.url(),a)},onChange:function(a){var b=this;this.isRoute()&&a&&this.ownerNode().on(c,function(d,c){a.call(b,c)})},onLoaded:function(a){var b=this;this.isRoute()&&a&&this.ownerNode().on("bg-location-loaded",function(d,c){a.call(b,c)})},url:function(){return this.isRoute()?this.ownerNode().attr(b):window.location+""},toString:function(){return this.url()},views:function(){return a.view(this.ownerNode()).$children},close:function(){if(!this.isRoute())return;if(this.trigger(d)===false)return;this.ownerNode().remove()},onCloseBefore:function(a){return this.on(d,a)},onClosed:function(c){var a="onClosed",b=this;if(b.__closeed!==true){b.__closeed=true;b.onDispose(function(){this.trigger(a)})}return b.on(a,c)}})});a.factory("$location",["node",function(b){return a.location(b)}])})(bingo);(function(a){a.factory("$render",["$view","node",function(b,c){return function(d){return a.render(d,b,c)}}])})(bingo);(function(a){a.factory("$timeout",["$view",function(a){return function(b,c){return a.$timeout(function(){b&&b()},c)}}])})(bingo);(function(a){a.command("bg-action",function(){var b=null;return{priority:1e3,tmpl:"",tmplUrl:"",replace:false,include:false,view:true,compileChild:false,compilePre:b,action:b,link:b,compile:["$view","$compile","$node","$attr",function(c,g,h,j){var e=j.$prop(),d=b;if(!a.isNullEmpty(e)){d=j.$results();if(!d)d=a.datavalue(c.$parentView(),e)}if(a.isNullEmpty(e)||a.isFunction(d)||a.isArray(d)){d&&c.$addAction(d);g().fromNode(h[0].childNodes).compile()}else{var k=e,i=a.routeContext(k),f=i.actionContext();if(f.action){c.$setModule(f.module);c.$addAction(f.action);g().fromNode(h[0].childNodes).compile()}else c.$using(k,function(){var a=i.actionContext();if(a.action){c.$setModule(a.module);c.$addAction(a.action);g().fromNode(h[0].childNodes).compile()}})}}]}})})(bingo);(function(a){a.each("attr,prop,src,checked,disabled,readonly,class".split(","),function(b){a.command("bg-"+b,function(){return["$view","$attr","$node",function(f,d,c){var a="checked",e=function(d){switch(b){case"attr":c.attr(d);break;case"prop":c.prop(d);break;case"disabled":case"readonly":case a:c.prop(b,d);break;default:c.attr(b,d)}};d.$subsResults(function(a){e(a)},b=="attr"||b=="prop");d.$initResults(function(a){e(a)});b==a&&c.click(function(){var b=c.prop(a);d.$value(b);f.$update()})}]})})})(bingo);(function(a){a.each("event,click,blur,dblclick,focus,focusin,focusout,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,resize,scroll,select,submit,contextmenu".split(","),function(b){a.command("bg-"+b,function(){return["$view","$node","$attr",function(i,h,e){var g=function(b,a){h.on(b,function(){a.apply(this,arguments);i.$update()})};if(b!="event"){var c=e.$value();if(!a.isFunction(c))c=function(a){return e.$eval(a)};g(b,c)}else{var d=e.$results();if(a.isObject(d)){var c=null;for(var f in d)if(a.hasOwnProp(d,f)){c=d[f];a.isFunction(c)&&g(f,c)}}}}]})})})(bingo);(function(a){"use strict";var b=/[ ]*([^ ]+)[ ]+in[ ]+(?:(.+)[ ]+tmpl[ ]*=[ ]*(.+)|(.+))/;a.each(["bg-for","bg-render"],function(c){var d=[c,"data"].join("_");a.command(c,function(){return{priority:100,compileChild:false,compilePre:["$node",function(g){var i=g.attr(c);if(a.isNullEmpty(i))return;var f="",e="",h="";i.replace(b,function(){f=arguments[1];e=arguments[2];h=a.trim(arguments[3]);if(a.isNullEmpty(e))e=arguments[4]});g.attr(c,e);if(a.isNullEmpty(f)||a.isNullEmpty(e))return;g.data(d,{itemName:f,dataName:e,tmpl:h})}],link:["$view","$compile","$node","$attr","$render","$tmpl",function(q,m,c,k,n,p){var f=c.data(d);if(!f)return;var l=f.itemName,e=f.tmpl,h=function(f){var e=c,b="";e.html("");var d=[];b=i.render(f,l,null,-1,d);a.isNullEmpty(b)||m().fromHtml(b).withDataList(d).appendTo(e).compile()},j=function(a){i=n(a);k.$subsResults(function(a){h(a)},true);k.$initResults(function(a){h(a)})},b="",i=null;if(a.isNullEmpty(e)){var g=c.children();if(g.size()===1&&g.is("script"))b=g.html();else b=c.html()}else{var o=e.indexOf("#")!=0;if(o)p(e).success(function(b){!a.isNullEmpty(b)&&j(b)}).get();else b=$(e).html()}!a.isNullEmpty(b)&&j(b)}]}})})})(bingo);(function(a){var b="$location";a.command("bg-route",function(){return{priority:1e3,replace:false,view:true,compileChild:false,compile:["$compile","$node","$attr",b,function(e,b,d,c){var a=null;c.onChange(function(c){a&&a.stop();a=e().fromUrl(c).appendTo(b).onCompilePre(function(){b.html("")}).onCompiled(function(){a=null;b.trigger("bg-location-loaded",[c])}).compile()});d.$init(function(){return d.$prop()},function(a){a&&c.href(a)})}]}});a.command("bg-route-load",function(){return[b,"$attr",function(b,c){c.$initResults(function(c){a.isFunction(c)&&b.onLoaded(function(a){c.call(b,a)})})}]});$(function(){$(document.documentElement).on("click","[href]",function(){if(!a.location)return;var c=$(this),b=c.attr("href");if(b.indexOf("#")>=0){var d=a.location(this),e=c.attr("bg-target");b=b.split("#");b=b[b.length-1];d.href(b,e)}})})})(bingo);(function(a){a.command("bg-html",function(){return["$attr","$node",function(b,d){var c=function(b){d.html(a.toStr(b))};b.$subsResults(function(a){c(a)});b.$initResults(function(a){c(a)})}]})})(bingo);(function(a){a.command("bg-if",function(){return{compileChild:false,compile:["$attr","$node","$compile",function(d,a,c){var b=$(a),e=b.html();b.html("");b=null;d.$subsResults(function(b){if(b){a.show();c().fromHtml(e).appendTo(a).compile()}else a.html("").hide()})}]}})})(bingo);(function(a){a.command("bg-include",function(){return["$view","$attr","$viewnode","$tmpl",function(g,b,d,f){var e=b.$prop();if(a.isNullEmpty(e))return;var c=function(b){var c=b.indexOf("#")!=0,a="";if(c)f(b).success(function(b){a=b;d.$html(a)}).get();else{a=$(b).html();d.$html(a)}};b.$initResults(function(d){var f=!a.isUndefined(d);if(f){b.$subsResults(function(a){c(a)});c(d)}else c(e)})}]})})(bingo);(function(a){a.command("bg-model",function(){return["$view","$node","$attr",function(j,c,e){var b="checked",d="checkbox_value_02",i=c.is(":radio"),f=c.is(":checkbox");f&&c.data(d,c.val());var g=function(){var a=c;return f?a.prop(b)?a.data(d):"":a.val()},h=function(d){var e=c;d=a.toStr(d);if(f)e.prop(b,e.val()==d);else if(i)e.prop(b,e.val()==d);else e.val(d)};if(i)c.click(function(){var a=g();e.$value(a);j.$update()});else c.on("change",function(){var a=g();e.$value(a);j.$update()});e.$subsValue(function(a){h(a)});e.$initValue(function(a){h(a)})}]})})(bingo);(function(a){a.each("style,show,hide,visible".split(","),function(b){a.command("bg-"+b,function(){return["$attr","$node",function(c,a){var d=function(c){switch(b){case"style":a.css(c);break;case"hide":c=!c;case"show":if(c)a.show();else a.hide();break;case"visible":c=c?"visible":"hidden";a.css("visibility",c);break;default:a.css(b,c)}};c.$subsResults(function(a){d(a)},b=="style");c.$initResults(function(a){d(a)})}]})})})(bingo);(function(a){a.command("bg-text",function(){return["$attr","$node",function(b,d){var c=function(b){d.text(a.toStr(b))};b.$subsResults(function(a){c(a)});b.$initResults(function(a){c(a)})}]})})(bingo);(function(a){a.command("bg-include",function(){return["$view","$attr","$viewnode","$tmpl",function(g,b,d,f){var e=b.$prop();if(a.isNullEmpty(e))return;var c=function(b){var c=b.indexOf("#")!=0,a="";if(c)f(b).success(function(b){a=b;d.$html(a)}).get();else{a=$(b).html();d.$html(a)}};b.$initResults(function(d){var f=!a.isUndefined(d);if(f){b.$subsResults(function(a){c(a)});c(d)}else c(e)})}]})})(bingo);(function(a){a.command("bg-node",function(){return["$attr","node",function(a,b){a.$value(b)}]})})(bingo);(function(a){"use strict";a.filter("eq",function(){return function(a,b){return a==b}});a.filter("neq",function(){return function(a,b){return a!=b}});a.filter("not",function(){return function(a){return!a}});a.filter("gt",function(){return function(a,b){return a>b}});a.filter("gte",function(){return function(a,b){return a>=b}});a.filter("lt",function(){return function(a,b){return a<b}});a.filter("lte",function(){return function(a,b){return a<=b}});a.filter("len",function(){return function(b){return b?a.isUndefined(b.length)?0:b.length:0}});a.filter("text",function(){return function(b){return a.htmlEncode(b)}});a.filter("html",function(){return function(b){return a.htmlDecode(b)}});a.filter("val",function(){return function(b,a){return a}});a.filter("len",function(){return function(a){return a&&a.length?a.length:0}});a.filter("sw",function(){return function(i,a){var b=a.length,d=b%2==1,h=d?a[b-1]:"";d&&b--;for(var g=null,f=false,e,c=0;c<b;c+=2){e=a[c];if(i==e){g=a[c+1],f=true;break}}return f?g:h}});a.filter("take",function(){return function(c,b){return a.linq(c).take(b[0],b[1])}});a.filter("asc",function(){return function(d,c){var b=a.linq(d);if(!a.isNullEmpty(c))b.sortAsc(c);else b.sortAsc();return b.toArray()}});a.filter("desc",function(){return function(d,c){var b=a.linq(d);if(!a.isNullEmpty(c))b.sortDesc(c);else b.sortDesc();return b.toArray()}})})(bingo)