Bones/node_modules/angular2/bundles/upgrade.min.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

1 line
16 KiB
JavaScript

"format register";System.register("angular2/src/upgrade/metadata",["angular2/core"],!0,function(t,e,r){function n(t){var e=c.resolve(t),r=e.selector;if(!r.match(p))throw new Error("Only selectors matching element names are supported, got: "+r);var r=r.replace(u,function(t,e){return e.toUpperCase()});return{type:t,selector:r,inputs:o(e.inputs),outputs:o(e.outputs)}}function o(t){var e=[];if(t)for(var r=0;r<t.length;r++){var n=t[r].split(":"),o=n[0].trim(),i=(n[1]||n[0]).trim(),a=i.charAt(0).toUpperCase()+i.substr(1);e.push({prop:o,attr:i,bracketAttr:"["+i+"]",parenAttr:"("+i+")",bracketParenAttr:"[("+i+")]",onAttr:"on"+a,bindAttr:"bind"+a,bindonAttr:"bindon"+a})}return e}var i=System.global,a=i.define;i.define=void 0;var s=t("angular2/core"),p=/^[\w|-]*$/,u=/-(\w)/g,c=new s.DirectiveResolver;return e.getComponentInfo=n,e.parseFields=o,i.define=a,r.exports}),System.register("angular2/src/upgrade/util",[],!0,function(t,e,r){function n(t){return"function"==typeof t?t.name||t.toString():""+t}function o(t){throw console.log(t,t.stack),t}function i(t){return"$"+t+"Controller"}var a=System.global,s=a.define;return a.define=void 0,e.stringify=n,e.onError=o,e.controllerKey=i,a.define=s,r.exports}),System.register("angular2/src/upgrade/constants",[],!0,function(t,e,r){var n=System.global,o=n.define;return n.define=void 0,e.NG2_APP_VIEW_MANAGER="ng2.AppViewManager",e.NG2_COMPILER="ng2.Compiler",e.NG2_INJECTOR="ng2.Injector",e.NG2_HOST_VIEW_FACTORY_REF_MAP="ng2.HostViewFactoryRefMap",e.NG2_ZONE="ng2.NgZone",e.NG1_CONTROLLER="$controller",e.NG1_SCOPE="$scope",e.NG1_ROOT_SCOPE="$rootScope",e.NG1_COMPILE="$compile",e.NG1_HTTP_BACKEND="$httpBackend",e.NG1_INJECTOR="$injector",e.NG1_PARSE="$parse",e.NG1_TEMPLATE_CACHE="$templateCache",e.NG1_TESTABILITY="$$testability",e.REQUIRE_INJECTOR="^"+e.NG2_INJECTOR,n.define=o,r.exports}),System.register("angular2/src/upgrade/downgrade_ng2_adapter",["angular2/core","angular2/src/upgrade/constants"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var i=t("angular2/core"),a=t("angular2/src/upgrade/constants"),s={__UNINITIALIZED__:!0},p=function(){function t(t,e,r,n,o,i,a,s,p){this.id=t,this.info=e,this.element=r,this.attrs=n,this.scope=o,this.parentInjector=i,this.parse=a,this.viewManager=s,this.hostViewFactory=p,this.component=null,this.inputChangeCount=0,this.inputChanges=null,this.hostViewRef=null,this.changeDetector=null,this.contentInsertionPoint=null,this.element[0].id=t,this.componentScope=o.$new(),this.childNodes=r.contents()}return t.prototype.bootstrapNg2=function(){var t=this.parentInjector.resolveAndCreateChild([i.provide(a.NG1_SCOPE,{useValue:this.componentScope})]);this.contentInsertionPoint=document.createComment("ng1 insertion point"),this.hostViewRef=this.viewManager.createRootHostView(this.hostViewFactory,"#"+this.id,t,[[this.contentInsertionPoint]]);var e=this.viewManager.getHostElement(this.hostViewRef);this.changeDetector=this.hostViewRef.changeDetectorRef,this.component=this.viewManager.getComponent(e)},t.prototype.setupInputs=function(){for(var t=this,e=this.attrs,r=this.info.inputs,n=0;n<r.length;n++){var o=r[n],i=null;if(e.hasOwnProperty(o.attr)){var a=function(e){var r=s;return function(n){null!==t.inputChanges&&(t.inputChangeCount++,t.inputChanges[e]=new u(n,r===s?n:r),r=n),t.component[e]=n}}(o.prop);e.$observe(o.attr,a)}else e.hasOwnProperty(o.bindAttr)?i=e[o.bindAttr]:e.hasOwnProperty(o.bracketAttr)?i=e[o.bracketAttr]:e.hasOwnProperty(o.bindonAttr)?i=e[o.bindonAttr]:e.hasOwnProperty(o.bracketParenAttr)&&(i=e[o.bracketParenAttr]);if(null!=i){var p=function(e){return function(r,n){null!=t.inputChanges&&(t.inputChangeCount++,t.inputChanges[e]=new u(n,r)),t.component[e]=r}}(o.prop);this.componentScope.$watch(i,p)}}var c=this.info.type.prototype;c&&c.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return t.inputChangeCount},function(){var e=t.inputChanges;t.inputChanges={},t.component.ngOnChanges(e)})),this.componentScope.$watch(function(){return t.changeDetector&&t.changeDetector.detectChanges()})},t.prototype.projectContent=function(){var t=this.childNodes,e=this.contentInsertionPoint.parentNode;if(e)for(var r=0,n=t.length;n>r;r++)e.insertBefore(t[r],this.contentInsertionPoint)},t.prototype.setupOutputs=function(){for(var t=this,e=this.attrs,r=this.info.outputs,n=0;n<r.length;n++){var o=r[n],i=null,a=!1,s=o.bindonAttr?o.bindonAttr.substring(0,o.bindonAttr.length-6):null,p=o.bracketParenAttr?"[("+o.bracketParenAttr.substring(2,o.bracketParenAttr.length-8)+")]":null;if(e.hasOwnProperty(o.onAttr)?i=e[o.onAttr]:e.hasOwnProperty(o.parenAttr)?i=e[o.parenAttr]:e.hasOwnProperty(s)?(i=e[s],a=!0):e.hasOwnProperty(p)&&(i=e[p],a=!0),null!=i&&null!=a){var u=this.parse(i),c=u.assign;if(a&&!c)throw new Error("Expression '"+i+"' is not assignable!");var l=this.component[o.prop];if(!l)throw new Error("Missing emitter '"+o.prop+"' on component '"+this.info.selector+"'!");l.subscribe({next:a?function(e){return function(r){return e(t.scope,r)}}(c):function(e){return function(r){return e(t.scope,{$event:r})}}(u)})}}},t.prototype.registerCleanup=function(){var t=this;this.element.bind("$remove",function(){return t.viewManager.destroyRootHostView(t.hostViewRef)})},t}();e.DowngradeNg2ComponentAdapter=p;var u=function(){function t(t,e){this.previousValue=t,this.currentValue=e}return t.prototype.isFirstChange=function(){return this.previousValue===this.currentValue},t}();return n.define=o,r.exports}),System.register("angular2/src/upgrade/angular_js",[],!0,function(t,e,r){function n(){throw new Error("AngularJS v1.x is not loaded!")}var o=System.global,i=o.define;o.define=void 0;var a={bootstrap:n,module:n,element:n,version:n,resumeBootstrap:n,getTestability:n};try{window.hasOwnProperty("angular")&&(a=window.angular)}catch(s){}return e.bootstrap=a.bootstrap,e.module=a.module,e.element=a.element,e.version=a.version,e.resumeBootstrap=a.resumeBootstrap,e.getTestability=a.getTestability,o.define=i,r.exports}),System.register("angular2/src/upgrade/upgrade_ng1_adapter",["angular2/core","angular2/src/upgrade/constants","angular2/src/upgrade/util","angular2/src/upgrade/angular_js"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var i=t("angular2/core"),a=t("angular2/src/upgrade/constants"),s=t("angular2/src/upgrade/util"),p=t("angular2/src/upgrade/angular_js"),u=/([A-Z])/g,c={__UNINITIALIZED__:!0},l="NOT_SUPPORTED",h=function(){function t(t){this.name=t,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var e=t.replace(u,function(t,e){return"-"+e.toLowerCase()}),r=this;this.type=i.Directive({selector:e,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new i.Inject(a.NG1_SCOPE),i.ElementRef,function(t,e){return new g(r.linkFn,t,r.directive,e,r.$controller,r.inputs,r.outputs,r.propertyOutputs,r.checkProperties,r.propertyMap)}],ngOnChanges:function(){},ngDoCheck:function(){}})}return t.prototype.extractDirective=function(t){var e=t.get(this.name+"Directive");if(e.length>1)throw new Error("Only support single directive definition for: "+this.name);var r=e[0];r.replace&&this.notSupported("replace"),r.terminal&&this.notSupported("terminal");var n=r.link;return"object"==typeof n&&n.post&&this.notSupported("link.post"),r},t.prototype.notSupported=function(t){throw new Error("Upgraded directive '"+this.name+"' does not support '"+t+"'.")},t.prototype.extractBindings=function(){var t="object"==typeof this.directive.bindToController;if(t&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var e=t?this.directive.bindToController:this.directive.scope;if("object"==typeof e)for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=n.charAt(0);n=n.substr(1)||r;var i="output_"+r,a=i+": "+r,s=i+": "+r+"Change",p="input_"+r,u=p+": "+r;switch(o){case"=":this.propertyOutputs.push(i),this.checkProperties.push(n),this.outputs.push(i),this.outputsRename.push(s),this.propertyMap[i]=n;case"@":this.inputs.push(p),this.inputsRename.push(u),this.propertyMap[p]=n;break;case"&":this.outputs.push(i),this.outputsRename.push(a),this.propertyMap[i]=n;break;default:var c=JSON.stringify(e);throw new Error("Unexpected mapping '"+o+"' in '"+c+"' in '"+this.name+"' directive.")}}},t.prototype.compileTemplate=function(t,e,r){function n(e){var r=document.createElement("div");return r.innerHTML=e,t(r.childNodes)}var o=this;if(void 0!==this.directive.template)this.linkFn=n(this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var i=this.directive.templateUrl,a=e.get(i);if(void 0===a)return new Promise(function(t,a){r("GET",i,null,function(r,s){200==r?t(o.linkFn=n(e.put(i,s))):a("GET "+i+" returned "+r+": "+s)})});this.linkFn=n(a)}return null},t.resolve=function(t,e){var r=[],n=e.get(a.NG1_COMPILE),o=e.get(a.NG1_TEMPLATE_CACHE),i=e.get(a.NG1_HTTP_BACKEND),s=e.get(a.NG1_CONTROLLER);for(var p in t)if(t.hasOwnProperty(p)){var u=t[p];u.directive=u.extractDirective(e),u.$controller=s,u.extractBindings();var c=u.compileTemplate(n,o,i);c&&r.push(c)}return Promise.all(r)},t}();e.UpgradeNg1ComponentAdapterBuilder=h;var g=function(){function t(t,e,r,n,o,a,u,h,g,d){this.directive=r,this.inputs=a,this.outputs=u,this.propOuts=h,this.checkProperties=g,this.propertyMap=d,this.destinationObj=null,this.checkLastValues=[];for(var f,v=n.nativeElement,m=[];f=v.firstChild;)v.removeChild(f),m.push(f);var y=e.$new(!!r.scope),_=p.element(v),C=r.controller,w=null;if(C){var E={$scope:y,$element:_};w=o(C,E,null,r.controllerAs),_.data(s.controllerKey(r.name),w)}var N=r.link;if("object"==typeof N&&(N=N.pre),N){var O=l,b=l,P=this.resolveRequired(_,r.require);r.link(y,_,O,P,b)}this.destinationObj=r.bindToController&&w?w:y,t(y,function(t,e){for(var r=0,n=t.length;n>r;r++)v.appendChild(t[r])},{parentBoundTranscludeFn:function(t,e){e(m)}});for(var A=0;A<a.length;A++)this[a[A]]=null;for(var R=0;R<u.length;R++){var I=this[u[R]]=new i.EventEmitter;this.setComponentProperty(u[R],function(t){return function(e){return t.emit(e)}}(I))}for(var S=0;S<h.length;S++)this[h[S]]=new i.EventEmitter,this.checkLastValues.push(c)}return t.prototype.ngOnChanges=function(t){for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];this.setComponentProperty(e,r.currentValue)}},t.prototype.ngDoCheck=function(){for(var t=0,e=this.destinationObj,r=this.checkLastValues,n=this.checkProperties,o=0;o<n.length;o++){var i=e[n[o]],a=r[o];if(i!==a)if("number"==typeof i&&isNaN(i)&&"number"==typeof a&&isNaN(a));else{var s=this[this.propOuts[o]];s.emit(r[o]=i)}}return t},t.prototype.setComponentProperty=function(t,e){this.destinationObj[this.propertyMap[t]]=e},t.prototype.resolveRequired=function(t,e){if(e){if("string"==typeof e){var r=e,n=!1,o=!1,i=!1;"?"==r.charAt(0)&&(n=!0,r=r.substr(1)),"^"==r.charAt(0)&&(i=!0,r=r.substr(1)),"^"==r.charAt(0)&&(o=!0,r=r.substr(1));var a=s.controllerKey(r);o&&(t=t.parent());var p=i?t.inheritedData(a):t.data(a);if(!p&&!n)throw new Error("Can not locate '"+e+"' in '"+this.directive.name+"'.");return p}if(e instanceof Array){for(var u=[],c=0;c<e.length;c++)u.push(this.resolveRequired(t,e[c]));return u}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},t}();return n.define=o,r.exports}),System.register("angular2/src/upgrade/upgrade_adapter",["angular2/core","angular2/src/facade/lang","angular2/src/facade/async","angular2/platform/browser","angular2/src/upgrade/metadata","angular2/src/upgrade/util","angular2/src/upgrade/constants","angular2/src/upgrade/downgrade_ng2_adapter","angular2/src/upgrade/upgrade_ng1_adapter","angular2/src/upgrade/angular_js"],!0,function(t,e,r){function n(t,e){function r(r,n,o){var i=r[t.selector];if(!i)throw new Error("Expecting HostViewFactoryRef for: "+t.selector);var a=0;return{restrict:"E",require:h.REQUIRE_INJECTOR,link:{post:function(r,s,p,u,c){var l=(s[0],new g.DowngradeNg2ComponentAdapter(e+a++,t,s,p,r,u,o,n,i));l.setupInputs(),l.bootstrapNg2(),l.projectContent(),l.setupOutputs(),l.registerCleanup()}}}}return r.$inject=[h.NG2_HOST_VIEW_FACTORY_REF_MAP,h.NG2_APP_VIEW_MANAGER,h.NG1_PARSE],r}var o=System.global,i=o.define;o.define=void 0;var a=t("angular2/core"),s=t("angular2/src/facade/lang"),p=t("angular2/src/facade/async"),u=t("angular2/platform/browser"),c=t("angular2/src/upgrade/metadata"),l=t("angular2/src/upgrade/util"),h=t("angular2/src/upgrade/constants"),g=t("angular2/src/upgrade/downgrade_ng2_adapter"),d=t("angular2/src/upgrade/upgrade_ng1_adapter"),f=t("angular2/src/upgrade/angular_js"),v=0,m=function(){function t(){this.idPrefix="NG2_UPGRADE_"+v++ +"_",this.upgradedComponents=[],this.downgradedComponents={},this.providers=[]}return t.prototype.downgradeNg2Component=function(t){this.upgradedComponents.push(t);var e=c.getComponentInfo(t);return n(e,""+this.idPrefix+e.selector+"_c")},t.prototype.upgradeNg1Component=function(t){return this.downgradedComponents.hasOwnProperty(t)?this.downgradedComponents[t].type:(this.downgradedComponents[t]=new d.UpgradeNg1ComponentAdapterBuilder(t)).type},t.prototype.bootstrap=function(t,e,r){var n,o,i,c=this,g=new y,v=null,m=a.platform(u.BROWSER_PROVIDERS),_=m.application([u.BROWSER_APP_PROVIDERS,a.provide(h.NG1_INJECTOR,{useFactory:function(){return v}}),a.provide(h.NG1_COMPILE,{useFactory:function(){return v.get(h.NG1_COMPILE)}}),this.providers]),C=_.injector,w=C.get(a.NgZone),E=C.get(a.Compiler),N=[],O={},b=f.module(this.idPrefix,e),P=null,A=null;b.value(h.NG2_INJECTOR,C).value(h.NG2_ZONE,w).value(h.NG2_COMPILER,E).value(h.NG2_HOST_VIEW_FACTORY_REF_MAP,O).value(h.NG2_APP_VIEW_MANAGER,C.get(a.AppViewManager)).config(["$provide",function(t){t.decorator(h.NG1_ROOT_SCOPE,["$delegate",function(t){if(o=t.constructor.prototype,!o.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return n=o.$apply,o.$apply=function(t){return N.push(t)},i=t}]),t.decorator(h.NG1_TESTABILITY,["$delegate",function(t){var e=this,r=C.get(a.Testability),n=t.whenStable,o=function(t){var i=e;n.call(e,function(){r.isStable()?t.apply(this,arguments):r.whenStable(o.bind(i,t))})};return t.whenStable=o,t}])}]),A=new Promise(function(t,e){b.run(["$injector","$rootScope",function(r,n){v=r,p.ObservableWrapper.subscribe(w.onMicrotaskEmpty,function(t){return w.runOutsideAngular(function(){return n.$apply()})}),d.UpgradeNg1ComponentAdapterBuilder.resolve(c.downgradedComponents,r).then(t,e)}])});var R=s.global.angular;return R.resumeBootstrap=void 0,f.element(t).data(l.controllerKey(h.NG2_INJECTOR),C),w.run(function(){f.bootstrap(t,[c.idPrefix],r)}),P=new Promise(function(t,e){if(R.resumeBootstrap){var r=R.resumeBootstrap;R.resumeBootstrap=function(){R.resumeBootstrap=r,R.resumeBootstrap.apply(this,arguments),t()}}else t()}),Promise.all([this.compileNg2Components(E,O),P,A]).then(function(){w.run(function(){if(o){for(o.$apply=n;N.length;)i.$apply(N.shift());g._bootstrapDone(_,v),o=null}})},l.onError),g},t.prototype.addProvider=function(t){this.providers.push(t)},t.prototype.upgradeNg1Provider=function(t,e){var r=e&&e.asToken||t;this.providers.push(a.provide(r,{useFactory:function(e){return e.get(t)},deps:[h.NG1_INJECTOR]}))},t.prototype.downgradeNg2Provider=function(t){var e=function(e){return e.get(t)};return e.$inject=[h.NG2_INJECTOR],e},t.prototype.compileNg2Components=function(t,e){for(var r=this,n=[],o=this.upgradedComponents,i=0;i<o.length;i++)n.push(t.compileInHost(o[i]));return Promise.all(n).then(function(t){for(var n=r.upgradedComponents,o=0;o<t.length;o++)e[c.getComponentInfo(n[o]).selector]=t[o];return e},l.onError)},t}();e.UpgradeAdapter=m;var y=function(){function t(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ApplicationRef=null,this.ng2Injector=null}return t.prototype._bootstrapDone=function(t,e){this.ng2ApplicationRef=t,this.ng2Injector=t.injector,this.ng1Injector=e,this.ng1RootScope=e.get(h.NG1_ROOT_SCOPE),this._readyFn&&this._readyFn(this)},t.prototype.ready=function(t){this._readyFn=t},t.prototype.dispose=function(){this.ng1Injector.get(h.NG1_ROOT_SCOPE).$destroy(),this.ng2ApplicationRef.dispose()},t}();return e.UpgradeAdapterRef=y,o.define=i,r.exports}),System.register("angular2/upgrade",["angular2/src/upgrade/upgrade_adapter"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var i=t("angular2/src/upgrade/upgrade_adapter");return e.UpgradeAdapter=i.UpgradeAdapter,e.UpgradeAdapterRef=i.UpgradeAdapterRef,n.define=o,r.exports});