@angular/router 11.0.0-rc.3 → 11.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/router-testing.umd.js +1 -1
- package/bundles/router-testing.umd.min.js +1 -1
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +1 -1
- package/bundles/router-upgrade.umd.min.js +1 -1
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +13 -10
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +13 -13
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/src/create_url_tree.js +7 -1
- package/esm2015/src/recognize.js +2 -4
- package/esm2015/src/version.js +1 -1
- package/fesm2015/router.js +13 -10
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.d.ts +1 -1
- package/router.metadata.json +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
- package/upgrade/upgrade.d.ts +1 -1
- package/upgrade.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v11.0.
|
|
2
|
+
* @license Angular v11.0.3
|
|
3
3
|
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -32,7 +32,7 @@ var l,p=function(t){function e(e,r,n,i){void 0===n&&(n="imperative"),void 0===i&
|
|
|
32
32
|
*
|
|
33
33
|
* Use of this source code is governed by an MIT-style license that can be
|
|
34
34
|
* found in the LICENSE file at https://angular.io/license
|
|
35
|
-
*/function N(t,e,r){return r?function n(t,e){return T(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!H(e.segments,r.segments))return!1;if(e.numberOfChildren!==r.numberOfChildren)return!1;for(var n in r.children){if(!e.children[n])return!1;if(!t(e.children[n],r.children[n]))return!1}return!0}(t.root,e.root):function i(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every((function(r){return k(t[r],e[r])}))}(t.queryParams,e.queryParams)&&function t(e,r){return function e(r,n,i){if(r.segments.length>i.length)return!!H(a=r.segments.slice(0,i.length),i)&&!n.hasChildren();if(r.segments.length===i.length){if(!H(r.segments,i))return!1;for(var o in n.children){if(!r.children[o])return!1;if(!t(r.children[o],n.children[o]))return!1}return!0}var a=i.slice(0,r.segments.length),u=i.slice(r.segments.length);return!!H(r.segments,a)&&!!r.children.primary&&e(r.children.primary,n,u)}(e,r,r.segments)}(t.root,e.root)}var q=function(){function t(t,e,r){this.root=t,this.queryParams=e,this.fragment=r}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=_(this.queryParams)),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return B.serialize(this)},t}(),z=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,L(e,(function(t,e){return t.parent=r}))}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return V(this)},t}(),D=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=_(this.parameters)),this._parameterMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return J(this)},t}();function H(t,e){return t.length===e.length&&t.every((function(t,r){return t.path===e[r].path}))}function F(t,e){var r=[];return L(t.children,(function(t,n){"primary"===n&&(r=r.concat(e(t,n)))})),L(t.children,(function(t,n){"primary"!==n&&(r=r.concat(e(t,n)))})),r}var G=function G(){},W=function(){function t(){}return t.prototype.parse=function(t){var e=new nt(t);return new q(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return V(e);if(r){var n=e.children.primary?t(e.children.primary,!1):"",i=[];return L(e.children,(function(e,r){"primary"!==r&&i.push(r+":"+t(e,!1))})),i.length>0?n+"("+i.join("//")+")":n}var o=F(e,(function(r,n){return"primary"===n?[t(e.children.primary,!1)]:[n+":"+t(r,!1)]}));return 1===Object.keys(e.children).length&&null!=e.children.primary?V(e)+"/"+o[0]:V(e)+"/("+o.join("//")+")"}(t.root,!0)+function e(t){var e=Object.keys(t).map((function(e){var r=t[e];return Array.isArray(r)?r.map((function(t){return Y(e)+"="+Y(t)})).join("&"):Y(e)+"="+Y(r)}));return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),B=new W;function V(t){return t.segments.map((function(t){return J(t)})).join("/")}function Q(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Y(t){return Q(t).replace(/%3B/gi,";")}function Z(t){return Q(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function $(t){return decodeURIComponent(t)}function K(t){return $(t.replace(/\+/g,"%20"))}function J(t){return""+Z(t.path)+function e(t){return Object.keys(t).map((function(e){return";"+Z(e)+"="+Z(t[e])})).join("")}(t.parameters)}var X=/^[^\/()?;=#]+/;function tt(t){var e=t.match(X);return e?e[0]:""}var et=/^[^=?&#]+/,rt=/^[^?&#]+/,nt=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new z([],{}):new z([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(r.primary=new z(t,e)),r},t.prototype.parseSegment=function(){var t=tt(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new D($(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=tt(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=tt(this.remaining);n&&this.capture(r=n)}t[$(e)]=$(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(et);return e?e[0]:""}(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var i=function o(t){var e=t.match(rt);return e?e[0]:""}(this.remaining);i&&this.capture(n=i)}var a=K(e),u=K(n);if(t.hasOwnProperty(a)){var s=t[a];Array.isArray(s)||(t[a]=s=[s]),s.push(u)}else t[a]=u}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var r=tt(this.remaining),n=this.remaining[r.length];if("/"!==n&&")"!==n&&";"!==n)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;r.indexOf(":")>-1?(i=r.substr(0,r.indexOf(":")),this.capture(i),this.capture(":")):t&&(i="primary");var o=this.parseChildren();e[i]=1===Object.keys(o).length?o.primary:new z([],o),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),it=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!1,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=ot(t,this._root);return e?e.children.map((function(t){return t.value})):[]},t.prototype.firstChild=function(t){var e=ot(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=at(t,this._root);return e.length<2?[]:e[e.length-2].children.map((function(t){return t.value})).filter((function(e){return e!==t}))},t.prototype.pathFromRoot=function(t){return at(t,this._root).map((function(t){return t.value}))},t}();function ot(t,e){var r,n;if(t===e.value)return e;try{for(var i=u(e.children),o=i.next();!o.done;o=i.next()){var a=ot(t,o.value);if(a)return a}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function at(t,e){var r,n;if(t===e.value)return[e];try{for(var i=u(e.children),o=i.next();!o.done;o=i.next()){var a=at(t,o.value);if(a.length)return a.unshift(e),a}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return[]}var ut=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function st(t){var e={};return t&&t.children.forEach((function(t){return e[t.value.outlet]=t})),e}var ct=function(t){function e(e,r){var n=t.call(this,e)||this;return n.snapshot=r,dt(n,e),n}return a(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(it);function lt(t,e){var r=function i(t,e){var r=new ft([],{},{},"",{},"primary",e,null,t.root,-1,{});return new gt("",new ut(r,[]))}(t,e),o=new n.BehaviorSubject([new D("",{})]),a=new n.BehaviorSubject({}),u=new n.BehaviorSubject({}),s=new n.BehaviorSubject({}),c=new n.BehaviorSubject(""),l=new pt(o,a,s,c,u,"primary",e,r.root);return l.snapshot=r.root,new ct(new ut(l,[]),r)}var pt=function(){function t(t,e,r,n,i,o,a,u){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=u}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(i.map((function(t){return _(t)})))),this._paramMap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(i.map((function(t){return _(t)})))),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function ht(t,e){void 0===e&&(e="emptyOnly");var r=t.pathFromRoot,n=0;if("always"!==e)for(n=r.length-1;n>=1;){var i=r[n],o=r[n-1];if(i.routeConfig&&""===i.routeConfig.path)n--;else{if(o.component)break;n--}}return function a(t){return t.reduce((function(t,e){return{params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}}),{params:{},data:{},resolve:{}})}(r.slice(n))}var ft=function(){function t(t,e,r,n,i,o,a,u,s,c,l){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this.routeConfig=u,this._urlSegment=s,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=_(this.params)),this._paramMap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=_(this.queryParams)),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map((function(t){return t.toString()})).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),gt=function(t){function e(e,r){var n=t.call(this,r)||this;return n.url=e,dt(n,r),n}return a(e,t),e.prototype.toString=function(){return vt(this._root)},e}(it);function dt(t,e){e.value._routerState=t,e.children.forEach((function(e){return dt(t,e)}))}function vt(t){var e=t.children.length>0?" { "+t.children.map(vt).join(", ")+" } ":"";return""+t.value+e}function mt(t){if(t.snapshot){var e=t.snapshot,r=t._futureSnapshot;t.snapshot=r,T(e.queryParams,r.queryParams)||t.queryParams.next(r.queryParams),e.fragment!==r.fragment&&t.fragment.next(r.fragment),T(e.params,r.params)||t.params.next(r.params),function n(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(!T(t[r],e[r]))return!1;return!0}(e.url,r.url)||t.url.next(r.url),T(e.data,r.data)||t.data.next(r.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function yt(t,e){return T(t.params,e.params)&&function r(t,e){return H(t,e)&&t.every((function(t,r){return T(t.parameters,e[r].parameters)}))}(t.url,e.url)&&!(!t.parent!=!e.parent)&&(!t.parent||yt(t.parent,e.parent))}function St(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function bt(t){return"object"==typeof t&&null!=t&&t.outlets}function Ct(t,e,r,n,i){var o={};return n&&L(n,(function(t,e){o[e]=Array.isArray(t)?t.map((function(t){return""+t})):""+t})),new q(r.root===t?e:function t(e,r,n){var i={};return L(e.children,(function(e,o){i[o]=e===r?n:t(e,r,n)})),new z(e.segments,i)}(r.root,t,e),o,i)}var wt=function(){function t(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&St(r[0]))throw new Error("Root segment cannot have matrix parameters");var n=r.find(bt);if(n&&n!==I(r))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Rt=function Rt(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r};function Ot(t,e,r){if(t||(t=new z([],{})),0===t.segments.length&&t.hasChildren())return Ut(t,e,r);var n=function i(t,e,r){for(var n=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};i<t.segments.length;){if(n>=r.length)return o;var a=t.segments[i],u=r[n];if(bt(u))break;var s=""+u,c=n<r.length-1?r[n+1]:null;if(i>0&&void 0===s)break;if(s&&c&&"object"==typeof c&&void 0===c.outlets){if(!At(s,c,a))return o;n+=2}else{if(!At(s,{},a))return o;n++}i++}return{match:!0,pathIndex:i,commandIndex:n}}(t,e,r),o=r.slice(n.commandIndex);if(n.match&&n.pathIndex<t.segments.length){var a=new z(t.segments.slice(0,n.pathIndex),{});return a.children.primary=new z(t.segments.slice(n.pathIndex),t.children),Ut(a,0,o)}return n.match&&0===o.length?new z(t.segments,{}):n.match&&!t.hasChildren()?Pt(t,e,r):n.match?Ut(t,0,o):Pt(t,e,r)}function Ut(t,e,r){if(0===r.length)return new z(t.segments,{});var n=function i(t){var e;return bt(t[0])?t[0].outlets:((e={}).primary=t,e)}(r),o={};return L(n,(function(r,n){null!==r&&(o[n]=Ot(t.children[n],e,r))})),L(t.children,(function(t,e){void 0===n[e]&&(o[e]=t)})),new z(t.segments,o)}function Pt(t,e,r){for(var n=t.segments.slice(0,e),i=0;i<r.length;){var o=r[i];if(bt(o)){var a=xt(o.outlets);return new z(n,a)}if(0===i&&St(r[0]))n.push(new D(t.segments[e].path,r[0])),i++;else{var u=bt(o)?o.outlets.primary:""+o,s=i<r.length-1?r[i+1]:null;u&&s&&St(s)?(n.push(new D(u,_t(s))),i+=2):(n.push(new D(u,{})),i++)}}return new z(n,{})}function xt(t){var e={};return L(t,(function(t,r){null!==t&&(e[r]=Pt(new z([],{}),0,t))})),e}function _t(t){var e={};return L(t,(function(t,r){return e[r]=""+t})),e}function At(t,e,r){return t==r.path&&T(e,r.parameters)}
|
|
35
|
+
*/function N(t,e,r){return r?function n(t,e){return T(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!H(e.segments,r.segments))return!1;if(e.numberOfChildren!==r.numberOfChildren)return!1;for(var n in r.children){if(!e.children[n])return!1;if(!t(e.children[n],r.children[n]))return!1}return!0}(t.root,e.root):function i(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every((function(r){return k(t[r],e[r])}))}(t.queryParams,e.queryParams)&&function t(e,r){return function e(r,n,i){if(r.segments.length>i.length)return!!H(a=r.segments.slice(0,i.length),i)&&!n.hasChildren();if(r.segments.length===i.length){if(!H(r.segments,i))return!1;for(var o in n.children){if(!r.children[o])return!1;if(!t(r.children[o],n.children[o]))return!1}return!0}var a=i.slice(0,r.segments.length),u=i.slice(r.segments.length);return!!H(r.segments,a)&&!!r.children.primary&&e(r.children.primary,n,u)}(e,r,r.segments)}(t.root,e.root)}var q=function(){function t(t,e,r){this.root=t,this.queryParams=e,this.fragment=r}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=_(this.queryParams)),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return B.serialize(this)},t}(),z=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,L(e,(function(t,e){return t.parent=r}))}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return V(this)},t}(),D=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=_(this.parameters)),this._parameterMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return J(this)},t}();function H(t,e){return t.length===e.length&&t.every((function(t,r){return t.path===e[r].path}))}function F(t,e){var r=[];return L(t.children,(function(t,n){"primary"===n&&(r=r.concat(e(t,n)))})),L(t.children,(function(t,n){"primary"!==n&&(r=r.concat(e(t,n)))})),r}var G=function G(){},W=function(){function t(){}return t.prototype.parse=function(t){var e=new nt(t);return new q(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return V(e);if(r){var n=e.children.primary?t(e.children.primary,!1):"",i=[];return L(e.children,(function(e,r){"primary"!==r&&i.push(r+":"+t(e,!1))})),i.length>0?n+"("+i.join("//")+")":n}var o=F(e,(function(r,n){return"primary"===n?[t(e.children.primary,!1)]:[n+":"+t(r,!1)]}));return 1===Object.keys(e.children).length&&null!=e.children.primary?V(e)+"/"+o[0]:V(e)+"/("+o.join("//")+")"}(t.root,!0)+function e(t){var e=Object.keys(t).map((function(e){var r=t[e];return Array.isArray(r)?r.map((function(t){return Y(e)+"="+Y(t)})).join("&"):Y(e)+"="+Y(r)}));return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),B=new W;function V(t){return t.segments.map((function(t){return J(t)})).join("/")}function Q(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Y(t){return Q(t).replace(/%3B/gi,";")}function Z(t){return Q(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function $(t){return decodeURIComponent(t)}function K(t){return $(t.replace(/\+/g,"%20"))}function J(t){return""+Z(t.path)+function e(t){return Object.keys(t).map((function(e){return";"+Z(e)+"="+Z(t[e])})).join("")}(t.parameters)}var X=/^[^\/()?;=#]+/;function tt(t){var e=t.match(X);return e?e[0]:""}var et=/^[^=?&#]+/,rt=/^[^?&#]+/,nt=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new z([],{}):new z([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(r.primary=new z(t,e)),r},t.prototype.parseSegment=function(){var t=tt(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new D($(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=tt(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=tt(this.remaining);n&&this.capture(r=n)}t[$(e)]=$(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(et);return e?e[0]:""}(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var i=function o(t){var e=t.match(rt);return e?e[0]:""}(this.remaining);i&&this.capture(n=i)}var a=K(e),u=K(n);if(t.hasOwnProperty(a)){var s=t[a];Array.isArray(s)||(t[a]=s=[s]),s.push(u)}else t[a]=u}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var r=tt(this.remaining),n=this.remaining[r.length];if("/"!==n&&")"!==n&&";"!==n)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;r.indexOf(":")>-1?(i=r.substr(0,r.indexOf(":")),this.capture(i),this.capture(":")):t&&(i="primary");var o=this.parseChildren();e[i]=1===Object.keys(o).length?o.primary:new z([],o),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),it=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!1,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=ot(t,this._root);return e?e.children.map((function(t){return t.value})):[]},t.prototype.firstChild=function(t){var e=ot(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=at(t,this._root);return e.length<2?[]:e[e.length-2].children.map((function(t){return t.value})).filter((function(e){return e!==t}))},t.prototype.pathFromRoot=function(t){return at(t,this._root).map((function(t){return t.value}))},t}();function ot(t,e){var r,n;if(t===e.value)return e;try{for(var i=u(e.children),o=i.next();!o.done;o=i.next()){var a=ot(t,o.value);if(a)return a}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function at(t,e){var r,n;if(t===e.value)return[e];try{for(var i=u(e.children),o=i.next();!o.done;o=i.next()){var a=at(t,o.value);if(a.length)return a.unshift(e),a}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return[]}var ut=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function st(t){var e={};return t&&t.children.forEach((function(t){return e[t.value.outlet]=t})),e}var ct=function(t){function e(e,r){var n=t.call(this,e)||this;return n.snapshot=r,dt(n,e),n}return a(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(it);function lt(t,e){var r=function i(t,e){var r=new ft([],{},{},"",{},"primary",e,null,t.root,-1,{});return new gt("",new ut(r,[]))}(t,e),o=new n.BehaviorSubject([new D("",{})]),a=new n.BehaviorSubject({}),u=new n.BehaviorSubject({}),s=new n.BehaviorSubject({}),c=new n.BehaviorSubject(""),l=new pt(o,a,s,c,u,"primary",e,r.root);return l.snapshot=r.root,new ct(new ut(l,[]),r)}var pt=function(){function t(t,e,r,n,i,o,a,u){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=u}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(i.map((function(t){return _(t)})))),this._paramMap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(i.map((function(t){return _(t)})))),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function ht(t,e){void 0===e&&(e="emptyOnly");var r=t.pathFromRoot,n=0;if("always"!==e)for(n=r.length-1;n>=1;){var i=r[n],o=r[n-1];if(i.routeConfig&&""===i.routeConfig.path)n--;else{if(o.component)break;n--}}return function a(t){return t.reduce((function(t,e){return{params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}}),{params:{},data:{},resolve:{}})}(r.slice(n))}var ft=function(){function t(t,e,r,n,i,o,a,u,s,c,l){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this.routeConfig=u,this._urlSegment=s,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=_(this.params)),this._paramMap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=_(this.queryParams)),this._queryParamMap},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map((function(t){return t.toString()})).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),gt=function(t){function e(e,r){var n=t.call(this,r)||this;return n.url=e,dt(n,r),n}return a(e,t),e.prototype.toString=function(){return vt(this._root)},e}(it);function dt(t,e){e.value._routerState=t,e.children.forEach((function(e){return dt(t,e)}))}function vt(t){var e=t.children.length>0?" { "+t.children.map(vt).join(", ")+" } ":"";return""+t.value+e}function mt(t){if(t.snapshot){var e=t.snapshot,r=t._futureSnapshot;t.snapshot=r,T(e.queryParams,r.queryParams)||t.queryParams.next(r.queryParams),e.fragment!==r.fragment&&t.fragment.next(r.fragment),T(e.params,r.params)||t.params.next(r.params),function n(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(!T(t[r],e[r]))return!1;return!0}(e.url,r.url)||t.url.next(r.url),T(e.data,r.data)||t.data.next(r.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function yt(t,e){return T(t.params,e.params)&&function r(t,e){return H(t,e)&&t.every((function(t,r){return T(t.parameters,e[r].parameters)}))}(t.url,e.url)&&!(!t.parent!=!e.parent)&&(!t.parent||yt(t.parent,e.parent))}function St(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function bt(t){return"object"==typeof t&&null!=t&&t.outlets}function Ct(t,e,r,n,i){var o={};return n&&L(n,(function(t,e){o[e]=Array.isArray(t)?t.map((function(t){return""+t})):""+t})),new q(r.root===t?e:function t(e,r,n){var i={};return L(e.children,(function(e,o){i[o]=e===r?n:t(e,r,n)})),new z(e.segments,i)}(r.root,t,e),o,i)}var wt=function(){function t(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&St(r[0]))throw new Error("Root segment cannot have matrix parameters");var n=r.find(bt);if(n&&n!==I(r))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Rt=function Rt(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r};function Ot(t,e,r){if(t||(t=new z([],{})),0===t.segments.length&&t.hasChildren())return Ut(t,e,r);var n=function i(t,e,r){for(var n=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};i<t.segments.length;){if(n>=r.length)return o;var a=t.segments[i],u=r[n];if(bt(u))break;var s=""+u,c=n<r.length-1?r[n+1]:null;if(i>0&&void 0===s)break;if(s&&c&&"object"==typeof c&&void 0===c.outlets){if(!At(s,c,a))return o;n+=2}else{if(!At(s,{},a))return o;n++}i++}return{match:!0,pathIndex:i,commandIndex:n}}(t,e,r),o=r.slice(n.commandIndex);if(n.match&&n.pathIndex<t.segments.length){var a=new z(t.segments.slice(0,n.pathIndex),{});return a.children.primary=new z(t.segments.slice(n.pathIndex),t.children),Ut(a,0,o)}return n.match&&0===o.length?new z(t.segments,{}):n.match&&!t.hasChildren()?Pt(t,e,r):n.match?Ut(t,0,o):Pt(t,e,r)}function Ut(t,e,r){if(0===r.length)return new z(t.segments,{});var n=function i(t){var e;return bt(t[0])?t[0].outlets:((e={}).primary=t,e)}(r),o={};return L(n,(function(r,n){"string"==typeof r&&(r=[r]),null!==r&&(o[n]=Ot(t.children[n],e,r))})),L(t.children,(function(t,e){void 0===n[e]&&(o[e]=t)})),new z(t.segments,o)}function Pt(t,e,r){for(var n=t.segments.slice(0,e),i=0;i<r.length;){var o=r[i];if(bt(o)){var a=xt(o.outlets);return new z(n,a)}if(0===i&&St(r[0]))n.push(new D(t.segments[e].path,r[0])),i++;else{var u=bt(o)?o.outlets.primary:""+o,s=i<r.length-1?r[i+1]:null;u&&s&&St(s)?(n.push(new D(u,_t(s))),i+=2):(n.push(new D(u,{})),i++)}}return new z(n,{})}function xt(t){var e={};return L(t,(function(t,r){"string"==typeof t&&(t=[t]),null!==t&&(e[r]=Pt(new z([],{}),0,t))})),e}function _t(t){var e={};return L(t,(function(t,r){return e[r]=""+t})),e}function At(t,e,r){return t==r.path&&T(e,r.parameters)}
|
|
36
36
|
/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -90,7 +90,7 @@ var Jt=function Jt(t){this.path=t,this.route=this.path[this.path.length-1]},Xt=f
|
|
|
90
90
|
*
|
|
91
91
|
* Use of this source code is governed by an MIT-style license that can be
|
|
92
92
|
* found in the LICENSE file at https://angular.io/license
|
|
93
|
-
*/function ne(t,e){return null!==t&&e&&e(new O(t)),n.of(!0)}function ie(t,e){return null!==t&&e&&e(new w(t)),n.of(!0)}function oe(t,e,r){var o=e.routeConfig?e.routeConfig.canActivate:null;if(!o||0===o.length)return n.of(!0);var a=o.map((function(o){return n.defer((function(){var n,a=te(o,e,r);if(function u(t){return t&&Et(t.canActivate)}(a))n=M(a.canActivate(e,t));else{if(!Et(a))throw new Error("Invalid CanActivate guard");n=M(a(e,t))}return n.pipe(i.first())}))}));return n.of(a).pipe(Nt())}function ae(t,e,r){var o=e[e.length-1],a=e.slice(0,e.length-1).reverse().map((function(t){return function e(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)})).filter((function(t){return null!==t})).map((function(e){return n.defer((function(){var a=e.guards.map((function(n){var a,u=te(n,e.node,r);if(function s(t){return t&&Et(t.canActivateChild)}(u))a=M(u.canActivateChild(o,t));else{if(!Et(u))throw new Error("Invalid CanActivateChild guard");a=M(u(o,t))}return a.pipe(i.first())}));return n.of(a).pipe(Nt())}))}));return n.of(a).pipe(Nt())}var ue=function Gt(){},se=function(){function t(t,e,r,n,i,o){this.rootComponentType=t,this.config=e,this.urlTree=r,this.url=n,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return t.prototype.recognize=function(){try{var t=pe(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,"primary"),r=new ft([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},"primary",this.rootComponentType,null,this.urlTree.root,-1,{}),i=new ut(r,e),o=new gt(this.url,i);return this.inheritParamsAndData(o._root),n.of(o)}catch(t){return new n.Observable((function(e){return e.error(t)}))}},t.prototype.inheritParamsAndData=function(t){var e=this,r=t.value,n=ht(r,this.paramsInheritanceStrategy);r.params=Object.freeze(n.params),r.data=Object.freeze(n.data),t.children.forEach((function(t){return e.inheritParamsAndData(t)}))},t.prototype.processSegmentGroup=function(t,e,r){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,r)},t.prototype.processChildren=function(t,e){var r=this,n=F(e,(function(e,n){return r.processSegmentGroup(t,e,n)}));return function i(t){var e={};t.forEach((function(t){var r=e[t.value.outlet];if(r){var n=r.url.map((function(t){return t.toString()})).join("/"),i=t.value.url.map((function(t){return t.toString()})).join("/");throw new Error("Two segments cannot have the same outlet name: '"+n+"' and '"+i+"'.")}e[t.value.outlet]=t.value}))}(n),function o(t){t.sort((function(t,e){return"primary"===t.value.outlet?-1:"primary"===e.value.outlet?1:t.value.outlet.localeCompare(e.value.outlet)}))}(n),n},t.prototype.processSegment=function(t,e,r,n){var i,o;try{for(var a=u(t),s=a.next();!s.done;s=a.next()){var c=s.value;try{return this.processSegmentAgainstRoute(c,e,r,n)}catch(t){if(!(t instanceof ue))throw t}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}if(this.noLeftoversInUrl(e,r,n))return[];throw new ue},t.prototype.noLeftoversInUrl=function(t,e,r){return 0===e.length&&!t.children[r]},t.prototype.processSegmentAgainstRoute=function(t,e,r,n){if(t.redirectTo)throw new ue;if((t.outlet||"primary")!==n)throw new ue;var i,o=[],a=[];if("**"===t.path){var u=r.length>0?I(r).parameters:{};i=new ft(r,u,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,
|
|
93
|
+
*/function ne(t,e){return null!==t&&e&&e(new O(t)),n.of(!0)}function ie(t,e){return null!==t&&e&&e(new w(t)),n.of(!0)}function oe(t,e,r){var o=e.routeConfig?e.routeConfig.canActivate:null;if(!o||0===o.length)return n.of(!0);var a=o.map((function(o){return n.defer((function(){var n,a=te(o,e,r);if(function u(t){return t&&Et(t.canActivate)}(a))n=M(a.canActivate(e,t));else{if(!Et(a))throw new Error("Invalid CanActivate guard");n=M(a(e,t))}return n.pipe(i.first())}))}));return n.of(a).pipe(Nt())}function ae(t,e,r){var o=e[e.length-1],a=e.slice(0,e.length-1).reverse().map((function(t){return function e(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)})).filter((function(t){return null!==t})).map((function(e){return n.defer((function(){var a=e.guards.map((function(n){var a,u=te(n,e.node,r);if(function s(t){return t&&Et(t.canActivateChild)}(u))a=M(u.canActivateChild(o,t));else{if(!Et(u))throw new Error("Invalid CanActivateChild guard");a=M(u(o,t))}return a.pipe(i.first())}));return n.of(a).pipe(Nt())}))}));return n.of(a).pipe(Nt())}var ue=function Gt(){},se=function(){function t(t,e,r,n,i,o){this.rootComponentType=t,this.config=e,this.urlTree=r,this.url=n,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return t.prototype.recognize=function(){try{var t=pe(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,"primary"),r=new ft([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},"primary",this.rootComponentType,null,this.urlTree.root,-1,{}),i=new ut(r,e),o=new gt(this.url,i);return this.inheritParamsAndData(o._root),n.of(o)}catch(t){return new n.Observable((function(e){return e.error(t)}))}},t.prototype.inheritParamsAndData=function(t){var e=this,r=t.value,n=ht(r,this.paramsInheritanceStrategy);r.params=Object.freeze(n.params),r.data=Object.freeze(n.data),t.children.forEach((function(t){return e.inheritParamsAndData(t)}))},t.prototype.processSegmentGroup=function(t,e,r){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,r)},t.prototype.processChildren=function(t,e){var r=this,n=F(e,(function(e,n){return r.processSegmentGroup(t,e,n)}));return function i(t){var e={};t.forEach((function(t){var r=e[t.value.outlet];if(r){var n=r.url.map((function(t){return t.toString()})).join("/"),i=t.value.url.map((function(t){return t.toString()})).join("/");throw new Error("Two segments cannot have the same outlet name: '"+n+"' and '"+i+"'.")}e[t.value.outlet]=t.value}))}(n),function o(t){t.sort((function(t,e){return"primary"===t.value.outlet?-1:"primary"===e.value.outlet?1:t.value.outlet.localeCompare(e.value.outlet)}))}(n),n},t.prototype.processSegment=function(t,e,r,n){var i,o;try{for(var a=u(t),s=a.next();!s.done;s=a.next()){var c=s.value;try{return this.processSegmentAgainstRoute(c,e,r,n)}catch(t){if(!(t instanceof ue))throw t}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}if(this.noLeftoversInUrl(e,r,n))return[];throw new ue},t.prototype.noLeftoversInUrl=function(t,e,r){return 0===e.length&&!t.children[r]},t.prototype.processSegmentAgainstRoute=function(t,e,r,n){if(t.redirectTo)throw new ue;if((t.outlet||"primary")!==n)throw new ue;var i,o=[],a=[];if("**"===t.path){var u=r.length>0?I(r).parameters:{};i=new ft(r,u,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,fe(t),n,t.component,t,ce(e),le(e)+r.length,ge(t))}else{var s=function c(t,e,r){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||r.length>0))throw new ue;return{consumedSegments:[],lastChild:0,parameters:{}}}var n=(e.matcher||j)(r,t,e);if(!n)throw new ue;var i={};L(n.posParams,(function(t,e){i[e]=t.path}));var o=n.consumed.length>0?Object.assign(Object.assign({},i),n.consumed[n.consumed.length-1].parameters):i;return{consumedSegments:n.consumed,lastChild:n.consumed.length,parameters:o}}(e,t,r);o=s.consumedSegments,a=r.slice(s.lastChild),i=new ft(o,s.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,fe(t),n,t.component,t,ce(e),le(e)+o.length,ge(t))}var l=function p(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),h=pe(e,o,a,l,this.relativeLinkResolution),f=h.segmentGroup,g=h.slicedSegments;if(0===g.length&&f.hasChildren()){var d=this.processChildren(l,f);return[new ut(i,d)]}if(0===l.length&&0===g.length)return[new ut(i,[])];var v=this.processSegment(l,f,g,"primary");return[new ut(i,v)]},t}();function ce(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function le(t){for(var e=t,r=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)r+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return r-1}function pe(t,e,r,n,i){if(r.length>0&&function o(t,e,r){return r.some((function(r){return he(t,e,r)&&"primary"!==Ft(r)}))}(t,r,n)){var a=new z(e,function s(t,e,r,n){var i,o,a={};a.primary=n,n._sourceSegment=t,n._segmentIndexShift=e.length;try{for(var s=u(r),c=s.next();!c.done;c=s.next()){var l=c.value;if(""===l.path&&"primary"!==Ft(l)){var p=new z([],{});p._sourceSegment=t,p._segmentIndexShift=e.length,a[Ft(l)]=p}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}(t,e,n,new z(r,t.children)));return a._sourceSegment=t,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:[]}}if(0===r.length&&function c(t,e,r){return r.some((function(r){return he(t,e,r)}))}(t,r,n)){var l=new z(t.segments,function p(t,e,r,n,i,o){var a,s,c={};try{for(var l=u(n),p=l.next();!p.done;p=l.next()){var h=p.value;if(he(t,r,h)&&!i[Ft(h)]){var f=new z([],{});f._sourceSegment=t,f._segmentIndexShift="legacy"===o?t.segments.length:e.length,c[Ft(h)]=f}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}return Object.assign(Object.assign({},i),c)}(t,e,r,n,t.children,i));return l._sourceSegment=t,l._segmentIndexShift=e.length,{segmentGroup:l,slicedSegments:r}}var h=new z(t.segments,t.children);return h._sourceSegment=t,h._segmentIndexShift=e.length,{segmentGroup:h,slicedSegments:r}}function he(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0===r.redirectTo}function fe(t){return t.data||{}}function ge(t){return t.resolve||{}}
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -105,14 +105,14 @@ var Jt=function Jt(t){this.path=t,this.route=this.path[this.path.length-1]},Xt=f
|
|
|
105
105
|
* Use of this source code is governed by an MIT-style license that can be
|
|
106
106
|
* found in the LICENSE file at https://angular.io/license
|
|
107
107
|
*/
|
|
108
|
-
function
|
|
108
|
+
function de(t){return function(e){return e.pipe(i.switchMap((function(e){var r=t(e);return r?n.from(r).pipe(i.map((function(){return e}))):n.from([e])})))}}
|
|
109
109
|
/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright Google LLC All Rights Reserved.
|
|
112
112
|
*
|
|
113
113
|
* Use of this source code is governed by an MIT-style license that can be
|
|
114
114
|
* found in the LICENSE file at https://angular.io/license
|
|
115
|
-
*/var
|
|
115
|
+
*/var ve=function ve(){},me=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(me),Se=new r.InjectionToken("ROUTES"),be=function(){function t(t,e,r,n){this.loader=t,this.compiler=e,this.onLoadStartListener=r,this.onLoadEndListener=n}return t.prototype.load=function(t,e){var r=this;return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(i.map((function(n){r.onLoadEndListener&&r.onLoadEndListener(e);var i=n.create(t);return new kt(E(i.injector.get(Se)).map(Ht),i)})))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?n.from(this.loader.load(t)):M(t()).pipe(i.mergeMap((function(t){return t instanceof r.NgModuleFactory?n.of(t):n.from(e.compiler.compileModuleAsync(t))})))},t}(),Ce=function Ce(){this.outlet=null,this.route=null,this.resolver=null,this.children=new we,this.attachRef=null},we=function(){function t(){this.contexts=new Map}return t.prototype.onChildOutletCreated=function(t,e){var r=this.getOrCreateContext(t);r.outlet=e,this.contexts.set(t,r)},t.prototype.onChildOutletDestroyed=function(t){var e=this.getContext(t);e&&(e.outlet=null)},t.prototype.onOutletDeactivated=function(){var t=this.contexts;return this.contexts=new Map,t},t.prototype.onOutletReAttached=function(t){this.contexts=t},t.prototype.getOrCreateContext=function(t){var e=this.getContext(t);return e||(e=new Ce,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),Re=function Re(){},Oe=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();
|
|
116
116
|
/**
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -120,21 +120,21 @@ function ve(t){return function(e){return e.pipe(i.switchMap((function(e){var r=t
|
|
|
120
120
|
* Use of this source code is governed by an MIT-style license that can be
|
|
121
121
|
* found in the LICENSE file at https://angular.io/license
|
|
122
122
|
*/
|
|
123
|
-
function
|
|
123
|
+
function Ue(t){throw t}function Pe(t,e,r){return e.parse("/")}function xe(t,e){return n.of(null)}var _e=function(){function t(t,e,i,o,a,u,s,c){var l=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=i,this.location=o,this.config=c,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new n.Subject,this.errorHandler=Ue,this.malformedUriErrorHandler=Pe,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:xe,afterPreactivation:xe},this.urlHandlingStrategy=new Oe,this.routeReuseStrategy=new ye,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=a.get(r.NgModuleRef),this.console=a.get(r.ɵConsole);var p=a.get(r.NgZone);this.isNgZoneEnabled=p instanceof r.NgZone,this.resetConfig(c),this.currentUrlTree=function h(){return new q(new z([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new be(u,s,(function(t){return l.triggerEvent(new b(t))}),(function(t){return l.triggerEvent(new C(t))})),this.routerState=lt(this.currentUrlTree,this.rootComponentType),this.transitions=new n.BehaviorSubject({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}return t.prototype.setupNavigations=function(t){var e=this,r=this.events;return t.pipe(i.filter((function(t){return 0!==t.id})),i.map((function(t){return Object.assign(Object.assign({},t),{extractedUrl:e.urlHandlingStrategy.extract(t.rawUrl)})})),i.switchMap((function(t){var o,a,s,c=!1,l=!1;return n.of(t).pipe(i.tap((function(t){e.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:e.lastSuccessfulNavigation?Object.assign(Object.assign({},e.lastSuccessfulNavigation),{previousNavigation:null}):null}})),i.switchMap((function(t){var o=!e.navigated||t.extractedUrl.toString()!==e.browserUrlTree.toString();if(("reload"===e.onSameUrlNavigation||o)&&e.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return n.of(t).pipe(i.switchMap((function(t){var i=e.transitions.getValue();return r.next(new p(t.id,e.serializeUrl(t.extractedUrl),t.source,t.restoredState)),i!==e.transitions.getValue()?n.EMPTY:[t]})),i.switchMap((function(t){return Promise.resolve(t)})),function a(t,e,r,n){return function(o){return o.pipe(i.switchMap((function(o){return function a(t,e,r,n,i){return new Yt(t,e,r,n,i).apply()}(t,e,r,o.extractedUrl,n).pipe(i.map((function(t){return Object.assign(Object.assign({},o),{urlAfterRedirects:t})})))})))}}(e.ngModule.injector,e.configLoader,e.urlSerializer,e.config),i.tap((function(t){e.currentNavigation=Object.assign(Object.assign({},e.currentNavigation),{finalUrl:t.urlAfterRedirects})})),function u(t,e,r,n,o){return function(a){return a.pipe(i.mergeMap((function(a){return function u(t,e,r,n,i,o){return void 0===i&&(i="emptyOnly"),void 0===o&&(o="legacy"),new se(t,e,r,n,i,o).recognize()}(t,e,a.urlAfterRedirects,r(a.urlAfterRedirects),n,o).pipe(i.map((function(t){return Object.assign(Object.assign({},a),{targetSnapshot:t})})))})))}}
|
|
124
124
|
/**
|
|
125
125
|
* @license
|
|
126
126
|
* Copyright Google LLC All Rights Reserved.
|
|
127
127
|
*
|
|
128
128
|
* Use of this source code is governed by an MIT-style license that can be
|
|
129
129
|
* found in the LICENSE file at https://angular.io/license
|
|
130
|
-
*/(e.rootComponentType,e.config,(function(t){return e.serializeUrl(t)}),e.paramsInheritanceStrategy,e.relativeLinkResolution),i.tap((function(t){"eager"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)})),i.tap((function(t){var n=new d(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);r.next(n)})));if(o&&e.rawUrlTree&&e.urlHandlingStrategy.shouldProcessUrl(e.rawUrlTree)){var s=t.extractedUrl,c=t.source,l=t.restoredState,h=t.extras,f=new p(t.id,e.serializeUrl(s),c,l);r.next(f);var g=lt(s,e.rootComponentType).snapshot;return n.of(Object.assign(Object.assign({},t),{targetSnapshot:g,urlAfterRedirects:s,extras:Object.assign(Object.assign({},h),{skipLocationChange:!1,replaceUrl:!1})}))}return e.rawUrlTree=t.rawUrl,e.browserUrlTree=t.urlAfterRedirects,t.resolve(null),n.EMPTY})),ve((function(t){var r=t.extras;return e.hooks.beforePreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!r.skipLocationChange,replaceUrl:!!r.replaceUrl})})),i.tap((function(t){var r=new v(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})),i.map((function(t){return Object.assign(Object.assign({},t),{guards:(r=t.targetSnapshot,n=t.currentSnapshot,i=e.rootContexts,o=r._root,ee(o,n?n._root:null,i,[o.value]))});var r,n,i,o})),function h(t,e){return function(r){return r.pipe(i.mergeMap((function(r){var o=r.targetSnapshot,a=r.currentSnapshot,u=r.guards,s=u.canActivateChecks,c=u.canDeactivateChecks;return 0===c.length&&0===s.length?n.of(Object.assign(Object.assign({},r),{guardsResult:!0})):function l(t,e,r,o){return n.from(t).pipe(i.mergeMap((function(t){return function a(t,e,r,o,u){var s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!s||0===s.length)return n.of(!0);var c=s.map((function(n){var a,s=te(n,e,u);if(function c(t){return t&&Et(t.canDeactivate)}(s))a=M(s.canDeactivate(t,e,r,o));else{if(!Et(s))throw new Error("Invalid CanDeactivate guard");a=M(s(t,e,r,o))}return a.pipe(i.first())}));return n.of(c).pipe(Nt())}(t.component,t.route,r,e,o)})),i.first((function(t){return!0!==t}),!0))}(c,o,a,t).pipe(i.mergeMap((function(r){return r&&function a(t){return"boolean"==typeof t}(r)?function u(t,e,r,o){return n.from(e).pipe(i.concatMap((function(e){return n.from([ie(e.route.parent,o),ne(e.route,o),ae(t,e.path,r),oe(t,e.route,r)]).pipe(i.concatAll(),i.first((function(t){return!0!==t}),!0))})),i.first((function(t){return!0!==t}),!0))}(o,s,t,e):n.of(r)})),i.map((function(t){return Object.assign(Object.assign({},r),{guardsResult:t})})))})))}}(e.ngModule.injector,(function(t){return e.triggerEvent(t)})),i.tap((function(t){if(It(t.guardsResult)){var r=A('Redirecting to "'+e.serializeUrl(t.guardsResult)+'"');throw r.url=t.guardsResult,r}})),i.tap((function(t){var r=new m(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);e.triggerEvent(r)})),i.filter((function(t){if(!t.guardsResult){e.resetUrlToCurrentUrlTree();var n=new f(t.id,e.serializeUrl(t.extractedUrl),"");return r.next(n),t.resolve(!1),!1}return!0})),ve((function(t){if(t.guards.canActivateChecks.length)return n.of(t).pipe(i.tap((function(t){var r=new y(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})),i.switchMap((function(t){var o=!1;return n.of(t).pipe(function a(t,e){return function(r){return r.pipe(i.mergeMap((function(r){var o=r.targetSnapshot,a=r.guards.canActivateChecks;if(!a.length)return n.of(r);var u=0;return n.from(a).pipe(i.concatMap((function(r){return function a(t,e,r,o){return function a(t,e,r,o){var a=Object.keys(t);if(0===a.length)return n.of({});var u={};return n.from(a).pipe(i.mergeMap((function(n){return function a(t,e,r,n){var i=te(t,e,n);return M(i.resolve?i.resolve(e,r):i(e,r))}(t[n],e,r,o).pipe(i.tap((function(t){u[n]=t})))})),i.takeLast(1),i.mergeMap((function(){return Object.keys(u).length===a.length?n.of(u):n.EMPTY})))}(t._resolve,t,e,o).pipe(i.map((function(e){return t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),ht(t,r).resolve),null})))}(r.route,o,t,e)})),i.tap((function(){return u++})),i.takeLast(1),i.mergeMap((function(t){return u===a.length?n.of(r):n.EMPTY})))})))}}(e.paramsInheritanceStrategy,e.ngModule.injector),i.tap({next:function(){return o=!0},complete:function(){if(!o){var n=new f(t.id,e.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");r.next(n),t.resolve(!1)}}}))})),i.tap((function(t){var r=new S(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})))})),ve((function(t){var r=t.extras;return e.hooks.afterPreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!r.skipLocationChange,replaceUrl:!!r.replaceUrl})})),i.map((function(t){var r=function i(t,e,r){var i=function t(e,r,i){if(i&&e.shouldReuseRoute(r.value,i.value.snapshot)){(l=i.value)._futureSnapshot=r.value;var o=function a(e,r,n){return r.children.map((function(r){var i,o;try{for(var a=u(n.children),s=a.next();!s.done;s=a.next()){var c=s.value;if(e.shouldReuseRoute(r.value,c.value.snapshot))return t(e,r,c)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return t(e,r)}))}(e,r,i);return new ut(l,o)}var s=e.retrieve(r.value);if(s){var c=s.route;return function t(e,r){if(e.value.routeConfig!==r.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==r.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");r.value._futureSnapshot=e.value;for(var n=0;n<e.children.length;++n)t(e.children[n],r.children[n])}(r,c),c}var l=function p(t){return new pt(new n.BehaviorSubject(t.url),new n.BehaviorSubject(t.params),new n.BehaviorSubject(t.queryParams),new n.BehaviorSubject(t.fragment),new n.BehaviorSubject(t.data),t.outlet,t.component,t)}(r.value);return o=r.children.map((function(r){return t(e,r)})),new ut(l,o)}(t,e._root,r?r._root:void 0);return new ct(i,e)}(e.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:r})})),i.tap((function(t){e.currentUrlTree=t.urlAfterRedirects,e.rawUrlTree=e.urlHandlingStrategy.merge(e.currentUrlTree,t.rawUrl),e.routerState=t.targetRouterState,"deferred"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(e.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)})),(o=e.rootContexts,a=e.routeReuseStrategy,s=function(t){return e.triggerEvent(t)},i.map((function(t){return new jt(a,t.targetRouterState,t.currentRouterState,s).activate(o),t}))),i.tap({next:function(){c=!0},complete:function(){c=!0}}),i.finalize((function(){if(!c&&!l){e.resetUrlToCurrentUrlTree();var n=new f(t.id,e.serializeUrl(t.extractedUrl),"Navigation ID "+t.id+" is not equal to the current navigation id "+e.navigationId);r.next(n),t.resolve(!1)}e.currentNavigation=null})),i.catchError((function(i){if(l=!0,function o(t){return t&&t.ngNavigationCancelingError}(i)){var a=It(i.url);a||(e.navigated=!0,e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));var u=new f(t.id,e.serializeUrl(t.extractedUrl),i.message);r.next(u),a?setTimeout((function(){var r=e.urlHandlingStrategy.merge(i.url,e.rawUrlTree);return e.scheduleNavigation(r,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===e.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})}),0):t.resolve(!1)}else{e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);var s=new g(t.id,e.serializeUrl(t.extractedUrl),i);r.next(s);try{t.resolve(e.errorHandler(i))}catch(e){t.reject(e)}}return n.EMPTY})))})))},t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.getTransition=function(){var t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t},t.prototype.setTransition=function(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe((function(e){var r=t.extractLocationChangeInfoFromEvent(e);t.shouldScheduleNavigation(t.lastLocationChangeInfo,r)&&setTimeout((function(){var e=r.source,n=r.state,i=r.urlTree,o={replaceUrl:!0};if(n){var a=Object.assign({},n);delete a.navigationId,0!==Object.keys(a).length&&(o.state=a)}t.scheduleNavigation(i,e,n,o)}),0),t.lastLocationChangeInfo=r})))},t.prototype.extractLocationChangeInfoFromEvent=function(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}},t.prototype.shouldScheduleNavigation=function(t,e){if(!t)return!0;var r=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&r&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!1,configurable:!0}),t.prototype.getCurrentNavigation=function(){return this.currentNavigation},t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){qt(t),this.config=t.map(Ht),this.navigated=!1,this.lastSuccessfulId=-1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)},t.prototype.createUrlTree=function(t,e){void 0===e&&(e={});var r=e.queryParams,n=e.relativeTo||this.routerState.root,i=e.preserveFragment?this.currentUrlTree.fragment:e.fragment,o=null;switch(e.queryParamsHandling){case"merge":o=Object.assign(Object.assign({},this.currentUrlTree.queryParams),r);break;case"preserve":o=this.currentUrlTree.queryParams;break;default:o=r||null}return null!==o&&(o=this.removeEmptyProps(o)),function a(t,e,r,n,i){if(0===r.length)return Ct(e.root,e.root,e,n,i);var o=function a(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new wt(!0,0,t);var e=0,r=!1,n=t.reduce((function(t,n,i){if("object"==typeof n&&null!=n){if(n.outlets){var o={};return L(n.outlets,(function(t,e){o[e]="string"==typeof t?t.split("/"):t})),c(t,[{outlets:o}])}if(n.segmentPath)return c(t,[n.segmentPath])}return"string"!=typeof n?c(t,[n]):0===i?(n.split("/").forEach((function(n,i){0==i&&"."===n||(0==i&&""===n?r=!0:".."===n?e++:""!=n&&t.push(n))})),t):c(t,[n])}),[]);return new wt(r,e,n)}(r);if(o.toRoot())return Ct(e.root,new z([],{}),e,n,i);var u=function s(t,e,r){if(t.isAbsolute)return new Rt(e.root,!0,0);if(-1===r.snapshot._lastPathIndex){var n=r.snapshot._urlSegment;return new Rt(n,n===e.root,0)}var i=St(t.commands[0])?0:1;return function o(t,e,r){for(var n=t,i=e,o=r;o>i;){if(o-=i,!(n=n.parent))throw new Error("Invalid number of '../'");i=n.segments.length}return new Rt(n,!1,i-o)}(r.snapshot._urlSegment,r.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(o,e,t),l=u.processChildren?Ut(u.segmentGroup,u.index,o.commands):Ot(u.segmentGroup,u.index,o.commands);return Ct(u.segmentGroup,l,e,n,i)}(n,this.currentUrlTree,t,o,i)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1});var r=It(t)?t:this.parseUrl(t),n=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(n,"imperative",null,e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function r(t){for(var e=0;e<t.length;e++){var r=t[e];if(null==r)throw new Error("The requested path contains "+r+" segment at index "+e)}}
|
|
130
|
+
*/(e.rootComponentType,e.config,(function(t){return e.serializeUrl(t)}),e.paramsInheritanceStrategy,e.relativeLinkResolution),i.tap((function(t){"eager"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)})),i.tap((function(t){var n=new d(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);r.next(n)})));if(o&&e.rawUrlTree&&e.urlHandlingStrategy.shouldProcessUrl(e.rawUrlTree)){var s=t.extractedUrl,c=t.source,l=t.restoredState,h=t.extras,f=new p(t.id,e.serializeUrl(s),c,l);r.next(f);var g=lt(s,e.rootComponentType).snapshot;return n.of(Object.assign(Object.assign({},t),{targetSnapshot:g,urlAfterRedirects:s,extras:Object.assign(Object.assign({},h),{skipLocationChange:!1,replaceUrl:!1})}))}return e.rawUrlTree=t.rawUrl,e.browserUrlTree=t.urlAfterRedirects,t.resolve(null),n.EMPTY})),de((function(t){var r=t.extras;return e.hooks.beforePreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!r.skipLocationChange,replaceUrl:!!r.replaceUrl})})),i.tap((function(t){var r=new v(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})),i.map((function(t){return Object.assign(Object.assign({},t),{guards:(r=t.targetSnapshot,n=t.currentSnapshot,i=e.rootContexts,o=r._root,ee(o,n?n._root:null,i,[o.value]))});var r,n,i,o})),function h(t,e){return function(r){return r.pipe(i.mergeMap((function(r){var o=r.targetSnapshot,a=r.currentSnapshot,u=r.guards,s=u.canActivateChecks,c=u.canDeactivateChecks;return 0===c.length&&0===s.length?n.of(Object.assign(Object.assign({},r),{guardsResult:!0})):function l(t,e,r,o){return n.from(t).pipe(i.mergeMap((function(t){return function a(t,e,r,o,u){var s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!s||0===s.length)return n.of(!0);var c=s.map((function(n){var a,s=te(n,e,u);if(function c(t){return t&&Et(t.canDeactivate)}(s))a=M(s.canDeactivate(t,e,r,o));else{if(!Et(s))throw new Error("Invalid CanDeactivate guard");a=M(s(t,e,r,o))}return a.pipe(i.first())}));return n.of(c).pipe(Nt())}(t.component,t.route,r,e,o)})),i.first((function(t){return!0!==t}),!0))}(c,o,a,t).pipe(i.mergeMap((function(r){return r&&function a(t){return"boolean"==typeof t}(r)?function u(t,e,r,o){return n.from(e).pipe(i.concatMap((function(e){return n.from([ie(e.route.parent,o),ne(e.route,o),ae(t,e.path,r),oe(t,e.route,r)]).pipe(i.concatAll(),i.first((function(t){return!0!==t}),!0))})),i.first((function(t){return!0!==t}),!0))}(o,s,t,e):n.of(r)})),i.map((function(t){return Object.assign(Object.assign({},r),{guardsResult:t})})))})))}}(e.ngModule.injector,(function(t){return e.triggerEvent(t)})),i.tap((function(t){if(It(t.guardsResult)){var r=A('Redirecting to "'+e.serializeUrl(t.guardsResult)+'"');throw r.url=t.guardsResult,r}})),i.tap((function(t){var r=new m(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);e.triggerEvent(r)})),i.filter((function(t){if(!t.guardsResult){e.resetUrlToCurrentUrlTree();var n=new f(t.id,e.serializeUrl(t.extractedUrl),"");return r.next(n),t.resolve(!1),!1}return!0})),de((function(t){if(t.guards.canActivateChecks.length)return n.of(t).pipe(i.tap((function(t){var r=new y(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})),i.switchMap((function(t){var o=!1;return n.of(t).pipe(function a(t,e){return function(r){return r.pipe(i.mergeMap((function(r){var o=r.targetSnapshot,a=r.guards.canActivateChecks;if(!a.length)return n.of(r);var u=0;return n.from(a).pipe(i.concatMap((function(r){return function a(t,e,r,o){return function a(t,e,r,o){var a=Object.keys(t);if(0===a.length)return n.of({});var u={};return n.from(a).pipe(i.mergeMap((function(n){return function a(t,e,r,n){var i=te(t,e,n);return M(i.resolve?i.resolve(e,r):i(e,r))}(t[n],e,r,o).pipe(i.tap((function(t){u[n]=t})))})),i.takeLast(1),i.mergeMap((function(){return Object.keys(u).length===a.length?n.of(u):n.EMPTY})))}(t._resolve,t,e,o).pipe(i.map((function(e){return t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),ht(t,r).resolve),null})))}(r.route,o,t,e)})),i.tap((function(){return u++})),i.takeLast(1),i.mergeMap((function(t){return u===a.length?n.of(r):n.EMPTY})))})))}}(e.paramsInheritanceStrategy,e.ngModule.injector),i.tap({next:function(){return o=!0},complete:function(){if(!o){var n=new f(t.id,e.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");r.next(n),t.resolve(!1)}}}))})),i.tap((function(t){var r=new S(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(r)})))})),de((function(t){var r=t.extras;return e.hooks.afterPreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!r.skipLocationChange,replaceUrl:!!r.replaceUrl})})),i.map((function(t){var r=function i(t,e,r){var i=function t(e,r,i){if(i&&e.shouldReuseRoute(r.value,i.value.snapshot)){(l=i.value)._futureSnapshot=r.value;var o=function a(e,r,n){return r.children.map((function(r){var i,o;try{for(var a=u(n.children),s=a.next();!s.done;s=a.next()){var c=s.value;if(e.shouldReuseRoute(r.value,c.value.snapshot))return t(e,r,c)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return t(e,r)}))}(e,r,i);return new ut(l,o)}var s=e.retrieve(r.value);if(s){var c=s.route;return function t(e,r){if(e.value.routeConfig!==r.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==r.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");r.value._futureSnapshot=e.value;for(var n=0;n<e.children.length;++n)t(e.children[n],r.children[n])}(r,c),c}var l=function p(t){return new pt(new n.BehaviorSubject(t.url),new n.BehaviorSubject(t.params),new n.BehaviorSubject(t.queryParams),new n.BehaviorSubject(t.fragment),new n.BehaviorSubject(t.data),t.outlet,t.component,t)}(r.value);return o=r.children.map((function(r){return t(e,r)})),new ut(l,o)}(t,e._root,r?r._root:void 0);return new ct(i,e)}(e.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:r})})),i.tap((function(t){e.currentUrlTree=t.urlAfterRedirects,e.rawUrlTree=e.urlHandlingStrategy.merge(e.currentUrlTree,t.rawUrl),e.routerState=t.targetRouterState,"deferred"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(e.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)})),(o=e.rootContexts,a=e.routeReuseStrategy,s=function(t){return e.triggerEvent(t)},i.map((function(t){return new jt(a,t.targetRouterState,t.currentRouterState,s).activate(o),t}))),i.tap({next:function(){c=!0},complete:function(){c=!0}}),i.finalize((function(){if(!c&&!l){e.resetUrlToCurrentUrlTree();var n=new f(t.id,e.serializeUrl(t.extractedUrl),"Navigation ID "+t.id+" is not equal to the current navigation id "+e.navigationId);r.next(n),t.resolve(!1)}e.currentNavigation=null})),i.catchError((function(i){if(l=!0,function o(t){return t&&t.ngNavigationCancelingError}(i)){var a=It(i.url);a||(e.navigated=!0,e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));var u=new f(t.id,e.serializeUrl(t.extractedUrl),i.message);r.next(u),a?setTimeout((function(){var r=e.urlHandlingStrategy.merge(i.url,e.rawUrlTree);return e.scheduleNavigation(r,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===e.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})}),0):t.resolve(!1)}else{e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);var s=new g(t.id,e.serializeUrl(t.extractedUrl),i);r.next(s);try{t.resolve(e.errorHandler(i))}catch(e){t.reject(e)}}return n.EMPTY})))})))},t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.getTransition=function(){var t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t},t.prototype.setTransition=function(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe((function(e){var r=t.extractLocationChangeInfoFromEvent(e);t.shouldScheduleNavigation(t.lastLocationChangeInfo,r)&&setTimeout((function(){var e=r.source,n=r.state,i=r.urlTree,o={replaceUrl:!0};if(n){var a=Object.assign({},n);delete a.navigationId,0!==Object.keys(a).length&&(o.state=a)}t.scheduleNavigation(i,e,n,o)}),0),t.lastLocationChangeInfo=r})))},t.prototype.extractLocationChangeInfoFromEvent=function(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}},t.prototype.shouldScheduleNavigation=function(t,e){if(!t)return!0;var r=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&r&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!1,configurable:!0}),t.prototype.getCurrentNavigation=function(){return this.currentNavigation},t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){qt(t),this.config=t.map(Ht),this.navigated=!1,this.lastSuccessfulId=-1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)},t.prototype.createUrlTree=function(t,e){void 0===e&&(e={});var r=e.queryParams,n=e.relativeTo||this.routerState.root,i=e.preserveFragment?this.currentUrlTree.fragment:e.fragment,o=null;switch(e.queryParamsHandling){case"merge":o=Object.assign(Object.assign({},this.currentUrlTree.queryParams),r);break;case"preserve":o=this.currentUrlTree.queryParams;break;default:o=r||null}return null!==o&&(o=this.removeEmptyProps(o)),function a(t,e,r,n,i){if(0===r.length)return Ct(e.root,e.root,e,n,i);var o=function a(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new wt(!0,0,t);var e=0,r=!1,n=t.reduce((function(t,n,i){if("object"==typeof n&&null!=n){if(n.outlets){var o={};return L(n.outlets,(function(t,e){o[e]="string"==typeof t?t.split("/"):t})),c(t,[{outlets:o}])}if(n.segmentPath)return c(t,[n.segmentPath])}return"string"!=typeof n?c(t,[n]):0===i?(n.split("/").forEach((function(n,i){0==i&&"."===n||(0==i&&""===n?r=!0:".."===n?e++:""!=n&&t.push(n))})),t):c(t,[n])}),[]);return new wt(r,e,n)}(r);if(o.toRoot())return Ct(e.root,new z([],{}),e,n,i);var u=function s(t,e,r){if(t.isAbsolute)return new Rt(e.root,!0,0);if(-1===r.snapshot._lastPathIndex){var n=r.snapshot._urlSegment;return new Rt(n,n===e.root,0)}var i=St(t.commands[0])?0:1;return function o(t,e,r){for(var n=t,i=e,o=r;o>i;){if(o-=i,!(n=n.parent))throw new Error("Invalid number of '../'");i=n.segments.length}return new Rt(n,!1,i-o)}(r.snapshot._urlSegment,r.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(o,e,t),l=u.processChildren?Ut(u.segmentGroup,u.index,o.commands):Ot(u.segmentGroup,u.index,o.commands);return Ct(u.segmentGroup,l,e,n,i)}(n,this.currentUrlTree,t,o,i)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1});var r=It(t)?t:this.parseUrl(t),n=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(n,"imperative",null,e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function r(t){for(var e=0;e<t.length;e++){var r=t[e];if(null==r)throw new Error("The requested path contains "+r+" segment at index "+e)}}
|
|
131
131
|
/**
|
|
132
132
|
* @license
|
|
133
133
|
* Copyright Google LLC All Rights Reserved.
|
|
134
134
|
*
|
|
135
135
|
* Use of this source code is governed by an MIT-style license that can be
|
|
136
136
|
* found in the LICENSE file at https://angular.io/license
|
|
137
|
-
*/(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(r){e=this.malformedUriErrorHandler(r,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(It(t))return N(this.currentUrlTree,t,e);var r=this.parseUrl(t);return N(this.currentUrlTree,r,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e[r]=n),e}),{})},t.prototype.processNavigations=function(){var t=this;this.navigations.subscribe((function(e){t.navigated=!0,t.lastSuccessfulId=e.id,t.events.next(new h(e.id,t.serializeUrl(e.extractedUrl),t.serializeUrl(t.currentUrlTree))),t.lastSuccessfulNavigation=t.currentNavigation,t.currentNavigation=null,e.resolve(!0)}),(function(e){t.console.warn("Unhandled Navigation Error: ")}))},t.prototype.scheduleNavigation=function(t,e,r,n,i){var o,a,u,s=this.getTransition(),c="imperative"!==e&&"imperative"===(null==s?void 0:s.source),l=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(c&&l)return Promise.resolve(!0);i?(o=i.resolve,a=i.reject,u=i.promise):u=new Promise((function(t,e){o=t,a=e}));var p=++this.navigationId;return this.setTransition({id:p,source:e,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:n,resolve:o,reject:a,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch((function(t){return Promise.reject(t)}))},t.prototype.setBrowserUrl=function(t,e,r,n){var i=this.urlSerializer.serialize(t);n=n||{},this.location.isCurrentPathEqualTo(i)||e?this.location.replaceState(i,"",Object.assign(Object.assign({},n),{navigationId:r})):this.location.go(i,"",Object.assign(Object.assign({},n),{navigationId:r}))},t.prototype.resetStateAndUrl=function(t,e,r){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}();
|
|
137
|
+
*/(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(r){e=this.malformedUriErrorHandler(r,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(It(t))return N(this.currentUrlTree,t,e);var r=this.parseUrl(t);return N(this.currentUrlTree,r,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e[r]=n),e}),{})},t.prototype.processNavigations=function(){var t=this;this.navigations.subscribe((function(e){t.navigated=!0,t.lastSuccessfulId=e.id,t.events.next(new h(e.id,t.serializeUrl(e.extractedUrl),t.serializeUrl(t.currentUrlTree))),t.lastSuccessfulNavigation=t.currentNavigation,t.currentNavigation=null,e.resolve(!0)}),(function(e){t.console.warn("Unhandled Navigation Error: ")}))},t.prototype.scheduleNavigation=function(t,e,r,n,i){var o,a,u,s=this.getTransition(),c="imperative"!==e&&"imperative"===(null==s?void 0:s.source),l=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(c&&l)return Promise.resolve(!0);i?(o=i.resolve,a=i.reject,u=i.promise):u=new Promise((function(t,e){o=t,a=e}));var p=++this.navigationId;return this.setTransition({id:p,source:e,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:n,resolve:o,reject:a,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch((function(t){return Promise.reject(t)}))},t.prototype.setBrowserUrl=function(t,e,r,n){var i=this.urlSerializer.serialize(t);n=n||{},this.location.isCurrentPathEqualTo(i)||e?this.location.replaceState(i,"",Object.assign(Object.assign({},n),{navigationId:r})):this.location.go(i,"",Object.assign(Object.assign({},n),{navigationId:r}))},t.prototype.resetStateAndUrl=function(t,e,r){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}();_e.decorators=[{type:r.Injectable}],_e.ctorParameters=function(){return[{type:r.Type},{type:G},{type:we},{type:e.Location},{type:r.Injector},{type:r.NgModuleFactoryLoader},{type:r.Compiler},{type:void 0}]};var Ae=function(){function t(t,e,r,i,o){this.router=t,this.route=e,this.commands=[],this.onChanges=new n.Subject,null==r&&i.setAttribute(o.nativeElement,"tabindex","0")}return t.prototype.ngOnChanges=function(t){this.onChanges.next(this)},Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!1,configurable:!0}),t.prototype.onClick=function(){var t={skipLocationChange:Te(this.skipLocationChange),replaceUrl:Te(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Te(this.preserveFragment)})},enumerable:!1,configurable:!0}),t}();Ae.decorators=[{type:r.Directive,args:[{selector:":not(a):not(area)[routerLink]"}]}],Ae.ctorParameters=function(){return[{type:_e},{type:pt},{type:String,decorators:[{type:r.Attribute,args:["tabindex"]}]},{type:r.Renderer2},{type:r.ElementRef}]},Ae.propDecorators={queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],state:[{type:r.Input}],routerLink:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click"]}]};var je=function(){function t(t,e,r){var i=this;this.router=t,this.route=e,this.locationStrategy=r,this.commands=[],this.onChanges=new n.Subject,this.subscription=t.events.subscribe((function(t){t instanceof h&&i.updateTargetUrlAndHref()}))}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(t){this.updateTargetUrlAndHref(),this.onChanges.next(this)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onClick=function(t,e,r,n,i){if(0!==t||e||r||n||i)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var o={skipLocationChange:Te(this.skipLocationChange),replaceUrl:Te(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,o),!1},t.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Te(this.preserveFragment)})},enumerable:!1,configurable:!0}),t}();function Te(t){return""===t||!!t}je.decorators=[{type:r.Directive,args:[{selector:"a[routerLink],area[routerLink]"}]}],je.ctorParameters=function(){return[{type:_e},{type:pt},{type:e.LocationStrategy}]},je.propDecorators={target:[{type:r.HostBinding,args:["attr.target"]},{type:r.Input}],queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],state:[{type:r.Input}],href:[{type:r.HostBinding}],routerLink:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.shiftKey","$event.altKey","$event.metaKey"]]}]};var ke=function(){function t(t,e,r,n,i,o){var a=this;this.router=t,this.element=e,this.renderer=r,this.cdr=n,this.link=i,this.linkWithHref=o,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=t.events.subscribe((function(t){t instanceof h&&a.update()}))}return t.prototype.ngAfterContentInit=function(){var t=this;n.from([this.links.changes,this.linksWithHrefs.changes,n.of(null)]).pipe(i.mergeAll()).subscribe((function(e){t.update(),t.subscribeToEachLinkOnChanges()}))},t.prototype.subscribeToEachLinkOnChanges=function(){var t,e=this;null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe();var r=c(this.links.toArray(),this.linksWithHrefs.toArray(),[this.link,this.linkWithHref]).filter((function(t){return!!t})).map((function(t){return t.onChanges}));this.linkInputChangesSubscription=n.from(r).pipe(i.mergeAll()).subscribe((function(t){e.isActive!==e.isLinkActive(e.router)(t)&&e.update()}))},Object.defineProperty(t.prototype,"routerLinkActive",{set:function(t){var e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter((function(t){return!!t}))},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnDestroy=function(){var t;this.routerEventsSubscription.unsubscribe(),null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe()},t.prototype.update=function(){var t=this;this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then((function(){var e=t.hasActiveLinks();t.isActive!==e&&(t.isActive=e,t.cdr.markForCheck(),t.classes.forEach((function(r){e?t.renderer.addClass(t.element.nativeElement,r):t.renderer.removeClass(t.element.nativeElement,r)})))}))},t.prototype.isLinkActive=function(t){var e=this;return function(r){return t.isActive(r.urlTree,e.routerLinkActiveOptions.exact)}},t.prototype.hasActiveLinks=function(){var t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.linkWithHref&&t(this.linkWithHref)||this.links.some(t)||this.linksWithHrefs.some(t)},t}();ke.decorators=[{type:r.Directive,args:[{selector:"[routerLinkActive]",exportAs:"routerLinkActive"}]}],ke.ctorParameters=function(){return[{type:_e},{type:r.ElementRef},{type:r.Renderer2},{type:r.ChangeDetectorRef},{type:Ae,decorators:[{type:r.Optional}]},{type:je,decorators:[{type:r.Optional}]}]},ke.propDecorators={links:[{type:r.ContentChildren,args:[Ae,{descendants:!0}]}],linksWithHrefs:[{type:r.ContentChildren,args:[je,{descendants:!0}]}],routerLinkActiveOptions:[{type:r.Input}],routerLinkActive:[{type:r.Input}]};
|
|
138
138
|
/**
|
|
139
139
|
* @license
|
|
140
140
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -142,7 +142,7 @@ function Pe(t){throw t}function xe(t,e,r){return e.parse("/")}function _e(t,e){r
|
|
|
142
142
|
* Use of this source code is governed by an MIT-style license that can be
|
|
143
143
|
* found in the LICENSE file at https://angular.io/license
|
|
144
144
|
*/
|
|
145
|
-
var
|
|
145
|
+
var Ee=function(){function t(t,e,n,i,o){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=o,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.EventEmitter,this.deactivateEvents=new r.EventEmitter,this.name=i||"primary",t.onChildOutletCreated(this.name,this)}return t.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},t.prototype.ngOnInit=function(){if(!this.activated){var t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!1,configurable:!0}),t.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var t=this.activated;return this.activated=null,this._activatedRoute=null,t},t.prototype.attach=function(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)},t.prototype.deactivate=function(){if(this.activated){var t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}},t.prototype.activateWith=function(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var r=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),n=this.parentContexts.getOrCreateContext(this.name).children,i=new Ie(t,n,this.location.injector);this.activated=this.location.createComponent(r,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},t}();Ee.decorators=[{type:r.Directive,args:[{selector:"router-outlet",exportAs:"outlet"}]}],Ee.ctorParameters=function(){return[{type:we},{type:r.ViewContainerRef},{type:r.ComponentFactoryResolver},{type:String,decorators:[{type:r.Attribute,args:["name"]}]},{type:r.ChangeDetectorRef}]},Ee.propDecorators={activateEvents:[{type:r.Output,args:["activate"]}],deactivateEvents:[{type:r.Output,args:["deactivate"]}]};var Ie=function(){function t(t,e,r){this.route=t,this.childContexts=e,this.parent=r}return t.prototype.get=function(t,e){return t===pt?this.route:t===we?this.childContexts:this.parent.get(t,e)},t}(),Le=function Le(){},Me=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(i.catchError((function(){return n.of(null)})))},t}(),Ne=function(){function t(){}return t.prototype.preload=function(t,e){return n.of(null)},t}(),qe=function(){function t(t,e,r,n,i){this.router=t,this.injector=n,this.preloadingStrategy=i,this.loader=new be(e,r,(function(e){return t.triggerEvent(new b(e))}),(function(e){return t.triggerEvent(new C(e))}))}return t.prototype.setUpPreloading=function(){var t=this;this.subscription=this.router.events.pipe(i.filter((function(t){return t instanceof h})),i.concatMap((function(){return t.preload()}))).subscribe((function(){}))},t.prototype.preload=function(){var t=this.injector.get(r.NgModuleRef);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){var r,o,a=[];try{for(var s=u(e),c=s.next();!c.done;c=s.next()){var l=c.value;if(l.loadChildren&&!l.canLoad&&l._loadedConfig){var p=l._loadedConfig;a.push(this.processRoutes(p.module,p.routes))}else l.loadChildren&&!l.canLoad?a.push(this.preloadConfig(t,l)):l.children&&a.push(this.processRoutes(t,l.children))}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return n.from(a).pipe(i.mergeAll(),i.map((function(t){})))},t.prototype.preloadConfig=function(t,e){var r=this;return this.preloadingStrategy.preload(e,(function(){return r.loader.load(t.injector,e).pipe(i.mergeMap((function(t){return e._loadedConfig=t,r.processRoutes(t.module,t.routes)})))}))},t}();qe.decorators=[{type:r.Injectable}],qe.ctorParameters=function(){return[{type:_e},{type:r.NgModuleFactoryLoader},{type:r.Compiler},{type:r.Injector},{type:Le}]};
|
|
146
146
|
/**
|
|
147
147
|
* @license
|
|
148
148
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -150,7 +150,7 @@ var Ie=function(){function t(t,e,n,i,o){this.parentContexts=t,this.location=e,th
|
|
|
150
150
|
* Use of this source code is governed by an MIT-style license that can be
|
|
151
151
|
* found in the LICENSE file at https://angular.io/license
|
|
152
152
|
*/
|
|
153
|
-
var
|
|
153
|
+
var ze=function(){function t(t,e,r){void 0===r&&(r={}),this.router=t,this.viewportScroller=e,this.options=r,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},r.scrollPositionRestoration=r.scrollPositionRestoration||"disabled",r.anchorScrolling=r.anchorScrolling||"disabled"}return t.prototype.init=function(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()},t.prototype.createScrollEvents=function(){var t=this;return this.router.events.subscribe((function(e){e instanceof p?(t.store[t.lastId]=t.viewportScroller.getScrollPosition(),t.lastSource=e.navigationTrigger,t.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof h&&(t.lastId=e.id,t.scheduleScrollEvent(e,t.router.parseUrl(e.urlAfterRedirects).fragment))}))},t.prototype.consumeScrollEvents=function(){var t=this;return this.router.events.subscribe((function(e){e instanceof P&&(e.position?"top"===t.options.scrollPositionRestoration?t.viewportScroller.scrollToPosition([0,0]):"enabled"===t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===t.options.anchorScrolling?t.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition([0,0]))}))},t.prototype.scheduleScrollEvent=function(t,e){this.router.triggerEvent(new P(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))},t.prototype.ngOnDestroy=function(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()},t}();ze.decorators=[{type:r.Injectable}],ze.ctorParameters=function(){return[{type:_e},{type:e.ViewportScroller},{type:void 0}]};
|
|
154
154
|
/**
|
|
155
155
|
* @license
|
|
156
156
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -158,14 +158,14 @@ var De=function(){function t(t,e,r){void 0===r&&(r={}),this.router=t,this.viewpo
|
|
|
158
158
|
* Use of this source code is governed by an MIT-style license that can be
|
|
159
159
|
* found in the LICENSE file at https://angular.io/license
|
|
160
160
|
*/
|
|
161
|
-
var
|
|
161
|
+
var De=[Ee,Ae,je,ke,Lt],He=new r.InjectionToken("ROUTER_CONFIGURATION"),Fe=new r.InjectionToken("ROUTER_FORROOT_GUARD"),Ge=[e.Location,{provide:G,useClass:W},{provide:_e,useFactory:$e,deps:[G,we,e.Location,r.Injector,r.NgModuleFactoryLoader,r.Compiler,Se,He,[Re,new r.Optional],[ve,new r.Optional]]},we,{provide:pt,useFactory:Je,deps:[_e]},{provide:r.NgModuleFactoryLoader,useClass:r.SystemJsNgModuleLoader},qe,Ne,Me,{provide:He,useValue:{enableTracing:!1}}];function We(){return new r.NgProbeToken("Router",_e)}var Be=function(){function t(t,e){}return t.forRoot=function(n,i){return{ngModule:t,providers:[Ge,Ze(n),{provide:Fe,useFactory:Ye,deps:[[_e,new r.Optional,new r.SkipSelf]]},{provide:He,useValue:i||{}},{provide:e.LocationStrategy,useFactory:Qe,deps:[e.PlatformLocation,[new r.Inject(e.APP_BASE_HREF),new r.Optional],He]},{provide:ze,useFactory:Ve,deps:[_e,e.ViewportScroller,He]},{provide:Le,useExisting:i&&i.preloadingStrategy?i.preloadingStrategy:Ne},{provide:r.NgProbeToken,multi:!0,useFactory:We},nr()]}},t.forChild=function(e){return{ngModule:t,providers:[Ze(e)]}},t}();function Ve(t,e,r){return r.scrollOffset&&e.setOffset(r.scrollOffset),new ze(t,e,r)}function Qe(t,r,n){return void 0===n&&(n={}),n.useHash?new e.HashLocationStrategy(t,r):new e.PathLocationStrategy(t,r)}function Ye(t){return"guarded"}function Ze(t){return[{provide:r.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:t},{provide:Se,multi:!0,useValue:t}]}function $e(t,r,n,i,o,a,u,s,c,l){void 0===s&&(s={});var p=new _e(null,t,r,n,i,o,a,E(u));if(c&&(p.urlHandlingStrategy=c),l&&(p.routeReuseStrategy=l),Ke(s,p),s.enableTracing){var h=e.ɵgetDOM();p.events.subscribe((function(t){h.logGroup("Router Event: "+t.constructor.name),h.log(t.toString()),h.log(t),h.logGroupEnd()}))}return p}function Ke(t,e){t.errorHandler&&(e.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(e.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(e.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(e.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(e.urlUpdateStrategy=t.urlUpdateStrategy)}function Je(t){return t.routerState.root}Be.decorators=[{type:r.NgModule,args:[{declarations:De,exports:De,entryComponents:[Lt]}]}],Be.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[Fe]}]},{type:_e,decorators:[{type:r.Optional}]}]};var Xe=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new n.Subject}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(e.LOCATION_INITIALIZED,Promise.resolve(null)).then((function(){var e=null,r=new Promise((function(t){return e=t})),i=t.injector.get(_e),o=t.injector.get(He);return"disabled"===o.initialNavigation?(i.setUpLocationChangeListener(),e(!0)):"enabled"===o.initialNavigation||"enabledBlocking"===o.initialNavigation?(i.hooks.afterPreactivation=function(){return t.initNavigation?n.of(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},i.initialNavigation()):e(!0),r}))},t.prototype.bootstrapListener=function(t){var e=this.injector.get(He),n=this.injector.get(qe),i=this.injector.get(ze),o=this.injector.get(_e),a=this.injector.get(r.ApplicationRef);t===a.components[0]&&("enabledNonBlocking"!==e.initialNavigation&&void 0!==e.initialNavigation||o.initialNavigation(),n.setUpPreloading(),i.init(),o.resetRootComponentType(a.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},t}();function tr(t){return t.appInitializer.bind(t)}function er(t){return t.bootstrapListener.bind(t)}Xe.decorators=[{type:r.Injectable}],Xe.ctorParameters=function(){return[{type:r.Injector}]};var rr=new r.InjectionToken("Router Initializer");function nr(){return[Xe,{provide:r.APP_INITIALIZER,multi:!0,useFactory:tr,deps:[Xe]},{provide:rr,useFactory:er,deps:[Xe]},{provide:r.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:rr}]}
|
|
162
162
|
/**
|
|
163
163
|
* @license
|
|
164
164
|
* Copyright Google LLC All Rights Reserved.
|
|
165
165
|
*
|
|
166
166
|
* Use of this source code is governed by an MIT-style license that can be
|
|
167
167
|
* found in the LICENSE file at https://angular.io/license
|
|
168
|
-
*/var
|
|
168
|
+
*/var ir=new r.Version("11.0.3");
|
|
169
169
|
/**
|
|
170
170
|
* @license
|
|
171
171
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -193,4 +193,4 @@ var He=[Ie,je,Te,Ee,Lt],Fe=new r.InjectionToken("ROUTER_CONFIGURATION"),Ge=new r
|
|
|
193
193
|
*
|
|
194
194
|
* Use of this source code is governed by an MIT-style license that can be
|
|
195
195
|
* found in the LICENSE file at https://angular.io/license
|
|
196
|
-
*/t.ActivatedRoute=pt,t.ActivatedRouteSnapshot=ft,t.ActivationEnd=U,t.ActivationStart=O,t.BaseRouteReuseStrategy=
|
|
196
|
+
*/t.ActivatedRoute=pt,t.ActivatedRouteSnapshot=ft,t.ActivationEnd=U,t.ActivationStart=O,t.BaseRouteReuseStrategy=me,t.ChildActivationEnd=R,t.ChildActivationStart=w,t.ChildrenOutletContexts=we,t.DefaultUrlSerializer=W,t.GuardsCheckEnd=m,t.GuardsCheckStart=v,t.NavigationCancel=f,t.NavigationEnd=h,t.NavigationError=g,t.NavigationStart=p,t.NoPreloading=Ne,t.OutletContext=Ce,t.PRIMARY_OUTLET="primary",t.PreloadAllModules=Me,t.PreloadingStrategy=Le,t.ROUTER_CONFIGURATION=He,t.ROUTER_INITIALIZER=rr,t.ROUTES=Se,t.ResolveEnd=S,t.ResolveStart=y,t.RouteConfigLoadEnd=C,t.RouteConfigLoadStart=b,t.RouteReuseStrategy=ve,t.Router=_e,t.RouterEvent=l,t.RouterLink=Ae,t.RouterLinkActive=ke,t.RouterLinkWithHref=je,t.RouterModule=Be,t.RouterOutlet=Ee,t.RouterPreloader=qe,t.RouterState=ct,t.RouterStateSnapshot=gt,t.RoutesRecognized=d,t.Scroll=P,t.UrlHandlingStrategy=Re,t.UrlSegment=D,t.UrlSegmentGroup=z,t.UrlSerializer=G,t.UrlTree=q,t.VERSION=ir,t.convertToParamMap=_,t.provideRoutes=Ze,t.ɵEmptyOutletComponent=Lt,t.ɵROUTER_PROVIDERS=Ge,t.ɵangular_packages_router_router_a=Fe,t.ɵangular_packages_router_router_b=We,t.ɵangular_packages_router_router_c=Ve,t.ɵangular_packages_router_router_d=Qe,t.ɵangular_packages_router_router_e=Ye,t.ɵangular_packages_router_router_f=$e,t.ɵangular_packages_router_router_g=Je,t.ɵangular_packages_router_router_h=Xe,t.ɵangular_packages_router_router_i=tr,t.ɵangular_packages_router_router_j=er,t.ɵangular_packages_router_router_k=nr,t.ɵangular_packages_router_router_l=Lt,t.ɵangular_packages_router_router_m=it,t.ɵangular_packages_router_router_n=ut,t.ɵangular_packages_router_router_o=ze,t.ɵassignExtraOptionsToRouter=Ke,t.ɵflatten=E,Object.defineProperty(t,"__esModule",{value:!0})}));
|