diff --git a/bundles/specmate-integration-test/bnd.bnd b/bundles/specmate-integration-test/bnd.bnd index 6c943ba08..24072b6b5 100644 --- a/bundles/specmate-integration-test/bnd.bnd +++ b/bundles/specmate-integration-test/bnd.bnd @@ -1,4 +1,7 @@ -Test-Cases: com.specmate.test.integration.EmfRestTest +Test-Cases: \ + com.specmate.test.integration.CrudTest,\ + com.specmate.test.integration.SearchTest,\ + com.specmate.test.integration.HistoryTest -buildpath: \ biz.aQute.launcher,\ specmate-persistency-api;version=latest,\ diff --git a/bundles/specmate-integration-test/src/com/specmate/test/integration/CrudTest.java b/bundles/specmate-integration-test/src/com/specmate/test/integration/CrudTest.java new file mode 100644 index 000000000..edd1bc870 --- /dev/null +++ b/bundles/specmate-integration-test/src/com/specmate/test/integration/CrudTest.java @@ -0,0 +1,345 @@ +package com.specmate.test.integration; + +import javax.ws.rs.core.Response.Status; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.osgi.service.log.LogService; + +import com.specmate.common.RestResult; +import com.specmate.common.SpecmateException; +import com.specmate.model.base.BasePackage; + +public class CrudTest extends EmfRestTest { + + public CrudTest() throws Exception {} + + /** + * Tests posting a folder to the root. Checks, if the return code of the + * post request is OK and if retrieving the object again returns the + * original object. + */ + @Test + public void testPostFolderToRootAndRetrieve() { + String postUrl = listUrl(); + JSONObject folder = createTestFolder(); + logService.log(LogService.LOG_DEBUG, "Posting the object " + folder.toString() + " to url " + postUrl); + RestResult result = restClient.post(postUrl, folder); + Assert.assertEquals(result.getResponse().getStatus(), Status.OK.getStatusCode()); + + String retrieveUrl = detailUrl(getId(folder)); + RestResult getResult = restClient.get(retrieveUrl); + JSONObject retrievedFolder = getResult.getPayload(); + logService.log(LogService.LOG_DEBUG, + "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); + Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); + } + + /** + * Tests posting a folder that contains special characters in its name. + * Checks, if the return code of the post request is OK and if retrieving + * the object again returns the original object. + */ + @Test + public void testPostFolderWithSpecialChars() { + String postUrl = listUrl(); + JSONObject folder = createTestFolder("TestFolder", "äöüߧ$% &=?!/\\^_:.,#'+~*(){}[]"); + logService.log(LogService.LOG_DEBUG, "Posting the object " + folder.toString() + " to url " + postUrl); + RestResult result = restClient.post(postUrl, folder); + Assert.assertEquals(result.getResponse().getStatus(), Status.OK.getStatusCode()); + + String retrieveUrl = detailUrl(getId(folder)); + RestResult getResult = restClient.get(retrieveUrl); + JSONObject retrievedFolder = getResult.getPayload(); + logService.log(LogService.LOG_DEBUG, + "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); + Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); + } + + /** + * Tests posting a folder to another folder. Checks, if the return code of + * the post request is OK and if retrieving the object again returns the + * original object. + */ + @Test + public void testPostFolderToFolderAndRetrieve() { + JSONObject folder = postFolderToRoot(); + String folderName = getId(folder); + + String postUrl2 = listUrl(folderName); + JSONObject folder2 = createTestFolder(); + String folderName2 = getId(folder2); + logService.log(LogService.LOG_DEBUG, "Posting the object " + folder2.toString() + " to url " + postUrl2); + RestResult result2 = restClient.post(postUrl2, folder2); + Assert.assertEquals(result2.getResponse().getStatus(), Status.OK.getStatusCode()); + + String retrieveUrl = detailUrl(folderName, folderName2); + RestResult getResult = restClient.get(retrieveUrl); + JSONObject retrievedFolder = getResult.getPayload(); + logService.log(LogService.LOG_DEBUG, + "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); + Assert.assertTrue(EmfRestTestUtil.compare(retrievedFolder, folder2, true)); + } + + /** Tests if retrieving a non-existing object returns 404-Not found */ + @Test + public void testMissingFolder() { + // Create new folder just to get a fresh name + JSONObject folder = createTestFolder(); + String folderName = getId(folder); + + // Not posting to backend instead try to retrieve + String retrieveUrl = detailUrl(folderName); + RestResult getResult = restClient.get(retrieveUrl); + + Assert.assertEquals(Status.NOT_FOUND.getStatusCode(), getResult.getResponse().getStatus()); + + } + + /** Tests retrieving a list of child folders from a folder */ + @Test + public void testRetrieveChildrenList() { + int numberOfChildren = 2; + + JSONObject folder = postFolderToRoot(); + String folderName = getId(folder); + + String postUrl2 = listUrl(folderName); + JSONObject[] folders = new JSONObject[2]; + for (int i = 0; i < numberOfChildren; i++) { + folders[i] = createTestFolder(); + logService.log(LogService.LOG_DEBUG, "Posting the object " + folders[i].toString() + " to url " + postUrl2); + RestResult result2 = restClient.post(postUrl2, folders[i]); + Assert.assertEquals(result2.getResponse().getStatus(), Status.OK.getStatusCode()); + } + + RestResult listResult = restClient.getList(postUrl2); + JSONArray childrenList = listResult.getPayload(); + logService.log(LogService.LOG_DEBUG, "Retrieved the list " + childrenList.toString() + " from url " + postUrl2); + Assert.assertEquals(2, childrenList.length()); + for (int i = 0; i < numberOfChildren; i++) { + Assert.assertTrue(EmfRestTestUtil.compare(folders[i], childrenList.getJSONObject(i), true)); + } + + } + + /** Tests if an empty folder can be deleted */ + @Test + public void testDeleteEmptyFolder() { + JSONObject folder = postFolderToRoot(); + String folderName = getId(folder); + getObject(folderName); + + deleteObject(folderName); + + // Check if folder still exists + getObject(Status.NOT_FOUND.getStatusCode(), folderName); + } + + /** Tests if a non-empty folder can be deleted */ + @Test + public void testDeleteNonEmptyFolder() { + // Post folder to root + JSONObject outerFolder = postFolderToRoot(); + String folderName = getId(outerFolder); + + // Post folder in new folder + postFolder(folderName); + + // Check if top level folder exists + getObject(folderName); + + // Delete top level folder + deleteObject(folderName); + + // Check if top level folder still exists + getObject(Status.NOT_FOUND.getStatusCode(), folderName); + } + + /** + * Tests posting a requirement to a folder. Checks, if the return code of + * the post request is OK and if retrieving the requirement again returns + * the original object. + */ + @Test + public void testPostRequirementToFolderAndRetrieve() { + JSONObject folder = postFolderToRoot(); + String folderName = getId(folder); + + JSONObject requirement = postRequirement(folderName); + String requirementName = getId(requirement); + + getObject(folderName, requirementName); + } + + @Test + public void testUpdateFolder() { + JSONObject folder = postFolderToRoot(); + String folderName = getId(folder); + + folder.put(BasePackage.Literals.INAMED__NAME.getName(), "New Name"); + updateObject(folder, folderName); + + JSONObject retrievedFolder = getObject(folderName); + Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); + } + + @Test + public void testPostCEGToRequirement() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + JSONObject retrievedCEG = getObject(requirementId, cegId); + Assert.assertTrue(EmfRestTestUtil.compare(retrievedCEG, cegModel, true)); + } + + @Test + public void testPostCEGNodesAndConnectionToCEG() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + // post ceg + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + // post node 1 + JSONObject cegNode1 = postCEGNode(requirementId, cegId); + String node1Id = getId(cegNode1); + + JSONObject retrievedCegNode1 = getObject(requirementId, cegId, node1Id); + Assert.assertTrue(EmfRestTestUtil.compare(cegNode1, retrievedCegNode1, true)); + + // post node 2 + JSONObject cegNode2 = postCEGNode(requirementId, cegId); + String node2Id = getId(cegNode2); + + JSONObject retrievedCegNode2 = getObject(requirementId, cegId, node2Id); + Assert.assertTrue(EmfRestTestUtil.compare(cegNode2, retrievedCegNode2, true)); + + // post connection + JSONObject connection = postCEGConnection(retrievedCegNode1, retrievedCegNode2, requirementId, cegId); + String connectionId = getId(connection); + + JSONObject retrievedConnection = getObject(requirementId, cegId, connectionId); + Assert.assertTrue(EmfRestTestUtil.compare(retrievedConnection, connection, true)); + } + + @Test + public void testPostFolderWithNoId() { + JSONObject folder = createTestFolder(); + folder.remove(ID_KEY); + + postObject(Status.BAD_REQUEST.getStatusCode(), folder); + } + + @Test + public void testPostFolderWithDuplicateId() { + JSONObject folder = postFolderToRoot(); + postObject(Status.BAD_REQUEST.getStatusCode(), folder); + } + + @Test + public void testPostFolderWithIllegalId() { + JSONObject folder = createTestFolder(); + folder.put(ID_KEY, "id with spaces"); + postObject(Status.BAD_REQUEST.getStatusCode(), folder); + } + + @Test + public void testPostTestSpecification() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + // Post ceg model + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + // Post test specification + JSONObject testSpecification = postTestSpecification(requirementId, cegId); + String testSpecId = getId(testSpecification); + + JSONObject retrievedTestSpecification = getObject(requirementId, cegId, testSpecId); + Assert.assertTrue(EmfRestTestUtil.compare(retrievedTestSpecification, testSpecification, true)); + } + + @Test + public void testGenerateTests() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + // Post ceg model + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + // post node 1 + JSONObject cegNode1 = postCEGNode(requirementId, cegId); + String cegNode1Id = getId(cegNode1); + JSONObject retrievedCegNode1 = getObject(requirementId, cegId, cegNode1Id); + + // post node 2 + JSONObject cegNode2 = postCEGNode(requirementId, cegId); + String cegNode2Id = getId(cegNode2); + JSONObject retrievedCegNode2 = getObject(requirementId, cegId, cegNode2Id); + + // post connection + postCEGConnection(retrievedCegNode1, retrievedCegNode2, requirementId, cegId); + + // Post test specification + JSONObject testSpec = postTestSpecification(requirementId, cegId); + String testSpecId = getId(testSpec); + + // Generate test cases + String generateUrl = buildUrl("generateTests", requirementId, cegId, testSpecId); + logService.log(LogService.LOG_DEBUG, "Request test genreation at url " + generateUrl); + RestResult result = restClient.post(generateUrl, null); + Assert.assertEquals(Status.NO_CONTENT.getStatusCode(), result.getResponse().getStatus()); + + String retrieveUrl = listUrl(requirementId, cegId, testSpecId); + RestResult getResult = restClient.getList(retrieveUrl); + JSONArray retrievedTestChilds = getResult.getPayload(); + logService.log(LogService.LOG_DEBUG, + "Retrieved the object " + retrievedTestChilds.toString() + " from url " + retrieveUrl); + + // Expect 4 children: two test cases and two test parameters + Assert.assertEquals(4, retrievedTestChilds.length()); + } + + /** + * Posts two test specifications to a CEG model and checks if they are + * retrieved by the list recursive service. + */ + @Test + public void testGetListRecursive() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + // Post ceg model + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + // Post test specification + JSONObject testSpecification = postTestSpecification(requirementId, cegId); + + // Post second test specification + JSONObject testSpecification2 = postTestSpecification(requirementId, cegId); + + // Perform recursive list call + String listUrl = buildUrl("listRecursive", requirementId); + RestResult listResult = restClient.getList(listUrl, "class", "TestSpecification"); + Assert.assertEquals(Status.OK.getStatusCode(), listResult.getResponse().getStatus()); + JSONArray retrievedTestSpecifications = listResult.getPayload(); + logService.log(LogService.LOG_DEBUG, + "Retrieved the object " + retrievedTestSpecifications.toString() + " from url " + listUrl); + Assert.assertEquals(2, retrievedTestSpecifications.length()); + Assert.assertTrue( + EmfRestTestUtil.compare(retrievedTestSpecifications.getJSONObject(0), testSpecification, true)); + Assert.assertTrue( + EmfRestTestUtil.compare(retrievedTestSpecifications.getJSONObject(1), testSpecification2, true)); + } +} diff --git a/bundles/specmate-integration-test/src/com/specmate/test/integration/EmfRestTest.java b/bundles/specmate-integration-test/src/com/specmate/test/integration/EmfRestTest.java index 67375c8c4..391cfe336 100644 --- a/bundles/specmate-integration-test/src/com/specmate/test/integration/EmfRestTest.java +++ b/bundles/specmate-integration-test/src/com/specmate/test/integration/EmfRestTest.java @@ -2,12 +2,8 @@ import javax.ws.rs.core.Response.Status; -import org.json.JSONArray; import org.json.JSONObject; import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.osgi.service.log.LogService; @@ -24,50 +20,41 @@ import com.specmate.persistency.IPersistencyService; import com.specmate.persistency.ITransaction; import com.specmate.persistency.IView; -import com.specmate.search.api.IModelSearchService; -public class EmfRestTest { - - private static final String ID_KEY = "id"; - private static final String NSURI_KEY = EMFJsonSerializer.KEY_NSURI; - private static final String ECLASS = EMFJsonSerializer.KEY_ECLASS; - private static BundleContext context; - private static IPersistencyService persistency; - private static IModelSearchService searchService; - - protected static IView view; - - protected static int counter = 0; - protected static LogService logService; - private static RestClient restClient; - - @BeforeClass - public static void init() throws Exception { - context = FrameworkUtil.getBundle(EmfRestTest.class).getBundleContext(); - persistency = getPersistencyService(); - searchService = getSearchService(); - view = persistency.openView(); - logService = getLogger(); - restClient = new RestClient("http://localhost:8088/services/rest", logService); +public abstract class EmfRestTest { + static final String ID_KEY = "id"; + static final String REST_ENDPOINT = "http://localhost:8088/services/rest"; + static final String NSURI_KEY = EMFJsonSerializer.KEY_NSURI; + static final String ECLASS = EMFJsonSerializer.KEY_ECLASS; + static BundleContext context; + static IPersistencyService persistency; + static IView view; + static LogService logService; + static RestClient restClient; + private static int counter = 0; + + public EmfRestTest() throws Exception { + if(context == null) { + context = FrameworkUtil.getBundle(EmfRestTest.class).getBundleContext(); + } + if(persistency == null) { + persistency = getPersistencyService(); + } + if(view == null) { + view = persistency.openView(); + } + if(logService == null) { + logService = getLogger(); + } + if(restClient == null) { + restClient = new RestClient(REST_ENDPOINT, logService); + } + Thread.sleep(2000); - } - - private static IModelSearchService getSearchService() throws InterruptedException { - ServiceTracker searchServiceTracker = new ServiceTracker<>(context, - IModelSearchService.class.getName(), null); - searchServiceTracker.open(); - IModelSearchService searchService = searchServiceTracker.waitForService(100000); - Assert.assertNotNull(searchService); - return searchService; - } - - @Before - public void clear() throws SpecmateException { clearPersistency(); - searchService.clear(); } - private static LogService getLogger() throws InterruptedException { + private LogService getLogger() throws InterruptedException { ServiceTracker logTracker = new ServiceTracker<>(context, LogService.class.getName(), null); logTracker.open(); @@ -76,13 +63,13 @@ private static LogService getLogger() throws InterruptedException { return logService; } - private static void clearPersistency() throws SpecmateException { + protected void clearPersistency() throws SpecmateException { ITransaction transaction = persistency.openTransaction(); transaction.getResource().getContents().clear(); transaction.commit(); } - private static IPersistencyService getPersistencyService() throws InterruptedException, SpecmateException { + private IPersistencyService getPersistencyService() throws InterruptedException, SpecmateException { ServiceTracker persistencyTracker = new ServiceTracker<>(context, IPersistencyService.class.getName(), null); persistencyTracker.open(); @@ -91,7 +78,7 @@ private static IPersistencyService getPersistencyService() throws InterruptedExc return persistency; } - private JSONObject createTestFolder(String folderId, String folderName) { + protected JSONObject createTestFolder(String folderId, String folderName) { JSONObject folder = new JSONObject(); folder.put(NSURI_KEY, BasePackage.eNS_URI); folder.put(ECLASS, BasePackage.Literals.FOLDER.getName()); @@ -100,12 +87,12 @@ private JSONObject createTestFolder(String folderId, String folderName) { return folder; } - private JSONObject createTestFolder() { + protected JSONObject createTestFolder() { String folderName = "TestFolder" + counter++; return createTestFolder(folderName, folderName); } - private JSONObject createTestRequirement() { + protected JSONObject createTestRequirement() { String requirementsName = "TestRequirement" + counter++; JSONObject requirement = new JSONObject(); requirement.put(NSURI_KEY, RequirementsPackage.eNS_URI); @@ -127,7 +114,7 @@ private JSONObject createTestRequirement() { return requirement; } - private JSONObject createTestCegModel() { + protected JSONObject createTestCegModel() { String cegName = "TestCeg" + counter++; JSONObject ceg = new JSONObject(); ceg.put(NSURI_KEY, RequirementsPackage.eNS_URI); @@ -137,7 +124,7 @@ private JSONObject createTestCegModel() { return ceg; } - private JSONObject createTestCegNode() { + protected JSONObject createTestCegNode() { String cegName = "TestCegNode" + counter++; JSONObject cegNode = new JSONObject(); cegNode.put(NSURI_KEY, RequirementsPackage.eNS_URI); @@ -150,7 +137,7 @@ private JSONObject createTestCegNode() { return cegNode; } - private JSONObject createTestConnection(JSONObject node1, JSONObject node2) { + protected JSONObject createTestConnection(JSONObject node1, JSONObject node2) { String connectionName = "TestConnection" + counter++; JSONObject connection = new JSONObject(); connection.put(NSURI_KEY, RequirementsPackage.eNS_URI); @@ -162,7 +149,7 @@ private JSONObject createTestConnection(JSONObject node1, JSONObject node2) { return connection; } - private JSONObject createTestTestSpecification() { + protected JSONObject createTestTestSpecification() { String testSpecName = "TestSpecification" + counter++; JSONObject testSpecification = new JSONObject(); testSpecification.put(NSURI_KEY, TestspecificationPackage.eNS_URI); @@ -172,7 +159,7 @@ private JSONObject createTestTestSpecification() { return testSpecification; } - private String buildUrl(String service, String... segments) { + protected String buildUrl(String service, String... segments) { StringBuilder builder = new StringBuilder(); for (String segment : segments) { builder.append("/").append(segment); @@ -180,85 +167,69 @@ private String buildUrl(String service, String... segments) { return builder.toString() + "/" + service; } - private String detailUrl(String... segments) { - return buildUrl("details", segments); - } - - private String listUrl(String... segments) { - return buildUrl("list", segments); - } - - private String deleteUrl(String... segments) { - return buildUrl("delete", segments); - } - - private String getId(JSONObject requirement) { + protected String getId(JSONObject requirement) { return requirement.getString(ID_KEY); } - private JSONObject postFolderToRoot() { + protected JSONObject postFolderToRoot() { JSONObject folder = createTestFolder(); return postObject(folder); } - private JSONObject postFolder(String... segments) { + protected JSONObject postFolder(String... segments) { JSONObject folder = createTestFolder(); return postObject(folder, segments); } - private JSONObject postRequirementToRoot() { + protected JSONObject postRequirementToRoot() { return postRequirement(); } - private JSONObject postRequirement(String... segments) { + protected JSONObject postRequirement(String... segments) { JSONObject requirement = createTestRequirement(); return postObject(requirement, segments); } - private JSONObject postCEG(String... segments) { + protected JSONObject postCEG(String... segments) { JSONObject cegModel = createTestCegModel(); return postObject(cegModel, segments); } - private JSONObject postCEGNode(String... segments) { + protected JSONObject postCEGNode(String... segments) { JSONObject cegNode = createTestCegNode(); return postObject(cegNode, segments); } - private JSONObject postCEGConnection(JSONObject node1, JSONObject node2, String... segments) { + protected JSONObject postCEGConnection(JSONObject node1, JSONObject node2, String... segments) { JSONObject cegConnection = createTestConnection(node1, node2); return postObject(cegConnection, segments); } - private JSONObject postTestSpecification(String... segments) { + protected JSONObject postTestSpecification(String... segments) { JSONObject testSpecification = createTestTestSpecification(); return postObject(testSpecification, segments); } - private JSONObject postObject(JSONObject object, String... segments) { + protected JSONObject postObject(JSONObject object, String... segments) { return postObject(Status.OK.getStatusCode(), object, segments); } - private JSONObject postObject(int statusCode, JSONObject object, String... segments) { + protected JSONObject postObject(int statusCode, JSONObject object, String... segments) { String postUrl = listUrl(segments); logService.log(LogService.LOG_DEBUG, "Posting the object " + object.toString() + " to url " + postUrl); RestResult result = restClient.post(postUrl, object); Assert.assertEquals(result.getResponse().getStatus(), statusCode); return object; } - - private void updateObject(JSONObject object, String segments) { + + protected void updateObject(JSONObject object, String... segments) { String updateUrl = detailUrl(segments); logService.log(LogService.LOG_DEBUG, "Updateing the object " + object.toString() + " at url " + updateUrl); RestResult putResult = restClient.put(updateUrl, object); Assert.assertEquals(Status.OK.getStatusCode(), putResult.getResponse().getStatus()); } - - private JSONObject getObject(String... segments) { - return getObject(Status.OK.getStatusCode(), segments); - } - - private JSONObject getObject(int statusCode, String... segments) { + + protected JSONObject getObject(int statusCode, String... segments) { String retrieveUrl = detailUrl(segments); RestResult getResult = restClient.get(retrieveUrl); JSONObject retrievedObject = getResult.getPayload(); @@ -271,450 +242,28 @@ private JSONObject getObject(int statusCode, String... segments) { Assert.assertEquals(statusCode, getResult.getResponse().getStatus()); return retrievedObject; } + + protected JSONObject getObject(String... segments) { + return getObject(Status.OK.getStatusCode(), segments); + } - private void deleteObject(String... segments) { + protected void deleteObject(String... segments) { // Delete folder String deleteUrl = deleteUrl(segments); logService.log(LogService.LOG_DEBUG, "Deleting object with URL " + deleteUrl); RestResult deleteResult = restClient.delete(deleteUrl); Assert.assertEquals(Status.OK.getStatusCode(), deleteResult.getResponse().getStatus()); } - - private JSONArray performSearch(String query) { - String searchUrl = buildUrl("search"); - RestResult result = restClient.getList(searchUrl, "query", query); - Assert.assertEquals(Status.OK.getStatusCode(), result.getResponse().getStatus()); - JSONArray foundObjects = result.getPayload(); - return foundObjects; - } - - /** - * Tests posting a folder to the root. Checks, if the return code of the - * post request is OK and if retrieving the object again returns the - * original object. - */ - @Test - public void testPostFolderToRootAndRetrieve() { - String postUrl = listUrl(); - JSONObject folder = createTestFolder(); - logService.log(LogService.LOG_DEBUG, "Posting the object " + folder.toString() + " to url " + postUrl); - RestResult result = restClient.post(postUrl, folder); - Assert.assertEquals(result.getResponse().getStatus(), Status.OK.getStatusCode()); - - String retrieveUrl = detailUrl(getId(folder)); - RestResult getResult = restClient.get(retrieveUrl); - JSONObject retrievedFolder = getResult.getPayload(); - logService.log(LogService.LOG_DEBUG, - "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); - Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); - } - - /** - * Tests posting a folder that contains special characters in its name. - * Checks, if the return code of the post request is OK and if retrieving - * the object again returns the original object. - */ - @Test - public void testPostFolderWithSpecialChars() { - String postUrl = listUrl(); - JSONObject folder = createTestFolder("TestFolder", "äöüߧ$% &=?!/\\^_:.,#'+~*(){}[]"); - logService.log(LogService.LOG_DEBUG, "Posting the object " + folder.toString() + " to url " + postUrl); - RestResult result = restClient.post(postUrl, folder); - Assert.assertEquals(result.getResponse().getStatus(), Status.OK.getStatusCode()); - - String retrieveUrl = detailUrl(getId(folder)); - RestResult getResult = restClient.get(retrieveUrl); - JSONObject retrievedFolder = getResult.getPayload(); - logService.log(LogService.LOG_DEBUG, - "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); - Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); - } - - /** - * Tests posting a folder to another folder. Checks, if the return code of - * the post request is OK and if retrieving the object again returns the - * original object. - */ - @Test - public void testPostFolderToFolderAndRetrieve() { - JSONObject folder = postFolderToRoot(); - String folderName = getId(folder); - - String postUrl2 = listUrl(folderName); - JSONObject folder2 = createTestFolder(); - String folderName2 = getId(folder2); - logService.log(LogService.LOG_DEBUG, "Posting the object " + folder2.toString() + " to url " + postUrl2); - RestResult result2 = restClient.post(postUrl2, folder2); - Assert.assertEquals(result2.getResponse().getStatus(), Status.OK.getStatusCode()); - - String retrieveUrl = detailUrl(folderName, folderName2); - RestResult getResult = restClient.get(retrieveUrl); - JSONObject retrievedFolder = getResult.getPayload(); - logService.log(LogService.LOG_DEBUG, - "Retrieved the object " + retrievedFolder.toString() + " from url " + retrieveUrl); - Assert.assertTrue(EmfRestTestUtil.compare(retrievedFolder, folder2, true)); - } - - /** Tests if retrieving a non-existing object returns 404-Not found */ - @Test - public void testMissingFolder() { - // Create new folder just to get a fresh name - JSONObject folder = createTestFolder(); - String folderName = getId(folder); - - // Not posting to backend instead try to retrieve - String retrieveUrl = detailUrl(folderName); - RestResult getResult = restClient.get(retrieveUrl); - - Assert.assertEquals(Status.NOT_FOUND.getStatusCode(), getResult.getResponse().getStatus()); - - } - - /** Tests retrieving a list of child folders from a folder */ - @Test - public void testRetrieveChildrenList() { - int numberOfChildren = 2; - - JSONObject folder = postFolderToRoot(); - String folderName = getId(folder); - - String postUrl2 = listUrl(folderName); - JSONObject[] folders = new JSONObject[2]; - for (int i = 0; i < numberOfChildren; i++) { - folders[i] = createTestFolder(); - logService.log(LogService.LOG_DEBUG, "Posting the object " + folders[i].toString() + " to url " + postUrl2); - RestResult result2 = restClient.post(postUrl2, folders[i]); - Assert.assertEquals(result2.getResponse().getStatus(), Status.OK.getStatusCode()); - } - - RestResult listResult = restClient.getList(postUrl2); - JSONArray childrenList = listResult.getPayload(); - logService.log(LogService.LOG_DEBUG, "Retrieved the list " + childrenList.toString() + " from url " + postUrl2); - Assert.assertEquals(2, childrenList.length()); - for (int i = 0; i < numberOfChildren; i++) { - Assert.assertTrue(EmfRestTestUtil.compare(folders[i], childrenList.getJSONObject(i), true)); - } - - } - - /** Tests if an empty folder can be deleted */ - @Test - public void testDeleteEmptyFolder() { - JSONObject folder = postFolderToRoot(); - String folderName = getId(folder); - getObject(folderName); - - deleteObject(folderName); - - // Check if folder still exists - getObject(Status.NOT_FOUND.getStatusCode(), folderName); - } - - /** Tests if a non-empty folder can be deleted */ - @Test - public void testDeleteNonEmptyFolder() { - // Post folder to root - JSONObject outerFolder = postFolderToRoot(); - String folderName = getId(outerFolder); - - // Post folder in new folder - postFolder(folderName); - - // Check if top level folder exists - getObject(folderName); - - // Delete top level folder - deleteObject(folderName); - - // Check if top level folder still exists - getObject(Status.NOT_FOUND.getStatusCode(), folderName); - } - - /** - * Tests posting a requirement to a folder. Checks, if the return code of - * the post request is OK and if retrieving the requirement again returns - * the original object. - */ - @Test - public void testPostRequirementToFolderAndRetrieve() { - JSONObject folder = postFolderToRoot(); - String folderName = getId(folder); - - JSONObject requirement = postRequirement(folderName); - String requirementName = getId(requirement); - - getObject(folderName, requirementName); - } - - @Test - public void testUpdateFolder() { - JSONObject folder = postFolderToRoot(); - String folderName = getId(folder); - - folder.put(BasePackage.Literals.INAMED__NAME.getName(), "New Name"); - updateObject(folder, folderName); - - JSONObject retrievedFolder = getObject(folderName); - Assert.assertTrue(EmfRestTestUtil.compare(folder, retrievedFolder, true)); - } - - @Test - public void testPostCEGToRequirement() { - JSONObject requirement = postRequirementToRoot(); - String requirementId = getId(requirement); - - JSONObject cegModel = postCEG(requirementId); - String cegId = getId(cegModel); - - JSONObject retrievedCEG = getObject(requirementId, cegId); - Assert.assertTrue(EmfRestTestUtil.compare(retrievedCEG, cegModel, true)); - } - - @Test - public void testPostCEGNodesAndConnectionToCEG() { - JSONObject requirement = postRequirementToRoot(); - String requirementId = getId(requirement); - - // post ceg - JSONObject cegModel = postCEG(requirementId); - String cegId = getId(cegModel); - - // post node 1 - JSONObject cegNode1 = postCEGNode(requirementId, cegId); - String node1Id = getId(cegNode1); - - JSONObject retrievedCegNode1 = getObject(requirementId, cegId, node1Id); - Assert.assertTrue(EmfRestTestUtil.compare(cegNode1, retrievedCegNode1, true)); - - // post node 2 - JSONObject cegNode2 = postCEGNode(requirementId, cegId); - String node2Id = getId(cegNode2); - - JSONObject retrievedCegNode2 = getObject(requirementId, cegId, node2Id); - Assert.assertTrue(EmfRestTestUtil.compare(cegNode2, retrievedCegNode2, true)); - - // post connection - JSONObject connection = postCEGConnection(retrievedCegNode1, retrievedCegNode2, requirementId, cegId); - String connectionId = getId(connection); - - JSONObject retrievedConnection = getObject(requirementId, cegId, connectionId); - Assert.assertTrue(EmfRestTestUtil.compare(retrievedConnection, connection, true)); - } - - @Test - public void testPostFolderWithNoId() { - JSONObject folder = createTestFolder(); - folder.remove(ID_KEY); - - postObject(Status.BAD_REQUEST.getStatusCode(), folder); - } - - @Test - public void testPostFolderWithDuplicateId() { - JSONObject folder = postFolderToRoot(); - postObject(Status.BAD_REQUEST.getStatusCode(), folder); - } - - @Test - public void testPostFolderWithIllegalId() { - JSONObject folder = createTestFolder(); - folder.put(ID_KEY, "id with spaces"); - postObject(Status.BAD_REQUEST.getStatusCode(), folder); - } - - @Test - public void testPostTestSpecification() { - JSONObject requirement = postRequirementToRoot(); - String requirementId = getId(requirement); - - // Post ceg model - JSONObject cegModel = postCEG(requirementId); - String cegId = getId(cegModel); - - // Post test specification - JSONObject testSpecification = postTestSpecification(requirementId, cegId); - String testSpecId = getId(testSpecification); - - JSONObject retrievedTestSpecification = getObject(requirementId, cegId, testSpecId); - Assert.assertTrue(EmfRestTestUtil.compare(retrievedTestSpecification, testSpecification, true)); - } - - @Test - public void testGenerateTests() { - JSONObject requirement = postRequirementToRoot(); - String requirementId = getId(requirement); - - // Post ceg model - JSONObject cegModel = postCEG(requirementId); - String cegId = getId(cegModel); - - // post node 1 - JSONObject cegNode1 = postCEGNode(requirementId, cegId); - String cegNode1Id = getId(cegNode1); - JSONObject retrievedCegNode1 = getObject(requirementId, cegId, cegNode1Id); - - // post node 2 - JSONObject cegNode2 = postCEGNode(requirementId, cegId); - String cegNode2Id = getId(cegNode2); - JSONObject retrievedCegNode2 = getObject(requirementId, cegId, cegNode2Id); - - // post connection - postCEGConnection(retrievedCegNode1, retrievedCegNode2, requirementId, cegId); - - // Post test specification - JSONObject testSpec = postTestSpecification(requirementId, cegId); - String testSpecId = getId(testSpec); - - // Generate test cases - String generateUrl = buildUrl("generateTests", requirementId, cegId, testSpecId); - logService.log(LogService.LOG_DEBUG, "Request test genreation at url " + generateUrl); - RestResult result = restClient.post(generateUrl, null); - Assert.assertEquals(Status.NO_CONTENT.getStatusCode(), result.getResponse().getStatus()); - - String retrieveUrl = listUrl(requirementId, cegId, testSpecId); - RestResult getResult = restClient.getList(retrieveUrl); - JSONArray retrievedTestChilds = getResult.getPayload(); - logService.log(LogService.LOG_DEBUG, - "Retrieved the object " + retrievedTestChilds.toString() + " from url " + retrieveUrl); - - // Expect 4 chidren: two test cases and two test parameters - Assert.assertEquals(4, retrievedTestChilds.length()); + + protected String listUrl(String... segments) { + return buildUrl("list", segments); } - - /** - * Posts two test specifications to a CEG model and checks if they are - * retrieved by the list recursive service. - */ - @Test - public void testGetListRecursive() { - JSONObject requirement = postRequirementToRoot(); - String requirementId = getId(requirement); - - // Post ceg model - JSONObject cegModel = postCEG(requirementId); - String cegId = getId(cegModel); - - // Post test specification - JSONObject testSpecification = postTestSpecification(requirementId, cegId); - - // Post second test specification - JSONObject testSpecification2 = postTestSpecification(requirementId, cegId); - - // Peform recursive list call - String listUrl = buildUrl("listRecursive", requirementId); - RestResult listResult = restClient.getList(listUrl, "class", "TestSpecification"); - Assert.assertEquals(Status.OK.getStatusCode(), listResult.getResponse().getStatus()); - JSONArray retrievedTestSpecifications = listResult.getPayload(); - logService.log(LogService.LOG_DEBUG, - "Retrieved the object " + retrievedTestSpecifications.toString() + " from url " + listUrl); - Assert.assertEquals(2, retrievedTestSpecifications.length()); - Assert.assertTrue( - EmfRestTestUtil.compare(retrievedTestSpecifications.getJSONObject(0), testSpecification, true)); - Assert.assertTrue( - EmfRestTestUtil.compare(retrievedTestSpecifications.getJSONObject(1), testSpecification2, true)); + + protected String detailUrl(String... segments) { + return buildUrl("details", segments); } - /** - * Posts two test specifications to a CEG model and checks if they are - * retrieved by the list recursive service. - * - * @throws InterruptedException - */ - @Test - public void testSearch() throws InterruptedException { - JSONObject folder = createTestFolder(); - folder.put(BasePackage.Literals.INAMED__NAME.getName(), "Test"); - folder.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST"); - postObject(folder); - String folderName = getId(folder); - - JSONObject requirement = createTestRequirement(); - requirement.put(BasePackage.Literals.INAMED__NAME.getName(), "Test BLA BLI"); - requirement.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST BLUP"); - postObject(requirement, folderName); - String requirementId = getId(requirement); - - JSONObject requirement2 = createTestRequirement(); - requirement2.put(BasePackage.Literals.INAMED__NAME.getName(), "Test"); - requirement2.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST BLI"); - requirement2.put(BasePackage.Literals.IEXTERNAL__EXT_ID.getName(), "4711"); - postObject(requirement2, folderName); - - JSONObject requirement3 = createTestRequirement(); - requirement3.put(BasePackage.Literals.INAMED__NAME.getName(), "Tree"); - requirement3.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "Tree"); - postObject(requirement3, folderName); - - JSONObject cegModel = createTestCegModel(); - cegModel.put(BasePackage.Literals.INAMED__NAME.getName(), "Test CEG"); - cegModel.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "CEG"); - postObject(cegModel, folderName, requirementId); - - // Allow time to commit to search index - Thread.sleep(35000); - - // Check if search on name field works - JSONArray foundObjects = performSearch("blup"); - Assert.assertEquals(1, foundObjects.length()); - - foundObjects = performSearch("BLUP"); - Assert.assertEquals(1, foundObjects.length()); - - foundObjects = performSearch("Blup"); - Assert.assertEquals(1, foundObjects.length()); - - // check if search on description field works - foundObjects = performSearch("bla"); - Assert.assertEquals(1, foundObjects.length()); - - // check if search on extid field works - foundObjects = performSearch("4711"); - Assert.assertEquals(1, foundObjects.length()); - - // check if search on multiple fields across objects works - foundObjects = performSearch("bli"); - Assert.assertEquals(2, foundObjects.length()); - - // check if wildcard search workds - foundObjects = performSearch("bl*"); - Assert.assertEquals(2, foundObjects.length()); - - // check if explicit name search works - foundObjects = performSearch("name:bli"); - Assert.assertEquals(1, foundObjects.length()); - - // check if explicit description search works - foundObjects = performSearch("description:bli"); - Assert.assertEquals(1, foundObjects.length()); - - // check if negative search works - foundObjects = performSearch("bli -(name:bla)"); - Assert.assertEquals(1, foundObjects.length()); - - // check if type search workds - foundObjects = performSearch("type:CEGModel"); - Assert.assertEquals(1, foundObjects.length()); - - // check if type search workds - foundObjects = performSearch("type:Requirement"); - Assert.assertEquals(3, foundObjects.length()); - - // check if search is robust agains syntax errors (no closed bracket) - foundObjects = performSearch("(type:Requirement"); - Assert.assertEquals(0, foundObjects.length()); - - // check if search is robust agains syntax errors (no opened bracket) - foundObjects = performSearch("type:Requirement)"); - Assert.assertEquals(0, foundObjects.length()); - - // check if search is robust agains syntax errors (no opened bracket) - foundObjects = performSearch("type:Requirement)"); - Assert.assertEquals(0, foundObjects.length()); - - // spurios "minus" - foundObjects = performSearch("bla -"); - Assert.assertEquals(0, foundObjects.length()); - + protected String deleteUrl(String... segments) { + return buildUrl("delete", segments); } - } \ No newline at end of file diff --git a/bundles/specmate-integration-test/src/com/specmate/test/integration/HistoryTest.java b/bundles/specmate-integration-test/src/com/specmate/test/integration/HistoryTest.java new file mode 100644 index 000000000..29c42e711 --- /dev/null +++ b/bundles/specmate-integration-test/src/com/specmate/test/integration/HistoryTest.java @@ -0,0 +1,126 @@ +package com.specmate.test.integration; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Assert; +import org.junit.Test; + +import com.specmate.common.RestResult; +import com.specmate.model.base.BasePackage; +import com.specmate.model.history.HistoryPackage; + +public class HistoryTest extends EmfRestTest { + + public HistoryTest() throws Exception {} + + private String historyUrl(String... segments) { + return buildUrl("history", segments); + } + + private String historyRecursiveUrl(String... segments) { + return buildUrl("historyRecursive", segments); + } + + private JSONArray getEntries(boolean recursive, String... segments) { + String historyUrl = recursive ? historyRecursiveUrl(segments) : historyUrl(segments); + RestResult result = restClient.get(historyUrl); + JSONObject history = result.getPayload(); + return history.getJSONArray(HistoryPackage.Literals.HISTORY__ENTRIES.getName()); + } + + /** + * Tests that the history entries are returned is reversed creation order + * and expected state (creation, modification). + */ + @Test + public void testHistoryIsInSequence() { + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + String newName = "changedName"; + int numChangeNames = 11; + for(int i = 0; i < numChangeNames; i++) { + requirement.put(BasePackage.Literals.INAMED__NAME.getName(), newName + i); + updateObject(requirement, requirementId); + } + + checkSequence(getEntries(false, requirementId), newName, numChangeNames); + checkSequence(getEntries(true, requirementId), newName, numChangeNames); + } + + private void checkSequence(JSONArray entries, String newName, int numChangeNames) { + assertEquals(numChangeNames + 1, entries.length()); + for(int i = 0, j = numChangeNames - 1; i < numChangeNames; i++, j--) { + JSONObject entry = entries.getJSONObject(i); + assertTrue(entry.getString(HistoryPackage.Literals.HISTORY_ENTRY__USER.getName()).length() > 0); + JSONArray changes = entry.getJSONArray(HistoryPackage.Literals.HISTORY_ENTRY__CHANGES.getName()); + assertEquals(1, changes.length()); + JSONObject change = changes.getJSONObject(0); + assertEquals(newName + j, change.getString(HistoryPackage.Literals.CHANGE__NEW_VALUE.getName())); + assertEquals(BasePackage.Literals.INAMED__NAME.getName(), change.getString(HistoryPackage.Literals.CHANGE__FEATURE.getName())); + assertFalse(change.getBoolean(HistoryPackage.Literals.CHANGE__IS_CREATE.getName())); + assertFalse(change.getBoolean(HistoryPackage.Literals.CHANGE__IS_DELETE.getName())); + } + + JSONObject creation = entries.getJSONObject(numChangeNames); + assertTrue(creation.getString(HistoryPackage.Literals.HISTORY_ENTRY__USER.getName()).length() > 0); + JSONArray changes = creation.getJSONArray(HistoryPackage.Literals.HISTORY_ENTRY__CHANGES.getName()); + for(int i = 0; i < changes.length(); i++) { + JSONObject change = changes.getJSONObject(i); + assertTrue(change.getBoolean(HistoryPackage.Literals.CHANGE__IS_CREATE.getName())); + assertFalse(change.getBoolean(HistoryPackage.Literals.CHANGE__IS_DELETE.getName())); + } + } + + /** + * Tests that the object hierarchy is traversed to get history elements by + * asserting the number of history entries for created and deleted objects. + */ + @Test + public void testRecursiveHistory() { + // Changes 1 + JSONObject requirement = postRequirementToRoot(); + String requirementId = getId(requirement); + + // Changes 3 + JSONObject cegModel = postCEG(requirementId); + String cegId = getId(cegModel); + + // Changes 5 + JSONObject cegNode1 = postCEGNode(requirementId, cegId); + String node1Id = getId(cegNode1); + + JSONObject retrievedCegNode1 = getObject(requirementId, cegId, node1Id); + Assert.assertTrue(EmfRestTestUtil.compare(cegNode1, retrievedCegNode1, true)); + + // Changes 7 + JSONObject cegNode2 = postCEGNode(requirementId, cegId); + String node2Id = getId(cegNode2); + + JSONObject retrievedCegNode2 = getObject(requirementId, cegId, node2Id); + Assert.assertTrue(EmfRestTestUtil.compare(cegNode2, retrievedCegNode2, true)); + + // Change 9 + JSONObject connection = postCEGConnection(retrievedCegNode1, retrievedCegNode2, requirementId, cegId); + String connectionId = getId(connection); + + JSONArray entries = getEntries(true, requirementId); + assertEquals(9, entries.length()); + + // Change 9: since we deleted an object, is does not appear in history anymore (-1), but we catch the deletion with + // the change event on the containment (+1). As a result, the number of history entries does not change when deleting + // an object. + deleteObject(requirementId, cegId, connectionId); + + entries = getEntries(true, requirementId); + assertEquals(9, entries.length()); + JSONObject entry = entries.getJSONObject(0); + JSONArray changes = entry.getJSONArray(HistoryPackage.Literals.HISTORY_ENTRY__CHANGES.getName()); + assertEquals(1, changes.length()); + JSONObject deletion = changes.getJSONObject(0); + assertTrue(deletion.getBoolean(HistoryPackage.Literals.CHANGE__IS_DELETE.getName())); + } +} diff --git a/bundles/specmate-integration-test/src/com/specmate/test/integration/SearchTest.java b/bundles/specmate-integration-test/src/com/specmate/test/integration/SearchTest.java new file mode 100644 index 000000000..5d6cc0f24 --- /dev/null +++ b/bundles/specmate-integration-test/src/com/specmate/test/integration/SearchTest.java @@ -0,0 +1,152 @@ +package com.specmate.test.integration; + +import javax.ws.rs.core.Response.Status; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.osgi.util.tracker.ServiceTracker; + +import com.specmate.common.RestResult; +import com.specmate.common.SpecmateException; +import com.specmate.model.base.BasePackage; +import com.specmate.search.api.IModelSearchService; + +public class SearchTest extends EmfRestTest { + private static IModelSearchService searchService; + + public SearchTest() throws Exception {} + + @BeforeClass + public static void init() throws Exception { + searchService = getSearchService(); + } + + private static IModelSearchService getSearchService() throws InterruptedException { + ServiceTracker searchServiceTracker = new ServiceTracker<>(context, + IModelSearchService.class.getName(), null); + searchServiceTracker.open(); + IModelSearchService searchService = searchServiceTracker.waitForService(100000); + Assert.assertNotNull(searchService); + return searchService; + } + + private JSONArray performSearch(String query) { + String searchUrl = buildUrl("search"); + RestResult result = restClient.getList(searchUrl, "query", query); + Assert.assertEquals(Status.OK.getStatusCode(), result.getResponse().getStatus()); + JSONArray foundObjects = result.getPayload(); + return foundObjects; + } + + @Before + public void clear() throws SpecmateException { + searchService.clear(); + } + + /** + * Posts two test specifications to a CEG model and checks if they are + * retrieved by the list recursive service. + * + * @throws InterruptedException + */ + @Test + public void testSearch() throws InterruptedException { + JSONObject folder = createTestFolder(); + folder.put(BasePackage.Literals.INAMED__NAME.getName(), "Test"); + folder.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST"); + postObject(folder); + String folderName = getId(folder); + + JSONObject requirement = createTestRequirement(); + requirement.put(BasePackage.Literals.INAMED__NAME.getName(), "Test BLA BLI"); + requirement.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST BLUP"); + postObject(requirement, folderName); + String requirementId = getId(requirement); + + JSONObject requirement2 = createTestRequirement(); + requirement2.put(BasePackage.Literals.INAMED__NAME.getName(), "Test"); + requirement2.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "TEST BLI"); + requirement2.put(BasePackage.Literals.IEXTERNAL__EXT_ID.getName(), "4711"); + postObject(requirement2, folderName); + + JSONObject requirement3 = createTestRequirement(); + requirement3.put(BasePackage.Literals.INAMED__NAME.getName(), "Tree"); + requirement3.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "Tree"); + postObject(requirement3, folderName); + + JSONObject cegModel = createTestCegModel(); + cegModel.put(BasePackage.Literals.INAMED__NAME.getName(), "Test CEG"); + cegModel.put(BasePackage.Literals.IDESCRIBED__DESCRIPTION.getName(), "CEG"); + postObject(cegModel, folderName, requirementId); + + // Allow time to commit to search index + Thread.sleep(35000); + + // Check if search on name field works + JSONArray foundObjects = performSearch("blup"); + Assert.assertEquals(1, foundObjects.length()); + + foundObjects = performSearch("BLUP"); + Assert.assertEquals(1, foundObjects.length()); + + foundObjects = performSearch("Blup"); + Assert.assertEquals(1, foundObjects.length()); + + // check if search on description field works + foundObjects = performSearch("bla"); + Assert.assertEquals(1, foundObjects.length()); + + // check if search on extid field works + foundObjects = performSearch("4711"); + Assert.assertEquals(1, foundObjects.length()); + + // check if search on multiple fields across objects works + foundObjects = performSearch("bli"); + Assert.assertEquals(2, foundObjects.length()); + + // check if wildcard search workds + foundObjects = performSearch("bl*"); + Assert.assertEquals(2, foundObjects.length()); + + // check if explicit name search works + foundObjects = performSearch("name:bli"); + Assert.assertEquals(1, foundObjects.length()); + + // check if explicit description search works + foundObjects = performSearch("description:bli"); + Assert.assertEquals(1, foundObjects.length()); + + // check if negative search works + foundObjects = performSearch("bli -(name:bla)"); + Assert.assertEquals(1, foundObjects.length()); + + // check if type search workds + foundObjects = performSearch("type:CEGModel"); + Assert.assertEquals(1, foundObjects.length()); + + // check if type search workds + foundObjects = performSearch("type:Requirement"); + Assert.assertEquals(3, foundObjects.length()); + + // check if search is robust agains syntax errors (no closed bracket) + foundObjects = performSearch("(type:Requirement"); + Assert.assertEquals(0, foundObjects.length()); + + // check if search is robust agains syntax errors (no opened bracket) + foundObjects = performSearch("type:Requirement)"); + Assert.assertEquals(0, foundObjects.length()); + + // check if search is robust agains syntax errors (no opened bracket) + foundObjects = performSearch("type:Requirement)"); + Assert.assertEquals(0, foundObjects.length()); + + // spurios "minus" + foundObjects = performSearch("bla -"); + Assert.assertEquals(0, foundObjects.length()); + + } +} diff --git a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java index 4deac328b..29c475afe 100644 --- a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java +++ b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java @@ -57,7 +57,7 @@ public void process() { private void processDelta(CDOID id, CDOFeatureDelta delta) { if (delta.getType().equals(Type.LIST)) { CDOListFeatureDelta listDelta = (CDOListFeatureDelta) delta; - ArrayList deltas = new ArrayList(listDelta.getListChanges()); + ArrayList deltas = new ArrayList<>(listDelta.getListChanges()); for (CDOFeatureDelta nestedDelta : deltas) { processDelta(id, nestedDelta); } @@ -81,7 +81,8 @@ private void processBasicDelta(CDOID id, CDOFeatureDelta delta) { case REMOVE: CDORemoveFeatureDelta removeDelta = (CDORemoveFeatureDelta) delta; - changedObject(id, removeDelta.getFeature(), EChangeKind.REMOVE, null, null, removeDelta.getIndex()); + changedObject(id, removeDelta.getFeature(), EChangeKind.REMOVE, removeDelta.getValue(), null, + removeDelta.getIndex()); break; case CLEAR: diff --git a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java index 6c248bc44..80593b8a3 100644 --- a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java +++ b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java @@ -122,26 +122,27 @@ protected void changedObject(CDOID id, EStructuralFeature feature, EChangeKind c return; } - //Not interested in containment features that changed. + Change change = HistoryFactory.eINSTANCE.createChange(); + change.setFeature(feature.getName()); + if(feature instanceof EReference) { - EReference ref = (EReference) feature; - if(ref.isContainment()) { + EReference ref = (EReference) feature; + if(ref.isContainment() && changeKind.equals(EChangeKind.REMOVE)) { + change.setIsDelete(true); + change.setNewValue(oldValue.toString()); + } + else if(ref.isContainment() && changeKind.equals(EChangeKind.ADD)) { + change.setIsCreate(true); + change.setNewValue(newValue.toString()); + } else { return; } } - - Change change = HistoryFactory.eINSTANCE.createChange(); - change.setFeature(feature.getName()); if(newValue != null) { change.setNewValue(newValue.toString()); } - else { - if(changeKind.name().equals("REMOVE")) { - change.setIsDelete(true); - } - change.setNewValue(changeKind.name()); - } + changes.add(change); } diff --git a/bundles/specmate-ui-core/webcontent/polyfills.js b/bundles/specmate-ui-core/webcontent/polyfills.js index e5d2154e7..2b2f67add 100644 --- a/bundles/specmate-ui-core/webcontent/polyfills.js +++ b/bundles/specmate-ui-core/webcontent/polyfills.js @@ -48,19 +48,19 @@ eval("var store = __webpack_require__(105)('wks');\nvar uid = __webpack_require_ /* 16 */ /***/ (function(module, exports, __webpack_require__) { -eval("var anObject = __webpack_require__(4);\nvar IE8_DOM_DEFINE = __webpack_require__(201);\nvar toPrimitive = __webpack_require__(60);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(20) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanM/OTQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4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9\n//# sourceURL=webpack-internal:///16\n"); +eval("var anObject = __webpack_require__(4);\nvar IE8_DOM_DEFINE = __webpack_require__(201);\nvar toPrimitive = __webpack_require__(60);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(21) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanM/OTQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBkUCA9IE9iamVjdC5kZWZpbmVQcm9wZXJ0eTtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIFAgPSB0b1ByaW1pdGl2ZShQLCB0cnVlKTtcbiAgYW5PYmplY3QoQXR0cmlidXRlcyk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZFAoTywgUCwgQXR0cmlidXRlcyk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoJ2dldCcgaW4gQXR0cmlidXRlcyB8fCAnc2V0JyBpbiBBdHRyaWJ1dGVzKSB0aHJvdyBUeXBlRXJyb3IoJ0FjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIScpO1xuICBpZiAoJ3ZhbHVlJyBpbiBBdHRyaWJ1dGVzKSBPW1BdID0gQXR0cmlidXRlcy52YWx1ZTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n"); /***/ }), /* 17 */, /* 18 */, /* 19 */, -/* 20 */ +/* 20 */, +/* 21 */ /***/ (function(module, exports, __webpack_require__) { -eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(6)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qcz82ZDRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIFRoYW5rJ3MgSUU4IGZvciBoaXMgZnVubnkgZGVmaW5lUHJvcGVydHlcbm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHt9LCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///20\n"); +eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(6)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qcz82ZDRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIFRoYW5rJ3MgSUU4IGZvciBoaXMgZnVubnkgZGVmaW5lUHJvcGVydHlcbm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHt9LCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMjFcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///21\n"); /***/ }), -/* 21 */, /* 22 */, /* 23 */, /* 24 */ @@ -103,7 +103,7 @@ eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(62);\nmodu /* 36 */ /***/ (function(module, exports, __webpack_require__) { -eval("var dP = __webpack_require__(16);\nvar createDesc = __webpack_require__(71);\nmodule.exports = __webpack_require__(20) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzP2RhOWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIGRQLmYob2JqZWN0LCBrZXksIGNyZWF0ZURlc2MoMSwgdmFsdWUpKTtcbn0gOiBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIHJldHVybiBvYmplY3Q7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSAzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n"); +eval("var dP = __webpack_require__(16);\nvar createDesc = __webpack_require__(71);\nmodule.exports = __webpack_require__(21) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzP2RhOWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIGRQLmYob2JqZWN0LCBrZXksIGNyZWF0ZURlc2MoMSwgdmFsdWUpKTtcbn0gOiBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIHJldHVybiBvYmplY3Q7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSAzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n"); /***/ }), /* 37 */ @@ -174,14 +174,14 @@ eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule /* 51 */ /***/ (function(module, exports, __webpack_require__) { -eval("var pIE = __webpack_require__(107);\nvar createDesc = __webpack_require__(71);\nvar toIObject = __webpack_require__(40);\nvar toPrimitive = __webpack_require__(60);\nvar has = __webpack_require__(28);\nvar IE8_DOM_DEFINE = __webpack_require__(201);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(20) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qcz9jN2RjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgZ09QRCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBnT1BEIDogZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIFApIHtcbiAgTyA9IHRvSU9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGdPUEQoTywgUCk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoaGFzKE8sIFApKSByZXR1cm4gY3JlYXRlRGVzYyghcElFLmYuY2FsbChPLCBQKSwgT1tQXSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qc1xuLy8gbW9kdWxlIGlkID0gNTFcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///51\n"); +eval("var pIE = __webpack_require__(107);\nvar createDesc = __webpack_require__(71);\nvar toIObject = __webpack_require__(40);\nvar toPrimitive = __webpack_require__(60);\nvar has = __webpack_require__(28);\nvar IE8_DOM_DEFINE = __webpack_require__(201);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(21) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qcz9jN2RjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgZ09QRCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBnT1BEIDogZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIFApIHtcbiAgTyA9IHRvSU9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGdPUEQoTywgUCk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoaGFzKE8sIFApKSByZXR1cm4gY3JlYXRlRGVzYyghcElFLmYuY2FsbChPLCBQKSwgT1tQXSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qc1xuLy8gbW9kdWxlIGlkID0gNTFcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///51\n"); /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nif (__webpack_require__(20)) {\n var LIBRARY = __webpack_require__(80);\n var global = __webpack_require__(12);\n var fails = __webpack_require__(6);\n var $export = __webpack_require__(1);\n var $typed = __webpack_require__(113);\n var $buffer = __webpack_require__(154);\n var ctx = __webpack_require__(48);\n var anInstance = __webpack_require__(82);\n var propertyDesc = __webpack_require__(71);\n var hide = __webpack_require__(36);\n var redefineAll = __webpack_require__(83);\n var toInteger = __webpack_require__(50);\n var toLength = __webpack_require__(24);\n var toIndex = __webpack_require__(231);\n var toAbsoluteIndex = __webpack_require__(73);\n var toPrimitive = __webpack_require__(60);\n var has = __webpack_require__(28);\n var classof = __webpack_require__(108);\n var isObject = __webpack_require__(7);\n var toObject = __webpack_require__(33);\n var isArrayIter = __webpack_require__(149);\n var create = __webpack_require__(74);\n var getPrototypeOf = __webpack_require__(42);\n var gOPN = __webpack_require__(75).f;\n var getIterFn = __webpack_require__(150);\n var uid = __webpack_require__(72);\n var wks = __webpack_require__(13);\n var createArrayMethod = __webpack_require__(43);\n var createArrayIncludes = __webpack_require__(135);\n var speciesConstructor = __webpack_require__(153);\n var ArrayIterators = __webpack_require__(221);\n var Iterators = __webpack_require__(94);\n var $iterDetect = __webpack_require__(110);\n var setSpecies = __webpack_require__(81);\n var arrayFill = __webpack_require__(151);\n var arrayCopyWithin = __webpack_require__(220);\n var $DP = __webpack_require__(16);\n var $GOPD = __webpack_require__(51);\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC1hcnJheS5qcz9lZmI1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbmlmIChyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpKSB7XG4gIHZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xuICB2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG4gIHZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG4gIHZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4gIHZhciAkdHlwZWQgPSByZXF1aXJlKCcuL190eXBlZCcpO1xuICB2YXIgJGJ1ZmZlciA9IHJlcXVpcmUoJy4vX3R5cGVkLWJ1ZmZlcicpO1xuICB2YXIgY3R4ID0gcmVxd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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n"); +eval("\nif (__webpack_require__(21)) {\n var LIBRARY = __webpack_require__(80);\n var global = __webpack_require__(12);\n var fails = __webpack_require__(6);\n var $export = __webpack_require__(1);\n var $typed = __webpack_require__(113);\n var $buffer = __webpack_require__(154);\n var ctx = __webpack_require__(48);\n var anInstance = __webpack_require__(82);\n var propertyDesc = __webpack_require__(71);\n var hide = __webpack_require__(36);\n var redefineAll = __webpack_require__(83);\n var toInteger = __webpack_require__(50);\n var toLength = __webpack_require__(24);\n var toIndex = __webpack_require__(231);\n var toAbsoluteIndex = __webpack_require__(73);\n var toPrimitive = __webpack_require__(60);\n var has = __webpack_require__(28);\n var classof = __webpack_require__(108);\n var isObject = __webpack_require__(7);\n var toObject = __webpack_require__(33);\n var isArrayIter = __webpack_require__(149);\n var create = __webpack_require__(74);\n var getPrototypeOf = __webpack_require__(42);\n var gOPN = __webpack_require__(75).f;\n var getIterFn = __webpack_require__(150);\n var uid = __webpack_require__(72);\n var wks = __webpack_require__(13);\n var createArrayMethod = __webpack_require__(43);\n var createArrayIncludes = __webpack_require__(135);\n var speciesConstructor = __webpack_require__(153);\n var ArrayIterators = __webpack_require__(221);\n var Iterators = __webpack_require__(94);\n var $iterDetect = __webpack_require__(110);\n var setSpecies = __webpack_require__(81);\n var arrayFill = __webpack_require__(151);\n var arrayCopyWithin = __webpack_require__(220);\n var $DP = __webpack_require__(16);\n var $GOPD = __webpack_require__(51);\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC1hcnJheS5qcz9lZmI1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbmlmIChyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpKSB7XG4gIHZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xuICB2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG4gIHZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG4gIHZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4gIHZhciAkdHlwZWQgPSByZXF1aXJlKCcuL190eXBlZCcpO1xuICB2YXIgJGJ1ZmZlciA9IHJlcXVpcmUoJy4vX3R5cGVkLWJ1ZmZlcicpO1xuICB2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG4gIHZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fYW4taW5zdGFuY2UnKTtcbiAgdmFyIHByb3BlcnR5RGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbiAgdmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG4gIHZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xuICB2YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xuICB2YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbiAgdmFyIHRvSW5kZX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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n"); /***/ }), /* 53 */ @@ -276,7 +276,7 @@ eval("module.exports = false;\n//# sourceURL=[module]\n//# sourceMappingURL=data /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar global = __webpack_require__(12);\nvar dP = __webpack_require__(16);\nvar DESCRIPTORS = __webpack_require__(20);\nvar SPECIES = __webpack_require__(13)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz8wODQ5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZKSB7XG4gIHZhciBDID0gZ2xvYmFsW0tFWV07XG4gIGlmIChERVNDUklQVE9SUyAmJiBDICYmICFDW1NQRUNJRVNdKSBkUC5mKEMsIFNQRUNJRVMsIHtcbiAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9XG4gIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDgxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///81\n"); +eval("\nvar global = __webpack_require__(12);\nvar dP = __webpack_require__(16);\nvar DESCRIPTORS = __webpack_require__(21);\nvar SPECIES = __webpack_require__(13)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz8wODQ5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZKSB7XG4gIHZhciBDID0gZ2xvYmFsW0tFWV07XG4gIGlmIChERVNDUklQVE9SUyAmJiBDICYmICFDW1NQRUNJRVNdKSBkUC5mKEMsIFNQRUNJRVMsIHtcbiAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9XG4gIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDgxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///81\n"); /***/ }), /* 82 */ @@ -545,7 +545,7 @@ eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webp /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar global = __webpack_require__(12);\nvar DESCRIPTORS = __webpack_require__(20);\nvar LIBRARY = __webpack_require__(80);\nvar $typed = __webpack_require__(113);\nvar hide = __webpack_require__(36);\nvar redefineAll = __webpack_require__(83);\nvar fails = __webpack_require__(6);\nvar anInstance = __webpack_require__(82);\nvar toInteger = __webpack_require__(50);\nvar toLength = __webpack_require__(24);\nvar toIndex = __webpack_require__(231);\nvar gOPN = __webpack_require__(75).f;\nvar dP = __webpack_require__(16).f;\nvar arrayFill = __webpack_require__(151);\nvar setToStringTag = __webpack_require__(79);\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdHlwZWQtYnVmZmVyLmpzPzJlYjciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyICR0eXBlZCA9IHJlcXVpcmUoJy4vX3R5cGVkJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fYW4taW5zdGFuY2UnKTtcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0luZGV4ID0gcmVxdWlyZSgnLi9fdG8taW5kZXgnKTtcbnZhciBnT1BOID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4nKS5mO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBhcnJheUZpbGwgPSByZXF1aXJlKCcuL19hcnJheS1maWxsJyk7XG52YXIgc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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///154\n"); +eval("\nvar global = __webpack_require__(12);\nvar DESCRIPTORS = __webpack_require__(21);\nvar LIBRARY = __webpack_require__(80);\nvar $typed = __webpack_require__(113);\nvar hide = __webpack_require__(36);\nvar redefineAll = __webpack_require__(83);\nvar fails = __webpack_require__(6);\nvar anInstance = __webpack_require__(82);\nvar toInteger = __webpack_require__(50);\nvar toLength = __webpack_require__(24);\nvar toIndex = __webpack_require__(231);\nvar gOPN = __webpack_require__(75).f;\nvar dP = __webpack_require__(16).f;\nvar arrayFill = __webpack_require__(151);\nvar setToStringTag = __webpack_require__(79);\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdHlwZWQtYnVmZmVyLmpzPzJlYjciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyICR0eXBlZCA9IHJlcXVpcmUoJy4vX3R5cGVkJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fYW4taW5zdGFuY2UnKTtcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0lu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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///154\n"); /***/ }), /* 155 */, @@ -597,7 +597,7 @@ eval("\nvar global = __webpack_require__(12);\nvar DESCRIPTORS = __webpack_requi /* 201 */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = !__webpack_require__(20) && !__webpack_require__(6)(function () {\n return Object.defineProperty(__webpack_require__(134)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanM/YzU5NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShyZXF1aXJlKCcuL19kb20tY3JlYXRlJykoJ2RpdicpLCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMjAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///201\n"); +eval("module.exports = !__webpack_require__(21) && !__webpack_require__(6)(function () {\n return Object.defineProperty(__webpack_require__(134)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanM/YzU5NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShyZXF1aXJlKCcuL19kb20tY3JlYXRlJykoJ2RpdicpLCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMjAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///201\n"); /***/ }), /* 202 */ @@ -615,7 +615,7 @@ eval("var has = __webpack_require__(28);\nvar toIObject = __webpack_require__(40 /* 204 */ /***/ (function(module, exports, __webpack_require__) { -eval("var dP = __webpack_require__(16);\nvar anObject = __webpack_require__(4);\nvar getKeys = __webpack_require__(92);\n\nmodule.exports = __webpack_require__(20) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qcz9iNzBjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzIDogZnVuY3Rpb24gZGVmaW5lUHJvcGVydGllcyhPLCBQcm9wZXJ0aWVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICB2YXIga2V5cyA9IGdldEtleXMoUHJvcGVydGllcyk7XG4gIHZhciBsZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgdmFyIGkgPSAwO1xuICB2YXIgUDtcbiAgd2hpbGUgKGxlbmd0aCA+IGkpIGRQLmYoTywgUCA9IGtleXNbaSsrXSwgUHJvcGVydGllc1tQXSk7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gMjA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///204\n"); +eval("var dP = __webpack_require__(16);\nvar anObject = __webpack_require__(4);\nvar getKeys = __webpack_require__(92);\n\nmodule.exports = __webpack_require__(21) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qcz9iNzBjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzIDogZnVuY3Rpb24gZGVmaW5lUHJvcGVydGllcyhPLCBQcm9wZXJ0aWVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICB2YXIga2V5cyA9IGdldEtleXMoUHJvcGVydGllcyk7XG4gIHZhciBsZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgdmFyIGkgPSAwO1xuICB2YXIgUDtcbiAgd2hpbGUgKGxlbmd0aCA+IGkpIGRQLmYoTywgUCA9IGtleXNbaSsrXSwgUHJvcGVydGllc1tQXSk7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gMjA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///204\n"); /***/ }), /* 205 */ @@ -736,7 +736,7 @@ eval("module.exports = function (done, value) {\n return { value: value, done: /* 223 */ /***/ (function(module, exports, __webpack_require__) { -eval("// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(20) && /./g.flags != 'g') __webpack_require__(16).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(152)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmZsYWdzLmpzP2E1ZGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMi41LjMgZ2V0IFJlZ0V4cC5wcm90b3R5cGUuZmxhZ3MoKVxuaWYgKHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgLy4vZy5mbGFncyAhPSAnZycpIHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYoUmVnRXhwLnByb3RvdHlwZSwgJ2ZsYWdzJywge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogcmVxdWlyZSgnLi9fZmxhZ3MnKVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gMjIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///223\n"); +eval("// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(21) && /./g.flags != 'g') __webpack_require__(16).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(152)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmZsYWdzLmpzP2E1ZGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMi41LjMgZ2V0IFJlZ0V4cC5wcm90b3R5cGUuZmxhZ3MoKVxuaWYgKHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgLy4vZy5mbGFncyAhPSAnZycpIHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYoUmVnRXhwLnByb3RvdHlwZSwgJ2ZsYWdzJywge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogcmVxdWlyZSgnLi9fZmxhZ3MnKVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gMjIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///223\n"); /***/ }), /* 224 */ @@ -763,7 +763,7 @@ eval("\nvar strong = __webpack_require__(227);\nvar validate = __webpack_require /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar dP = __webpack_require__(16).f;\nvar create = __webpack_require__(74);\nvar redefineAll = __webpack_require__(83);\nvar ctx = __webpack_require__(48);\nvar anInstance = __webpack_require__(82);\nvar forOf = __webpack_require__(96);\nvar $iterDefine = __webpack_require__(145);\nvar step = __webpack_require__(222);\nvar setSpecies = __webpack_require__(81);\nvar DESCRIPTORS = __webpack_require__(20);\nvar fastKey = __webpack_require__(61).fastKey;\nvar validate = __webpack_require__(84);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi1zdHJvbmcuanM/MGUwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZFAg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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///227\n"); +eval("\nvar dP = __webpack_require__(16).f;\nvar create = __webpack_require__(74);\nvar redefineAll = __webpack_require__(83);\nvar ctx = __webpack_require__(48);\nvar anInstance = __webpack_require__(82);\nvar forOf = __webpack_require__(96);\nvar $iterDefine = __webpack_require__(145);\nvar step = __webpack_require__(222);\nvar setSpecies = __webpack_require__(81);\nvar DESCRIPTORS = __webpack_require__(21);\nvar fastKey = __webpack_require__(61).fastKey;\nvar validate = __webpack_require__(84);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi1zdHJvbmcuanM/MGUwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIGFuSW5zdGFuY2UgPSByZXF1aXJlKCcuL19hbi1pbnN0YW5jZScpO1xudmFyIGZvck9mID0gcmVxdWl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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///227\n"); /***/ }), /* 228 */ @@ -915,7 +915,7 @@ eval("__webpack_require__(339);\n__webpack_require__(342);\n__webpack_require__( /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(12);\nvar has = __webpack_require__(28);\nvar DESCRIPTORS = __webpack_require__(20);\nvar $export = __webpack_require__(1);\nvar redefine = __webpack_require__(32);\nvar META = __webpack_require__(61).KEY;\nvar $fails = __webpack_require__(6);\nvar shared = __webpack_require__(105);\nvar setToStringTag = __webpack_require__(79);\nvar uid = __webpack_require__(72);\nvar wks = __webpack_require__(13);\nvar wksExt = __webpack_require__(202);\nvar wksDefine = __webpack_require__(340);\nvar enumKeys = __webpack_require__(341);\nvar isArray = __webpack_require__(138);\nvar anObject = __webpack_require__(4);\nvar isObject = __webpack_require__(7);\nvar toIObject = __webpack_require__(40);\nvar toPrimitive = __webpack_require__(60);\nvar createDesc = __webpack_require__(71);\nvar _create = __webpack_require__(74);\nvar gOPNExt = __webpack_require__(205);\nvar $GOPD = __webpack_require__(51);\nvar $DP = __webpack_require__(16);\nvar $keys = __webpack_require__(92);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(75).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(107).f = $propertyIsEnumerable;\n __webpack_require__(106).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(80)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(36)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3ltYm9sLmpzPzAzNDkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gRUNNQVNjcmlwdCA2IHN5bWJvbHMgc2hpbVxudmFyIGdsb2JhbCA9IHJlcXVpcm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= __webpack_require__(32);\nvar META = __webpack_require__(61).KEY;\nvar $fails = __webpack_require__(6);\nvar shared = __webpack_require__(105);\nvar setToStringTag = __webpack_require__(79);\nvar uid = __webpack_require__(72);\nvar wks = __webpack_require__(13);\nvar wksExt = __webpack_require__(202);\nvar wksDefine = __webpack_require__(340);\nvar enumKeys = __webpack_require__(341);\nvar isArray = __webpack_require__(138);\nvar anObject = __webpack_require__(4);\nvar isObject = __webpack_require__(7);\nvar toIObject = __webpack_require__(40);\nvar toPrimitive = __webpack_require__(60);\nvar createDesc = __webpack_require__(71);\nvar _create = __webpack_require__(74);\nvar gOPNExt = __webpack_require__(205);\nvar $GOPD = __webpack_require__(51);\nvar $DP = __webpack_require__(16);\nvar $keys = __webpack_require__(92);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(75).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(107).f = $propertyIsEnumerable;\n __webpack_require__(106).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(80)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(36)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3ltYm9sLmpzPzAzNDkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gRUNNQVNjcmlwdCA2IHN5bWJvbHMgc2hpbVxudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIE1FVEEgPSByZXF1aXJlKCcuL19tZXRhJykuS0VZO1xudmFyICRmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJyk7XG52YXIgc2V0VG9TdHJpbmdUYWcgPSByZXF1aXJlKCcuL19zZX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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///339\n"); /***/ }), /* 340 */ @@ -939,13 +939,13 @@ eval("var $export = __webpack_require__(1);\n// 19.1.2.2 / 15.2.3.5 Object.creat /* 343 */ /***/ (function(module, exports, __webpack_require__) { -eval("var $export = __webpack_require__(1);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(20), 'Object', { defineProperty: __webpack_require__(16).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eS5qcz80MzMyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuNCAvIDE1LjIuMy42IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSwgJ09iamVjdCcsIHsgZGVmaW5lUHJvcGVydHk6IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDM0M1xuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///343\n"); +eval("var $export = __webpack_require__(1);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(21), 'Object', { defineProperty: __webpack_require__(16).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eS5qcz80MzMyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuNCAvIDE1LjIuMy42IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSwgJ09iamVjdCcsIHsgZGVmaW5lUHJvcGVydHk6IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDM0M1xuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///343\n"); /***/ }), /* 344 */ /***/ (function(module, exports, __webpack_require__) { -eval("var $export = __webpack_require__(1);\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !__webpack_require__(20), 'Object', { defineProperties: __webpack_require__(204) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzPzFlMTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4zIC8gMTUuMi4zLjcgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnRpZXM6IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNDRcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///344\n"); +eval("var $export = __webpack_require__(1);\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !__webpack_require__(21), 'Object', { defineProperties: __webpack_require__(204) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzPzFlMTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4zIC8gMTUuMi4zLjcgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnRpZXM6IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNDRcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///344\n"); /***/ }), /* 345 */ @@ -1048,7 +1048,7 @@ eval("// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $exp /* 361 */ /***/ (function(module, exports, __webpack_require__) { -eval("var dP = __webpack_require__(16).f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(20) && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qcz8xMmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgRlByb3RvID0gRnVuY3Rpb24ucHJvdG90eXBlO1xudmFyIG5hbWVSRSA9IC9eXFxzKmZ1bmN0aW9uIChbXiAoXSopLztcbnZhciBOQU1FID0gJ25hbWUnO1xuXG4vLyAxOS4yLjQuMiBuYW1lXG5OQU1FIGluIEZQcm90byB8fCByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmIGRQKEZQcm90bywgTkFNRSwge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogZnVuY3Rpb24gKCkge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gKCcnICsgdGhpcykubWF0Y2gobmFtZVJFKVsxXTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qc1xuLy8gbW9kdWxlIGlkID0gMzYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///361\n"); +eval("var dP = __webpack_require__(16).f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(21) && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qcz8xMmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgRlByb3RvID0gRnVuY3Rpb24ucHJvdG90eXBlO1xudmFyIG5hbWVSRSA9IC9eXFxzKmZ1bmN0aW9uIChbXiAoXSopLztcbnZhciBOQU1FID0gJ25hbWUnO1xuXG4vLyAxOS4yLjQuMiBuYW1lXG5OQU1FIGluIEZQcm90byB8fCByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmIGRQKEZQcm90bywgTkFNRSwge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogZnVuY3Rpb24gKCkge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gKCcnICsgdGhpcykubWF0Y2gobmFtZVJFKVsxXTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qc1xuLy8gbW9kdWxlIGlkID0gMzYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///361\n"); /***/ }), /* 362 */ @@ -1074,7 +1074,7 @@ eval("var $export = __webpack_require__(1);\nvar $parseFloat = __webpack_require /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar global = __webpack_require__(12);\nvar has = __webpack_require__(28);\nvar cof = __webpack_require__(49);\nvar inheritIfRequired = __webpack_require__(142);\nvar toPrimitive = __webpack_require__(60);\nvar fails = __webpack_require__(6);\nvar gOPN = __webpack_require__(75).f;\nvar gOPD = __webpack_require__(51).f;\nvar dP = __webpack_require__(16).f;\nvar $trim = __webpack_require__(109).trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(__webpack_require__(74)(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = __webpack_require__(20) ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n __webpack_require__(32)(global, NUMBER, $Number);\n}\n//# sourceURL=[module]\n//# sourceMappingUR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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///365\n"); +eval("\nvar global = __webpack_require__(12);\nvar has = __webpack_require__(28);\nvar cof = __webpack_require__(49);\nvar inheritIfRequired = __webpack_require__(142);\nvar toPrimitive = __webpack_require__(60);\nvar fails = __webpack_require__(6);\nvar gOPN = __webpack_require__(75).f;\nvar gOPD = __webpack_require__(51).f;\nvar dP = __webpack_require__(16).f;\nvar $trim = __webpack_require__(109).trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(__webpack_require__(74)(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = __webpack_require__(21) ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n __webpack_require__(32)(global, NUMBER, $Number);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmNvbnN0cnVjdG9yLmpzPzQwMWIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhhcyA9I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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///365\n"); /***/ }), /* 366 */ @@ -1600,14 +1600,14 @@ eval("__webpack_require__(81)('Array');\n//# sourceURL=[module]\n//# sourceMappi /* 446 */ /***/ (function(module, exports, __webpack_require__) { -eval("var global = __webpack_require__(12);\nvar inheritIfRequired = __webpack_require__(142);\nvar dP = __webpack_require__(16).f;\nvar gOPN = __webpack_require__(75).f;\nvar isRegExp = __webpack_require__(147);\nvar $flags = __webpack_require__(152);\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (__webpack_require__(20) && (!CORRECT_NEW || __webpack_require__(6)(function () {\n re2[__webpack_require__(13)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n __webpack_require__(32)(global, 'RegExp', $RegExp);\n}\n\n__webpack_require__(81)('RegExp');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmNvbnN0cnVjdG9yLmpzPzk2NzYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGluaGVyaXRJZlJlcXVpcmVkID0gcmVxdWlyZSgnLi9faW5oZXJpdC1pZi1yZXF1aXJlZCcpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBnT1BOID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4nKS5mO1xudmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG52YXIgJGZsYWdzID0gcmVxdWlyZSgnLi9fZmxhZ3MnKTtcbnZhciAkUmVnRXhwID0gZ2xvYmFsLlJlZ0V4cDtcbnZhciBCYXNlID0gJFJlZ0V4cDtcbnZhciBwcm90byA9ICRSZWdFeHAucHJvdG90eXBlO1xudmFyIHJlMSA9IC9hL2c7XG52YXIgcmUyID0gL2EvZztcbi8vIFwibmV3XCIgY3JlYXRlcyBhIG5ldyBvYmplY3QsIG9sZCB3ZWJraXQgYnVnZ3kgaGVyZVxudmFyIENPUlJFQ1RfTkVXID0gbmV3ICRSZWdFeHAocmUxKSAhPT0gcmUxO1xuXG5pZiAocmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAoIUNPUlJFQ1RfTkVXIHx8IHJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZTJbcmVxdWlyZSgnLi9fd2tzJykoJ21hdGNoJyldID0gZmFsc2U7XG4gIC8vIFJlZ0V4cCBjb25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ga2V5cyA9IGdPUE4oQmFzZSksIGkgPSAwOyBrZXlzLmxlbmd0aCA+IGk7KSBwcm94eShrZXlzW2krK10pO1xuICBwcm90by5jb25zdHJ1Y3RvciA9ICRSZWdFeHA7XG4gICRSZWdFeHAucHJvdG90eXBlID0gcHJvdG87XG4gIHJlcXVpcmUoJy4vX3JlZGVmaW5lJykoZ2xvYmFsLCAnUmVnRXhwJywgJFJlZ0V4cCk7XG59XG5cbnJlcXVpcmUoJy4vX3NldC1zcGVjaWVzJykoJ1JlZ0V4cCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAuY29uc3RydWN0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///446\n"); +eval("var global = __webpack_require__(12);\nvar inheritIfRequired = __webpack_require__(142);\nvar dP = __webpack_require__(16).f;\nvar gOPN = __webpack_require__(75).f;\nvar isRegExp = __webpack_require__(147);\nvar $flags = __webpack_require__(152);\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (__webpack_require__(21) && (!CORRECT_NEW || __webpack_require__(6)(function () {\n re2[__webpack_require__(13)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n __webpack_require__(32)(global, 'RegExp', $RegExp);\n}\n\n__webpack_require__(81)('RegExp');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmNvbnN0cnVjdG9yLmpzPzk2NzYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGluaGVyaXRJZlJlcXVpcmVkID0gcmVxdWlyZSgnLi9faW5oZXJpdC1pZi1yZXF1aXJlZCcpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBnT1BOID0gc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vZHVsZSBpZCA9IDQ0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///446\n"); /***/ }), /* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n__webpack_require__(223);\nvar anObject = __webpack_require__(4);\nvar $flags = __webpack_require__(152);\nvar DESCRIPTORS = __webpack_require__(20);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(32)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(6)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnRvLXN0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7XG4gIGRlZmluZShmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICByZXR1cm4gJHRvU3RyaW5nLmNhbGwodGhpcyk7XG4gIH0pO1xufVxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAudG8tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDdcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///447\n"); +eval("\n__webpack_require__(223);\nvar anObject = __webpack_require__(4);\nvar $flags = __webpack_require__(152);\nvar DESCRIPTORS = __webpack_require__(21);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(32)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(6)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ3LmpzIiwic291cmNlcyI6WyJ3ZWJw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Hdyb25nIG5hbWVcbn0gZWxzZSBpZiAoJHRvU3RyaW5nLm5hbWUgIT0gVE9fU1RSSU5HKSB7XG4gIGRlZmluZShmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICByZXR1cm4gJHRvU3RyaW5nLmNhbGwodGhpcyk7XG4gIH0pO1xufVxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAudG8tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDdcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///447\n"); /***/ }), /* 448 */ diff --git a/bundles/specmate-ui-core/webcontent/specmate.js b/bundles/specmate-ui-core/webcontent/specmate.js index 6fe62ef80..5a143af96 100644 --- a/bundles/specmate-ui-core/webcontent/specmate.js +++ b/bundles/specmate-ui-core/webcontent/specmate.js @@ -30,7 +30,7 @@ eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, ta /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar config_1 = __webpack_require__(2);\r\nvar strings_1 = __webpack_require__(189);\r\nvar Url = /** @class */ (function () {\r\n function Url() {\r\n }\r\n Url.basePath = function (cls) {\r\n return config_1.Config.VIEW_URL_PREFIX + cls.className;\r\n };\r\n Url.parent = function (url) {\r\n var parts = url.split(Url.SEP);\r\n parts.splice(parts.length - 1, 1);\r\n var parentUrl = Url.build(parts);\r\n if (parentUrl.length === 0) {\r\n parentUrl = Url.SEP;\r\n }\r\n return parentUrl;\r\n };\r\n Url.isRoot = function (url) {\r\n return url === undefined || url === null || url === Url.SEP || url.length === 0;\r\n };\r\n Url.isParent = function (parentUrl, childUrl) {\r\n return strings_1.Strings.contains(childUrl, parentUrl) && childUrl !== parentUrl;\r\n };\r\n Url.build = function (parts, preventCache) {\r\n if (parts.filter(function (part) { return part === undefined; }).length > 0) {\r\n console.error('Supplied undefined part for URL building!');\r\n console.error(parts);\r\n }\r\n var joined = parts.join(Url.SEP);\r\n var url = Url.clean(joined);\r\n if (preventCache) {\r\n url += '?' + (new Date()).getTime();\r\n }\r\n return url;\r\n };\r\n Url.parts = function (url) {\r\n if (url) {\r\n return url.split(Url.SEP);\r\n }\r\n return null;\r\n };\r\n Url.clean = function (url) {\r\n while (url.indexOf(Url.SEP + Url.SEP) >= 0) {\r\n url = url.replace(Url.SEP + Url.SEP, Url.SEP);\r\n }\r\n if (url.startsWith(Url.SEP)) {\r\n url = url.slice(1, url.length);\r\n }\r\n return url;\r\n };\r\n Url.fromParams = function (params) {\r\n return params['url'];\r\n };\r\n Url.urlCreate = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, Url.parent(url), config_1.Config.URL_CONTENTS]);\r\n };\r\n Url.urlDelete = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_DELETE]);\r\n };\r\n Url.urlUpdate = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_ELEMENT]);\r\n };\r\n Url.urlElement = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_ELEMENT], true);\r\n };\r\n Url.urlContents = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_CONTENTS], true);\r\n };\r\n Url.urlCustomService = function (url, serviceName) {\r\n return Url.build([config_1.Config.URL_BASE, url, serviceName], true);\r\n };\r\n Url.urlCheckConnectivity = function () {\r\n return Url.build([config_1.Config.URL_BASE, 'list'], true);\r\n };\r\n Url.SEP = '/';\r\n return Url;\r\n}());\r\nexports.Url = Url;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9hcHAvdXRpbC91cmwudHM/YTExOCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb25maWcgfSBmcm9tICcuLi9jb25maWcvY29uZmlnJztcbmltcG9ydCB7IFN0cmluZ3MgfSBmcm9tICcuL3N0cmluZ3MnO1xuaW1wb3J0IHsgUGFyYW1zIH0gZnJvbSAnQGFuZ3VsYXIvcm91dGVyJztcblxuZXhwb3J0IGNsYXNzIFVybCB7XG4gICAgcHVibGljIHN0YXRpYyBTRVAgPSAnLyc7XG5cbiAgICBwdWJsaWMgc3RhdGljIGJhc2VQYXRoKGNsczogeyBjbGFzc05hbWU6IHN0cmluZyB9KTogc3RyaW5nIHtcbiAgICAgICAgcmV0dXJuIENvbmZpZy5WSUVXX1VSTF9QUkVGSVggKyBjbHMuY2xhc3NOYW1lO1xuICAgIH1cblxuICAgIHB1YmxpYyBzdGF0aWMgcGFyZW50KHVybDogc3RyaW5nKTogc3RyaW5nIHtcbiAgICAgICAgbGV0IHBhcnRzOiBzdHJpbmdbXSA9IHVybC5zcGxpdChVcmwuU0VQKTtcbiAgICAgICAgcGFydHMuc3BsaWNlKHBhcnRzLmxlbmd0aCAtIDEsIDEpO1xuICAgICAgICBsZXQgcGFyZW50VXJsOiBzdHJpbmcgPSBVcmwuYnVpbGQocGFydHMpO1xuICAgICAgICBpZiAocGFyZW50VXJsLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcGFyZW50VXJsID0gVXJsLlNFUDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFyZW50VXJsO1xuICAgIH1cblxuICAgIHB1Y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7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFwRkE7QUFxRkE7QUFBQTtBQXRGQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar config_1 = __webpack_require__(2);\r\nvar strings_1 = __webpack_require__(189);\r\nvar Url = /** @class */ (function () {\r\n function Url() {\r\n }\r\n Url.basePath = function (cls) {\r\n return config_1.Config.VIEW_URL_PREFIX + cls.className;\r\n };\r\n Url.stripBasePath = function (path) {\r\n // Expected input: /-/basepath/url%2Fmorestuff\r\n // Output: url/morestuff\r\n path = decodeURIComponent(path);\r\n path = path.slice(config_1.Config.VIEW_URL_PREFIX.length);\r\n return path.slice(path.indexOf(this.SEP, path.indexOf(this.SEP) + 1) + 1);\r\n };\r\n Url.parent = function (url) {\r\n var parts = url.split(Url.SEP);\r\n parts.splice(parts.length - 1, 1);\r\n var parentUrl = Url.build(parts);\r\n if (parentUrl.length === 0) {\r\n parentUrl = Url.SEP;\r\n }\r\n return parentUrl;\r\n };\r\n Url.isRoot = function (url) {\r\n return url === undefined || url === null || url === Url.SEP || url.length === 0;\r\n };\r\n Url.isParent = function (parentUrl, childUrl) {\r\n return strings_1.Strings.contains(childUrl, parentUrl) && childUrl !== parentUrl;\r\n };\r\n Url.build = function (parts, preventCache) {\r\n if (parts.filter(function (part) { return part === undefined; }).length > 0) {\r\n console.error('Supplied undefined part for URL building!');\r\n console.error(parts);\r\n }\r\n var joined = parts.join(Url.SEP);\r\n var url = Url.clean(joined);\r\n if (preventCache) {\r\n url += '?' + (new Date()).getTime();\r\n }\r\n return url;\r\n };\r\n Url.parts = function (url) {\r\n if (url) {\r\n return url.split(Url.SEP);\r\n }\r\n return null;\r\n };\r\n Url.clean = function (url) {\r\n while (url.indexOf(Url.SEP + Url.SEP) >= 0) {\r\n url = url.replace(Url.SEP + Url.SEP, Url.SEP);\r\n }\r\n if (url.startsWith(Url.SEP)) {\r\n url = url.slice(1, url.length);\r\n }\r\n return url;\r\n };\r\n Url.fromParams = function (params) {\r\n return params['url'];\r\n };\r\n Url.urlCreate = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, Url.parent(url), config_1.Config.URL_CONTENTS]);\r\n };\r\n Url.urlDelete = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_DELETE]);\r\n };\r\n Url.urlUpdate = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_ELEMENT]);\r\n };\r\n Url.urlElement = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_ELEMENT], true);\r\n };\r\n Url.urlContents = function (url) {\r\n return Url.build([config_1.Config.URL_BASE, url, config_1.Config.URL_CONTENTS], true);\r\n };\r\n Url.urlCustomService = function (url, serviceName) {\r\n return Url.build([config_1.Config.URL_BASE, url, serviceName], true);\r\n };\r\n Url.urlCheckConnectivity = function () {\r\n return Url.build([config_1.Config.URL_BASE, 'list'], true);\r\n };\r\n Url.SEP = '/';\r\n return Url;\r\n}());\r\nexports.Url = Url;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWx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oVXJsLlNFUCk7XG4gICAgICAgIGxldCB1cmw6IHN0cmluZyA9IFVybC5jbGVhbihqb2luZWQpO1xuICAgICAgICBpZiAocHJldmVudENhY2hlKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgKG5ldyBEYXRlKCkpLmdldFRpbWUoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdXJsO1xuICAgIH1cblxuICAgIHB1YmxpYyBzdGF0aWMgcGFydHModXJsOiBzdHJpbmcpOiBzdHJpbmdbXSB7XG4gICAgICAgIGlmICh1cmwpIHtcbiAgICAgICAgICAgIHJldHVybiB1cmwuc3BsaXQoVXJsLlNFUCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgcHVibGljIHN0YXRpYyBjbGVhbih1cmw6IHN0cmluZykge1xuICAgICAgICB3aGlsZSAodXJsLmluZGV4T2YoVXJsLlNFUCArIFVybC5TRVApID49IDApIHtcbiAgICAgICAgICAgIHVybCA9IHVybC5yZXBsYWNlKFVybC5TRVAgKyBVcmwuU0VQLCBVcmwuU0VQKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodXJsLnN0YXJ0c1dpdGgoVXJsLlNFUCkpIHtcbiAgICAgICAgICAgIHVybCA9IHVybC5zbGljZSgxLCB1cmwubGVuZ3RoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdXJsO1xuICAgIH1cblxuICAgIHB1YmxpYyBzdGF0aWMgZnJvbVBhcmFtcyhwYXJhbXM6IFBhcmFtcyk6IHN0cmluZyB7XG4gICAgICAgIHJldHVybiBwYXJhbXNbJ3VybCddO1xuICAgIH1cblxuICAgIHB1YmxpYyBzdGF0aWMgdXJsQ3JlYXRlKHVybDogc3RyaW5nKTogc3RyaW5nIHtcbiAgICAgICAgcmV0dXJuIFVybC5idWlsZChbQ29uZmlnLlVSTF9CQVNFLCBVcmwucGFyZW50KHVybCksIENvbmZpZy5VUkxfQ09OVEVOVFNdKT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k7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIG5vZGVfbW9kdWxlcy9hbmd1bGFyMi10ZW1wbGF0ZS1sb2FkZXIhLi9zcmMvYXBwL3V0aWwvdXJsLnRzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFHQTtBQUFBO0FBOEZBO0FBM0ZBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBNUZBO0FBNkZBO0FBQUE7QUE5RkE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n"); /***/ }), /* 10 */, @@ -47,7 +47,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nva /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar specmate_data_service_1 = __webpack_require__(3);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar router_1 = __webpack_require__(66);\r\nvar url_1 = __webpack_require__(9);\r\nvar NavigatorService = /** @class */ (function () {\r\n function NavigatorService(dataService, logger, router, route) {\r\n var _this = this;\r\n this.dataService = dataService;\r\n this.logger = logger;\r\n this.router = router;\r\n this.route = route;\r\n this.history = [];\r\n this.current = -1;\r\n var subscription = this.router.events.subscribe(function (event) {\r\n if (event instanceof router_1.NavigationEnd && !_this.hasHistory) {\r\n if (!_this.route.snapshot.children[0] || !url_1.Url.fromParams(_this.route.snapshot.children[0].params)) {\r\n return;\r\n }\r\n var currentUrl_1 = url_1.Url.fromParams(_this.route.snapshot.children[0].params);\r\n _this.dataService.readElement(currentUrl_1, true)\r\n .then(function (element) {\r\n if (element) {\r\n _this.current = 0;\r\n _this.history[_this.current] = element;\r\n subscription.unsubscribe();\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('Could not load element: ' + currentUrl_1);\r\n })\r\n .then(function () { return _this.dataService.readContents(currentUrl_1, true); })\r\n .then(function (contents) { return _this._currentContents = contents; })\r\n .then(function () { return _this.hasNavigated.emit(_this.currentElement); });\r\n }\r\n });\r\n }\r\n Object.defineProperty(NavigatorService.prototype, \"hasNavigated\", {\r\n get: function () {\r\n if (!this._hasNavigated) {\r\n this._hasNavigated = new core_1.EventEmitter();\r\n }\r\n return this._hasNavigated;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n NavigatorService.prototype.navigate = function (element) {\r\n var _this = this;\r\n if (this.history[this.current] !== element) {\r\n this.history.splice(this.current + 1, 0, element);\r\n this.performNavigation(this.current + 1).then(function () {\r\n _this.history = _this.history.splice(0, _this.current + 1);\r\n _this.logger.debug('Navigated', _this.currentElement.url);\r\n }).catch(function () {\r\n _this.history.splice(_this.current + 1, 1);\r\n });\r\n }\r\n };\r\n NavigatorService.prototype.forward = function () {\r\n if (this.hasNext) {\r\n this.performNavigation(this.current + 1);\r\n }\r\n };\r\n NavigatorService.prototype.back = function () {\r\n if (this.hasPrevious) {\r\n this.performNavigation(this.current - 1);\r\n }\r\n };\r\n NavigatorService.prototype.performNavigation = function (index) {\r\n var _this = this;\r\n return this.router.navigate([url_1.Url.basePath(this.history[index]), this.history[index].url]).then(function (hasNavigated) {\r\n if (hasNavigated) {\r\n _this.current = index;\r\n _this.dataService.discardChanges();\r\n _this.dataService.clearCommits();\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('Navigation was not performed');\r\n })\r\n .then(function () { return _this.dataService.readContents(_this.currentElement.url, true); })\r\n .then(function (contents) { return _this._currentContents = contents; })\r\n .then(function () { return _this.hasNavigated.emit(_this.currentElement); });\r\n };\r\n Object.defineProperty(NavigatorService.prototype, \"currentElement\", {\r\n get: function () {\r\n return this.history[this.current];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"currentContents\", {\r\n get: function () {\r\n return this._currentContents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasPrevious\", {\r\n get: function () {\r\n return this.current > 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasNext\", {\r\n get: function () {\r\n return this.current < this.history.length - 1;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"previousElement\", {\r\n get: function () {\r\n if (this.hasPrevious) {\r\n return this.history[this.current - 1];\r\n }\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"nextElement\", {\r\n get: function () {\r\n if (this.hasNext) {\r\n return this.history[this.current + 1];\r\n }\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasHistory\", {\r\n get: function () {\r\n return this.current >= 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"isWelcome\", {\r\n get: function () {\r\n return !this.hasHistory && this.currentElement === undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n NavigatorService = __decorate([\r\n core_1.Injectable(),\r\n __metadata(\"design:paramtypes\", [specmate_data_service_1.SpecmateDataService,\r\n logging_service_1.LoggingService,\r\n router_1.Router,\r\n router_1.ActivatedRoute])\r\n ], NavigatorService);\r\n return NavigatorService;\r\n}());\r\nexports.NavigatorService = NavigatorService;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYXBwL21vZHVsZXMvbmF2aWdhdGlvbi9tb2R1bGVzL25hdmlnYXRvci9zZXJ2aWNlcy9uYXZpZ2F0b3Iuc2VydmljZS50cz80NGRjIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFN1YnNjcmlwdGlvbiB9IGZyb20gJ3J4anMvU3Vic2NyaXB0aW9uJztcbmltcG9ydCB7IEluamVjdGFibGUsIEV2ZW50RW1pdHRlciB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgSUNvbnRhaW5lciB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL21vZGVsL0lDb250YWluZXInO1xuaW1wb3J0IHsgU3BlY21hdGVEYXRh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gICAgICAgICAgIGlmIChldmVudCBpbnN0YW5jZW9mIE5hdmlnYXRpb25FbmQgJiYgIXRoaXMuaGFzSGlzdG9yeSkge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5yb3V0ZS5zbmFwc2hvdC5jaGlsZHJlblswXSB8fCAhVXJsLmZyb21QYXJhbXModGhpcy5yb3V0ZS5zbmFwc2hvdC5jaGlsZHJlblswXS5wYXJhbXMpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbnRVcmw6IHN0cmluZyA9IFVybC5mcm9tUGFyYW1zKHRoaXMucm91dGUuc25hcHNob3QuY2hpbGRyZW5bMF0ucGFyYW1zKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRhdGFTZXJ2aWNlLnJlYWRFbGVtZW50KGN1cnJlbnRVcmwsIHRydWUpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKChlbGVtZW50OiBJQ29udGFpbmVyKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oaXN0b3J5W3RoaXMuY3VycmVudF0gPSBlbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdCgnQ291bGQgbm90IGxvYWQgZWxlbWVudDogJyArIGN1cnJlbnRVcmwpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAudGhlbigoKSA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xlbWVudC51cmwpO1xuICAgICAgICAgICAgfSkuY2F0Y2goKCkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuaGlzdG9yeS5zcGxpY2UodGhpcy5jdXJyZW50ICsgMSwgMSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHB1YmxpYyBmb3J3YXJkKCk6IHZvaWQge1xuICAgICAgICBpZiAodGhpcy5oYXNOZXh0KSB7XG4gICAgICAgICAgICB0aGlzLnBlcmZvcm1OYXZpZ2F0aW9uKHRoaXMuY3VycmVudCArIDEpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHVibGljIGJhY2soKTogdm9pZCB7XG4gICAgICAgIGlmICh0aGlzLmhhc1ByZXZpb3VzKSB7XG4gICAgICAgICAgICB0aGlzLnBlcmZvcm1OYXZpZ2F0aW9uKHRoaXMuY3VycmVudCAtIDEpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBwZXJmb3JtTmF2aWdhdGlvbihpbmRleDogbnVtYmVyKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgICAgIHJldHVybiB0aGlzLnJvdXRlci5uYXZpZ2F0ZShbVXJsLmJhc2VQYXRoKHRoaXMuaGlzdG9yeVtpbmRleF0pLCB0aGlzLmhpc3RvcnlbaW5kZXhdLnVybF0pLnRoZW4oKGhhc05hdmlnYXRlZDogYm9vbGVhbikgPT4ge1xuICAgICAgICAgICAgaWYgKGhhc05hdmlnYXRlZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIHRoaXMuZGF0YVNlcnZpY2UuZGlzY2FyZENoYW5nZXMoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRhdGFTZXJ2aWNlLmNsZWFyQ29tbWl0cygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdCgnTmF2aWdhdGlvbiB3YXMgbm90IHBlcmZvcm1lZCcpO1xuICAgICAgICB9KVxuICAgICAgICAudGhlbigoKSA9PiB0aGlzLmRhdGFTZXJ2aWNlLnJlYWRDb250ZW50cyh0aGlzLmN1cnJlbnRFbGVtZW50LnVybCwgdHJ1ZSkpXG4gICAgICAgIC50aGVuKChjb250ZW50czogSUNvbnRhaW5lcltdKSA9PiB0aGlzLl9jdXJyZW50Q29udGVudHMgPSBjb250ZW50cylcbiAgICAgICAgLnRoZW4oKCkgPT4gdGhpcy5oYXNOYXZpZ2F0ZWQuZW1pdCh0aGlzLmN1cnJlbnRFbGVtZW50KSk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBjdXJyZW50RWxlbWVudCgpOiBJQ29udGFpbmVyIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaGlzdG9yeVt0aGlzLmN1cnJlbnRdO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgY3VycmVudENvbnRlbnRzKCk6IElDb250YWluZXJbXSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50Q29udGVudHM7XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBoYXNQcmV2aW91cygpOiBib29sZWFuIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY3VycmVudCA+IDA7XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBoYXNOZXh0KCk6IGJvb2xlYW4ge1xuICAgICAgICByZXR1cm4gdGhpcy5jdXJyZW50IDwgdGhpcy5oaXN0b3J5Lmxlbmd0aCAtIDE7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBnZXQgcHJldmlvdXNFbGVtZW50KCk6IElDb250YWluZXIge1xuICAgICAgICBpZiAodGhpcy5oYXNQcmV2aW91cykge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaGlzdG9yeVt0aGlzLmN1cnJlbnQgLSAxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1c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FFQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQUVBO0FBQUE7QUFDQTtBQUNBOzs7QUFBQTtBQXRIQTtBQURBO0FBU0E7QUFDQTtBQUNBO0FBQ0E7QUFYQTtBQXVIQTtBQUFBO0FBdkhBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///14\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar specmate_data_service_1 = __webpack_require__(3);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar router_1 = __webpack_require__(66);\r\nvar url_1 = __webpack_require__(9);\r\nvar common_1 = __webpack_require__(18);\r\nvar NavigatorService = /** @class */ (function () {\r\n function NavigatorService(dataService, logger, router, location) {\r\n var _this = this;\r\n this.dataService = dataService;\r\n this.logger = logger;\r\n this.router = router;\r\n this.location = location;\r\n this.history = [];\r\n this.current = -1;\r\n this.location.subscribe(function (pse) {\r\n _this.handleBrowserBackForwardButton(url_1.Url.stripBasePath(pse.url));\r\n });\r\n var subscription = this.router.events.subscribe(function (event) {\r\n if (event instanceof router_1.NavigationEnd && _this.location.path()) {\r\n var currentUrl_1 = url_1.Url.stripBasePath(_this.location.path());\r\n _this.dataService.readElement(currentUrl_1, true)\r\n .then(function (element) {\r\n if (element) {\r\n if (!_this.hasHistory) {\r\n _this.current = 0;\r\n _this.history[_this.current] = element;\r\n }\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('Could not load element: ' + currentUrl_1);\r\n })\r\n .then(function () { return _this.dataService.readContents(currentUrl_1, true); })\r\n .then(function (contents) { return _this._currentContents = contents; })\r\n .then(function () { return _this.hasNavigated.emit(_this.currentElement); });\r\n }\r\n });\r\n }\r\n Object.defineProperty(NavigatorService.prototype, \"hasNavigated\", {\r\n get: function () {\r\n if (!this._hasNavigated) {\r\n this._hasNavigated = new core_1.EventEmitter();\r\n }\r\n return this._hasNavigated;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n NavigatorService.prototype.navigate = function (element) {\r\n var _this = this;\r\n if (this.history[this.current] !== element) {\r\n this.history.splice(this.current + 1, 0, element);\r\n this.performNavigation(this.current + 1).then(function () {\r\n _this.history = _this.history.splice(0, _this.current + 1);\r\n _this.logger.debug('Navigated', _this.currentElement.url);\r\n }).catch(function () {\r\n _this.history.splice(_this.current + 1, 1);\r\n });\r\n }\r\n };\r\n NavigatorService.prototype.forward = function () {\r\n if (this.hasNext) {\r\n this.performNavigation(this.current + 1);\r\n }\r\n };\r\n NavigatorService.prototype.back = function () {\r\n if (this.hasPrevious) {\r\n this.performNavigation(this.current - 1);\r\n }\r\n };\r\n NavigatorService.prototype.performNavigation = function (index) {\r\n var _this = this;\r\n return this.router.navigate([url_1.Url.basePath(this.history[index]), this.history[index].url]).then(function (hasNavigated) {\r\n if (hasNavigated) {\r\n _this.current = index;\r\n _this.dataService.discardChanges();\r\n _this.dataService.clearCommits();\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('Navigation was not performed');\r\n });\r\n };\r\n NavigatorService.prototype.handleBrowserBackForwardButton = function (navigatedTo) {\r\n var previous = this.previousElement;\r\n var next = this.nextElement;\r\n if (previous && navigatedTo == previous.url) {\r\n this.current -= 1;\r\n }\r\n else if (next && navigatedTo == next.url) {\r\n this.current += 1;\r\n }\r\n this.dataService.discardChanges();\r\n this.dataService.clearCommits();\r\n };\r\n Object.defineProperty(NavigatorService.prototype, \"currentElement\", {\r\n get: function () {\r\n return this.history[this.current];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"currentContents\", {\r\n get: function () {\r\n return this._currentContents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasPrevious\", {\r\n get: function () {\r\n return this.current > 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasNext\", {\r\n get: function () {\r\n return this.current < this.history.length - 1;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"previousElement\", {\r\n get: function () {\r\n if (this.hasPrevious) {\r\n return this.history[this.current - 1];\r\n }\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"nextElement\", {\r\n get: function () {\r\n if (this.hasNext) {\r\n return this.history[this.current + 1];\r\n }\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"hasHistory\", {\r\n get: function () {\r\n return this.current >= 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NavigatorService.prototype, \"isWelcome\", {\r\n get: function () {\r\n return !this.hasHistory && this.currentElement === undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n NavigatorService = __decorate([\r\n core_1.Injectable(),\r\n __metadata(\"design:paramtypes\", [specmate_data_service_1.SpecmateDataService,\r\n logging_service_1.LoggingService,\r\n router_1.Router,\r\n common_1.Location])\r\n ], NavigatorService);\r\n return NavigatorService;\r\n}());\r\nexports.NavigatorService = NavigatorService;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYXBwL21vZHVsZXMvbmF2aWdhdGlvbi9tb2R1bGVzL25hdmlnYXRvci9zZXJ2aWNlcy9uYXZpZ2F0b3Iuc2VydmljZS50cz80NGRjIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFN1YnNjcmlwdGlvbiB9IGZyb20gJ3J4anMvU3Vic2NyaXB0aW9uJztcbmltcG9ydCB7IEluamVjdGFibGUsIEV2ZW50RW1pdHRlciB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgSUNvbnRhaW5lciB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL21vZGVsL0lDb250YWluZXInO1xuaW1wb3J0IHsgU3BlY21hdGVEYXRhU2VydmljZSB9IGZyb20gJy4uLy4uLy4uLy4uL2RhdGEvbW9kdWxlcy9kYXRhLXNlcnZpY2Uvc2VydmljZX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ICBsZXQgc3Vic2NyaXB0aW9uOiBTdWJzY3JpcHRpb24gPSB0aGlzLnJvdXRlci5ldmVudHMuc3Vic2NyaWJlKChldmVudCkgPT4ge1xuICAgICAgICAgICAgaWYgKGV2ZW50IGluc3RhbmNlb2YgTmF2aWdhdGlvbkVuZCAmJiB0aGlzLmxvY2F0aW9uLnBhdGgoKSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW50VXJsOiBzdHJpbmcgPSBVcmwuc3RyaXBCYXNlUGF0aCh0aGlzLmxvY2F0aW9uLnBhdGgoKSk7XG4gICAgICAgICAgICAgICAgdGhpcy5kYXRhU2VydmljZS5yZWFkRWxlbWVudChjdXJyZW50VXJsLCB0cnVlKVxuICAgICAgICAgICAgICAgICAgICAudGhlbigoZWxlbWVudDogSUNvbnRhaW5lcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaGFzSGlzdG9yeSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGlzdG9yeVt0aGlzLmN1cnJlbnRdID0gZWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KCdDb3VsZCBub3QgbG9hZCBlbGVtZW50OiAnICsgY3VycmVudFVybCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKCgpID0+IHRoaXMuZGF0YVNlcnZpY2UucmVhZENvbnRlbnRzKGN1cnJlbnRVcmwsIHRydWUpKVxuICAgIC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b3J5LnNwbGljZSh0aGlzLmN1cnJlbnQgKyAxLCAxKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHVibGljIGZvcndhcmQoKTogdm9pZCB7XG4gICAgICAgIGlmICh0aGlzLmhhc05leHQpIHtcbiAgICAgICAgICAgIHRoaXMucGVyZm9ybU5hdmlnYXRpb24odGhpcy5jdXJyZW50ICsgMSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwdWJsaWMgYmFjaygpOiB2b2lkIHtcbiAgICAgICAgaWYgKHRoaXMuaGFzUHJldmlvdXMpIHtcbiAgICAgICAgICAgIHRoaXMucGVyZm9ybU5hdmlnYXRpb24odGhpcy5jdXJyZW50IC0gMSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHBlcmZvcm1OYXZpZ2F0aW9uKGluZGV4OiBudW1iZXIpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMucm91dGVyLm5hdmlnYXRlKFtVcmwuYmFzZVBhdGgodGhpcy5oaXN0b3J5W2luZGV4XSksIHRoaXMuaGlzdG9yeVtpbmRleF0udXJsXSkudGhlbigoaGFzTmF2aWdhdGVkOiBib29sZWFuKSA9PiB7XG4gICAgICAgICAgICBpZiAoaGFzTmF2aWdhdGVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgdGhpcy5kYXRhU2VydmljZS5kaXNjYXJkQ2hhbmdlcygpO1xuICAgICAgICAgICAgICAgIHRoaXMuZGF0YVNlcnZpY2UuY2xlYXJDb21taXRzKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KCdOYXZpZ2F0aW9uIHdhcyBub3QgcGVyZm9ybWVkJyk7XG4gICAgICAgIH0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+316,7 @@ eval("\r\nvar __extends = (this && this.__extends) || (function () {\r\n var /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar forms_1 = __webpack_require__(19);\r\nvar id_1 = __webpack_require__(11);\r\nvar SimpleInputFormBase = /** @class */ (function () {\r\n function SimpleInputFormBase() {\r\n this.formGroup = new forms_1.FormGroup({});\r\n }\r\n Object.defineProperty(SimpleInputFormBase.prototype, \"modelElement\", {\r\n get: function () {\r\n return this._modelElement;\r\n },\r\n set: function (modelElement) {\r\n this._modelElement = modelElement;\r\n if (this._modelElement) {\r\n this.buildFormGroup();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SimpleInputFormBase.prototype.ngDoCheck = function (args) {\r\n this.updateFormGroupIfChanged(this.modelElement, this.fields);\r\n };\r\n SimpleInputFormBase.prototype.updateFormGroupIfChanged = function (modelElement, fields) {\r\n var _this = this;\r\n if (!modelElement) {\r\n return;\r\n }\r\n var changed = false;\r\n fields.forEach(function (field) {\r\n var currentFormValue = _this.formGroup.controls[field].value;\r\n var currentModelValue = modelElement[field];\r\n if (currentFormValue !== currentModelValue) {\r\n changed = true;\r\n }\r\n });\r\n if (changed) {\r\n var formBuilderObject_1 = {};\r\n fields.forEach(function (field) {\r\n formBuilderObject_1[field] = _this.modelElement[field];\r\n });\r\n this.formGroup.setValue(formBuilderObject_1);\r\n }\r\n };\r\n SimpleInputFormBase.prototype.buildFormGroup = function () {\r\n var _this = this;\r\n this.formGroup = this.buildFormGroupObject(this.modelElement, this.fields);\r\n this.formGroup.valueChanges.subscribe(function () { return _this.updateModelPropertiesIfChanged(_this.modelElement, _this.fields); });\r\n };\r\n SimpleInputFormBase.prototype.buildFormGroupObject = function (modelElement, fields) {\r\n var formGroupObject = {};\r\n for (var i = 0; i < fields.length; i++) {\r\n var currentField = fields[i];\r\n formGroupObject[currentField] = new forms_1.FormControl(modelElement[currentField], forms_1.Validators.required);\r\n }\r\n return new forms_1.FormGroup(formGroupObject);\r\n };\r\n SimpleInputFormBase.prototype.updateModelPropertiesIfChanged = function (modelElement, fields) {\r\n var changed = false;\r\n for (var i = 0; i < fields.length; i++) {\r\n var currentChanged = this.updateModelPropertyIfChanged(modelElement, fields[i]);\r\n if (currentChanged) {\r\n changed = true;\r\n }\r\n }\r\n if (changed) {\r\n this.dataService.updateElement(modelElement, true, id_1.Id.uuid);\r\n }\r\n };\r\n SimpleInputFormBase.prototype.updateModelPropertyIfChanged = function (modelElement, field) {\r\n var formValue = this.formGroup.controls[field].value;\r\n var modelValue = modelElement[field];\r\n if (modelValue !== formValue) {\r\n modelElement[field] = formValue;\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(SimpleInputFormBase.prototype, \"isInitialized\", {\r\n get: function () {\r\n var _this = this;\r\n return !this.fields.some(function (field) { return _this.formGroup.controls[field] === undefined; });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return SimpleInputFormBase;\r\n}());\r\nexports.SimpleInputFormBase = SimpleInputFormBase;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2Jhc2Uvc2ltcGxlLWlucHV0LWZvcm0tYmFzZS50cz9hNzIyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUNvbnRyb2wsIFZhbGlkYXRvcnMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBJQ29udGFpbmVyIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vbW9kZWwvSUNvbnRhaW5lcic7XG5pbXBvcnQgeyBTcGVjbWF0ZURhdGFTZXJ2aWNlIH0gZnJvbSAnLi4vLi4v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VzL2FuZ3VsYXIyLXRlbXBsYXRlLWxvYWRlciEuL3NyYy9hcHAvbW9kdWxlcy9mb3Jtcy9tb2R1bGVzL2dlbmVyaWMtZm9ybS9iYXNlL3NpbXBsZS1pbnB1dC1mb3JtLWJhc2UudHMiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFHQTtBQUVBO0FBa0JBO0FBQ0E7QUFDQTtBQWJBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFQQTtBQWFBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUFBO0FBeEZBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///104\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar forms_1 = __webpack_require__(20);\r\nvar id_1 = __webpack_require__(11);\r\nvar SimpleInputFormBase = /** @class */ (function () {\r\n function SimpleInputFormBase() {\r\n this.formGroup = new forms_1.FormGroup({});\r\n }\r\n Object.defineProperty(SimpleInputFormBase.prototype, \"modelElement\", {\r\n get: function () {\r\n return this._modelElement;\r\n },\r\n set: function (modelElement) {\r\n this._modelElement = modelElement;\r\n if (this._modelElement) {\r\n this.buildFormGroup();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SimpleInputFormBase.prototype.ngDoCheck = function (args) {\r\n this.updateFormGroupIfChanged(this.modelElement, this.fields);\r\n };\r\n SimpleInputFormBase.prototype.updateFormGroupIfChanged = function (modelElement, fields) {\r\n var _this = this;\r\n if (!modelElement) {\r\n return;\r\n }\r\n var changed = false;\r\n fields.forEach(function (field) {\r\n var currentFormValue = _this.formGroup.controls[field].value;\r\n var currentModelValue = modelElement[field];\r\n if (currentFormValue !== currentModelValue) {\r\n changed = true;\r\n }\r\n });\r\n if (changed) {\r\n var formBuilderObject_1 = {};\r\n fields.forEach(function (field) {\r\n formBuilderObject_1[field] = _this.modelElement[field];\r\n });\r\n this.formGroup.setValue(formBuilderObject_1);\r\n }\r\n };\r\n SimpleInputFormBase.prototype.buildFormGroup = function () {\r\n var _this = this;\r\n this.formGroup = this.buildFormGroupObject(this.modelElement, this.fields);\r\n this.formGroup.valueChanges.subscribe(function () { return _this.updateModelPropertiesIfChanged(_this.modelElement, _this.fields); });\r\n };\r\n SimpleInputFormBase.prototype.buildFormGroupObject = function (modelElement, fields) {\r\n var formGroupObject = {};\r\n for (var i = 0; i < fields.length; i++) {\r\n var currentField = fields[i];\r\n formGroupObject[currentField] = new forms_1.FormControl(modelElement[currentField], forms_1.Validators.required);\r\n }\r\n return new forms_1.FormGroup(formGroupObject);\r\n };\r\n SimpleInputFormBase.prototype.updateModelPropertiesIfChanged = function (modelElement, fields) {\r\n var changed = false;\r\n for (var i = 0; i < fields.length; i++) {\r\n var currentChanged = this.updateModelPropertyIfChanged(modelElement, fields[i]);\r\n if (currentChanged) {\r\n changed = true;\r\n }\r\n }\r\n if (changed) {\r\n this.dataService.updateElement(modelElement, true, id_1.Id.uuid);\r\n }\r\n };\r\n SimpleInputFormBase.prototype.updateModelPropertyIfChanged = function (modelElement, field) {\r\n var formValue = this.formGroup.controls[field].value;\r\n var modelValue = modelElement[field];\r\n if (modelValue !== formValue) {\r\n modelElement[field] = formValue;\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(SimpleInputFormBase.prototype, \"isInitialized\", {\r\n get: function () {\r\n var _this = this;\r\n return !this.fields.some(function (field) { return _this.formGroup.controls[field] === undefined; });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return SimpleInputFormBase;\r\n}());\r\nexports.SimpleInputFormBase = SimpleInputFormBase;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2Jhc2Uvc2ltcGxlLWlucHV0LWZvcm0tYmFzZS50cz9hNzIyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUNvbnRyb2wsIFZhbGlkYXRvcnMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBJQ29udGFpbmVyIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vbW9kZWwvSUNvbnRhaW5lcic7XG5pbXBvcnQgeyBTcGVjbWF0ZURhdGFTZXJ2aWNlIH0gZnJvbSAnLi4vLi4vLi4vLi4vZGF0YS9tb2R1bGVzL2RhdGEtc2VydmljZS9zZXJ2aWNlcy9zcGVjbWF0ZS1kYXRhLnNlcnZpY2UnO1xuaW1wb3J0IHsgSWQgfSBmcm9tICcuLi8uLi8uLi8uLi8uLi91dGlsL2lkJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIFNpbXBsZUlucHV0Rm9ybUJhc2Uge1xuXG4gICAgcHJpdmF0ZSBfbW9kZWxFbGVtZW50OiBJQ29udGFpbmVyO1xuICAgIHByb3RlY3RlZCBmaWVsZHM6IHN0cmluZ1tdO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QUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUFBO0FBeEZBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///104\n"); /***/ }), /* 105 */, @@ -370,7 +370,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nva /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar forms_1 = __webpack_require__(19);\r\nvar field_meta_1 = __webpack_require__(193);\r\nvar FormElement = /** @class */ (function () {\r\n function FormElement() {\r\n this.errorMessage = 'This field is required.';\r\n }\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", field_meta_1.FieldMetaItem)\r\n ], FormElement.prototype, \"meta\", void 0);\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", forms_1.FormGroup)\r\n ], FormElement.prototype, \"form\", void 0);\r\n return FormElement;\r\n}());\r\nexports.FormElement = FormElement;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2Jhc2UvZm9ybS1lbGVtZW50LnRzP2ZjNjciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5wdXQgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEZvcm1Hcm91cCB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IEZpZWxkTWV0YUl0ZW0gfSBmcm9tICcuLi8uLi8uLi8uLi8uLi9tb2RlbC9tZXRhL2ZpZWxkLW1ldGEnO1xuXG5leHBvcnQgYWJzdHJhY3QgY2xhc3MgRm9ybUVsZW1lbnQge1xuXG4gICAgQElucHV0KClcbiAgICBwdWJsaWMgbWV0YTogRmllbGRNZXRhSXRlbTtcblxuICAgIEBJbnB1dCgpXG4gICAgcHVibGljIGZvcm06IEZvcm1Hcm91cDtcblxuICAgIHB1YmxpYyBlcnJvck1lc3NhZ2UgPSAnVGhpcyBmaWVsZCBpcyByZXF1aXJlZC4nO1xufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIG5vZGVfbW9kdWxlcy9hbmd1bGFyMi10ZW1wbGF0ZS1sb2FkZXIhLi9zcmMvYXBwL21vZHVsZXMvZm9ybXMvbW9kdWxlcy9nZW5lcmljLWZvcm0vYmFzZS9mb3JtLWVsZW1lbnQudHMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQVFBO0FBQ0E7QUFOQTtBQURBO0FBQ0E7QUFBQTtBQUdBO0FBREE7QUFDQTtBQUFBO0FBR0E7QUFBQTtBQVRBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///128\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar forms_1 = __webpack_require__(20);\r\nvar field_meta_1 = __webpack_require__(193);\r\nvar FormElement = /** @class */ (function () {\r\n function FormElement() {\r\n this.errorMessage = 'This field is required.';\r\n }\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", field_meta_1.FieldMetaItem)\r\n ], FormElement.prototype, \"meta\", void 0);\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", forms_1.FormGroup)\r\n ], FormElement.prototype, \"form\", void 0);\r\n return FormElement;\r\n}());\r\nexports.FormElement = FormElement;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base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 @@ -690,7 +690,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar forms_1 = __webpack_require__(19);\r\nvar type_1 = __webpack_require__(5);\r\nvar field_meta_1 = __webpack_require__(193);\r\nvar arrays_1 = __webpack_require__(101);\r\nvar specmate_data_service_1 = __webpack_require__(3);\r\nvar converters_1 = __webpack_require__(614);\r\nvar id_1 = __webpack_require__(11);\r\nvar GenericForm = /** @class */ (function () {\r\n function GenericForm(formBuilder, dataService) {\r\n this.formBuilder = formBuilder;\r\n this.dataService = dataService;\r\n this.errorMessage = 'This field is invalid.';\r\n this.ready = false;\r\n this.initEmpty();\r\n }\r\n Object.defineProperty(GenericForm.prototype, \"element\", {\r\n get: function () {\r\n return this._element;\r\n },\r\n set: function (element) {\r\n if (!element) {\r\n return;\r\n }\r\n if (!this._element || !type_1.Type.is(this._element, element)) {\r\n this._element = element;\r\n this.ready = false;\r\n this.createForm();\r\n }\r\n else {\r\n this._element = element;\r\n this.updateForm();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GenericForm.prototype, \"meta\", {\r\n get: function () {\r\n var _this = this;\r\n if (!this._meta) {\r\n return [];\r\n }\r\n return this._meta.filter(function (metaItem) { return !arrays_1.Arrays.contains(_this.hiddenFields, metaItem.name); });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n GenericForm.prototype.ngDoCheck = function (args) {\r\n this.updateForm();\r\n };\r\n GenericForm.prototype.orderFieldMeta = function () {\r\n this._meta.sort(function (item1, item2) { return Number.parseInt(item1.position) - Number.parseInt(item2.position); });\r\n };\r\n GenericForm.prototype.initEmpty = function () {\r\n this.formGroup = this.formBuilder.group({});\r\n };\r\n GenericForm.prototype.createForm = function () {\r\n var _this = this;\r\n if (!this._element) {\r\n return;\r\n }\r\n this._meta = field_meta_1.MetaInfo[this.element.className];\r\n if (!this._meta) {\r\n this.initEmpty();\r\n return;\r\n }\r\n this.orderFieldMeta();\r\n var formBuilderObject = {};\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var formBuilderObjectValue = [''];\r\n if (this._meta[i].required) {\r\n formBuilderObjectValue.push(forms_1.Validators.required);\r\n }\r\n formBuilderObject[fieldName] = formBuilderObjectValue;\r\n }\r\n this.formGroup = this.formBuilder.group(formBuilderObject);\r\n this.formGroup.valueChanges.subscribe(function () {\r\n _this.updateFormModel();\r\n return '';\r\n });\r\n this.ready = true;\r\n this.updateForm();\r\n };\r\n GenericForm.prototype.updateForm = function () {\r\n if (!this.ready) {\r\n return;\r\n }\r\n var changed = false;\r\n var formBuilderObject = {};\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var fieldType = fieldMeta.type;\r\n var updateValue = this.element[fieldName] || '';\r\n var converter = converters_1.Converters[fieldMeta.type];\r\n if (converter) {\r\n updateValue = converter.convertFromModelToControl(updateValue);\r\n }\r\n formBuilderObject[fieldName] = updateValue;\r\n if (this.formGroup.controls[fieldName].value !== updateValue) {\r\n changed = true;\r\n }\r\n }\r\n if (changed) {\r\n this.formGroup.setValue(formBuilderObject);\r\n }\r\n };\r\n GenericForm.prototype.updateFormModel = function () {\r\n // We need this, since in some cases, the update event on the control is fired,\r\n // even though the data did actually not change. We want to prevent unnecessary updates.\r\n var changed = false;\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var updateValue = this.formGroup.controls[fieldName].value;\r\n if (updateValue === undefined) {\r\n updateValue = '';\r\n }\r\n var converter = converters_1.Converters[fieldMeta.type];\r\n if (converter) {\r\n updateValue = converter.convertFromControlToModel(updateValue);\r\n }\r\n // We do not need to clone here (hopefully), because only simple values can be passed via forms.\r\n if (this.element[fieldName] + '' !== updateValue + '') {\r\n this.element[fieldName] = updateValue;\r\n changed = true;\r\n }\r\n }\r\n if (changed && this.isValid) {\r\n this.dataService.updateElement(this.element, true, id_1.Id.uuid);\r\n }\r\n };\r\n Object.defineProperty(GenericForm.prototype, \"isValid\", {\r\n get: function () {\r\n return this.formGroup.valid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", Array)\r\n ], GenericForm.prototype, \"hiddenFields\", void 0);\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", Object),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], GenericForm.prototype, \"element\", null);\r\n GenericForm = __decorate([\r\n core_1.Component({\r\n moduleId: module.i.toString(),\r\n selector: 'generic-form',\r\n template: __webpack_require__(615)\r\n }),\r\n __metadata(\"design:paramtypes\", [forms_1.FormBuilder, specmate_data_service_1.SpecmateDataService])\r\n ], GenericForm);\r\n return GenericForm;\r\n}());\r\nexports.GenericForm = GenericForm;\r\nvar FieldType = /** @class */ (function () {\r\n function FieldType() {\r\n }\r\n FieldType.TEXT = 'text';\r\n FieldType.TEXT_LONG = 'longText';\r\n FieldType.CHECKBOX = 'checkbox';\r\n FieldType.SINGLE_SELECT = 'singleSelect';\r\n return FieldType;\r\n}());\r\nexports.FieldType = FieldType;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2NvbXBvbmVudHMvZ2VuZXJpYy1mb3JtLmNvbXBvbmVudC50cz9iMjVlIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgSW5wdXQgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUJ1aWxkZXIsIFZhbGlkYXRvcnMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBUeXBlIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vdXRpbC90eXBlJztcbmltcG9ydCB7IEZpZWxkTWV0YUl0ZW0sIE1ldGFJbmZvIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vbW9kZWwvbWV0YS9maWVsZC1tZXRhJztcbmltcG9ydCB7IEFycmF5cyB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL3V0aWwvYXJyYXlzJztcbmltcG9ydCB7IFNwZWNtYXRlRGF0YVNlcnZpY2UgfSBmcm9tICcuLi8uLi8uLi8uLi9kYXRhL21vZHVsZXMvZGF0YS1zZXJ2aWNlL3NlcnZpY2VzL3NwZWNtYXRlLWRhdGEuc2VydmljZSc7XG5pbXBvcnQgeyBDb252ZXJ0ZXJzIH0gZnJvbSAnLi4vY29udmVyc2lvbi9jb252ZXJ0ZXJzJztcbmltcG9ydCB7IElkIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vdXRpbC9pZCc7XG5cbkBDb21wb25lbnQoe1xuICAgIG1vZHVsZUlkOiBtb2R1bGUuaWQudG9TdHJp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B0aGlzLl9tZXRhID0gTWV0YUluZm9bdGhpcy5lbGVtZW50LmNsYXNzTmFtZV07XG4gICAgICAgIGlmICghdGhpcy5fbWV0YSkge1xuICAgICAgICAgICAgdGhpcy5pbml0RW1wdHkoKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9yZGVyRmllbGRNZXRhKCk7XG4gICAgICAgIGxldCBmb3JtQnVpbGRlck9iamVjdDogYW55ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fbWV0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGZpZWxkTWV0YTogRmllbGRNZXRhSXRlbSA9IHRoaXMuX21ldGFbaV07XG4gICAgICAgICAgICBsZXQgZmllbGROYW1lOiBzdHJpbmcgPSBmaWVsZE1ldGEubmFtZTtcbiAgICAgICAgICAgIGxldCBmb3JtQnVpbGRlck9iamVjdFZhbHVlOiBhbnlbXSA9IFsnJ107XG4gICAgICAgICAgICBpZiAodGhpcy5fbWV0YVtpXS5yZXF1aXJlZCkge1xuICAgICAgICAgICAgICAgIGZvcm1CdWlsZGVyT2JqZWN0VmFsdWUucHVzaChWYWxpZGF0b3JzLnJlcXVpcmVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvcm1CdWlsZGVyT2JqZWN0W2ZpZWxkTmFtZV0gPSBmb3JtQnVpbGRlck9iamVjdFZhbHVlO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZm9ybUdyb3VwID0gdGhpcy5mb3JtQnVpbGRlci5ncm91cChmb3JtQnVpbGRlck9iamVjdCk7XG5cbiAgICAgICAgdGhpcy5mb3JtR3JvdXAudmFsdWVDaGFuZ2VzLnN1YnNjcmliZSgoKSA9PiB7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZUZvcm1Nb2RlbCgpO1xuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9KTtcbiAgICAgICAgdG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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQ0E7OztBQUFBO0FBaklBO0FBREE7O0FBQ0E7QUFTQTtBQURBOzs7QUFhQTtBQWhDQTtBQUxBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUEwQ0E7QUF6Q0E7QUE2SUE7QUFBQTtBQTdJQTtBQStJQTtBQUFBO0FBS0E7QUFKQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFMQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///310\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar forms_1 = __webpack_require__(20);\r\nvar type_1 = __webpack_require__(5);\r\nvar field_meta_1 = __webpack_require__(193);\r\nvar arrays_1 = __webpack_require__(101);\r\nvar specmate_data_service_1 = __webpack_require__(3);\r\nvar converters_1 = __webpack_require__(614);\r\nvar id_1 = __webpack_require__(11);\r\nvar GenericForm = /** @class */ (function () {\r\n function GenericForm(formBuilder, dataService) {\r\n this.formBuilder = formBuilder;\r\n this.dataService = dataService;\r\n this.errorMessage = 'This field is invalid.';\r\n this.ready = false;\r\n this.initEmpty();\r\n }\r\n Object.defineProperty(GenericForm.prototype, \"element\", {\r\n get: function () {\r\n return this._element;\r\n },\r\n set: function (element) {\r\n if (!element) {\r\n return;\r\n }\r\n if (!this._element || !type_1.Type.is(this._element, element)) {\r\n this._element = element;\r\n this.ready = false;\r\n this.createForm();\r\n }\r\n else {\r\n this._element = element;\r\n this.updateForm();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GenericForm.prototype, \"meta\", {\r\n get: function () {\r\n var _this = this;\r\n if (!this._meta) {\r\n return [];\r\n }\r\n return this._meta.filter(function (metaItem) { return !arrays_1.Arrays.contains(_this.hiddenFields, metaItem.name); });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n GenericForm.prototype.ngDoCheck = function (args) {\r\n this.updateForm();\r\n };\r\n GenericForm.prototype.orderFieldMeta = function () {\r\n this._meta.sort(function (item1, item2) { return Number.parseInt(item1.position) - Number.parseInt(item2.position); });\r\n };\r\n GenericForm.prototype.initEmpty = function () {\r\n this.formGroup = this.formBuilder.group({});\r\n };\r\n GenericForm.prototype.createForm = function () {\r\n var _this = this;\r\n if (!this._element) {\r\n return;\r\n }\r\n this._meta = field_meta_1.MetaInfo[this.element.className];\r\n if (!this._meta) {\r\n this.initEmpty();\r\n return;\r\n }\r\n this.orderFieldMeta();\r\n var formBuilderObject = {};\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var formBuilderObjectValue = [''];\r\n if (this._meta[i].required) {\r\n formBuilderObjectValue.push(forms_1.Validators.required);\r\n }\r\n formBuilderObject[fieldName] = formBuilderObjectValue;\r\n }\r\n this.formGroup = this.formBuilder.group(formBuilderObject);\r\n this.formGroup.valueChanges.subscribe(function () {\r\n _this.updateFormModel();\r\n return '';\r\n });\r\n this.ready = true;\r\n this.updateForm();\r\n };\r\n GenericForm.prototype.updateForm = function () {\r\n if (!this.ready) {\r\n return;\r\n }\r\n var changed = false;\r\n var formBuilderObject = {};\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var fieldType = fieldMeta.type;\r\n var updateValue = this.element[fieldName] || '';\r\n var converter = converters_1.Converters[fieldMeta.type];\r\n if (converter) {\r\n updateValue = converter.convertFromModelToControl(updateValue);\r\n }\r\n formBuilderObject[fieldName] = updateValue;\r\n if (this.formGroup.controls[fieldName].value !== updateValue) {\r\n changed = true;\r\n }\r\n }\r\n if (changed) {\r\n this.formGroup.setValue(formBuilderObject);\r\n }\r\n };\r\n GenericForm.prototype.updateFormModel = function () {\r\n // We need this, since in some cases, the update event on the control is fired,\r\n // even though the data did actually not change. We want to prevent unnecessary updates.\r\n var changed = false;\r\n for (var i = 0; i < this._meta.length; i++) {\r\n var fieldMeta = this._meta[i];\r\n var fieldName = fieldMeta.name;\r\n var updateValue = this.formGroup.controls[fieldName].value;\r\n if (updateValue === undefined) {\r\n updateValue = '';\r\n }\r\n var converter = converters_1.Converters[fieldMeta.type];\r\n if (converter) {\r\n updateValue = converter.convertFromControlToModel(updateValue);\r\n }\r\n // We do not need to clone here (hopefully), because only simple values can be passed via forms.\r\n if (this.element[fieldName] + '' !== updateValue + '') {\r\n this.element[fieldName] = updateValue;\r\n changed = true;\r\n }\r\n }\r\n if (changed && this.isValid) {\r\n this.dataService.updateElement(this.element, true, id_1.Id.uuid);\r\n }\r\n };\r\n Object.defineProperty(GenericForm.prototype, \"isValid\", {\r\n get: function () {\r\n return this.formGroup.valid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", Array)\r\n ], GenericForm.prototype, \"hiddenFields\", void 0);\r\n __decorate([\r\n core_1.Input(),\r\n __metadata(\"design:type\", Object),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], GenericForm.prototype, \"element\", null);\r\n GenericForm = __decorate([\r\n core_1.Component({\r\n moduleId: module.i.toString(),\r\n selector: 'generic-form',\r\n template: __webpack_require__(615)\r\n }),\r\n __metadata(\"design:paramtypes\", [forms_1.FormBuilder, specmate_data_service_1.SpecmateDataService])\r\n ], GenericForm);\r\n return GenericForm;\r\n}());\r\nexports.GenericForm = GenericForm;\r\nvar FieldType = /** @class */ (function () {\r\n function FieldType() {\r\n }\r\n FieldType.TEXT = 'text';\r\n FieldType.TEXT_LONG = 'longText';\r\n FieldType.CHECKBOX = 'checkbox';\r\n FieldType.SINGLE_SELECT = 'singleSelect';\r\n return FieldType;\r\n}());\r\nexports.FieldType = FieldType;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2NvbXBvbmVudHMvZ2VuZXJpYy1mb3JtLmNvbXBvbmVudC50cz9iMjVlIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgSW5wdXQgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUJ1aWxkZXIsIFZhbGlkYXRvcnMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBUeXBlIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vdXRpbC90eXBlJztcbmltcG9ydCB7IEZpZWxkTWV0YUl0ZW0sIE1ldGFJbmZvIH0gZnJvbSAnLi4vLi4vLi4vLi4vLi4vbW9kZWwvbWV0YS9maWVsZC1tZXRhJztcbmltcG9ydCB7IEFycmF5cyB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL3V0aWwvYXJyYXlzJztcbmltcG9yd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aXRlbTEucG9zaXRpb24pIC0gTnVtYmVyLnBhcnNlSW50KGl0ZW0yLnBvc2l0aW9uKSk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBpbml0RW1wdHkoKTogdm9pZCB7XG4gICAgICAgIHRoaXMuZm9ybUdyb3VwID0gdGhpcy5mb3JtQnVpbGRlci5ncm91cCh7fSk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBjcmVhdGVGb3JtKCk6IHZvaWQge1xuICAgICAgICBpZiAoIXRoaXMuX2VsZW1lbnQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9tZXRhID0gTWV0YUluZm9bdGhpcy5lbGVtZW50LmNsYXNzTmFtZV07XG4gICAgICAgIGlmICghdGhpcy5fbWV0YSkge1xuICAgICAgICAgICAgdGhpcy5pbml0RW1wdHkoKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9yZGVyRmllbGRNZXRhKCk7XG4gICAgICAgIGxldCBmb3JtQnVpbGRlck9iamVjdDogYW55ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fbWV0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGZpZWxkTWV0YTogRmllbGRNZXRhSXRlbSA9IHRoaXMuX21ldGFbaV07XG4gICAgICAgICAgICBsZXQgZmllbGROYW1lOiBzdHJpbmcgPSBmaWVsZE1ldGEubmFtZTtcbiAgICAgICAgICAgIGxldCBmb3JtQnVpbGRlck9iamVjdFZhbHVlOiBhbnlbXSA9IFsnJ107XG4gICAgICAgICAgICBpZiAodGhpcy5fbWV0YVtpXS5yZXF1aXJlZCkge1xuICAgICAgICAgICAgICAgIGZvcm1CdWlsZGVyT2JqZWN0VmFsdWUucHVzaChWYWxpZGF0b3JzLnJlcXVpcmVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvcm1CdWlsZGVyT2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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQ0E7OztBQUFBO0FBaklBO0FBREE7O0FBQ0E7QUFTQTtBQURBOzs7QUFhQTtBQWhDQTtBQUxBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUEwQ0E7QUF6Q0E7QUE2SUE7QUFBQTtBQTdJQTtBQStJQTtBQUFBO0FBS0E7QUFKQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFMQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///310\n"); /***/ }), /* 311 */ @@ -704,7 +704,7 @@ eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, ta /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar log_list_component_1 = __webpack_require__(649);\r\nvar forms_1 = __webpack_require__(19);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar log_entry_component_1 = __webpack_require__(651);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar LogListModule = /** @class */ (function () {\r\n function LogListModule() {\r\n }\r\n LogListModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n log_list_component_1.LogList,\r\n log_entry_component_1.LogEntry\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n log_list_component_1.LogList\r\n ],\r\n providers: [\r\n // SERVICES\r\n logging_service_1.LoggingService\r\n ],\r\n bootstrap: []\r\n })\r\n ], LogListModule);\r\n return LogListModule;\r\n}());\r\nexports.LogListModule = LogListModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9sb2ctbGlzdC9sb2ctbGlzdC5tb2R1bGUudHM/MTU0NyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBMb2dMaXN0IH0gZnJvbSAnLi9jb21wb25lbnRzL2xvZy1saXN0LmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IEZvcm1zTW9kdWx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hdGUtbG9hZGVyIS4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9sb2ctbGlzdC9sb2ctbGlzdC5tb2R1bGUudHMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBMkJBO0FBQUE7QUFBQTtBQUFBO0FBekJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBRUE7QUFBQTtBQUFBO0FBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///312\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar log_list_component_1 = __webpack_require__(649);\r\nvar forms_1 = __webpack_require__(20);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar log_entry_component_1 = __webpack_require__(651);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar LogListModule = /** @class */ (function () {\r\n function LogListModule() {\r\n }\r\n LogListModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n log_list_component_1.LogList,\r\n log_entry_component_1.LogEntry\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n log_list_component_1.LogList\r\n ],\r\n providers: [\r\n // SERVICES\r\n logging_service_1.LoggingService\r\n ],\r\n bootstrap: []\r\n })\r\n ], LogListModule);\r\n return LogListModule;\r\n}());\r\nexports.LogListModule = LogListModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9sb2ctbGlzdC9sb2ctbGlzdC5tb2R1bGUudHM/MTU0NyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBMb2dMaXN0IH0gZnJvbSAnLi9jb21wb25lbnRzL2xvZy1saXN0LmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IEZvcm1zTW9kdWxlLCBSZWFjdGl2ZUZvcm1zTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xyXG5pbXBvcnQgeyBCcm93c2VyTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XHJcbmltcG9ydCB7IExvZ0VudHJ5IH0gZnJvbSAnLi9jb21wb25lbnRzL2xvZy1lbnRyeS5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBMb2dnaW5nU2VydmljZSB9IGZyb20gJy4vc2VydmljZXMvbG9nZ2luZy5zZXJ2aWNlJztcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgLy8gTU9EVUxFIElNUE9SVFNcclxuICAgIEJy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vdCI6IiJ9\n//# sourceURL=webpack-internal:///312\n"); /***/ }), /* 313 */ @@ -1413,7 +1413,7 @@ eval("module.exports = \"\\r\\n = 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar navigator_module_1 = __webpack_require__(68);\r\nvar core_1 = __webpack_require__(0);\r\nvar properties_editor_component_1 = __webpack_require__(612);\r\nvar generic_form_module_1 = __webpack_require__(618);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar ng_bootstrap_1 = __webpack_require__(34);\r\nvar forms_1 = __webpack_require__(19);\r\nvar icons_module_1 = __webpack_require__(126);\r\nvar core_2 = __webpack_require__(22);\r\nvar PropertiesEditorModule = /** @class */ (function () {\r\n function PropertiesEditorModule() {\r\n }\r\n PropertiesEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n generic_form_module_1.GenericFormModule,\r\n navigator_module_1.NavigatorModule,\r\n ng_bootstrap_1.NgbModule.forRoot(),\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n icons_module_1.IconsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n properties_editor_component_1.PropertiesEditor\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n properties_editor_component_1.PropertiesEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], PropertiesEditorModule);\r\n return PropertiesEditorModule;\r\n}());\r\nexports.PropertiesEditorModule = PropertiesEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3Jj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QkE7QUFBQTtBQUFBO0FBQUE7QUE1QkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFHQTtBQUVBO0FBQUE7QUFBQTtBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///611\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar navigator_module_1 = __webpack_require__(68);\r\nvar core_1 = __webpack_require__(0);\r\nvar properties_editor_component_1 = __webpack_require__(612);\r\nvar generic_form_module_1 = __webpack_require__(618);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar ng_bootstrap_1 = __webpack_require__(34);\r\nvar forms_1 = __webpack_require__(20);\r\nvar icons_module_1 = __webpack_require__(126);\r\nvar core_2 = __webpack_require__(22);\r\nvar PropertiesEditorModule = /** @class */ (function () {\r\n function PropertiesEditorModule() {\r\n }\r\n PropertiesEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n generic_form_module_1.GenericFormModule,\r\n navigator_module_1.NavigatorModule,\r\n ng_bootstrap_1.NgbModule.forRoot(),\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n icons_module_1.IconsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n properties_editor_component_1.PropertiesEditor\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n properties_editor_component_1.PropertiesEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], PropertiesEditorModule);\r\n return PropertiesEditorModule;\r\n}());\r\nexports.PropertiesEditorModule = PropertiesEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9wcm9wZXJ0aWVzLWVkaXRvci9wcm9wZXJ0aWVzLWVkaXRvci5tb2R1bGUudHM/ZWM3YyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOYXZpZ2F0b3JNb2R1bGUgfSBmcm9tICcuLi8uLi8uLi8uLi9uYXZpZ2F0aW9uL21vZHVsZXMvbmF2aWdhdG9yL25hdmlnYXRvci5tb2R1bGUnO1xyXG5pbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBQcm9wZXJ0aWVzRWRpdG9yIH0gZnJvbSAnLi9jb21wb25lbnRzL3Byb3BlcnRpZXMtZWRpdG9yLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IEdlbmVyaWNGb3JtTW9kdWxlIH0gZnJvbSAnLi4vLi4vLi4vLi4vZm9ybXMvbW9kdWxlcy9nZW5lcmljLWZvcm0vZ2VuZXJpYy1mb3JtLm1vZHVsZSc7XHJcbmltcG9ydCB7IEJyb3dzZXJNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9wbGF0Zm9ybS1icm93c2VyJztcclxuaW1wb3J0IHsgTmdiTW9kdWxlIH0g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HJcblxyXG5leHBvcnQgY2xhc3MgUHJvcGVydGllc0VkaXRvck1vZHVsZSB7IH1cclxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIG5vZGVfbW9kdWxlcy9hbmd1bGFyMi10ZW1wbGF0ZS1sb2FkZXIhLi9zcmMvYXBwL21vZHVsZXMvdmlld3Mvc2lkZS9tb2R1bGVzL3Byb3BlcnRpZXMtZWRpdG9yL3Byb3BlcnRpZXMtZWRpdG9yLm1vZHVsZS50cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUE4QkE7QUFBQTtBQUFBO0FBQUE7QUE1QkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFHQTtBQUVBO0FBQUE7QUFBQTtBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///611\n"); /***/ }), /* 612 */ @@ -1459,7 +1459,7 @@ eval("module.exports = \"\"//# sourceURL=[module]\n//# sourceMappingURL=data:app /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar generic_form_component_1 = __webpack_require__(310);\r\nvar forms_1 = __webpack_require__(19);\r\nvar form_text_input_component_1 = __webpack_require__(619);\r\nvar form_checkbox_input_component_1 = __webpack_require__(621);\r\nvar form_long_text_input_component_1 = __webpack_require__(623);\r\nvar form_single_selection_input_component_1 = __webpack_require__(625);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar GenericFormModule = /** @class */ (function () {\r\n function GenericFormModule() {\r\n }\r\n GenericFormModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n generic_form_component_1.GenericForm,\r\n form_text_input_component_1.FormTextInput,\r\n form_checkbox_input_component_1.FormCheckboxInput,\r\n form_long_text_input_component_1.FormLongTextInput,\r\n form_single_selection_input_component_1.FormSingleSelectionInput\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n generic_form_component_1.GenericForm\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], GenericFormModule);\r\n return GenericFormModule;\r\n}());\r\nexports.GenericFormModule = GenericFormModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2dlbmVyaWMtZm9ybS5tb2R1bGUudHM/YjI3ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBHZW5lcmljRm9ybSB9IGZyb20gJy4vY29tcG9uZW50cy9nZW5lcmljLWZvc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FxyXG4gIGV4cG9ydHM6IFtcclxuICAgIC8vIFRIRSBDT01QT05FTlRTIFZJU0lCTEUgVE8gVEhFIE9VVFNJREVcclxuICAgIEdlbmVyaWNGb3JtXHJcbiAgXSxcclxuICBwcm92aWRlcnM6IFtcclxuICAgIC8vIFNFUlZJQ0VTXHJcbiAgXSxcclxuICBib290c3RyYXA6IFtcclxuICAgIC8vIENPTVBPTkVOVFMgVEhBVCBBUkUgQk9PVFNUUkFQUEVEIEhFUkVcclxuICBdXHJcbn0pXHJcblxyXG5leHBvcnQgY2xhc3MgR2VuZXJpY0Zvcm1Nb2R1bGUgeyB9XHJcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBub2RlX21vZHVsZXMvYW5ndWxhcjItdGVtcGxhdGUtbG9hZGVyIS4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2dlbmVyaWMtZm9ybS5tb2R1bGUudHMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQTZCQTtBQUFBO0FBQUE7QUFBQTtBQTNCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFHQTtBQUVBO0FBQUE7QUFBQTtBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///618\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar generic_form_component_1 = __webpack_require__(310);\r\nvar forms_1 = __webpack_require__(20);\r\nvar form_text_input_component_1 = __webpack_require__(619);\r\nvar form_checkbox_input_component_1 = __webpack_require__(621);\r\nvar form_long_text_input_component_1 = __webpack_require__(623);\r\nvar form_single_selection_input_component_1 = __webpack_require__(625);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar GenericFormModule = /** @class */ (function () {\r\n function GenericFormModule() {\r\n }\r\n GenericFormModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n generic_form_component_1.GenericForm,\r\n form_text_input_component_1.FormTextInput,\r\n form_checkbox_input_component_1.FormCheckboxInput,\r\n form_long_text_input_component_1.FormLongTextInput,\r\n form_single_selection_input_component_1.FormSingleSelectionInput\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n generic_form_component_1.GenericForm\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], GenericFormModule);\r\n return GenericFormModule;\r\n}());\r\nexports.GenericFormModule = GenericFormModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL2Zvcm1zL21vZHVsZXMvZ2VuZXJpYy1mb3JtL2dlbmVyaWMtZm9ybS5tb2R1bGUudHM/YjI3ZSJdLCJzb3VyY2VzQ29udG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\"//# sourceURL=[module]\n//# sourceMappingURL=data:app /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar log_presentation_1 = __webpack_require__(313);\r\nvar forms_1 = __webpack_require__(19);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar view_controller_service_1 = __webpack_require__(76);\r\nvar LogList = /** @class */ (function () {\r\n function LogList(logger, viewController, formBuilder) {\r\n this.logger = logger;\r\n this.viewController = viewController;\r\n this.formBuilder = formBuilder;\r\n this.errorName = log_presentation_1.LogPresentation.ERROR;\r\n this.warnName = log_presentation_1.LogPresentation.WARN;\r\n this.infoName = log_presentation_1.LogPresentation.INFO;\r\n this.debugName = log_presentation_1.LogPresentation.DEBUG;\r\n this.severityNames = [this.errorName, this.warnName, this.infoName, this.debugName];\r\n var formGroupObj = {};\r\n this.severityNames.forEach(function (severityName) { return formGroupObj[severityName] = true; });\r\n this.checkboxGroupForm = this.formBuilder.group(formGroupObj);\r\n }\r\n Object.defineProperty(LogList.prototype, \"log\", {\r\n get: function () {\r\n var _this = this;\r\n return this.logger.logs.filter(function (logElement) { return _this.isVisible(logElement); });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LogList.prototype.closeLog = function () {\r\n this.viewController.hideLoggingOutput();\r\n };\r\n LogList.prototype.isChecked = function (severityName) {\r\n return this.checkboxGroupForm.value[severityName];\r\n };\r\n LogList.prototype.isSeverityActive = function (severity) {\r\n return this.isChecked(log_presentation_1.LogPresentation.getStringForSeverity(severity));\r\n };\r\n LogList.prototype.isVisible = function (logElement) {\r\n return this.isSeverityActive(logElement.severity);\r\n };\r\n LogList.prototype.icon = function (severityName) {\r\n return log_presentation_1.LogPresentation.iconForStr(severityName);\r\n };\r\n LogList.prototype.color = function (severityName) {\r\n return log_presentation_1.LogPresentation.colorForStr(severityName);\r\n };\r\n LogList = __decorate([\r\n core_1.Component({\r\n moduleId: module.i.toString(),\r\n selector: 'log-list',\r\n template: __webpack_require__(650)\r\n }),\r\n __metadata(\"design:paramtypes\", [logging_service_1.LoggingService, view_controller_service_1.ViewControllerService, forms_1.FormBuilder])\r\n ], LogList);\r\n return LogList;\r\n}());\r\nexports.LogList = LogList;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9sb2ctbGlzdC9jb21wb25lbnRzL2xvZy1saXN0LmNvbXBvbmVudC50cz9lZTQzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTG9nUHJlc2VudGF0aW9uIH0gZnJvbSAnLi4vYmFzZS9sb2ctcHJlc2VudGF0aW9uJztcbmltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUJ1aWxkZXIgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBMb2dFbGVtZW50IH0gZnJvbSAnLi4vc2VydmljZXMvbG9nLWVsZW1lbnQnO1xuaW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vb3QiOiIifQ==\n//# sourceURL=webpack-internal:///649\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar log_presentation_1 = __webpack_require__(313);\r\nvar forms_1 = __webpack_require__(20);\r\nvar logging_service_1 = __webpack_require__(87);\r\nvar view_controller_service_1 = __webpack_require__(76);\r\nvar LogList = /** @class */ (function () {\r\n function LogList(logger, viewController, formBuilder) {\r\n this.logger = logger;\r\n this.viewController = viewController;\r\n this.formBuilder = formBuilder;\r\n this.errorName = log_presentation_1.LogPresentation.ERROR;\r\n this.warnName = log_presentation_1.LogPresentation.WARN;\r\n this.infoName = log_presentation_1.LogPresentation.INFO;\r\n this.debugName = log_presentation_1.LogPresentation.DEBUG;\r\n this.severityNames = [this.errorName, this.warnName, this.infoName, this.debugName];\r\n var formGroupObj = {};\r\n this.severityNames.forEach(function (severityName) { return formGroupObj[severityName] = true; });\r\n this.checkboxGroupForm = this.formBuilder.group(formGroupObj);\r\n }\r\n Object.defineProperty(LogList.prototype, \"log\", {\r\n get: function () {\r\n var _this = this;\r\n return this.logger.logs.filter(function (logElement) { return _this.isVisible(logElement); });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LogList.prototype.closeLog = function () {\r\n this.viewController.hideLoggingOutput();\r\n };\r\n LogList.prototype.isChecked = function (severityName) {\r\n return this.checkboxGroupForm.value[severityName];\r\n };\r\n LogList.prototype.isSeverityActive = function (severity) {\r\n return this.isChecked(log_presentation_1.LogPresentation.getStringForSeverity(severity));\r\n };\r\n LogList.prototype.isVisible = function (logElement) {\r\n return this.isSeverityActive(logElement.severity);\r\n };\r\n LogList.prototype.icon = function (severityName) {\r\n return log_presentation_1.LogPresentation.iconForStr(severityName);\r\n };\r\n LogList.prototype.color = function (severityName) {\r\n return log_presentation_1.LogPresentation.colorForStr(severityName);\r\n };\r\n LogList = __decorate([\r\n core_1.Component({\r\n moduleId: module.i.toString(),\r\n selector: 'log-list',\r\n template: __webpack_require__(650)\r\n }),\r\n __metadata(\"design:paramtypes\", [logging_service_1.LoggingService, view_controller_service_1.ViewControllerService, forms_1.FormBuilder])\r\n ], LogList);\r\n return LogList;\r\n}());\r\nexports.LogList = LogList;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL3NpZGUvbW9kdWxlcy9sb2ctbGlzdC9jb21wb25lbnRzL2xvZy1saXN0LmNvbXBvbmVudC50cz9lZTQzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTG9nUHJlc2VudGF0aW9uIH0gZnJvbSAnLi4vYmFzZS9sb2ctcHJlc2VudGF0aW9uJztcbmltcG9ydCB7IEZvcm1Hcm91cCwgRm9ybUJ1aWxkZXIgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBMb2dFbGVtZW50IH0gZnJvbSAnLi4vc2VydmljZXMvbG9nLWVsZW1lbnQnO1xuaW1wb3J0IHsgTG9nZ2luZ1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=webpack-internal:///649\n"); /***/ }), /* 650 */ @@ -2279,7 +2279,7 @@ eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, ta /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_procedure_editor_component_1 = __webpack_require__(326);\r\nvar angular_split_1 = __webpack_require__(184);\r\nvar maximize_button_module_1 = __webpack_require__(199);\r\nvar ng2_dragula_1 = __webpack_require__(100);\r\nvar test_step_row_component_1 = __webpack_require__(744);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar test_case_parameter_mapping_module_1 = __webpack_require__(746);\r\nvar forms_1 = __webpack_require__(19);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestProcedureEditorModule = /** @class */ (function () {\r\n function TestProcedureEditorModule() {\r\n }\r\n TestProcedureEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n angular_split_1.AngularSplitModule,\r\n maximize_button_module_1.MaximizeButtonModule,\r\n ng2_dragula_1.DragulaModule,\r\n test_case_parameter_mapping_module_1.TestCaseParameterMappingModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_procedure_editor_component_1.TestProcedureEditor,\r\n test_step_row_component_1.TestStepRow\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_procedure_editor_component_1.TestProcedureEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestProcedureEditorModule);\r\n return TestProcedureEditorModule;\r\n}());\r\nexports.TestProcedureEditorModule = TestProcedureEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3QtcHJvY2VkdXJlLWVkaXRvci90ZXN0LXByb2NlZHVyZS1lZGl0b3IubW9kdWxlLnRzPzZkNTEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHsgVGVzdFByb2NlZHVyZUVkaXRvciB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LXByb2NlZHVyZS1lZGl0b3IuY29tcG9uZW50JztcclxuaW1wb3J0IHsgQW5ndWxhclNwbGl0TW9kdWxlIH0gZnJvbSAnYW5ndWxhci1zcGxpdCc7XHJcbmltcG9ydCB7IE1heGltaXplQnV0dG9uTW9kdWxlIH0gZnJvbSAnLi4vbWF4aW1pemUtYnV0dG9uL21heGltaXplLWJ1dHRvbi5tb2R1bGUnO1xyXG5pbXBvcnQgeyBEcmFndWxhTW9kdWxlIH0gZnJvbSAnbmcyLWRyYWd1bGEnO1xyXG5pbXBvcnQgeyBUZXN0U3RlcFJvdyB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LXN0ZXAtcm93LmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IEJyb3dzZXJNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9wbGF0Zm9ybS1icm93c2VyJztcclxuaW1wb3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gICAvLyBDT01QT05FTlRTIFRIQVQgQVJFIEJPT1RTVFJBUFBFRCBIRVJFXHJcbiAgXVxyXG59KVxyXG5cclxuZXhwb3J0IGNsYXNzIFRlc3RQcm9jZWR1cmVFZGl0b3JNb2R1bGUgeyB9XHJcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBub2RlX21vZHVsZXMvYW5ndWxhcjItdGVtcGxhdGUtbG9hZGVyIS4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3QtcHJvY2VkdXJlLWVkaXRvci90ZXN0LXByb2NlZHVyZS1lZGl0b3IubW9kdWxlLnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBK0JBO0FBQUE7QUFBQTtBQUFBO0FBN0JBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFHQTtBQUVBO0FBQUE7QUFBQTtBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///743\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_procedure_editor_component_1 = __webpack_require__(326);\r\nvar angular_split_1 = __webpack_require__(184);\r\nvar maximize_button_module_1 = __webpack_require__(199);\r\nvar ng2_dragula_1 = __webpack_require__(100);\r\nvar test_step_row_component_1 = __webpack_require__(744);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar test_case_parameter_mapping_module_1 = __webpack_require__(746);\r\nvar forms_1 = __webpack_require__(20);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestProcedureEditorModule = /** @class */ (function () {\r\n function TestProcedureEditorModule() {\r\n }\r\n TestProcedureEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n angular_split_1.AngularSplitModule,\r\n maximize_button_module_1.MaximizeButtonModule,\r\n ng2_dragula_1.DragulaModule,\r\n test_case_parameter_mapping_module_1.TestCaseParameterMappingModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_procedure_editor_component_1.TestProcedureEditor,\r\n test_step_row_component_1.TestStepRow\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_procedure_editor_component_1.TestProcedureEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestProcedureEditorModule);\r\n return TestProcedureEditorModule;\r\n}());\r\nexports.TestProcedureEditorModule = TestProcedureEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3QtcHJvY2VkdXJlLWVkaXRvci90ZXN0LXByb2NlZHVyZS1lZGl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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBK0JBO0FBQUE7QUFBQTtBQUFBO0FBN0JBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFHQTtBQUVBO0FBQUE7QUFBQTtBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///743\n"); /***/ }), /* 744 */ @@ -2299,7 +2299,7 @@ eval("module.exports = \"= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_case_parameter_mapping_component_1 = __webpack_require__(747);\r\nvar test_case_value_form_component_1 = __webpack_require__(749);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar forms_1 = __webpack_require__(19);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestCaseParameterMappingModule = /** @class */ (function () {\r\n function TestCaseParameterMappingModule() {\r\n }\r\n TestCaseParameterMappingModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_case_parameter_mapping_component_1.TestCaseParameterMapping,\r\n test_case_value_form_component_1.TestCaseValueForm\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_case_parameter_mapping_component_1.TestCaseParameterMapping\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestCaseParameterMappingModule);\r\n return TestCaseParameterMappingModule;\r\n}());\r\nexports.TestCaseParameterMappingModule = TestCaseParameterMappingModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3QtY2FzZS1wYXJhbWV0ZXItbWFwcGluZy90ZXN0LWNhc2UtcGFyYW1ldGVyLW1hcHBpbmcubW9kdWxlLnRzPzI3OTciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHsgVGVzdENhc2VQYXJhbWV0ZXJNYXBwaW5nIH0gZnJvbSAnLi9jb21wb25lbnRzL3Rlc3QtY2FzZS1wYXJhbWV0ZXItbWFwcGluZy5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBUZXN0Q2FzZVZhbHVlRm9ybSB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LWNhc2UtdmFsdWUtZm9ybS5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBCcm93c2VyTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XHJcbmltcG9ydCB7IEZvcm1zTW9kdWxlLCBSZWFjdGl2ZUZvcm1zTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xyXG5pbXBvcnQgeyBUcmFuc2xhdGVNb2R1bGUgfSBmcm9tICdAbmd4LXRyYW5zbGF0ZS9jb3JlJztcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgLy8gTU9EVUxFIElNUE9SVFNcclxuICAgIEJyb3dzZXJNb2R1bGUsXHJcbiAgIC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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///746\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_case_parameter_mapping_component_1 = __webpack_require__(747);\r\nvar test_case_value_form_component_1 = __webpack_require__(749);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar forms_1 = __webpack_require__(20);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestCaseParameterMappingModule = /** @class */ (function () {\r\n function TestCaseParameterMappingModule() {\r\n }\r\n TestCaseParameterMappingModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n platform_browser_1.BrowserModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_case_parameter_mapping_component_1.TestCaseParameterMapping,\r\n test_case_value_form_component_1.TestCaseValueForm\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_case_parameter_mapping_component_1.TestCaseParameterMapping\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestCaseParameterMappingModule);\r\n return TestCaseParameterMappingModule;\r\n}());\r\nexports.TestCaseParameterMappingModule = TestCaseParameterMappingModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3QtY2FzZS1wYXJhbWV0ZXItbWFwcGluZy90ZXN0LWNhc2UtcGFyYW1ldGVyLW1hcHBpbmcubW9kdWxlLnRzPzI3OTciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHsgVGVzdENhc2VQYXJhbWV0ZXJNYXBwaW5nIH0gZnJvbSAnLi9jb21wb25lbnRzL3Rlc3QtY2FzZS1wYXJhbWV0ZXItbWFwcGluZy5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBUZXN0Q2FzZVZhbHVlRm9ybSB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LWNhc2UtdmFsdWUtZm9ybS5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBCcm93c2VyTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XHJcbmltcG9ydCB7IEZvcm1zTW9kdWxlLCBSZWFjdGl2ZUZvcm1zTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xyXG5pbXBvcnQgeyBUcmFuc2xhdGVNb2R1bGUgfSBmcm9tICdAbmd4LXRyYW5zbGF0ZS9jb3JlJztcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgLy8gTU9EVUxFIElNUE9SVFNcclxuICAgIEJyb3dzZXJNb2R1bGUsXHJcbiAgICBGb3Jtc01vZHVsZSxcclxuICAgIFJlYWN0aXZlRm9ybXNNb2R1bGUsXHJ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0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///746\n"); /***/ }), /* 747 */ @@ -2338,7 +2338,7 @@ eval("module.exports = \"\"//# sourceURL=[module]\n//# sourceMappingURL=data:app /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_specification_editor_component_1 = __webpack_require__(329);\r\nvar maximize_button_module_1 = __webpack_require__(199);\r\nvar test_case_condition_form_component_1 = __webpack_require__(753);\r\nvar test_case_name_form_component_1 = __webpack_require__(756);\r\nvar test_case_row_component_1 = __webpack_require__(759);\r\nvar test_parameter_form_component_1 = __webpack_require__(762);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar ng2_dragula_1 = __webpack_require__(100);\r\nvar forms_1 = __webpack_require__(19);\r\nvar navigator_module_1 = __webpack_require__(68);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestSpecificationEditorModule = /** @class */ (function () {\r\n function TestSpecificationEditorModule() {\r\n }\r\n TestSpecificationEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n maximize_button_module_1.MaximizeButtonModule,\r\n platform_browser_1.BrowserModule,\r\n ng2_dragula_1.DragulaModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n navigator_module_1.NavigatorModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_specification_editor_component_1.TestSpecificationEditor,\r\n test_case_condition_form_component_1.TestCaseConditionForm,\r\n test_case_name_form_component_1.TestCaseNameForm,\r\n test_case_row_component_1.TestCaseRow,\r\n test_parameter_form_component_1.TestParameterForm\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_specification_editor_component_1.TestSpecificationEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestSpecificationEditorModule);\r\n return TestSpecificationEditorModule;\r\n}());\r\nexports.TestSpecificationEditorModule = TestSpecificationEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3Qtc3BlY2lmaWNhdGlvbi1lZGl0b3IvdGVzdC1zcGVjaWZpY2F0aW9uLWVkaXRvci5tb2R1bGUudHM/NmJiZCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBUZXN0U3BlY2lmaWNhdGlvbkVkaXRvciB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LXNwZWNpZmljYXRpb24tZWRpdG9yLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IE1heGltaXplQnV0dG9uTW9kdWxlIH0gZnJvbSAnLi4vbWF4aW1pemUtYnV0dG9uL21heGltaXplLWJ1dHRvbi5tb2R1bGUnO1xyXG5pbXBvcnQgeyBUZXN0Q2FzZUNvbmRpdGlvbkZvcm0gfSBmcm9tICcuL2NvbXBvbmVudHMvdGVzdC1jYXNlLWNvbmRpdGlvbi1m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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///752\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar test_specification_editor_component_1 = __webpack_require__(329);\r\nvar maximize_button_module_1 = __webpack_require__(199);\r\nvar test_case_condition_form_component_1 = __webpack_require__(753);\r\nvar test_case_name_form_component_1 = __webpack_require__(756);\r\nvar test_case_row_component_1 = __webpack_require__(759);\r\nvar test_parameter_form_component_1 = __webpack_require__(762);\r\nvar platform_browser_1 = __webpack_require__(8);\r\nvar ng2_dragula_1 = __webpack_require__(100);\r\nvar forms_1 = __webpack_require__(20);\r\nvar navigator_module_1 = __webpack_require__(68);\r\nvar core_2 = __webpack_require__(22);\r\nvar TestSpecificationEditorModule = /** @class */ (function () {\r\n function TestSpecificationEditorModule() {\r\n }\r\n TestSpecificationEditorModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n maximize_button_module_1.MaximizeButtonModule,\r\n platform_browser_1.BrowserModule,\r\n ng2_dragula_1.DragulaModule,\r\n forms_1.FormsModule,\r\n forms_1.ReactiveFormsModule,\r\n navigator_module_1.NavigatorModule,\r\n core_2.TranslateModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n test_specification_editor_component_1.TestSpecificationEditor,\r\n test_case_condition_form_component_1.TestCaseConditionForm,\r\n test_case_name_form_component_1.TestCaseNameForm,\r\n test_case_row_component_1.TestCaseRow,\r\n test_parameter_form_component_1.TestParameterForm\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n test_specification_editor_component_1.TestSpecificationEditor\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], TestSpecificationEditorModule);\r\n return TestSpecificationEditorModule;\r\n}());\r\nexports.TestSpecificationEditorModule = TestSpecificationEditorModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vZWRpdG9ycy9tb2R1bGVzL3Rlc3Qtc3BlY2lmaWNhdGlvbi1lZGl0b3IvdGVzdC1zcGVjaWZpY2F0aW9uLWVkaXRvci5tb2R1bGUudHM/NmJiZCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBUZXN0U3BlY2lmaWNhdGlvbkVkaXRvciB9IGZyb20gJy4vY29tcG9uZW50cy90ZXN0LXNwZWNpZmljYXRpb24tZWRpdG9yLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IE1heGltaXplQnV0dG9uTW9kdWxlIH0gZnJvbSAnLi4vbWF4aW1pemUtYnV0dG9uL21heGltaXplLWJ1dHRvbi5tb2R1bGUnO1xyXG5pbXBvcnQgeyBUZXN0Q2FzZUNvbmR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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBaUNBO0FBQUE7QUFBQTtBQUFBO0FBL0JBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///752\n"); /***/ }), /* 753 */ @@ -2436,7 +2436,7 @@ eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, ta /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar welcome_component_1 = __webpack_require__(332);\r\nvar core_2 = __webpack_require__(22);\r\nvar common_1 = __webpack_require__(21);\r\nvar WelcomePageModule = /** @class */ (function () {\r\n function WelcomePageModule() {\r\n }\r\n WelcomePageModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n core_2.TranslateModule,\r\n common_1.CommonModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n welcome_component_1.Welcome\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n welcome_component_1.Welcome\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], WelcomePageModule);\r\n return WelcomePageModule;\r\n}());\r\nexports.WelcomePageModule = WelcomePageModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vc3RhdGljL21vZHVsZXMvd2VsY29tZS1wYWdlL3dlbGNvbWUtcGFnZS5tb2R1bGUudHM/Zjc4YSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBXZWxjb21lIH0gZnJvbSAnLi9jb21wb25lbnRzL3dlbGNvbWUuY29tcG9uZW50JztcclxuaW1wb3J0IHsgVHJhbnNsYXRlTW9kdWxlIH0gZnJvbSAnQG5neC10cmFuc2xhdGUvY29yZSc7XHJcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XHJcblxyXG5ATmdNb2R1bGUoe1xyXG4gIGltcG9ydHM6IFtcclxuICAgIC8vIE1PRFVMRSBJTVBPUlRTXHJcbiAgICBUcmFuc2xhdGVNb2R1bGUsXHJcbiAgICBDb21tb25Nb2R1bGVcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW1xyXG4gICAgLy8gQ09NUE9ORU5UUyBJTiBUSElTIE1PRFVMRVxyXG4gICAgV2VsY29tZVxyXG4gIF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgLy8gVEhFIENPTVBPTkVOVFMgVklTSUJMRSBUTyBUSEUgT1VUU0lERVxyXG4gICAgV2VsY29tZVxyXG4gIF0sXHJcbiAgcHJvdmlkZXJzOiBbXHJcbiAgICAvLyBTRVJWSUNFU1xyXG4gIF0sXHJcbiAgYm9vdHN0cmFwOiBbXHJcbiAgICAvLyBDT01QT05FTlRTIFRIQVQgQVJFIEJPT1RTVFJBUFBFRCBIRVJFXHJcbiAgXVxyXG59KVxyXG5cclxuZXhwb3J0IGNsYXNzIFdlbGNvbWVQYWdlTW9kdWxlIHsgfVxyXG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbm9kZV9tb2R1bGVzL2FuZ3VsYXIyLXRlbXBsYXRlLWxvYWRlciEuL3NyYy9hcHAvbW9kdWxlcy92aWV3cy9tYWluL3N0YXRpYy9tb2R1bGVzL3dlbGNvbWUtcGFnZS93ZWxjb21lLXBhZ2UubW9kdWxlLnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBd0JBO0FBQUE7QUFBQTtBQUFBO0FBdEJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///767\n"); +eval("\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar core_1 = __webpack_require__(0);\r\nvar welcome_component_1 = __webpack_require__(332);\r\nvar core_2 = __webpack_require__(22);\r\nvar common_1 = __webpack_require__(18);\r\nvar WelcomePageModule = /** @class */ (function () {\r\n function WelcomePageModule() {\r\n }\r\n WelcomePageModule = __decorate([\r\n core_1.NgModule({\r\n imports: [\r\n // MODULE IMPORTS\r\n core_2.TranslateModule,\r\n common_1.CommonModule\r\n ],\r\n declarations: [\r\n // COMPONENTS IN THIS MODULE\r\n welcome_component_1.Welcome\r\n ],\r\n exports: [\r\n // THE COMPONENTS VISIBLE TO THE OUTSIDE\r\n welcome_component_1.Welcome\r\n ],\r\n providers: [],\r\n bootstrap: []\r\n })\r\n ], WelcomePageModule);\r\n return WelcomePageModule;\r\n}());\r\nexports.WelcomePageModule = WelcomePageModule;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2FwcC9tb2R1bGVzL3ZpZXdzL21haW4vc3RhdGljL21vZHVsZXMvd2VsY29tZS1wYWdlL3dlbGNvbWUtcGFnZS5tb2R1bGUudHM/Zjc4YSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBXZWxjb21lIH0gZnJvbSAnLi9jb21wb25lbnRzL3dlbGNvbWUuY29tcG9uZW50JztcclxuaW1wb3J0IHsgVHJhbnNsYXRlTW9kdWxlIH0gZnJvbSAnQG5neC10cmFuc2xhdGUvY29yZSc7XHJcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XHJcblxyXG5ATmdNb2R1bGUoe1xyXG4gIGltcG9ydHM6IFtcclxuICAgIC8vIE1PRFVMRSBJTVBPUlRTXHJcbiAgICBUcmFuc2xhdGVNb2R1bGUsXHJcbiAgICBDb21tb25Nb2R1bGVcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW1xyXG4gICAgLy8gQ09NUE9ORU5UUyBJTiBUSElTIE1PRFVMRVxyXG4gICAgV2VsY29tZVxyXG4gIF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgLy8gVEhFIENPTVBPTkVOVFMgVklTSUJMRSBUTyBUSEUgT1VUU0lERVxyXG4gICAgV2VsY29tZVxyXG4gIF0sXHJcbiAgcHJvdmlkZXJzOiBbXHJcbiAgICAvLyBTRVJWSUNFU1xyXG4gIF0sXHJcbiAgYm9vdHN0cmFwOiBbXHJcbiAgICAvLyBDT01QT05FTlRTIFRIQVQgQVJFIEJPT1RTVFJBUFBFRCBIRVJFXHJcbiAgXVxyXG59KVxyXG5cclxuZXhwb3J0IGNsYXNzIFdlbGNvbWVQYWdlTW9kdWxlIHsgfVxyXG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbm9kZV9tb2R1bGVzL2FuZ3VsYXIyLXRlbXBsYXRlLWxvYWRlciEuL3NyYy9hcHAvbW9kdWxlcy92aWV3cy9tYWluL3N0YXRpYy9tb2R1bGVzL3dlbGNvbWUtcGFnZS93ZWxjb21lLXBhZ2UubW9kdWxlLnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBd0JBO0FBQUE7QUFBQTtBQUFBO0FBdEJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBR0E7QUFFQTtBQUFBO0FBQUE7QUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///767\n"); /***/ }), /* 768 */ diff --git a/bundles/specmate-ui-core/webcontent/vendor.js b/bundles/specmate-ui-core/webcontent/vendor.js index 4fe15ce08..0c64516b1 100644 --- a/bundles/specmate-ui-core/webcontent/vendor.js +++ b/bundles/specmate-ui-core/webcontent/vendor.js @@ -17,7 +17,7 @@ eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true } /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserModule\", function() { return BrowserModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"platformBrowser\", function() { return platformBrowser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Meta\", function() { return Meta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Title\", function() { return Title; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"disableDebugTools\", function() { return disableDebugTools; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"enableDebugTools\", function() { return enableDebugTools; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserTransferStateModule\", function() { return BrowserTransferStateModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TransferState\", function() { return TransferState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeStateKey\", function() { return makeStateKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"By\", function() { return By; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOCUMENT\", function() { return DOCUMENT$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EVENT_MANAGER_PLUGINS\", function() { return EVENT_MANAGER_PLUGINS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EventManager\", function() { return EventManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HAMMER_GESTURE_CONFIG\", function() { return HAMMER_GESTURE_CONFIG; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HammerGestureConfig\", function() { return HammerGestureConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DomSanitizer\", function() { return DomSanitizer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBROWSER_SANITIZATION_PROVIDERS\", function() { return BROWSER_SANITIZATION_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS\", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵinitDomAdapter\", function() { return initDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserDomAdapter\", function() { return BrowserDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserPlatformLocation\", function() { return BrowserPlatformLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵTRANSITION_ID\", function() { return TRANSITION_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserGetTestability\", function() { return BrowserGetTestability; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵescapeHtml\", function() { return escapeHtml; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵELEMENT_PROBE_PROVIDERS\", function() { return ELEMENT_PROBE_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomAdapter\", function() { return DomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵgetDOM\", function() { return getDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵsetRootDomAdapter\", function() { return setRootDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomRendererFactory2\", function() { return DomRendererFactory2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵNAMESPACE_URIS\", function() { return NAMESPACE_URIS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵflattenStyles\", function() { return flattenStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵshimContentAttribute\", function() { return shimContentAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵshimHostAttribute\", function() { return shimHostAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomEventsPlugin\", function() { return DomEventsPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵHammerGesturesPlugin\", function() { return HammerGesturesPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵKeyEventsPlugin\", function() { return KeyEventsPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomSharedStylesHost\", function() { return DomSharedStylesHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵSharedStylesHost\", function() { return SharedStylesHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return _document; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return errorHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return GenericBrowserDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return SERVER_TRANSITION_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return appInitializerFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return initTransferState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return _createNgProbe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return EventManagerPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return DomSanitizerImpl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _DOM = /** @type {?} */ ((null));\n/**\n * @return {?}\n */\nfunction getDOM() {\n return _DOM;\n}\n/**\n * @param {?} adapter\n * @return {?}\n */\n\n/**\n * @param {?} adapter\n * @return {?}\n */\nfunction setRootDomAdapter(adapter) {\n if (!_DOM) {\n _DOM = adapter;\n }\n}\n/**\n * Provides DOM operations in an environment-agnostic way.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar DomAdapter = /** @class */ (function () {\n function DomAdapter() {\n this.resourceLoaderType = /** @type {?} */ ((null));\n }\n Object.defineProperty(DomAdapter.prototype, \"attrToPropMap\", {\n /**\n * Maps attribute names to their corresponding property names for cases\n * where attribute name doesn't match property name.\n */\n get: /**\n * Maps attribute names to their corresponding property names for cases\n * where attribute name doesn't match property name.\n * @return {?}\n */\n function () { return this._attrToPropMap; },\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this._attrToPropMap = value; },\n enumerable: true,\n configurable: true\n });\n return DomAdapter;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Provides DOM operations in any browser environment.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar GenericBrowserDomAdapter = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GenericBrowserDomAdapter, _super);\n function GenericBrowserDomAdapter() {\n var _this = _super.call(this) || this;\n _this._animationPrefix = null;\n _this._transitionEnd = null;\n try {\n var /** @type {?} */ element_1 = _this.createElement('div', document);\n if (_this.getStyle(element_1, 'animationName') != null) {\n _this._animationPrefix = '';\n }\n else {\n var /** @type {?} */ domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];\n for (var /** @type {?} */ i = 0; i < domPrefixes.length; i++) {\n if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {\n _this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';\n break;\n }\n }\n }\n var /** @type {?} */ transEndEventNames_1 = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'oTransitionEnd otransitionend',\n transition: 'transitionend'\n };\n Object.keys(transEndEventNames_1).forEach(function (key) {\n if (_this.getStyle(element_1, key) != null) {\n _this._transitionEnd = transEndEventNames_1[key];\n }\n });\n }\n catch (/** @type {?} */ e) {\n _this._animationPrefix = null;\n _this._transitionEnd = null;\n }\n return _this;\n }\n /**\n * @param {?} el\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getDistributedNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).getDistributedNodes(); };\n /**\n * @param {?} el\n * @param {?} baseUrl\n * @param {?} href\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.resolveAndSetHref = /**\n * @param {?} el\n * @param {?} baseUrl\n * @param {?} href\n * @return {?}\n */\n function (el, baseUrl, href) {\n el.href = href == null ? baseUrl : baseUrl + '/../' + href;\n };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsDOMEvents = /**\n * @return {?}\n */\n function () { return true; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = /**\n * @return {?}\n */\n function () {\n return typeof (/** @type {?} */ (document.body)).createShadowRoot === 'function';\n };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getAnimationPrefix = /**\n * @return {?}\n */\n function () { return this._animationPrefix ? this._animationPrefix : ''; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getTransitionEnd = /**\n * @return {?}\n */\n function () { return this._transitionEnd ? this._transitionEnd : ''; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsAnimation = /**\n * @return {?}\n */\n function () {\n return this._animationPrefix != null && this._transitionEnd != null;\n };\n return GenericBrowserDomAdapter;\n}(DomAdapter));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _attrToPropMap = {\n 'class': 'className',\n 'innerHtml': 'innerHTML',\n 'readonly': 'readOnly',\n 'tabindex': 'tabIndex',\n};\nvar DOM_KEY_LOCATION_NUMPAD = 3;\n// Map to convert some key or keyIdentifier values to what will be returned by getEventKey\nvar _keyMap = {\n // The following values are here for cross-browser compatibility and to match the W3C standard\n // cf http://www.w3.org/TR/DOM-Level-3-Events-key/\n '\\b': 'Backspace',\n '\\t': 'Tab',\n '\\x7F': 'Delete',\n '\\x1B': 'Escape',\n 'Del': 'Delete',\n 'Esc': 'Escape',\n 'Left': 'ArrowLeft',\n 'Right': 'ArrowRight',\n 'Up': 'ArrowUp',\n 'Down': 'ArrowDown',\n 'Menu': 'ContextMenu',\n 'Scroll': 'ScrollLock',\n 'Win': 'OS'\n};\n// There is a bug in Chrome for numeric keypad keys:\n// https://code.google.com/p/chromium/issues/detail?id=155654\n// 1, 2, 3 ... are reported as A, B, C ...\nvar _chromeNumKeyPadMap = {\n 'A': '1',\n 'B': '2',\n 'C': '3',\n 'D': '4',\n 'E': '5',\n 'F': '6',\n 'G': '7',\n 'H': '8',\n 'I': '9',\n 'J': '*',\n 'K': '+',\n 'M': '-',\n 'N': '.',\n 'O': '/',\n '\\x60': '0',\n '\\x90': 'NumLock'\n};\nvar nodeContains;\nif (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['Node']) {\n nodeContains = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['Node'].prototype.contains || function (node) {\n return !!(this.compareDocumentPosition(node) & 16);\n };\n}\n/**\n * A `DomAdapter` powered by full browser DOM APIs.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nvar BrowserDomAdapter = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(BrowserDomAdapter, _super);\n function BrowserDomAdapter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} templateHtml\n * @return {?}\n */\n BrowserDomAdapter.prototype.parse = /**\n * @param {?} templateHtml\n * @return {?}\n */\n function (templateHtml) { throw new Error('parse not implemented'); };\n /**\n * @return {?}\n */\n BrowserDomAdapter.makeCurrent = /**\n * @return {?}\n */\n function () { setRootDomAdapter(new BrowserDomAdapter()); };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasProperty = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) { return name in element; };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setProperty = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (el, name, value) { (/** @type {?} */ (el))[name] = value; };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getProperty = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { return (/** @type {?} */ (el))[name]; };\n /**\n * @param {?} el\n * @param {?} methodName\n * @param {?} args\n * @return {?}\n */\n BrowserDomAdapter.prototype.invoke = /**\n * @param {?} el\n * @param {?} methodName\n * @param {?} args\n * @return {?}\n */\n function (el, methodName, args) {\n (_a = (/** @type {?} */ (el)))[methodName].apply(_a, args);\n var _a;\n };\n // TODO(tbosch): move this into a separate environment class once we have it\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.logError = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n if (console.error) {\n console.error(error);\n }\n else {\n console.log(error);\n }\n }\n };\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.log = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n window.console.log && window.console.log(error);\n }\n };\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.logGroup = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n window.console.group && window.console.group(error);\n }\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.logGroupEnd = /**\n * @return {?}\n */\n function () {\n if (window.console) {\n window.console.groupEnd && window.console.groupEnd();\n }\n };\n Object.defineProperty(BrowserDomAdapter.prototype, \"attrToPropMap\", {\n get: /**\n * @return {?}\n */\n function () { return _attrToPropMap; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} nodeA\n * @param {?} nodeB\n * @return {?}\n */\n BrowserDomAdapter.prototype.contains = /**\n * @param {?} nodeA\n * @param {?} nodeB\n * @return {?}\n */\n function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };\n /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.querySelector = /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n function (el, selector) { return el.querySelector(selector); };\n /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.querySelectorAll = /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n function (el, selector) { return el.querySelectorAll(selector); };\n /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n BrowserDomAdapter.prototype.on = /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n function (el, evt, listener) { el.addEventListener(evt, listener, false); };\n /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n BrowserDomAdapter.prototype.onAndCancel = /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n function (el, evt, listener) {\n el.addEventListener(evt, listener, false);\n // Needed to follow Dart's subscription semantic, until fix of\n // https://code.google.com/p/dart/issues/detail?id=17406\n return function () { el.removeEventListener(evt, listener, false); };\n };\n /**\n * @param {?} el\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.dispatchEvent = /**\n * @param {?} el\n * @param {?} evt\n * @return {?}\n */\n function (el, evt) { el.dispatchEvent(evt); };\n /**\n * @param {?} eventType\n * @return {?}\n */\n BrowserDomAdapter.prototype.createMouseEvent = /**\n * @param {?} eventType\n * @return {?}\n */\n function (eventType) {\n var /** @type {?} */ evt = this.getDefaultDocument().createEvent('MouseEvent');\n evt.initEvent(eventType, true, true);\n return evt;\n };\n /**\n * @param {?} eventType\n * @return {?}\n */\n BrowserDomAdapter.prototype.createEvent = /**\n * @param {?} eventType\n * @return {?}\n */\n function (eventType) {\n var /** @type {?} */ evt = this.getDefaultDocument().createEvent('Event');\n evt.initEvent(eventType, true, true);\n return evt;\n };\n /**\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.preventDefault = /**\n * @param {?} evt\n * @return {?}\n */\n function (evt) {\n evt.preventDefault();\n evt.returnValue = false;\n };\n /**\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.isPrevented = /**\n * @param {?} evt\n * @return {?}\n */\n function (evt) {\n return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getInnerHTML = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.innerHTML; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getTemplateContent = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n return 'content' in el && this.isTemplateElement(el) ? (/** @type {?} */ (el)).content : null;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getOuterHTML = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.outerHTML; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.nodeName = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeName; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.nodeValue = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeValue; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.type = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.type; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.content = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (this.hasProperty(node, 'content')) {\n return (/** @type {?} */ (node)).content;\n }\n else {\n return node;\n }\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.firstChild = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.firstChild; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.nextSibling = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.nextSibling; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.parentElement = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.parentNode; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.childNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.childNodes; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.childNodesAsList = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n var /** @type {?} */ childNodes = el.childNodes;\n var /** @type {?} */ res = new Array(childNodes.length);\n for (var /** @type {?} */ i = 0; i < childNodes.length; i++) {\n res[i] = childNodes[i];\n }\n return res;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.clearNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n };\n /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.appendChild = /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n function (el, node) { el.appendChild(node); };\n /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeChild = /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n function (el, node) { el.removeChild(node); };\n /**\n * @param {?} el\n * @param {?} newChild\n * @param {?} oldChild\n * @return {?}\n */\n BrowserDomAdapter.prototype.replaceChild = /**\n * @param {?} el\n * @param {?} newChild\n * @param {?} oldChild\n * @return {?}\n */\n function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.remove = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n return node;\n };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n function (parent, ref, node) { parent.insertBefore(node, ref); };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} nodes\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertAllBefore = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} nodes\n * @return {?}\n */\n function (parent, ref, nodes) {\n nodes.forEach(function (n) { return parent.insertBefore(n, ref); });\n };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertAfter = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setInnerHTML = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.innerHTML = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getText = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.textContent; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setText = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.textContent = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getValue = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.value; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setValue = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.value = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getChecked = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.checked; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setChecked = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.checked = value; };\n /**\n * @param {?} text\n * @return {?}\n */\n BrowserDomAdapter.prototype.createComment = /**\n * @param {?} text\n * @return {?}\n */\n function (text) { return this.getDefaultDocument().createComment(text); };\n /**\n * @param {?} html\n * @return {?}\n */\n BrowserDomAdapter.prototype.createTemplate = /**\n * @param {?} html\n * @return {?}\n */\n function (html) {\n var /** @type {?} */ t = this.getDefaultDocument().createElement('template');\n t.innerHTML = html;\n return t;\n };\n /**\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createElement = /**\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n function (tagName, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createElement(tagName);\n };\n /**\n * @param {?} ns\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createElementNS = /**\n * @param {?} ns\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n function (ns, tagName, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createElementNS(ns, tagName);\n };\n /**\n * @param {?} text\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createTextNode = /**\n * @param {?} text\n * @param {?=} doc\n * @return {?}\n */\n function (text, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createTextNode(text);\n };\n /**\n * @param {?} attrName\n * @param {?} attrValue\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createScriptTag = /**\n * @param {?} attrName\n * @param {?} attrValue\n * @param {?=} doc\n * @return {?}\n */\n function (attrName, attrValue, doc) {\n doc = doc || this.getDefaultDocument();\n var /** @type {?} */ el = /** @type {?} */ (doc.createElement('SCRIPT'));\n el.setAttribute(attrName, attrValue);\n return el;\n };\n /**\n * @param {?} css\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createStyleElement = /**\n * @param {?} css\n * @param {?=} doc\n * @return {?}\n */\n function (css, doc) {\n doc = doc || this.getDefaultDocument();\n var /** @type {?} */ style = /** @type {?} */ (doc.createElement('style'));\n this.appendChild(style, this.createTextNode(css, doc));\n return style;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.createShadowRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).createShadowRoot(); };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getShadowRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).shadowRoot; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHost = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).host; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.clone = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.cloneNode(true); };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getElementsByClassName = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return element.getElementsByClassName(name);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getElementsByTagName = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return element.getElementsByTagName(name);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.classList = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return Array.prototype.slice.call(element.classList, 0); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.addClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) { element.classList.add(className); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) { element.classList.remove(className); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) {\n return element.classList.contains(className);\n };\n /**\n * @param {?} element\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\n BrowserDomAdapter.prototype.setStyle = /**\n * @param {?} element\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\n function (element, styleName, styleValue) {\n element.style[styleName] = styleValue;\n };\n /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeStyle = /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n function (element, stylename) {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n element.style[stylename] = '';\n };\n /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n BrowserDomAdapter.prototype.getStyle = /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n function (element, stylename) { return element.style[stylename]; };\n /**\n * @param {?} element\n * @param {?} styleName\n * @param {?=} styleValue\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasStyle = /**\n * @param {?} element\n * @param {?} styleName\n * @param {?=} styleValue\n * @return {?}\n */\n function (element, styleName, styleValue) {\n var /** @type {?} */ value = this.getStyle(element, styleName) || '';\n return styleValue ? value == styleValue : value.length > 0;\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.tagName = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return element.tagName; };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.attributeMap = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var /** @type {?} */ res = new Map();\n var /** @type {?} */ elAttrs = element.attributes;\n for (var /** @type {?} */ i = 0; i < elAttrs.length; i++) {\n var /** @type {?} */ attrib = elAttrs.item(i);\n res.set(attrib.name, attrib.value);\n }\n return res;\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) {\n return element.hasAttribute(attribute);\n };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} attribute\n * @return {?}\n */\n function (element, ns, attribute) {\n return element.hasAttributeNS(ns, attribute);\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.getAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) {\n return element.getAttribute(attribute);\n };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n function (element, ns, name) {\n return element.getAttributeNS(ns, name);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setAttribute = /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, name, value) { element.setAttribute(name, value); };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, ns, name, value) {\n element.setAttributeNS(ns, name, value);\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) { element.removeAttribute(attribute); };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n function (element, ns, name) {\n element.removeAttributeNS(ns, name);\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.templateAwareRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.createHtmlDocument = /**\n * @return {?}\n */\n function () {\n return document.implementation.createHTMLDocument('fakeTitle');\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getDefaultDocument = /**\n * @return {?}\n */\n function () { return document; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getBoundingClientRect = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n try {\n return el.getBoundingClientRect();\n }\n catch (/** @type {?} */ e) {\n return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };\n }\n };\n /**\n * @param {?} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.getTitle = /**\n * @param {?} doc\n * @return {?}\n */\n function (doc) { return doc.title; };\n /**\n * @param {?} doc\n * @param {?} newTitle\n * @return {?}\n */\n BrowserDomAdapter.prototype.setTitle = /**\n * @param {?} doc\n * @param {?} newTitle\n * @return {?}\n */\n function (doc, newTitle) { doc.title = newTitle || ''; };\n /**\n * @param {?} n\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.elementMatches = /**\n * @param {?} n\n * @param {?} selector\n * @return {?}\n */\n function (n, selector) {\n if (this.isElementNode(n)) {\n return n.matches && n.matches(selector) ||\n n.msMatchesSelector && n.msMatchesSelector(selector) ||\n n.webkitMatchesSelector && n.webkitMatchesSelector(selector);\n }\n return false;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.isTemplateElement = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n return this.isElementNode(el) && el.nodeName === 'TEMPLATE';\n };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isTextNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.TEXT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isCommentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.COMMENT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isElementNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.ELEMENT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n return node.shadowRoot != null && node instanceof HTMLElement;\n };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node instanceof DocumentFragment; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.importIntoDoc = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return document.importNode(this.templateAwareRoot(node), true); };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.adoptNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return document.adoptNode(node); };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHref = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return /** @type {?} */ ((el.getAttribute('href'))); };\n /**\n * @param {?} event\n * @return {?}\n */\n BrowserDomAdapter.prototype.getEventKey = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n var /** @type {?} */ key = event.key;\n if (key == null) {\n key = event.keyIdentifier;\n // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and\n // Safari cf\n // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces\n if (key == null) {\n return 'Unidentified';\n }\n if (key.startsWith('U+')) {\n key = String.fromCharCode(parseInt(key.substring(2), 16));\n if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {\n // There is a bug in Chrome for numeric keypad keys:\n // https://code.google.com/p/chromium/issues/detail?id=155654\n // 1, 2, 3 ... are reported as A, B, C ...\n key = (/** @type {?} */ (_chromeNumKeyPadMap))[key];\n }\n }\n }\n return _keyMap[key] || key;\n };\n /**\n * @param {?} doc\n * @param {?} target\n * @return {?}\n */\n BrowserDomAdapter.prototype.getGlobalEventTarget = /**\n * @param {?} doc\n * @param {?} target\n * @return {?}\n */\n function (doc, target) {\n if (target === 'window') {\n return window;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHistory = /**\n * @return {?}\n */\n function () { return window.history; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getLocation = /**\n * @return {?}\n */\n function () { return window.location; };\n /**\n * @param {?} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.getBaseHref = /**\n * @param {?} doc\n * @return {?}\n */\n function (doc) {\n var /** @type {?} */ href = getBaseElementHref();\n return href == null ? null : relativePath(href);\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.resetBaseElement = /**\n * @return {?}\n */\n function () { baseElement = null; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getUserAgent = /**\n * @return {?}\n */\n function () { return window.navigator.userAgent; };\n /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setData = /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, name, value) {\n this.setAttribute(element, 'data-' + name, value);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getData = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return this.getAttribute(element, 'data-' + name);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.getComputedStyle = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return getComputedStyle(element); };\n // TODO(tbosch): move this into a separate environment class once we have it\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.supportsWebAnimation = /**\n * @return {?}\n */\n function () {\n return typeof (/** @type {?} */ (Element)).prototype['animate'] === 'function';\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.performanceNow = /**\n * @return {?}\n */\n function () {\n // performance.now() is not available in all browsers, see\n // http://caniuse.com/#search=performance.now\n return window.performance && window.performance.now ? window.performance.now() :\n new Date().getTime();\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.supportsCookies = /**\n * @return {?}\n */\n function () { return true; };\n /**\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getCookie = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { return Object(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"ɵparseCookieValue\"])(document.cookie, name); };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setCookie = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does\n // not clear other cookies.\n document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n };\n return BrowserDomAdapter;\n}(GenericBrowserDomAdapter));\nvar baseElement = null;\n/**\n * @return {?}\n */\nfunction getBaseElementHref() {\n if (!baseElement) {\n baseElement = /** @type {?} */ ((document.querySelector('base')));\n if (!baseElement) {\n return null;\n }\n }\n return baseElement.getAttribute('href');\n}\n// based on urlUtils.js in AngularJS 1\nvar urlParsingNode;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction relativePath(url) {\n if (!urlParsingNode) {\n urlParsingNode = document.createElement('a');\n }\n urlParsingNode.setAttribute('href', url);\n return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :\n '/' + urlParsingNode.pathname;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application into a Web Worker).\n *\n * @deprecated import from `\\@angular/common` instead.\n */\nvar DOCUMENT$1 = __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"DOCUMENT\"];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction supportsState() {\n return !!window.history.pushState;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n */\nvar BrowserPlatformLocation = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(BrowserPlatformLocation, _super);\n function BrowserPlatformLocation(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n _this._init();\n return _this;\n }\n // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n BrowserPlatformLocation.prototype._init = /**\n * \\@internal\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.getBaseHrefFromDOM = /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((getDOM().getBaseHref(this._doc))); };\n /**\n * @param {?} fn\n * @return {?}\n */\n BrowserPlatformLocation.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n BrowserPlatformLocation.prototype.onHashChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);\n };\n Object.defineProperty(BrowserPlatformLocation.prototype, \"pathname\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.pathname; },\n set: /**\n * @param {?} newPath\n * @return {?}\n */\n function (newPath) { this.location.pathname = newPath; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserPlatformLocation.prototype, \"search\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.search; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserPlatformLocation.prototype, \"hash\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.hash; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n BrowserPlatformLocation.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n function (state, title, url) {\n if (supportsState()) {\n this._history.pushState(state, title, url);\n }\n else {\n this.location.hash = url;\n }\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n BrowserPlatformLocation.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n function (state, title, url) {\n if (supportsState()) {\n this._history.replaceState(state, title, url);\n }\n else {\n this.location.hash = url;\n }\n };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.forward = /**\n * @return {?}\n */\n function () { this._history.forward(); };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.back = /**\n * @return {?}\n */\n function () { this._history.back(); };\n BrowserPlatformLocation.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n BrowserPlatformLocation.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return BrowserPlatformLocation;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A service that can be used to get and add meta tags.\n *\n * \\@experimental\n */\nvar Meta = /** @class */ (function () {\n function Meta(_doc) {\n this._doc = _doc;\n this._dom = getDOM();\n }\n /**\n * @param {?} tag\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype.addTag = /**\n * @param {?} tag\n * @param {?=} forceCreation\n * @return {?}\n */\n function (tag, forceCreation) {\n if (forceCreation === void 0) { forceCreation = false; }\n if (!tag)\n return null;\n return this._getOrCreateElement(tag, forceCreation);\n };\n /**\n * @param {?} tags\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype.addTags = /**\n * @param {?} tags\n * @param {?=} forceCreation\n * @return {?}\n */\n function (tags, forceCreation) {\n var _this = this;\n if (forceCreation === void 0) { forceCreation = false; }\n if (!tags)\n return [];\n return tags.reduce(function (result, tag) {\n if (tag) {\n result.push(_this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.getTag = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) {\n if (!attrSelector)\n return null;\n return this._dom.querySelector(this._doc, \"meta[\" + attrSelector + \"]\") || null;\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.getTags = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) {\n if (!attrSelector)\n return [];\n var /** @type {?} */ list = this._dom.querySelectorAll(this._doc, \"meta[\" + attrSelector + \"]\");\n return list ? [].slice.call(list) : [];\n };\n /**\n * @param {?} tag\n * @param {?=} selector\n * @return {?}\n */\n Meta.prototype.updateTag = /**\n * @param {?} tag\n * @param {?=} selector\n * @return {?}\n */\n function (tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n var /** @type {?} */ meta = /** @type {?} */ ((this.getTag(selector)));\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.removeTag = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) { this.removeTagElement(/** @type {?} */ ((this.getTag(attrSelector)))); };\n /**\n * @param {?} meta\n * @return {?}\n */\n Meta.prototype.removeTagElement = /**\n * @param {?} meta\n * @return {?}\n */\n function (meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n };\n /**\n * @param {?} meta\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype._getOrCreateElement = /**\n * @param {?} meta\n * @param {?=} forceCreation\n * @return {?}\n */\n function (meta, forceCreation) {\n if (forceCreation === void 0) { forceCreation = false; }\n if (!forceCreation) {\n var /** @type {?} */ selector = this._parseSelector(meta);\n var /** @type {?} */ elem = /** @type {?} */ ((this.getTag(selector)));\n // It's allowed to have multiple elements with the same name so it's not enough to\n // just check that element with the same name already present on the page. We also need to\n // check if element has tag attributes\n if (elem && this._containsAttributes(meta, elem))\n return elem;\n }\n var /** @type {?} */ element = /** @type {?} */ (this._dom.createElement('meta'));\n this._setMetaElementAttributes(meta, element);\n var /** @type {?} */ head = this._dom.getElementsByTagName(this._doc, 'head')[0];\n this._dom.appendChild(head, element);\n return element;\n };\n /**\n * @param {?} tag\n * @param {?} el\n * @return {?}\n */\n Meta.prototype._setMetaElementAttributes = /**\n * @param {?} tag\n * @param {?} el\n * @return {?}\n */\n function (tag, el) {\n var _this = this;\n Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });\n return el;\n };\n /**\n * @param {?} tag\n * @return {?}\n */\n Meta.prototype._parseSelector = /**\n * @param {?} tag\n * @return {?}\n */\n function (tag) {\n var /** @type {?} */ attr = tag.name ? 'name' : 'property';\n return attr + \"=\\\"\" + tag[attr] + \"\\\"\";\n };\n /**\n * @param {?} tag\n * @param {?} elem\n * @return {?}\n */\n Meta.prototype._containsAttributes = /**\n * @param {?} tag\n * @param {?} elem\n * @return {?}\n */\n function (tag, elem) {\n var _this = this;\n return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });\n };\n Meta.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Meta.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return Meta;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An id that identifies a particular application being bootstrapped, that should\n * match across the client/server boundary.\n */\nvar TRANSITION_ID = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('TRANSITION_ID');\n/**\n * @param {?} transitionId\n * @param {?} document\n * @param {?} injector\n * @return {?}\n */\nfunction appInitializerFactory(transitionId, document, injector) {\n return function () {\n // Wait for all application initializers to be completed before removing the styles set by\n // the server.\n injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationInitStatus\"]).donePromise.then(function () {\n var /** @type {?} */ dom = getDOM();\n var /** @type {?} */ styles = Array.prototype.slice.apply(dom.querySelectorAll(document, \"style[ng-transition]\"));\n styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })\n .forEach(function (el) { return dom.remove(el); });\n });\n };\n}\nvar SERVER_TRANSITION_PROVIDERS = [\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n useFactory: appInitializerFactory,\n deps: [TRANSITION_ID, DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"]],\n multi: true\n },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar BrowserGetTestability = /** @class */ (function () {\n function BrowserGetTestability() {\n }\n /**\n * @return {?}\n */\n BrowserGetTestability.init = /**\n * @return {?}\n */\n function () { Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"setTestabilityGetter\"])(new BrowserGetTestability()); };\n /**\n * @param {?} registry\n * @return {?}\n */\n BrowserGetTestability.prototype.addToWindow = /**\n * @param {?} registry\n * @return {?}\n */\n function (registry) {\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAngularTestability'] = function (elem, findInAncestors) {\n if (findInAncestors === void 0) { findInAncestors = true; }\n var /** @type {?} */ testability = registry.findTestabilityInTree(elem, findInAncestors);\n if (testability == null) {\n throw new Error('Could not find testability for element.');\n }\n return testability;\n };\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };\n var /** @type {?} */ whenAllStable = function (callback /** TODO #9100 */) {\n var /** @type {?} */ testabilities = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularTestabilities']();\n var /** @type {?} */ count = testabilities.length;\n var /** @type {?} */ didWork = false;\n var /** @type {?} */ decrement = function (didWork_ /** TODO #9100 */) {\n didWork = didWork || didWork_;\n count--;\n if (count == 0) {\n callback(didWork);\n }\n };\n testabilities.forEach(function (testability /** TODO #9100 */) {\n testability.whenStable(decrement);\n });\n };\n if (!__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers']) {\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers'] = [];\n }\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers'].push(whenAllStable);\n };\n /**\n * @param {?} registry\n * @param {?} elem\n * @param {?} findInAncestors\n * @return {?}\n */\n BrowserGetTestability.prototype.findTestabilityInTree = /**\n * @param {?} registry\n * @param {?} elem\n * @param {?} findInAncestors\n * @return {?}\n */\n function (registry, elem, findInAncestors) {\n if (elem == null) {\n return null;\n }\n var /** @type {?} */ t = registry.getTestability(elem);\n if (t != null) {\n return t;\n }\n else if (!findInAncestors) {\n return null;\n }\n if (getDOM().isShadowRoot(elem)) {\n return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);\n }\n return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);\n };\n return BrowserGetTestability;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A service that can be used to get and set the title of a current HTML document.\n *\n * Since an Angular application can't be bootstrapped on the entire HTML document (`` tag)\n * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements\n * (representing the `` tag). Instead, this service can be used to set and get the current\n * title value.\n *\n * \\@experimental\n */\nvar Title = /** @class */ (function () {\n function Title(_doc) {\n this._doc = _doc;\n }\n /**\n * Get the title of the current HTML document.\n */\n /**\n * Get the title of the current HTML document.\n * @return {?}\n */\n Title.prototype.getTitle = /**\n * Get the title of the current HTML document.\n * @return {?}\n */\n function () { return getDOM().getTitle(this._doc); };\n /**\n * Set the title of the current HTML document.\n * @param newTitle\n */\n /**\n * Set the title of the current HTML document.\n * @param {?} newTitle\n * @return {?}\n */\n Title.prototype.setTitle = /**\n * Set the title of the current HTML document.\n * @param {?} newTitle\n * @return {?}\n */\n function (newTitle) { getDOM().setTitle(this._doc, newTitle); };\n Title.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Title.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return Title;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} input\n * @return {?}\n */\n\n/**\n * @param {?} input\n * @return {?}\n */\n\n/**\n * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if\n * `name` is `'probe'`.\n * @param {?} name Name under which it will be exported. Keep in mind this will be a property of the\n * global `ng` object.\n * @param {?} value The value to export.\n * @return {?}\n */\nfunction exportNgVar(name, value) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for angularJS (via `goog.provide('ng....')`).\n var /** @type {?} */ ng = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['ng'] = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['ng'])) || {};\n ng[name] = value;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CORE_TOKENS = {\n 'ApplicationRef': __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"],\n 'NgZone': __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"],\n};\nvar INSPECT_GLOBAL_NAME = 'probe';\nvar CORE_TOKENS_GLOBAL_NAME = 'coreTokens';\n/**\n * Returns a {\\@link DebugElement} for the given native DOM element, or\n * null if the given native element does not have an Angular view associated\n * with it.\n * @param {?} element\n * @return {?}\n */\nfunction inspectNativeElement(element) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"getDebugNode\"])(element);\n}\n/**\n * @param {?} coreTokens\n * @return {?}\n */\nfunction _createNgProbe(coreTokens) {\n exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);\n exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));\n return function () { return inspectNativeElement; };\n}\n/**\n * @param {?} tokens\n * @return {?}\n */\nfunction _ngProbeTokensToMap(tokens) {\n return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});\n}\n/**\n * Providers which support debugging Angular applications (e.g. via `ng.probe`).\n */\nvar ELEMENT_PROBE_PROVIDERS = [\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n useFactory: _createNgProbe,\n deps: [\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"], new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()],\n ],\n multi: true,\n },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar EVENT_MANAGER_PLUGINS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('EventManagerPlugins');\n/**\n * \\@stable\n */\nvar EventManager = /** @class */ (function () {\n function EventManager(plugins, _zone) {\n var _this = this;\n this._zone = _zone;\n this._eventNameToPlugin = new Map();\n plugins.forEach(function (p) { return p.manager = _this; });\n this._plugins = plugins.slice().reverse();\n }\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManager.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ plugin = this._findPluginFor(eventName);\n return plugin.addEventListener(element, eventName, handler);\n };\n /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManager.prototype.addGlobalEventListener = /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (target, eventName, handler) {\n var /** @type {?} */ plugin = this._findPluginFor(eventName);\n return plugin.addGlobalEventListener(target, eventName, handler);\n };\n /**\n * @return {?}\n */\n EventManager.prototype.getZone = /**\n * @return {?}\n */\n function () { return this._zone; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} eventName\n * @return {?}\n */\n EventManager.prototype._findPluginFor = /**\n * \\@internal\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n var /** @type {?} */ plugin = this._eventNameToPlugin.get(eventName);\n if (plugin) {\n return plugin;\n }\n var /** @type {?} */ plugins = this._plugins;\n for (var /** @type {?} */ i = 0; i < plugins.length; i++) {\n var /** @type {?} */ plugin_1 = plugins[i];\n if (plugin_1.supports(eventName)) {\n this._eventNameToPlugin.set(eventName, plugin_1);\n return plugin_1;\n }\n }\n throw new Error(\"No event manager plugin found for event \" + eventName);\n };\n EventManager.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n EventManager.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [EVENT_MANAGER_PLUGINS,] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"], },\n ]; };\n return EventManager;\n}());\n/**\n * @abstract\n */\nvar EventManagerPlugin = /** @class */ (function () {\n function EventManagerPlugin(_doc) {\n this._doc = _doc;\n }\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManagerPlugin.prototype.addGlobalEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ target = getDOM().getGlobalEventTarget(this._doc, element);\n if (!target) {\n throw new Error(\"Unsupported event target \" + target + \" for event \" + eventName);\n }\n return this.addEventListener(target, eventName, handler);\n };\n return EventManagerPlugin;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SharedStylesHost = /** @class */ (function () {\n function SharedStylesHost() {\n /**\n * \\@internal\n */\n this._stylesSet = new Set();\n }\n /**\n * @param {?} styles\n * @return {?}\n */\n SharedStylesHost.prototype.addStyles = /**\n * @param {?} styles\n * @return {?}\n */\n function (styles) {\n var _this = this;\n var /** @type {?} */ additions = new Set();\n styles.forEach(function (style) {\n if (!_this._stylesSet.has(style)) {\n _this._stylesSet.add(style);\n additions.add(style);\n }\n });\n this.onStylesAdded(additions);\n };\n /**\n * @param {?} additions\n * @return {?}\n */\n SharedStylesHost.prototype.onStylesAdded = /**\n * @param {?} additions\n * @return {?}\n */\n function (additions) { };\n /**\n * @return {?}\n */\n SharedStylesHost.prototype.getAllStyles = /**\n * @return {?}\n */\n function () { return Array.from(this._stylesSet); };\n SharedStylesHost.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n SharedStylesHost.ctorParameters = function () { return []; };\n return SharedStylesHost;\n}());\nvar DomSharedStylesHost = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomSharedStylesHost, _super);\n function DomSharedStylesHost(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n _this._hostNodes = new Set();\n _this._styleNodes = new Set();\n _this._hostNodes.add(_doc.head);\n return _this;\n }\n /**\n * @param {?} styles\n * @param {?} host\n * @return {?}\n */\n DomSharedStylesHost.prototype._addStylesToHost = /**\n * @param {?} styles\n * @param {?} host\n * @return {?}\n */\n function (styles, host) {\n var _this = this;\n styles.forEach(function (style) {\n var /** @type {?} */ styleEl = _this._doc.createElement('style');\n styleEl.textContent = style;\n _this._styleNodes.add(host.appendChild(styleEl));\n });\n };\n /**\n * @param {?} hostNode\n * @return {?}\n */\n DomSharedStylesHost.prototype.addHost = /**\n * @param {?} hostNode\n * @return {?}\n */\n function (hostNode) {\n this._addStylesToHost(this._stylesSet, hostNode);\n this._hostNodes.add(hostNode);\n };\n /**\n * @param {?} hostNode\n * @return {?}\n */\n DomSharedStylesHost.prototype.removeHost = /**\n * @param {?} hostNode\n * @return {?}\n */\n function (hostNode) { this._hostNodes.delete(hostNode); };\n /**\n * @param {?} additions\n * @return {?}\n */\n DomSharedStylesHost.prototype.onStylesAdded = /**\n * @param {?} additions\n * @return {?}\n */\n function (additions) {\n var _this = this;\n this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });\n };\n /**\n * @return {?}\n */\n DomSharedStylesHost.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };\n DomSharedStylesHost.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomSharedStylesHost.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return DomSharedStylesHost;\n}(SharedStylesHost));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NAMESPACE_URIS = {\n 'svg': 'http://www.w3.org/2000/svg',\n 'xhtml': 'http://www.w3.org/1999/xhtml',\n 'xlink': 'http://www.w3.org/1999/xlink',\n 'xml': 'http://www.w3.org/XML/1998/namespace',\n 'xmlns': 'http://www.w3.org/2000/xmlns/',\n};\nvar COMPONENT_REGEX = /%COMP%/g;\nvar COMPONENT_VARIABLE = '%COMP%';\nvar HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\nvar CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimContentAttribute(componentShortId) {\n return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimHostAttribute(componentShortId) {\n return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} compId\n * @param {?} styles\n * @param {?} target\n * @return {?}\n */\nfunction flattenStyles(compId, styles, target) {\n for (var /** @type {?} */ i = 0; i < styles.length; i++) {\n var /** @type {?} */ style = styles[i];\n if (Array.isArray(style)) {\n flattenStyles(compId, style, target);\n }\n else {\n style = style.replace(COMPONENT_REGEX, compId);\n target.push(style);\n }\n }\n return target;\n}\n/**\n * @param {?} eventHandler\n * @return {?}\n */\nfunction decoratePreventDefault(eventHandler) {\n return function (event) {\n var /** @type {?} */ allowDefaultBehavior = eventHandler(event);\n if (allowDefaultBehavior === false) {\n // TODO(tbosch): move preventDefault into event plugins...\n event.preventDefault();\n event.returnValue = false;\n }\n };\n}\nvar DomRendererFactory2 = /** @class */ (function () {\n function DomRendererFactory2(eventManager, sharedStylesHost) {\n this.eventManager = eventManager;\n this.sharedStylesHost = sharedStylesHost;\n this.rendererByCompId = new Map();\n this.defaultRenderer = new DefaultDomRenderer2(eventManager);\n }\n /**\n * @param {?} element\n * @param {?} type\n * @return {?}\n */\n DomRendererFactory2.prototype.createRenderer = /**\n * @param {?} element\n * @param {?} type\n * @return {?}\n */\n function (element, type) {\n if (!element || !type) {\n return this.defaultRenderer;\n }\n switch (type.encapsulation) {\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Emulated: {\n var /** @type {?} */ renderer = this.rendererByCompId.get(type.id);\n if (!renderer) {\n renderer =\n new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type);\n this.rendererByCompId.set(type.id, renderer);\n }\n (/** @type {?} */ (renderer)).applyToHost(element);\n return renderer;\n }\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Native:\n return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);\n default: {\n if (!this.rendererByCompId.has(type.id)) {\n var /** @type {?} */ styles = flattenStyles(type.id, type.styles, []);\n this.sharedStylesHost.addStyles(styles);\n this.rendererByCompId.set(type.id, this.defaultRenderer);\n }\n return this.defaultRenderer;\n }\n }\n };\n /**\n * @return {?}\n */\n DomRendererFactory2.prototype.begin = /**\n * @return {?}\n */\n function () { };\n /**\n * @return {?}\n */\n DomRendererFactory2.prototype.end = /**\n * @return {?}\n */\n function () { };\n DomRendererFactory2.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomRendererFactory2.ctorParameters = function () { return [\n { type: EventManager, },\n { type: DomSharedStylesHost, },\n ]; };\n return DomRendererFactory2;\n}());\nvar DefaultDomRenderer2 = /** @class */ (function () {\n function DefaultDomRenderer2(eventManager) {\n this.eventManager = eventManager;\n this.data = Object.create(null);\n }\n /**\n * @return {?}\n */\n DefaultDomRenderer2.prototype.destroy = /**\n * @return {?}\n */\n function () { };\n /**\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createElement = /**\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n function (name, namespace) {\n if (namespace) {\n return document.createElementNS(NAMESPACE_URIS[namespace], name);\n }\n return document.createElement(name);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createComment = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return document.createComment(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createText = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return document.createTextNode(value); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.appendChild = /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n function (parent, newChild) { parent.appendChild(newChild); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n function (parent, newChild, refChild) {\n if (parent) {\n parent.insertBefore(newChild, refChild);\n }\n };\n /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeChild = /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n function (parent, oldChild) {\n if (parent) {\n parent.removeChild(oldChild);\n }\n };\n /**\n * @param {?} selectorOrNode\n * @return {?}\n */\n DefaultDomRenderer2.prototype.selectRootElement = /**\n * @param {?} selectorOrNode\n * @return {?}\n */\n function (selectorOrNode) {\n var /** @type {?} */ el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :\n selectorOrNode;\n if (!el) {\n throw new Error(\"The selector \\\"\" + selectorOrNode + \"\\\" did not match any elements\");\n }\n el.textContent = '';\n return el;\n };\n /**\n * @param {?} node\n * @return {?}\n */\n DefaultDomRenderer2.prototype.parentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.parentNode; };\n /**\n * @param {?} node\n * @return {?}\n */\n DefaultDomRenderer2.prototype.nextSibling = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nextSibling; };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setAttribute = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\n function (el, name, value, namespace) {\n if (namespace) {\n name = namespace + \":\" + name;\n var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.setAttributeNS(namespaceUri, name, value);\n }\n else {\n el.setAttribute(name, value);\n }\n }\n else {\n el.setAttribute(name, value);\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeAttribute = /**\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n function (el, name, namespace) {\n if (namespace) {\n var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.removeAttributeNS(namespaceUri, name);\n }\n else {\n el.removeAttribute(namespace + \":\" + name);\n }\n }\n else {\n el.removeAttribute(name);\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n DefaultDomRenderer2.prototype.addClass = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { el.classList.add(name); };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeClass = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { el.classList.remove(name); };\n /**\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?} flags\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setStyle = /**\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?} flags\n * @return {?}\n */\n function (el, style, value, flags) {\n if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].DashCase) {\n el.style.setProperty(style, value, !!(flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].Important) ? 'important' : '');\n }\n else {\n el.style[style] = value;\n }\n };\n /**\n * @param {?} el\n * @param {?} style\n * @param {?} flags\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeStyle = /**\n * @param {?} el\n * @param {?} style\n * @param {?} flags\n * @return {?}\n */\n function (el, style, flags) {\n if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].DashCase) {\n el.style.removeProperty(style);\n }\n else {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n el.style[style] = '';\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setProperty = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (el, name, value) {\n checkNoSyntheticProp(name, 'property');\n el[name] = value;\n };\n /**\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setValue = /**\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\n function (node, value) { node.nodeValue = value; };\n /**\n * @param {?} target\n * @param {?} event\n * @param {?} callback\n * @return {?}\n */\n DefaultDomRenderer2.prototype.listen = /**\n * @param {?} target\n * @param {?} event\n * @param {?} callback\n * @return {?}\n */\n function (target, event, callback) {\n checkNoSyntheticProp(event, 'listener');\n if (typeof target === 'string') {\n return /** @type {?} */ (this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)));\n }\n return /** @type {?} */ ((this.eventManager.addEventListener(target, event, decoratePreventDefault(callback))));\n };\n return DefaultDomRenderer2;\n}());\nvar AT_CHARCODE = '@'.charCodeAt(0);\n/**\n * @param {?} name\n * @param {?} nameKind\n * @return {?}\n */\nfunction checkNoSyntheticProp(name, nameKind) {\n if (name.charCodeAt(0) === AT_CHARCODE) {\n throw new Error(\"Found the synthetic \" + nameKind + \" \" + name + \". Please include either \\\"BrowserAnimationsModule\\\" or \\\"NoopAnimationsModule\\\" in your application.\");\n }\n}\nvar EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(EmulatedEncapsulationDomRenderer2, _super);\n function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component) {\n var _this = _super.call(this, eventManager) || this;\n _this.component = component;\n var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);\n sharedStylesHost.addStyles(styles);\n _this.contentAttr = shimContentAttribute(component.id);\n _this.hostAttr = shimHostAttribute(component.id);\n return _this;\n }\n /**\n * @param {?} element\n * @return {?}\n */\n EmulatedEncapsulationDomRenderer2.prototype.applyToHost = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };\n /**\n * @param {?} parent\n * @param {?} name\n * @return {?}\n */\n EmulatedEncapsulationDomRenderer2.prototype.createElement = /**\n * @param {?} parent\n * @param {?} name\n * @return {?}\n */\n function (parent, name) {\n var /** @type {?} */ el = _super.prototype.createElement.call(this, parent, name);\n _super.prototype.setAttribute.call(this, el, this.contentAttr, '');\n return el;\n };\n return EmulatedEncapsulationDomRenderer2;\n}(DefaultDomRenderer2));\nvar ShadowDomRenderer = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ShadowDomRenderer, _super);\n function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {\n var _this = _super.call(this, eventManager) || this;\n _this.sharedStylesHost = sharedStylesHost;\n _this.hostEl = hostEl;\n _this.component = component;\n _this.shadowRoot = (/** @type {?} */ (hostEl)).createShadowRoot();\n _this.sharedStylesHost.addHost(_this.shadowRoot);\n var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);\n for (var /** @type {?} */ i = 0; i < styles.length; i++) {\n var /** @type {?} */ styleEl = document.createElement('style');\n styleEl.textContent = styles[i];\n _this.shadowRoot.appendChild(styleEl);\n }\n return _this;\n }\n /**\n * @param {?} node\n * @return {?}\n */\n ShadowDomRenderer.prototype.nodeOrShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node === this.hostEl ? this.shadowRoot : node; };\n /**\n * @return {?}\n */\n ShadowDomRenderer.prototype.destroy = /**\n * @return {?}\n */\n function () { this.sharedStylesHost.removeHost(this.shadowRoot); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.appendChild = /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n function (parent, newChild) {\n return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);\n };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n function (parent, newChild, refChild) {\n return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);\n };\n /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.removeChild = /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n function (parent, oldChild) {\n return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);\n };\n /**\n * @param {?} node\n * @return {?}\n */\n ShadowDomRenderer.prototype.parentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));\n };\n return ShadowDomRenderer;\n}(DefaultDomRenderer2));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ɵ0 = function (v) {\n return '__zone_symbol__' + v;\n};\n/**\n * Detect if Zone is present. If it is then use simple zone aware 'addEventListener'\n * since Angular can do much more\n * efficient bookkeeping than Zone can, because we have additional information. This speeds up\n * addEventListener by 3x.\n */\nvar __symbol__ = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))['__symbol__'] || ɵ0;\nvar ADD_EVENT_LISTENER = __symbol__('addEventListener');\nvar REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');\nvar symbolNames = {};\nvar FALSE = 'FALSE';\nvar ANGULAR = 'ANGULAR';\nvar NATIVE_ADD_LISTENER = 'addEventListener';\nvar NATIVE_REMOVE_LISTENER = 'removeEventListener';\n// use the same symbol string which is used in zone.js\nvar stopSymbol = '__zone_symbol__propagationStopped';\nvar stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';\nvar blackListedEvents = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))[__symbol__('BLACK_LISTED_EVENTS')];\nvar blackListedMap;\nif (blackListedEvents) {\n blackListedMap = {};\n blackListedEvents.forEach(function (eventName) { blackListedMap[eventName] = eventName; });\n}\nvar isBlackListedEvent = function (eventName) {\n if (!blackListedMap) {\n return false;\n }\n return blackListedMap.hasOwnProperty(eventName);\n};\n// a global listener to handle all dom event,\n// so we do not need to create a closure everytime\nvar globalListener = function (event) {\n var /** @type {?} */ symbolName = symbolNames[event.type];\n if (!symbolName) {\n return;\n }\n var /** @type {?} */ taskDatas = this[symbolName];\n if (!taskDatas) {\n return;\n }\n var /** @type {?} */ args = [event];\n if (taskDatas.length === 1) {\n // if taskDatas only have one element, just invoke it\n var /** @type {?} */ taskData = taskDatas[0];\n if (taskData.zone !== Zone.current) {\n // only use Zone.run when Zone.current not equals to stored zone\n return taskData.zone.run(taskData.handler, this, args);\n }\n else {\n return taskData.handler.apply(this, args);\n }\n }\n else {\n // copy tasks as a snapshot to avoid event handlers remove\n // itself or others\n var /** @type {?} */ copiedTasks = taskDatas.slice();\n for (var /** @type {?} */ i = 0; i < copiedTasks.length; i++) {\n // if other listener call event.stopImmediatePropagation\n // just break\n if ((/** @type {?} */ (event))[stopSymbol] === true) {\n break;\n }\n var /** @type {?} */ taskData = copiedTasks[i];\n if (taskData.zone !== Zone.current) {\n // only use Zone.run when Zone.current not equals to stored zone\n taskData.zone.run(taskData.handler, this, args);\n }\n else {\n taskData.handler.apply(this, args);\n }\n }\n }\n};\nvar DomEventsPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomEventsPlugin, _super);\n function DomEventsPlugin(doc, ngZone) {\n var _this = _super.call(this, doc) || this;\n _this.ngZone = ngZone;\n _this.patchEvent();\n return _this;\n }\n /**\n * @return {?}\n */\n DomEventsPlugin.prototype.patchEvent = /**\n * @return {?}\n */\n function () {\n if (!Event || !Event.prototype) {\n return;\n }\n if ((/** @type {?} */ (Event.prototype))[stopMethodSymbol]) {\n // already patched by zone.js\n return;\n }\n var /** @type {?} */ delegate = (/** @type {?} */ (Event.prototype))[stopMethodSymbol] =\n Event.prototype.stopImmediatePropagation;\n Event.prototype.stopImmediatePropagation = function () {\n if (this) {\n this[stopSymbol] = true;\n }\n // should call native delegate in case\n // in some enviroment part of the application\n // will not use the patched Event\n delegate && delegate.apply(this, arguments);\n };\n };\n // This plugin should come last in the list of plugins, because it accepts all\n // events.\n /**\n * @param {?} eventName\n * @return {?}\n */\n DomEventsPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return true; };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n DomEventsPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var _this = this;\n /**\n * This code is about to add a listener to the DOM. If Zone.js is present, than\n * `addEventListener` has been patched. The patched code adds overhead in both\n * memory and speed (3x slower) than native. For this reason if we detect that\n * Zone.js is present we use a simple version of zone aware addEventListener instead.\n * The result is faster registration and the zone will be restored.\n * But ZoneSpec.onScheduleTask, ZoneSpec.onInvokeTask, ZoneSpec.onCancelTask\n * will not be invoked\n * We also do manual zone restoration in element.ts renderEventHandlerClosure method.\n *\n * NOTE: it is possible that the element is from different iframe, and so we\n * have to check before we execute the method.\n */\n var /** @type {?} */ self = this;\n var /** @type {?} */ zoneJsLoaded = element[ADD_EVENT_LISTENER];\n var /** @type {?} */ callback = /** @type {?} */ (handler);\n // if zonejs is loaded and current zone is not ngZone\n // we keep Zone.current on target for later restoration.\n if (zoneJsLoaded && (!__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"].isInAngularZone() || isBlackListedEvent(eventName))) {\n var /** @type {?} */ symbolName = symbolNames[eventName];\n if (!symbolName) {\n symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);\n }\n var /** @type {?} */ taskDatas = (/** @type {?} */ (element))[symbolName];\n var /** @type {?} */ globalListenerRegistered = taskDatas && taskDatas.length > 0;\n if (!taskDatas) {\n taskDatas = (/** @type {?} */ (element))[symbolName] = [];\n }\n var /** @type {?} */ zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;\n if (taskDatas.length === 0) {\n taskDatas.push({ zone: zone, handler: callback });\n }\n else {\n var /** @type {?} */ callbackRegistered = false;\n for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {\n if (taskDatas[i].handler === callback) {\n callbackRegistered = true;\n break;\n }\n }\n if (!callbackRegistered) {\n taskDatas.push({ zone: zone, handler: callback });\n }\n }\n if (!globalListenerRegistered) {\n element[ADD_EVENT_LISTENER](eventName, globalListener, false);\n }\n }\n else {\n element[NATIVE_ADD_LISTENER](eventName, callback, false);\n }\n return function () { return _this.removeEventListener(element, eventName, callback); };\n };\n /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\n DomEventsPlugin.prototype.removeEventListener = /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\n function (target, eventName, callback) {\n var /** @type {?} */ underlyingRemove = target[REMOVE_EVENT_LISTENER];\n // zone.js not loaded, use native removeEventListener\n if (!underlyingRemove) {\n return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n var /** @type {?} */ symbolName = symbolNames[eventName];\n var /** @type {?} */ taskDatas = symbolName && target[symbolName];\n if (!taskDatas) {\n // addEventListener not using patched version\n // just call native removeEventListener\n return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n // fix issue 20532, should be able to remove\n // listener which was added inside of ngZone\n var /** @type {?} */ found = false;\n for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {\n // remove listener from taskDatas if the callback equals\n if (taskDatas[i].handler === callback) {\n found = true;\n taskDatas.splice(i, 1);\n break;\n }\n }\n if (found) {\n if (taskDatas.length === 0) {\n // all listeners are removed, we can remove the globalListener from target\n underlyingRemove.apply(target, [eventName, globalListener, false]);\n }\n }\n else {\n // not found in taskDatas, the callback may be added inside of ngZone\n // use native remove listener to remove the calback\n target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n };\n DomEventsPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomEventsPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"], },\n ]; };\n return DomEventsPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar EVENT_NAMES = {\n // pan\n 'pan': true,\n 'panstart': true,\n 'panmove': true,\n 'panend': true,\n 'pancancel': true,\n 'panleft': true,\n 'panright': true,\n 'panup': true,\n 'pandown': true,\n // pinch\n 'pinch': true,\n 'pinchstart': true,\n 'pinchmove': true,\n 'pinchend': true,\n 'pinchcancel': true,\n 'pinchin': true,\n 'pinchout': true,\n // press\n 'press': true,\n 'pressup': true,\n // rotate\n 'rotate': true,\n 'rotatestart': true,\n 'rotatemove': true,\n 'rotateend': true,\n 'rotatecancel': true,\n // swipe\n 'swipe': true,\n 'swipeleft': true,\n 'swiperight': true,\n 'swipeup': true,\n 'swipedown': true,\n // tap\n 'tap': true,\n};\n/**\n * A DI token that you can use to provide{\\@link HammerGestureConfig} to Angular. Use it to configure\n * Hammer gestures.\n *\n * \\@experimental\n */\nvar HAMMER_GESTURE_CONFIG = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('HammerGestureConfig');\n/**\n * @record\n */\n\n/**\n * \\@experimental\n */\nvar HammerGestureConfig = /** @class */ (function () {\n function HammerGestureConfig() {\n this.events = [];\n this.overrides = {};\n }\n /**\n * @param {?} element\n * @return {?}\n */\n HammerGestureConfig.prototype.buildHammer = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var /** @type {?} */ mc = new Hammer(element);\n mc.get('pinch').set({ enable: true });\n mc.get('rotate').set({ enable: true });\n for (var /** @type {?} */ eventName in this.overrides) {\n mc.get(eventName).set(this.overrides[eventName]);\n }\n return mc;\n };\n HammerGestureConfig.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HammerGestureConfig.ctorParameters = function () { return []; };\n return HammerGestureConfig;\n}());\nvar HammerGesturesPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(HammerGesturesPlugin, _super);\n function HammerGesturesPlugin(doc, _config) {\n var _this = _super.call(this, doc) || this;\n _this._config = _config;\n return _this;\n }\n /**\n * @param {?} eventName\n * @return {?}\n */\n HammerGesturesPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {\n return false;\n }\n if (!(/** @type {?} */ (window)).Hammer) {\n throw new Error(\"Hammer.js is not loaded, can not bind \" + eventName + \" event\");\n }\n return true;\n };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n HammerGesturesPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var _this = this;\n var /** @type {?} */ zone = this.manager.getZone();\n eventName = eventName.toLowerCase();\n return zone.runOutsideAngular(function () {\n // Creating the manager bind events, must be done outside of angular\n var /** @type {?} */ mc = _this._config.buildHammer(element);\n var /** @type {?} */ callback = function (eventObj) {\n zone.runGuarded(function () { handler(eventObj); });\n };\n mc.on(eventName, callback);\n return function () { return mc.off(eventName, callback); };\n });\n };\n /**\n * @param {?} eventName\n * @return {?}\n */\n HammerGesturesPlugin.prototype.isCustomEvent = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return this._config.events.indexOf(eventName) > -1; };\n HammerGesturesPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HammerGesturesPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n { type: HammerGestureConfig, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [HAMMER_GESTURE_CONFIG,] },] },\n ]; };\n return HammerGesturesPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\nvar ɵ0$1 = function (event) { return event.altKey; };\nvar ɵ1$1 = function (event) { return event.ctrlKey; };\nvar ɵ2$1 = function (event) { return event.metaKey; };\nvar ɵ3 = function (event) { return event.shiftKey; };\nvar MODIFIER_KEY_GETTERS = {\n 'alt': ɵ0$1,\n 'control': ɵ1$1,\n 'meta': ɵ2$1,\n 'shift': ɵ3\n};\n/**\n * \\@experimental\n */\nvar KeyEventsPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(KeyEventsPlugin, _super);\n function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }\n /**\n * @param {?} eventName\n * @return {?}\n */\n KeyEventsPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n KeyEventsPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ parsedEvent = /** @type {?} */ ((KeyEventsPlugin.parseEventName(eventName)));\n var /** @type {?} */ outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(function () {\n return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n };\n /**\n * @param {?} eventName\n * @return {?}\n */\n KeyEventsPlugin.parseEventName = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n var /** @type {?} */ parts = eventName.toLowerCase().split('.');\n var /** @type {?} */ domEventName = parts.shift();\n if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n return null;\n }\n var /** @type {?} */ key = KeyEventsPlugin._normalizeKey(/** @type {?} */ ((parts.pop())));\n var /** @type {?} */ fullKey = '';\n MODIFIER_KEYS.forEach(function (modifierName) {\n var /** @type {?} */ index = parts.indexOf(modifierName);\n if (index > -1) {\n parts.splice(index, 1);\n fullKey += modifierName + '.';\n }\n });\n fullKey += key;\n if (parts.length != 0 || key.length === 0) {\n // returning null instead of throwing to let another plugin process the event\n return null;\n }\n var /** @type {?} */ result = {};\n result['domEventName'] = domEventName;\n result['fullKey'] = fullKey;\n return result;\n };\n /**\n * @param {?} event\n * @return {?}\n */\n KeyEventsPlugin.getEventFullKey = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n var /** @type {?} */ fullKey = '';\n var /** @type {?} */ key = getDOM().getEventKey(event);\n key = key.toLowerCase();\n if (key === ' ') {\n key = 'space'; // for readability\n }\n else if (key === '.') {\n key = 'dot'; // because '.' is used as a separator in event names\n }\n MODIFIER_KEYS.forEach(function (modifierName) {\n if (modifierName != key) {\n var /** @type {?} */ modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n if (modifierGetter(event)) {\n fullKey += modifierName + '.';\n }\n }\n });\n fullKey += key;\n return fullKey;\n };\n /**\n * @param {?} fullKey\n * @param {?} handler\n * @param {?} zone\n * @return {?}\n */\n KeyEventsPlugin.eventCallback = /**\n * @param {?} fullKey\n * @param {?} handler\n * @param {?} zone\n * @return {?}\n */\n function (fullKey, handler, zone) {\n return function (event /** TODO #9100 */) {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(function () { return handler(event); });\n }\n };\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} keyName\n * @return {?}\n */\n KeyEventsPlugin._normalizeKey = /**\n * \\@internal\n * @param {?} keyName\n * @return {?}\n */\n function (keyName) {\n // TODO: switch to a Map if the mapping grows too much\n switch (keyName) {\n case 'esc':\n return 'escape';\n default:\n return keyName;\n }\n };\n KeyEventsPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n KeyEventsPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return KeyEventsPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"http\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo<bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript:...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nvar SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n */\nvar DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))\n return url;\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])()) {\n getDOM().log(\"WARNING: sanitizing unsafe URL value \" + url + \" (see http://g.co/ng/security#xss)\");\n }\n return 'unsafe:' + url;\n}\n/**\n * @param {?} srcset\n * @return {?}\n */\nfunction sanitizeSrcset(srcset) {\n srcset = String(srcset);\n return srcset.split(',').map(function (srcset) { return sanitizeUrl(srcset.trim()); }).join(', ');\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A <body> element that can be safely used to parse untrusted HTML. Lazily initialized below.\n */\nvar inertElement = null;\n/**\n * Lazily initialized to make sure the DOM adapter gets set before use.\n */\nvar DOM = /** @type {?} */ ((null));\n/**\n * Returns an HTML element that is guaranteed to not execute code when creating elements in it.\n * @return {?}\n */\nfunction getInertElement() {\n if (inertElement)\n return inertElement;\n DOM = getDOM();\n // Prefer using <template> element if supported.\n var /** @type {?} */ templateEl = DOM.createElement('template');\n if ('content' in templateEl)\n return templateEl;\n var /** @type {?} */ doc = DOM.createHtmlDocument();\n inertElement = DOM.querySelector(doc, 'body');\n if (inertElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so we\n // need to create one.\n var /** @type {?} */ html = DOM.createElement('html', doc);\n inertElement = DOM.createElement('body', doc);\n DOM.appendChild(html, inertElement);\n DOM.appendChild(doc, html);\n }\n return inertElement;\n}\n/**\n * @param {?} tags\n * @return {?}\n */\nfunction tagSet(tags) {\n var /** @type {?} */ res = {};\n for (var _i = 0, _a = tags.split(','); _i < _a.length; _i++) {\n var t = _a[_i];\n res[t] = true;\n }\n return res;\n}\n/**\n * @param {...?} sets\n * @return {?}\n */\nfunction merge() {\n var sets = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sets[_i] = arguments[_i];\n }\n var /** @type {?} */ res = {};\n for (var _a = 0, sets_1 = sets; _a < sets_1.length; _a++) {\n var s = sets_1[_a];\n for (var /** @type {?} */ v in s) {\n if (s.hasOwnProperty(v))\n res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nvar OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nvar OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nvar BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nvar INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nvar VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nvar URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n// Attributes that have special href set hence need to be sanitized\nvar SRCSET_ATTRS = tagSet('srcset');\nvar HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nvar VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nvar SanitizingHtmlSerializer = /** @class */ (function () {\n function SanitizingHtmlSerializer() {\n this.sanitizedSomething = false;\n this.buf = [];\n }\n /**\n * @param {?} el\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.sanitizeChildren = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n var /** @type {?} */ current = /** @type {?} */ ((el.firstChild));\n while (current) {\n if (DOM.isElementNode(current)) {\n this.startElement(/** @type {?} */ (current));\n }\n else if (DOM.isTextNode(current)) {\n this.chars(/** @type {?} */ ((DOM.nodeValue(current))));\n }\n else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (DOM.firstChild(current)) {\n current = /** @type {?} */ ((DOM.firstChild(current)));\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (DOM.isElementNode(current)) {\n this.endElement(/** @type {?} */ (current));\n }\n var /** @type {?} */ next = checkClobberedElement(current, /** @type {?} */ ((DOM.nextSibling(current))));\n if (next) {\n current = next;\n break;\n }\n current = checkClobberedElement(current, /** @type {?} */ ((DOM.parentElement(current))));\n }\n }\n return this.buf.join('');\n };\n /**\n * @param {?} element\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.startElement = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var _this = this;\n var /** @type {?} */ tagName = DOM.nodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return;\n }\n this.buf.push('<');\n this.buf.push(tagName);\n DOM.attributeMap(element).forEach(function (value, attrName) {\n var /** @type {?} */ lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n _this.sanitizedSomething = true;\n return;\n }\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower])\n value = sanitizeUrl(value);\n if (SRCSET_ATTRS[lower])\n value = sanitizeSrcset(value);\n _this.buf.push(' ');\n _this.buf.push(attrName);\n _this.buf.push('=\"');\n _this.buf.push(encodeEntities(value));\n _this.buf.push('\"');\n });\n this.buf.push('>');\n };\n /**\n * @param {?} current\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.endElement = /**\n * @param {?} current\n * @return {?}\n */\n function (current) {\n var /** @type {?} */ tagName = DOM.nodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n };\n /**\n * @param {?} chars\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.chars = /**\n * @param {?} chars\n * @return {?}\n */\n function (chars) { this.buf.push(encodeEntities(chars)); };\n return SanitizingHtmlSerializer;\n}());\n/**\n * @param {?} node\n * @param {?} nextNode\n * @return {?}\n */\nfunction checkClobberedElement(node, nextNode) {\n if (nextNode && DOM.contains(node, nextNode)) {\n throw new Error(\"Failed to sanitize html because the element is clobbered: \" + DOM.getOuterHTML(node));\n }\n return nextNode;\n}\n// Regular Expressions for parsing tags and attributes\nvar SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nvar NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param {?} value\n * @return {?}\n */\nfunction encodeEntities(value) {\n return value.replace(/&/g, '&')\n .replace(SURROGATE_PAIR_REGEXP, function (match) {\n var /** @type {?} */ hi = match.charCodeAt(0);\n var /** @type {?} */ low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n/**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n * @param {?} el\n * @return {?}\n */\nfunction stripCustomNsAttrs(el) {\n DOM.attributeMap(el).forEach(function (_, attrName) {\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n DOM.removeAttribute(el, attrName);\n }\n });\n for (var _i = 0, _a = DOM.childNodesAsList(el); _i < _a.length; _i++) {\n var n = _a[_i];\n if (DOM.isElementNode(n))\n stripCustomNsAttrs(/** @type {?} */ (n));\n }\n}\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n * @param {?} defaultDoc\n * @param {?} unsafeHtmlInput\n * @return {?}\n */\nfunction sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n try {\n var /** @type {?} */ containerEl = getInertElement();\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n var /** @type {?} */ unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n var /** @type {?} */ mXSSAttempts = 5;\n var /** @type {?} */ parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n DOM.setInnerHTML(containerEl, unsafeHtml);\n if (defaultDoc.documentMode) {\n // strip custom-namespaced attributes on IE<=11\n stripCustomNsAttrs(containerEl);\n }\n parsedHtml = DOM.getInnerHTML(containerEl);\n } while (unsafeHtml !== parsedHtml);\n var /** @type {?} */ sanitizer = new SanitizingHtmlSerializer();\n var /** @type {?} */ safeHtml = sanitizer.sanitizeChildren(DOM.getTemplateContent(containerEl) || containerEl);\n // Clear out the body element.\n var /** @type {?} */ parent_1 = DOM.getTemplateContent(containerEl) || containerEl;\n for (var _i = 0, _a = DOM.childNodesAsList(parent_1); _i < _a.length; _i++) {\n var child = _a[_i];\n DOM.removeChild(parent_1, child);\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && sanitizer.sanitizedSomething) {\n DOM.log('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');\n }\n return safeHtml;\n }\n catch (/** @type {?} */ e) {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n inertElement = null;\n throw e;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nvar VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nvar TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nvar COLOR_FNS = '(?:rgb|hsl)a?';\nvar GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nvar CSS3_FNS = '(?:calc|attr)';\nvar FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nvar SAFE_STYLE_VALUE = new RegExp(\"^(\" + VALUES + \"|\" +\n (\"(?:\" + TRANSFORMATION_FNS + \"|\" + COLOR_FNS + \"|\" + GRADIENTS + \"|\" + CSS3_FNS + \")\") +\n (FN_ARGS + \")$\"), 'g');\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nvar URL_RE = /^url\\(([^)]+)\\)$/;\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n * @param {?} value\n * @return {?}\n */\nfunction hasBalancedQuotes(value) {\n var /** @type {?} */ outsideSingle = true;\n var /** @type {?} */ outsideDouble = true;\n for (var /** @type {?} */ i = 0; i < value.length; i++) {\n var /** @type {?} */ c = value.charAt(i);\n if (c === '\\'' && outsideDouble) {\n outsideSingle = !outsideSingle;\n }\n else if (c === '\"' && outsideSingle) {\n outsideDouble = !outsideDouble;\n }\n }\n return outsideSingle && outsideDouble;\n}\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n * @param {?} value\n * @return {?}\n */\nfunction sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var /** @type {?} */ urlMatch = value.match(URL_RE);\n if ((urlMatch && sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])()) {\n getDOM().log(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Marker interface for a value that's safe to use in a particular context.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as HTML.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as style (CSS).\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as JavaScript.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as a URL linking to a document.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as a URL to load executable code from.\n *\n * \\@stable\n * @record\n */\n\n/**\n * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n * values to be safe to use in the different DOM contexts.\n *\n * For example, when binding a URL in an `<a [href]=\"someValue\">` hyperlink, `someValue` will be\n * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n * the website.\n *\n * In specific situations, it might be necessary to disable sanitization, for example if the\n * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n * methods, and then binding to that value from the template.\n *\n * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n * Cross Site Scripting (XSS) security bug!\n *\n * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n * close as possible to the source of the value, to make it easy to verify no security bug is\n * created by its use.\n *\n * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n * code. The sanitizer leaves safe values intact.\n *\n * \\@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n * sanitization for the value passed in. Carefully check and audit all values and code paths going\n * into this call. Make sure any user data is appropriately escaped for this security context.\n * For more detail, see the [Security Guide](http://g.co/ng/security).\n *\n * \\@stable\n * @abstract\n */\nvar DomSanitizer = /** @class */ (function () {\n function DomSanitizer() {\n }\n return DomSanitizer;\n}());\nvar DomSanitizerImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomSanitizerImpl, _super);\n function DomSanitizerImpl(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n return _this;\n }\n /**\n * @param {?} ctx\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.sanitize = /**\n * @param {?} ctx\n * @param {?} value\n * @return {?}\n */\n function (ctx, value) {\n if (value == null)\n return null;\n switch (ctx) {\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].NONE:\n return /** @type {?} */ (value);\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].HTML:\n if (value instanceof SafeHtmlImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'HTML');\n return sanitizeHtml(this._doc, String(value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].STYLE:\n if (value instanceof SafeStyleImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'Style');\n return sanitizeStyle(/** @type {?} */ (value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].SCRIPT:\n if (value instanceof SafeScriptImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'Script');\n throw new Error('unsafe value used in a script context');\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].URL:\n if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {\n // Allow resource URLs in URL contexts, they are strictly more trusted.\n return value.changingThisBreaksApplicationSecurity;\n }\n this.checkNotSafeValue(value, 'URL');\n return sanitizeUrl(String(value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].RESOURCE_URL:\n if (value instanceof SafeResourceUrlImpl) {\n return value.changingThisBreaksApplicationSecurity;\n }\n this.checkNotSafeValue(value, 'ResourceURL');\n throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n default:\n throw new Error(\"Unexpected SecurityContext \" + ctx + \" (see http://g.co/ng/security#xss)\");\n }\n };\n /**\n * @param {?} value\n * @param {?} expectedType\n * @return {?}\n */\n DomSanitizerImpl.prototype.checkNotSafeValue = /**\n * @param {?} value\n * @param {?} expectedType\n * @return {?}\n */\n function (value, expectedType) {\n if (value instanceof SafeValueImpl) {\n throw new Error(\"Required a safe \" + expectedType + \", got a \" + value.getTypeName() + \" \" +\n \"(see http://g.co/ng/security#xss)\");\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustHtml = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeHtmlImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustStyle = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeStyleImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustScript = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeScriptImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustUrl = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeUrlImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n return new SafeResourceUrlImpl(value);\n };\n DomSanitizerImpl.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomSanitizerImpl.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return DomSanitizerImpl;\n}(DomSanitizer));\n/**\n * @abstract\n */\nvar SafeValueImpl = /** @class */ (function () {\n function SafeValueImpl(changingThisBreaksApplicationSecurity) {\n // empty\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n /**\n * @return {?}\n */\n SafeValueImpl.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"SafeValue must use [property]=binding: \" + this.changingThisBreaksApplicationSecurity +\n \" (see http://g.co/ng/security#xss)\";\n };\n return SafeValueImpl;\n}());\nvar SafeHtmlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeHtmlImpl, _super);\n function SafeHtmlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeHtmlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'HTML'; };\n return SafeHtmlImpl;\n}(SafeValueImpl));\nvar SafeStyleImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeStyleImpl, _super);\n function SafeStyleImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeStyleImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'Style'; };\n return SafeStyleImpl;\n}(SafeValueImpl));\nvar SafeScriptImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeScriptImpl, _super);\n function SafeScriptImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeScriptImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'Script'; };\n return SafeScriptImpl;\n}(SafeValueImpl));\nvar SafeUrlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeUrlImpl, _super);\n function SafeUrlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeUrlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'URL'; };\n return SafeUrlImpl;\n}(SafeValueImpl));\nvar SafeResourceUrlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeResourceUrlImpl, _super);\n function SafeResourceUrlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeResourceUrlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'ResourceURL'; };\n return SafeResourceUrlImpl;\n}(SafeValueImpl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar INTERNAL_BROWSER_PLATFORM_PROVIDERS = [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_ID\"], useValue: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"ɵPLATFORM_BROWSER_ID\"] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_INITIALIZER\"], useValue: initDomAdapter, multi: true },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"], useClass: BrowserPlatformLocation, deps: [DOCUMENT$1] },\n { provide: DOCUMENT$1, useFactory: _document, deps: [] },\n];\n/**\n * \\@security Replacing built-in sanitization providers exposes the application to XSS risks.\n * Attacker-controlled data introduced by an unsanitized provider could expose your\n * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).\n * \\@experimental\n */\nvar BROWSER_SANITIZATION_PROVIDERS = [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Sanitizer\"], useExisting: DomSanitizer },\n { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT$1] },\n];\n/**\n * \\@stable\n */\nvar platformBrowser = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"platformCore\"], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n/**\n * @return {?}\n */\nfunction initDomAdapter() {\n BrowserDomAdapter.makeCurrent();\n BrowserGetTestability.init();\n}\n/**\n * @return {?}\n */\nfunction errorHandler() {\n return new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ErrorHandler\"]();\n}\n/**\n * @return {?}\n */\nfunction _document() {\n return document;\n}\n/**\n * The ng module for the browser.\n *\n * \\@stable\n */\nvar BrowserModule = /** @class */ (function () {\n function BrowserModule(parentModule) {\n if (parentModule) {\n throw new Error(\"BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.\");\n }\n }\n /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * @experimental\n */\n /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * \\@experimental\n * @param {?} params\n * @return {?}\n */\n BrowserModule.withServerTransition = /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * \\@experimental\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return {\n ngModule: BrowserModule,\n providers: [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"], useValue: params.appId },\n { provide: TRANSITION_ID, useExisting: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"] },\n SERVER_TRANSITION_PROVIDERS,\n ],\n };\n };\n BrowserModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n providers: [\n BROWSER_SANITIZATION_PROVIDERS,\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ErrorHandler\"], useFactory: errorHandler, deps: [] },\n { provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true },\n { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true },\n { provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true },\n { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },\n DomRendererFactory2,\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererFactory2\"], useExisting: DomRendererFactory2 },\n { provide: SharedStylesHost, useExisting: DomSharedStylesHost },\n DomSharedStylesHost,\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Testability\"],\n EventManager,\n ELEMENT_PROBE_PROVIDERS,\n Meta,\n Title,\n ],\n exports: [__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"CommonModule\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationModule\"]]\n },] },\n ];\n /** @nocollapse */\n BrowserModule.ctorParameters = function () { return [\n { type: BrowserModule, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n ]; };\n return BrowserModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar win = typeof window !== 'undefined' && window || /** @type {?} */ ({});\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ChangeDetectionPerfRecord = /** @class */ (function () {\n function ChangeDetectionPerfRecord(msPerTick, numTicks) {\n this.msPerTick = msPerTick;\n this.numTicks = numTicks;\n }\n return ChangeDetectionPerfRecord;\n}());\n/**\n * Entry point for all Angular profiling-related debug tools. This object\n * corresponds to the `ng.profiler` in the dev console.\n */\nvar AngularProfiler = /** @class */ (function () {\n function AngularProfiler(ref) {\n this.appRef = ref.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"]);\n }\n // tslint:disable:no-console\n /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n */\n /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n * @param {?} config\n * @return {?}\n */\n AngularProfiler.prototype.timeChangeDetection = /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n * @param {?} config\n * @return {?}\n */\n function (config) {\n var /** @type {?} */ record = config && config['record'];\n var /** @type {?} */ profileName = 'Change Detection';\n // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened\n var /** @type {?} */ isProfilerAvailable = win.console.profile != null;\n if (record && isProfilerAvailable) {\n win.console.profile(profileName);\n }\n var /** @type {?} */ start = getDOM().performanceNow();\n var /** @type {?} */ numTicks = 0;\n while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {\n this.appRef.tick();\n numTicks++;\n }\n var /** @type {?} */ end = getDOM().performanceNow();\n if (record && isProfilerAvailable) {\n // need to cast to <any> because type checker thinks there's no argument\n // while in fact there is:\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd\n (/** @type {?} */ (win.console.profileEnd))(profileName);\n }\n var /** @type {?} */ msPerTick = (end - start) / numTicks;\n win.console.log(\"ran \" + numTicks + \" change detection cycles\");\n win.console.log(msPerTick.toFixed(2) + \" ms per check\");\n return new ChangeDetectionPerfRecord(msPerTick, numTicks);\n };\n return AngularProfiler;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PROFILER_GLOBAL_NAME = 'profiler';\n/**\n * Enabled Angular debug tools that are accessible via your browser's\n * developer console.\n *\n * Usage:\n *\n * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)\n * 1. Type `ng.` (usually the console will show auto-complete suggestion)\n * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`\n * then hit Enter.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @template T\n * @param {?} ref\n * @return {?}\n */\nfunction enableDebugTools(ref) {\n exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n return ref;\n}\n/**\n * Disables Angular tools.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @return {?}\n */\nfunction disableDebugTools() {\n exportNgVar(PROFILER_GLOBAL_NAME, null);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} text\n * @return {?}\n */\nfunction escapeHtml(text) {\n var /** @type {?} */ escapedText = {\n '&': '&a;',\n '\"': '&q;',\n '\\'': '&s;',\n '<': '&l;',\n '>': '&g;',\n };\n return text.replace(/[&\"'<>]/g, function (s) { return escapedText[s]; });\n}\n/**\n * @param {?} text\n * @return {?}\n */\nfunction unescapeHtml(text) {\n var /** @type {?} */ unescapedText = {\n '&a;': '&',\n '&q;': '\"',\n '&s;': '\\'',\n '&l;': '<',\n '&g;': '>',\n };\n return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });\n}\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * \\@experimental\n * @template T\n * @param {?} key\n * @return {?}\n */\nfunction makeStateKey(key) {\n return /** @type {?} */ (key);\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * `TransferState` will be available as an injectable token. To use it import\n * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialzied in a\n * non-lossy manner.\n *\n * \\@experimental\n */\nvar TransferState = /** @class */ (function () {\n function TransferState() {\n this.store = {};\n this.onSerializeCallbacks = {};\n }\n /** @internal */\n /**\n * \\@internal\n * @param {?} initState\n * @return {?}\n */\n TransferState.init = /**\n * \\@internal\n * @param {?} initState\n * @return {?}\n */\n function (initState) {\n var /** @type {?} */ transferState = new TransferState();\n transferState.store = initState;\n return transferState;\n };\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n * @template T\n * @param {?} key\n * @param {?} defaultValue\n * @return {?}\n */\n TransferState.prototype.get = /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n * @template T\n * @param {?} key\n * @param {?} defaultValue\n * @return {?}\n */\n function (key, defaultValue) { return /** @type {?} */ (this.store[key]) || defaultValue; };\n /**\n * Set the value corresponding to a key.\n */\n /**\n * Set the value corresponding to a key.\n * @template T\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\n TransferState.prototype.set = /**\n * Set the value corresponding to a key.\n * @template T\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\n function (key, value) { this.store[key] = value; };\n /**\n * Remove a key from the store.\n */\n /**\n * Remove a key from the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n TransferState.prototype.remove = /**\n * Remove a key from the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n function (key) { delete this.store[key]; };\n /**\n * Test whether a key exists in the store.\n */\n /**\n * Test whether a key exists in the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n TransferState.prototype.hasKey = /**\n * Test whether a key exists in the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n function (key) { return this.store.hasOwnProperty(key); };\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n * @template T\n * @param {?} key\n * @param {?} callback\n * @return {?}\n */\n TransferState.prototype.onSerialize = /**\n * Register a callback to provide the value for a key when `toJson` is called.\n * @template T\n * @param {?} key\n * @param {?} callback\n * @return {?}\n */\n function (key, callback) {\n this.onSerializeCallbacks[key] = callback;\n };\n /**\n * Serialize the current state of the store to JSON.\n */\n /**\n * Serialize the current state of the store to JSON.\n * @return {?}\n */\n TransferState.prototype.toJson = /**\n * Serialize the current state of the store to JSON.\n * @return {?}\n */\n function () {\n // Call the onSerialize callbacks and put those values into the store.\n for (var /** @type {?} */ key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n }\n catch (/** @type {?} */ e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n return JSON.stringify(this.store);\n };\n TransferState.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n TransferState.ctorParameters = function () { return []; };\n return TransferState;\n}());\n/**\n * @param {?} doc\n * @param {?} appId\n * @return {?}\n */\nfunction initTransferState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n var /** @type {?} */ script = doc.getElementById(appId + '-state');\n var /** @type {?} */ initialState = {};\n if (script && script.textContent) {\n try {\n initialState = JSON.parse(unescapeHtml(script.textContent));\n }\n catch (/** @type {?} */ e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return TransferState.init(initialState);\n}\n/**\n * NgModule to install on the client side while using the `TransferState` to transfer state from\n * server to client.\n *\n * \\@experimental\n */\nvar BrowserTransferStateModule = /** @class */ (function () {\n function BrowserTransferStateModule() {\n }\n BrowserTransferStateModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"]] }],\n },] },\n ];\n /** @nocollapse */\n BrowserTransferStateModule.ctorParameters = function () { return []; };\n return BrowserTransferStateModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Predicates for use with {\\@link DebugElement}'s query functions.\n *\n * \\@experimental All debugging apis are currently experimental.\n */\nvar By = /** @class */ (function () {\n function By() {\n }\n /**\n * Match all elements.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n */\n /**\n * Match all elements.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n * @return {?}\n */\n By.all = /**\n * Match all elements.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n * @return {?}\n */\n function () { return function (debugElement) { return true; }; };\n /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n */\n /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n * @param {?} selector\n * @return {?}\n */\n By.css = /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n * @param {?} selector\n * @return {?}\n */\n function (selector) {\n return function (debugElement) {\n return debugElement.nativeElement != null ?\n getDOM().elementMatches(debugElement.nativeElement, selector) :\n false;\n };\n };\n /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n */\n /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n * @param {?} type\n * @return {?}\n */\n By.directive = /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return function (debugElement) { return ((debugElement.providerTokens)).indexOf(type) !== -1; };\n };\n return By;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=platform-browser.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYW5ndWxhci9wbGF0Zm9ybS1icm93c2VyL2VzbTUvcGxhdGZvcm0tYnJvd3Nlci5qcz8zODRkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBDb21tb25Nb2R1bGUsIERPQ1VNRU5ULCBQbGF0Zm9ybUxvY2F0aW9uLCDJtVBMQVRGT1JNX0JST1dTRVJfSUQsIMm1cGFyc2VDb29raWVWYWx1ZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBBUFBfSUQsIEFQUF9JTklUSUFMSVpFUiwgQXBwbGljYXRpb25Jbml0U3RhdHVzLCBBcHBsaWNhdGlvbk1vZHVsZSwgQXBwbGljYXRpb25SZWYsIEVycm9ySGFuZGxlciwgSW5qZWN0LCBJbmplY3RhYmxlLCBJbmplY3Rpb25Ub2tlbiwgSW5qZWN0b3IsIE5nTW9kdWxlLCBOZ1Byb2JlVG9rZW4sIE5nWm9uZSwgT3B0aW9uYWwsIFBMQVRGT1JNX0lELCBQTEFURk9STV9JTklUSUFMSVpFUiwgUmVuZGVyZXJGYWN0b3J5MiwgUmV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uUHJlZml4ID0gJy0nICsgZG9tUHJlZml4ZXNbaV0udG9Mb3dlckNhc2UoKSArICctJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdHJhbnNFbmRFdmVudE5hbWVzXzEgPSB7XG4gICAgICAgICAgICAgICAgV2Via2l0VHJhbnNpdGlvbjogJ3dlYmtpdFRyYW5zaXRpb25FbmQnLFxuICAgICAgICAgICAgICAgIE1velRyYW5zaXRpb246ICd0cmFuc2l0aW9uZW5kJyxcbiAgICAgICAgICAgICAgICBPVHJhbnNpdGlvbjogJ29UcmFuc2l0aW9uRW5kIG90cmFuc2l0aW9uZW5kJyxcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiAndHJhbnNpdGlvbmVuZCdcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBPYmplY3Qua2V5cyh0cmFuc0VuZEV2ZW50TmFtZXNfMSkuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgaWYgKF90aGlzLmdldFN0eWxlKGVsZW1lbnRfMSwga2V5KSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLl90cmFuc2l0aW9uRW5kID0gdHJhbnNFbmRFdmVudE5hbWVzXzFba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoLyoqIEB0eXBlIHs/fSAqLyBlKSB7XG4gICAgICAgICAgICBfdGhpcy5fYW5pbWF0aW9uUHJlZml4ID0gbnVsbDtcbiAgICAgICAgICAgIF90aGlzLl90cmFuc2l0aW9uRW5kID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIC8qKlxuICAgICAqI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GxlbWVudGVkJyk7IH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5tYWtlQ3VycmVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyBzZXRSb290RG9tQWRhcHRlcihuZXcgQnJvd3NlckRvbUFkYXB0ZXIoKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaGFzUHJvcGVydHkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBuYW1lKSB7IHJldHVybiBuYW1lIGluIGVsZW1lbnQ7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5zZXRQcm9wZXJ0eSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlKSB7ICgvKiogQHR5cGUgez99ICovIChlbCkpW25hbWVdID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFByb3BlcnR5ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuYW1lKSB7IHJldHVybiAoLyoqIEB0eXBlIHs/fSAqLyAoZWwpKVtuYW1lXTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBtZXRob2ROYW1lXG4gICAgICogQHBhcmFtIHs/fSBhcmdzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW52b2tlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbWV0aG9kTmFtZVxuICAgICAqIEBwYXJhbSB7P30gYXJnc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBtZXRob2ROYW1lLCBhcmdzKSB7XG4gICAgICAgIChfYSA9ICgvKiogQHR5cGUgez99ICovIChlbCkpKVttZXRob2ROYW1lXS5hcHBseShfYSwgYXJncyk7XG4gICAgICAgIHZhciBfYTtcbiAgICB9O1xuICAgIC8vIFRPRE8odGJvc2NoKTogbW92ZSB0aGlzIGludG8gYSBzZXBhcmF0ZSBlbnZpcm9ubWVudCBjbGFzcyBvbmNlIHdlIGhhdmUgaXRcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nRXJyb3IgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgaWYgKHdpbmRvdy5jb25zb2xlKSB7XG4gICAgICAgICAgICBpZiAoY29uc29sZS5lcnJvcikge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlcnJvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgIGlmICh3aW5kb3cuY29uc29sZSkge1xuICAgICAgICAgICAgd2luZG93LmNvbnNvbGUubG9nICYmIHdpbmRvdy5jb25zb2xlLmxvZyhlcnJvcik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXJyb3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5sb2dHcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXJyb3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICBpZiAod2luZG93LmNvbnNvbGUpIHtcbiAgICAgICAgICAgIHdpbmRvdy5jb25zb2xlLmdyb3VwICYmIHdpbmRvdy5jb25zb2xlLmdyb3VwKGVycm9yKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nR3JvdXBFbmQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHdpbmRvdy5jb25zb2xlKSB7XG4gICAgICAgICAgICB3aW5kb3cuY29uc29sZS5ncm91cEVuZCAmJiB3aW5kb3cuY29uc29sZS5ncm91cEVuZCgpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLCBcImF0dHJUb1Byb3BNYXBcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gX2F0dHJUb1Byb3BNYXA7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZUFcbiAgICAgKiBAcGFyYW0gez99IG5vZGVCXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY29udGFpbnMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVBXG4gICAgICogQHBhcmFtIHs/fSBub2RlQlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGVBLCBub2RlQikgeyByZXR1cm4gbm9kZUNvbnRhaW5zLmNhbGwobm9kZUEsIG5vZGVCKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4g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VudChldnQpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY3JlYXRlTW91c2VFdmVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnRUeXBlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGV2dCA9IHRoaXMuZ2V0RGVmYXVsdERvY3VtZW50KCkuY3JlYXRlRXZlbnQoJ01vdXNlRXZlbnQnKTtcbiAgICAgICAgZXZ0LmluaXRFdmVudChldmVudFR5cGUsIHRydWUsIHRydWUpO1xuICAgICAgICByZXR1cm4gZXZ0O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFR5cGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5jcmVhdGVFdmVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnRUeXBlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGV2dCA9IHRoaXMuZ2V0RGVmYXVsdERvY3VtZW50KCkuY3JlYXRlRXZlbnQoJ0V2ZW50Jyk7XG4gICAgICAgIGV2dC5pbml0RXZlbnQoZXZlbnRUeXBlLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgcmV0dXJuIGV2dDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZ0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUucHJldmVudERlZmF1bHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGV2dCkge1xuICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgZXZ0LnJldHVyblZhbHVlID0gZmFsc2U7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzUHJldmVudGVkID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBldnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChldnQpIHtcbiAgICAgICAgcmV0dXJuIGV2dC5kZWZhdWx0UHJldmVudGVkIHx8IGV2dC5yZXR1cm5WYWx1ZSAhPSBudWxsICYmICFldnQucmV0dXJuVmFsdWU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0SW5uZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5pbm5lckhUTUw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRlbXBsYXRlQ29udGVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkge1xuICAgICAgICByZXR1cm4gJ2NvbnRlbnQnIGluIGVsICYmIHRoaXMuaXNUZW1wbGF0ZUVsZW1lbnQoZWwpID8gKC8qKiBAdHlwZSB7P30gKi8gKGVsKSkuY29udGVudCA6IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0T3V0ZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5vdXRlckhUTUw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubm9kZU5hbWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLm5vZGVOYW1lOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLm5vZGVWYWx1ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubm9kZVZhbHVlOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnR5cGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLnR5cGU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY29udGVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgaWYgKHRoaXMuaGFzUHJvcGVydHkobm9kZSwgJ2NvbnRlbnQnKSkge1xuICAgICAgICAgICAgcmV0dXJuICgvKiogQHR5cGUgez99ICovIChub2RlKSkuY29udGVudDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZmlyc3RDaGlsZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gZWwuZmlyc3RDaGlsZDsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubmV4dFNpYmxpbmcgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuIGVsLm5leHRTaWJsaW5nOyB9O1xuICAgIC8qKlxuICAg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ByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmNsZWFyTm9kZXMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHtcbiAgICAgICAgd2hpbGUgKGVsLmZpcnN0Q2hpbGQpIHtcbiAgICAgICAgICAgIGVsLnJlbW92ZUNoaWxkKGVsLmZpcnN0Q2hpbGQpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuYXBwZW5kQ2hpbGQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5vZGUpIHsgZWwuYXBwZW5kQ2hpbGQobm9kZSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnJlbW92ZUNoaWxkID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBub2RlKSB7IGVsLnJlbW92ZUNoaWxkKG5vZGUpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5ld0NoaWxkXG4gICAgICogQHBhcmFtIHs/fSBvbGRDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnJlcGxhY2VDaGlsZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5ld0NoaWxkXG4gICAgICogQHBhcmFtIHs/fSBvbGRDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuZXdDaGlsZCwgb2xkQ2hpbGQpIHsgZWwucmVwbGFjZUNoaWxkKG5ld0NoaWxkLCBvbGRDaGlsZCk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUucmVtb3ZlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICBpZiAobm9kZS5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICBub2RlLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW5zZXJ0QmVmb3JlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRcbiAgICAgKiBAcGFyYW0gez99IHJlZlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmVudCwgcmVmLCBub2RlKSB7IHBhcmVudC5pbnNlcnRCZWZvcmUobm9kZSwgcmVmKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2Rlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmluc2VydEFsbEJlZm9yZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyZW50XG4gICAgICogQHBhcmFtIHs/fSByZWZcbiAgICAgKiBAcGFyYW0gez99IG5vZGVzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGFyZW50LCByZWYsIG5vZGVzKSB7XG4gICAgICAgIG5vZGVzLmZvckVhY2goZnVuY3Rpb24gKG4pIHsgcmV0dXJuIHBhcmVudC5pbnNlcnRCZWZvcmUobiwgcmVmKTsgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW5zZXJ0QWZ0ZXIgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGFyZW50LCByZWYsIG5vZGUpIHsgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWYubmV4dFNpYmxpbmcpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuc2V0SW5uZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCwgdmFsdWUpIHsgZWwuaW5uZXJIVE1MID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRleHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuIGVsLnRleHRDb250ZW50OyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuc2V0VGV4dCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIHZhbHVlKSB7IGVsLnRleHRDb250ZW50ID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFZhbHVlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC52YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnNldFZhbHVlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCwgdmFsdWUpIHsgZWwudmFsdWUgPSB2YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0Q2hlY2tlZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gZWwuY2hlY2tlZDsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnNldENoZWNrZWQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCB2YWx1ZSkgeyBlbC5jaGVja2VkID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0ZXh0XG4gICAgICogQHJldHVybiB7P31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B0eXBlIHs/fSAqLyAoZG9jLmNyZWF0ZUVsZW1lbnQoJ3N0eWxlJykpO1xuICAgICAgICB0aGlzLmFwcGVuZENoaWxkKHN0eWxlLCB0aGlzLmNyZWF0ZVRleHROb2RlKGNzcywgZG9jKSk7XG4gICAgICAgIHJldHVybiBzdHlsZTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5jcmVhdGVTaGFkb3dSb290ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiAoLyoqIEB0eXBlIHs/fSAqLyAoZWwpKS5jcmVhdGVTaGFkb3dSb290KCk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFNoYWRvd1Jvb3QgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuICgvKiogQHR5cGUgez99ICovIChlbCkpLnNoYWRvd1Jvb3Q7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEhvc3QgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuICgvKiogQHR5cGUgez99ICovIChlbCkpLmhvc3Q7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY2xvbmUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLmNsb25lTm9kZSh0cnVlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWxlbWVudCwgbmFtZSkge1xuICAgICAgICByZXR1cm4gZWxlbWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKG5hbWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0RWxlbWVudHNCeVRhZ05hbWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBuYW1lKSB7XG4gICAgICAgIHJldHVybiBlbGVtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKG5hbWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY2xhc3NMaXN0ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWxlbWVudCkgeyByZXR1cm4gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoZWxlbWVudC5jbGFzc0xpc3QsIDApOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEBwYXJhbSB7P30gY2xhc3NOYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuYWRkQ2xhc3MgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IGNsYXNzTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsZW1lbnQsIGNsYXNzTmFtZSkgeyBlbGVtZW50LmNsYXNzTGlzdC5hZGQoY2xhc3NOYW1lKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IGNsYXNzTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnJlbW92ZUNsYXNzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBjbGFzc05hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBjbGFzc05hbWUpIHsgZWxlbWVudC5jbGFzc0xpc3QucmVtb3ZlKG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wOyBpIDwgZWxBdHRycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXR0cmliID0gZWxBdHRycy5pdGVtKGkpO1xuICAgICAgICAgICAgcmVzLnNldChhdHRyaWIubmFtZSwgYXR0cmliLnZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBhdHRyaWJ1dGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5oYXNBdHRyaWJ1dGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IGF0dHJpYnV0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsZW1lbnQsIGF0dHJpYnV0ZSkge1xuICAgICAgICByZXR1cm4gZWxlbWVudC5oYXNBdHRyaWJ1dGUoYXR0cmlidXRlKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEBwYXJhbSB7P30gbnNcbiAgICAgKiBAcGFyYW0gez99IGF0dHJpYnV0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmhhc0F0dHJpYnV0ZU5TID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuc1xuICAgICAqIEBwYXJhbSB7P30gYXR0cmlidXRlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWxlbWVudCwgbnMsIGF0dHJpYnV0ZSkge1xuICAgICAgICByZXR1cm4gZWxlbWVudC5oY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ez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gZG9jdW1lbnQuaW1wbGVtZW50YXRpb24uY3JlYXRlSFRNTERvY3VtZW50KCdmYWtlVGl0bGUnKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldERlZmF1bHREb2N1bWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gZG9jdW1lbnQ7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEJvdW5kaW5nQ2xpZW50UmVjdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGVsLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoICgvKiogQHR5cGUgez99ICovIGUpIHtcbiAgICAgICAgICAgIHJldHVybiB7IHRvcDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwLCByaWdodDogMCwgd2lkdGg6IDAsIGhlaWdodDogMCB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRpdGxlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkb2NcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChkb2MpIHsgcmV0dXJuIGRvYy50aXRsZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gbmV3VGl0bGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5zZXRUaXRsZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZG9jXG4gICAgICogQHBhcmFtIHs/fSBuZXdUaXRsZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRvYywgbmV3VGl0bGUpIHsgZG9jLnRpdGxlID0gbmV3VGl0bGUgfHwgJyc7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBuXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmVsZW1lbnRNYXRjaGVzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG4sIHNlbGVjdG9yKSB7XG4gICAgICAgIGlmICh0aGlzLmlzRWxlbWVudE5vZGUobikpIHtcbiAgICAgICAgICAgIHJldHVybiBuLm1hdGNoZXMgJiYgbi5tYXRjaGVzKHNlbGVjdG9yKSB8fFxuICAgICAgICAgICAgICAgIG4ubXNNYXRjaGVzU2VsZWN0b3IgJiYgbi5tc01hdGNoZXNTZWxlY3RvcihzZWxlY3RvcikgfHxcbiAgICAgICAgICAgICAgICBuLndlYmtpdE1hdGNoZXNTZWxlY3RvciAmJiBuLndlYmtpdE1hdGNoZXNTZWxlY3RvcihzZWxlY3Rvcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzVGVtcGxhdGVFbGVtZW50ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmlzRWxlbWVudE5vZGUoZWwpICYmIGVsLm5vZGVOYW1lID09PSAnVEVNUExBVEUnO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaXNUZXh0Tm9kZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IE5vZGUuVEVYVF9OT0RFOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzQ29tbWVudE5vZGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLm5vZGVUeXBlID09PSBOb2RlLkNPTU1FTlRfTk9ERTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5pc0VsZW1lbnROb2RlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSkgeyByZXR1cm4gbm9kZS5ub2RlVHlwZSA9PT0gTm9kZS5FTEVNRU5UX05PREU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaGFzU2hhZG93Um9vdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIG5vZGUuc2hhZG93Um9vdCAhPSBudWxsICYmIG5vZGUgaW5zdGFuY2VvZiBIVE1MRWxlbWVudDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzU2hhZG93Um9vdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUgaW5zdGFuY2VvZiBEb2N1bWVudEZyYWdtZW50OyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmltcG9ydEludG9Eb2MgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBkb2N1bWVudC5pbXBvcnROb2RlKHRoaXMudGVtcGxhdGVBd2FyZVJvb3Qobm9kZSksIHRydWUpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmFkb3B0Tm9kZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIGRvY3VtZW50LmFkb3B0Tm9kZShub2RlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0SHJlZiA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAoKGVsLmdldEF0dHJpYnV0ZSgnaHJlZicpKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEV2ZW50S2V5ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleSA9IGV2ZW50LmtleTtcbiAgICAgICAgaWYgKGtleSA9PSBudWxsKSB7XG4gICAgICAgICAgICBrZXkgPSBldmVudC5rZXlJZGVudGlmaWVyO1xuICAgICAgICAgICAgLy8ga2V5SWRlbnRpZmllciBpcyBkZWZpbmVkIGluIHRoZSBvbGQgZHJhZnQgb2YgRE9NIExldmVsIDMgRXZlbnRzIGltcGxlbWVudGVkIGJ5IENocm9tZSBhbmRcbiAgICAgICAgICAgIC8vIFNhZmFyaSBjZlxuICAgICAgICAgICAgLy8gaHR0cDovL3d3dy53My5vcmcvVFIvMjAwNy9XRC1ET00tTGV2ZWwtMy1FdmVudHMtMjAwNzEyMjEvZXZlbnRzLmh0bWwjRXZlbnRzLUtleWJvYXJkRXZlbnRzLUludGVyZmFjZXNcbiAgICAgICAgICAgIGlmIChrZXkgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnVW5pZGVudGlmaWVkJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChrZXkuc3RhcnRzV2l0aCgnVSsnKSkge1xuICAgICAgICAgICAgICAgIGtleSA9IFN0cmluZy5mcm9tQ2hhckNvZGUocGFyc2VJbnQoa2V5LnN1YnN0cmluZygyKSwgMTYpKTtcbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQubG9jYXRpb24gPT09IERPTV9LRVlfTE9DQVRJT05fTlVNUEFEICYmIF9jaHJvbWVOdW1LZXlQYWRNYXAuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSBpcyBhIGJ1ZyBpbiBDaHJvbWUgZm9yIG51bWVyaWMga2V5cGFkIGtleXM6XG4gICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vY29kZS5nb29nbGUuY29tL3AvY2hyb21pdW0vaXNzdWVzL2RldGFpbD9pZD0xNTU2NTRcbiAgICAgICAgICAgICAgICAgICAgLy8gMSwgMiwgMyAuLi4gYXJlIHJlcG9ydGVkIGFzIEEsIEIsIEMgLi4uXG4gICAgICAgICAgICAgICAgICAgIGtleSA9ICgvKiogQHR5cGUgez99ICovIChfY2hyb21lTnVtS2V5UGFkTWFwKSlba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIF9rZXlNYXBba2V5XSB8fCBrZXk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0R2xvYmFsRXZlbnRUYXJnZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZG9jLCB0YXJnZXQpIHtcbiAgICAgICAgaWYgKHRhcmdldCA9PT0gJ3dpbmRvdycpIHtcbiAgICAgICAgICAgIHJldHVybiB3aW5kb3c7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRhcmdldCA9PT0gJ2RvY3VtZW50Jykge1xuICAgICAgICAgICAgcmV0dXJuIGRvYztcbiAgICAgICAgfVxuICAgICAgICBpZiAodGFyZ2V0ID09PSAnYm9keScpIHtcbiAgICAgICAgICAgIHJldHVybiBkb2MuYm9keTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEhpc3RvcnkgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHdpbmRvdy5oaXN0b3J5OyB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldExvY2F0aW9uID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB3aW5k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BvcnRzU3RhdGUoKSkge1xuICAgICAgICAgICAgdGhpcy5faGlzdG9yeS5wdXNoU3RhdGUoc3RhdGUsIHRpdGxlLCB1cmwpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5sb2NhdGlvbi5oYXNoID0gdXJsO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0YXRlXG4gICAgICogQHBhcmFtIHs/fSB0aXRsZVxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyUGxhdGZvcm1Mb2NhdGlvbi5wcm90b3R5cGUucmVwbGFjZVN0YXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEBwYXJhbSB7P30gdGl0bGVcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0YXRlLCB0aXRsZSwgdXJsKSB7XG4gICAgICAgIGlmIChzdXBwb3J0c1N0YXRlKCkpIHtcbiAgICAgICAgICAgIHRoaXMuX2hpc3RvcnkucmVwbGFjZVN0YXRlKHN0YXRlLCB0aXRsZSwgdXJsKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMubG9jYXRpb24uaGFzaCA9IHVybDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyUGxhdGZvcm1Mb2NhdGlvbi5wcm90b3R5cGUuZm9yd2FyZCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB0aGlzLl9oaXN0b3J5LmZvcndhcmQoKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuIC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0aW9uICh0YWdzLCBmb3JjZUNyZWF0aW9uKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChmb3JjZUNyZWF0aW9uID09PSB2b2lkIDApIHsgZm9yY2VDcmVhdGlvbiA9IGZhbHNlOyB9XG4gICAgICAgIGlmICghdGFncylcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgcmV0dXJuIHRhZ3MucmVkdWNlKGZ1bmN0aW9uIChyZXN1bHQsIHRhZykge1xuICAgICAgICAgICAgaWYgKHRhZykge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKF90aGlzLl9nZXRPckNyZWF0ZUVsZW1lbnQodGFnLCBmb3JjZUNyZWF0aW9uKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9LCBbXSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGF0dHJTZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuZ2V0VGFnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBhdHRyU2VsZWN0b3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChhdHRyU2VsZWN0b3IpIHtcbiAgICAgICAgaWYgKCFhdHRyU2VsZWN0b3IpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2RvbS5xdWVyeVNlbGVjdG9yKHRoaXMuX2RvYywgXCJtZXRhW1wiICsgYXR0clNlbGVjdG9yICsgXCJdXCIpIHx8IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGF0dHJTZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuZ2V0VGFncyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYXR0clNlbGVjdG9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYXR0clNlbGVjdG9yKSB7XG4gICAgICAgIGlmICghYXR0clNlbGVjdG9yKVxuICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBsaXN0ID0gdGhpcy5fZG9tLnF1ZXJ5U2VsZWN0b3JBbGwodGhpcy5fZG9jLCBcIm1ldGFbXCIgKyBhdHRyU2VsZWN0b3IgKyBcIl1cIik7XG4gICAgICAgIHJldHVybiBsaXN0ID8gW10uc2xpY2UuY2FsbChsaXN0KSA6IFtdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0YWdcbiAgICAgKiBAcGFyYW0gez89fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUudXBkYXRlVGFnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB0YWdcbiAgICAgKiBAcGFyYW0gez89fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHRhZywgc2VsZWN0b3IpIHtcbiAgICAgICAgaWYgKCF0YWcpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgc2VsZWN0b3IgPSBzZWxlY3RvciB8fCB0aGlzLl9wYXJzZVNlbGVjdG9yKHRhZyk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1ldGEgPSAvKiogQHR5cGUgez99ICovICgodGhpcy5nZXRUYWcoc2VsZWN0b3IpKSk7XG4gICAgICAgIGlmIChtZXRhKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fc2V0TWV0YUVsZW1lbnRBdHRyaWJ1dGVzKHRhZywgbWV0YSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuX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aXMuX2RvYywgJ2hlYWQnKVswXTtcbiAgICAgICAgdGhpcy5fZG9tLmFwcGVuZENoaWxkKGhlYWQsIGVsZW1lbnQpO1xuICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuX3NldE1ldGFFbGVtZW50QXR0cmlidXRlcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHRhZywgZWwpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgT2JqZWN0LmtleXModGFnKS5mb3JFYWNoKGZ1bmN0aW9uIChwcm9wKSB7IHJldHVybiBfdGhpcy5fZG9tLnNldEF0dHJpYnV0ZShlbCwgcHJvcCwgdGFnW3Byb3BdKTsgfSk7XG4gICAgICAgIHJldHVybiBlbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNZXRhLnByb3RvdHlwZS5fcGFyc2VTZWxlY3RvciA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodGFnKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGF0dHIgPSB0YWcubmFtZSA/ICduYW1lJyA6ICdwcm9wZXJ0eSc7XG4gICAgICAgIHJldHVybiBhdHRyICsgXCI9XFxcIlwiICsgdGFnW2F0dHJdICsgXCJcXFwiXCI7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhZ1xuICAgICAqIEBw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WVzLmZvckVhY2goZnVuY3Rpb24gKHRlc3RhYmlsaXR5IC8qKiBUT0RPICM5MTAwICovKSB7XG4gICAgICAgICAgICAgICAgdGVzdGFiaWxpdHkud2hlblN0YWJsZShkZWNyZW1lbnQpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgICAgIGlmICghybVnbG9iYWxbJ2ZyYW1ld29ya1N0YWJpbGl6ZXJzJ10pIHtcbiAgICAgICAgICAgIMm1Z2xvYmFsWydmcmFtZXdvcmtTdGFiaWxpemVycyddID0gW107XG4gICAgICAgIH1cbiAgICAgICAgybVnbG9iYWxbJ2ZyYW1ld29ya1N0YWJpbGl6ZXJzJ10ucHVzaCh3aGVuQWxsU3RhYmxlKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVnaXN0cnlcbiAgICAgKiBAcGFyYW0gez99IGVsZW1cbiAgICAgKiBAcGFyYW0gez99IGZpbmRJbkFuY2VzdG9yc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckdldFRlc3RhYmlsaXR5LnByb3RvdHlwZS5maW5kVGVzdGFiaWxpdHlJblRyZWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHJlZ2lzdHJ5XG4gICAgICogQHBhcmFtIHs/fSBlbGVtXG4gICAgICogQHBhcmFtIHs/fSBmaW5kSW5BbmNlc3RvcnNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChyZWdpc3RyeSwgZWxlbSwgZmluZEluQW5jZXN0b3JzKSB7XG4gICAgICAgIGlmIChlbGVtID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHQgPSByZWdpc3RyeS5nZXRUZXN0YWJpbGl0eShlbGVtKTtcbiAgICAgICAgaWYgKHQgIT0gbnVsbCkge1xuICAgICAgICAgICAgcm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YW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHBhcmFtIHs/fSBoYW5kbGVyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodGFyZ2V0LCBldmVudE5hbWUsIGhhbmRsZXIpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGx1Z2luID0gdGhpcy5fZmluZFBsdWdpbkZvcihldmVudE5hbWUpO1xuICAgICAgICByZXR1cm4gcGx1Z2luLmFkZEdsb2JhbEV2ZW50TGlzdGVuZXIodGFyZ2V0LCBldmVudE5hbWUsIGhhbmRsZXIpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBFdmVudE1hbmFnZXIucHJvdG90eXBlLmdldFpvbmUgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuX3pvbmU7IH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEV2ZW50TWFuYWdlci5wcm90b3R5cGUuX2ZpbmRQbHVnaW5Gb3IgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnROYW1lKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBsdWdpbiA9IHRoaXMuX2V2ZW50TmFtZVRvUGx1Z2luLmdldChldmVudE5hbWUpO1xuICAgICAgICBpZiAocGx1Z2luKSB7XG4gICAgICAgICAgICByZXR1cm4gcGx1Z2luO1xuICAgICAg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KiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gRGVmYXVsdERvbVJlbmRlcmVyMihldmVudE1hbmFnZXIpIHtcbiAgICAgICAgdGhpcy5ldmVudE1hbmFnZXIgPSBldmVudE1hbmFnZXI7XG4gICAgICAgIHRoaXMuZGF0YSA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuZGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuY3JlYXRlRWxlbWVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIG5hbWVzcGFjZSkge1xuICAgICAgICBpZiAobmFtZXNwYWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKE5BTUVTUEFDRV9VUklTW25hbWVzcGFjZV0sIG5hbWUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkb2N1bWVudC5jcmVhdGVFbGVtZW50KG5hbWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuY3JlYXRlQ29tbWV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XG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRcbiAgICAgKiBAcGFyYW0gez99IG5ld0NoaWxkXG4gICAgICogQHBhcmFtIHs/fSByZWZDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmVudCwgbmV3Q2hpbGQsIHJlZkNoaWxkKSB7XG4gICAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgICAgIHBhcmVudC5pbnNlcnRCZWZvcmUobmV3Q2hpbGQsIHJlZkNoaWxkKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRcbiAgICAgKiBAcGFyYW0gez99IG9sZENoaWxkXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5yZW1vdmVDaGlsZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyZW50XG4gICAgICogQHBhcmFtIHs/fSBvbGRDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmVudCwgb2xkQ2hpbGQpIHtcbiAgICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICAgICAgcGFyZW50LnJlbW92ZUNoaWxkKG9sZENoaWxkKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3Rvck9yTm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuc2VsZWN0Um9vdEVsZW1lbnQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHNlbGVjdG9yT3JOb2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoc2VsZWN0b3JPck5vZGUpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZWwgPSB0eXBlb2Ygc2VsZWN0b3JPck5vZGUgPT09ICdzdHJpbmcnID8gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihzZWxlY3Rvck9yTm9kZSkgOlxuICAgICAgICAgICAgc2VsZWN0b3JPck5vZGU7XG4gICAgICAgIGlmICghZWwpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoZSBzZWxlY3RvciBcXFwiXCIgKyBzZWxlY3Rvck9yTm9kZSArIFwiXFxcIiBkaWQgbm90IG1hdGNoIGFueSBlbGVtZW50c1wiKTtcbiAgICAgICAgfVxuICAgICAgICBlbC50ZXh0Q29udGVudCA9ICcnO1xuICAgICAgICByZXR1cm4gZWw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIERlZmF1bHREb21SZW5kZXJlcjIucHJvdG90eXBlLnBhcmVudE5vZGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLnBhcmVudE5vZGU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5uZXh0U2libGluZyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubmV4dFNpYmxpbmc7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcGFyYW0gez89fSBuYW1lc3BhY2VcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIERlZmF1bHREb21SZW5kZXJlcjIucHJvdG90eXBlLnNldEF0dHJpYnV0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHBhcmFtIHs/PX0gbmFtZXNwYWNlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlLCBuYW1lc3BhY2UpIHtcbiAgICAgICAgaWYgKG5hbWVzcGFjZSkge1xuICAgICAgICAgICAgbmFtZSA9IG5hbWVzcGFjZSArIFwiOlwiICsgbmFtZTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5hbWVzcGFjZVVyaSA9IE5BTUVTUEFDRV9VUklTW25hbWVzcGFjZV07XG4gICAgICAgICAgICBpZiAobmFtZXNwYWNlVXJpKSB7XG4gICAgICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlTlMobmFtZXNwYWNlVXJpLCBuYW1lLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBlbC5zZXRBdHRyaWJ1dGUobmFtZSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlKG5hbWUsIHZhbHVlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUucmVtb3ZlQXR0cmlidXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuYW1lLCBuYW1lc3BhY2UpIHtcbiAgICAgICAgaWYgKG5hbWVzcGFjZSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmFtZXNwYWNlVXJpID0gTkFNRVNQQUNFX1VSSVNbbmFtZXNwYWNlXTtcbiAgICAgICAgICAgIGlmIChuYW1lc3BhY2VVcmkpIHtcbiAgICAgICAgICAgICAgICBlbC5yZW1vdmVBdHRyaWJ1dGVOUyhuYW1lc3BhY2VVcmksIG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZWwucmVtb3ZlQXR0cmlidXRlKG5hbWVzcGFjZSArIFwiOlwiICsgbmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbC5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIERlZmF1bHREb21SZW5kZXJlcjIucHJvdG90eXBlLmFkZENsYXNzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuYW1lKSB7IGVsLmNsYXNzTGlzdC5hZGQobmFtZSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB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JldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlKSB7XG4gICAgICAgIGNoZWNrTm9TeW50aGV0aWNQcm9wKG5hbWUsICdwcm9wZXJ0eScpO1xuICAgICAgICBlbFtuYW1lXSA9IHZhbHVlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuc2V0VmFsdWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSwgdmFsdWUpIHsgbm9kZS5ub2RlVmFsdWUgPSB2YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRcbiAgICAgKiBAcGFyYW0gez99IGNhbGxiYWNrXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5saXN0ZW4gPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRcbiAgICAgKiBAcGFyYW0gez99IGNhbGxiYWNrXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodGFyZ2V0LCBldmVudCwgY2FsbGJhY2spIHtcbiAgICAgICAgY2hlY2tOb1N5bnRoZXRpY1Byb3AoZXZlbnQsICdsaXN0ZW5lcicpO1xuICAgICAgICBpZiAodHlwZW9mIHRhcmdldCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHJldHVybiAvKiogQHR5cGU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hhbmRsZXIuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIGNvcHkgdGFza3MgYXMgYSBzbmFwc2hvdCB0byBhdm9pZCBldmVudCBoYW5kbGVycyByZW1vdmVcbiAgICAgICAgLy8gaXRzZWxmIG9yIG90aGVyc1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb3BpZWRUYXNrcyA9IHRhc2tEYXRhcy5zbGljZSgpO1xuICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGkgPSAwOyBpIDwgY29waWVkVGFza3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIC8vIGlmIG90aGVyIGxpc3RlbmVyIGNhbGwgZXZlbnQuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uXG4gICAgICAgICAgICAvLyBqdXN0IGJyZWFrXG4gICAgICAgICAgICBpZiAoKC8qKiBAdHlwZSB7P30gKi8gKGV2ZW50KSlbc3RvcFN5bWJvbF0gPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHRhc2tEYXRhID0gY29waWVkVGFza3NbaV07XG4gICAgICAgICAgICBpZiAodGFza0RhdGEuem9uZSAhPT0gWm9uZS5jdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgLy8gb25seSB1c2UgWm9uZS5ydW4gd2hlbiBab25lLmN1cnJlbnQgbm90IGVxdWFscyB0byBzdG9yZWQgem9uZVxuICAgICAgICAgICAgICAgIHRhc2tEYXRhLnpvbmUucnVuKHRhc2tEYXRhLmhhbmRsZXIsIHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGFza0RhdGEuaGFuZGxlci5hcHBseSh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG52YXIgRG9tRXZlbnRzUGx1Z2luID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgIF9fZXh0ZW5kcyhEb21FdmVudHNQbHVnaW4sIF9zdXBlcik7XG4gICAgZnVuY3Rpb24gRG9tRXZlbnRzUGx1Z2luKGRvYywgbmdab25lKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIGRvYykgfHwgdGhpcztcbiAgICAgICAgX3RoaXMubmdab25lID0gbmdab25lO1xuICAgICAgICBfdGhpcy5wYXRjaEV2ZW50KCk7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEb21FdmVudHNQbHVnaW4ucHJvdG90eXBlLnBhdGNoRXZlbnQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCFFdmVudCB8fCAhRXZlbnQucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCgvKiogQHR5cGUgez99ICovIChFdmVudC5wcm90b3R5cGUpKVtzdG9wTWV0aG9kU3ltYm9sXSkge1xuICAgICAgICAgICAgLy8gYWxyZWFkeSBwYXRjaGVkIGJ5IHpvbmUuanNcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBkZWxlZ2F0ZSA9ICgvKiogQHR5cGUgez99ICovIChFdmVudC5wcm90b3R5cGUpKVtzdG9wTWV0aG9kU3ltYm9sXSA9XG4gICAgICAgICAgICBFdmVudC5wcm90b3R5cGUuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uO1xuICAgICAgICBFdmVudC5wcm90b3R5cGUuc3RvcElt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iBAdHlwZSB7P30gKi8gdGFza0RhdGFzID0gKC8qKiBAdHlwZSB7P30gKi8gKGVsZW1lbnQpKVtzeW1ib2xOYW1lXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGdsb2JhbExpc3RlbmVyUmVnaXN0ZXJlZCA9IHRhc2tEYXRhcyAmJiB0YXNrRGF0YXMubGVuZ3RoID4gMDtcbiAgICAgICAgICAgIGlmICghdGFza0RhdGFzKSB7XG4gICAgICAgICAgICAgICAgdGFza0RhdGFzID0gKC8qKiBAdHlwZSB7P30gKi8gKGVsZW1lbnQpKVtzeW1ib2xOYW1lXSA9IFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gem9uZSA9IGlzQmxhY2tMaXN0ZWRFdmVudChldmVudE5hbWUpID8gWm9uZS5yb290IDogWm9uZS5jdXJyZW50O1xuICAgICAgICAgICAgaWYgKHRhc2tEYXRhcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICB0YXNrRGF0YXMucHVzaCh7IHpvbmU6IHpvbmUsIGhhbmRsZXI6IGNhbGxiYWNrIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2FsbGJhY2tSZWdpc3RlcmVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IHRhc2tEYXRhcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGFza0RhdGFzW2ldLmhhbmRsZXIgPT09IGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja1JlZ2lzdGVyZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFjYWxsYmFja1JlZ2lzdGVyZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGFza0RhdGFzLnB1c2goeyB6b25lOiB6b25lLCBoYW5kbGVyOiBjYWxsYmFjayB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWdsb2JhbExpc3RlbmVyUmVnaXN0ZXJlZCkge1xuICAgICAgICAgICAgICAgIGVsZW1lbnRbQUREX0VWRU5UX0xJU1RFTkVSXShldmVudE5hbWUsIGdsb2JhbExpc3RlbmVyLCBmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbGVtZW50W05BVElWRV9BRERfTElTVEVORVJdKGV2ZW50TmFtZSwgY2FsbGJhY2ssIGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeyByZXR1cm4gX3RoaXMucmVtb3ZlRXZlbnRMaXN0ZW5lcihlbGVtZW50LCBldmVudE5hbWUsIGNhbGxiYWNrKTsgfTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcGFyYW0gez99IGNhbGxiYWNrXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEb21FdmVudHNQbHVnaW4ucHJvdG90eXBlLnJlbW92ZUV2ZW50TGlzdGVuZXIgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHBhcmFtIHs/fSBjYWxsYmFja1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHRhcmdldCwgZXZlbnROYW1lLCBjYWxsYmFjaykge1xuICAgICAgICB2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gICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXkgPSBLZXlFdmVudHNQbHVnaW4uX25vcm1hbGl6ZUtleSgvKiogQHR5cGUgez99ICovICgocGFydHMucG9wKCkpKSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGZ1bGxLZXkgPSAnJztcbiAgICAgICAgTU9ESUZJRVJfS0VZUy5mb3JFYWNoKGZ1bmN0aW9uIChtb2RpZmllck5hbWUpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGluZGV4ID0gcGFydHMuaW5kZXhPZihtb2RpZmllck5hbWUpO1xuICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcbiAgICAgICAgICAgICAgICBwYXJ0cy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgICAgIGZ1bGxLZXkgKz0gbW9kaWZpZXJOYW1lICsgJy4nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgZnVsbEtleSArPSBrZXk7XG4gICAgICAgIGlmIChwYXJ0cy5sZW5ndGggIT0gMCB8fCBrZXkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAvLyByZXR1cm5pbmcgbnVsbCBpbnN0ZWFkIG9mIHRocm93aW5nIHRvIGxldCBhbm90aGVyIHBsdWdpbiBwcm9jZXNzIHRoZSBldmVudFxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzdWx0ID0ge307XG4gICAgICAgIHJlc3VsdFsnZG9tRXZlbnROYW1lJ10gPSBkb21FdmVudE5hbWU7XG4gICAgICAgIHJlc3VsdFsnZnVsbEtleSddID0gZnVsbEtleTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEtleUV2ZW50c1BsdWdpbi5nZXRFdmVudEZ1bGxLZXkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2ZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZnVsbEtleSA9ICcnO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXkgPSBnZXRET00oKS5nZXRFdmVudEtleShldmVudCk7XG4gICAgICAgIGtleSA9IGtleS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICBpZiAoa2V5ID09PSAnICcpIHtcbiAgICAgICAgICAgIGtleSA9ICdzcGFjZSc7IC8vIGZvciByZWFkYWJpbGl0eVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGtleSA9PT0gJy4nKSB7XG4gICAgICAgICAgICBrZXkgPSAnZG90JzsgLy8gYmVjYXVzZSAnLicgaXMgdXNlZCBhcyBhIHNlcGFyYXRvciBpbiBldmVudCBuYW1lc1xuICAgICAgICB9XG4gICAgICAgIE1PRElGSUVSX0tFWVMuZm9yRWFjaChmdW5jdGlvbiAobW9kaWZpZXJOYW1lKSB7XG4gICAgICAgICAgICBpZiAobW9kaWZpZXJOYW1lICE9IGtleSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1vZGlmaWVyR2V0dGVyID0gTU9ESUZJRVJfS0VZX0dFVFRFUlNbbW9kaWZpZXJOYW1lXTtcbiAgICAgICAgICAgICAgICBpZiAobW9kaWZpZXJHZXR0ZXIoZXZlbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxLZXkgKz0gbW9kaWZpZXJOYW1lICsgJy4nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGZ1bGxLZ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sb2JiZXJpbmcuXG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGN1cnJlbnQgPSAvKiogQHR5cGUgez99ICovICgoZWwuZmlyc3RDaGlsZCkpO1xuICAgICAgICB3aGlsZSAoY3VycmVudCkge1xuICAgICAgICAgICAgaWYgKERPTS5pc0VsZW1lbnROb2RlKGN1cnJlbnQpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdGFydEVsZW1lbnQoLyoqIEB0eXBlIHs/fSAqLyAoY3VycmVudCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoRE9NLmlzVGV4dE5vZGUoY3VycmVudCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYXJzKC8qKiBAdHlwZSB7P30gKi8gKChET00ubm9kZVZhbHVlKGN1cnJlbnQpKSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gU3RyaXAgbm9uLWVsZW1lbnQsIG5vbi10ZXh0IG5vZGVzLlxuICAgICAgICAgICAgICAgIHRoaXMuc2FuaXRpemVkU29tZXRoaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChET00uZmlyc3RDaGlsZChjdXJyZW50KSkge1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAvKiogQHR5cGUgez99ICovICgoRE9NLmZpcnN0Q2hpbGQoY3VycmVudCkpKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdoaWxlIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgLy8gTGVhdmluZyB0aGUgZWxlbWVudC4gV2FsayB1cCBhbmQgdG8gdGhlIHJpZ2h0LCBjbG9zaW5nIHRhZ3MgYXMgd2UgZ28uXG4gICAgICAgICAgICAgICAgaWYgKERPTS5pc0VsZW1lbnROb2RlKGN1cnJlbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZW5kRWxlbWVudCgvKiogQHR5cGUgez99ICovIChjdXJyZW50KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5leHQgPSBjaGVja0Nsb2JiZXJlZEVsZW1lbnQoY3VycmVudCwgLyoqIEB0eXBlIHs/fSAqLyAoKERPTS5uZXh0U2libGluZyhjdXJyZW50KSkpKTtcbiAgICAgICAgICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gbmV4dDtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSBjaGVja0Nsb2JiZXJlZEVsZW1lbnQoY3VycmVudCwgLyoqIEB0eXBlIHs/fSAqLyAoKERPTS5wYXJlbnRFbGVtZW50KGN1cnJlbnQpKSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmJ1Zi5qb2luKCcnKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU2FuaXRpemluZ0h0bWxTZXJpYWxpemVyLnByb3RvdHlwZS5zdGFydEVsZW1lbnQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50KSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHRhZ05hbWUgPSBET00ubm9kZU5hbWUoZWxlbWVudCkudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgaWYgKCFWQUxJRF9FTEVNRU5UUy5oYXNPd25Qcm9wZXJ0eSh0YWdOYW1lKSkge1xuICAgICAgICAgICAgdGhpcy5zYW5pdGl6ZWRTb21ldGhpbmcgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuYnVmLnB1c2goJzwnKTtcbiAgICAgICAgdGhpcy5idWYucHVzaCh0YWdOYW1lKTtcbiAgICAgICAgRE9NLmF0dHJpYnV0ZU1hcChlbGVtZW50KS5mb3JFYWNoKGZ1bmN0aW9uICh2YWx1ZSwgYXR0ck5hbWUpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxvd2VyID0gYXR0ck5hbWUudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgIGlmICghVkFMSURfQVRUUlMuaGFzT3duUHJvcGVydHkobG93ZXIpKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuc2FuaXRpemVkU29tZXRoaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBUT0RPKG1hcnRpbnByb2JzdCk6IFNwZWNpYWwgY2FzZSBpbWFnZSBVUklzIGZvciBkYXRhOmltYWdlLy4uLlxuICAgICAgICAgICAgaWYgKFVSSV9BVFRSU1tsb3dlcl0pXG4gICAgICAgICAgICAgICAgdmFsdWUgPSBzYW5pdGl6ZVVybCh2YWx1ZSk7XG4gICAgICAgICAgICBpZiAoU1JDU0VUX0FUVFJTW2xvd2VyXSlcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHNhbml0aXplU3Jjc2V0KHZhbHVlKTtcbiAgICAgICAgICAgIF90aGlzLmJ1Zi5wdXNoKCcgJyk7XG4gICAgICAgICAgICBfdGhpcy5idWYucHVzaChhdHRyTmFtZSk7XG4gICAgICAgICAgICBfdGhpcy5idWYucHVzaCgnPVwiJyk7XG4gICAgICAgICAgICBfdGhpcy5idWYucHVzaChlbmNvZGVFbnRpdGllcyh2YWx1ZSkpO1xuICAgICAgICAgICAgX3RoaXMuYnVmLnB1c2goJ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nJvbSBhIHNlcnZlci1yZW5kZXJlZCBhcHAsIGlmXG4gICAgICogb25lIGlzIHByZXNlbnQgb24gdGhlIHBhZ2UuIFRoZSBzcGVjaWZpZWQgcGFyYW1ldGVycyBtdXN0IGluY2x1ZGUgYW4gYXBwbGljYXRpb24gaWQsXG4gICAgICogd2hpY2ggbXVzdCBtYXRjaCBiZXR3ZWVuIHRoZSBjbGllbnQgYW5kIHNlcnZlciBhcHBsaWNhdGlvbnMuXG4gICAgICpcbiAgICAgKiBcXEBleHBlcmltZW50YWxcbiAgICAgKiBAcGFyYW0gez99IHBhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmFtcykge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbmdNb2R1bGU6IEJyb3dzZXJNb2R1bGUsXG4gICAgICAgICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgICAgICAgICB7IHByb3ZpZGU6IEFQUF9JRCwgdXNlVmFsdWU6IHBhcmFtcy5hcHBJZCB9LFxuICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogVFJBTlNJVElPTl9JRCwgdXNlRXhpc3Rpbmc6IEFQUF9JRCB9LFxuICAgICAgICAgICAgICAgIFNFUlZFUl9UUkFOU0lUSU9OX1BST1ZJREVSUyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH07XG4gICAgfTtcbiAgICBCcm93c2VyTW9kdWxlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogTmdNb2R1bGUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgQlJPV1NFUl9TQU5JVElaQVRJT05fUFJPVklERVJTLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBFcnJvckhhbmRsZXIsIHVzZUZhY3Rvcnk6IGVycm9ySGFuZGxlciwgZGVwczogW10gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogRVZFTlRfTUFOQUdFUl9QTFVHSU5TLCB1c2VDbGFzczogRG9tRXZlbnRzUGx1Z2luLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBFVkVOVF9NQU5BR0VSX1BMVUdJTlMsIHVzZUNsYXNzOiBLZXlFdmVudHNQbHVnaW4sIG11bHRpOiB0cnVlIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7IHByb3ZpZGU6IEVWRU5UX01BTkFHRVJfUExVR0lOUywgdXNlQ2xhc3M6IEhhbW1lckdlc3R1cmVzUGx1Z2luLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIQU1NRVJfR0VTVFVSRV9DT05GSUcsIHVzZUNsYXNzOiBIYW1tZXJHZXN0dXJlQ29uZmlnIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBEb21SZW5kZXJlckZhY3RvcnkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBSZW5kZXJlckZhY3RvcnkyLCB1c2VFeGlzdGluZzogRG9tUmVuZGVyZXJGYWN0b3J5MiB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBTaGFyZWRTdHlsZXNIb3N0LCB1c2VFeGlzdGluZzogRG9tU2hhcmVkU3R5bGVzSG9zdCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgRG9tU2hhcmVkU3R5bGVzSG9zdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIFRlc3RhYmlsaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRNYW5hZ2VyLFxuICAgICAgICAgICAgICAgICAgICAgICAgRUxFTUVOVF9QUk9CRV9QUk9WSURFUlMsXG4gICAgICAgICAgICAgICAgICAgICAgICBNZXRhLFxuICAgICAgICAgICAgICAgICAgICAgICAgVGl0bGUsXG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ICAgICogb2YgNTAwIG1pbGxpc2Vjb25kcy5cbiAgICAgKlxuICAgICAqIE9wdGlvbmFsbHksIGEgdXNlciBtYXkgcGFzcyBhIGBjb25maWdgIHBhcmFtZXRlciBjb250YWluaW5nIGEgbWFwIG9mXG4gICAgICogb3B0aW9ucy4gU3VwcG9ydGVkIG9wdGlvbnMgYXJlOlxuICAgICAqXG4gICAgICogYHJlY29yZGAgKGJvb2xlYW4pIC0gY2F1c2VzIHRoZSBwcm9maWxlciB0byByZWNvcmQgYSBDUFUgcHJvZmlsZSB3aGlsZVxuICAgICAqIGl0IGV4ZXJjaXNlcyB0aGUgY2hhbmdlIGRldGVjdG9yLiBFeGFtcGxlOlxuICAgICAqXG4gICAgICogYGBgXG4gICAgICogbmcucHJvZmlsZXIudGltZUNoYW5nZURldGVjdGlvbih7cmVjb3JkOiB0cnVlfSlcbiAgICAgKiBgYGBcbiAgICAgKiBAcGFyYW0gez99IGNvbmZpZ1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZWNvcmQgPSBjb25maWcgJiYgY29uZmlnWydyZWNvcmQnXTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcHJvZmlsZU5hbWUgPSAnQ2hhbmdlIERldGVjdGlvbic7XG4gICAgICAgIC8vIFByb2ZpbGVyIGlzIG5vdCBhdmFpbGFibGUgaW4gQW5kcm9pZCBicm93c2Vycywgbm9yIGluIElFIDkgd2l0aG91dCBkZXYgdG9vbHMgb3BlbmVkXG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGlzUHJvZmlsZXJBdmFpbGFibGUgPSB3aW4uY29uc29sZS5wcm9maWxlICE9IG51bGw7XG4gICAgICAgIGlmIChyZWNvcmQgJiYgaXNQcm9maWxlckF2YWlsYWJsZSkge1xuICAgICAgICAgICAgd2luLmNvbnNvbGUucHJvZmlsZShwc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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserModule\", function() { return BrowserModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"platformBrowser\", function() { return platformBrowser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Meta\", function() { return Meta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Title\", function() { return Title; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"disableDebugTools\", function() { return disableDebugTools; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"enableDebugTools\", function() { return enableDebugTools; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserTransferStateModule\", function() { return BrowserTransferStateModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TransferState\", function() { return TransferState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeStateKey\", function() { return makeStateKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"By\", function() { return By; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOCUMENT\", function() { return DOCUMENT$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EVENT_MANAGER_PLUGINS\", function() { return EVENT_MANAGER_PLUGINS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EventManager\", function() { return EventManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HAMMER_GESTURE_CONFIG\", function() { return HAMMER_GESTURE_CONFIG; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HammerGestureConfig\", function() { return HammerGestureConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DomSanitizer\", function() { return DomSanitizer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBROWSER_SANITIZATION_PROVIDERS\", function() { return BROWSER_SANITIZATION_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS\", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵinitDomAdapter\", function() { return initDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserDomAdapter\", function() { return BrowserDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserPlatformLocation\", function() { return BrowserPlatformLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵTRANSITION_ID\", function() { return TRANSITION_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵBrowserGetTestability\", function() { return BrowserGetTestability; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵescapeHtml\", function() { return escapeHtml; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵELEMENT_PROBE_PROVIDERS\", function() { return ELEMENT_PROBE_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomAdapter\", function() { return DomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵgetDOM\", function() { return getDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵsetRootDomAdapter\", function() { return setRootDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomRendererFactory2\", function() { return DomRendererFactory2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵNAMESPACE_URIS\", function() { return NAMESPACE_URIS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵflattenStyles\", function() { return flattenStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵshimContentAttribute\", function() { return shimContentAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵshimHostAttribute\", function() { return shimHostAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomEventsPlugin\", function() { return DomEventsPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵHammerGesturesPlugin\", function() { return HammerGesturesPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵKeyEventsPlugin\", function() { return KeyEventsPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵDomSharedStylesHost\", function() { return DomSharedStylesHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵSharedStylesHost\", function() { return SharedStylesHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return _document; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return errorHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return GenericBrowserDomAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return SERVER_TRANSITION_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return appInitializerFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return initTransferState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return _createNgProbe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return EventManagerPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return DomSanitizerImpl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _DOM = /** @type {?} */ ((null));\n/**\n * @return {?}\n */\nfunction getDOM() {\n return _DOM;\n}\n/**\n * @param {?} adapter\n * @return {?}\n */\n\n/**\n * @param {?} adapter\n * @return {?}\n */\nfunction setRootDomAdapter(adapter) {\n if (!_DOM) {\n _DOM = adapter;\n }\n}\n/**\n * Provides DOM operations in an environment-agnostic way.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar DomAdapter = /** @class */ (function () {\n function DomAdapter() {\n this.resourceLoaderType = /** @type {?} */ ((null));\n }\n Object.defineProperty(DomAdapter.prototype, \"attrToPropMap\", {\n /**\n * Maps attribute names to their corresponding property names for cases\n * where attribute name doesn't match property name.\n */\n get: /**\n * Maps attribute names to their corresponding property names for cases\n * where attribute name doesn't match property name.\n * @return {?}\n */\n function () { return this._attrToPropMap; },\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this._attrToPropMap = value; },\n enumerable: true,\n configurable: true\n });\n return DomAdapter;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Provides DOM operations in any browser environment.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar GenericBrowserDomAdapter = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GenericBrowserDomAdapter, _super);\n function GenericBrowserDomAdapter() {\n var _this = _super.call(this) || this;\n _this._animationPrefix = null;\n _this._transitionEnd = null;\n try {\n var /** @type {?} */ element_1 = _this.createElement('div', document);\n if (_this.getStyle(element_1, 'animationName') != null) {\n _this._animationPrefix = '';\n }\n else {\n var /** @type {?} */ domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];\n for (var /** @type {?} */ i = 0; i < domPrefixes.length; i++) {\n if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {\n _this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';\n break;\n }\n }\n }\n var /** @type {?} */ transEndEventNames_1 = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'oTransitionEnd otransitionend',\n transition: 'transitionend'\n };\n Object.keys(transEndEventNames_1).forEach(function (key) {\n if (_this.getStyle(element_1, key) != null) {\n _this._transitionEnd = transEndEventNames_1[key];\n }\n });\n }\n catch (/** @type {?} */ e) {\n _this._animationPrefix = null;\n _this._transitionEnd = null;\n }\n return _this;\n }\n /**\n * @param {?} el\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getDistributedNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).getDistributedNodes(); };\n /**\n * @param {?} el\n * @param {?} baseUrl\n * @param {?} href\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.resolveAndSetHref = /**\n * @param {?} el\n * @param {?} baseUrl\n * @param {?} href\n * @return {?}\n */\n function (el, baseUrl, href) {\n el.href = href == null ? baseUrl : baseUrl + '/../' + href;\n };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsDOMEvents = /**\n * @return {?}\n */\n function () { return true; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = /**\n * @return {?}\n */\n function () {\n return typeof (/** @type {?} */ (document.body)).createShadowRoot === 'function';\n };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getAnimationPrefix = /**\n * @return {?}\n */\n function () { return this._animationPrefix ? this._animationPrefix : ''; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.getTransitionEnd = /**\n * @return {?}\n */\n function () { return this._transitionEnd ? this._transitionEnd : ''; };\n /**\n * @return {?}\n */\n GenericBrowserDomAdapter.prototype.supportsAnimation = /**\n * @return {?}\n */\n function () {\n return this._animationPrefix != null && this._transitionEnd != null;\n };\n return GenericBrowserDomAdapter;\n}(DomAdapter));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _attrToPropMap = {\n 'class': 'className',\n 'innerHtml': 'innerHTML',\n 'readonly': 'readOnly',\n 'tabindex': 'tabIndex',\n};\nvar DOM_KEY_LOCATION_NUMPAD = 3;\n// Map to convert some key or keyIdentifier values to what will be returned by getEventKey\nvar _keyMap = {\n // The following values are here for cross-browser compatibility and to match the W3C standard\n // cf http://www.w3.org/TR/DOM-Level-3-Events-key/\n '\\b': 'Backspace',\n '\\t': 'Tab',\n '\\x7F': 'Delete',\n '\\x1B': 'Escape',\n 'Del': 'Delete',\n 'Esc': 'Escape',\n 'Left': 'ArrowLeft',\n 'Right': 'ArrowRight',\n 'Up': 'ArrowUp',\n 'Down': 'ArrowDown',\n 'Menu': 'ContextMenu',\n 'Scroll': 'ScrollLock',\n 'Win': 'OS'\n};\n// There is a bug in Chrome for numeric keypad keys:\n// https://code.google.com/p/chromium/issues/detail?id=155654\n// 1, 2, 3 ... are reported as A, B, C ...\nvar _chromeNumKeyPadMap = {\n 'A': '1',\n 'B': '2',\n 'C': '3',\n 'D': '4',\n 'E': '5',\n 'F': '6',\n 'G': '7',\n 'H': '8',\n 'I': '9',\n 'J': '*',\n 'K': '+',\n 'M': '-',\n 'N': '.',\n 'O': '/',\n '\\x60': '0',\n '\\x90': 'NumLock'\n};\nvar nodeContains;\nif (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['Node']) {\n nodeContains = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['Node'].prototype.contains || function (node) {\n return !!(this.compareDocumentPosition(node) & 16);\n };\n}\n/**\n * A `DomAdapter` powered by full browser DOM APIs.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nvar BrowserDomAdapter = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(BrowserDomAdapter, _super);\n function BrowserDomAdapter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} templateHtml\n * @return {?}\n */\n BrowserDomAdapter.prototype.parse = /**\n * @param {?} templateHtml\n * @return {?}\n */\n function (templateHtml) { throw new Error('parse not implemented'); };\n /**\n * @return {?}\n */\n BrowserDomAdapter.makeCurrent = /**\n * @return {?}\n */\n function () { setRootDomAdapter(new BrowserDomAdapter()); };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasProperty = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) { return name in element; };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setProperty = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (el, name, value) { (/** @type {?} */ (el))[name] = value; };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getProperty = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { return (/** @type {?} */ (el))[name]; };\n /**\n * @param {?} el\n * @param {?} methodName\n * @param {?} args\n * @return {?}\n */\n BrowserDomAdapter.prototype.invoke = /**\n * @param {?} el\n * @param {?} methodName\n * @param {?} args\n * @return {?}\n */\n function (el, methodName, args) {\n (_a = (/** @type {?} */ (el)))[methodName].apply(_a, args);\n var _a;\n };\n // TODO(tbosch): move this into a separate environment class once we have it\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.logError = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n if (console.error) {\n console.error(error);\n }\n else {\n console.log(error);\n }\n }\n };\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.log = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n window.console.log && window.console.log(error);\n }\n };\n /**\n * @param {?} error\n * @return {?}\n */\n BrowserDomAdapter.prototype.logGroup = /**\n * @param {?} error\n * @return {?}\n */\n function (error) {\n if (window.console) {\n window.console.group && window.console.group(error);\n }\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.logGroupEnd = /**\n * @return {?}\n */\n function () {\n if (window.console) {\n window.console.groupEnd && window.console.groupEnd();\n }\n };\n Object.defineProperty(BrowserDomAdapter.prototype, \"attrToPropMap\", {\n get: /**\n * @return {?}\n */\n function () { return _attrToPropMap; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} nodeA\n * @param {?} nodeB\n * @return {?}\n */\n BrowserDomAdapter.prototype.contains = /**\n * @param {?} nodeA\n * @param {?} nodeB\n * @return {?}\n */\n function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };\n /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.querySelector = /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n function (el, selector) { return el.querySelector(selector); };\n /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.querySelectorAll = /**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\n function (el, selector) { return el.querySelectorAll(selector); };\n /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n BrowserDomAdapter.prototype.on = /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n function (el, evt, listener) { el.addEventListener(evt, listener, false); };\n /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n BrowserDomAdapter.prototype.onAndCancel = /**\n * @param {?} el\n * @param {?} evt\n * @param {?} listener\n * @return {?}\n */\n function (el, evt, listener) {\n el.addEventListener(evt, listener, false);\n // Needed to follow Dart's subscription semantic, until fix of\n // https://code.google.com/p/dart/issues/detail?id=17406\n return function () { el.removeEventListener(evt, listener, false); };\n };\n /**\n * @param {?} el\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.dispatchEvent = /**\n * @param {?} el\n * @param {?} evt\n * @return {?}\n */\n function (el, evt) { el.dispatchEvent(evt); };\n /**\n * @param {?} eventType\n * @return {?}\n */\n BrowserDomAdapter.prototype.createMouseEvent = /**\n * @param {?} eventType\n * @return {?}\n */\n function (eventType) {\n var /** @type {?} */ evt = this.getDefaultDocument().createEvent('MouseEvent');\n evt.initEvent(eventType, true, true);\n return evt;\n };\n /**\n * @param {?} eventType\n * @return {?}\n */\n BrowserDomAdapter.prototype.createEvent = /**\n * @param {?} eventType\n * @return {?}\n */\n function (eventType) {\n var /** @type {?} */ evt = this.getDefaultDocument().createEvent('Event');\n evt.initEvent(eventType, true, true);\n return evt;\n };\n /**\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.preventDefault = /**\n * @param {?} evt\n * @return {?}\n */\n function (evt) {\n evt.preventDefault();\n evt.returnValue = false;\n };\n /**\n * @param {?} evt\n * @return {?}\n */\n BrowserDomAdapter.prototype.isPrevented = /**\n * @param {?} evt\n * @return {?}\n */\n function (evt) {\n return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getInnerHTML = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.innerHTML; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getTemplateContent = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n return 'content' in el && this.isTemplateElement(el) ? (/** @type {?} */ (el)).content : null;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getOuterHTML = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.outerHTML; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.nodeName = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeName; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.nodeValue = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeValue; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.type = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.type; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.content = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (this.hasProperty(node, 'content')) {\n return (/** @type {?} */ (node)).content;\n }\n else {\n return node;\n }\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.firstChild = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.firstChild; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.nextSibling = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.nextSibling; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.parentElement = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.parentNode; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.childNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.childNodes; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.childNodesAsList = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n var /** @type {?} */ childNodes = el.childNodes;\n var /** @type {?} */ res = new Array(childNodes.length);\n for (var /** @type {?} */ i = 0; i < childNodes.length; i++) {\n res[i] = childNodes[i];\n }\n return res;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.clearNodes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n };\n /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.appendChild = /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n function (el, node) { el.appendChild(node); };\n /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeChild = /**\n * @param {?} el\n * @param {?} node\n * @return {?}\n */\n function (el, node) { el.removeChild(node); };\n /**\n * @param {?} el\n * @param {?} newChild\n * @param {?} oldChild\n * @return {?}\n */\n BrowserDomAdapter.prototype.replaceChild = /**\n * @param {?} el\n * @param {?} newChild\n * @param {?} oldChild\n * @return {?}\n */\n function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.remove = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n return node;\n };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n function (parent, ref, node) { parent.insertBefore(node, ref); };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} nodes\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertAllBefore = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} nodes\n * @return {?}\n */\n function (parent, ref, nodes) {\n nodes.forEach(function (n) { return parent.insertBefore(n, ref); });\n };\n /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.insertAfter = /**\n * @param {?} parent\n * @param {?} ref\n * @param {?} node\n * @return {?}\n */\n function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setInnerHTML = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.innerHTML = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getText = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.textContent; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setText = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.textContent = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getValue = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.value; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setValue = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.value = value; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getChecked = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return el.checked; };\n /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setChecked = /**\n * @param {?} el\n * @param {?} value\n * @return {?}\n */\n function (el, value) { el.checked = value; };\n /**\n * @param {?} text\n * @return {?}\n */\n BrowserDomAdapter.prototype.createComment = /**\n * @param {?} text\n * @return {?}\n */\n function (text) { return this.getDefaultDocument().createComment(text); };\n /**\n * @param {?} html\n * @return {?}\n */\n BrowserDomAdapter.prototype.createTemplate = /**\n * @param {?} html\n * @return {?}\n */\n function (html) {\n var /** @type {?} */ t = this.getDefaultDocument().createElement('template');\n t.innerHTML = html;\n return t;\n };\n /**\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createElement = /**\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n function (tagName, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createElement(tagName);\n };\n /**\n * @param {?} ns\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createElementNS = /**\n * @param {?} ns\n * @param {?} tagName\n * @param {?=} doc\n * @return {?}\n */\n function (ns, tagName, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createElementNS(ns, tagName);\n };\n /**\n * @param {?} text\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createTextNode = /**\n * @param {?} text\n * @param {?=} doc\n * @return {?}\n */\n function (text, doc) {\n doc = doc || this.getDefaultDocument();\n return doc.createTextNode(text);\n };\n /**\n * @param {?} attrName\n * @param {?} attrValue\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createScriptTag = /**\n * @param {?} attrName\n * @param {?} attrValue\n * @param {?=} doc\n * @return {?}\n */\n function (attrName, attrValue, doc) {\n doc = doc || this.getDefaultDocument();\n var /** @type {?} */ el = /** @type {?} */ (doc.createElement('SCRIPT'));\n el.setAttribute(attrName, attrValue);\n return el;\n };\n /**\n * @param {?} css\n * @param {?=} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.createStyleElement = /**\n * @param {?} css\n * @param {?=} doc\n * @return {?}\n */\n function (css, doc) {\n doc = doc || this.getDefaultDocument();\n var /** @type {?} */ style = /** @type {?} */ (doc.createElement('style'));\n this.appendChild(style, this.createTextNode(css, doc));\n return style;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.createShadowRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).createShadowRoot(); };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getShadowRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).shadowRoot; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHost = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return (/** @type {?} */ (el)).host; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.clone = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.cloneNode(true); };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getElementsByClassName = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return element.getElementsByClassName(name);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getElementsByTagName = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return element.getElementsByTagName(name);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.classList = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return Array.prototype.slice.call(element.classList, 0); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.addClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) { element.classList.add(className); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) { element.classList.remove(className); };\n /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasClass = /**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\n function (element, className) {\n return element.classList.contains(className);\n };\n /**\n * @param {?} element\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\n BrowserDomAdapter.prototype.setStyle = /**\n * @param {?} element\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\n function (element, styleName, styleValue) {\n element.style[styleName] = styleValue;\n };\n /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeStyle = /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n function (element, stylename) {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n element.style[stylename] = '';\n };\n /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n BrowserDomAdapter.prototype.getStyle = /**\n * @param {?} element\n * @param {?} stylename\n * @return {?}\n */\n function (element, stylename) { return element.style[stylename]; };\n /**\n * @param {?} element\n * @param {?} styleName\n * @param {?=} styleValue\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasStyle = /**\n * @param {?} element\n * @param {?} styleName\n * @param {?=} styleValue\n * @return {?}\n */\n function (element, styleName, styleValue) {\n var /** @type {?} */ value = this.getStyle(element, styleName) || '';\n return styleValue ? value == styleValue : value.length > 0;\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.tagName = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return element.tagName; };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.attributeMap = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var /** @type {?} */ res = new Map();\n var /** @type {?} */ elAttrs = element.attributes;\n for (var /** @type {?} */ i = 0; i < elAttrs.length; i++) {\n var /** @type {?} */ attrib = elAttrs.item(i);\n res.set(attrib.name, attrib.value);\n }\n return res;\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) {\n return element.hasAttribute(attribute);\n };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} attribute\n * @return {?}\n */\n function (element, ns, attribute) {\n return element.hasAttributeNS(ns, attribute);\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.getAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) {\n return element.getAttribute(attribute);\n };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n function (element, ns, name) {\n return element.getAttributeNS(ns, name);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setAttribute = /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, name, value) { element.setAttribute(name, value); };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, ns, name, value) {\n element.setAttributeNS(ns, name, value);\n };\n /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeAttribute = /**\n * @param {?} element\n * @param {?} attribute\n * @return {?}\n */\n function (element, attribute) { element.removeAttribute(attribute); };\n /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.removeAttributeNS = /**\n * @param {?} element\n * @param {?} ns\n * @param {?} name\n * @return {?}\n */\n function (element, ns, name) {\n element.removeAttributeNS(ns, name);\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.templateAwareRoot = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.createHtmlDocument = /**\n * @return {?}\n */\n function () {\n return document.implementation.createHTMLDocument('fakeTitle');\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getDefaultDocument = /**\n * @return {?}\n */\n function () { return document; };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getBoundingClientRect = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n try {\n return el.getBoundingClientRect();\n }\n catch (/** @type {?} */ e) {\n return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };\n }\n };\n /**\n * @param {?} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.getTitle = /**\n * @param {?} doc\n * @return {?}\n */\n function (doc) { return doc.title; };\n /**\n * @param {?} doc\n * @param {?} newTitle\n * @return {?}\n */\n BrowserDomAdapter.prototype.setTitle = /**\n * @param {?} doc\n * @param {?} newTitle\n * @return {?}\n */\n function (doc, newTitle) { doc.title = newTitle || ''; };\n /**\n * @param {?} n\n * @param {?} selector\n * @return {?}\n */\n BrowserDomAdapter.prototype.elementMatches = /**\n * @param {?} n\n * @param {?} selector\n * @return {?}\n */\n function (n, selector) {\n if (this.isElementNode(n)) {\n return n.matches && n.matches(selector) ||\n n.msMatchesSelector && n.msMatchesSelector(selector) ||\n n.webkitMatchesSelector && n.webkitMatchesSelector(selector);\n }\n return false;\n };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.isTemplateElement = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n return this.isElementNode(el) && el.nodeName === 'TEMPLATE';\n };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isTextNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.TEXT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isCommentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.COMMENT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isElementNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nodeType === Node.ELEMENT_NODE; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.hasShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n return node.shadowRoot != null && node instanceof HTMLElement;\n };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.isShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node instanceof DocumentFragment; };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.importIntoDoc = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return document.importNode(this.templateAwareRoot(node), true); };\n /**\n * @param {?} node\n * @return {?}\n */\n BrowserDomAdapter.prototype.adoptNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return document.adoptNode(node); };\n /**\n * @param {?} el\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHref = /**\n * @param {?} el\n * @return {?}\n */\n function (el) { return /** @type {?} */ ((el.getAttribute('href'))); };\n /**\n * @param {?} event\n * @return {?}\n */\n BrowserDomAdapter.prototype.getEventKey = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n var /** @type {?} */ key = event.key;\n if (key == null) {\n key = event.keyIdentifier;\n // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and\n // Safari cf\n // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces\n if (key == null) {\n return 'Unidentified';\n }\n if (key.startsWith('U+')) {\n key = String.fromCharCode(parseInt(key.substring(2), 16));\n if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {\n // There is a bug in Chrome for numeric keypad keys:\n // https://code.google.com/p/chromium/issues/detail?id=155654\n // 1, 2, 3 ... are reported as A, B, C ...\n key = (/** @type {?} */ (_chromeNumKeyPadMap))[key];\n }\n }\n }\n return _keyMap[key] || key;\n };\n /**\n * @param {?} doc\n * @param {?} target\n * @return {?}\n */\n BrowserDomAdapter.prototype.getGlobalEventTarget = /**\n * @param {?} doc\n * @param {?} target\n * @return {?}\n */\n function (doc, target) {\n if (target === 'window') {\n return window;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getHistory = /**\n * @return {?}\n */\n function () { return window.history; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getLocation = /**\n * @return {?}\n */\n function () { return window.location; };\n /**\n * @param {?} doc\n * @return {?}\n */\n BrowserDomAdapter.prototype.getBaseHref = /**\n * @param {?} doc\n * @return {?}\n */\n function (doc) {\n var /** @type {?} */ href = getBaseElementHref();\n return href == null ? null : relativePath(href);\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.resetBaseElement = /**\n * @return {?}\n */\n function () { baseElement = null; };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.getUserAgent = /**\n * @return {?}\n */\n function () { return window.navigator.userAgent; };\n /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setData = /**\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (element, name, value) {\n this.setAttribute(element, 'data-' + name, value);\n };\n /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getData = /**\n * @param {?} element\n * @param {?} name\n * @return {?}\n */\n function (element, name) {\n return this.getAttribute(element, 'data-' + name);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n BrowserDomAdapter.prototype.getComputedStyle = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { return getComputedStyle(element); };\n // TODO(tbosch): move this into a separate environment class once we have it\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.supportsWebAnimation = /**\n * @return {?}\n */\n function () {\n return typeof (/** @type {?} */ (Element)).prototype['animate'] === 'function';\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.performanceNow = /**\n * @return {?}\n */\n function () {\n // performance.now() is not available in all browsers, see\n // http://caniuse.com/#search=performance.now\n return window.performance && window.performance.now ? window.performance.now() :\n new Date().getTime();\n };\n /**\n * @return {?}\n */\n BrowserDomAdapter.prototype.supportsCookies = /**\n * @return {?}\n */\n function () { return true; };\n /**\n * @param {?} name\n * @return {?}\n */\n BrowserDomAdapter.prototype.getCookie = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { return Object(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"ɵparseCookieValue\"])(document.cookie, name); };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n BrowserDomAdapter.prototype.setCookie = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does\n // not clear other cookies.\n document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n };\n return BrowserDomAdapter;\n}(GenericBrowserDomAdapter));\nvar baseElement = null;\n/**\n * @return {?}\n */\nfunction getBaseElementHref() {\n if (!baseElement) {\n baseElement = /** @type {?} */ ((document.querySelector('base')));\n if (!baseElement) {\n return null;\n }\n }\n return baseElement.getAttribute('href');\n}\n// based on urlUtils.js in AngularJS 1\nvar urlParsingNode;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction relativePath(url) {\n if (!urlParsingNode) {\n urlParsingNode = document.createElement('a');\n }\n urlParsingNode.setAttribute('href', url);\n return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :\n '/' + urlParsingNode.pathname;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application into a Web Worker).\n *\n * @deprecated import from `\\@angular/common` instead.\n */\nvar DOCUMENT$1 = __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"DOCUMENT\"];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction supportsState() {\n return !!window.history.pushState;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n */\nvar BrowserPlatformLocation = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(BrowserPlatformLocation, _super);\n function BrowserPlatformLocation(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n _this._init();\n return _this;\n }\n // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n BrowserPlatformLocation.prototype._init = /**\n * \\@internal\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.getBaseHrefFromDOM = /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((getDOM().getBaseHref(this._doc))); };\n /**\n * @param {?} fn\n * @return {?}\n */\n BrowserPlatformLocation.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n BrowserPlatformLocation.prototype.onHashChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);\n };\n Object.defineProperty(BrowserPlatformLocation.prototype, \"pathname\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.pathname; },\n set: /**\n * @param {?} newPath\n * @return {?}\n */\n function (newPath) { this.location.pathname = newPath; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserPlatformLocation.prototype, \"search\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.search; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserPlatformLocation.prototype, \"hash\", {\n get: /**\n * @return {?}\n */\n function () { return this.location.hash; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n BrowserPlatformLocation.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n function (state, title, url) {\n if (supportsState()) {\n this._history.pushState(state, title, url);\n }\n else {\n this.location.hash = url;\n }\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n BrowserPlatformLocation.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @return {?}\n */\n function (state, title, url) {\n if (supportsState()) {\n this._history.replaceState(state, title, url);\n }\n else {\n this.location.hash = url;\n }\n };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.forward = /**\n * @return {?}\n */\n function () { this._history.forward(); };\n /**\n * @return {?}\n */\n BrowserPlatformLocation.prototype.back = /**\n * @return {?}\n */\n function () { this._history.back(); };\n BrowserPlatformLocation.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n BrowserPlatformLocation.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return BrowserPlatformLocation;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A service that can be used to get and add meta tags.\n *\n * \\@experimental\n */\nvar Meta = /** @class */ (function () {\n function Meta(_doc) {\n this._doc = _doc;\n this._dom = getDOM();\n }\n /**\n * @param {?} tag\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype.addTag = /**\n * @param {?} tag\n * @param {?=} forceCreation\n * @return {?}\n */\n function (tag, forceCreation) {\n if (forceCreation === void 0) { forceCreation = false; }\n if (!tag)\n return null;\n return this._getOrCreateElement(tag, forceCreation);\n };\n /**\n * @param {?} tags\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype.addTags = /**\n * @param {?} tags\n * @param {?=} forceCreation\n * @return {?}\n */\n function (tags, forceCreation) {\n var _this = this;\n if (forceCreation === void 0) { forceCreation = false; }\n if (!tags)\n return [];\n return tags.reduce(function (result, tag) {\n if (tag) {\n result.push(_this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.getTag = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) {\n if (!attrSelector)\n return null;\n return this._dom.querySelector(this._doc, \"meta[\" + attrSelector + \"]\") || null;\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.getTags = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) {\n if (!attrSelector)\n return [];\n var /** @type {?} */ list = this._dom.querySelectorAll(this._doc, \"meta[\" + attrSelector + \"]\");\n return list ? [].slice.call(list) : [];\n };\n /**\n * @param {?} tag\n * @param {?=} selector\n * @return {?}\n */\n Meta.prototype.updateTag = /**\n * @param {?} tag\n * @param {?=} selector\n * @return {?}\n */\n function (tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n var /** @type {?} */ meta = /** @type {?} */ ((this.getTag(selector)));\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n };\n /**\n * @param {?} attrSelector\n * @return {?}\n */\n Meta.prototype.removeTag = /**\n * @param {?} attrSelector\n * @return {?}\n */\n function (attrSelector) { this.removeTagElement(/** @type {?} */ ((this.getTag(attrSelector)))); };\n /**\n * @param {?} meta\n * @return {?}\n */\n Meta.prototype.removeTagElement = /**\n * @param {?} meta\n * @return {?}\n */\n function (meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n };\n /**\n * @param {?} meta\n * @param {?=} forceCreation\n * @return {?}\n */\n Meta.prototype._getOrCreateElement = /**\n * @param {?} meta\n * @param {?=} forceCreation\n * @return {?}\n */\n function (meta, forceCreation) {\n if (forceCreation === void 0) { forceCreation = false; }\n if (!forceCreation) {\n var /** @type {?} */ selector = this._parseSelector(meta);\n var /** @type {?} */ elem = /** @type {?} */ ((this.getTag(selector)));\n // It's allowed to have multiple elements with the same name so it's not enough to\n // just check that element with the same name already present on the page. We also need to\n // check if element has tag attributes\n if (elem && this._containsAttributes(meta, elem))\n return elem;\n }\n var /** @type {?} */ element = /** @type {?} */ (this._dom.createElement('meta'));\n this._setMetaElementAttributes(meta, element);\n var /** @type {?} */ head = this._dom.getElementsByTagName(this._doc, 'head')[0];\n this._dom.appendChild(head, element);\n return element;\n };\n /**\n * @param {?} tag\n * @param {?} el\n * @return {?}\n */\n Meta.prototype._setMetaElementAttributes = /**\n * @param {?} tag\n * @param {?} el\n * @return {?}\n */\n function (tag, el) {\n var _this = this;\n Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });\n return el;\n };\n /**\n * @param {?} tag\n * @return {?}\n */\n Meta.prototype._parseSelector = /**\n * @param {?} tag\n * @return {?}\n */\n function (tag) {\n var /** @type {?} */ attr = tag.name ? 'name' : 'property';\n return attr + \"=\\\"\" + tag[attr] + \"\\\"\";\n };\n /**\n * @param {?} tag\n * @param {?} elem\n * @return {?}\n */\n Meta.prototype._containsAttributes = /**\n * @param {?} tag\n * @param {?} elem\n * @return {?}\n */\n function (tag, elem) {\n var _this = this;\n return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });\n };\n Meta.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Meta.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return Meta;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An id that identifies a particular application being bootstrapped, that should\n * match across the client/server boundary.\n */\nvar TRANSITION_ID = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('TRANSITION_ID');\n/**\n * @param {?} transitionId\n * @param {?} document\n * @param {?} injector\n * @return {?}\n */\nfunction appInitializerFactory(transitionId, document, injector) {\n return function () {\n // Wait for all application initializers to be completed before removing the styles set by\n // the server.\n injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationInitStatus\"]).donePromise.then(function () {\n var /** @type {?} */ dom = getDOM();\n var /** @type {?} */ styles = Array.prototype.slice.apply(dom.querySelectorAll(document, \"style[ng-transition]\"));\n styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })\n .forEach(function (el) { return dom.remove(el); });\n });\n };\n}\nvar SERVER_TRANSITION_PROVIDERS = [\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n useFactory: appInitializerFactory,\n deps: [TRANSITION_ID, DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"]],\n multi: true\n },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar BrowserGetTestability = /** @class */ (function () {\n function BrowserGetTestability() {\n }\n /**\n * @return {?}\n */\n BrowserGetTestability.init = /**\n * @return {?}\n */\n function () { Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"setTestabilityGetter\"])(new BrowserGetTestability()); };\n /**\n * @param {?} registry\n * @return {?}\n */\n BrowserGetTestability.prototype.addToWindow = /**\n * @param {?} registry\n * @return {?}\n */\n function (registry) {\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAngularTestability'] = function (elem, findInAncestors) {\n if (findInAncestors === void 0) { findInAncestors = true; }\n var /** @type {?} */ testability = registry.findTestabilityInTree(elem, findInAncestors);\n if (testability == null) {\n throw new Error('Could not find testability for element.');\n }\n return testability;\n };\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };\n var /** @type {?} */ whenAllStable = function (callback /** TODO #9100 */) {\n var /** @type {?} */ testabilities = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['getAllAngularTestabilities']();\n var /** @type {?} */ count = testabilities.length;\n var /** @type {?} */ didWork = false;\n var /** @type {?} */ decrement = function (didWork_ /** TODO #9100 */) {\n didWork = didWork || didWork_;\n count--;\n if (count == 0) {\n callback(didWork);\n }\n };\n testabilities.forEach(function (testability /** TODO #9100 */) {\n testability.whenStable(decrement);\n });\n };\n if (!__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers']) {\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers'] = [];\n }\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['frameworkStabilizers'].push(whenAllStable);\n };\n /**\n * @param {?} registry\n * @param {?} elem\n * @param {?} findInAncestors\n * @return {?}\n */\n BrowserGetTestability.prototype.findTestabilityInTree = /**\n * @param {?} registry\n * @param {?} elem\n * @param {?} findInAncestors\n * @return {?}\n */\n function (registry, elem, findInAncestors) {\n if (elem == null) {\n return null;\n }\n var /** @type {?} */ t = registry.getTestability(elem);\n if (t != null) {\n return t;\n }\n else if (!findInAncestors) {\n return null;\n }\n if (getDOM().isShadowRoot(elem)) {\n return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);\n }\n return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);\n };\n return BrowserGetTestability;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A service that can be used to get and set the title of a current HTML document.\n *\n * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)\n * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements\n * (representing the `<title>` tag). Instead, this service can be used to set and get the current\n * title value.\n *\n * \\@experimental\n */\nvar Title = /** @class */ (function () {\n function Title(_doc) {\n this._doc = _doc;\n }\n /**\n * Get the title of the current HTML document.\n */\n /**\n * Get the title of the current HTML document.\n * @return {?}\n */\n Title.prototype.getTitle = /**\n * Get the title of the current HTML document.\n * @return {?}\n */\n function () { return getDOM().getTitle(this._doc); };\n /**\n * Set the title of the current HTML document.\n * @param newTitle\n */\n /**\n * Set the title of the current HTML document.\n * @param {?} newTitle\n * @return {?}\n */\n Title.prototype.setTitle = /**\n * Set the title of the current HTML document.\n * @param {?} newTitle\n * @return {?}\n */\n function (newTitle) { getDOM().setTitle(this._doc, newTitle); };\n Title.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Title.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return Title;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} input\n * @return {?}\n */\n\n/**\n * @param {?} input\n * @return {?}\n */\n\n/**\n * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if\n * `name` is `'probe'`.\n * @param {?} name Name under which it will be exported. Keep in mind this will be a property of the\n * global `ng` object.\n * @param {?} value The value to export.\n * @return {?}\n */\nfunction exportNgVar(name, value) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for angularJS (via `goog.provide('ng....')`).\n var /** @type {?} */ ng = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['ng'] = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"]['ng'])) || {};\n ng[name] = value;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CORE_TOKENS = {\n 'ApplicationRef': __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"],\n 'NgZone': __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"],\n};\nvar INSPECT_GLOBAL_NAME = 'probe';\nvar CORE_TOKENS_GLOBAL_NAME = 'coreTokens';\n/**\n * Returns a {\\@link DebugElement} for the given native DOM element, or\n * null if the given native element does not have an Angular view associated\n * with it.\n * @param {?} element\n * @return {?}\n */\nfunction inspectNativeElement(element) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"getDebugNode\"])(element);\n}\n/**\n * @param {?} coreTokens\n * @return {?}\n */\nfunction _createNgProbe(coreTokens) {\n exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);\n exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));\n return function () { return inspectNativeElement; };\n}\n/**\n * @param {?} tokens\n * @return {?}\n */\nfunction _ngProbeTokensToMap(tokens) {\n return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});\n}\n/**\n * Providers which support debugging Angular applications (e.g. via `ng.probe`).\n */\nvar ELEMENT_PROBE_PROVIDERS = [\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n useFactory: _createNgProbe,\n deps: [\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"], new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()],\n ],\n multi: true,\n },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar EVENT_MANAGER_PLUGINS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('EventManagerPlugins');\n/**\n * \\@stable\n */\nvar EventManager = /** @class */ (function () {\n function EventManager(plugins, _zone) {\n var _this = this;\n this._zone = _zone;\n this._eventNameToPlugin = new Map();\n plugins.forEach(function (p) { return p.manager = _this; });\n this._plugins = plugins.slice().reverse();\n }\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManager.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ plugin = this._findPluginFor(eventName);\n return plugin.addEventListener(element, eventName, handler);\n };\n /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManager.prototype.addGlobalEventListener = /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (target, eventName, handler) {\n var /** @type {?} */ plugin = this._findPluginFor(eventName);\n return plugin.addGlobalEventListener(target, eventName, handler);\n };\n /**\n * @return {?}\n */\n EventManager.prototype.getZone = /**\n * @return {?}\n */\n function () { return this._zone; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} eventName\n * @return {?}\n */\n EventManager.prototype._findPluginFor = /**\n * \\@internal\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n var /** @type {?} */ plugin = this._eventNameToPlugin.get(eventName);\n if (plugin) {\n return plugin;\n }\n var /** @type {?} */ plugins = this._plugins;\n for (var /** @type {?} */ i = 0; i < plugins.length; i++) {\n var /** @type {?} */ plugin_1 = plugins[i];\n if (plugin_1.supports(eventName)) {\n this._eventNameToPlugin.set(eventName, plugin_1);\n return plugin_1;\n }\n }\n throw new Error(\"No event manager plugin found for event \" + eventName);\n };\n EventManager.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n EventManager.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [EVENT_MANAGER_PLUGINS,] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"], },\n ]; };\n return EventManager;\n}());\n/**\n * @abstract\n */\nvar EventManagerPlugin = /** @class */ (function () {\n function EventManagerPlugin(_doc) {\n this._doc = _doc;\n }\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n EventManagerPlugin.prototype.addGlobalEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ target = getDOM().getGlobalEventTarget(this._doc, element);\n if (!target) {\n throw new Error(\"Unsupported event target \" + target + \" for event \" + eventName);\n }\n return this.addEventListener(target, eventName, handler);\n };\n return EventManagerPlugin;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SharedStylesHost = /** @class */ (function () {\n function SharedStylesHost() {\n /**\n * \\@internal\n */\n this._stylesSet = new Set();\n }\n /**\n * @param {?} styles\n * @return {?}\n */\n SharedStylesHost.prototype.addStyles = /**\n * @param {?} styles\n * @return {?}\n */\n function (styles) {\n var _this = this;\n var /** @type {?} */ additions = new Set();\n styles.forEach(function (style) {\n if (!_this._stylesSet.has(style)) {\n _this._stylesSet.add(style);\n additions.add(style);\n }\n });\n this.onStylesAdded(additions);\n };\n /**\n * @param {?} additions\n * @return {?}\n */\n SharedStylesHost.prototype.onStylesAdded = /**\n * @param {?} additions\n * @return {?}\n */\n function (additions) { };\n /**\n * @return {?}\n */\n SharedStylesHost.prototype.getAllStyles = /**\n * @return {?}\n */\n function () { return Array.from(this._stylesSet); };\n SharedStylesHost.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n SharedStylesHost.ctorParameters = function () { return []; };\n return SharedStylesHost;\n}());\nvar DomSharedStylesHost = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomSharedStylesHost, _super);\n function DomSharedStylesHost(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n _this._hostNodes = new Set();\n _this._styleNodes = new Set();\n _this._hostNodes.add(_doc.head);\n return _this;\n }\n /**\n * @param {?} styles\n * @param {?} host\n * @return {?}\n */\n DomSharedStylesHost.prototype._addStylesToHost = /**\n * @param {?} styles\n * @param {?} host\n * @return {?}\n */\n function (styles, host) {\n var _this = this;\n styles.forEach(function (style) {\n var /** @type {?} */ styleEl = _this._doc.createElement('style');\n styleEl.textContent = style;\n _this._styleNodes.add(host.appendChild(styleEl));\n });\n };\n /**\n * @param {?} hostNode\n * @return {?}\n */\n DomSharedStylesHost.prototype.addHost = /**\n * @param {?} hostNode\n * @return {?}\n */\n function (hostNode) {\n this._addStylesToHost(this._stylesSet, hostNode);\n this._hostNodes.add(hostNode);\n };\n /**\n * @param {?} hostNode\n * @return {?}\n */\n DomSharedStylesHost.prototype.removeHost = /**\n * @param {?} hostNode\n * @return {?}\n */\n function (hostNode) { this._hostNodes.delete(hostNode); };\n /**\n * @param {?} additions\n * @return {?}\n */\n DomSharedStylesHost.prototype.onStylesAdded = /**\n * @param {?} additions\n * @return {?}\n */\n function (additions) {\n var _this = this;\n this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });\n };\n /**\n * @return {?}\n */\n DomSharedStylesHost.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };\n DomSharedStylesHost.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomSharedStylesHost.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return DomSharedStylesHost;\n}(SharedStylesHost));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NAMESPACE_URIS = {\n 'svg': 'http://www.w3.org/2000/svg',\n 'xhtml': 'http://www.w3.org/1999/xhtml',\n 'xlink': 'http://www.w3.org/1999/xlink',\n 'xml': 'http://www.w3.org/XML/1998/namespace',\n 'xmlns': 'http://www.w3.org/2000/xmlns/',\n};\nvar COMPONENT_REGEX = /%COMP%/g;\nvar COMPONENT_VARIABLE = '%COMP%';\nvar HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\nvar CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimContentAttribute(componentShortId) {\n return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimHostAttribute(componentShortId) {\n return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} compId\n * @param {?} styles\n * @param {?} target\n * @return {?}\n */\nfunction flattenStyles(compId, styles, target) {\n for (var /** @type {?} */ i = 0; i < styles.length; i++) {\n var /** @type {?} */ style = styles[i];\n if (Array.isArray(style)) {\n flattenStyles(compId, style, target);\n }\n else {\n style = style.replace(COMPONENT_REGEX, compId);\n target.push(style);\n }\n }\n return target;\n}\n/**\n * @param {?} eventHandler\n * @return {?}\n */\nfunction decoratePreventDefault(eventHandler) {\n return function (event) {\n var /** @type {?} */ allowDefaultBehavior = eventHandler(event);\n if (allowDefaultBehavior === false) {\n // TODO(tbosch): move preventDefault into event plugins...\n event.preventDefault();\n event.returnValue = false;\n }\n };\n}\nvar DomRendererFactory2 = /** @class */ (function () {\n function DomRendererFactory2(eventManager, sharedStylesHost) {\n this.eventManager = eventManager;\n this.sharedStylesHost = sharedStylesHost;\n this.rendererByCompId = new Map();\n this.defaultRenderer = new DefaultDomRenderer2(eventManager);\n }\n /**\n * @param {?} element\n * @param {?} type\n * @return {?}\n */\n DomRendererFactory2.prototype.createRenderer = /**\n * @param {?} element\n * @param {?} type\n * @return {?}\n */\n function (element, type) {\n if (!element || !type) {\n return this.defaultRenderer;\n }\n switch (type.encapsulation) {\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Emulated: {\n var /** @type {?} */ renderer = this.rendererByCompId.get(type.id);\n if (!renderer) {\n renderer =\n new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type);\n this.rendererByCompId.set(type.id, renderer);\n }\n (/** @type {?} */ (renderer)).applyToHost(element);\n return renderer;\n }\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Native:\n return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);\n default: {\n if (!this.rendererByCompId.has(type.id)) {\n var /** @type {?} */ styles = flattenStyles(type.id, type.styles, []);\n this.sharedStylesHost.addStyles(styles);\n this.rendererByCompId.set(type.id, this.defaultRenderer);\n }\n return this.defaultRenderer;\n }\n }\n };\n /**\n * @return {?}\n */\n DomRendererFactory2.prototype.begin = /**\n * @return {?}\n */\n function () { };\n /**\n * @return {?}\n */\n DomRendererFactory2.prototype.end = /**\n * @return {?}\n */\n function () { };\n DomRendererFactory2.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomRendererFactory2.ctorParameters = function () { return [\n { type: EventManager, },\n { type: DomSharedStylesHost, },\n ]; };\n return DomRendererFactory2;\n}());\nvar DefaultDomRenderer2 = /** @class */ (function () {\n function DefaultDomRenderer2(eventManager) {\n this.eventManager = eventManager;\n this.data = Object.create(null);\n }\n /**\n * @return {?}\n */\n DefaultDomRenderer2.prototype.destroy = /**\n * @return {?}\n */\n function () { };\n /**\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createElement = /**\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n function (name, namespace) {\n if (namespace) {\n return document.createElementNS(NAMESPACE_URIS[namespace], name);\n }\n return document.createElement(name);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createComment = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return document.createComment(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.createText = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return document.createTextNode(value); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.appendChild = /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n function (parent, newChild) { parent.appendChild(newChild); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n function (parent, newChild, refChild) {\n if (parent) {\n parent.insertBefore(newChild, refChild);\n }\n };\n /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeChild = /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n function (parent, oldChild) {\n if (parent) {\n parent.removeChild(oldChild);\n }\n };\n /**\n * @param {?} selectorOrNode\n * @return {?}\n */\n DefaultDomRenderer2.prototype.selectRootElement = /**\n * @param {?} selectorOrNode\n * @return {?}\n */\n function (selectorOrNode) {\n var /** @type {?} */ el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :\n selectorOrNode;\n if (!el) {\n throw new Error(\"The selector \\\"\" + selectorOrNode + \"\\\" did not match any elements\");\n }\n el.textContent = '';\n return el;\n };\n /**\n * @param {?} node\n * @return {?}\n */\n DefaultDomRenderer2.prototype.parentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.parentNode; };\n /**\n * @param {?} node\n * @return {?}\n */\n DefaultDomRenderer2.prototype.nextSibling = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node.nextSibling; };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setAttribute = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\n function (el, name, value, namespace) {\n if (namespace) {\n name = namespace + \":\" + name;\n var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.setAttributeNS(namespaceUri, name, value);\n }\n else {\n el.setAttribute(name, value);\n }\n }\n else {\n el.setAttribute(name, value);\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeAttribute = /**\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\n function (el, name, namespace) {\n if (namespace) {\n var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.removeAttributeNS(namespaceUri, name);\n }\n else {\n el.removeAttribute(namespace + \":\" + name);\n }\n }\n else {\n el.removeAttribute(name);\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n DefaultDomRenderer2.prototype.addClass = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { el.classList.add(name); };\n /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeClass = /**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\n function (el, name) { el.classList.remove(name); };\n /**\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?} flags\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setStyle = /**\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?} flags\n * @return {?}\n */\n function (el, style, value, flags) {\n if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].DashCase) {\n el.style.setProperty(style, value, !!(flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].Important) ? 'important' : '');\n }\n else {\n el.style[style] = value;\n }\n };\n /**\n * @param {?} el\n * @param {?} style\n * @param {?} flags\n * @return {?}\n */\n DefaultDomRenderer2.prototype.removeStyle = /**\n * @param {?} el\n * @param {?} style\n * @param {?} flags\n * @return {?}\n */\n function (el, style, flags) {\n if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererStyleFlags2\"].DashCase) {\n el.style.removeProperty(style);\n }\n else {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n el.style[style] = '';\n }\n };\n /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setProperty = /**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (el, name, value) {\n checkNoSyntheticProp(name, 'property');\n el[name] = value;\n };\n /**\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\n DefaultDomRenderer2.prototype.setValue = /**\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\n function (node, value) { node.nodeValue = value; };\n /**\n * @param {?} target\n * @param {?} event\n * @param {?} callback\n * @return {?}\n */\n DefaultDomRenderer2.prototype.listen = /**\n * @param {?} target\n * @param {?} event\n * @param {?} callback\n * @return {?}\n */\n function (target, event, callback) {\n checkNoSyntheticProp(event, 'listener');\n if (typeof target === 'string') {\n return /** @type {?} */ (this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)));\n }\n return /** @type {?} */ ((this.eventManager.addEventListener(target, event, decoratePreventDefault(callback))));\n };\n return DefaultDomRenderer2;\n}());\nvar AT_CHARCODE = '@'.charCodeAt(0);\n/**\n * @param {?} name\n * @param {?} nameKind\n * @return {?}\n */\nfunction checkNoSyntheticProp(name, nameKind) {\n if (name.charCodeAt(0) === AT_CHARCODE) {\n throw new Error(\"Found the synthetic \" + nameKind + \" \" + name + \". Please include either \\\"BrowserAnimationsModule\\\" or \\\"NoopAnimationsModule\\\" in your application.\");\n }\n}\nvar EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(EmulatedEncapsulationDomRenderer2, _super);\n function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component) {\n var _this = _super.call(this, eventManager) || this;\n _this.component = component;\n var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);\n sharedStylesHost.addStyles(styles);\n _this.contentAttr = shimContentAttribute(component.id);\n _this.hostAttr = shimHostAttribute(component.id);\n return _this;\n }\n /**\n * @param {?} element\n * @return {?}\n */\n EmulatedEncapsulationDomRenderer2.prototype.applyToHost = /**\n * @param {?} element\n * @return {?}\n */\n function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };\n /**\n * @param {?} parent\n * @param {?} name\n * @return {?}\n */\n EmulatedEncapsulationDomRenderer2.prototype.createElement = /**\n * @param {?} parent\n * @param {?} name\n * @return {?}\n */\n function (parent, name) {\n var /** @type {?} */ el = _super.prototype.createElement.call(this, parent, name);\n _super.prototype.setAttribute.call(this, el, this.contentAttr, '');\n return el;\n };\n return EmulatedEncapsulationDomRenderer2;\n}(DefaultDomRenderer2));\nvar ShadowDomRenderer = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ShadowDomRenderer, _super);\n function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {\n var _this = _super.call(this, eventManager) || this;\n _this.sharedStylesHost = sharedStylesHost;\n _this.hostEl = hostEl;\n _this.component = component;\n _this.shadowRoot = (/** @type {?} */ (hostEl)).createShadowRoot();\n _this.sharedStylesHost.addHost(_this.shadowRoot);\n var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);\n for (var /** @type {?} */ i = 0; i < styles.length; i++) {\n var /** @type {?} */ styleEl = document.createElement('style');\n styleEl.textContent = styles[i];\n _this.shadowRoot.appendChild(styleEl);\n }\n return _this;\n }\n /**\n * @param {?} node\n * @return {?}\n */\n ShadowDomRenderer.prototype.nodeOrShadowRoot = /**\n * @param {?} node\n * @return {?}\n */\n function (node) { return node === this.hostEl ? this.shadowRoot : node; };\n /**\n * @return {?}\n */\n ShadowDomRenderer.prototype.destroy = /**\n * @return {?}\n */\n function () { this.sharedStylesHost.removeHost(this.shadowRoot); };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.appendChild = /**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\n function (parent, newChild) {\n return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);\n };\n /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.insertBefore = /**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\n function (parent, newChild, refChild) {\n return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);\n };\n /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n ShadowDomRenderer.prototype.removeChild = /**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\n function (parent, oldChild) {\n return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);\n };\n /**\n * @param {?} node\n * @return {?}\n */\n ShadowDomRenderer.prototype.parentNode = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));\n };\n return ShadowDomRenderer;\n}(DefaultDomRenderer2));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ɵ0 = function (v) {\n return '__zone_symbol__' + v;\n};\n/**\n * Detect if Zone is present. If it is then use simple zone aware 'addEventListener'\n * since Angular can do much more\n * efficient bookkeeping than Zone can, because we have additional information. This speeds up\n * addEventListener by 3x.\n */\nvar __symbol__ = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))['__symbol__'] || ɵ0;\nvar ADD_EVENT_LISTENER = __symbol__('addEventListener');\nvar REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');\nvar symbolNames = {};\nvar FALSE = 'FALSE';\nvar ANGULAR = 'ANGULAR';\nvar NATIVE_ADD_LISTENER = 'addEventListener';\nvar NATIVE_REMOVE_LISTENER = 'removeEventListener';\n// use the same symbol string which is used in zone.js\nvar stopSymbol = '__zone_symbol__propagationStopped';\nvar stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';\nvar blackListedEvents = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))[__symbol__('BLACK_LISTED_EVENTS')];\nvar blackListedMap;\nif (blackListedEvents) {\n blackListedMap = {};\n blackListedEvents.forEach(function (eventName) { blackListedMap[eventName] = eventName; });\n}\nvar isBlackListedEvent = function (eventName) {\n if (!blackListedMap) {\n return false;\n }\n return blackListedMap.hasOwnProperty(eventName);\n};\n// a global listener to handle all dom event,\n// so we do not need to create a closure everytime\nvar globalListener = function (event) {\n var /** @type {?} */ symbolName = symbolNames[event.type];\n if (!symbolName) {\n return;\n }\n var /** @type {?} */ taskDatas = this[symbolName];\n if (!taskDatas) {\n return;\n }\n var /** @type {?} */ args = [event];\n if (taskDatas.length === 1) {\n // if taskDatas only have one element, just invoke it\n var /** @type {?} */ taskData = taskDatas[0];\n if (taskData.zone !== Zone.current) {\n // only use Zone.run when Zone.current not equals to stored zone\n return taskData.zone.run(taskData.handler, this, args);\n }\n else {\n return taskData.handler.apply(this, args);\n }\n }\n else {\n // copy tasks as a snapshot to avoid event handlers remove\n // itself or others\n var /** @type {?} */ copiedTasks = taskDatas.slice();\n for (var /** @type {?} */ i = 0; i < copiedTasks.length; i++) {\n // if other listener call event.stopImmediatePropagation\n // just break\n if ((/** @type {?} */ (event))[stopSymbol] === true) {\n break;\n }\n var /** @type {?} */ taskData = copiedTasks[i];\n if (taskData.zone !== Zone.current) {\n // only use Zone.run when Zone.current not equals to stored zone\n taskData.zone.run(taskData.handler, this, args);\n }\n else {\n taskData.handler.apply(this, args);\n }\n }\n }\n};\nvar DomEventsPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomEventsPlugin, _super);\n function DomEventsPlugin(doc, ngZone) {\n var _this = _super.call(this, doc) || this;\n _this.ngZone = ngZone;\n _this.patchEvent();\n return _this;\n }\n /**\n * @return {?}\n */\n DomEventsPlugin.prototype.patchEvent = /**\n * @return {?}\n */\n function () {\n if (!Event || !Event.prototype) {\n return;\n }\n if ((/** @type {?} */ (Event.prototype))[stopMethodSymbol]) {\n // already patched by zone.js\n return;\n }\n var /** @type {?} */ delegate = (/** @type {?} */ (Event.prototype))[stopMethodSymbol] =\n Event.prototype.stopImmediatePropagation;\n Event.prototype.stopImmediatePropagation = function () {\n if (this) {\n this[stopSymbol] = true;\n }\n // should call native delegate in case\n // in some enviroment part of the application\n // will not use the patched Event\n delegate && delegate.apply(this, arguments);\n };\n };\n // This plugin should come last in the list of plugins, because it accepts all\n // events.\n /**\n * @param {?} eventName\n * @return {?}\n */\n DomEventsPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return true; };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n DomEventsPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var _this = this;\n /**\n * This code is about to add a listener to the DOM. If Zone.js is present, than\n * `addEventListener` has been patched. The patched code adds overhead in both\n * memory and speed (3x slower) than native. For this reason if we detect that\n * Zone.js is present we use a simple version of zone aware addEventListener instead.\n * The result is faster registration and the zone will be restored.\n * But ZoneSpec.onScheduleTask, ZoneSpec.onInvokeTask, ZoneSpec.onCancelTask\n * will not be invoked\n * We also do manual zone restoration in element.ts renderEventHandlerClosure method.\n *\n * NOTE: it is possible that the element is from different iframe, and so we\n * have to check before we execute the method.\n */\n var /** @type {?} */ self = this;\n var /** @type {?} */ zoneJsLoaded = element[ADD_EVENT_LISTENER];\n var /** @type {?} */ callback = /** @type {?} */ (handler);\n // if zonejs is loaded and current zone is not ngZone\n // we keep Zone.current on target for later restoration.\n if (zoneJsLoaded && (!__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"].isInAngularZone() || isBlackListedEvent(eventName))) {\n var /** @type {?} */ symbolName = symbolNames[eventName];\n if (!symbolName) {\n symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);\n }\n var /** @type {?} */ taskDatas = (/** @type {?} */ (element))[symbolName];\n var /** @type {?} */ globalListenerRegistered = taskDatas && taskDatas.length > 0;\n if (!taskDatas) {\n taskDatas = (/** @type {?} */ (element))[symbolName] = [];\n }\n var /** @type {?} */ zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;\n if (taskDatas.length === 0) {\n taskDatas.push({ zone: zone, handler: callback });\n }\n else {\n var /** @type {?} */ callbackRegistered = false;\n for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {\n if (taskDatas[i].handler === callback) {\n callbackRegistered = true;\n break;\n }\n }\n if (!callbackRegistered) {\n taskDatas.push({ zone: zone, handler: callback });\n }\n }\n if (!globalListenerRegistered) {\n element[ADD_EVENT_LISTENER](eventName, globalListener, false);\n }\n }\n else {\n element[NATIVE_ADD_LISTENER](eventName, callback, false);\n }\n return function () { return _this.removeEventListener(element, eventName, callback); };\n };\n /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\n DomEventsPlugin.prototype.removeEventListener = /**\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\n function (target, eventName, callback) {\n var /** @type {?} */ underlyingRemove = target[REMOVE_EVENT_LISTENER];\n // zone.js not loaded, use native removeEventListener\n if (!underlyingRemove) {\n return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n var /** @type {?} */ symbolName = symbolNames[eventName];\n var /** @type {?} */ taskDatas = symbolName && target[symbolName];\n if (!taskDatas) {\n // addEventListener not using patched version\n // just call native removeEventListener\n return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n // fix issue 20532, should be able to remove\n // listener which was added inside of ngZone\n var /** @type {?} */ found = false;\n for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {\n // remove listener from taskDatas if the callback equals\n if (taskDatas[i].handler === callback) {\n found = true;\n taskDatas.splice(i, 1);\n break;\n }\n }\n if (found) {\n if (taskDatas.length === 0) {\n // all listeners are removed, we can remove the globalListener from target\n underlyingRemove.apply(target, [eventName, globalListener, false]);\n }\n }\n else {\n // not found in taskDatas, the callback may be added inside of ngZone\n // use native remove listener to remove the calback\n target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);\n }\n };\n DomEventsPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomEventsPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgZone\"], },\n ]; };\n return DomEventsPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar EVENT_NAMES = {\n // pan\n 'pan': true,\n 'panstart': true,\n 'panmove': true,\n 'panend': true,\n 'pancancel': true,\n 'panleft': true,\n 'panright': true,\n 'panup': true,\n 'pandown': true,\n // pinch\n 'pinch': true,\n 'pinchstart': true,\n 'pinchmove': true,\n 'pinchend': true,\n 'pinchcancel': true,\n 'pinchin': true,\n 'pinchout': true,\n // press\n 'press': true,\n 'pressup': true,\n // rotate\n 'rotate': true,\n 'rotatestart': true,\n 'rotatemove': true,\n 'rotateend': true,\n 'rotatecancel': true,\n // swipe\n 'swipe': true,\n 'swipeleft': true,\n 'swiperight': true,\n 'swipeup': true,\n 'swipedown': true,\n // tap\n 'tap': true,\n};\n/**\n * A DI token that you can use to provide{\\@link HammerGestureConfig} to Angular. Use it to configure\n * Hammer gestures.\n *\n * \\@experimental\n */\nvar HAMMER_GESTURE_CONFIG = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('HammerGestureConfig');\n/**\n * @record\n */\n\n/**\n * \\@experimental\n */\nvar HammerGestureConfig = /** @class */ (function () {\n function HammerGestureConfig() {\n this.events = [];\n this.overrides = {};\n }\n /**\n * @param {?} element\n * @return {?}\n */\n HammerGestureConfig.prototype.buildHammer = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var /** @type {?} */ mc = new Hammer(element);\n mc.get('pinch').set({ enable: true });\n mc.get('rotate').set({ enable: true });\n for (var /** @type {?} */ eventName in this.overrides) {\n mc.get(eventName).set(this.overrides[eventName]);\n }\n return mc;\n };\n HammerGestureConfig.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HammerGestureConfig.ctorParameters = function () { return []; };\n return HammerGestureConfig;\n}());\nvar HammerGesturesPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(HammerGesturesPlugin, _super);\n function HammerGesturesPlugin(doc, _config) {\n var _this = _super.call(this, doc) || this;\n _this._config = _config;\n return _this;\n }\n /**\n * @param {?} eventName\n * @return {?}\n */\n HammerGesturesPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {\n return false;\n }\n if (!(/** @type {?} */ (window)).Hammer) {\n throw new Error(\"Hammer.js is not loaded, can not bind \" + eventName + \" event\");\n }\n return true;\n };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n HammerGesturesPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var _this = this;\n var /** @type {?} */ zone = this.manager.getZone();\n eventName = eventName.toLowerCase();\n return zone.runOutsideAngular(function () {\n // Creating the manager bind events, must be done outside of angular\n var /** @type {?} */ mc = _this._config.buildHammer(element);\n var /** @type {?} */ callback = function (eventObj) {\n zone.runGuarded(function () { handler(eventObj); });\n };\n mc.on(eventName, callback);\n return function () { return mc.off(eventName, callback); };\n });\n };\n /**\n * @param {?} eventName\n * @return {?}\n */\n HammerGesturesPlugin.prototype.isCustomEvent = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return this._config.events.indexOf(eventName) > -1; };\n HammerGesturesPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HammerGesturesPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n { type: HammerGestureConfig, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [HAMMER_GESTURE_CONFIG,] },] },\n ]; };\n return HammerGesturesPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\nvar ɵ0$1 = function (event) { return event.altKey; };\nvar ɵ1$1 = function (event) { return event.ctrlKey; };\nvar ɵ2$1 = function (event) { return event.metaKey; };\nvar ɵ3 = function (event) { return event.shiftKey; };\nvar MODIFIER_KEY_GETTERS = {\n 'alt': ɵ0$1,\n 'control': ɵ1$1,\n 'meta': ɵ2$1,\n 'shift': ɵ3\n};\n/**\n * \\@experimental\n */\nvar KeyEventsPlugin = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(KeyEventsPlugin, _super);\n function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }\n /**\n * @param {?} eventName\n * @return {?}\n */\n KeyEventsPlugin.prototype.supports = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; };\n /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n KeyEventsPlugin.prototype.addEventListener = /**\n * @param {?} element\n * @param {?} eventName\n * @param {?} handler\n * @return {?}\n */\n function (element, eventName, handler) {\n var /** @type {?} */ parsedEvent = /** @type {?} */ ((KeyEventsPlugin.parseEventName(eventName)));\n var /** @type {?} */ outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(function () {\n return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n };\n /**\n * @param {?} eventName\n * @return {?}\n */\n KeyEventsPlugin.parseEventName = /**\n * @param {?} eventName\n * @return {?}\n */\n function (eventName) {\n var /** @type {?} */ parts = eventName.toLowerCase().split('.');\n var /** @type {?} */ domEventName = parts.shift();\n if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n return null;\n }\n var /** @type {?} */ key = KeyEventsPlugin._normalizeKey(/** @type {?} */ ((parts.pop())));\n var /** @type {?} */ fullKey = '';\n MODIFIER_KEYS.forEach(function (modifierName) {\n var /** @type {?} */ index = parts.indexOf(modifierName);\n if (index > -1) {\n parts.splice(index, 1);\n fullKey += modifierName + '.';\n }\n });\n fullKey += key;\n if (parts.length != 0 || key.length === 0) {\n // returning null instead of throwing to let another plugin process the event\n return null;\n }\n var /** @type {?} */ result = {};\n result['domEventName'] = domEventName;\n result['fullKey'] = fullKey;\n return result;\n };\n /**\n * @param {?} event\n * @return {?}\n */\n KeyEventsPlugin.getEventFullKey = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n var /** @type {?} */ fullKey = '';\n var /** @type {?} */ key = getDOM().getEventKey(event);\n key = key.toLowerCase();\n if (key === ' ') {\n key = 'space'; // for readability\n }\n else if (key === '.') {\n key = 'dot'; // because '.' is used as a separator in event names\n }\n MODIFIER_KEYS.forEach(function (modifierName) {\n if (modifierName != key) {\n var /** @type {?} */ modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n if (modifierGetter(event)) {\n fullKey += modifierName + '.';\n }\n }\n });\n fullKey += key;\n return fullKey;\n };\n /**\n * @param {?} fullKey\n * @param {?} handler\n * @param {?} zone\n * @return {?}\n */\n KeyEventsPlugin.eventCallback = /**\n * @param {?} fullKey\n * @param {?} handler\n * @param {?} zone\n * @return {?}\n */\n function (fullKey, handler, zone) {\n return function (event /** TODO #9100 */) {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(function () { return handler(event); });\n }\n };\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} keyName\n * @return {?}\n */\n KeyEventsPlugin._normalizeKey = /**\n * \\@internal\n * @param {?} keyName\n * @return {?}\n */\n function (keyName) {\n // TODO: switch to a Map if the mapping grows too much\n switch (keyName) {\n case 'esc':\n return 'escape';\n default:\n return keyName;\n }\n };\n KeyEventsPlugin.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n KeyEventsPlugin.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return KeyEventsPlugin;\n}(EventManagerPlugin));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"http\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo<bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript:...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nvar SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n */\nvar DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))\n return url;\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])()) {\n getDOM().log(\"WARNING: sanitizing unsafe URL value \" + url + \" (see http://g.co/ng/security#xss)\");\n }\n return 'unsafe:' + url;\n}\n/**\n * @param {?} srcset\n * @return {?}\n */\nfunction sanitizeSrcset(srcset) {\n srcset = String(srcset);\n return srcset.split(',').map(function (srcset) { return sanitizeUrl(srcset.trim()); }).join(', ');\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A <body> element that can be safely used to parse untrusted HTML. Lazily initialized below.\n */\nvar inertElement = null;\n/**\n * Lazily initialized to make sure the DOM adapter gets set before use.\n */\nvar DOM = /** @type {?} */ ((null));\n/**\n * Returns an HTML element that is guaranteed to not execute code when creating elements in it.\n * @return {?}\n */\nfunction getInertElement() {\n if (inertElement)\n return inertElement;\n DOM = getDOM();\n // Prefer using <template> element if supported.\n var /** @type {?} */ templateEl = DOM.createElement('template');\n if ('content' in templateEl)\n return templateEl;\n var /** @type {?} */ doc = DOM.createHtmlDocument();\n inertElement = DOM.querySelector(doc, 'body');\n if (inertElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so we\n // need to create one.\n var /** @type {?} */ html = DOM.createElement('html', doc);\n inertElement = DOM.createElement('body', doc);\n DOM.appendChild(html, inertElement);\n DOM.appendChild(doc, html);\n }\n return inertElement;\n}\n/**\n * @param {?} tags\n * @return {?}\n */\nfunction tagSet(tags) {\n var /** @type {?} */ res = {};\n for (var _i = 0, _a = tags.split(','); _i < _a.length; _i++) {\n var t = _a[_i];\n res[t] = true;\n }\n return res;\n}\n/**\n * @param {...?} sets\n * @return {?}\n */\nfunction merge() {\n var sets = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sets[_i] = arguments[_i];\n }\n var /** @type {?} */ res = {};\n for (var _a = 0, sets_1 = sets; _a < sets_1.length; _a++) {\n var s = sets_1[_a];\n for (var /** @type {?} */ v in s) {\n if (s.hasOwnProperty(v))\n res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nvar OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nvar OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nvar BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nvar INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nvar VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nvar URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n// Attributes that have special href set hence need to be sanitized\nvar SRCSET_ATTRS = tagSet('srcset');\nvar HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nvar VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nvar SanitizingHtmlSerializer = /** @class */ (function () {\n function SanitizingHtmlSerializer() {\n this.sanitizedSomething = false;\n this.buf = [];\n }\n /**\n * @param {?} el\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.sanitizeChildren = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n var /** @type {?} */ current = /** @type {?} */ ((el.firstChild));\n while (current) {\n if (DOM.isElementNode(current)) {\n this.startElement(/** @type {?} */ (current));\n }\n else if (DOM.isTextNode(current)) {\n this.chars(/** @type {?} */ ((DOM.nodeValue(current))));\n }\n else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (DOM.firstChild(current)) {\n current = /** @type {?} */ ((DOM.firstChild(current)));\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (DOM.isElementNode(current)) {\n this.endElement(/** @type {?} */ (current));\n }\n var /** @type {?} */ next = checkClobberedElement(current, /** @type {?} */ ((DOM.nextSibling(current))));\n if (next) {\n current = next;\n break;\n }\n current = checkClobberedElement(current, /** @type {?} */ ((DOM.parentElement(current))));\n }\n }\n return this.buf.join('');\n };\n /**\n * @param {?} element\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.startElement = /**\n * @param {?} element\n * @return {?}\n */\n function (element) {\n var _this = this;\n var /** @type {?} */ tagName = DOM.nodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return;\n }\n this.buf.push('<');\n this.buf.push(tagName);\n DOM.attributeMap(element).forEach(function (value, attrName) {\n var /** @type {?} */ lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n _this.sanitizedSomething = true;\n return;\n }\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower])\n value = sanitizeUrl(value);\n if (SRCSET_ATTRS[lower])\n value = sanitizeSrcset(value);\n _this.buf.push(' ');\n _this.buf.push(attrName);\n _this.buf.push('=\"');\n _this.buf.push(encodeEntities(value));\n _this.buf.push('\"');\n });\n this.buf.push('>');\n };\n /**\n * @param {?} current\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.endElement = /**\n * @param {?} current\n * @return {?}\n */\n function (current) {\n var /** @type {?} */ tagName = DOM.nodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n };\n /**\n * @param {?} chars\n * @return {?}\n */\n SanitizingHtmlSerializer.prototype.chars = /**\n * @param {?} chars\n * @return {?}\n */\n function (chars) { this.buf.push(encodeEntities(chars)); };\n return SanitizingHtmlSerializer;\n}());\n/**\n * @param {?} node\n * @param {?} nextNode\n * @return {?}\n */\nfunction checkClobberedElement(node, nextNode) {\n if (nextNode && DOM.contains(node, nextNode)) {\n throw new Error(\"Failed to sanitize html because the element is clobbered: \" + DOM.getOuterHTML(node));\n }\n return nextNode;\n}\n// Regular Expressions for parsing tags and attributes\nvar SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nvar NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param {?} value\n * @return {?}\n */\nfunction encodeEntities(value) {\n return value.replace(/&/g, '&')\n .replace(SURROGATE_PAIR_REGEXP, function (match) {\n var /** @type {?} */ hi = match.charCodeAt(0);\n var /** @type {?} */ low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n/**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n * @param {?} el\n * @return {?}\n */\nfunction stripCustomNsAttrs(el) {\n DOM.attributeMap(el).forEach(function (_, attrName) {\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n DOM.removeAttribute(el, attrName);\n }\n });\n for (var _i = 0, _a = DOM.childNodesAsList(el); _i < _a.length; _i++) {\n var n = _a[_i];\n if (DOM.isElementNode(n))\n stripCustomNsAttrs(/** @type {?} */ (n));\n }\n}\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n * @param {?} defaultDoc\n * @param {?} unsafeHtmlInput\n * @return {?}\n */\nfunction sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n try {\n var /** @type {?} */ containerEl = getInertElement();\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n var /** @type {?} */ unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n var /** @type {?} */ mXSSAttempts = 5;\n var /** @type {?} */ parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n DOM.setInnerHTML(containerEl, unsafeHtml);\n if (defaultDoc.documentMode) {\n // strip custom-namespaced attributes on IE<=11\n stripCustomNsAttrs(containerEl);\n }\n parsedHtml = DOM.getInnerHTML(containerEl);\n } while (unsafeHtml !== parsedHtml);\n var /** @type {?} */ sanitizer = new SanitizingHtmlSerializer();\n var /** @type {?} */ safeHtml = sanitizer.sanitizeChildren(DOM.getTemplateContent(containerEl) || containerEl);\n // Clear out the body element.\n var /** @type {?} */ parent_1 = DOM.getTemplateContent(containerEl) || containerEl;\n for (var _i = 0, _a = DOM.childNodesAsList(parent_1); _i < _a.length; _i++) {\n var child = _a[_i];\n DOM.removeChild(parent_1, child);\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && sanitizer.sanitizedSomething) {\n DOM.log('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');\n }\n return safeHtml;\n }\n catch (/** @type {?} */ e) {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n inertElement = null;\n throw e;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nvar VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nvar TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nvar COLOR_FNS = '(?:rgb|hsl)a?';\nvar GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nvar CSS3_FNS = '(?:calc|attr)';\nvar FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nvar SAFE_STYLE_VALUE = new RegExp(\"^(\" + VALUES + \"|\" +\n (\"(?:\" + TRANSFORMATION_FNS + \"|\" + COLOR_FNS + \"|\" + GRADIENTS + \"|\" + CSS3_FNS + \")\") +\n (FN_ARGS + \")$\"), 'g');\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nvar URL_RE = /^url\\(([^)]+)\\)$/;\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n * @param {?} value\n * @return {?}\n */\nfunction hasBalancedQuotes(value) {\n var /** @type {?} */ outsideSingle = true;\n var /** @type {?} */ outsideDouble = true;\n for (var /** @type {?} */ i = 0; i < value.length; i++) {\n var /** @type {?} */ c = value.charAt(i);\n if (c === '\\'' && outsideDouble) {\n outsideSingle = !outsideSingle;\n }\n else if (c === '\"' && outsideSingle) {\n outsideDouble = !outsideDouble;\n }\n }\n return outsideSingle && outsideDouble;\n}\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n * @param {?} value\n * @return {?}\n */\nfunction sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var /** @type {?} */ urlMatch = value.match(URL_RE);\n if ((urlMatch && sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])()) {\n getDOM().log(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Marker interface for a value that's safe to use in a particular context.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as HTML.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as style (CSS).\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as JavaScript.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as a URL linking to a document.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Marker interface for a value that's safe to use as a URL to load executable code from.\n *\n * \\@stable\n * @record\n */\n\n/**\n * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n * values to be safe to use in the different DOM contexts.\n *\n * For example, when binding a URL in an `<a [href]=\"someValue\">` hyperlink, `someValue` will be\n * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n * the website.\n *\n * In specific situations, it might be necessary to disable sanitization, for example if the\n * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n * methods, and then binding to that value from the template.\n *\n * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n * Cross Site Scripting (XSS) security bug!\n *\n * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n * close as possible to the source of the value, to make it easy to verify no security bug is\n * created by its use.\n *\n * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n * code. The sanitizer leaves safe values intact.\n *\n * \\@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n * sanitization for the value passed in. Carefully check and audit all values and code paths going\n * into this call. Make sure any user data is appropriately escaped for this security context.\n * For more detail, see the [Security Guide](http://g.co/ng/security).\n *\n * \\@stable\n * @abstract\n */\nvar DomSanitizer = /** @class */ (function () {\n function DomSanitizer() {\n }\n return DomSanitizer;\n}());\nvar DomSanitizerImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(DomSanitizerImpl, _super);\n function DomSanitizerImpl(_doc) {\n var _this = _super.call(this) || this;\n _this._doc = _doc;\n return _this;\n }\n /**\n * @param {?} ctx\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.sanitize = /**\n * @param {?} ctx\n * @param {?} value\n * @return {?}\n */\n function (ctx, value) {\n if (value == null)\n return null;\n switch (ctx) {\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].NONE:\n return /** @type {?} */ (value);\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].HTML:\n if (value instanceof SafeHtmlImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'HTML');\n return sanitizeHtml(this._doc, String(value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].STYLE:\n if (value instanceof SafeStyleImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'Style');\n return sanitizeStyle(/** @type {?} */ (value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].SCRIPT:\n if (value instanceof SafeScriptImpl)\n return value.changingThisBreaksApplicationSecurity;\n this.checkNotSafeValue(value, 'Script');\n throw new Error('unsafe value used in a script context');\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].URL:\n if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {\n // Allow resource URLs in URL contexts, they are strictly more trusted.\n return value.changingThisBreaksApplicationSecurity;\n }\n this.checkNotSafeValue(value, 'URL');\n return sanitizeUrl(String(value));\n case __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"].RESOURCE_URL:\n if (value instanceof SafeResourceUrlImpl) {\n return value.changingThisBreaksApplicationSecurity;\n }\n this.checkNotSafeValue(value, 'ResourceURL');\n throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n default:\n throw new Error(\"Unexpected SecurityContext \" + ctx + \" (see http://g.co/ng/security#xss)\");\n }\n };\n /**\n * @param {?} value\n * @param {?} expectedType\n * @return {?}\n */\n DomSanitizerImpl.prototype.checkNotSafeValue = /**\n * @param {?} value\n * @param {?} expectedType\n * @return {?}\n */\n function (value, expectedType) {\n if (value instanceof SafeValueImpl) {\n throw new Error(\"Required a safe \" + expectedType + \", got a \" + value.getTypeName() + \" \" +\n \"(see http://g.co/ng/security#xss)\");\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustHtml = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeHtmlImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustStyle = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeStyleImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustScript = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeScriptImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustUrl = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return new SafeUrlImpl(value); };\n /**\n * @param {?} value\n * @return {?}\n */\n DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n return new SafeResourceUrlImpl(value);\n };\n DomSanitizerImpl.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n DomSanitizerImpl.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [DOCUMENT$1,] },] },\n ]; };\n return DomSanitizerImpl;\n}(DomSanitizer));\n/**\n * @abstract\n */\nvar SafeValueImpl = /** @class */ (function () {\n function SafeValueImpl(changingThisBreaksApplicationSecurity) {\n // empty\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n /**\n * @return {?}\n */\n SafeValueImpl.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"SafeValue must use [property]=binding: \" + this.changingThisBreaksApplicationSecurity +\n \" (see http://g.co/ng/security#xss)\";\n };\n return SafeValueImpl;\n}());\nvar SafeHtmlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeHtmlImpl, _super);\n function SafeHtmlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeHtmlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'HTML'; };\n return SafeHtmlImpl;\n}(SafeValueImpl));\nvar SafeStyleImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeStyleImpl, _super);\n function SafeStyleImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeStyleImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'Style'; };\n return SafeStyleImpl;\n}(SafeValueImpl));\nvar SafeScriptImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeScriptImpl, _super);\n function SafeScriptImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeScriptImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'Script'; };\n return SafeScriptImpl;\n}(SafeValueImpl));\nvar SafeUrlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeUrlImpl, _super);\n function SafeUrlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeUrlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'URL'; };\n return SafeUrlImpl;\n}(SafeValueImpl));\nvar SafeResourceUrlImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(SafeResourceUrlImpl, _super);\n function SafeResourceUrlImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n SafeResourceUrlImpl.prototype.getTypeName = /**\n * @return {?}\n */\n function () { return 'ResourceURL'; };\n return SafeResourceUrlImpl;\n}(SafeValueImpl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar INTERNAL_BROWSER_PLATFORM_PROVIDERS = [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_ID\"], useValue: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"ɵPLATFORM_BROWSER_ID\"] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_INITIALIZER\"], useValue: initDomAdapter, multi: true },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"], useClass: BrowserPlatformLocation, deps: [DOCUMENT$1] },\n { provide: DOCUMENT$1, useFactory: _document, deps: [] },\n];\n/**\n * \\@security Replacing built-in sanitization providers exposes the application to XSS risks.\n * Attacker-controlled data introduced by an unsanitized provider could expose your\n * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).\n * \\@experimental\n */\nvar BROWSER_SANITIZATION_PROVIDERS = [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Sanitizer\"], useExisting: DomSanitizer },\n { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT$1] },\n];\n/**\n * \\@stable\n */\nvar platformBrowser = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"platformCore\"], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n/**\n * @return {?}\n */\nfunction initDomAdapter() {\n BrowserDomAdapter.makeCurrent();\n BrowserGetTestability.init();\n}\n/**\n * @return {?}\n */\nfunction errorHandler() {\n return new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ErrorHandler\"]();\n}\n/**\n * @return {?}\n */\nfunction _document() {\n return document;\n}\n/**\n * The ng module for the browser.\n *\n * \\@stable\n */\nvar BrowserModule = /** @class */ (function () {\n function BrowserModule(parentModule) {\n if (parentModule) {\n throw new Error(\"BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.\");\n }\n }\n /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * @experimental\n */\n /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * \\@experimental\n * @param {?} params\n * @return {?}\n */\n BrowserModule.withServerTransition = /**\n * Configures a browser-based application to transition from a server-rendered app, if\n * one is present on the page. The specified parameters must include an application id,\n * which must match between the client and server applications.\n *\n * \\@experimental\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return {\n ngModule: BrowserModule,\n providers: [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"], useValue: params.appId },\n { provide: TRANSITION_ID, useExisting: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"] },\n SERVER_TRANSITION_PROVIDERS,\n ],\n };\n };\n BrowserModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n providers: [\n BROWSER_SANITIZATION_PROVIDERS,\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ErrorHandler\"], useFactory: errorHandler, deps: [] },\n { provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true },\n { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true },\n { provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true },\n { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },\n DomRendererFactory2,\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"RendererFactory2\"], useExisting: DomRendererFactory2 },\n { provide: SharedStylesHost, useExisting: DomSharedStylesHost },\n DomSharedStylesHost,\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Testability\"],\n EventManager,\n ELEMENT_PROBE_PROVIDERS,\n Meta,\n Title,\n ],\n exports: [__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"CommonModule\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationModule\"]]\n },] },\n ];\n /** @nocollapse */\n BrowserModule.ctorParameters = function () { return [\n { type: BrowserModule, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n ]; };\n return BrowserModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar win = typeof window !== 'undefined' && window || /** @type {?} */ ({});\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ChangeDetectionPerfRecord = /** @class */ (function () {\n function ChangeDetectionPerfRecord(msPerTick, numTicks) {\n this.msPerTick = msPerTick;\n this.numTicks = numTicks;\n }\n return ChangeDetectionPerfRecord;\n}());\n/**\n * Entry point for all Angular profiling-related debug tools. This object\n * corresponds to the `ng.profiler` in the dev console.\n */\nvar AngularProfiler = /** @class */ (function () {\n function AngularProfiler(ref) {\n this.appRef = ref.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"]);\n }\n // tslint:disable:no-console\n /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n */\n /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n * @param {?} config\n * @return {?}\n */\n AngularProfiler.prototype.timeChangeDetection = /**\n * Exercises change detection in a loop and then prints the average amount of\n * time in milliseconds how long a single round of change detection takes for\n * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n * of 500 milliseconds.\n *\n * Optionally, a user may pass a `config` parameter containing a map of\n * options. Supported options are:\n *\n * `record` (boolean) - causes the profiler to record a CPU profile while\n * it exercises the change detector. Example:\n *\n * ```\n * ng.profiler.timeChangeDetection({record: true})\n * ```\n * @param {?} config\n * @return {?}\n */\n function (config) {\n var /** @type {?} */ record = config && config['record'];\n var /** @type {?} */ profileName = 'Change Detection';\n // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened\n var /** @type {?} */ isProfilerAvailable = win.console.profile != null;\n if (record && isProfilerAvailable) {\n win.console.profile(profileName);\n }\n var /** @type {?} */ start = getDOM().performanceNow();\n var /** @type {?} */ numTicks = 0;\n while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {\n this.appRef.tick();\n numTicks++;\n }\n var /** @type {?} */ end = getDOM().performanceNow();\n if (record && isProfilerAvailable) {\n // need to cast to <any> because type checker thinks there's no argument\n // while in fact there is:\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd\n (/** @type {?} */ (win.console.profileEnd))(profileName);\n }\n var /** @type {?} */ msPerTick = (end - start) / numTicks;\n win.console.log(\"ran \" + numTicks + \" change detection cycles\");\n win.console.log(msPerTick.toFixed(2) + \" ms per check\");\n return new ChangeDetectionPerfRecord(msPerTick, numTicks);\n };\n return AngularProfiler;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PROFILER_GLOBAL_NAME = 'profiler';\n/**\n * Enabled Angular debug tools that are accessible via your browser's\n * developer console.\n *\n * Usage:\n *\n * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)\n * 1. Type `ng.` (usually the console will show auto-complete suggestion)\n * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`\n * then hit Enter.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @template T\n * @param {?} ref\n * @return {?}\n */\nfunction enableDebugTools(ref) {\n exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n return ref;\n}\n/**\n * Disables Angular tools.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @return {?}\n */\nfunction disableDebugTools() {\n exportNgVar(PROFILER_GLOBAL_NAME, null);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} text\n * @return {?}\n */\nfunction escapeHtml(text) {\n var /** @type {?} */ escapedText = {\n '&': '&a;',\n '\"': '&q;',\n '\\'': '&s;',\n '<': '&l;',\n '>': '&g;',\n };\n return text.replace(/[&\"'<>]/g, function (s) { return escapedText[s]; });\n}\n/**\n * @param {?} text\n * @return {?}\n */\nfunction unescapeHtml(text) {\n var /** @type {?} */ unescapedText = {\n '&a;': '&',\n '&q;': '\"',\n '&s;': '\\'',\n '&l;': '<',\n '&g;': '>',\n };\n return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });\n}\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * \\@experimental\n * @template T\n * @param {?} key\n * @return {?}\n */\nfunction makeStateKey(key) {\n return /** @type {?} */ (key);\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * `TransferState` will be available as an injectable token. To use it import\n * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialzied in a\n * non-lossy manner.\n *\n * \\@experimental\n */\nvar TransferState = /** @class */ (function () {\n function TransferState() {\n this.store = {};\n this.onSerializeCallbacks = {};\n }\n /** @internal */\n /**\n * \\@internal\n * @param {?} initState\n * @return {?}\n */\n TransferState.init = /**\n * \\@internal\n * @param {?} initState\n * @return {?}\n */\n function (initState) {\n var /** @type {?} */ transferState = new TransferState();\n transferState.store = initState;\n return transferState;\n };\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n * @template T\n * @param {?} key\n * @param {?} defaultValue\n * @return {?}\n */\n TransferState.prototype.get = /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n * @template T\n * @param {?} key\n * @param {?} defaultValue\n * @return {?}\n */\n function (key, defaultValue) { return /** @type {?} */ (this.store[key]) || defaultValue; };\n /**\n * Set the value corresponding to a key.\n */\n /**\n * Set the value corresponding to a key.\n * @template T\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\n TransferState.prototype.set = /**\n * Set the value corresponding to a key.\n * @template T\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\n function (key, value) { this.store[key] = value; };\n /**\n * Remove a key from the store.\n */\n /**\n * Remove a key from the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n TransferState.prototype.remove = /**\n * Remove a key from the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n function (key) { delete this.store[key]; };\n /**\n * Test whether a key exists in the store.\n */\n /**\n * Test whether a key exists in the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n TransferState.prototype.hasKey = /**\n * Test whether a key exists in the store.\n * @template T\n * @param {?} key\n * @return {?}\n */\n function (key) { return this.store.hasOwnProperty(key); };\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n * @template T\n * @param {?} key\n * @param {?} callback\n * @return {?}\n */\n TransferState.prototype.onSerialize = /**\n * Register a callback to provide the value for a key when `toJson` is called.\n * @template T\n * @param {?} key\n * @param {?} callback\n * @return {?}\n */\n function (key, callback) {\n this.onSerializeCallbacks[key] = callback;\n };\n /**\n * Serialize the current state of the store to JSON.\n */\n /**\n * Serialize the current state of the store to JSON.\n * @return {?}\n */\n TransferState.prototype.toJson = /**\n * Serialize the current state of the store to JSON.\n * @return {?}\n */\n function () {\n // Call the onSerialize callbacks and put those values into the store.\n for (var /** @type {?} */ key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n }\n catch (/** @type {?} */ e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n return JSON.stringify(this.store);\n };\n TransferState.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n TransferState.ctorParameters = function () { return []; };\n return TransferState;\n}());\n/**\n * @param {?} doc\n * @param {?} appId\n * @return {?}\n */\nfunction initTransferState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n var /** @type {?} */ script = doc.getElementById(appId + '-state');\n var /** @type {?} */ initialState = {};\n if (script && script.textContent) {\n try {\n initialState = JSON.parse(unescapeHtml(script.textContent));\n }\n catch (/** @type {?} */ e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return TransferState.init(initialState);\n}\n/**\n * NgModule to install on the client side while using the `TransferState` to transfer state from\n * server to client.\n *\n * \\@experimental\n */\nvar BrowserTransferStateModule = /** @class */ (function () {\n function BrowserTransferStateModule() {\n }\n BrowserTransferStateModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_ID\"]] }],\n },] },\n ];\n /** @nocollapse */\n BrowserTransferStateModule.ctorParameters = function () { return []; };\n return BrowserTransferStateModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Predicates for use with {\\@link DebugElement}'s query functions.\n *\n * \\@experimental All debugging apis are currently experimental.\n */\nvar By = /** @class */ (function () {\n function By() {\n }\n /**\n * Match all elements.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n */\n /**\n * Match all elements.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n * @return {?}\n */\n By.all = /**\n * Match all elements.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n * @return {?}\n */\n function () { return function (debugElement) { return true; }; };\n /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n */\n /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n * @param {?} selector\n * @return {?}\n */\n By.css = /**\n * Match elements by the given CSS selector.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n * @param {?} selector\n * @return {?}\n */\n function (selector) {\n return function (debugElement) {\n return debugElement.nativeElement != null ?\n getDOM().elementMatches(debugElement.nativeElement, selector) :\n false;\n };\n };\n /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n */\n /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n * @param {?} type\n * @return {?}\n */\n By.directive = /**\n * Match elements that have the given directive present.\n *\n * ## Example\n *\n * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return function (debugElement) { return ((debugElement.providerTokens)).indexOf(type) !== -1; };\n };\n return By;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=platform-browser.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYW5ndWxhci9wbGF0Zm9ybS1icm93c2VyL2VzbTUvcGxhdGZvcm0tYnJvd3Nlci5qcz8zODRkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBDb21tb25Nb2R1bGUsIERPQ1VNRU5ULCBQbGF0Zm9ybUxvY2F0aW9uLCDJtVBMQVRGT1JNX0JST1dTRVJfSUQsIMm1cGFyc2VDb29raWVWYWx1ZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXB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qLyBkb21QcmVmaXhlcyA9IFsnV2Via2l0JywgJ01veicsICdPJywgJ21zJ107XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IGRvbVByZWZpeGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChfdGhpcy5nZXRTdHlsZShlbGVtZW50XzEsIGRvbVByZWZpeGVzW2ldICsgJ0FuaW1hdGlvbk5hbWUnKSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5fYW5pbWF0aW9uUHJlZml4ID0gJy0nICsgZG9tUHJlZml4ZXNbaV0udG9Mb3dlckNhc2UoKSArICctJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdHJhbnNFbmRFdmVudE5hbWVzXzEgPSB7XG4gICAgICAgICAgICAgICAgV2Via2l0VHJhbnNpdGlvbjogJ3dlYmtpdFRyYW5zaXRpb25FbmQnLFxuICAgICAgICAgICAgICAgIE1velRyYW5zaXRpb246ICd0cmFuc2l0aW9uZW5kJyxcbiAgICAgICAgICAgICAgICBPVHJhbnNpdGlvbjogJ29UcmFuc2l0aW9uRW5kIG90cmFuc2l0aW9uZW5kJyxcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiAndHJhbnNpdGlvbmVuZCdcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBPYmplY3Qua2V5cyh0cmFuc0VuZEV2ZW50TmFtZXNfMSkuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgaWYgKF90aGlzLmdldFN0eWxlKGVsZW1lbnRfMSwga2V5KSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLl90cmFuc2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tZW50cykgfHwgdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0ZW1wbGF0ZUh0bWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5wYXJzZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGVtcGxhdGVIdG1sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodGVtcGxhdGVIdG1sKSB7IHRocm93IG5ldyBFcnJvcigncGFyc2Ugbm90IGltcGxlbWVudGVkJyk7IH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5tYWtlQ3VycmVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyBzZXRSb290RG9tQWRhcHRlcihuZXcgQnJvd3NlckRvbUFkYXB0ZXIoKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaGFzUHJvcGVydHkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBuYW1lKSB7IHJldHVybiBuYW1lIGluIGVsZW1lbnQ7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5zZXRQcm9wZXJ0eSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlKSB7ICgvKiogQHR5cGUgez99ICovIChlbCkpW25hbWVdID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFByb3BlcnR5ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuYW1lKSB7IHJldHVybiAoLyoqIEB0eXBlIHs/fSAqLyAoZWwpKVtuYW1lXTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBtZXRob2ROYW1lXG4gICAgICogQHBhcmFtIHs/fSBhcmdzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW52b2tlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbWV0aG9kTmFtZVxuICAgICAqIEBwYXJhbSB7P30gYXJnc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBtZXRob2ROYW1lLCBhcmdzKSB7XG4gICAgICAgIChfYSA9ICgvKiogQHR5cGUgez99ICovIChlbCkpKVttZXRob2ROYW1lXS5hcHBseShfYSwgYXJncyk7XG4gICAgICAgIHZhciBfYTtcbiAgICB9O1xuICAgIC8vIFRPRE8odGJvc2NoKTogbW92ZSB0aGlzIGludG8gYSBzZXBhcmF0ZSBlbnZpcm9ubWVudCBjbGFzcyBvbmNlIHdlIGhhdmUgaXRcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nRXJyb3IgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgaWYgKHdpbmRvdy5jb25zb2xlKSB7XG4gICAgICAgICAgICBpZiAoY29uc29sZS5lcnJvcikge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVycm9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlcnJvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgIGlmICh3aW5kb3cuY29uc29sZSkge1xuICAgICAgICAgICAgd2luZG93LmNvbnNvbGUubG9nICYmIHdpbmRvdy5jb25zb2xlLmxvZyhlcnJvcik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXJyb3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5sb2dHcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXJyb3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICBpZiAod2luZG93LmNvbnNvbGUpIHtcbiAgICAgICAgICAgIHdpbmRvdy5jb25zb2xlLmdyb3VwICYmIHdpbmRvdy5jb25zb2xlLmdyb3VwKGVycm9yKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubG9nR3JvdXBFbmQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHdpbmRvdy5jb25zb2xlKSB7XG4gICAgICAgICAgICB3aW5kb3cuY29uc29sZS5ncm91cEVuZCAmJiB3aW5kb3cuY29uc29sZS5ncm91cEVuZCgpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLCBcImF0dHJUb1Byb3BNYXBcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gX2F0dHJUb1Byb3BNYXA7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZUFcbiAgICAgKiBAcGFyYW0gez99IG5vZGVCXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9t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pOyB9O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gZXZ0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZGlzcGF0Y2hFdmVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IGV2dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBldnQpIHsgZWwuZGlzcGF0Y2hFdmVudChldnQpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY3JlYXRlTW91c2VFdmVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnRUeXBlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGV2dCA9IHRoaXMuZ2V0RGVmYXVsdERvY3VtZW50KCkuY3JlYXRlRXZlbnQoJ01vdXNlRXZlbnQnKTtcbiAgICAgICAgZXZ0LmluaXRFdmVudChldmVudFR5cGUsIHRydWUsIHRydWUpO1xuICAgICAgICByZXR1cm4gZXZ0O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFR5cGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5jcmVhdGVFdmVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnRUeXBlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGV2dCA9IHRoaXMuZ2V0RGVmYXVsdERvY3VtZW50KCkuY3JlYXRlRXZlbnQoJ0V2ZW50Jyk7XG4gICAgICAgIGV2dC5pbml0RXZlbnQoZXZlbnRUeXBlLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgcmV0dXJuIGV2dDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZ0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUucHJldmVudERlZmF1bHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGV2dCkge1xuICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgZXZ0LnJldHVyblZhbHVlID0gZmFsc2U7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzUHJldmVudGVkID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBldnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChldnQpIHtcbiAgICAgICAgcmV0dXJuIGV2dC5kZWZhdWx0UHJldmVudGVkIHx8IGV2dC5yZXR1cm5WYWx1ZSAhPSBudWxsICYmICFldnQucmV0dXJuVmFsdWU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0SW5uZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5pbm5lckhUTUw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRlbXBsYXRlQ29udGVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkge1xuICAgICAgICByZXR1cm4gJ2NvbnRlbnQnIGluIGVsICYmIHRoaXMuaXNUZW1wbGF0ZUVsZW1lbnQoZWwpID8gKC8qKiBAdHlwZSB7P30gKi8gKGVsKSkuY29udGVudCA6IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0T3V0ZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5vdXRlckhUTUw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubm9kZU5hbWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLm5vZGVOYW1lOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLm5vZGVWYWx1ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubm9kZVZhbHVlOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnR5cGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLnR5cGU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY29udGVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgaWYgKHRoaXMuaGFzUHJvcGVydHkobm9kZSwgJ2NvbnRlbnQnKSkge1xuICAgICAgICAgICAgcmV0dXJuICgvKiogQHR5cGUgez99ICovIChub2RlKSkuY29udGVudDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZmlyc3RDaGlsZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gZWwuZmlyc3RDaGlsZDsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUubmV4dFNpYmxpbmcgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuIGVsLm5leHRTaWJsaW5nOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5wYXJlbnRFbGVtZW50ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5wYXJlbnROb2RlOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5jaGlsZE5vZGVzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC5jaGlsZE5vZGVzOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5jaGlsZE5vZGVzQXNMaXN0ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNoaWxkTm9kZXMgPSBlbC5jaGlsZE5vZGVzO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXMgPSBuZXcgQXJyYXkoY2hpbGROb2Rlcy5sZW5ndGgpO1xuICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGkgPSAwOyBpIDwgY2hpbGROb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgcmVzW2ldID0gY2hpbGROb2Rlc1tpXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmNsZWFyTm9kZXMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHtcbiAgICAgICAgd2hpbGUgKGVsLmZpcnN0Q2hpbGQpIHtcbiAgICAgICAgICAgIGVsLnJlbW92ZUNoaWxkKGVsLmZpcnN0Q2hpbGQpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuYXBwZW5kQ2hpbGQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5vZGUpIHsgZWwuYXBwZW5kQ2hpbGQobm9kZSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnJlbW92ZUNoaWxkID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBub2RlKSB7IGVsLnJlbW92ZUNoaWxkKG5vZGUpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5ld0NoaWxkXG4gICAgICogQHBhcmFtIHs/fSBvbGRDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnJlcGxhY2VDaGlsZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5ld0NoaWxkXG4gICAgICogQHBhcmFtIHs/fSBvbGRDaGlsZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuZXdDaGlsZCwgb2xkQ2hpbGQpIHsgZWwucmVwbGFjZUNoaWxkKG5ld0NoaWxkLCBvbGRDaGlsZCk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUucmVtb3ZlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICBpZiAobm9kZS5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICBub2RlLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW5zZXJ0QmVmb3JlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRcbiAgICAgKiBAcGFyYW0gez99IHJlZlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmVudCwgcmVmLCBub2RlKSB7IHBhcmVudC5pbnNlcnRCZWZvcmUobm9kZSwgcmVmKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2Rlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmluc2VydEFsbEJlZm9yZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyZW50XG4gICAgICogQHBhcmFtIHs/fSByZWZcbiAgICAgKiBAcGFyYW0gez99IG5vZGVzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGFyZW50LCByZWYsIG5vZGVzKSB7XG4gICAgICAgIG5vZGVzLmZvckVhY2goZnVuY3Rpb24gKG4pIHsgcmV0dXJuIHBhcmVudC5pbnNlcnRCZWZvcmUobiwgcmVmKTsgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaW5zZXJ0QWZ0ZXIgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudFxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGFyZW50LCByZWYsIG5vZGUpIHsgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWYubmV4dFNpYmxpbmcpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuc2V0SW5uZXJIVE1MID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCwgdmFsdWUpIHsgZWwuaW5uZXJIVE1MID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRleHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuIGVsLnRleHRDb250ZW50OyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuc2V0VGV4dCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIHZhbHVlKSB7IGVsLnRleHRDb250ZW50ID0gdmFsdWU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFZhbHVlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7IHJldHVybiBlbC52YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnNldFZhbHVlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCwgdmFsdWUpIHsgZWwudmFsdWUgPSB2YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0Q2hlY2tlZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gZWwuY2hlY2tlZDsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHBhcmFtIHs/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GUgez99ICovIChlbCkpLnNoYWRvd1Jvb3Q7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEhvc3QgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuICgvKiogQHR5cGUgez99ICovIChlbCkpLmhvc3Q7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY2xvbmUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLmNsb25lTm9kZSh0cnVlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWxlbWVudCwgbmFtZSkge1xuICAgICAgICByZXR1cm4gZWxlbWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKG5hbWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0RWxlbWVudHNCeVRhZ05hbWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBuYW1lKSB7XG4gICAgICAgIHJldHVybiBlbGVtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKG5hbWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuY2xhc3NMaXN0ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWxlbWVudCkgeyByZXR1cm4gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoZWxlbWVudC5jbGFzc0xpc3QsIDApOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEBwYXJhbSB7P30gY2xhc3NOYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuYWRkQ2xhc3MgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1lbnRcbiAgICAgKiBAcGFyYW0gez99IGNsYXNzTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsZW1lbnQsIGNsYXNzTmFtZSkgeyBlbGVtZW50LmNsYXNzTGlzdC5hZGQoY2xhc3NOYW1lKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsZW1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FyZVJvb3QgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwpIHsgcmV0dXJuIHRoaXMuaXNUZW1wbGF0ZUVsZW1lbnQoZWwpID8gdGhpcy5jb250ZW50KGVsKSA6IGVsOyB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmNyZWF0ZUh0bWxEb2N1bWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gZG9jdW1lbnQuaW1wbGVtZW50YXRpb24uY3JlYXRlSFRNTERvY3VtZW50KCdmYWtlVGl0bGUnKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldERlZmF1bHREb2N1bWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gZG9jdW1lbnQ7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEJvdW5kaW5nQ2xpZW50UmVjdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGVsLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoICgvKiogQHR5cGUgez99ICovIGUpIHtcbiAgICAgICAgICAgIHJldHVybiB7IHRvcDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwLCByaWdodDogMCwgd2lkdGg6IDAsIGhlaWdodDogMCB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldFRpdGxlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkb2NcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChkb2MpIHsgcmV0dXJuIGRvYy50aXRsZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gbmV3VGl0bGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5zZXRUaXRsZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZG9jXG4gICAgICogQHBhcmFtIHs/fSBuZXdUaXRsZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRvYywgbmV3VGl0bGUpIHsgZG9jLnRpdGxlID0gbmV3VGl0bGUgfHwgJyc7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBuXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmVsZW1lbnRNYXRjaGVzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG4sIHNlbGVjdG9yKSB7XG4gICAgICAgIGlmICh0aGlzLmlzRWxlbWVudE5vZGUobikpIHtcbiAgICAgICAgICAgIHJldHVybiBuLm1hdGNoZXMgJiYgbi5tYXRjaGVzKHNlbGVjdG9yKSB8fFxuICAgICAgICAgICAgICAgIG4ubXNNYXRjaGVzU2VsZWN0b3IgJiYgbi5tc01hdGNoZXNTZWxlY3RvcihzZWxlY3RvcikgfHxcbiAgICAgICAgICAgICAgICBuLndlYmtpdE1hdGNoZXNTZWxlY3RvciAmJiBuLndlYmtpdE1hdGNoZXNTZWxlY3RvcihzZWxlY3Rvcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzVGVtcGxhdGVFbGVtZW50ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmlzRWxlbWVudE5vZGUoZWwpICYmIGVsLm5vZGVOYW1lID09PSAnVEVNUExBVEUnO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaXNUZXh0Tm9kZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IE5vZGUuVEVYVF9OT0RFOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzQ29tbWVudE5vZGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLm5vZGVUeXBlID09PSBOb2RlLkNPTU1FTlRfTk9ERTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5pc0VsZW1lbnROb2RlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSkgeyByZXR1cm4gbm9kZS5ub2RlVHlwZSA9PT0gTm9kZS5FTEVNRU5UX05PREU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuaGFzU2hhZG93Um9vdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIG5vZGUuc2hhZG93Um9vdCAhPSBudWxsICYmIG5vZGUgaW5zdGFuY2VvZiBIVE1MRWxlbWVudDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmlzU2hhZG93Um9vdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUgaW5zdGFuY2VvZiBEb2N1bWVudEZyYWdtZW50OyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmltcG9ydEludG9Eb2MgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBkb2N1bWVudC5pbXBvcnROb2RlKHRoaXMudGVtcGxhdGVBd2FyZVJvb3Qobm9kZSksIHRydWUpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmFkb3B0Tm9kZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIGRvY3VtZW50LmFkb3B0Tm9kZShub2RlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0SHJlZiA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbCkgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAoKGVsLmdldEF0dHJpYnV0ZSgnaHJlZicpKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLmdldEV2ZW50S2V5ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleSA9IGV2ZW50LmtleTtcbiAgICAgICAgaWYgKGtleSA9PSBudWxsKSB7XG4gICAgICAgICAgICBrZXkgPSBldmVudC5rZXlJZGVudGlmaWVyO1xuICAgICAgICAgICAgLy8ga2V5SWRlbnRpZmllciBpcyBkZWZpbmVkIGluIHRoZSBvbGQgZHJhZnQgb2YgRE9NIExldmVsIDMgRXZlbnRzIGltcGxlbWVudGVkIGJ5IENocm9tZSBhbmRcbiAgICAgICAgICAgIC8vIFNhZmFyaSBjZlxuICAgICAgICAgICAgLy8gaHR0cDovL3d3dy53My5vcmcvVFIvMjAwNy9XRC1ET00tTGV2ZWwtMy1FdmVudHMtMjAwNzEyMjEvZXZlbnRzLmh0bWwjRXZlbnRzLUtleWJvYXJkRXZlbnRzLUludGVyZmFjZXNcbiAgICAgICAgICAgIGlmIChrZXkgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnVW5pZGVudGlmaWVkJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChrZXkuc3RhcnRzV2l0aCgnVSsnKSkge1xuICAgICAgICAgICAgICAgIGtleSA9IFN0cmluZy5mcm9tQ2hhckNvZGUocGFyc2VJbnQoa2V5LnN1YnN0cmluZygyKSwgMTYpKTtcbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQubG9jYXRpb24gPT09IERPTV9LRVlfTE9DQVRJT05fTlVNUEFEICYmIF9jaHJvbWVOdW1LZXlQYWRNYXAuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSBpcyBhIGJ1ZyBpbiBDaHJvbWUgZm9yIG51bWVyaWMga2V5cGFkIGtleXM6XG4gICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vY29kZS5nb29nbGUuY29tL3AvY2hyb21pdW0vaXNzdWVzL2RldGFpbD9pZD0xNTU2NTRcbiAgICAgICAgICAgICAgICAgICAgLy8gMSwgMiwgMyAuLi4gYXJlIHJlcG9ydGVkIGFzIEEsIEIsIEMgLi4uXG4gICAgICAgICAgICAgICAgICAgIGtleSA9ICgvKiogQHR5cGUgez99ICovIChfY2hyb21lTnVtS2V5UGFkTWFwKSlba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIF9rZXlNYXBba2V5XSB8fCBrZXk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuZ2V0R2xvYmFsRXZlbnRUYXJnZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRvY1xuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZG9jLCB0YXJnZXQpIHtcbiAgICAgICAgaWYgKHRhcmdldCA9PT0gJ3dpbmRvdycpIHtcbiAgICAgICAgICAgIHJldHVybiB3aW5kb3c7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRhcmdldCA9PT0gJ2RvY3VtZW50Jykge1xuICAgICAgICAgICAgcmV0dXJuIGRvYztcbiAgICAgICAgfVxuICAgICAgICBpZiAodGFyZ2V0ID09PSAnYm9keScpIHtcbiAgICAgICAgICAgIHJldHVybiBkb2MuYm9keTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3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dy5wZXJmb3JtYW5jZS5ub3coKSA6XG4gICAgICAgICAgICBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckRvbUFkYXB0ZXIucHJvdG90eXBlLnN1cHBvcnRzQ29va2llcyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gdHJ1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEJyb3dzZXJEb21BZGFwdGVyLnByb3RvdHlwZS5nZXRDb29raWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChuYW1lKSB7IHJldHVybiDJtXBhcnNlQ29va2llVmFsdWUoZG9jdW1lbnQuY29va2llLCBuYW1lKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBCcm93c2VyRG9tQWRhcHRlci5wcm90b3R5cGUuc2V0Q29va2llID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIHZhbHVlKSB7XG4gICAgICAgIC8vIGRvY3VtZW50LmNvb2tpZSBpcyBtYWdpY2FsLCBhc3NpZ25pbmcgaW50byBpdCBhc3NpZ25zL292ZXJyaWRlcyBvbmUgY29va2llIHZhbHVlLCBidXQgZG9lc1xuICAgICAgICAvLyBub3QgY2xlYXIgb3RoZXIgY29va2llcy5cbiAgIC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bWVudCh0YWcsIGZvcmNlQ3JlYXRpb24pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0YWdzXG4gICAgICogQHBhcmFtIHs/PX0gZm9yY2VDcmVhdGlvblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuYWRkVGFncyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnc1xuICAgICAqIEBwYXJhbSB7Pz19IGZvcmNlQ3JlYXRpb25cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh0YWdzLCBmb3JjZUNyZWF0aW9uKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChmb3JjZUNyZWF0aW9uID09PSB2b2lkIDApIHsgZm9yY2VDcmVhdGlvbiA9IGZhbHNlOyB9XG4gICAgICAgIGlmICghdGFncylcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgcmV0dXJuIHRhZ3MucmVkdWNlKGZ1bmN0aW9uIChyZXN1bHQsIHRhZykge1xuICAgICAgICAgICAgaWYgKHRhZykge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKF90aGlzLl9nZXRPckNyZWF0ZUVsZW1lbnQodGFnLCBmb3JjZUNyZWF0aW9uKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9LCBbXSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGF0dHJTZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuZ2V0VGFnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBhdHRyU2VsZWN0b3JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChhdHRyU2VsZWN0b3IpIHtcbiAgICAgICAgaWYgKCFhdHRyU2VsZWN0b3IpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2RvbS5xdWVyeVNlbGVjdG9yKHRoaXMuX2RvYywgXCJtZXRhW1wiICsgYXR0clNlbGVjdG9yICsgXCJdXCIpIHx8IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGF0dHJTZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuZ2V0VGFncyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYXR0clNlbGVjdG9yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYXR0clNlbGVjdG9yKSB7XG4gICAgICAgIGlmICghYXR0clNlbGVjdG9yKVxuICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBsaXN0ID0gdGhpcy5fZG9tLnF1ZXJ5U2VsZWN0b3JBbGwodGhpcy5fZG9jLCBcIm1ldGFbXCIgKyBhdHRyU2VsZWN0b3IgKyBcIl1cIik7XG4gICAgICAgIHJldHVybiBsaXN0ID8gW10uc2xpY2UuY2FsbChsaXN0KSA6IFtdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0YWdcbiAgICAgKiBAcGFyYW0gez89fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUudXBkYXRlVGFnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB0YWdcbiAgICAgKiBAcGFyYW0gez89fSBzZWxlY3RvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHRhZywgc2VsZWN0b3IpIHtcbiAgICAgICAgaWYgKCF0YWcpXG4gICAgICAgICAgICByZXR1cm4gbnVs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KVxuICAgICAgICAgICAgICAgIHJldHVybiBlbGVtO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGVsZW1lbnQgPSAvKiogQHR5cGUgez99ICovICh0aGlzLl9kb20uY3JlYXRlRWxlbWVudCgnbWV0YScpKTtcbiAgICAgICAgdGhpcy5fc2V0TWV0YUVsZW1lbnRBdHRyaWJ1dGVzKG1ldGEsIGVsZW1lbnQpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBoZWFkID0gdGhpcy5fZG9tLmdldEVsZW1lbnRzQnlUYWdOYW1lKHRoaXMuX2RvYywgJ2hlYWQnKVswXTtcbiAgICAgICAgdGhpcy5fZG9tLmFwcGVuZENoaWxkKGhlYWQsIGVsZW1lbnQpO1xuICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWV0YS5wcm90b3R5cGUuX3NldE1ldGFFbGVtZW50QXR0cmlidXRlcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHRhZywgZWwpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgT2JqZWN0LmtleXModGFnKS5mb3JFYWNoKGZ1bmN0aW9uIChwcm9wKSB7IHJldHVybiBfdGhpcy5fZG9tLnNldEF0dHJpYnV0ZShlbCwgcHJvcCwgdGFnW3Byb3BdKTsgfSk7XG4gICAgICAgIHJldHVybiBlbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFnXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNZXRhLnByb3RvdHlwZS5fcGFyc2VT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XBlIHs/fSAqLyBkZWNyZW1lbnQgPSBmdW5jdGlvbiAoZGlkV29ya18gLyoqIFRPRE8gIzkxMDAgKi8pIHtcbiAgICAgICAgICAgICAgICBkaWRXb3JrID0gZGlkV29yayB8fCBkaWRXb3JrXztcbiAgICAgICAgICAgICAgICBjb3VudC0tO1xuICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGRpZFdvcmspO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB0ZXN0YWJpbGl0aWVzLmZvckVhY2goZnVuY3Rpb24gKHRlc3RhYmlsaXR5IC8qKiBUT0RPICM5MTAwICovKSB7XG4gICAgICAgICAgICAgICAgdGVzdGFiaWxpdHkud2hlblN0YWJsZShkZWNyZW1lbnQpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgICAgIGlmICghybVnbG9iYWxbJ2ZyYW1ld29ya1N0YWJpbGl6ZXJzJ10pIHtcbiAgICAgICAgICAgIMm1Z2xvYmFsWydmcmFtZXdvcmtTdGFiaWxpemVycyddID0gW107XG4gICAgICAgIH1cbiAgICAgICAgybVnbG9iYWxbJ2ZyYW1ld29ya1N0YWJpbGl6ZXJzJ10ucHVzaCh3aGVuQWxsU3RhYmxlKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVnaXN0cnlcbiAgICAgKiBAcGFyYW0gez99IGVsZW1cbiAgICAgKiBAcGFyYW0gez99IGZpbmRJbkFuY2VzdG9yc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQnJvd3NlckdldFRlc3RhYmlsaXR5LnByb3RvdHlwZS5maW5kVGVzdGFiaWxpdHlJblRyZWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHJlZ2lzdHJ5XG4gICAgICogQHBhcmFtIHs/fSBlbGVtXG4gICAgICogQHBhcmFtIHs/fSBm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ICAgcmV0dXJuIHBsdWdpbi5hZGRFdmVudExpc3RlbmVyKGVsZW1lbnQsIGV2ZW50TmFtZSwgaGFuZGxlcik7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHBhcmFtIHs/fSBoYW5kbGVyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBFdmVudE1hbmFnZXIucHJvdG90eXBlLmFkZEdsb2JhbEV2ZW50TGlzdGVuZXIgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHBhcmFtIHs/fSBoYW5kbGVyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodGFyZ2V0LCBldmVudE5hbWUsIGhhbmRsZXIpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGx1Z2luID0gdGhpcy5fZmluZFBsdWdpbkZvcihldmVudE5hbWUpO1xuICAgICAgICByZXR1cm4gcGx1Z2luLmFkZEdsb2JhbEV2ZW50TGlzdGVuZXIodGFyZ2V0LCBldmVudE5hbWUsIGhhbmRsZXIpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBFdmVudE1hbmFnZXIucHJvdG90eXBlLmdldFpvbmUgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuX3pvbmU7IH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEV2ZW50TWFuYWdlci5wcm90b3R5cGUuX2ZpbmRQbHVnaW5Gb3IgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnROYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnROYW1lKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBsdWdpbiA9IHRoaXMuX2V2ZW50TmFtZVRvUGx1Z2luLmdldChldmVudE5hbWUpO1xuICAgICAgICBpZiAocGx1Z2luKSB7XG4gICAgICAgICAgICByZXR1cm4gcGx1Z2luO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBsdWdpbnMgPSB0aGlzLl9wbHVnaW5zO1xuICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGkgPSAwOyBpIDwgcGx1Z2lucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGx1Z2luXzEgPSBwbHVnaW5zW2ldO1xuICAgICAgICAgICAgaWYgKHBsdWdpbl8xLnN1cHBvcnRzKGV2ZW50TmFtZSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9ldmVudE5hbWVUb1BsdWdpbi5zZXQoZXZlbnROYW1lLCBwbHVnaW5fMSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsdWdpbl8xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIk5vIGV2ZW50IG1hbmFnZXIgcGx1Z2luIGZvdW5kIGZvciBldmVudCBcIiArIGV2ZW50TmFtZSk7XG4gICAgfTtcbiAgICBFdmVudE1hbmFnZXIuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBJbmplY3RhYmxlIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBFdmVudE1hbmFnZXIuY3RvclBhcmFtZXRlcnM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kyLnByb3RvdHlwZS5jcmVhdGVSZW5kZXJlciA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEBwYXJhbSB7P30gdHlwZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsZW1lbnQsIHR5cGUpIHtcbiAgICAgICAgaWYgKCFlbGVtZW50IHx8ICF0eXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kZWZhdWx0UmVuZGVyZXI7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoICh0eXBlLmVuY2Fwc3VsYXRpb24pIHtcbiAgICAgICAgICAgIGNhc2UgVmlld0VuY2Fwc3VsYXRpb24uRW11bGF0ZWQ6IHtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZW5kZXJlciA9IHRoaXMucmVuZGVyZXJCeUNvbXBJZC5nZXQodHlwZS5pZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFyZW5kZXJlcikge1xuICAgICAgICAgICAgICAgICAgICByZW5kZXJlciA9XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgRW11bGF0ZWRFbmNhcHN1bGF0aW9uRG9tUmVuZGVyZXIyKHRoaXMuZXZlbnRNYW5hZ2VyLCB0aGlzLnNoYXJlZFN0eWxlc0hvc3QsIHR5cGUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyQnlDb21wSWQuc2V0KHR5cGUuaWQsIHJlbmRlcmVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKHJlbmRlcmVyKSkuYXBwbHlUb0hvc3QoZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlbmRlcmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSBWaWV3RW5jYXBzdWxhdGlvbi5OYXRpdmU6XG4gICAgICAgICAgICAgIC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xlIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBEb21SZW5kZXJlckZhY3RvcnkyLmN0b3JQYXJhbWV0ZXJzID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gW1xuICAgICAgICB7IHR5cGU6IEV2ZW50TWFuYWdlciwgfSxcbiAgICAgICAgeyB0eXBlOiBEb21TaGFyZWRTdHlsZXNIb3N0LCB9LFxuICAgIF07IH07XG4gICAgcmV0dXJuIERvbVJlbmRlcmVyRmFjdG9yeTI7XG59KCkpO1xudmFyIERlZmF1bHREb21SZW5kZXJlcjIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gRGVmYXVsdERvbVJlbmRlcmVyMihldmVudE1hbmFnZXIpIHtcbiAgICAgICAgdGhpcy5ldmVudE1hbmFnZXIgPSBldmVudE1hbmFnZXI7XG4gICAgICAgIHRoaXMuZGF0YSA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuZGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuY3JlYXRlRWxlbWVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIG5hbWVzcGFjZSkge1xuICAgICAgICBpZiAobmFtZ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ICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWxlY3Rvck9yTm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuc2VsZWN0Um9vdEVsZW1lbnQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHNlbGVjdG9yT3JOb2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoc2VsZWN0b3JPck5vZGUpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZWwgPSB0eXBlb2Ygc2VsZWN0b3JPck5vZGUgPT09ICdzdHJpbmcnID8gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihzZWxlY3Rvck9yTm9kZSkgOlxuICAgICAgICAgICAgc2VsZWN0b3JPck5vZGU7XG4gICAgICAgIGlmICghZWwpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoZSBzZWxlY3RvciBcXFwiXCIgKyBzZWxlY3Rvck9yTm9kZSArIFwiXFxcIiBkaWQgbm90IG1hdGNoIGFueSBlbGVtZW50c1wiKTtcbiAgICAgICAgfVxuICAgICAgICBlbC50ZXh0Q29udGVudCA9ICcnO1xuICAgICAgICByZXR1cm4gZWw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIERlZmF1bHREb21SZW5kZXJlcjIucHJvdG90eXBlLnBhcmVudE5vZGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChub2RlKSB7IHJldHVybiBub2RlLnBhcmVudE5vZGU7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5uZXh0U2libGluZyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbm9kZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5vZGUpIHsgcmV0dXJuIG5vZGUubmV4dFNpYmxpbmc7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcGFyYW0gez89fSBuYW1lc3BhY2VcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIERlZmF1bHREb21SZW5kZXJlcjIucHJvdG90eXBlLnNldEF0dHJpYnV0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHBhcmFtIHs/PX0gbmFtZXNwYWNlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlLCBuYW1lc3BhY2UpIHtcbiAgICAgICAgaWYgKG5hbWVzcGFjZSkge1xuICAgICAgICAgICAgbmFtZSA9IG5hbWVzcGFjZSArIFwiOlwiICsgbmFtZTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5hbWVzcGFjZVVyaSA9IE5BTUVTUEFDRV9VUklTW25hbWVzcGFjZV07XG4gICAgICAgICAgICBpZiAobmFtZXNwYWNlVXJpKSB7XG4gICAgICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlTlMobmFtZXNwYWNlVXJpLCBuYW1lLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBlbC5zZXRBdHRyaWJ1dGUobmFtZSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlKG5hbWUsIHZhbHVlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUucmVtb3ZlQXR0cmlidXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbFxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7Pz19IG5hbWVzcGFjZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGVsLCBuYW1lLCBuYW1lc3BhY2UpIHtcbiAgICAgICAgaWYgKG5hbWVzcGFjZSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmFtZXNwYWNlVXJpID0gTkFNRVNQQUNFX1VSSVNbbmFtZXNwYWNlXTtcbiAgICAgICAgICAgIGlmIChuYW1lc3BhY2VVcmkpIHtcbiAgICAgICAgICAgICAgICBlbC5yZW1vdmVBdHRyaWJ1dGVOUyhuYW1lc3BhY2VVcmksIG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZWwucmVtb3ZlQXR0cmlidXRlKG5hbWVzcGFjZSArIFwiOlwiICsgbmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbC5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30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XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5zZXRQcm9wZXJ0eSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZWwsIG5hbWUsIHZhbHVlKSB7XG4gICAgICAgIGNoZWNrTm9TeW50aGV0aWNQcm9wKG5hbWUsICdwcm9wZXJ0eScpO1xuICAgICAgICBlbFtuYW1lXSA9IHZhbHVlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBub2RlXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdERvbVJlbmRlcmVyMi5wcm90b3R5cGUuc2V0VmFsdWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5vZGVcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobm9kZSwgdmFsdWUpIHsgbm9kZS5ub2RlVmFsdWUgPSB2YWx1ZTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHRhcmdldFxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRcbiAgICAgKiBAcGFyYW0gez99IGNhbGxiYWNrXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0RG9tUmVuZGVyZXIyLnByb3RvdHlwZS5saXN0ZW4gPSAvKipcbiAgICAgKiB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2tEYXRhc1swXTtcbiAgICAgICAgaWYgKHRhc2tEYXRhLnpvbmUgIT09IFpvbmUuY3VycmVudCkge1xuICAgICAgICAgICAgLy8gb25seSB1c2UgWm9uZS5ydW4gd2hlbiBab25lLmN1cnJlbnQgbm90IGVxdWFscyB0byBzdG9yZWQgem9uZVxuICAgICAgICAgICAgcmV0dXJuIHRhc2tEYXRhLnpvbmUucnVuKHRhc2tEYXRhLmhhbmRsZXIsIHRoaXMsIGFyZ3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRhc2tEYXRhLmhhbmRsZXIuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIGNvcHkgdGFza3MgYXMgYSBzbmFwc2hvdCB0byBhdm9pZCBldmVudCBoYW5kbGVycyByZW1vdmVcbiAgICAgICAgLy8gaXRzZWxmIG9yIG90aGVyc1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb3BpZWRUYXNrcyA9IHRhc2tEYXRhcy5zbGljZSgpO1xuICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGkgPSAwOyBpIDwgY29waWVkVGFza3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIC8vIGlmIG90aGVyIGxpc3RlbmVyIGNhbGwgZXZlbnQuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uXG4gICAgICAgICAgICAvLyBqdXN0IGJyZWFrXG4gICAgICAgICAgICBpZiAoKC8qKiBAdHlwZSB7P30gKi8gKGV2ZW50KSlbc3RvcFN5bWJvbF0gPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHRhc2tEYXRhID0gY29waWVkVGFza3NbaV07XG4gICAgICAgICAgICBpZiAodGFza0RhdGEuem9uZSAhPT0gWm9uZS5jdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgLy8gb25seSB1c2UgWm9uZS5ydW4gd2hlbiBab25lLmN1cnJlbnQgbm90IGVxdWFscyB0byBzdG9yZWQgem9uZVxuICAgICAgICAgICAgICAgIHRhc2tEYXRhLnpvbmUucnVuKHRhc2tEYXRhLmhhbmRsZXIsIHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGFza0RhdGEuaGFuZGxlci5hcHBseSh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG52YXIgRG9tRXZlbnRzUGx1Z2luID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgIF9fZXh0ZW5kcyhEb21FdmVudHNQbHVnaW4sIF9zdXBlcik7XG4gICAgZnVuY3Rpb24gRG9tRXZlbnRzUGx1Z2luKGRvYywgbmdab25lKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIGRvYykgfHwgdGhpcztcbiAgICAgICAgX3RoaXMubmdab25lID0gbmdab25lO1xuICAgICAgICBfdGhpcy5wYXRjaEV2ZW50KCk7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEb21FdmVudHNQbHVnaW4ucHJvdG90eXBlLnBhdGNoRXZlbnQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCFFdmVudCB8fCAhRXZlbnQucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCgvKiogQHR5cGUgez99ICovIChFdmVudC5wcm90b3R5cGUpKVtzdG9wTWV0aG9kU3ltYm9sXSk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ja0xpc3RlZEV2ZW50KGV2ZW50TmFtZSkpKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzeW1ib2xOYW1lID0gc3ltYm9sTmFtZXNbZXZlbnROYW1lXTtcbiAgICAgICAgICAgIGlmICghc3ltYm9sTmFtZSkge1xuICAgICAgICAgICAgICAgIHN5bWJvbE5hbWUgPSBzeW1ib2xOYW1lc1tldmVudE5hbWVdID0gX19zeW1ib2xfXyhBTkdVTEFSICsgZXZlbnROYW1lICsgRkFMU0UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdGFza0RhdGFzID0gKC8qKiBAdHlwZSB7P30gKi8gKGVsZW1lbnQpKVtzeW1ib2xOYW1lXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGdsb2JhbExpc3RlbmVyUmVnaXN0ZXJlZCA9IHRhc2tEYXRhcyAmJiB0YXNrRGF0YXMubGVuZ3RoID4gMDtcbiAgICAgICAgICAgIGlmICghdGFza0RhdGFzKSB7XG4gICAgICAgICAgICAgICAgdGFza0RhdGFzID0gKC8qKiBAdHlwZSB7P30gKi8gKGVsZW1lbnQpKVtzeW1ib2xOYW1lXSA9IFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gem9uZSA9IGlzQmxhY2tMaXN0ZWRFdmVudChldmVudE5hbWUpID8gWm9uZS5yb290IDogWm9uZS5jdXJyZW50O1xuICAgICAgICAgICAgaWYgKHRhc2tEYXRhcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICB0YXNrRGF0YXMucHVzaCh7IHpvbmU6IHpvbmUsIGhhbmRsZXI6IGNhbGxiYWNrIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2FsbGJhY2tSZWdpc3RlcmVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IHRhc2tEYXRhcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGFza0RhdGFzW2ldLmhhbmRsZXIgPT09IGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja1JlZ2lzdGVyZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFjYWxsYmFja1JlZ2lzdGVyZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGFza0RhdGFzLnB1c2goeyB6b25lOiB6b25lLCBoYW5kbGVyOiBjYWxsYmFjayB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWdsb2JhbExpc3RlbmVyUmVnaXN0ZXJlZCkge1xuICAgICAgICAgICAgICAgIGVsZW1lbnRbQUREX0VWRU5UX0xJU1RFTkVSXShldmVudE5hbWUsIGdsb2JhbExpc3RlbmVyLCBmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbGVtZW50W05BVElWRV9BRERfTElTVEVORVJdKGV2ZW50TmFtZSwgY2FsbGJhY2ssIGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeyByZXR1cm4gX3RoaXMucmVtb3ZlRXZlbnRMaXN0ZW5lcihlbGVtZW50LCBldmVudE5hbWUsIGNhbGxiYWNrKTsgfTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdGFyZ2V0XG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcGFyY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gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnROYW1lKSB7XG4gICAgICAgIGlmICghRVZFTlRfTkFNRVMuaGFzT3duUHJvcGVydHkoZXZlbnROYW1lLnRvTG93ZXJDYXNlKCkpICYmICF0aGlzLmlzQ3VzdG9tRXZlbnQoZXZlbnROYW1lKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKC8qKiBAdHlwZSB7P30gKi8gKHdpbmRvdykpLkhhbW1lcikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiSGFtbWVyLmpzIGlzIG5vdCBsb2FkZWQsIGNhbiBub3QgYmluZCBcIiArIGV2ZW50TmFtZSArIFwiIGV2ZW50XCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcGFyYW0gez99IGhhbmRsZXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEhhbW1lckdlc3R1cmVzUGx1Z2luLnByb3RvdHlwZS5hZGRFdmVudExpc3RlbmVyID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBlbGVtZW50XG4gICAgICogQHBhcmFtIHs/fSBldmVudE5hbWVcbiAgICAgKiBAcGFyYW0gez99IGhhbmRsZXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlbGVtZW50LCBldmVudE5hbWUsIGhhbmRsZXIpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gem9uZSA9IHRoaXMubWFuYWdlci5nZXRab25lKCk7XG4gICAgICAgIGV2ZW50TmFtZSA9IGV2ZW50TmFtZS50b0xv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N0aW9uIChldmVudE5hbWUpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGFydHMgPSBldmVudE5hbWUudG9Mb3dlckNhc2UoKS5zcGxpdCgnLicpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBkb21FdmVudE5hbWUgPSBwYXJ0cy5zaGlmdCgpO1xuICAgICAgICBpZiAoKHBhcnRzLmxlbmd0aCA9PT0gMCkgfHwgIShkb21FdmVudE5hbWUgPT09ICdrZXlkb3duJyB8fCBkb21FdmVudE5hbWUgPT09ICdrZXl1cCcpKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXkgPSBLZXlFdmVudHNQbHVnaW4uX25vcm1hbGl6ZUtleSgvKiogQHR5cGUgez99ICovICgocGFydHMucG9wKCkpKSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGZ1bGxLZXkgPSAnJztcbiAgICAgICAgTU9ESUZJRVJfS0VZUy5mb3JFYWNoKGZ1bmN0aW9uIChtb2RpZmllck5hbWUpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGluZGV4ID0gcGFydHMuaW5kZXhPZihtb2RpZmllck5hbWUpO1xuICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcbiAgICAgICAgICAgICAgICBwYXJ0cy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgICAgIGZ1bGxLZXkgKz0gbW9kaWZpZXJOYW1lICsgJy4nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgZnVsbEtleSArPSBrZXk7XG4gICAgICAgIGlmIChwYXJ0cy5sZW5ndGggIT0gMCB8fCBrZXkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAvLyByZXR1cm5pbmcgbnVsbCBpbnN0ZWFkIG9mIHRocm93aW5nIHRvIGxldCBhbm90aGVyIHBsdWdpbiBwcm9jZXNzIHRoZSBldmVudFxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzdWx0ID0ge307XG4gICAgICAgIHJlc3VsdFsnZG9tRXZlbnROYW1lJ10gPSBkb21FdmVudE5hbWU7XG4gICAgICAgIHJlc3VsdFsnZnVsbEtleSddID0gZnVsbEtleTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZXZlbnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEtleUV2ZW50c1BsdWdpbi5nZXRFdmVudEZ1bGxLZXkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2ZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZnVsbEtleSA9ICcnO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXkgPSBnZXRET00oKS5nZXRFdmVudEtleShldmVudCk7XG4gICAgICAgIGtleSA9IGtleS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICBpZiAoa2V5ID09PSAnICcpIHtcbiAgICAgICAgICAgIGtleSA9ICdzcGFjZSc7IC8vIGZvciByZWFkYWJpbGl0eVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGtleSA9PT0gJy4nKSB7XG4gICAgICAgICAgICBrZXkgPSAnZG90JzsgLy8gYmVjYXVzZSAnLicgaXMgdXNlZCBhcyBhIHNlcGFyYXRvciBpbiBldmVudCBuYW1lc1xuICAgICAgICB9XG4gICAgICAgIE1PRElGSUVSX0tFWVMuZm9yRWFjaChmdW5jdGlvbiAobW9kaWZpZXJOYW1lKSB7XG4gICAgICAgICAgICBpZiAobW9kaWZpZXJOYW1lICE9IGtleSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1vZGlmaWVyR2V0dGVyID0gTU9ESUZJRVJfS0VZX0dFVFRFUlNbbW9kaWZpZXJOYW1lXTtcbiAgICAgICAgICAgICAgICBpZiAobW9kaWZpZXJHZXR0ZXIoZXZlbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxLZXkgKz0gbW9kaWZpZXJOYW1lICsgJy4nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGZ1bGxLZXkgKz0ga2V5O1xuICAgICAgICByZXR1cm4gZnVsbEtleTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZnVsbEtleVxuICAgICAqIEBwYXJhbSB7P30gaGFuZGxlclxuICAgICAqIEBwYXJhbSB7P30gem9uZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgS2V5RXZlbnRzUGx1Z2luLmV2ZW50Q2FsbGJhY2sgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGZ1bGxLZXlcbiAgICAgKiBAcGFyYW0gez99IGhhbmRsZXJcbiAgICAgKiBAcGFyYW0gez99IHpvbmVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChmdWxsS2V5LCBoYW5kbGVyLCB6b25lKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZXZlbnQgLyoqIFRPRE8gIzkxMDAgKi8pIHtcbiAgICAgICAgICAgIGlmIChLZXlFdmVudHNQbHVnaW4uZ2V0RXZlbnRGdWxsS2V5KGV2ZW50KSA9PT0gZnVsbEtleSkge1xuICAgICAgICAgICAgICAgIHpvbmUucnVuR3VhcmRlZChmdW5jdGlvbiAoKSB7IHJldHVybiBoYW5kbGVyKGV2ZW50KTsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfTtc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Ugez99ICovICgoRE9NLmZpcnN0Q2hpbGQoY3VycmVudCkpKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdoaWxlIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgLy8gTGVhdmluZyB0aGUgZWxlbWVudC4gV2FsayB1cCBhbmQgdG8gdGhlIHJpZ2h0LCBjbG9zaW5nIHRhZ3MgYXMgd2UgZ28uXG4gICAgICAgICAgICAgICAgaWYgKERPTS5pc0VsZW1lbnROb2RlKGN1cnJlbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZW5kRWxlbWVudCgvKiogQHR5cGUgez99ICovIChjdXJyZW50KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5leHQgPSBjaGVja0Nsb2JiZXJlZEVsZW1lbnQoY3VycmVudCwgLyoqIEB0eXBlIHs/fSAqLyAoKERPTS5uZXh0U2libGluZyhjdXJyZW50KSkpKTtcbiAgICAgICAgICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gbmV4dDtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSBjaGVja0Nsb2JiZXJlZEVsZW1lbnQoY3VycmVudCwgLyoqIEB0eXBlIHs/fSAqLyAoKERPTS5wYXJlbnRFbGVtZW50KGN1cnJlbnQpKSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmJ1Zi5qb2luKCcnKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZWxlbWVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU2FuaXRpemluZ0h0bWxTZXJpYWxpemVyLnByb3RvdHlwZS5zdGFydEVsZW1lbnQ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gICAgIH07XG4gICAgfTtcbiAgICBCcm93c2VyTW9kdWxlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogTmdNb2R1bGUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgQlJPV1NFUl9TQU5JVElaQVRJT05fUFJPVklERVJTLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBFcnJvckhhbmRsZXIsIHVzZUZhY3Rvcnk6IGVycm9ySGFuZGxlciwgZGVwczogW10gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogRVZFTlRfTUFOQUdFUl9QTFVHSU5TLCB1c2VDbGFzczogRG9tRXZlbnRzUGx1Z2luLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBFVkVOVF9NQU5BR0VSX1BMVUdJTlMsIHVzZUNsYXNzOiBLZXlFdmVudHNQbHVnaW4sIG11bHRpOiB0cnVlIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7IHByb3ZpZGU6IEVWRU5UX01BTkFHRVJfUExVR0lOUywgdXNlQ2xhc3M6IEhhbW1lckdlc3R1cmVzUGx1Z2luLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIQU1NRVJfR0VTVFVSRV9DT05GSUcsIHVzZUNsYXNzOiBIYW1tZXJHZXN0dXJlQ29uZmlnIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBEb21SZW5kZXJlckZhY3RvcnkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBSZW5kZXJlckZhY3RvcnkyLCB1c2VFeGlzdGluZzogRG9tUmVuZGVyZXJGYWN0b3J5MiB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBTaGFyZWRTdHlsZXNIb3N0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sYmFjaztcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIFNlcmlhbGl6ZSB0aGUgY3VycmVudCBzdGF0ZSBvZiB0aGUgc3RvcmUgdG8gSlNPTi5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBTZXJpYWxpemUgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIHN0b3JlIHRvIEpTT04uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBUcmFuc2ZlclN0YXRlLnByb3RvdHlwZS50b0pzb24gPSAvKipcbiAgICAgKiBTZXJpYWxpemUgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIHN0b3JlIHRvIEpTT04uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIC8vIENhbGwgdGhlIG9uU2VyaWFsaXplIGNhbGxiYWNrcyBhbmQgcHV0IHRob3NlIHZhbHVlcyBpbnRvIHRoZSBzdG9yZS5cbiAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXkgaW4gdGhpcy5vblNlcmlhbGl6ZUNhbGxiYWNrcykge1xuICAgICAgICAgICAgaWYgKHRoaXMub25TZXJpYWxpemVDYWxsYmFja3MuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3RvcmVba2V5XSA9IHRoaXMub25TZXJpYWxpemVDYWxsYmFja3Nba2V5XSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXRjaCAoLyoqIEB0eXBlIHs/fSAqLyBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybignRXhjZXB0aW9uIGluIG9uU2VyaWFsaXplIGNhbGxiYWNrOiAnLCBlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0d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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n"); /***/ }), /* 9 */, @@ -45,24 +45,24 @@ eval("\nvar __extends = (this && this.__extends) || function (d, b) {\n for ( /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (immutable) */ __webpack_exports__[\"h\"] = toInteger;\n/* harmony export (immutable) */ __webpack_exports__[\"i\"] = toString;\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getValueInRange;\n/* harmony export (immutable) */ __webpack_exports__[\"e\"] = isString;\n/* harmony export (immutable) */ __webpack_exports__[\"d\"] = isNumber;\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = isInteger;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = isDefined;\n/* harmony export (immutable) */ __webpack_exports__[\"f\"] = padNumber;\n/* harmony export (immutable) */ __webpack_exports__[\"g\"] = regExpEscape;\nfunction toInteger(value) {\n return parseInt(\"\" + value, 10);\n}\nfunction toString(value) {\n return (value !== undefined && value !== null) ? \"\" + value : '';\n}\nfunction getValueInRange(value, max, min) {\n if (min === void 0) { min = 0; }\n return Math.max(Math.min(value, max), min);\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction isNumber(value) {\n return !isNaN(toInteger(value));\n}\nfunction isInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction padNumber(value) {\n if (isNumber(value)) {\n return (\"0\" + value).slice(-2);\n }\n else {\n return '';\n }\n}\nfunction regExpEscape(text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n//# sourceMappingURL=util.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvdXRpbC91dGlsLmpzP2RiMjEiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIHRvSW50ZWdlcih2YWx1ZSkge1xuICAgIHJldHVybiBwYXJzZUludChcIlwiICsgdmFsdWUsIDEwKTtcbn1cbmV4cG9ydCBmdW5jdGlvbiB0b1N0cmluZyh2YWx1ZSkge1xuICAgIHJldHVybiAodmFsdWUgIT09IHVuZGVmaW5lZCAmJiB2YWx1ZSAhPT0gbnVsbCkgPyBcIlwiICsgdmFsdWUgOiAnJztcbn1cbmV4cG9ydCBmdW5jdGlvbiBnZXRWYWx1ZUluUmFuZ2UodmFsdWUsIG1heCwgbWluK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bm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3V0aWwvdXRpbC5qc1xuLy8gbW9kdWxlIGlkID0gMThcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///18\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵregisterLocaleData\", function() { return registerLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgLocaleLocalization\", function() { return NgLocaleLocalization; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgLocalization\", function() { return NgLocalization; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerLocaleData\", function() { return registerLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plural\", function() { return Plural; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NumberFormatStyle\", function() { return NumberFormatStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormStyle\", function() { return FormStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TranslationWidth\", function() { return TranslationWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormatWidth\", function() { return FormatWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NumberSymbol\", function() { return NumberSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WeekDay\", function() { return WeekDay; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCurrencySymbol\", function() { return getCurrencySymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDayPeriods\", function() { return getLocaleDayPeriods; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDayNames\", function() { return getLocaleDayNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleMonthNames\", function() { return getLocaleMonthNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleId\", function() { return getLocaleId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleEraNames\", function() { return getLocaleEraNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleWeekEndRange\", function() { return getLocaleWeekEndRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleFirstDayOfWeek\", function() { return getLocaleFirstDayOfWeek; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDateFormat\", function() { return getLocaleDateFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDateTimeFormat\", function() { return getLocaleDateTimeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleExtraDayPeriodRules\", function() { return getLocaleExtraDayPeriodRules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleExtraDayPeriods\", function() { return getLocaleExtraDayPeriods; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocalePluralCase\", function() { return getLocalePluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleTimeFormat\", function() { return getLocaleTimeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleNumberSymbol\", function() { return getLocaleNumberSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleNumberFormat\", function() { return getLocaleNumberFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleCurrencyName\", function() { return getLocaleCurrencyName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleCurrencySymbol\", function() { return getLocaleCurrencySymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵparseCookieValue\", function() { return parseCookieValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommonModule\", function() { return CommonModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedI18NPipesModule\", function() { return DeprecatedI18NPipesModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgClass\", function() { return NgClass; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForOf\", function() { return NgForOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForOfContext\", function() { return NgForOfContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgIf\", function() { return NgIf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgIfContext\", function() { return NgIfContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgPlural\", function() { return NgPlural; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgPluralCase\", function() { return NgPluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgStyle\", function() { return NgStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitch\", function() { return NgSwitch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitchCase\", function() { return NgSwitchCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitchDefault\", function() { return NgSwitchDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgTemplateOutlet\", function() { return NgTemplateOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgComponentOutlet\", function() { return NgComponentOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOCUMENT\", function() { return DOCUMENT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AsyncPipe\", function() { return AsyncPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DatePipe\", function() { return DatePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I18nPluralPipe\", function() { return I18nPluralPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I18nSelectPipe\", function() { return I18nSelectPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonPipe\", function() { return JsonPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LowerCasePipe\", function() { return LowerCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CurrencyPipe\", function() { return CurrencyPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DecimalPipe\", function() { return DecimalPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PercentPipe\", function() { return PercentPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SlicePipe\", function() { return SlicePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UpperCasePipe\", function() { return UpperCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TitleCasePipe\", function() { return TitleCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedDatePipe\", function() { return DeprecatedDatePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedCurrencyPipe\", function() { return DeprecatedCurrencyPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedDecimalPipe\", function() { return DeprecatedDecimalPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedPercentPipe\", function() { return DeprecatedPercentPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_BROWSER_ID\", function() { return PLATFORM_BROWSER_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_SERVER_ID\", function() { return PLATFORM_SERVER_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_WORKER_APP_ID\", function() { return PLATFORM_WORKER_APP_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_WORKER_UI_ID\", function() { return PLATFORM_WORKER_UI_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformBrowser\", function() { return isPlatformBrowser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformServer\", function() { return isPlatformServer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformWorkerApp\", function() { return isPlatformWorkerApp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformWorkerUi\", function() { return isPlatformWorkerUi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PlatformLocation\", function() { return PlatformLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOCATION_INITIALIZED\", function() { return LOCATION_INITIALIZED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LocationStrategy\", function() { return LocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"APP_BASE_HREF\", function() { return APP_BASE_HREF; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HashLocationStrategy\", function() { return HashLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PathLocationStrategy\", function() { return PathLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Location\", function() { return Location; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return COMMON_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return findLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return DEPRECATED_PLURAL_FN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return getPluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return COMMON_DEPRECATED_I18N_PIPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return COMMON_PIPES; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n *\n * `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform\n * agnostic.\n * This means that we can have different implementation of `PlatformLocation` for the different\n * platforms that angular supports. For example, `\\@angular/platform-browser` provides an\n * implementation specific to the browser environment, while `\\@angular/platform-webworker` provides\n * one suitable for use with web workers.\n *\n * The `PlatformLocation` class is used directly by all implementations of {\\@link LocationStrategy}\n * when they need to interact with the DOM apis like pushState, popState, etc...\n *\n * {\\@link LocationStrategy} in turn is used by the {\\@link Location} service which is used directly\n * by the {\\@link Router} in order to navigate between routes. Since all interactions between {\\@link\n * Router} /\n * {\\@link Location} / {\\@link LocationStrategy} and DOM apis flow through the `PlatformLocation`\n * class they are all platform independent.\n *\n * \\@stable\n * @abstract\n */\nvar PlatformLocation = /** @class */ (function () {\n function PlatformLocation() {\n }\n return PlatformLocation;\n}());\n/**\n * \\@whatItDoes indicates when a location is initialized\n * \\@experimental\n */\nvar LOCATION_INITIALIZED = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('Location Initialized');\n/**\n * A serializable version of the event from onPopState or onHashChange\n *\n * \\@experimental\n * @record\n */\n\n/**\n * \\@experimental\n * @record\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * `LocationStrategy` is responsible for representing and reading route state\n * from the browser's URL. Angular provides two strategies:\n * {\\@link HashLocationStrategy} and {\\@link PathLocationStrategy}.\n *\n * This is used under the hood of the {\\@link Location} service.\n *\n * Applications should use the {\\@link Router} or {\\@link Location} services to\n * interact with application route state.\n *\n * For instance, {\\@link HashLocationStrategy} produces URLs like\n * `http://example.com#/foo`, and {\\@link PathLocationStrategy} produces\n * `http://example.com/foo` as an equivalent URL.\n *\n * See these two classes for more.\n *\n * \\@stable\n * @abstract\n */\nvar LocationStrategy = /** @class */ (function () {\n function LocationStrategy() {\n }\n return LocationStrategy;\n}());\n/**\n * The `APP_BASE_HREF` token represents the base href to be used with the\n * {\\@link PathLocationStrategy}.\n *\n * If you're using {\\@link PathLocationStrategy}, you must provide a provider to a string\n * representing the URL prefix that should be preserved when generating and recognizing\n * URLs.\n *\n * ### Example\n *\n * ```typescript\n * import {Component, NgModule} from '\\@angular/core';\n * import {APP_BASE_HREF} from '\\@angular/common';\n *\n * \\@NgModule({\n * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * \\@stable\n */\nvar APP_BASE_HREF = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('appBaseHref');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental\n * @record\n */\n\n/**\n * \\@whatItDoes `Location` is a service that applications can use to interact with a browser's URL.\n * \\@description\n * Depending on which {\\@link LocationStrategy} is used, `Location` will either persist\n * to the URL's path or the URL's hash segment.\n *\n * Note: it's better to use {\\@link Router#navigate} service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n * \\@stable\n */\nvar Location = /** @class */ (function () {\n function Location(platformStrategy) {\n var _this = this;\n /**\n * \\@internal\n */\n this._subject = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this._platformStrategy = platformStrategy;\n var /** @type {?} */ browserBaseHref = this._platformStrategy.getBaseHref();\n this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));\n this._platformStrategy.onPopState(function (ev) {\n _this._subject.emit({\n 'url': _this.path(true),\n 'pop': true,\n 'type': ev.type,\n });\n });\n }\n /**\n * Returns the normalized URL path.\n */\n // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n // removed.\n /**\n * Returns the normalized URL path.\n * @param {?=} includeHash\n * @return {?}\n */\n Location.prototype.path = /**\n * Returns the normalized URL path.\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n return this.normalize(this._platformStrategy.path(includeHash));\n };\n /**\n * Normalizes the given path and compares to the current normalized path.\n */\n /**\n * Normalizes the given path and compares to the current normalized path.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.isCurrentPathEqualTo = /**\n * Normalizes the given path and compares to the current normalized path.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n return this.path() == this.normalize(path + Location.normalizeQueryParams(query));\n };\n /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n */\n /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n * @param {?} url\n * @return {?}\n */\n Location.prototype.normalize = /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));\n };\n /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n */\n /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n * @param {?} url\n * @return {?}\n */\n Location.prototype.prepareExternalUrl = /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n if (url && url[0] !== '/') {\n url = '/' + url;\n }\n return this._platformStrategy.prepareExternalUrl(url);\n };\n // TODO: rename this method to pushState\n /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n */\n /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.go = /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n this._platformStrategy.pushState(null, '', path, query);\n };\n /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n */\n /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.replaceState = /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n this._platformStrategy.replaceState(null, '', path, query);\n };\n /**\n * Navigates forward in the platform's history.\n */\n /**\n * Navigates forward in the platform's history.\n * @return {?}\n */\n Location.prototype.forward = /**\n * Navigates forward in the platform's history.\n * @return {?}\n */\n function () { this._platformStrategy.forward(); };\n /**\n * Navigates back in the platform's history.\n */\n /**\n * Navigates back in the platform's history.\n * @return {?}\n */\n Location.prototype.back = /**\n * Navigates back in the platform's history.\n * @return {?}\n */\n function () { this._platformStrategy.back(); };\n /**\n * Subscribe to the platform's `popState` events.\n */\n /**\n * Subscribe to the platform's `popState` events.\n * @param {?} onNext\n * @param {?=} onThrow\n * @param {?=} onReturn\n * @return {?}\n */\n Location.prototype.subscribe = /**\n * Subscribe to the platform's `popState` events.\n * @param {?} onNext\n * @param {?=} onThrow\n * @param {?=} onReturn\n * @return {?}\n */\n function (onNext, onThrow, onReturn) {\n return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });\n };\n /**\n * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as\n * is.\n * @param {?} params\n * @return {?}\n */\n Location.normalizeQueryParams = /**\n * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as\n * is.\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return params && params[0] !== '?' ? '?' + params : params;\n };\n /**\n * Given 2 parts of a url, join them with a slash if needed.\n * @param {?} start\n * @param {?} end\n * @return {?}\n */\n Location.joinWithSlash = /**\n * Given 2 parts of a url, join them with a slash if needed.\n * @param {?} start\n * @param {?} end\n * @return {?}\n */\n function (start, end) {\n if (start.length == 0) {\n return end;\n }\n if (end.length == 0) {\n return start;\n }\n var /** @type {?} */ slashes = 0;\n if (start.endsWith('/')) {\n slashes++;\n }\n if (end.startsWith('/')) {\n slashes++;\n }\n if (slashes == 2) {\n return start + end.substring(1);\n }\n if (slashes == 1) {\n return start + end;\n }\n return start + '/' + end;\n };\n /**\n * If url has a trailing slash, remove it, otherwise return url as is. This\n * method looks for the first occurence of either #, ?, or the end of the\n * line as `/` characters after any of these should not be replaced.\n * @param {?} url\n * @return {?}\n */\n Location.stripTrailingSlash = /**\n * If url has a trailing slash, remove it, otherwise return url as is. This\n * method looks for the first occurence of either #, ?, or the end of the\n * line as `/` characters after any of these should not be replaced.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ match = url.match(/#|\\?|$/);\n var /** @type {?} */ pathEndIdx = match && match.index || url.length;\n var /** @type {?} */ droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n };\n Location.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Location.ctorParameters = function () { return [\n { type: LocationStrategy, },\n ]; };\n return Location;\n}());\n/**\n * @param {?} baseHref\n * @param {?} url\n * @return {?}\n */\nfunction _stripBaseHref(baseHref, url) {\n return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;\n}\n/**\n * @param {?} url\n * @return {?}\n */\nfunction _stripIndexHtml(url) {\n return url.replace(/\\/index.html$/, '');\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL hash for storing application location data.\n * \\@description\n * `HashLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n * of the browser's URL.\n *\n * For instance, if you call `location.go('/foo')`, the browser's URL will become\n * `example.com#/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar HashLocationStrategy = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(HashLocationStrategy, _super);\n function HashLocationStrategy(_platformLocation, _baseHref) {\n var _this = _super.call(this) || this;\n _this._platformLocation = _platformLocation;\n _this._baseHref = '';\n if (_baseHref != null) {\n _this._baseHref = _baseHref;\n }\n return _this;\n }\n /**\n * @param {?} fn\n * @return {?}\n */\n HashLocationStrategy.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._platformLocation.onPopState(fn);\n this._platformLocation.onHashChange(fn);\n };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.getBaseHref = /**\n * @return {?}\n */\n function () { return this._baseHref; };\n /**\n * @param {?=} includeHash\n * @return {?}\n */\n HashLocationStrategy.prototype.path = /**\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n // the hash value is always prefixed with a `#`\n // and if it is empty then it will stay empty\n var /** @type {?} */ path = this._platformLocation.hash;\n if (path == null)\n path = '#';\n return path.length > 0 ? path.substring(1) : path;\n };\n /**\n * @param {?} internal\n * @return {?}\n */\n HashLocationStrategy.prototype.prepareExternalUrl = /**\n * @param {?} internal\n * @return {?}\n */\n function (internal) {\n var /** @type {?} */ url = Location.joinWithSlash(this._baseHref, internal);\n return url.length > 0 ? ('#' + url) : url;\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n HashLocationStrategy.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, path, queryParams) {\n var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.pushState(state, title, url);\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n HashLocationStrategy.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, path, queryParams) {\n var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.replaceState(state, title, url);\n };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.forward = /**\n * @return {?}\n */\n function () { this._platformLocation.forward(); };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.back = /**\n * @return {?}\n */\n function () { this._platformLocation.back(); };\n HashLocationStrategy.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HashLocationStrategy.ctorParameters = function () { return [\n { type: PlatformLocation, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [APP_BASE_HREF,] },] },\n ]; };\n return HashLocationStrategy;\n}(LocationStrategy));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL for storing application location data.\n * \\@description\n * `PathLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you must provide a {\\@link APP_BASE_HREF}\n * or add a base element to the document. This URL prefix that will be preserved\n * when generating and recognizing URLs.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Similarly, if you add `<base href='/my/app'/>` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar PathLocationStrategy = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(PathLocationStrategy, _super);\n function PathLocationStrategy(_platformLocation, href) {\n var _this = _super.call(this) || this;\n _this._platformLocation = _platformLocation;\n if (href == null) {\n href = _this._platformLocation.getBaseHrefFromDOM();\n }\n if (href == null) {\n throw new Error(\"No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.\");\n }\n _this._baseHref = href;\n return _this;\n }\n /**\n * @param {?} fn\n * @return {?}\n */\n PathLocationStrategy.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._platformLocation.onPopState(fn);\n this._platformLocation.onHashChange(fn);\n };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.getBaseHref = /**\n * @return {?}\n */\n function () { return this._baseHref; };\n /**\n * @param {?} internal\n * @return {?}\n */\n PathLocationStrategy.prototype.prepareExternalUrl = /**\n * @param {?} internal\n * @return {?}\n */\n function (internal) {\n return Location.joinWithSlash(this._baseHref, internal);\n };\n /**\n * @param {?=} includeHash\n * @return {?}\n */\n PathLocationStrategy.prototype.path = /**\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n var /** @type {?} */ pathname = this._platformLocation.pathname +\n Location.normalizeQueryParams(this._platformLocation.search);\n var /** @type {?} */ hash = this._platformLocation.hash;\n return hash && includeHash ? \"\" + pathname + hash : pathname;\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n PathLocationStrategy.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, url, queryParams) {\n var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n this._platformLocation.pushState(state, title, externalUrl);\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n PathLocationStrategy.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, url, queryParams) {\n var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n this._platformLocation.replaceState(state, title, externalUrl);\n };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.forward = /**\n * @return {?}\n */\n function () { this._platformLocation.forward(); };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.back = /**\n * @return {?}\n */\n function () { this._platformLocation.back(); };\n PathLocationStrategy.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n PathLocationStrategy.ctorParameters = function () { return [\n { type: PlatformLocation, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [APP_BASE_HREF,] },] },\n ]; };\n return PathLocationStrategy;\n}(LocationStrategy));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n/**\n * \\@internal\n */\nvar CURRENCIES = {\n 'AOA': [, 'Kz'],\n 'ARS': [, '$'],\n 'AUD': ['A$', '$'],\n 'BAM': [, 'KM'],\n 'BBD': [, '$'],\n 'BDT': [, '৳'],\n 'BMD': [, '$'],\n 'BND': [, '$'],\n 'BOB': [, 'Bs'],\n 'BRL': ['R$'],\n 'BSD': [, '$'],\n 'BWP': [, 'P'],\n 'BYN': [, 'р.'],\n 'BZD': [, '$'],\n 'CAD': ['CA$', '$'],\n 'CLP': [, '$'],\n 'CNY': ['CN¥', '¥'],\n 'COP': [, '$'],\n 'CRC': [, '₡'],\n 'CUC': [, '$'],\n 'CUP': [, '$'],\n 'CZK': [, 'Kč'],\n 'DKK': [, 'kr'],\n 'DOP': [, '$'],\n 'EGP': [, 'E£'],\n 'ESP': [, '₧'],\n 'EUR': ['€'],\n 'FJD': [, '$'],\n 'FKP': [, '£'],\n 'GBP': ['£'],\n 'GEL': [, '₾'],\n 'GIP': [, '£'],\n 'GNF': [, 'FG'],\n 'GTQ': [, 'Q'],\n 'GYD': [, '$'],\n 'HKD': ['HK$', '$'],\n 'HNL': [, 'L'],\n 'HRK': [, 'kn'],\n 'HUF': [, 'Ft'],\n 'IDR': [, 'Rp'],\n 'ILS': ['₪'],\n 'INR': ['₹'],\n 'ISK': [, 'kr'],\n 'JMD': [, '$'],\n 'JPY': ['¥'],\n 'KHR': [, '៛'],\n 'KMF': [, 'CF'],\n 'KPW': [, '₩'],\n 'KRW': ['₩'],\n 'KYD': [, '$'],\n 'KZT': [, '₸'],\n 'LAK': [, '₭'],\n 'LBP': [, 'L£'],\n 'LKR': [, 'Rs'],\n 'LRD': [, '$'],\n 'LTL': [, 'Lt'],\n 'LVL': [, 'Ls'],\n 'MGA': [, 'Ar'],\n 'MMK': [, 'K'],\n 'MNT': [, '₮'],\n 'MUR': [, 'Rs'],\n 'MXN': ['MX$', '$'],\n 'MYR': [, 'RM'],\n 'NAD': [, '$'],\n 'NGN': [, '₦'],\n 'NIO': [, 'C$'],\n 'NOK': [, 'kr'],\n 'NPR': [, 'Rs'],\n 'NZD': ['NZ$', '$'],\n 'PHP': [, '₱'],\n 'PKR': [, 'Rs'],\n 'PLN': [, 'zł'],\n 'PYG': [, '₲'],\n 'RON': [, 'lei'],\n 'RUB': [, '₽'],\n 'RUR': [, 'р.'],\n 'RWF': [, 'RF'],\n 'SBD': [, '$'],\n 'SEK': [, 'kr'],\n 'SGD': [, '$'],\n 'SHP': [, '£'],\n 'SRD': [, '$'],\n 'SSP': [, '£'],\n 'STD': [, 'Db'],\n 'SYP': [, '£'],\n 'THB': [, '฿'],\n 'TOP': [, 'T$'],\n 'TRY': [, '₺'],\n 'TTD': [, '$'],\n 'TWD': ['NT$', '$'],\n 'UAH': [, '₴'],\n 'USD': ['$'],\n 'UYU': [, '$'],\n 'VEF': [, 'Bs'],\n 'VND': ['₫'],\n 'XAF': ['FCFA'],\n 'XCD': ['EC$', '$'],\n 'XOF': ['CFA'],\n 'XPF': ['CFPF'],\n 'ZAR': [, 'R'],\n 'ZMW': [, 'ZK'],\n};\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n/**\n * @param {?} n\n * @return {?}\n */\nfunction plural(n) {\n var /** @type {?} */ i = Math.floor(Math.abs(n)), /** @type {?} */ v = n.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0)\n return 1;\n return 5;\n}\nvar localeEn = [\n 'en',\n [\n ['a', 'p'],\n ['AM', 'PM'],\n ],\n [\n ['AM', 'PM'],\n ,\n ],\n [\n ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\n ],\n ,\n [\n ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n [\n 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ]\n ],\n ,\n [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 0, [6, 0],\n ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],\n ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],\n [\n '{1}, {0}',\n ,\n '{1} \\'at\\' {0}',\n ],\n ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],\n ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'US Dollar', plural\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental i18n support is experimental.\n */\nvar LOCALE_DATA = {};\n/**\n * Register global data to be used internally by Angular. See the\n * {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} data\n * @param {?=} localeId\n * @param {?=} extraData\n * @return {?}\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[0 /* LocaleId */];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][18 /* ExtraData */] = extraData;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar NumberFormatStyle = {\n Decimal: 0,\n Percent: 1,\n Currency: 2,\n Scientific: 3,\n};\nNumberFormatStyle[NumberFormatStyle.Decimal] = \"Decimal\";\nNumberFormatStyle[NumberFormatStyle.Percent] = \"Percent\";\nNumberFormatStyle[NumberFormatStyle.Currency] = \"Currency\";\nNumberFormatStyle[NumberFormatStyle.Scientific] = \"Scientific\";\n/** @enum {number} */\nvar Plural = {\n Zero: 0,\n One: 1,\n Two: 2,\n Few: 3,\n Many: 4,\n Other: 5,\n};\nPlural[Plural.Zero] = \"Zero\";\nPlural[Plural.One] = \"One\";\nPlural[Plural.Two] = \"Two\";\nPlural[Plural.Few] = \"Few\";\nPlural[Plural.Many] = \"Many\";\nPlural[Plural.Other] = \"Other\";\n/** @enum {number} */\nvar FormStyle = {\n Format: 0,\n Standalone: 1,\n};\nFormStyle[FormStyle.Format] = \"Format\";\nFormStyle[FormStyle.Standalone] = \"Standalone\";\n/** @enum {number} */\nvar TranslationWidth = {\n Narrow: 0,\n Abbreviated: 1,\n Wide: 2,\n Short: 3,\n};\nTranslationWidth[TranslationWidth.Narrow] = \"Narrow\";\nTranslationWidth[TranslationWidth.Abbreviated] = \"Abbreviated\";\nTranslationWidth[TranslationWidth.Wide] = \"Wide\";\nTranslationWidth[TranslationWidth.Short] = \"Short\";\n/** @enum {number} */\nvar FormatWidth = {\n Short: 0,\n Medium: 1,\n Long: 2,\n Full: 3,\n};\nFormatWidth[FormatWidth.Short] = \"Short\";\nFormatWidth[FormatWidth.Medium] = \"Medium\";\nFormatWidth[FormatWidth.Long] = \"Long\";\nFormatWidth[FormatWidth.Full] = \"Full\";\n/** @enum {number} */\nvar NumberSymbol = {\n Decimal: 0,\n Group: 1,\n List: 2,\n PercentSign: 3,\n PlusSign: 4,\n MinusSign: 5,\n Exponential: 6,\n SuperscriptingExponent: 7,\n PerMille: 8,\n Infinity: 9,\n NaN: 10,\n TimeSeparator: 11,\n CurrencyDecimal: 12,\n CurrencyGroup: 13,\n};\nNumberSymbol[NumberSymbol.Decimal] = \"Decimal\";\nNumberSymbol[NumberSymbol.Group] = \"Group\";\nNumberSymbol[NumberSymbol.List] = \"List\";\nNumberSymbol[NumberSymbol.PercentSign] = \"PercentSign\";\nNumberSymbol[NumberSymbol.PlusSign] = \"PlusSign\";\nNumberSymbol[NumberSymbol.MinusSign] = \"MinusSign\";\nNumberSymbol[NumberSymbol.Exponential] = \"Exponential\";\nNumberSymbol[NumberSymbol.SuperscriptingExponent] = \"SuperscriptingExponent\";\nNumberSymbol[NumberSymbol.PerMille] = \"PerMille\";\nNumberSymbol[NumberSymbol.Infinity] = \"Infinity\";\nNumberSymbol[NumberSymbol.NaN] = \"NaN\";\nNumberSymbol[NumberSymbol.TimeSeparator] = \"TimeSeparator\";\nNumberSymbol[NumberSymbol.CurrencyDecimal] = \"CurrencyDecimal\";\nNumberSymbol[NumberSymbol.CurrencyGroup] = \"CurrencyGroup\";\n/** @enum {number} */\nvar WeekDay = {\n Sunday: 0,\n Monday: 1,\n Tuesday: 2,\n Wednesday: 3,\n Thursday: 4,\n Friday: 5,\n Saturday: 6,\n};\nWeekDay[WeekDay.Sunday] = \"Sunday\";\nWeekDay[WeekDay.Monday] = \"Monday\";\nWeekDay[WeekDay.Tuesday] = \"Tuesday\";\nWeekDay[WeekDay.Wednesday] = \"Wednesday\";\nWeekDay[WeekDay.Thursday] = \"Thursday\";\nWeekDay[WeekDay.Friday] = \"Friday\";\nWeekDay[WeekDay.Saturday] = \"Saturday\";\n/**\n * The locale id for the chosen locale (e.g `en-GB`).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleId(locale) {\n return findLocaleData(locale)[0 /* LocaleId */];\n}\n/**\n * Periods of the day (e.g. `[AM, PM]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDayPeriods(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ amPmData = /** @type {?} */ ([data[1 /* DayPeriodsFormat */], data[2 /* DayPeriodsStandalone */]]);\n var /** @type {?} */ amPm = getLastDefinedValue(amPmData, formStyle);\n return getLastDefinedValue(amPm, width);\n}\n/**\n * Days of the week for the Gregorian calendar (e.g. `[Sunday, Monday, ... Saturday]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDayNames(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ daysData = /** @type {?} */ ([data[3 /* DaysFormat */], data[4 /* DaysStandalone */]]);\n var /** @type {?} */ days = getLastDefinedValue(daysData, formStyle);\n return getLastDefinedValue(days, width);\n}\n/**\n * Months of the year for the Gregorian calendar (e.g. `[January, February, ...]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleMonthNames(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ monthsData = /** @type {?} */ ([data[5 /* MonthsFormat */], data[6 /* MonthsStandalone */]]);\n var /** @type {?} */ months = getLastDefinedValue(monthsData, formStyle);\n return getLastDefinedValue(months, width);\n}\n/**\n * Eras for the Gregorian calendar (e.g. AD/BC).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleEraNames(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ erasData = /** @type {?} */ (data[7 /* Eras */]);\n return getLastDefinedValue(erasData, width);\n}\n/**\n * First day of the week for this locale, based on english days (Sunday = 0, Monday = 1, ...).\n * For example in french the value would be 1 because the first day of the week is Monday.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleFirstDayOfWeek(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[8 /* FirstDayOfWeek */];\n}\n/**\n * Range of days in the week that represent the week-end for this locale, based on english days\n * (Sunday = 0, Monday = 1, ...).\n * For example in english the value would be [6,0] for Saturday to Sunday.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleWeekEndRange(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[9 /* WeekendRange */];\n}\n/**\n * Date format that depends on the locale.\n *\n * There are four basic date formats:\n * - `full` should contain long-weekday (EEEE), year (y), long-month (MMMM), day (d).\n *\n * For example, English uses `EEEE, MMMM d, y`, corresponding to a date like\n * \"Tuesday, September 14, 1999\".\n *\n * - `long` should contain year, long-month, day.\n *\n * For example, `MMMM d, y`, corresponding to a date like \"September 14, 1999\".\n *\n * - `medium` should contain year, abbreviated-month (MMM), day.\n *\n * For example, `MMM d, y`, corresponding to a date like \"Sep 14, 1999\".\n * For languages that do not use abbreviated months, use the numeric month (MM/M). For example,\n * `y/MM/dd`, corresponding to a date like \"1999/09/14\".\n *\n * - `short` should contain year, numeric-month (MM/M), and day.\n *\n * For example, `M/d/yy`, corresponding to a date like \"9/14/99\".\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDateFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n return getLastDefinedValue(data[10 /* DateFormat */], width);\n}\n/**\n * Time format that depends on the locale.\n *\n * The standard formats include four basic time formats:\n * - `full` should contain hour (h/H), minute (mm), second (ss), and zone (zzzz).\n * - `long` should contain hour, minute, second, and zone (z)\n * - `medium` should contain hour, minute, second.\n * - `short` should contain hour, minute.\n *\n * Note: The patterns depend on whether the main country using your language uses 12-hour time or\n * not:\n * - For 12-hour time, use a pattern like `hh:mm a` using h to mean a 12-hour clock cycle running\n * 1 through 12 (midnight plus 1 minute is 12:01), or using K to mean a 12-hour clock cycle\n * running 0 through 11 (midnight plus 1 minute is 0:01).\n * - For 24-hour time, use a pattern like `HH:mm` using H to mean a 24-hour clock cycle running 0\n * through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running\n * 1 through 24 (midnight plus 1 minute is 24:01).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleTimeFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n return getLastDefinedValue(data[11 /* TimeFormat */], width);\n}\n/**\n * Date-time format that depends on the locale.\n *\n * The date-time pattern shows how to combine separate patterns for date (represented by {1})\n * and time (represented by {0}) into a single pattern. It usually doesn't need to be changed.\n * What you want to pay attention to are:\n * - possibly removing a space for languages that don't use it, such as many East Asian languages\n * - possibly adding a comma, other punctuation, or a combining word\n *\n * For example:\n * - English uses `{1} 'at' {0}` or `{1}, {0}` (depending on date style), while Japanese uses\n * `{1}{0}`.\n * - An English formatted date-time using the combining pattern `{1}, {0}` could be\n * `Dec 10, 2010, 3:59:49 PM`. Notice the comma and space between the date portion and the time\n * portion.\n *\n * There are four formats (`full`, `long`, `medium`, `short`); the determination of which to use\n * is normally based on the date style. For example, if the date has a full month and weekday\n * name, the full combining pattern will be used to combine that with a time. If the date has\n * numeric month, the short version of the combining pattern will be used to combine that with a\n * time. English uses `{1} 'at' {0}` for full and long styles, and `{1}, {0}` for medium and short\n * styles.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDateTimeFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ dateTimeFormatData = /** @type {?} */ (data[12 /* DateTimeFormat */]);\n return getLastDefinedValue(dateTimeFormatData, width);\n}\n/**\n * Number symbol that can be used to replace placeholders in number formats.\n * See {\\@link NumberSymbol} for more information.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} symbol\n * @return {?}\n */\nfunction getLocaleNumberSymbol(locale, symbol) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ res = data[13 /* NumberSymbols */][symbol];\n if (typeof res === 'undefined') {\n if (symbol === NumberSymbol.CurrencyDecimal) {\n return data[13 /* NumberSymbols */][NumberSymbol.Decimal];\n }\n else if (symbol === NumberSymbol.CurrencyGroup) {\n return data[13 /* NumberSymbols */][NumberSymbol.Group];\n }\n }\n return res;\n}\n/**\n * Number format that depends on the locale.\n *\n * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`\n * when used to format the number 12345.678 could result in \"12'345,67\". That would happen if the\n * grouping separator for your language is an apostrophe, and the decimal separator is a comma.\n *\n * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders;\n * they stand for the decimal separator, and so on, and are NOT real characters.\n * You must NOT \"translate\" the placeholders; for example, don't change `.` to `,` even though in\n * your language the decimal point is written with a comma. The symbols should be replaced by the\n * local equivalents, using the Number Symbols for your language.\n *\n * Here are the special characters used in number patterns:\n *\n * | Symbol | Meaning |\n * |--------|---------|\n * | . | Replaced automatically by the character used for the decimal point. |\n * | , | Replaced by the \"grouping\" (thousands) separator. |\n * | 0 | Replaced by a digit (or zero if there aren't enough digits). |\n * | # | Replaced by a digit (or nothing if there aren't enough). |\n * | ¤ | This will be replaced by a currency symbol, such as $ or USD. |\n * | % | This marks a percent format. The % symbol may change position, but must be retained. |\n * | E | This marks a scientific format. The E symbol may change position, but must be retained. |\n * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |\n *\n * You can find more information\n * [on the CLDR website](http://cldr.unicode.org/translation/number-patterns)\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} type\n * @return {?}\n */\nfunction getLocaleNumberFormat(locale, type) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[14 /* NumberFormats */][type];\n}\n/**\n * The symbol used to represent the currency for the main country using this locale (e.g. $ for\n * the locale en-US).\n * The symbol will be `null` if the main country cannot be determined.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleCurrencySymbol(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[15 /* CurrencySymbol */] || null;\n}\n/**\n * The name of the currency for the main country using this locale (e.g. USD for the locale\n * en-US).\n * The name will be `null` if the main country cannot be determined.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleCurrencyName(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[16 /* CurrencyName */] || null;\n}\n/**\n * The locale plural function used by ICU expressions to determine the plural case to use.\n * See {\\@link NgPlural} for more information.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocalePluralCase(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[17 /* PluralCase */];\n}\n/**\n * @param {?} data\n * @return {?}\n */\nfunction checkFullData(data) {\n if (!data[18 /* ExtraData */]) {\n throw new Error(\"Missing extra locale data for the locale \\\"\" + data[0 /* LocaleId */] + \"\\\". Use \\\"registerLocaleData\\\" to load new data. See the \\\"I18n guide\\\" on angular.io to know more.\");\n }\n}\n/**\n * Rules used to determine which day period to use (See `dayPeriods` below).\n * The rules can either be an array or a single value. If it's an array, consider it as \"from\"\n * and \"to\". If it's a single value then it means that the period is only valid at this exact\n * value.\n * There is always the same number of rules as the number of day periods, which means that the\n * first rule is applied to the first day period and so on.\n * You should fallback to AM/PM when there are no rules available.\n *\n * Note: this is only available if you load the full locale data.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleExtraDayPeriodRules(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n checkFullData(data);\n var /** @type {?} */ rules = data[18 /* ExtraData */][2 /* ExtraDayPeriodsRules */] || [];\n return rules.map(function (rule) {\n if (typeof rule === 'string') {\n return extractTime(rule);\n }\n return [extractTime(rule[0]), extractTime(rule[1])];\n });\n}\n/**\n * Day Periods indicate roughly how the day is broken up in different languages (e.g. morning,\n * noon, afternoon, midnight, ...).\n * You should use the function {\\@link getLocaleExtraDayPeriodRules} to determine which period to\n * use.\n * You should fallback to AM/PM when there are no day periods available.\n *\n * Note: this is only available if you load the full locale data.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleExtraDayPeriods(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n checkFullData(data);\n var /** @type {?} */ dayPeriodsData = /** @type {?} */ ([\n data[18 /* ExtraData */][0 /* ExtraDayPeriodFormats */],\n data[18 /* ExtraData */][1 /* ExtraDayPeriodStandalone */]\n ]);\n var /** @type {?} */ dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];\n return getLastDefinedValue(dayPeriods, width) || [];\n}\n/**\n * Returns the first value that is defined in an array, going backwards.\n *\n * To avoid repeating the same data (e.g. when \"format\" and \"standalone\" are the same) we only\n * add the first one to the locale data arrays, the other ones are only defined when different.\n * We use this function to retrieve the first defined value.\n *\n * \\@experimental i18n support is experimental.\n * @template T\n * @param {?} data\n * @param {?} index\n * @return {?}\n */\nfunction getLastDefinedValue(data, index) {\n for (var /** @type {?} */ i = index; i > -1; i--) {\n if (typeof data[i] !== 'undefined') {\n return data[i];\n }\n }\n throw new Error('Locale data API: locale data undefined');\n}\n/**\n * Extract the hours and minutes from a string like \"15:45\"\n * @param {?} time\n * @return {?}\n */\nfunction extractTime(time) {\n var _a = time.split(':'), h = _a[0], m = _a[1];\n return { hours: +h, minutes: +m };\n}\n/**\n * Finds the locale data for a locale id\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction findLocaleData(locale) {\n var /** @type {?} */ normalizedLocale = locale.toLowerCase().replace(/_/g, '-');\n var /** @type {?} */ match = LOCALE_DATA[normalizedLocale];\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n var /** @type {?} */ parentLocale = normalizedLocale.split('-')[0];\n match = LOCALE_DATA[parentLocale];\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new Error(\"Missing locale data for the locale \\\"\" + locale + \"\\\".\");\n}\n/**\n * Return the currency symbol for a given currency code, or the code if no symbol available\n * (e.g.: format narrow = $, format wide = US$, code = USD)\n *\n * \\@experimental i18n support is experimental.\n * @param {?} code\n * @param {?} format\n * @return {?}\n */\nfunction getCurrencySymbol(code, format) {\n var /** @type {?} */ currency = CURRENCIES[code] || [];\n var /** @type {?} */ symbolNarrow = currency[1];\n if (format === 'narrow' && typeof symbolNarrow === 'string') {\n return symbolNarrow;\n }\n return currency[0] || code;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @deprecated from v5\n */\nvar DEPRECATED_PLURAL_FN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('UseV4Plurals');\n/**\n * \\@experimental\n * @abstract\n */\nvar NgLocalization = /** @class */ (function () {\n function NgLocalization() {\n }\n return NgLocalization;\n}());\n/**\n * Returns the plural category for a given value.\n * - \"=value\" when the case exists,\n * - the plural category otherwise\n * @param {?} value\n * @param {?} cases\n * @param {?} ngLocalization\n * @param {?=} locale\n * @return {?}\n */\nfunction getPluralCategory(value, cases, ngLocalization, locale) {\n var /** @type {?} */ key = \"=\" + value;\n if (cases.indexOf(key) > -1) {\n return key;\n }\n key = ngLocalization.getPluralCategory(value, locale);\n if (cases.indexOf(key) > -1) {\n return key;\n }\n if (cases.indexOf('other') > -1) {\n return 'other';\n }\n throw new Error(\"No plural message found for value \\\"\" + value + \"\\\"\");\n}\n/**\n * Returns the plural case based on the locale\n *\n * \\@experimental\n */\nvar NgLocaleLocalization = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(NgLocaleLocalization, _super);\n function NgLocaleLocalization(locale, /** @deprecated from v5 */\n deprecatedPluralFn) {\n var _this = _super.call(this) || this;\n _this.locale = locale;\n _this.deprecatedPluralFn = deprecatedPluralFn;\n return _this;\n }\n /**\n * @param {?} value\n * @param {?=} locale\n * @return {?}\n */\n NgLocaleLocalization.prototype.getPluralCategory = /**\n * @param {?} value\n * @param {?=} locale\n * @return {?}\n */\n function (value, locale) {\n var /** @type {?} */ plural = this.deprecatedPluralFn ? this.deprecatedPluralFn(locale || this.locale, value) :\n getLocalePluralCase(locale || this.locale)(value);\n switch (plural) {\n case Plural.Zero:\n return 'zero';\n case Plural.One:\n return 'one';\n case Plural.Two:\n return 'two';\n case Plural.Few:\n return 'few';\n case Plural.Many:\n return 'many';\n default:\n return 'other';\n }\n };\n NgLocaleLocalization.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgLocaleLocalization.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [DEPRECATED_PLURAL_FN,] },] },\n ]; };\n return NgLocaleLocalization;\n}(NgLocalization));\n/**\n * Returns the plural case based on the locale\n *\n * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts\n * \\@experimental\n * @param {?} locale\n * @param {?} nLike\n * @return {?}\n */\nfunction getPluralCase(locale, nLike) {\n // TODO(vicb): lazy compute\n if (typeof nLike === 'string') {\n nLike = parseInt(/** @type {?} */ (nLike), 10);\n }\n var /** @type {?} */ n = /** @type {?} */ (nLike);\n var /** @type {?} */ nDecimal = n.toString().replace(/^[^.]*\\.?/, '');\n var /** @type {?} */ i = Math.floor(Math.abs(n));\n var /** @type {?} */ v = nDecimal.length;\n var /** @type {?} */ f = parseInt(nDecimal, 10);\n var /** @type {?} */ t = parseInt(n.toString().replace(/^[^.]*\\.?|0+$/g, ''), 10) || 0;\n var /** @type {?} */ lang = locale.split('-')[0].toLowerCase();\n switch (lang) {\n case 'af':\n case 'asa':\n case 'az':\n case 'bem':\n case 'bez':\n case 'bg':\n case 'brx':\n case 'ce':\n case 'cgg':\n case 'chr':\n case 'ckb':\n case 'ee':\n case 'el':\n case 'eo':\n case 'es':\n case 'eu':\n case 'fo':\n case 'fur':\n case 'gsw':\n case 'ha':\n case 'haw':\n case 'hu':\n case 'jgo':\n case 'jmc':\n case 'ka':\n case 'kk':\n case 'kkj':\n case 'kl':\n case 'ks':\n case 'ksb':\n case 'ky':\n case 'lb':\n case 'lg':\n case 'mas':\n case 'mgo':\n case 'ml':\n case 'mn':\n case 'nb':\n case 'nd':\n case 'ne':\n case 'nn':\n case 'nnh':\n case 'nyn':\n case 'om':\n case 'or':\n case 'os':\n case 'ps':\n case 'rm':\n case 'rof':\n case 'rwk':\n case 'saq':\n case 'seh':\n case 'sn':\n case 'so':\n case 'sq':\n case 'ta':\n case 'te':\n case 'teo':\n case 'tk':\n case 'tr':\n case 'ug':\n case 'uz':\n case 'vo':\n case 'vun':\n case 'wae':\n case 'xog':\n if (n === 1)\n return Plural.One;\n return Plural.Other;\n case 'ak':\n case 'ln':\n case 'mg':\n case 'pa':\n case 'ti':\n if (n === Math.floor(n) && n >= 0 && n <= 1)\n return Plural.One;\n return Plural.Other;\n case 'am':\n case 'as':\n case 'bn':\n case 'fa':\n case 'gu':\n case 'hi':\n case 'kn':\n case 'mr':\n case 'zu':\n if (i === 0 || n === 1)\n return Plural.One;\n return Plural.Other;\n case 'ar':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99)\n return Plural.Many;\n return Plural.Other;\n case 'ast':\n case 'ca':\n case 'de':\n case 'en':\n case 'et':\n case 'fi':\n case 'fy':\n case 'gl':\n case 'it':\n case 'nl':\n case 'sv':\n case 'sw':\n case 'ur':\n case 'yi':\n if (i === 1 && v === 0)\n return Plural.One;\n return Plural.Other;\n case 'be':\n if (n % 10 === 1 && !(n % 100 === 11))\n return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&\n !(n % 100 >= 12 && n % 100 <= 14))\n return Plural.Few;\n if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||\n n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'br':\n if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))\n return Plural.One;\n if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))\n return Plural.Two;\n if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&\n !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||\n n % 100 >= 90 && n % 100 <= 99))\n return Plural.Few;\n if (!(n === 0) && n % 1e6 === 0)\n return Plural.Many;\n return Plural.Other;\n case 'bs':\n case 'hr':\n case 'sr':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14) ||\n f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&\n !(f % 100 >= 12 && f % 100 <= 14))\n return Plural.Few;\n return Plural.Other;\n case 'cs':\n case 'sk':\n if (i === 1 && v === 0)\n return Plural.One;\n if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0)\n return Plural.Few;\n if (!(v === 0))\n return Plural.Many;\n return Plural.Other;\n case 'cy':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n === 3)\n return Plural.Few;\n if (n === 6)\n return Plural.Many;\n return Plural.Other;\n case 'da':\n if (n === 1 || !(t === 0) && (i === 0 || i === 1))\n return Plural.One;\n return Plural.Other;\n case 'dsb':\n case 'hsb':\n if (v === 0 && i % 100 === 1 || f % 100 === 1)\n return Plural.One;\n if (v === 0 && i % 100 === 2 || f % 100 === 2)\n return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||\n f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)\n return Plural.Few;\n return Plural.Other;\n case 'ff':\n case 'fr':\n case 'hy':\n case 'kab':\n if (i === 0 || i === 1)\n return Plural.One;\n return Plural.Other;\n case 'fil':\n if (v === 0 && (i === 1 || i === 2 || i === 3) ||\n v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||\n !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))\n return Plural.One;\n return Plural.Other;\n case 'ga':\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n === Math.floor(n) && n >= 3 && n <= 6)\n return Plural.Few;\n if (n === Math.floor(n) && n >= 7 && n <= 10)\n return Plural.Many;\n return Plural.Other;\n case 'gd':\n if (n === 1 || n === 11)\n return Plural.One;\n if (n === 2 || n === 12)\n return Plural.Two;\n if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19))\n return Plural.Few;\n return Plural.Other;\n case 'gv':\n if (v === 0 && i % 10 === 1)\n return Plural.One;\n if (v === 0 && i % 10 === 2)\n return Plural.Two;\n if (v === 0 &&\n (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))\n return Plural.Few;\n if (!(v === 0))\n return Plural.Many;\n return Plural.Other;\n case 'he':\n if (i === 1 && v === 0)\n return Plural.One;\n if (i === 2 && v === 0)\n return Plural.Two;\n if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0)\n return Plural.Many;\n return Plural.Other;\n case 'is':\n if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0))\n return Plural.One;\n return Plural.Other;\n case 'ksh':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n return Plural.Other;\n case 'kw':\n case 'naq':\n case 'se':\n case 'smn':\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n return Plural.Other;\n case 'lag':\n if (n === 0)\n return Plural.Zero;\n if ((i === 0 || i === 1) && !(n === 0))\n return Plural.One;\n return Plural.Other;\n case 'lt':\n if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&\n !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.Few;\n if (!(f === 0))\n return Plural.Many;\n return Plural.Other;\n case 'lv':\n case 'prg':\n if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||\n v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)\n return Plural.Zero;\n if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||\n !(v === 2) && f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mk':\n if (v === 0 && i % 10 === 1 || f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mt':\n if (n === 1)\n return Plural.One;\n if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19)\n return Plural.Many;\n return Plural.Other;\n case 'pl':\n if (i === 1 && v === 0)\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'pt':\n if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2))\n return Plural.One;\n return Plural.Other;\n case 'ro':\n if (i === 1 && v === 0)\n return Plural.One;\n if (!(v === 0) || n === 0 ||\n !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)\n return Plural.Few;\n return Plural.Other;\n case 'ru':\n case 'uk':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && i % 10 === 0 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'shi':\n if (i === 0 || n === 1)\n return Plural.One;\n if (n === Math.floor(n) && n >= 2 && n <= 10)\n return Plural.Few;\n return Plural.Other;\n case 'si':\n if (n === 0 || n === 1 || i === 0 && f === 1)\n return Plural.One;\n return Plural.Other;\n case 'sl':\n if (v === 0 && i % 100 === 1)\n return Plural.One;\n if (v === 0 && i % 100 === 2)\n return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))\n return Plural.Few;\n return Plural.Other;\n case 'tzm':\n if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)\n return Plural.One;\n return Plural.Other;\n // When there is no specification, the default is always \"other\"\n // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules\n // > other (required—general plural form — also used if the language only has a single form)\n default:\n return Plural.Other;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} cookieStr\n * @param {?} name\n * @return {?}\n */\nfunction parseCookieValue(cookieStr, name) {\n name = encodeURIComponent(name);\n for (var _i = 0, _a = cookieStr.split(';'); _i < _a.length; _i++) {\n var cookie = _a[_i];\n var /** @type {?} */ eqIndex = cookie.indexOf('=');\n var _b = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], cookieName = _b[0], cookieValue = _b[1];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds and removes CSS classes on an HTML element.\n *\n * \\@howToUse\n * ```\n * <some-element [ngClass]=\"'first second'\">...</some-element>\n *\n * <some-element [ngClass]=\"['first', 'second']\">...</some-element>\n *\n * <some-element [ngClass]=\"{'first': true, 'second': true, 'third': false}\">...</some-element>\n *\n * <some-element [ngClass]=\"stringExp|arrayExp|objExp\">...</some-element>\n *\n * <some-element [ngClass]=\"{'class1 class2 class3' : true}\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n * - `string` - the CSS classes listed in the string (space delimited) are added,\n * - `Array` - the CSS classes declared as Array elements are added,\n * - `Object` - keys are CSS classes that get added when the expression given in the value\n * evaluates to a truthy value, otherwise they are removed.\n *\n * \\@stable\n */\nvar NgClass = /** @class */ (function () {\n function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {\n this._iterableDiffers = _iterableDiffers;\n this._keyValueDiffers = _keyValueDiffers;\n this._ngEl = _ngEl;\n this._renderer = _renderer;\n this._initialClasses = [];\n }\n Object.defineProperty(NgClass.prototype, \"klass\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._applyInitialClasses(true);\n this._initialClasses = typeof v === 'string' ? v.split(/\\s+/) : [];\n this._applyInitialClasses(false);\n this._applyClasses(this._rawClass, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgClass.prototype, \"ngClass\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._cleanupClasses(this._rawClass);\n this._iterableDiffer = null;\n this._keyValueDiffer = null;\n this._rawClass = typeof v === 'string' ? v.split(/\\s+/) : v;\n if (this._rawClass) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisListLikeIterable\"])(this._rawClass)) {\n this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();\n }\n else {\n this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgClass.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._iterableDiffer) {\n var /** @type {?} */ iterableChanges = this._iterableDiffer.diff(/** @type {?} */ (this._rawClass));\n if (iterableChanges) {\n this._applyIterableChanges(iterableChanges);\n }\n }\n else if (this._keyValueDiffer) {\n var /** @type {?} */ keyValueChanges = this._keyValueDiffer.diff(/** @type {?} */ (this._rawClass));\n if (keyValueChanges) {\n this._applyKeyValueChanges(keyValueChanges);\n }\n }\n };\n /**\n * @param {?} rawClassVal\n * @return {?}\n */\n NgClass.prototype._cleanupClasses = /**\n * @param {?} rawClassVal\n * @return {?}\n */\n function (rawClassVal) {\n this._applyClasses(rawClassVal, true);\n this._applyInitialClasses(false);\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgClass.prototype._applyKeyValueChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n changes.forEachRemovedItem(function (record) {\n if (record.previousValue) {\n _this._toggleClass(record.key, false);\n }\n });\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgClass.prototype._applyIterableChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachAddedItem(function (record) {\n if (typeof record.item === 'string') {\n _this._toggleClass(record.item, true);\n }\n else {\n throw new Error(\"NgClass can only toggle CSS classes expressed as strings, got \" + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵstringify\"])(record.item));\n }\n });\n changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });\n };\n /**\n * @param {?} isCleanup\n * @return {?}\n */\n NgClass.prototype._applyInitialClasses = /**\n * @param {?} isCleanup\n * @return {?}\n */\n function (isCleanup) {\n var _this = this;\n this._initialClasses.forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n };\n /**\n * @param {?} rawClassVal\n * @param {?} isCleanup\n * @return {?}\n */\n NgClass.prototype._applyClasses = /**\n * @param {?} rawClassVal\n * @param {?} isCleanup\n * @return {?}\n */\n function (rawClassVal, isCleanup) {\n var _this = this;\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n (/** @type {?} */ (rawClassVal)).forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n }\n else {\n Object.keys(rawClassVal).forEach(function (klass) {\n if (rawClassVal[klass] != null)\n _this._toggleClass(klass, !isCleanup);\n });\n }\n }\n };\n /**\n * @param {?} klass\n * @param {?} enabled\n * @return {?}\n */\n NgClass.prototype._toggleClass = /**\n * @param {?} klass\n * @param {?} enabled\n * @return {?}\n */\n function (klass, enabled) {\n var _this = this;\n klass = klass.trim();\n if (klass) {\n klass.split(/\\s+/g).forEach(function (klass) {\n if (enabled) {\n _this._renderer.addClass(_this._ngEl.nativeElement, klass);\n }\n else {\n _this._renderer.removeClass(_this._ngEl.nativeElement, klass);\n }\n });\n }\n };\n NgClass.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngClass]' },] },\n ];\n /** @nocollapse */\n NgClass.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"IterableDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"KeyValueDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n NgClass.propDecorators = {\n \"klass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['class',] },],\n \"ngClass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgClass;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Instantiates a single {\\@link Component} type and inserts its Host View into current View.\n * `NgComponentOutlet` provides a declarative approach for dynamic component creation.\n *\n * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and\n * any existing component will get destroyed.\n *\n * ### Fine tune control\n *\n * You can control the component creation process by using the following optional attributes:\n *\n * * `ngComponentOutletInjector`: Optional custom {\\@link Injector} that will be used as parent for\n * the Component. Defaults to the injector of the current view container.\n *\n * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content\n * section of the component, if exists.\n *\n * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other\n * module, then load a component from that module.\n *\n * ### Syntax\n *\n * Simple\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression\"></ng-container>\n * ```\n *\n * Customized injector/content\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n * injector: injectorExpression;\n * content: contentNodesExpression;\">\n * </ng-container>\n * ```\n *\n * Customized ngModuleFactory\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n * ngModuleFactory: moduleFactory;\">\n * </ng-container>\n * ```\n * ## Example\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}\n *\n * A more complete example with additional options:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}\n * A more complete example with ngModuleFactory:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}\n *\n * \\@experimental\n */\nvar NgComponentOutlet = /** @class */ (function () {\n function NgComponentOutlet(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n this._componentRef = null;\n this._moduleRef = null;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgComponentOutlet.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._viewContainerRef.clear();\n this._componentRef = null;\n if (this.ngComponentOutlet) {\n var /** @type {?} */ elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;\n if (changes['ngComponentOutletNgModuleFactory']) {\n if (this._moduleRef)\n this._moduleRef.destroy();\n if (this.ngComponentOutletNgModuleFactory) {\n var /** @type {?} */ parentModule = elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModuleRef\"]);\n this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);\n }\n else {\n this._moduleRef = null;\n }\n }\n var /** @type {?} */ componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :\n elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"]);\n var /** @type {?} */ componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);\n this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);\n }\n };\n /**\n * @return {?}\n */\n NgComponentOutlet.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._moduleRef)\n this._moduleRef.destroy();\n };\n NgComponentOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngComponentOutlet]' },] },\n ];\n /** @nocollapse */\n NgComponentOutlet.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n ]; };\n NgComponentOutlet.propDecorators = {\n \"ngComponentOutlet\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletInjector\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletContent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletNgModuleFactory\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgComponentOutlet;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar NgForOfContext = /** @class */ (function () {\n function NgForOfContext($implicit, ngForOf, index, count) {\n this.$implicit = $implicit;\n this.ngForOf = ngForOf;\n this.index = index;\n this.count = count;\n }\n Object.defineProperty(NgForOfContext.prototype, \"first\", {\n get: /**\n * @return {?}\n */\n function () { return this.index === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"last\", {\n get: /**\n * @return {?}\n */\n function () { return this.index === this.count - 1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"even\", {\n get: /**\n * @return {?}\n */\n function () { return this.index % 2 === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"odd\", {\n get: /**\n * @return {?}\n */\n function () { return !this.even; },\n enumerable: true,\n configurable: true\n });\n return NgForOfContext;\n}());\n/**\n * The `NgForOf` directive instantiates a template once per item from an iterable. The context\n * for each instantiated template inherits from the outer context with the given loop variable\n * set to the current item from the iterable.\n *\n * ### Local Variables\n *\n * `NgForOf` provides several exported values that can be aliased to local variables:\n *\n * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe (`userStreams |\n * async`).\n * - `index: number`: The index of the current item in the iterable.\n * - `first: boolean`: True when the item is the first item in the iterable.\n * - `last: boolean`: True when the item is the last item in the iterable.\n * - `even: boolean`: True when the item has an even index in the iterable.\n * - `odd: boolean`: True when the item has an odd index in the iterable.\n *\n * ```\n * <li *ngFor=\"let user of userObservable | async as users; index as i; first as isFirst\">\n * {{i}}/{{users.length}}. {{user}} <span *ngIf=\"isFirst\">default</span>\n * </li>\n * ```\n *\n * ### Change Propagation\n *\n * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n * * Otherwise, the DOM element for that item will remain the same.\n *\n * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n * those changes in the DOM. This has important implications for animations and any stateful\n * controls (such as `<input>` elements which accept user input) that are present. Inserted rows can\n * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n * such as user input.\n *\n * It is possible for the identities of elements in the iterator to change while the data does not.\n * This can happen, for example, if the iterator produced from an RPC to the server, and that\n * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with\n * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old\n * elements were deleted and all new elements inserted). This is an expensive operation and should\n * be avoided if possible.\n *\n * To customize the default tracking algorithm, `NgForOf` supports `trackBy` option.\n * `trackBy` takes a function which has two arguments: `index` and `item`.\n * If `trackBy` is given, Angular tracks changes by the return value of the function.\n *\n * ### Syntax\n *\n * - `<li *ngFor=\"let item of items; index as i; trackBy: trackByFn\">...</li>`\n *\n * With `<ng-template>` element:\n *\n * ```\n * <ng-template ngFor let-item [ngForOf]=\"items\" let-i=\"index\" [ngForTrackBy]=\"trackByFn\">\n * <li>...</li>\n * </ng-template>\n * ```\n *\n * ### Example\n *\n * See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed\n * example.\n *\n * \\@stable\n */\nvar NgForOf = /** @class */ (function () {\n function NgForOf(_viewContainer, _template, _differs) {\n this._viewContainer = _viewContainer;\n this._template = _template;\n this._differs = _differs;\n this._differ = null;\n }\n Object.defineProperty(NgForOf.prototype, \"ngForTrackBy\", {\n get: /**\n * @return {?}\n */\n function () { return this._trackByFn; },\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"isDevMode\"])() && fn != null && typeof fn !== 'function') {\n // TODO(vicb): use a log service once there is a public one available\n if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn(\"trackBy must be a function, but received \" + JSON.stringify(fn) + \". \" +\n \"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.\");\n }\n }\n this._trackByFn = fn;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOf.prototype, \"ngForTemplate\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1\n // The current type is too restrictive; a template that just uses index, for example,\n // should be acceptable.\n if (value) {\n this._template = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n NgForOf.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('ngForOf' in changes) {\n // React on ngForOf changes only once all inputs have been initialized\n var /** @type {?} */ value = changes['ngForOf'].currentValue;\n if (!this._differ && value) {\n try {\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n }\n catch (/** @type {?} */ e) {\n throw new Error(\"Cannot find a differ supporting object '\" + value + \"' of type '\" + getTypeNameForDebugging(value) + \"'. NgFor only supports binding to Iterables such as Arrays.\");\n }\n }\n }\n };\n /**\n * @return {?}\n */\n NgForOf.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._differ) {\n var /** @type {?} */ changes = this._differ.diff(this.ngForOf);\n if (changes)\n this._applyChanges(changes);\n }\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgForOf.prototype._applyChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n var /** @type {?} */ insertTuples = [];\n changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {\n if (item.previousIndex == null) {\n var /** @type {?} */ view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(/** @type {?} */ ((null)), _this.ngForOf, -1, -1), currentIndex);\n var /** @type {?} */ tuple = new RecordViewTuple(item, view);\n insertTuples.push(tuple);\n }\n else if (currentIndex == null) {\n _this._viewContainer.remove(adjustedPreviousIndex);\n }\n else {\n var /** @type {?} */ view = /** @type {?} */ ((_this._viewContainer.get(adjustedPreviousIndex)));\n _this._viewContainer.move(view, currentIndex);\n var /** @type {?} */ tuple = new RecordViewTuple(item, /** @type {?} */ (view));\n insertTuples.push(tuple);\n }\n });\n for (var /** @type {?} */ i = 0; i < insertTuples.length; i++) {\n this._perViewChange(insertTuples[i].view, insertTuples[i].record);\n }\n for (var /** @type {?} */ i = 0, /** @type {?} */ ilen = this._viewContainer.length; i < ilen; i++) {\n var /** @type {?} */ viewRef = /** @type {?} */ (this._viewContainer.get(i));\n viewRef.context.index = i;\n viewRef.context.count = ilen;\n }\n changes.forEachIdentityChange(function (record) {\n var /** @type {?} */ viewRef = /** @type {?} */ (_this._viewContainer.get(record.currentIndex));\n viewRef.context.$implicit = record.item;\n });\n };\n /**\n * @param {?} view\n * @param {?} record\n * @return {?}\n */\n NgForOf.prototype._perViewChange = /**\n * @param {?} view\n * @param {?} record\n * @return {?}\n */\n function (view, record) {\n view.context.$implicit = record.item;\n };\n NgForOf.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngFor][ngForOf]' },] },\n ];\n /** @nocollapse */\n NgForOf.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"IterableDiffers\"], },\n ]; };\n NgForOf.propDecorators = {\n \"ngForOf\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngForTrackBy\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngForTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgForOf;\n}());\nvar RecordViewTuple = /** @class */ (function () {\n function RecordViewTuple(record, view) {\n this.record = record;\n this.view = view;\n }\n return RecordViewTuple;\n}());\n/**\n * @param {?} type\n * @return {?}\n */\nfunction getTypeNameForDebugging(type) {\n return type['name'] || typeof type;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Conditionally includes a template based on the value of an `expression`.\n *\n * `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place\n * when expression is truthy or falsy respectively. Typically the:\n * - `then` template is the inline template of `ngIf` unless bound to a different value.\n * - `else` template is blank unless it is bound.\n *\n * ## Most common usage\n *\n * The most common usage of the `ngIf` directive is to conditionally show the inline template as\n * seen in this example:\n * {\\@example common/ngIf/ts/module.ts region='NgIfSimple'}\n *\n * ## Showing an alternative template using `else`\n *\n * If it is necessary to display a template when the `expression` is falsy use the `else` template\n * binding as shown. Note that the `else` binding points to a `<ng-template>` labeled `#elseBlock`.\n * The template can be defined anywhere in the component view but is typically placed right after\n * `ngIf` for readability.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfElse'}\n *\n * ## Using non-inlined `then` template\n *\n * Usually the `then` template is the inlined template of the `ngIf`, but it can be changed using\n * a binding (just like `else`). Because `then` and `else` are bindings, the template references can\n * change at runtime as shown in this example.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n *\n * ## Storing conditional result in a variable\n *\n * A common pattern is that we need to show a set of properties from the same object. If the\n * object is undefined, then we have to use the safe-traversal-operator `?.` to guard against\n * dereferencing a `null` value. This is especially the case when waiting on async data such as\n * when using the `async` pipe as shown in following example:\n *\n * ```\n * Hello {{ (userStream|async)?.last }}, {{ (userStream|async)?.first }}!\n * ```\n *\n * There are several inefficiencies in the above example:\n * - We create multiple subscriptions on `userStream`. One for each `async` pipe, or two in the\n * example above.\n * - We cannot display an alternative screen while waiting for the data to arrive asynchronously.\n * - We have to use the safe-traversal-operator `?.` to access properties, which is cumbersome.\n * - We have to place the `async` pipe in parenthesis.\n *\n * A better way to do this is to use `ngIf` and store the result of the condition in a local\n * variable as shown in the the example below:\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfAs'}\n *\n * Notice that:\n * - We use only one `async` pipe and hence only one subscription gets created.\n * - `ngIf` stores the result of the `userStream|async` in the local variable `user`.\n * - The local `user` can then be bound repeatedly in a more efficient way.\n * - No need to use the safe-traversal-operator `?.` to access properties as `ngIf` will only\n * display the data if `userStream` returns a value.\n * - We can display an alternative template while waiting for the data.\n *\n * ### Syntax\n *\n * Simple form:\n * - `<div *ngIf=\"condition\">...</div>`\n * - `<ng-template [ngIf]=\"condition\"><div>...</div></ng-template>`\n *\n * Form with an else block:\n * ```\n * <div *ngIf=\"condition; else elseBlock\">...</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with a `then` and `else` block:\n * ```\n * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n * <ng-template #thenBlock>...</ng-template>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with storing the value locally:\n * ```\n * <div *ngIf=\"condition as value; else elseBlock\">{{value}}</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * \\@stable\n */\nvar NgIf = /** @class */ (function () {\n function NgIf(_viewContainer, templateRef) {\n this._viewContainer = _viewContainer;\n this._context = new NgIfContext();\n this._thenTemplateRef = null;\n this._elseTemplateRef = null;\n this._thenViewRef = null;\n this._elseViewRef = null;\n this._thenTemplateRef = templateRef;\n }\n Object.defineProperty(NgIf.prototype, \"ngIf\", {\n set: /**\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgIf.prototype, \"ngIfThen\", {\n set: /**\n * @param {?} templateRef\n * @return {?}\n */\n function (templateRef) {\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgIf.prototype, \"ngIfElse\", {\n set: /**\n * @param {?} templateRef\n * @return {?}\n */\n function (templateRef) {\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgIf.prototype._updateView = /**\n * @return {?}\n */\n function () {\n if (this._context.$implicit) {\n if (!this._thenViewRef) {\n this._viewContainer.clear();\n this._elseViewRef = null;\n if (this._thenTemplateRef) {\n this._thenViewRef =\n this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n }\n }\n }\n else {\n if (!this._elseViewRef) {\n this._viewContainer.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef =\n this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n }\n }\n }\n };\n NgIf.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngIf]' },] },\n ];\n /** @nocollapse */\n NgIf.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n NgIf.propDecorators = {\n \"ngIf\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngIfThen\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngIfElse\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgIf;\n}());\n/**\n * \\@stable\n */\nvar NgIfContext = /** @class */ (function () {\n function NgIfContext() {\n this.$implicit = null;\n this.ngIf = null;\n }\n return NgIfContext;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SwitchView = /** @class */ (function () {\n function SwitchView(_viewContainerRef, _templateRef) {\n this._viewContainerRef = _viewContainerRef;\n this._templateRef = _templateRef;\n this._created = false;\n }\n /**\n * @return {?}\n */\n SwitchView.prototype.create = /**\n * @return {?}\n */\n function () {\n this._created = true;\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n };\n /**\n * @return {?}\n */\n SwitchView.prototype.destroy = /**\n * @return {?}\n */\n function () {\n this._created = false;\n this._viewContainerRef.clear();\n };\n /**\n * @param {?} created\n * @return {?}\n */\n SwitchView.prototype.enforceState = /**\n * @param {?} created\n * @return {?}\n */\n function (created) {\n if (created && !this._created) {\n this.create();\n }\n else if (!created && this._created) {\n this.destroy();\n }\n };\n return SwitchView;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees when the nest match expressions matches the switch\n * expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n * <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n * <ng-container *ngSwitchCase=\"match_expression_3\">\n * <!-- use a ng-container to group multiple root nodes -->\n * <inner-element></inner-element>\n * <inner-other-element></inner-other-element>\n * </ng-container>\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n * \\@description\n *\n * `NgSwitch` stamps out nested views when their match expression value matches the value of the\n * switch expression.\n *\n * In other words:\n * - you define a container element (where you place the directive with a switch expression on the\n * `[ngSwitch]=\"...\"` attribute)\n * - you define inner views inside the `NgSwitch` and place a `*ngSwitchCase` attribute on the view\n * root elements.\n *\n * Elements within `NgSwitch` but outside of a `NgSwitchCase` or `NgSwitchDefault` directives will\n * be preserved at the location.\n *\n * The `ngSwitchCase` directive informs the parent `NgSwitch` of which view to display when the\n * expression is evaluated.\n * When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is\n * stamped out.\n *\n * \\@stable\n */\nvar NgSwitch = /** @class */ (function () {\n function NgSwitch() {\n this._defaultUsed = false;\n this._caseCount = 0;\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n Object.defineProperty(NgSwitch.prototype, \"ngSwitch\", {\n set: /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this._ngSwitch = newValue;\n if (this._caseCount === 0) {\n this._updateDefaultCases(true);\n }\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n NgSwitch.prototype._addCase = /**\n * \\@internal\n * @return {?}\n */\n function () { return this._caseCount++; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} view\n * @return {?}\n */\n NgSwitch.prototype._addDefault = /**\n * \\@internal\n * @param {?} view\n * @return {?}\n */\n function (view) {\n if (!this._defaultViews) {\n this._defaultViews = [];\n }\n this._defaultViews.push(view);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSwitch.prototype._matchCase = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ matched = value == this._ngSwitch;\n this._lastCasesMatched = this._lastCasesMatched || matched;\n this._lastCaseCheckIndex++;\n if (this._lastCaseCheckIndex === this._caseCount) {\n this._updateDefaultCases(!this._lastCasesMatched);\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n return matched;\n };\n /**\n * @param {?} useDefault\n * @return {?}\n */\n NgSwitch.prototype._updateDefaultCases = /**\n * @param {?} useDefault\n * @return {?}\n */\n function (useDefault) {\n if (this._defaultViews && useDefault !== this._defaultUsed) {\n this._defaultUsed = useDefault;\n for (var /** @type {?} */ i = 0; i < this._defaultViews.length; i++) {\n var /** @type {?} */ defaultView = this._defaultViews[i];\n defaultView.enforceState(useDefault);\n }\n }\n };\n NgSwitch.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitch]' },] },\n ];\n /** @nocollapse */\n NgSwitch.ctorParameters = function () { return []; };\n NgSwitch.propDecorators = {\n \"ngSwitch\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgSwitch;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgSwitch} when the\n * given expression evaluate to respectively the same/different value as the switch\n * expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * </container-element>\n * ```\n * \\@description\n *\n * Insert the sub-tree when the expression evaluates to the same value as the enclosing switch\n * expression.\n *\n * If multiple match expressions match the switch expression value, all of them are displayed.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchCase = /** @class */ (function () {\n function NgSwitchCase(viewContainer, templateRef, ngSwitch) {\n this.ngSwitch = ngSwitch;\n ngSwitch._addCase();\n this._view = new SwitchView(viewContainer, templateRef);\n }\n /**\n * @return {?}\n */\n NgSwitchCase.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); };\n NgSwitchCase.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitchCase]' },] },\n ];\n /** @nocollapse */\n NgSwitchCase.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n NgSwitchCase.propDecorators = {\n \"ngSwitchCase\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgSwitchCase;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a view that is added to the parent {\\@link NgSwitch} when no case expressions\n * match the\n * switch expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-other-element *ngSwitchDefault>...</some-other-element>\n * </container-element>\n * ```\n *\n * \\@description\n *\n * Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch\n * expression.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchDefault = /** @class */ (function () {\n function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {\n ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n }\n NgSwitchDefault.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitchDefault]' },] },\n ];\n /** @nocollapse */\n NgSwitchDefault.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n return NgSwitchDefault;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n * <ng-template ngPluralCase=\"=0\">there is nothing</ng-template>\n * <ng-template ngPluralCase=\"=1\">there is one</ng-template>\n * <ng-template ngPluralCase=\"few\">there are a few</ng-template>\n * </some-element>\n * ```\n *\n * \\@description\n *\n * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\n * that match the switch expression's pluralization category.\n *\n * To use this directive you must provide a container element that sets the `[ngPlural]` attribute\n * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their\n * expression:\n * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value\n * matches the switch expression exactly,\n * - otherwise, the view will be treated as a \"category match\", and will only display if exact\n * value matches aren't found and the value maps to its category for the defined locale.\n *\n * See http://cldr.unicode.org/index/cldr-spec/plural-rules\n *\n * \\@experimental\n */\nvar NgPlural = /** @class */ (function () {\n function NgPlural(_localization) {\n this._localization = _localization;\n this._caseViews = {};\n }\n Object.defineProperty(NgPlural.prototype, \"ngPlural\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._switchValue = value;\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @param {?} switchView\n * @return {?}\n */\n NgPlural.prototype.addCase = /**\n * @param {?} value\n * @param {?} switchView\n * @return {?}\n */\n function (value, switchView) { this._caseViews[value] = switchView; };\n /**\n * @return {?}\n */\n NgPlural.prototype._updateView = /**\n * @return {?}\n */\n function () {\n this._clearViews();\n var /** @type {?} */ cases = Object.keys(this._caseViews);\n var /** @type {?} */ key = getPluralCategory(this._switchValue, cases, this._localization);\n this._activateView(this._caseViews[key]);\n };\n /**\n * @return {?}\n */\n NgPlural.prototype._clearViews = /**\n * @return {?}\n */\n function () {\n if (this._activeView)\n this._activeView.destroy();\n };\n /**\n * @param {?} view\n * @return {?}\n */\n NgPlural.prototype._activateView = /**\n * @param {?} view\n * @return {?}\n */\n function (view) {\n if (view) {\n this._activeView = view;\n this._activeView.create();\n }\n };\n NgPlural.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngPlural]' },] },\n ];\n /** @nocollapse */\n NgPlural.ctorParameters = function () { return [\n { type: NgLocalization, },\n ]; };\n NgPlural.propDecorators = {\n \"ngPlural\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgPlural;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgPlural} when the\n * given expression matches the plural expression according to CLDR rules.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n * <ng-template ngPluralCase=\"=0\">...</ng-template>\n * <ng-template ngPluralCase=\"other\">...</ng-template>\n * </some-element>\n * ```\n *\n * See {\\@link NgPlural} for more details and example.\n *\n * \\@experimental\n */\nvar NgPluralCase = /** @class */ (function () {\n function NgPluralCase(value, template, viewContainer, ngPlural) {\n this.value = value;\n var /** @type {?} */ isANumber = !isNaN(Number(value));\n ngPlural.addCase(isANumber ? \"=\" + value : value, new SwitchView(viewContainer, template));\n }\n NgPluralCase.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngPluralCase]' },] },\n ];\n /** @nocollapse */\n NgPluralCase.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Attribute\"], args: ['ngPluralCase',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: NgPlural, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n return NgPluralCase;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Update an HTML element styles.\n *\n * \\@howToUse\n * ```\n * <some-element [ngStyle]=\"{'font-style': styleExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"{'max-width.px': widthExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"objExp\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The styles are updated according to the value of the expression evaluation:\n * - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),\n * - values are the values assigned to those properties (expressed in the given unit).\n *\n * \\@stable\n */\nvar NgStyle = /** @class */ (function () {\n function NgStyle(_differs, _ngEl, _renderer) {\n this._differs = _differs;\n this._ngEl = _ngEl;\n this._renderer = _renderer;\n }\n Object.defineProperty(NgStyle.prototype, \"ngStyle\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._ngStyle = v;\n if (!this._differ && v) {\n this._differ = this._differs.find(v).create();\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgStyle.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._differ) {\n var /** @type {?} */ changes = this._differ.diff(this._ngStyle);\n if (changes) {\n this._applyChanges(changes);\n }\n }\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgStyle.prototype._applyChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });\n changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n };\n /**\n * @param {?} nameAndUnit\n * @param {?} value\n * @return {?}\n */\n NgStyle.prototype._setStyle = /**\n * @param {?} nameAndUnit\n * @param {?} value\n * @return {?}\n */\n function (nameAndUnit, value) {\n var _a = nameAndUnit.split('.'), name = _a[0], unit = _a[1];\n value = value != null && unit ? \"\" + value + unit : value;\n if (value != null) {\n this._renderer.setStyle(this._ngEl.nativeElement, name, /** @type {?} */ (value));\n }\n else {\n this._renderer.removeStyle(this._ngEl.nativeElement, name);\n }\n };\n NgStyle.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngStyle]' },] },\n ];\n /** @nocollapse */\n NgStyle.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"KeyValueDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n NgStyle.propDecorators = {\n \"ngStyle\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgStyle;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Inserts an embedded view from a prepared `TemplateRef`\n *\n * \\@howToUse\n * ```\n * <ng-container *ngTemplateOutlet=\"templateRefExp; context: contextExp\"></ng-container>\n * ```\n *\n * \\@description\n *\n * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n * by the local template `let` declarations.\n *\n * Note: using the key `$implicit` in the context object will set it's value as default.\n *\n * ## Example\n *\n * {\\@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n *\n * \\@stable\n */\nvar NgTemplateOutlet = /** @class */ (function () {\n function NgTemplateOutlet(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgTemplateOutlet.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var /** @type {?} */ recreateView = this._shouldRecreateView(changes);\n if (recreateView) {\n if (this._viewRef) {\n this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));\n }\n if (this.ngTemplateOutlet) {\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext);\n }\n }\n else {\n if (this._viewRef && this.ngTemplateOutletContext) {\n this._updateExistingContext(this.ngTemplateOutletContext);\n }\n }\n };\n /**\n * We need to re-create existing embedded view if:\n * - templateRef has changed\n * - context has changes\n *\n * We mark context object as changed when the corresponding object\n * shape changes (new properties are added or existing properties are removed).\n * In other words we consider context with the same properties as \"the same\" even\n * if object reference changes (see https://github.com/angular/angular/issues/13407).\n * @param {?} changes\n * @return {?}\n */\n NgTemplateOutlet.prototype._shouldRecreateView = /**\n * We need to re-create existing embedded view if:\n * - templateRef has changed\n * - context has changes\n *\n * We mark context object as changed when the corresponding object\n * shape changes (new properties are added or existing properties are removed).\n * In other words we consider context with the same properties as \"the same\" even\n * if object reference changes (see https://github.com/angular/angular/issues/13407).\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var /** @type {?} */ ctxChange = changes['ngTemplateOutletContext'];\n return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange));\n };\n /**\n * @param {?} ctxChange\n * @return {?}\n */\n NgTemplateOutlet.prototype._hasContextShapeChanged = /**\n * @param {?} ctxChange\n * @return {?}\n */\n function (ctxChange) {\n var /** @type {?} */ prevCtxKeys = Object.keys(ctxChange.previousValue || {});\n var /** @type {?} */ currCtxKeys = Object.keys(ctxChange.currentValue || {});\n if (prevCtxKeys.length === currCtxKeys.length) {\n for (var _i = 0, currCtxKeys_1 = currCtxKeys; _i < currCtxKeys_1.length; _i++) {\n var propName = currCtxKeys_1[_i];\n if (prevCtxKeys.indexOf(propName) === -1) {\n return true;\n }\n }\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * @param {?} ctx\n * @return {?}\n */\n NgTemplateOutlet.prototype._updateExistingContext = /**\n * @param {?} ctx\n * @return {?}\n */\n function (ctx) {\n for (var _i = 0, _a = Object.keys(ctx); _i < _a.length; _i++) {\n var propName = _a[_i];\n (/** @type {?} */ (this._viewRef.context))[propName] = (/** @type {?} */ (this.ngTemplateOutletContext))[propName];\n }\n };\n NgTemplateOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngTemplateOutlet]' },] },\n ];\n /** @nocollapse */\n NgTemplateOutlet.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n ]; };\n NgTemplateOutlet.propDecorators = {\n \"ngTemplateOutletContext\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngTemplateOutlet\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgTemplateOutlet;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of Angular directives that are likely to be used in each and every Angular\n * application.\n */\nvar COMMON_DIRECTIVES = [\n NgClass,\n NgComponentOutlet,\n NgForOf,\n NgIf,\n NgTemplateOutlet,\n NgStyle,\n NgSwitch,\n NgSwitchCase,\n NgSwitchDefault,\n NgPlural,\n NgPluralCase,\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NAMED_FORMATS = {};\nvar DATE_FORMATS_SPLIT = /((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)/;\n/** @enum {number} */\nvar ZoneWidth = {\n Short: 0,\n ShortGMT: 1,\n Long: 2,\n Extended: 3,\n};\nZoneWidth[ZoneWidth.Short] = \"Short\";\nZoneWidth[ZoneWidth.ShortGMT] = \"ShortGMT\";\nZoneWidth[ZoneWidth.Long] = \"Long\";\nZoneWidth[ZoneWidth.Extended] = \"Extended\";\n/** @enum {number} */\nvar DateType = {\n FullYear: 0,\n Month: 1,\n Date: 2,\n Hours: 3,\n Minutes: 4,\n Seconds: 5,\n Milliseconds: 6,\n Day: 7,\n};\nDateType[DateType.FullYear] = \"FullYear\";\nDateType[DateType.Month] = \"Month\";\nDateType[DateType.Date] = \"Date\";\nDateType[DateType.Hours] = \"Hours\";\nDateType[DateType.Minutes] = \"Minutes\";\nDateType[DateType.Seconds] = \"Seconds\";\nDateType[DateType.Milliseconds] = \"Milliseconds\";\nDateType[DateType.Day] = \"Day\";\n/** @enum {number} */\nvar TranslationType = {\n DayPeriods: 0,\n Days: 1,\n Months: 2,\n Eras: 3,\n};\nTranslationType[TranslationType.DayPeriods] = \"DayPeriods\";\nTranslationType[TranslationType.Days] = \"Days\";\nTranslationType[TranslationType.Months] = \"Months\";\nTranslationType[TranslationType.Eras] = \"Eras\";\n/**\n * Transforms a date to a locale string based on a pattern and a timezone\n *\n * \\@internal\n * @param {?} date\n * @param {?} format\n * @param {?} locale\n * @param {?=} timezone\n * @return {?}\n */\nfunction formatDate(date, format, locale, timezone) {\n var /** @type {?} */ namedFormat = getNamedFormat(locale, format);\n format = namedFormat || format;\n var /** @type {?} */ parts = [];\n var /** @type {?} */ match;\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = parts.concat(match.slice(1));\n var /** @type {?} */ part = parts.pop();\n if (!part) {\n break;\n }\n format = part;\n }\n else {\n parts.push(format);\n break;\n }\n }\n var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n var /** @type {?} */ text = '';\n parts.forEach(function (value) {\n var /** @type {?} */ dateFormatter = getDateFormatter(value);\n text += dateFormatter ?\n dateFormatter(date, locale, dateTimezoneOffset) :\n value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n return text;\n}\n/**\n * @param {?} locale\n * @param {?} format\n * @return {?}\n */\nfunction getNamedFormat(locale, format) {\n var /** @type {?} */ localeId = getLocaleId(locale);\n NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};\n if (NAMED_FORMATS[localeId][format]) {\n return NAMED_FORMATS[localeId][format];\n }\n var /** @type {?} */ formatValue = '';\n switch (format) {\n case 'shortDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Short);\n break;\n case 'mediumDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);\n break;\n case 'longDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Long);\n break;\n case 'fullDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Full);\n break;\n case 'shortTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);\n break;\n case 'mediumTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);\n break;\n case 'longTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);\n break;\n case 'fullTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);\n break;\n case 'short':\n var /** @type {?} */ shortTime = getNamedFormat(locale, 'shortTime');\n var /** @type {?} */ shortDate = getNamedFormat(locale, 'shortDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);\n break;\n case 'medium':\n var /** @type {?} */ mediumTime = getNamedFormat(locale, 'mediumTime');\n var /** @type {?} */ mediumDate = getNamedFormat(locale, 'mediumDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);\n break;\n case 'long':\n var /** @type {?} */ longTime = getNamedFormat(locale, 'longTime');\n var /** @type {?} */ longDate = getNamedFormat(locale, 'longDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);\n break;\n case 'full':\n var /** @type {?} */ fullTime = getNamedFormat(locale, 'fullTime');\n var /** @type {?} */ fullDate = getNamedFormat(locale, 'fullDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);\n break;\n }\n if (formatValue) {\n NAMED_FORMATS[localeId][format] = formatValue;\n }\n return formatValue;\n}\n/**\n * @param {?} str\n * @param {?} opt_values\n * @return {?}\n */\nfunction formatDateTime(str, opt_values) {\n if (opt_values) {\n str = str.replace(/\\{([^}]+)}/g, function (match, key) {\n return (opt_values != null && key in opt_values) ? opt_values[key] : match;\n });\n }\n return str;\n}\n/**\n * @param {?} num\n * @param {?} digits\n * @param {?=} minusSign\n * @param {?=} trim\n * @param {?=} negWrap\n * @return {?}\n */\nfunction padNumber(num, digits, minusSign, trim, negWrap) {\n if (minusSign === void 0) { minusSign = '-'; }\n var /** @type {?} */ neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n }\n else {\n num = -num;\n neg = minusSign;\n }\n }\n var /** @type {?} */ strNum = '' + num;\n while (strNum.length < digits)\n strNum = '0' + strNum;\n if (trim) {\n strNum = strNum.substr(strNum.length - digits);\n }\n return neg + strNum;\n}\n/**\n * Returns a date formatter that transforms a date into its locale digit representation\n * @param {?} name\n * @param {?} size\n * @param {?=} offset\n * @param {?=} trim\n * @param {?=} negWrap\n * @return {?}\n */\nfunction dateGetter(name, size, offset, trim, negWrap) {\n if (offset === void 0) { offset = 0; }\n if (trim === void 0) { trim = false; }\n if (negWrap === void 0) { negWrap = false; }\n return function (date, locale) {\n var /** @type {?} */ part = getDatePart(name, date, size);\n if (offset > 0 || part > -offset) {\n part += offset;\n }\n if (name === DateType.Hours && part === 0 && offset === -12) {\n part = 12;\n }\n return padNumber(part, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim, negWrap);\n };\n}\n/**\n * @param {?} name\n * @param {?} date\n * @param {?} size\n * @return {?}\n */\nfunction getDatePart(name, date, size) {\n switch (name) {\n case DateType.FullYear:\n return date.getFullYear();\n case DateType.Month:\n return date.getMonth();\n case DateType.Date:\n return date.getDate();\n case DateType.Hours:\n return date.getHours();\n case DateType.Minutes:\n return date.getMinutes();\n case DateType.Seconds:\n return date.getSeconds();\n case DateType.Milliseconds:\n var /** @type {?} */ div = size === 1 ? 100 : (size === 2 ? 10 : 1);\n return Math.round(date.getMilliseconds() / div);\n case DateType.Day:\n return date.getDay();\n default:\n throw new Error(\"Unknown DateType value \\\"\" + name + \"\\\".\");\n }\n}\n/**\n * Returns a date formatter that transforms a date into its locale string representation\n * @param {?} name\n * @param {?} width\n * @param {?=} form\n * @param {?=} extended\n * @return {?}\n */\nfunction dateStrGetter(name, width, form, extended) {\n if (form === void 0) { form = FormStyle.Format; }\n if (extended === void 0) { extended = false; }\n return function (date, locale) {\n return getDateTranslation(date, locale, name, width, form, extended);\n };\n}\n/**\n * Returns the locale translation of a date for a given form, type and width\n * @param {?} date\n * @param {?} locale\n * @param {?} name\n * @param {?} width\n * @param {?} form\n * @param {?} extended\n * @return {?}\n */\nfunction getDateTranslation(date, locale, name, width, form, extended) {\n switch (name) {\n case TranslationType.Months:\n return getLocaleMonthNames(locale, form, width)[date.getMonth()];\n case TranslationType.Days:\n return getLocaleDayNames(locale, form, width)[date.getDay()];\n case TranslationType.DayPeriods:\n var /** @type {?} */ currentHours_1 = date.getHours();\n var /** @type {?} */ currentMinutes_1 = date.getMinutes();\n if (extended) {\n var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);\n var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);\n var /** @type {?} */ result_1;\n rules.forEach(function (rule, index) {\n if (Array.isArray(rule)) {\n // morning, afternoon, evening, night\n var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;\n var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;\n if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&\n (currentHours_1 < hoursTo ||\n (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {\n result_1 = dayPeriods_1[index];\n }\n }\n else {\n // noon or midnight\n var hours = rule.hours, minutes = rule.minutes;\n if (hours === currentHours_1 && minutes === currentMinutes_1) {\n result_1 = dayPeriods_1[index];\n }\n }\n });\n if (result_1) {\n return result_1;\n }\n }\n // if no rules for the day periods, we use am/pm by default\n return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];\n case TranslationType.Eras:\n return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];\n default:\n // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n // However Closure Compiler does not understand that and reports an error in typed mode.\n // The `throw new Error` below works around the problem, and the unexpected: never variable\n // makes sure tsc still checks this code is unreachable.\n var /** @type {?} */ unexpected = name;\n throw new Error(\"unexpected translation type \" + unexpected);\n }\n}\n/**\n * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or\n * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,\n * extended = +04:30)\n * @param {?} width\n * @return {?}\n */\nfunction timeZoneGetter(width) {\n return function (date, locale, offset) {\n var /** @type {?} */ zone = -1 * offset;\n var /** @type {?} */ minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var /** @type {?} */ hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}\nvar JANUARY = 0;\nvar THURSDAY = 4;\n/**\n * @param {?} year\n * @return {?}\n */\nfunction getFirstThursdayOfYear(year) {\n var /** @type {?} */ firstDayOfYear = (new Date(year, JANUARY, 1)).getDay();\n return new Date(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);\n}\n/**\n * @param {?} datetime\n * @return {?}\n */\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));\n}\n/**\n * @param {?} size\n * @param {?=} monthBased\n * @return {?}\n */\nfunction weekGetter(size, monthBased) {\n if (monthBased === void 0) { monthBased = false; }\n return function (date, locale) {\n var /** @type {?} */ result;\n if (monthBased) {\n var /** @type {?} */ nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;\n var /** @type {?} */ today = date.getDate();\n result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);\n }\n else {\n var /** @type {?} */ firstThurs = getFirstThursdayOfYear(date.getFullYear());\n var /** @type {?} */ thisThurs = getThursdayThisWeek(date);\n var /** @type {?} */ diff = thisThurs.getTime() - firstThurs.getTime();\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n }\n return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n };\n}\nvar DATE_FORMATS = {};\n/**\n * @param {?} format\n * @return {?}\n */\nfunction getDateFormatter(format) {\n if (DATE_FORMATS[format]) {\n return DATE_FORMATS[format];\n }\n var /** @type {?} */ formatter;\n switch (format) {\n // Era name (AD/BC)\n case 'G':\n case 'GG':\n case 'GGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);\n break;\n case 'GGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);\n break;\n case 'GGGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);\n break;\n // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'y':\n formatter = dateGetter(DateType.FullYear, 1, 0, false, true);\n break;\n // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yy':\n formatter = dateGetter(DateType.FullYear, 2, 0, true, true);\n break;\n // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yyy':\n formatter = dateGetter(DateType.FullYear, 3, 0, false, true);\n break;\n // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'yyyy':\n formatter = dateGetter(DateType.FullYear, 4, 0, false, true);\n break;\n // Month of the year (1-12), numeric\n case 'M':\n case 'L':\n formatter = dateGetter(DateType.Month, 1, 1);\n break;\n case 'MM':\n case 'LL':\n formatter = dateGetter(DateType.Month, 2, 1);\n break;\n // Month of the year (January, ...), string, format\n case 'MMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);\n break;\n case 'MMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);\n break;\n case 'MMMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);\n break;\n // Month of the year (January, ...), string, standalone\n case 'LLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'LLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'LLLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n // Week of the year (1, ... 52)\n case 'w':\n formatter = weekGetter(1);\n break;\n case 'ww':\n formatter = weekGetter(2);\n break;\n // Week of the month (1, ...)\n case 'W':\n formatter = weekGetter(1, true);\n break;\n // Day of the month (1-31)\n case 'd':\n formatter = dateGetter(DateType.Date, 1);\n break;\n case 'dd':\n formatter = dateGetter(DateType.Date, 2);\n break;\n // Day of the Week\n case 'E':\n case 'EE':\n case 'EEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);\n break;\n case 'EEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);\n break;\n case 'EEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);\n break;\n case 'EEEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);\n break;\n // Generic period of the day (am-pm)\n case 'a':\n case 'aa':\n case 'aaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);\n break;\n case 'aaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);\n break;\n case 'aaaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);\n break;\n // Extended period of the day (midnight, at night, ...), standalone\n case 'b':\n case 'bb':\n case 'bbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);\n break;\n case 'bbbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);\n break;\n case 'bbbbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);\n break;\n // Extended period of the day (midnight, night, ...), standalone\n case 'B':\n case 'BB':\n case 'BBB':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);\n break;\n case 'BBBB':\n formatter =\n dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);\n break;\n case 'BBBBB':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);\n break;\n // Hour in AM/PM, (1-12)\n case 'h':\n formatter = dateGetter(DateType.Hours, 1, -12);\n break;\n case 'hh':\n formatter = dateGetter(DateType.Hours, 2, -12);\n break;\n // Hour of the day (0-23)\n case 'H':\n formatter = dateGetter(DateType.Hours, 1);\n break;\n // Hour in day, padded (00-23)\n case 'HH':\n formatter = dateGetter(DateType.Hours, 2);\n break;\n // Minute of the hour (0-59)\n case 'm':\n formatter = dateGetter(DateType.Minutes, 1);\n break;\n case 'mm':\n formatter = dateGetter(DateType.Minutes, 2);\n break;\n // Second of the minute (0-59)\n case 's':\n formatter = dateGetter(DateType.Seconds, 1);\n break;\n case 'ss':\n formatter = dateGetter(DateType.Seconds, 2);\n break;\n // Fractional second padded (0-9)\n case 'S':\n formatter = dateGetter(DateType.Milliseconds, 1);\n break;\n case 'SS':\n formatter = dateGetter(DateType.Milliseconds, 2);\n break;\n // = millisecond\n case 'SSS':\n formatter = dateGetter(DateType.Milliseconds, 3);\n break;\n // Timezone ISO8601 short format (-0430)\n case 'Z':\n case 'ZZ':\n case 'ZZZ':\n formatter = timeZoneGetter(ZoneWidth.Short);\n break;\n // Timezone ISO8601 extended format (-04:30)\n case 'ZZZZZ':\n formatter = timeZoneGetter(ZoneWidth.Extended);\n break;\n // Timezone GMT short format (GMT+4)\n case 'O':\n case 'OO':\n case 'OOO':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'z':\n case 'zz':\n case 'zzz':\n formatter = timeZoneGetter(ZoneWidth.ShortGMT);\n break;\n // Timezone GMT long format (GMT+0430)\n case 'OOOO':\n case 'ZZZZ':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'zzzz':\n formatter = timeZoneGetter(ZoneWidth.Long);\n break;\n default:\n return null;\n }\n DATE_FORMATS[format] = formatter;\n return formatter;\n}\n/**\n * @param {?} timezone\n * @param {?} fallback\n * @return {?}\n */\nfunction timezoneToOffset(timezone, fallback) {\n // Support: IE 9-11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(/:/g, '');\n var /** @type {?} */ requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n/**\n * @param {?} date\n * @param {?} minutes\n * @return {?}\n */\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n/**\n * @param {?} date\n * @param {?} timezone\n * @param {?} reverse\n * @return {?}\n */\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n var /** @type {?} */ reverseValue = reverse ? -1 : 1;\n var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();\n var /** @type {?} */ timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} type\n * @param {?} value\n * @return {?}\n */\nfunction invalidPipeArgumentError(type, value) {\n return Error(\"InvalidPipeArgument: '\" + value + \"' for pipe '\" + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵstringify\"])(type) + \"'\");\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ISO8601_DATE_REGEX = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a date according to locale rules.\n * \\@howToUse `date_expression | date[:format[:timezone[:locale]]]`\n * \\@description\n *\n * Where:\n * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string\n * (https://www.w3.org/TR/NOTE-datetime).\n * - `format` indicates which date/time components to include. The format can be predefined as\n * shown below (all examples are given for `en-US`) or custom as shown in the table.\n * - `'short'`: equivalent to `'M/d/yy, h:mm a'` (e.g. `6/15/15, 9:03 AM`)\n * - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (e.g. `Jun 15, 2015, 9:03:01 AM`)\n * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM GMT+1`)\n * - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at\n * 9:03:01 AM GMT+01:00`)\n * - `'shortDate'`: equivalent to `'M/d/yy'` (e.g. `6/15/15`)\n * - `'mediumDate'`: equivalent to `'MMM d, y'` (e.g. `Jun 15, 2015`)\n * - `'longDate'`: equivalent to `'MMMM d, y'` (e.g. `June 15, 2015`)\n * - `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` (e.g. `Monday, June 15, 2015`)\n * - `'shortTime'`: equivalent to `'h:mm a'` (e.g. `9:03 AM`)\n * - `'mediumTime'`: equivalent to `'h:mm:ss a'` (e.g. `9:03:01 AM`)\n * - `'longTime'`: equivalent to `'h:mm:ss a z'` (e.g. `9:03:01 AM GMT+1`)\n * - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (e.g. `9:03:01 AM GMT+01:00`)\n * - `timezone` to be used for formatting. It understands UTC/GMT and the continental US time zone\n * abbreviations, but for general use, use a time zone offset, for example,\n * `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the local system timezone of the end-user's browser will be used.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n *\n * | Field Type | Format | Description | Example Value |\n * |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|\n * | Era | G, GG & GGG | Abbreviated | AD |\n * | | GGGG | Wide | Anno Domini |\n * | | GGGGG | Narrow | A |\n * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | Month | M | Numeric: 1 digit | 9, 12 |\n * | | MM | Numeric: 2 digits + zero padded | 09, 12 |\n * | | MMM | Abbreviated | Sep |\n * | | MMMM | Wide | September |\n * | | MMMMM | Narrow | S |\n * | Month standalone | L | Numeric: 1 digit | 9, 12 |\n * | | LL | Numeric: 2 digits + zero padded | 09, 12 |\n * | | LLL | Abbreviated | Sep |\n * | | LLLL | Wide | September |\n * | | LLLLL | Narrow | S |\n * | Week of year | w | Numeric: minimum digits | 1... 53 |\n * | | ww | Numeric: 2 digits + zero padded | 01... 53 |\n * | Week of month | W | Numeric: 1 digit | 1... 5 |\n * | Day of month | d | Numeric: minimum digits | 1 |\n * | | dd | Numeric: 2 digits + zero padded | 01 |\n * | Week day | E, EE & EEE | Abbreviated | Tue |\n * | | EEEE | Wide | Tuesday |\n * | | EEEEE | Narrow | T |\n * | | EEEEEE | Short | Tu |\n * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |\n * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |\n * | | aaaaa | Narrow | a/p |\n * | Period* | B, BB & BBB | Abbreviated | mid. |\n * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | BBBBB | Narrow | md |\n * | Period standalone* | b, bb & bbb | Abbreviated | mid. |\n * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | bbbbb | Narrow | md |\n * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |\n * | | hh | Numeric: 2 digits + zero padded | 01, 12 |\n * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |\n * | | HH | Numeric: 2 digits + zero padded | 00, 23 |\n * | Minute | m | Numeric: minimum digits | 8, 59 |\n * | | mm | Numeric: 2 digits + zero padded | 08, 59 |\n * | Second | s | Numeric: minimum digits | 0... 59 |\n * | | ss | Numeric: 2 digits + zero padded | 00... 59 |\n * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |\n * | | SS | Numeric: 2 digits + zero padded | 00... 99 |\n * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |\n * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |\n * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |\n * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |\n * | | ZZZZ | Long localized GMT format | GMT-8:00 |\n * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |\n * | | O, OO & OOO | Short localized GMT format | GMT-8 |\n * | | OOOO | Long localized GMT format | GMT-08:00 |\n *\n *\n * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not\n * applied and the formatted text will have the same day, month and year of the expression.\n *\n * WARNINGS:\n * - this pipe has only access to en-US locale data by default. If you want to localize the dates\n * in another language, you will have to import data for other locales.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n * - Fields suffixed with * are only available in the extra dataset.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import extra locale\n * data.\n * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.\n * Instead users should treat the date as an immutable object and change the reference when the\n * pipe needs to re-run (this is to avoid reformatting the date on every change detection run\n * which would be an expensive operation).\n *\n * ### Examples\n *\n * Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)\n * in the _local_ time and locale is 'en-US':\n *\n * {\\@example common/pipes/ts/date_pipe.ts region='DatePipe'}\n *\n * \\@stable\n */\nvar DatePipe = /** @class */ (function () {\n function DatePipe(locale) {\n this.locale = locale;\n }\n /**\n * @param {?} value\n * @param {?=} format\n * @param {?=} timezone\n * @param {?=} locale\n * @return {?}\n */\n DatePipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} format\n * @param {?=} timezone\n * @param {?=} locale\n * @return {?}\n */\n function (value, format, timezone, locale) {\n if (format === void 0) { format = 'mediumDate'; }\n if (value == null || value === '' || value !== value)\n return null;\n if (typeof value === 'string') {\n value = value.trim();\n }\n var /** @type {?} */ date;\n var /** @type {?} */ match;\n if (isDate$1(value)) {\n date = value;\n }\n else if (!isNaN(value - parseFloat(value))) {\n date = new Date(parseFloat(value));\n }\n else if (typeof value === 'string' && /^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /**\n * For ISO Strings without time the day, month and year must be extracted from the ISO String\n * before Date creation to avoid time offset and errors in the new Date.\n * If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n * date, some browsers (e.g. IE 9) will throw an invalid Date error\n * If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n * is applied\n * Note: ISO months are 0 for January, 1 for February, ...\n */\n var _a = value.split('-').map(function (val) { return +val; }), y = _a[0], m = _a[1], d = _a[2];\n date = new Date(y, m - 1, d);\n }\n else if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {\n date = isoStringToDate(match);\n }\n else {\n date = new Date(value);\n }\n if (!isDate$1(date)) {\n throw invalidPipeArgumentError(DatePipe, value);\n }\n return formatDate(date, format, locale || this.locale, timezone);\n };\n DatePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'date', pure: true },] },\n ];\n /** @nocollapse */\n DatePipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DatePipe;\n}());\n/**\n * \\@internal\n * @param {?} match\n * @return {?}\n */\nfunction isoStringToDate(match) {\n var /** @type {?} */ date = new Date(0);\n var /** @type {?} */ tzHour = 0;\n var /** @type {?} */ tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var /** @type {?} */ dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var /** @type {?} */ timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = +(match[9] + match[10]);\n tzMin = +(match[9] + match[11]);\n }\n dateSetter.call(date, +(match[1]), +(match[2]) - 1, +(match[3]));\n var /** @type {?} */ h = +(match[4] || '0') - tzHour;\n var /** @type {?} */ m = +(match[5] || '0') - tzMin;\n var /** @type {?} */ s = +(match[6] || '0');\n var /** @type {?} */ ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isDate$1(value) {\n return value instanceof Date && !isNaN(value.valueOf());\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar NumberFormatter = /** @class */ (function () {\n function NumberFormatter() {\n }\n /**\n * @param {?} num\n * @param {?} locale\n * @param {?} style\n * @param {?=} opts\n * @return {?}\n */\n NumberFormatter.format = /**\n * @param {?} num\n * @param {?} locale\n * @param {?} style\n * @param {?=} opts\n * @return {?}\n */\n function (num, locale, style, opts) {\n if (opts === void 0) { opts = {}; }\n var minimumIntegerDigits = opts.minimumIntegerDigits, minimumFractionDigits = opts.minimumFractionDigits, maximumFractionDigits = opts.maximumFractionDigits, currency = opts.currency, _a = opts.currencyAsSymbol, currencyAsSymbol = _a === void 0 ? false : _a;\n var /** @type {?} */ options = {\n minimumIntegerDigits: minimumIntegerDigits,\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits,\n style: NumberFormatStyle[style].toLowerCase()\n };\n if (style == NumberFormatStyle.Currency) {\n options.currency = typeof currency == 'string' ? currency : undefined;\n options.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';\n }\n return new Intl.NumberFormat(locale, options).format(num);\n };\n return NumberFormatter;\n}());\nvar DATE_FORMATS_SPLIT$1 = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;\nvar PATTERN_ALIASES = {\n // Keys are quoted so they do not get renamed during closure compilation.\n 'yMMMdjms': datePartGetterFactory(combine([\n digitCondition('year', 1),\n nameCondition('month', 3),\n digitCondition('day', 1),\n digitCondition('hour', 1),\n digitCondition('minute', 1),\n digitCondition('second', 1),\n ])),\n 'yMdjm': datePartGetterFactory(combine([\n digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),\n digitCondition('hour', 1), digitCondition('minute', 1)\n ])),\n 'yMMMMEEEEd': datePartGetterFactory(combine([\n digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),\n digitCondition('day', 1)\n ])),\n 'yMMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),\n 'yMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),\n 'yMd': datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),\n 'jms': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),\n 'jm': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))\n};\nvar DATE_FORMATS$1 = {\n // Keys are quoted so they do not get renamed.\n 'yyyy': datePartGetterFactory(digitCondition('year', 4)),\n 'yy': datePartGetterFactory(digitCondition('year', 2)),\n 'y': datePartGetterFactory(digitCondition('year', 1)),\n 'MMMM': datePartGetterFactory(nameCondition('month', 4)),\n 'MMM': datePartGetterFactory(nameCondition('month', 3)),\n 'MM': datePartGetterFactory(digitCondition('month', 2)),\n 'M': datePartGetterFactory(digitCondition('month', 1)),\n 'LLLL': datePartGetterFactory(nameCondition('month', 4)),\n 'L': datePartGetterFactory(nameCondition('month', 1)),\n 'dd': datePartGetterFactory(digitCondition('day', 2)),\n 'd': datePartGetterFactory(digitCondition('day', 1)),\n 'HH': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),\n 'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),\n 'hh': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),\n 'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n 'jj': datePartGetterFactory(digitCondition('hour', 2)),\n 'j': datePartGetterFactory(digitCondition('hour', 1)),\n 'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),\n 'm': datePartGetterFactory(digitCondition('minute', 1)),\n 'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),\n 's': datePartGetterFactory(digitCondition('second', 1)),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit\n // fractions\n 'sss': datePartGetterFactory(digitCondition('second', 3)),\n 'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),\n 'EEE': datePartGetterFactory(nameCondition('weekday', 3)),\n 'EE': datePartGetterFactory(nameCondition('weekday', 2)),\n 'E': datePartGetterFactory(nameCondition('weekday', 1)),\n 'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n 'Z': timeZoneGetter$1('short'),\n 'z': timeZoneGetter$1('long'),\n 'ww': datePartGetterFactory({}),\n // Week of year, padded (00-53). Week 01 is the week with the\n // first Thursday of the year. not support ?\n 'w': datePartGetterFactory({}),\n // Week of year (0-53). Week 1 is the week with the first Thursday\n // of the year not support ?\n 'G': datePartGetterFactory(nameCondition('era', 1)),\n 'GG': datePartGetterFactory(nameCondition('era', 2)),\n 'GGG': datePartGetterFactory(nameCondition('era', 3)),\n 'GGGG': datePartGetterFactory(nameCondition('era', 4))\n};\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction digitModifier(inner) {\n return function (date, locale) {\n var /** @type {?} */ result = inner(date, locale);\n return result.length == 1 ? '0' + result : result;\n };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourClockExtractor(inner) {\n return function (date, locale) { return inner(date, locale).split(' ')[1]; };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourExtractor(inner) {\n return function (date, locale) { return inner(date, locale).split(' ')[0]; };\n}\n/**\n * @param {?} date\n * @param {?} locale\n * @param {?} options\n * @return {?}\n */\nfunction intlDateFormat(date, locale, options) {\n return new Intl.DateTimeFormat(locale, options).format(date).replace(/[\\u200e\\u200f]/g, '');\n}\n/**\n * @param {?} timezone\n * @return {?}\n */\nfunction timeZoneGetter$1(timezone) {\n // To workaround `Intl` API restriction for single timezone let format with 24 hours\n var /** @type {?} */ options = { hour: '2-digit', hour12: false, timeZoneName: timezone };\n return function (date, locale) {\n var /** @type {?} */ result = intlDateFormat(date, locale, options);\n // Then extract first 3 letters that related to hours\n return result ? result.substring(3) : '';\n };\n}\n/**\n * @param {?} options\n * @param {?} value\n * @return {?}\n */\nfunction hour12Modify(options, value) {\n options.hour12 = value;\n return options;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction digitCondition(prop, len) {\n var /** @type {?} */ result = {};\n result[prop] = len === 2 ? '2-digit' : 'numeric';\n return result;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction nameCondition(prop, len) {\n var /** @type {?} */ result = {};\n if (len < 4) {\n result[prop] = len > 1 ? 'short' : 'narrow';\n }\n else {\n result[prop] = 'long';\n }\n return result;\n}\n/**\n * @param {?} options\n * @return {?}\n */\nfunction combine(options) {\n return options.reduce(function (merged, opt) { return (Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"a\" /* __assign */])({}, merged, opt)); }, {});\n}\n/**\n * @param {?} ret\n * @return {?}\n */\nfunction datePartGetterFactory(ret) {\n return function (date, locale) { return intlDateFormat(date, locale, ret); };\n}\nvar DATE_FORMATTER_CACHE = new Map();\n/**\n * @param {?} format\n * @param {?} date\n * @param {?} locale\n * @return {?}\n */\nfunction dateFormatter(format, date, locale) {\n var /** @type {?} */ fn = PATTERN_ALIASES[format];\n if (fn)\n return fn(date, locale);\n var /** @type {?} */ cacheKey = format;\n var /** @type {?} */ parts = DATE_FORMATTER_CACHE.get(cacheKey);\n if (!parts) {\n parts = [];\n var /** @type {?} */ match = void 0;\n DATE_FORMATS_SPLIT$1.exec(format);\n var /** @type {?} */ _format = format;\n while (_format) {\n match = DATE_FORMATS_SPLIT$1.exec(_format);\n if (match) {\n parts = parts.concat(match.slice(1));\n _format = /** @type {?} */ ((parts.pop()));\n }\n else {\n parts.push(_format);\n _format = null;\n }\n }\n DATE_FORMATTER_CACHE.set(cacheKey, parts);\n }\n return parts.reduce(function (text, part) {\n var /** @type {?} */ fn = DATE_FORMATS$1[part];\n return text + (fn ? fn(date, locale) : partToTime(part));\n }, '');\n}\n/**\n * @param {?} part\n * @return {?}\n */\nfunction partToTime(part) {\n return part === '\\'\\'' ? '\\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n}\nvar DateFormatter = /** @class */ (function () {\n function DateFormatter() {\n }\n /**\n * @param {?} date\n * @param {?} locale\n * @param {?} pattern\n * @return {?}\n */\n DateFormatter.format = /**\n * @param {?} date\n * @param {?} locale\n * @param {?} pattern\n * @return {?}\n */\n function (date, locale, pattern) {\n return dateFormatter(pattern, date, locale);\n };\n return DateFormatter;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a date according to locale rules.\n * \\@howToUse `date_expression | date[:format]`\n * \\@description\n *\n * Where:\n * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string\n * (https://www.w3.org/TR/NOTE-datetime).\n * - `format` indicates which date/time components to include. The format can be predefined as\n * shown below or custom as shown in the table.\n * - `'medium'`: equivalent to `'yMMMdjms'` (e.g. `Sep 3, 2010, 12:05:08 PM` for `en-US`)\n * - `'short'`: equivalent to `'yMdjm'` (e.g. `9/3/2010, 12:05 PM` for `en-US`)\n * - `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. `Friday, September 3, 2010` for `en-US`)\n * - `'longDate'`: equivalent to `'yMMMMd'` (e.g. `September 3, 2010` for `en-US`)\n * - `'mediumDate'`: equivalent to `'yMMMd'` (e.g. `Sep 3, 2010` for `en-US`)\n * - `'shortDate'`: equivalent to `'yMd'` (e.g. `9/3/2010` for `en-US`)\n * - `'mediumTime'`: equivalent to `'jms'` (e.g. `12:05:08 PM` for `en-US`)\n * - `'shortTime'`: equivalent to `'jm'` (e.g. `12:05 PM` for `en-US`)\n *\n *\n * | Component | Symbol | Narrow | Short Form | Long Form | Numeric | 2-digit |\n * |-----------|:------:|--------|--------------|-------------------|-----------|-----------|\n * | era | G | G (A) | GGG (AD) | GGGG (Anno Domini)| - | - |\n * | year | y | - | - | - | y (2015) | yy (15) |\n * | month | M | L (S) | MMM (Sep) | MMMM (September) | M (9) | MM (09) |\n * | day | d | - | - | - | d (3) | dd (03) |\n * | weekday | E | E (S) | EEE (Sun) | EEEE (Sunday) | - | - |\n * | hour | j | - | - | - | j (13) | jj (13) |\n * | hour12 | h | - | - | - | h (1 PM) | hh (01 PM)|\n * | hour24 | H | - | - | - | H (13) | HH (13) |\n * | minute | m | - | - | - | m (5) | mm (05) |\n * | second | s | - | - | - | s (9) | ss (09) |\n * | timezone | z | - | - | z (Pacific Standard Time)| - | - |\n * | timezone | Z | - | Z (GMT-8:00) | - | - | - |\n * | timezone | a | - | a (PM) | - | - | - |\n *\n * In javascript, only the components specified will be respected (not the ordering,\n * punctuations, ...) and details of the formatting will be dependent on the locale.\n *\n * Timezone of the formatted text will be the local system timezone of the end-user's machine.\n *\n * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not\n * applied and the formatted text will have the same day, month and year of the expression.\n *\n * WARNINGS:\n * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.\n * Instead users should treat the date as an immutable object and change the reference when the\n * pipe needs to re-run (this is to avoid reformatting the date on every change detection run\n * which would be an expensive operation).\n * - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera\n * browsers.\n *\n * ### Examples\n *\n * Assuming `dateObj` is (year: 2010, month: 9, day: 3, hour: 12 PM, minute: 05, second: 08)\n * in the _local_ time and locale is 'en-US':\n *\n * {\\@example common/pipes/ts/date_pipe.ts region='DeprecatedDatePipe'}\n *\n * \\@stable\n */\nvar DeprecatedDatePipe = /** @class */ (function () {\n function DeprecatedDatePipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} pattern\n * @return {?}\n */\n DeprecatedDatePipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} pattern\n * @return {?}\n */\n function (value, pattern) {\n if (pattern === void 0) { pattern = 'mediumDate'; }\n if (value == null || value === '' || value !== value)\n return null;\n var /** @type {?} */ date;\n if (typeof value === 'string') {\n value = value.trim();\n }\n if (isDate(value)) {\n date = value;\n }\n else if (!isNaN(value - parseFloat(value))) {\n date = new Date(parseFloat(value));\n }\n else if (typeof value === 'string' && /^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /**\n * For ISO Strings without time the day, month and year must be extracted from the ISO String\n * before Date creation to avoid time offset and errors in the new Date.\n * If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n * date, some browsers (e.g. IE 9) will throw an invalid Date error\n * If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the\n * timeoffset\n * is applied\n * Note: ISO months are 0 for January, 1 for February, ...\n */\n var _a = value.split('-').map(function (val) { return parseInt(val, 10); }), y = _a[0], m = _a[1], d = _a[2];\n date = new Date(y, m - 1, d);\n }\n else {\n date = new Date(value);\n }\n if (!isDate(date)) {\n var /** @type {?} */ match = void 0;\n if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {\n date = isoStringToDate(match);\n }\n else {\n throw invalidPipeArgumentError(DeprecatedDatePipe, value);\n }\n }\n return DateFormatter.format(date, this._locale, DeprecatedDatePipe._ALIASES[pattern] || pattern);\n };\n /**\n * \\@internal\n */\n DeprecatedDatePipe._ALIASES = {\n 'medium': 'yMMMdjms',\n 'short': 'yMdjm',\n 'fullDate': 'yMMMMEEEEd',\n 'longDate': 'yMMMMd',\n 'mediumDate': 'yMMMd',\n 'shortDate': 'yMd',\n 'mediumTime': 'jms',\n 'shortTime': 'jm'\n };\n DeprecatedDatePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'date', pure: true },] },\n ];\n /** @nocollapse */\n DeprecatedDatePipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedDatePipe;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isDate(value) {\n return value instanceof Date && !isNaN(value.valueOf());\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\nvar PATTERN_SEP = ';';\nvar GROUP_SEP = ',';\nvar DIGIT_CHAR = '#';\nvar CURRENCY_CHAR = '¤';\nvar PERCENT_CHAR = '%';\n/**\n * Transform a number to a locale string based on a style and a format\n *\n * \\@internal\n * @param {?} value\n * @param {?} locale\n * @param {?} style\n * @param {?=} digitsInfo\n * @param {?=} currency\n * @return {?}\n */\nfunction formatNumber$1(value, locale, style, digitsInfo, currency) {\n if (currency === void 0) { currency = null; }\n var /** @type {?} */ res = { str: null };\n var /** @type {?} */ format = getLocaleNumberFormat(locale, style);\n var /** @type {?} */ num;\n // Convert strings to numbers\n if (typeof value === 'string' && !isNaN(+value - parseFloat(value))) {\n num = +value;\n }\n else if (typeof value !== 'number') {\n res.error = value + \" is not a number\";\n return res;\n }\n else {\n num = value;\n }\n var /** @type {?} */ pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n var /** @type {?} */ formattedText = '';\n var /** @type {?} */ isZero = false;\n if (!isFinite(num)) {\n formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);\n }\n else {\n var /** @type {?} */ parsedNumber = parseNumber(num);\n if (style === NumberFormatStyle.Percent) {\n parsedNumber = toPercent(parsedNumber);\n }\n var /** @type {?} */ minInt = pattern.minInt;\n var /** @type {?} */ minFraction = pattern.minFrac;\n var /** @type {?} */ maxFraction = pattern.maxFrac;\n if (digitsInfo) {\n var /** @type {?} */ parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);\n if (parts === null) {\n res.error = digitsInfo + \" is not a valid digit info\";\n return res;\n }\n var /** @type {?} */ minIntPart = parts[1];\n var /** @type {?} */ minFractionPart = parts[3];\n var /** @type {?} */ maxFractionPart = parts[5];\n if (minIntPart != null) {\n minInt = parseIntAutoRadix(minIntPart);\n }\n if (minFractionPart != null) {\n minFraction = parseIntAutoRadix(minFractionPart);\n }\n if (maxFractionPart != null) {\n maxFraction = parseIntAutoRadix(maxFractionPart);\n }\n else if (minFractionPart != null && minFraction > maxFraction) {\n maxFraction = minFraction;\n }\n }\n roundNumber(parsedNumber, minFraction, maxFraction);\n var /** @type {?} */ digits = parsedNumber.digits;\n var /** @type {?} */ integerLen = parsedNumber.integerLen;\n var /** @type {?} */ exponent = parsedNumber.exponent;\n var /** @type {?} */ decimals = [];\n isZero = digits.every(function (d) { return !d; });\n // pad zeros for small numbers\n for (; integerLen < minInt; integerLen++) {\n digits.unshift(0);\n }\n // pad zeros for small numbers\n for (; integerLen < 0; integerLen++) {\n digits.unshift(0);\n }\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n }\n else {\n decimals = digits;\n digits = [0];\n }\n // format the integer digits with grouping separators\n var /** @type {?} */ groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n var /** @type {?} */ groupSymbol = currency ? NumberSymbol.CurrencyGroup : NumberSymbol.Group;\n formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));\n // append the decimal digits\n if (decimals.length) {\n var /** @type {?} */ decimalSymbol = currency ? NumberSymbol.CurrencyDecimal : NumberSymbol.Decimal;\n formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');\n }\n if (exponent) {\n formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;\n }\n }\n if (num < 0 && !isZero) {\n formattedText = pattern.negPre + formattedText + pattern.negSuf;\n }\n else {\n formattedText = pattern.posPre + formattedText + pattern.posSuf;\n }\n if (style === NumberFormatStyle.Currency && currency !== null) {\n res.str = formattedText\n .replace(CURRENCY_CHAR, currency)\n .replace(CURRENCY_CHAR, '');\n return res;\n }\n if (style === NumberFormatStyle.Percent) {\n res.str = formattedText.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));\n return res;\n }\n res.str = formattedText;\n return res;\n}\n/**\n * @param {?} format\n * @param {?=} minusSign\n * @return {?}\n */\nfunction parseNumberFormat(format, minusSign) {\n if (minusSign === void 0) { minusSign = '-'; }\n var /** @type {?} */ p = {\n minInt: 1,\n minFrac: 0,\n maxFrac: 0,\n posPre: '',\n posSuf: '',\n negPre: '',\n negSuf: '',\n gSize: 0,\n lgSize: 0\n };\n var /** @type {?} */ patternParts = format.split(PATTERN_SEP);\n var /** @type {?} */ positive = patternParts[0];\n var /** @type {?} */ negative = patternParts[1];\n var /** @type {?} */ positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?\n positive.split(DECIMAL_SEP) :\n [\n positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),\n positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)\n ], /** @type {?} */\n integer = positiveParts[0], /** @type {?} */ fraction = positiveParts[1] || '';\n p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));\n for (var /** @type {?} */ i = 0; i < fraction.length; i++) {\n var /** @type {?} */ ch = fraction.charAt(i);\n if (ch === ZERO_CHAR) {\n p.minFrac = p.maxFrac = i + 1;\n }\n else if (ch === DIGIT_CHAR) {\n p.maxFrac = i + 1;\n }\n else {\n p.posSuf += ch;\n }\n }\n var /** @type {?} */ groups = integer.split(GROUP_SEP);\n p.gSize = groups[1] ? groups[1].length : 0;\n p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;\n if (negative) {\n var /** @type {?} */ trunkLen = positive.length - p.posPre.length - p.posSuf.length, /** @type {?} */\n pos = negative.indexOf(DIGIT_CHAR);\n p.negPre = negative.substr(0, pos).replace(/'/g, '');\n p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');\n }\n else {\n p.negPre = minusSign + p.posPre;\n p.negSuf = p.posSuf;\n }\n return p;\n}\n/**\n * @param {?} parsedNumber\n * @return {?}\n */\nfunction toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var /** @type {?} */ fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}\n/**\n * Parses a number.\n * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/\n * @param {?} num\n * @return {?}\n */\nfunction parseNumber(num) {\n var /** @type {?} */ numStr = Math.abs(num) + '';\n var /** @type {?} */ exponent = 0, /** @type {?} */ digits, /** @type {?} */ integerLen;\n var /** @type {?} */ i, /** @type {?} */ j, /** @type {?} */ zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changes the parsedNumber in-place\n * @param {?} parsedNumber\n * @param {?} minFrac\n * @param {?} maxFrac\n * @return {?}\n */\nfunction roundNumber(parsedNumber, minFrac, maxFrac) {\n if (minFrac > maxFrac) {\n throw new Error(\"The minimum number of digits after fraction (\" + minFrac + \") is higher than the maximum (\" + maxFrac + \").\");\n }\n var /** @type {?} */ digits = parsedNumber.digits;\n var /** @type {?} */ fractionLen = digits.length - parsedNumber.integerLen;\n var /** @type {?} */ fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);\n // The index of the digit to where rounding is to occur\n var /** @type {?} */ roundAt = fractionSize + parsedNumber.integerLen;\n var /** @type {?} */ digit = digits[roundAt];\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.integerLen, roundAt));\n // Set non-fractional digits beyond `roundAt` to 0\n for (var /** @type {?} */ j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n }\n else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.integerLen = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var /** @type {?} */ i = 1; i < roundAt; i++)\n digits[i] = 0;\n }\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var /** @type {?} */ k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.integerLen++;\n }\n digits.unshift(1);\n parsedNumber.integerLen++;\n }\n else {\n digits[roundAt - 1]++;\n }\n }\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++)\n digits.push(0);\n var /** @type {?} */ dropTrailingZeros = fractionSize !== 0;\n // Minimal length = nb of decimals required + current nb of integers\n // Any number besides that is optional and can be removed if it's a trailing 0\n var /** @type {?} */ minLen = minFrac + parsedNumber.integerLen;\n // Do any carrying, e.g. a digit was rounded up to 10\n var /** @type {?} */ carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d < 10 ? d : d - 10; // d % 10\n if (dropTrailingZeros) {\n // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n if (digits[i] === 0 && i >= minLen) {\n digits.pop();\n }\n else {\n dropTrailingZeros = false;\n }\n }\n return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.integerLen++;\n }\n}\n/**\n * \\@internal\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n var /** @type {?} */ result = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} pipe\n * @param {?} locale\n * @param {?} value\n * @param {?} style\n * @param {?=} digits\n * @param {?=} currency\n * @param {?=} currencyAsSymbol\n * @return {?}\n */\nfunction formatNumber(pipe, locale, value, style, digits, currency, currencyAsSymbol) {\n if (currency === void 0) { currency = null; }\n if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }\n if (value == null)\n return null;\n // Convert strings to numbers\n value = typeof value === 'string' && !isNaN(+value - parseFloat(value)) ? +value : value;\n if (typeof value !== 'number') {\n throw invalidPipeArgumentError(pipe, value);\n }\n var /** @type {?} */ minInt;\n var /** @type {?} */ minFraction;\n var /** @type {?} */ maxFraction;\n if (style !== NumberFormatStyle.Currency) {\n // rely on Intl default for currency\n minInt = 1;\n minFraction = 0;\n maxFraction = 3;\n }\n if (digits) {\n var /** @type {?} */ parts = digits.match(NUMBER_FORMAT_REGEXP);\n if (parts === null) {\n throw new Error(digits + \" is not a valid digit info for number pipes\");\n }\n if (parts[1] != null) {\n // min integer digits\n minInt = parseIntAutoRadix(parts[1]);\n }\n if (parts[3] != null) {\n // min fraction digits\n minFraction = parseIntAutoRadix(parts[3]);\n }\n if (parts[5] != null) {\n // max fraction digits\n maxFraction = parseIntAutoRadix(parts[5]);\n }\n }\n return NumberFormatter.format(/** @type {?} */ (value), locale, style, {\n minimumIntegerDigits: minInt,\n minimumFractionDigits: minFraction,\n maximumFractionDigits: maxFraction,\n currency: currency,\n currencyAsSymbol: currencyAsSymbol,\n });\n}\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number according to locale rules.\n * \\@howToUse `number_expression | number[:digitInfo]`\n *\n * Formats a number as text. Group sizing and separator and other locale-specific\n * configurations are based on the active locale.\n *\n * where `expression` is a number:\n * - `digitInfo` is a `string` which has a following format: <br>\n * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>\n * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.\n * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.\n * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.\n *\n * For more information on the acceptable range for each of these numbers and other\n * details see your native internationalization library.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}\n *\n * \\@stable\n */\nvar DeprecatedDecimalPipe = /** @class */ (function () {\n function DeprecatedDecimalPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedDecimalPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n function (value, digits) {\n return formatNumber(DeprecatedDecimalPipe, this._locale, value, NumberFormatStyle.Decimal, digits);\n };\n DeprecatedDecimalPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'number' },] },\n ];\n /** @nocollapse */\n DeprecatedDecimalPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedDecimalPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as a percentage according to locale rules.\n * \\@howToUse `number_expression | percent[:digitInfo]`\n *\n * \\@description\n *\n * Formats a number as percentage.\n *\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}\n *\n * \\@stable\n */\nvar DeprecatedPercentPipe = /** @class */ (function () {\n function DeprecatedPercentPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedPercentPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n function (value, digits) {\n return formatNumber(DeprecatedPercentPipe, this._locale, value, NumberFormatStyle.Percent, digits);\n };\n DeprecatedPercentPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'percent' },] },\n ];\n /** @nocollapse */\n DeprecatedPercentPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedPercentPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as currency using locale rules.\n * \\@howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]`\n * \\@description\n *\n * Use `currency` to format a number as currency.\n *\n * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such\n * as `USD` for the US dollar and `EUR` for the euro.\n * - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.\n * - `true`: use symbol (e.g. `$`).\n * - `false`(default): use code (e.g. `USD`).\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}\n *\n * \\@stable\n */\nvar DeprecatedCurrencyPipe = /** @class */ (function () {\n function DeprecatedCurrencyPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} symbolDisplay\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedCurrencyPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} symbolDisplay\n * @param {?=} digits\n * @return {?}\n */\n function (value, currencyCode, symbolDisplay, digits) {\n if (currencyCode === void 0) { currencyCode = 'USD'; }\n if (symbolDisplay === void 0) { symbolDisplay = false; }\n return formatNumber(DeprecatedCurrencyPipe, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);\n };\n DeprecatedCurrencyPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'currency' },] },\n ];\n /** @nocollapse */\n DeprecatedCurrencyPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedCurrencyPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of deprecated i18n pipes that require intl api\n *\n * @deprecated from v5\n */\nvar COMMON_DEPRECATED_I18N_PIPES = [DeprecatedDecimalPipe, DeprecatedPercentPipe, DeprecatedCurrencyPipe, DeprecatedDatePipe];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ObservableStrategy = /** @class */ (function () {\n function ObservableStrategy() {\n }\n /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n ObservableStrategy.prototype.createSubscription = /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n function (async, updateLatestValue) {\n return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });\n };\n /**\n * @param {?} subscription\n * @return {?}\n */\n ObservableStrategy.prototype.dispose = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { subscription.unsubscribe(); };\n /**\n * @param {?} subscription\n * @return {?}\n */\n ObservableStrategy.prototype.onDestroy = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { subscription.unsubscribe(); };\n return ObservableStrategy;\n}());\nvar PromiseStrategy = /** @class */ (function () {\n function PromiseStrategy() {\n }\n /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n PromiseStrategy.prototype.createSubscription = /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n function (async, updateLatestValue) {\n return async.then(updateLatestValue, function (e) { throw e; });\n };\n /**\n * @param {?} subscription\n * @return {?}\n */\n PromiseStrategy.prototype.dispose = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { };\n /**\n * @param {?} subscription\n * @return {?}\n */\n PromiseStrategy.prototype.onDestroy = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { };\n return PromiseStrategy;\n}());\nvar _promiseStrategy = new PromiseStrategy();\nvar _observableStrategy = new ObservableStrategy();\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Unwraps a value from an asynchronous primitive.\n * \\@howToUse `observable_or_promise_expression | async`\n * \\@description\n * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n * potential memory leaks.\n *\n *\n * ## Examples\n *\n * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n * promise.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n *\n * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n * to the view. The Observable continuously updates the view with the current time.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n *\n * \\@stable\n */\nvar AsyncPipe = /** @class */ (function () {\n function AsyncPipe(_ref) {\n this._ref = _ref;\n this._latestValue = null;\n this._latestReturnedValue = null;\n this._subscription = null;\n this._obj = null;\n this._strategy = /** @type {?} */ ((null));\n }\n /**\n * @return {?}\n */\n AsyncPipe.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._subscription) {\n this._dispose();\n }\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype.transform = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n if (!this._obj) {\n if (obj) {\n this._subscribe(obj);\n }\n this._latestReturnedValue = this._latestValue;\n return this._latestValue;\n }\n if (obj !== this._obj) {\n this._dispose();\n return this.transform(/** @type {?} */ (obj));\n }\n if (this._latestValue === this._latestReturnedValue) {\n return this._latestReturnedValue;\n }\n this._latestReturnedValue = this._latestValue;\n return __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"WrappedValue\"].wrap(this._latestValue);\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype._subscribe = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n var _this = this;\n this._obj = obj;\n this._strategy = this._selectStrategy(obj);\n this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype._selectStrategy = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisPromise\"])(obj)) {\n return _promiseStrategy;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisObservable\"])(obj)) {\n return _observableStrategy;\n }\n throw invalidPipeArgumentError(AsyncPipe, obj);\n };\n /**\n * @return {?}\n */\n AsyncPipe.prototype._dispose = /**\n * @return {?}\n */\n function () {\n this._strategy.dispose(/** @type {?} */ ((this._subscription)));\n this._latestValue = null;\n this._latestReturnedValue = null;\n this._subscription = null;\n this._obj = null;\n };\n /**\n * @param {?} async\n * @param {?} value\n * @return {?}\n */\n AsyncPipe.prototype._updateLatestValue = /**\n * @param {?} async\n * @param {?} value\n * @return {?}\n */\n function (async, value) {\n if (async === this._obj) {\n this._latestValue = value;\n this._ref.markForCheck();\n }\n };\n AsyncPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'async', pure: false },] },\n ];\n /** @nocollapse */\n AsyncPipe.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n return AsyncPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms text to lowercase.\n *\n * {\\@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe' }\n *\n * \\@stable\n */\nvar LowerCasePipe = /** @class */ (function () {\n function LowerCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n LowerCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(LowerCasePipe, value);\n }\n return value.toLowerCase();\n };\n LowerCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'lowercase' },] },\n ];\n /** @nocollapse */\n LowerCasePipe.ctorParameters = function () { return []; };\n return LowerCasePipe;\n}());\n/**\n * Helper method to transform a single word to titlecase.\n *\n * \\@stable\n * @param {?} word\n * @return {?}\n */\nfunction titleCaseWord(word) {\n if (!word)\n return word;\n return word[0].toUpperCase() + word.substr(1).toLowerCase();\n}\n/**\n * Transforms text to titlecase.\n *\n * \\@stable\n */\nvar TitleCasePipe = /** @class */ (function () {\n function TitleCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n TitleCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(TitleCasePipe, value);\n }\n return value.split(/\\b/g).map(function (word) { return titleCaseWord(word); }).join('');\n };\n TitleCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'titlecase' },] },\n ];\n /** @nocollapse */\n TitleCasePipe.ctorParameters = function () { return []; };\n return TitleCasePipe;\n}());\n/**\n * Transforms text to uppercase.\n *\n * \\@stable\n */\nvar UpperCasePipe = /** @class */ (function () {\n function UpperCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n UpperCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(UpperCasePipe, value);\n }\n return value.toUpperCase();\n };\n UpperCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'uppercase' },] },\n ];\n /** @nocollapse */\n UpperCasePipe.ctorParameters = function () { return []; };\n return UpperCasePipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _INTERPOLATION_REGEXP = /#/g;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Maps a value to a string that pluralizes the value according to locale rules.\n * \\@howToUse `expression | i18nPlural:mapping[:locale]`\n * \\@description\n *\n * Where:\n * - `expression` is a number.\n * - `mapping` is an object that mimics the ICU format, see\n * http://userguide.icu-project.org/formatparse/messages\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}\n *\n * \\@experimental\n */\nvar I18nPluralPipe = /** @class */ (function () {\n function I18nPluralPipe(_localization) {\n this._localization = _localization;\n }\n /**\n * @param {?} value\n * @param {?} pluralMap\n * @param {?=} locale\n * @return {?}\n */\n I18nPluralPipe.prototype.transform = /**\n * @param {?} value\n * @param {?} pluralMap\n * @param {?=} locale\n * @return {?}\n */\n function (value, pluralMap, locale) {\n if (value == null)\n return '';\n if (typeof pluralMap !== 'object' || pluralMap === null) {\n throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);\n }\n var /** @type {?} */ key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);\n return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());\n };\n I18nPluralPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'i18nPlural', pure: true },] },\n ];\n /** @nocollapse */\n I18nPluralPipe.ctorParameters = function () { return [\n { type: NgLocalization, },\n ]; };\n return I18nPluralPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Generic selector that displays the string that matches the current value.\n * \\@howToUse `expression | i18nSelect:mapping`\n * \\@description\n *\n * Where `mapping` is an object that indicates the text that should be displayed\n * for different values of the provided `expression`.\n * If none of the keys of the mapping match the value of the `expression`, then the content\n * of the `other` key is returned when present, otherwise an empty string is returned.\n *\n * ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}\n *\n * \\@experimental\n */\nvar I18nSelectPipe = /** @class */ (function () {\n function I18nSelectPipe() {\n }\n /**\n * @param {?} value\n * @param {?} mapping\n * @return {?}\n */\n I18nSelectPipe.prototype.transform = /**\n * @param {?} value\n * @param {?} mapping\n * @return {?}\n */\n function (value, mapping) {\n if (value == null)\n return '';\n if (typeof mapping !== 'object' || typeof value !== 'string') {\n throw invalidPipeArgumentError(I18nSelectPipe, mapping);\n }\n if (mapping.hasOwnProperty(value)) {\n return mapping[value];\n }\n if (mapping.hasOwnProperty('other')) {\n return mapping['other'];\n }\n return '';\n };\n I18nSelectPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'i18nSelect', pure: true },] },\n ];\n /** @nocollapse */\n I18nSelectPipe.ctorParameters = function () { return []; };\n return I18nSelectPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Converts value into JSON string.\n * \\@howToUse `expression | json`\n * \\@description\n *\n * Converts value into string using `JSON.stringify`. Useful for debugging.\n *\n * ### Example\n * {\\@example common/pipes/ts/json_pipe.ts region='JsonPipe'}\n *\n * \\@stable\n */\nvar JsonPipe = /** @class */ (function () {\n function JsonPipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n JsonPipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return JSON.stringify(value, null, 2); };\n JsonPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'json', pure: false },] },\n ];\n /** @nocollapse */\n JsonPipe.ctorParameters = function () { return []; };\n return JsonPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number according to locale rules.\n * \\@howToUse `number_expression | number[:digitInfo[:locale]]`\n *\n * Formats a number as text. Group sizing and separator and other locale-specific\n * configurations are based on the active locale.\n *\n * where `expression` is a number:\n * - `digitInfo` is a `string` which has a following format: <br>\n * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>\n * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.\n * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.\n * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * For more information on the acceptable range for each of these numbers and other\n * details see your native internationalization library.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='NumberPipe'}\n *\n * \\@stable\n */\nvar DecimalPipe = /** @class */ (function () {\n function DecimalPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n DecimalPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, digits, locale) {\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Decimal, digits), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(DecimalPipe, error);\n }\n return str;\n };\n DecimalPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'number' },] },\n ];\n /** @nocollapse */\n DecimalPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DecimalPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as a percentage according to locale rules.\n * \\@howToUse `number_expression | percent[:digitInfo[:locale]]`\n *\n * \\@description\n *\n * Formats a number as percentage.\n *\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}\n *\n * \\@stable\n */\nvar PercentPipe = /** @class */ (function () {\n function PercentPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n PercentPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, digits, locale) {\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Percent, digits), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(PercentPipe, error);\n }\n return str;\n };\n PercentPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'percent' },] },\n ];\n /** @nocollapse */\n PercentPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return PercentPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as currency using locale rules.\n * \\@howToUse `number_expression | currency[:currencyCode[:display[:digitInfo[:locale]]]]`\n * \\@description\n *\n * Use `currency` to format a number as currency.\n *\n * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such\n * as `USD` for the US dollar and `EUR` for the euro.\n * - `display` indicates whether to show the currency symbol or the code.\n * - `code`: use code (e.g. `USD`).\n * - `symbol`(default): use symbol (e.g. `$`).\n * - `symbol-narrow`: some countries have two symbols for their currency, one regular and one\n * narrow (e.g. the canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`).\n * - boolean (deprecated from v5): `true` for symbol and false for `code`\n * If there is no narrow symbol for the chosen currency, the regular symbol will be used.\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}\n *\n * \\@stable\n */\nvar CurrencyPipe = /** @class */ (function () {\n function CurrencyPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} display\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n CurrencyPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} display\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, currencyCode, display, digits, locale) {\n if (display === void 0) { display = 'symbol'; }\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n if (typeof display === 'boolean') {\n if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn(\"Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \\\"code\\\", \\\"symbol\\\" or \\\"symbol-narrow\\\".\");\n }\n display = display ? 'symbol' : 'code';\n }\n var /** @type {?} */ currency = currencyCode || 'USD';\n if (display !== 'code') {\n currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow');\n }\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Currency, digits, currency), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(CurrencyPipe, error);\n }\n return str;\n };\n CurrencyPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'currency' },] },\n ];\n /** @nocollapse */\n CurrencyPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return CurrencyPipe;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isEmpty(value) {\n return value == null || value === '' || value !== value;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a new List or String containing a subset (slice) of the elements.\n * \\@howToUse `array_or_string_expression | slice:start[:end]`\n * \\@description\n *\n * Where the input expression is a `List` or `String`, and:\n * - `start`: The starting index of the subset to return.\n * - **a positive integer**: return the item at `start` index and all items after\n * in the list or string expression.\n * - **a negative integer**: return the item at `start` index from the end and all items after\n * in the list or string expression.\n * - **if positive and greater than the size of the expression**: return an empty list or string.\n * - **if negative and greater than the size of the expression**: return entire list or string.\n * - `end`: The ending index of the subset to return.\n * - **omitted**: return all items until the end.\n * - **if positive**: return all items before `end` index of the list or string.\n * - **if negative**: return all items before `end` index from the end of the list or string.\n *\n * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`\n * and `String.prototype.slice()`.\n *\n * When operating on a [List], the returned list is always a copy even when all\n * the elements are being returned.\n *\n * When operating on a blank value, the pipe returns the blank value.\n *\n * ## List Example\n *\n * This `ngFor` example:\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}\n *\n * produces the following:\n *\n * <li>b</li>\n * <li>c</li>\n *\n * ## String Examples\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}\n *\n * \\@stable\n */\nvar SlicePipe = /** @class */ (function () {\n function SlicePipe() {\n }\n /**\n * @param {?} value\n * @param {?} start\n * @param {?=} end\n * @return {?}\n */\n SlicePipe.prototype.transform = /**\n * @param {?} value\n * @param {?} start\n * @param {?=} end\n * @return {?}\n */\n function (value, start, end) {\n if (value == null)\n return value;\n if (!this.supports(value)) {\n throw invalidPipeArgumentError(SlicePipe, value);\n }\n return value.slice(start, end);\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n SlicePipe.prototype.supports = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) { return typeof obj === 'string' || Array.isArray(obj); };\n SlicePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'slice', pure: false },] },\n ];\n /** @nocollapse */\n SlicePipe.ctorParameters = function () { return []; };\n return SlicePipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of Angular pipes that are likely to be used in each and every application.\n */\nvar COMMON_PIPES = [\n AsyncPipe,\n UpperCasePipe,\n LowerCasePipe,\n JsonPipe,\n SlicePipe,\n DecimalPipe,\n PercentPipe,\n TitleCasePipe,\n CurrencyPipe,\n DatePipe,\n I18nPluralPipe,\n I18nSelectPipe,\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * The module that includes all the basic Angular directives like {\\@link NgIf}, {\\@link NgForOf}, ...\n *\n * \\@stable\n */\nvar CommonModule = /** @class */ (function () {\n function CommonModule() {\n }\n CommonModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [COMMON_DIRECTIVES, COMMON_PIPES],\n exports: [COMMON_DIRECTIVES, COMMON_PIPES],\n providers: [\n { provide: NgLocalization, useClass: NgLocaleLocalization },\n ],\n },] },\n ];\n /** @nocollapse */\n CommonModule.ctorParameters = function () { return []; };\n return CommonModule;\n}());\nvar ɵ0 = getPluralCase;\n/**\n * A module that contains the deprecated i18n pipes.\n *\n * @deprecated from v5\n */\nvar DeprecatedI18NPipesModule = /** @class */ (function () {\n function DeprecatedI18NPipesModule() {\n }\n DeprecatedI18NPipesModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [COMMON_DEPRECATED_I18N_PIPES],\n exports: [COMMON_DEPRECATED_I18N_PIPES],\n providers: [{ provide: DEPRECATED_PLURAL_FN, useValue: ɵ0 }],\n },] },\n ];\n /** @nocollapse */\n DeprecatedI18NPipesModule.ctorParameters = function () { return []; };\n return DeprecatedI18NPipesModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application into a Web Worker).\n *\n * \\@stable\n */\nvar DOCUMENT = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('DocumentToken');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PLATFORM_BROWSER_ID = 'browser';\nvar PLATFORM_SERVER_ID = 'server';\nvar PLATFORM_WORKER_APP_ID = 'browserWorkerApp';\nvar PLATFORM_WORKER_UI_ID = 'browserWorkerUi';\n/**\n * Returns whether a platform id represents a browser platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformBrowser(platformId) {\n return platformId === PLATFORM_BROWSER_ID;\n}\n/**\n * Returns whether a platform id represents a server platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformServer(platformId) {\n return platformId === PLATFORM_SERVER_ID;\n}\n/**\n * Returns whether a platform id represents a web worker app platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerApp(platformId) {\n return platformId === PLATFORM_WORKER_APP_ID;\n}\n/**\n * Returns whether a platform id represents a web worker UI platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerUi(platformId) {\n return platformId === PLATFORM_WORKER_UI_ID;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=common.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXM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qknXSxcbiAgICAnS1JXJzogWyfigqknXSxcbiAgICAnS1lEJzogWywgJyQnXSxcbiAgICAnS1pUJzogWywgJ+KCuCddLFxuICAgICdMQUsnOiBbLCAn4oKtJ10sXG4gICAgJ0xCUCc6IFssICdMwqMnXSxcbiAgICAnTEtSJzogWywgJ1JzJ10sXG4gICAgJ0xSRCc6IFssICckJ10sXG4gICAgJ0xUTCc6IFssICdMdCddLFxuICAgICdMVkwnOiBbLCAnTHMnXSxcbiAgICAnTUdBJzogWywgJ0FyJ10sXG4gICAgJ01NSyc6IFssICdLJ10sXG4gICAgJ01OVCc6IFssICfigq4nXSxcbiAgICAnTVVSJzogWywgJ1JzJ10sXG4gICAgJ01YTic6IFsnTVgkJywgJyQnXSxcbiAgICAnTVlSJzogWywgJ1JNJ10sXG4gICAgJ05BRCc6IFssICckJ10sXG4gICAgJ05HTic6IFssICfigqYnXSxcbiAgICAnTklPJzogWywgJ0MkJ10sXG4gICAgJ05PSyc6IFssICdrciddLFxuICAgICdOUFInOiBbLCAnUnMnXSxcbiAgICAnTlpEJzogWydOWiQnLCAnJCddLFxuICAgICdQSFAnOiBbLCAn4oKxJ10sXG4gICAgJ1BLUic6IFssICdScyddLFxuICAgICdQTE4nOiBbLCAnesWCJ10sXG4gICAgJ1BZRyc6IFssICfigrInXSxcbiAgICAnUk9OJzogWywgJ2xlaSddLFxuICAgICdSVUInOiBbLCAn4oK9J10sXG4gICAgJ1JVUic6IFssICfRgC4nXSxcbiAgICAnUldGJzogWywgJ1JGJ10sXG4gICAgJ1NCRCc6IFssICckJ10sXG4gICAgJ1NFSyc6IFssICdrciddLFxuICAgICdTR0QnOiBbLCAnJCddLFxuICAgICdTSFAnOiBbLCAnwqMnXSxcbiAgICAnU1JEJzogWywgJyQnXSxcbiAgICAnU1NQJzogWywgJ8KjJ10sXG4gICAgJ1NURCc6IFssICdEYiddLFxuICAgICdTWVAnOiBbLCAnwqMnXSxcbiAgICAnVEhCJzogWywgJ+C4vyddLFxuICAg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Zsb29yKE1hdGguYWJzKG4pKSwgLyoqIEB0eXBlIHs/fSAqLyB2ID0gbi50b1N0cmluZygpLnJlcGxhY2UoL15bXi5dKlxcLj8vLCAnJykubGVuZ3RoO1xuICAgIGlmIChpID09PSAxICYmIHYgPT09IDApXG4gICAgICAgIHJldHVybiAxO1xuICAgIHJldHVybiA1O1xufVxudmFyIGxvY2FsZUVuID0gW1xuICAgICdlbicsXG4gICAgW1xuICAgICAgICBbJ2EnLCAncCddLFxuICAgICAgICBbJ0FNJywgJ1BNJ10sXG4gICAgXSxcbiAgICBbXG4gICAgICAgIFsnQU0nLCAnUE0nXSxcbiAgICAgICAgLFxuICAgIF0sXG4gICAgW1xuICAgICAgICBbJ1MnLCAnTScsICdUJywgJ1cnLCAnVCcsICdGJywgJ1MnXSwgWydTdW4nLCAnTW9uJywgJ1R1ZScsICdXZWQnLCAnVGh1JywgJ0ZyaScsICdTYXQnXSxcbiAgICAgICAgWydTdW5kYXknLCAnTW9uZGF5JywgJ1R1ZXNkYXknLCAnV2VkbmVzZGF5JywgJ1RodXJzZGF5JywgJ0ZyaWRheScsICdTYXR1cmRheSddLFxuICAgICAgICBbJ1N1JywgJ01vJywgJ1R1JywgJ1dlJywgJ1RoJywgJ0ZyJywgJ1NhJ11cbiAgICBdLFxuICAgICxcbiAgICBbXG4gICAgICAgIFsnSicsICdGJywgJ00nLCAnQScsICdNJywgJ0onLCAnSicsICdBJywgJ1MnLCAnTycsICdOJywgJ0QnXSxcbiAgICAgICAgWydKYW4nLCAnRmViJywgJ01hcicsICdBcHInLCAnTWF5JywgJ0p1bicsICdKdWwnLCAnQXVnJywgJ1NlcCcsICdPY3QnLCAnTm92JywgJ0RlYyddLFxuICAgICAgICBbXG4gICAgICAgICAgICAnSmFudWFyeScsICdGZWJydWFyeScsICdNYXJjaCcsICdBcHJpbCcsICdNYXknLCAnSnVuZScsICdKdWx5JywgJ0F1Z3VzdCcsICdTZXB0ZW1iZXInLFxuICAgICAgICAgICAgJ09jdG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NlICdsYic6XG4gICAgICAgIGNhc2UgJ2xnJzpcbiAgICAgICAgY2FzZSAnbWFzJzpcbiAgICAgICAgY2FzZSAnbWdvJzpcbiAgICAgICAgY2FzZSAnbWwnOlxuICAgICAgICBjYXNlICdtbic6XG4gICAgICAgIGNhc2UgJ25iJzpcbiAgICAgICAgY2FzZSAnbmQnOlxuICAgICAgICBjYXNlICduZSc6XG4gICAgICAgIGNhc2UgJ25uJzpcbiAgICAgICAgY2FzZSAnbm5oJzpcbiAgICAgICAgY2FzZSAnbnluJzpcbiAgICAgICAgY2FzZSAnb20nOlxuICAgICAgICBjYXNlICdvcic6XG4gICAgICAgIGNhc2UgJ29zJzpcbiAgICAgICAgY2FzZSAncHMnOlxuICAgICAgICBjYXNlICdybSc6XG4gICAgICAgIGNhc2UgJ3JvZic6XG4gICAgICAgIGNhc2UgJ3J3ayc6XG4gICAgICAgIGNhc2UgJ3NhcSc6XG4gICAgICAgIGNhc2UgJ3NlaCc6XG4gICAgICAgIGNhc2UgJ3NuJzpcbiAgICAgICAgY2FzZSAnc28nOlxuICAgICAgICBjYXNlICdzcSc6XG4gICAgICAgIGNhc2UgJ3RhJzpcbiAgICAgICAgY2FzZSAndGUnOlxuICAgICAgICBjYXNlICd0ZW8nOlxuICAgICAgICBjYXNlICd0ayc6XG4gICAgICAgIGNhc2UgJ3RyJzpcbiAgICAgICAgY2FzZSAndWcnOlxuICAgICAgICBjYXNlICd1eic6XG4gICAgICAgIGNhc2UgJ3ZvJzpcbiAgICAgICAgY2FzZSAndnVuJzpcbiAgICAgICAgY2FzZSAnd2FlJzpcbiAgICAgICAgY2FzZSAneG9nJzpcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYWsnOlxuICAgICAgICBjYXNlICdsbic6XG4gICAgICAgIGNhc2UgJ21nJzpcbiAgICAgICAgY2FzZSAncGEnOlxuICAgICAgICBjYXNlICd0aSc6XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDAgJiYgbiA8PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYW0nOlxuICAgICAgICBjYXNlICdhcyc6XG4gICAgICAgIGNhc2UgJ2JuJzpcbiAgICAgICAgY2FzZSAnZmEnOlxuICAgICAgICBjYXNlICdndSc6XG4gICAgICAgIGNhc2UgJ2hpJzpcbiAgICAgICAgY2FzZSAna24nOlxuICAgICAgICBjYXNlICdtcic6XG4gICAgICAgIGNhc2UgJ3p1JzpcbiAgICAgICAgICAgIGlmIChpID09PSAwIHx8IG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdhcic6XG4gICAgICAgICAgICBpZiAobiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlplcm87XG4gICAgICAgICAgICBpZiAobiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAzICYmIG4gJSAxMDAgPD0gMTApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDExICYmIG4gJSAxMDAgPD0gOTkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYXN0JzpcbiAgICAgICAgY2FzZSAnY2EnOlxuICAgICAgICBjYXNlICdkZSc6XG4gICAgICAgIGNhc2UgJ2VuJzpcbiAgICAgICAgY2FzZSAnZXQnOlxuICAgICAgICBjYXNlICdmaSc6XG4gICAgICAgIGNhc2UgJ2Z5JzpcbiAgICAgICAgY2FzZSAnZ2wnOlxuICAgICAgICBjYXNlICdpdCc6XG4gICAgICAgIGNhc2UgJ25sJzpcbiAgICAgICAgY2FzZSAnc3YnOlxuICAgICAgICBjYXNlICdzdyc6XG4gICAgICAgIGNhc2UgJ3VyJzpcbiAgICAgICAgY2FzZSAneWknOlxuICAgICAgICAgICAgaWYgKGkgPT09IDEgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2JlJzpcbiAgICAgICAgICAgIGlmIChuICUgMTAgPT09IDEgJiYgIShuICUgMTAwID09PSAxMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgbiAlIDEwID49IDIgJiYgbiAlIDEwIDw9IDQgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTIgJiYgbiAlIDEwMCA8PSAxNCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAwIHx8IG4gJSAxMCA9PT0gTWF0aC5mbG9vcihuICUgMTApICYmIG4gJSAxMCA+PSA1ICYmIG4gJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgbiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDExICYmIG4gJSAxMDAgPD0gMTQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYnInOlxuICAgICAgICAgICAgaWYgKG4gJSAxMCA9PT0gMSAmJiAhKG4gJSAxMDAgPT09IDExIHx8IG4gJSAxMDAgPT09IDcxIHx8IG4gJSAxMDAgPT09IDkxKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuICUgMTAgPT09IDIgJiYgIShuICUgMTAwID09PSAxMiB8fCBuICUgMTAwID09PSA3MiB8fCBuICUgMTAwID09PSA5MikpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgKG4gJSAxMCA+PSAzICYmIG4gJSAxMCA8PSA0IHx8IG4gJSAxMCA9PT0gOSkgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTAgJiYgbiAlIDEwMCA8PSAxOSB8fCBuICUgMTAwID49IDcwICYmIG4gJSAxMDAgPD0gNzkgfHxcbiAgICAgICAgICAgICAgICAgICAgbiAlIDEwMCA+PSA5MCAmJiBuICUgMTAwIDw9IDk5KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKG4gPT09IDApICYmIG4gJSAxZTYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYnMnOlxuICAgICAgICBjYXNlICdocic6XG4gICAgICAgIGNhc2UgJ3NyJzpcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmIGkgJSAxMCA9PT0gMSAmJiAhKGkgJSAxMDAgPT09IDExKSB8fCBmICUgMTAgPT09IDEgJiYgIShmICUgMTAwID09PSAxMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IE1hdGguZmxvb3IoaSAlIDEwKSAmJiBpICUgMTAgPj0gMiAmJiBpICUgMTAgPD0gNCAmJlxuICAgICAgICAgICAgICAgICEoaSAlIDEwMCA+PSAxMiAmJiBpICUgMTAwIDw9IDE0KSB8fFxuICAgICAgICAgICAgICAgIGYgJSAxMCA9PT0gTWF0aC5mbG9vcihmICUgMTApICYmIGYgJSAxMCA+PSAyICYmIGYgJSAxMCA8PSA0ICYmXG4gICAgICAgICAgICAgICAgICAgICEoZiAlIDEwMCA+PSAxMiAmJiBmICUgMTAwIDw9IDE0KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2NzJzpcbiAgICAgICAgY2FzZSAnc2snOlxuICAgICAgICAgICAgaWYgKGkgPT09IDEgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChpID09PSBNYXRoLmZsb29yKGkpICYmIGkgPj0gMiAmJiBpIDw9IDQgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2N5JzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKG4gPT09IDIpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAobiA9PT0gMylcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmIChuID09PSA2KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2RhJzpcbiAgICAgICAgICAgIGlmIChuID09PSAxIHx8ICEodCA9PT0gMCkgJiYgKGkgPT09IDAgfHwgaSA9PT0gMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdkc2InOlxuICAgICAgICBjYXNlICdoc2InOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMSB8fCBmICUgMTAwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMiB8fCBmICUgMTAwID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gTWF0aC5mbG9vcihpICUgMTAwKSAmJiBpICUgMTAwID49IDMgJiYgaSAlIDEwMCA8PSA0IHx8XG4gICAgICAgICAgICAgICAgZiAlIDEwMCA9PT0gTWF0aC5mbG9vcihmICUgMTAwKSAmJiBmICUgMTAwID49IDMgJiYgZiAlIDEwMCA8PSA0KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnZmYnOlxuICAgICAgICBjYXNlICdmcic6XG4gICAgICAgIGNhc2UgJ2h5JzpcbiAgICAgICAgY2FzZSAna2FiJzpcbiAgICAgICAgICAgIGlmIChpID09PSAwIHx8IGkgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdmaWwnOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgKGkgPT09IDEgfHwgaSA9PT0gMiB8fCBpID09PSAzKSB8fFxuICAgICAgICAgICAgICAgIHYgPT09IDAgJiYgIShpICUgMTAgPT09IDQgfHwgaSAlIDEwID09PSA2IHx8IGkgJSAxMCA9PT0gOSkgfHxcbiAgICAgICAgICAgICAgICAhKHYgPT09IDApICYmICEoZiAlIDEwID09PSA0IHx8IGYgJSAxMCA9PT0gNiB8fCBmICUgMTAgPT09IDkpKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnZ2EnOlxuICAgICAgICAgICAgaWYgKG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiA9PT0gMilcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlR3bztcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMyAmJiBuIDw9IDYpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDcgJiYgbiA8PSAxMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdnZCc6XG4gICAgICAgICAgICBpZiAobiA9PT0gMSB8fCBuID09PSAxMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyIHx8IG4gPT09IDEyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKG4gPT09IE1hdGguZmxvb3IobikgJiYgKG4gPj0gMyAmJiBuIDw9IDEwIHx8IG4gPj0gMTMgJiYgbiA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdndic6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDIpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJlxuICAgICAgICAgICAgICAgIChpICUgMTAwID09PSAwIHx8IGkgJSAxMDAgPT09IDIwIHx8IGkgJSAxMDAgPT09IDQwIHx8IGkgJSAxMDAgPT09IDYwIHx8IGkgJSAxMDAgPT09IDgwKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2hlJzpcbiAgICAgICAgICAgIGlmIChpID09PSAxICYmIHYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAoaSA9PT0gMiAmJiB2ID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgIShuID49IDAgJiYgbiA8PSAxMCkgJiYgbiAlIDEwID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2lzJzpcbiAgICAgICAgICAgIGlmICh0ID09PSAwICYmIGkgJSAxMCA9PT0gMSAmJiAhKGkgJSAxMDAgPT09IDExKSB8fCAhKHQgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAna3NoJzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAna3cnOlxuICAgICAgICBjYXNlICduYXEnOlxuICAgICAgICBjYXNlICdzZSc6XG4gICAgICAgIGNhc2UgJ3Ntbic6XG4gICAgICAgICAgICBpZiAobiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbGFnJzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmICgoaSA9PT0gMCB8fCBpID09PSAxKSAmJiAhKG4gPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbHQnOlxuICAgICAgICAgICAgaWYgKG4gJSAxMCA9PT0gMSAmJiAhKG4gJSAxMDAgPj0gMTEgJiYgbiAlIDEwMCA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgbiAlIDEwID49IDIgJiYgbiAlIDEwIDw9IDkgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTEgJiYgbiAlIDEwMCA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAoIShmID09PSAwKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdsdic6XG4gICAgICAgIGNhc2UgJ3ByZyc6XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAwIHx8IG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAxMSAmJiBuICUgMTAwIDw9IDE5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMiAmJiBmICUgMTAwID09PSBNYXRoLmZsb29yKGYgJSAxMDApICYmIGYgJSAxMDAgPj0gMTEgJiYgZiAlIDEwMCA8PSAxOSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlplcm87XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAxICYmICEobiAlIDEwMCA9PT0gMTEpIHx8IHYgPT09IDIgJiYgZiAlIDEwID09PSAxICYmICEoZiAlIDEwMCA9PT0gMTEpIHx8XG4gICAgICAgICAgICAgICAgISh2ID09PSAyKSAmJiBmICUgMTAgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdtayc6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDEgfHwgZiAlIDEwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbXQnOlxuICAgICAgICAgICAgaWYgKG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiA9PT0gMCB8fCBuICUgMTAwID09PSBNYXRoLmZsb29yKG4gJSAxMDApICYmIG4gJSAxMDAgPj0gMiAmJiBuICUgMTAwIDw9IDEwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgaWYgKG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAxMSAmJiBuICUgMTAwIDw9IDE5KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ3BsJzpcbiAgICAgICAgICAgIGlmIChpID09PSAxICYmIHYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IE1hdGguZmxvb3IoaSAlIDEwKSAmJiBpICUgMTAgPj0gMiAmJiBpICUgMTAgPD0gNCAmJlxuICAgICAgICAgICAgICAgICEoaSAlIDEwMCA+PSAxMiAmJiBpICUgMTAwIDw9IDE0KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmICEoaSA9PT0gMSkgJiYgaSAlIDEwID09PSBNYXRoLmZsb29yKGkgJSAxMCkgJiYgaSAlIDEwID49IDAgJiYgaSAlIDEwIDw9IDEgfHxcbiAgICAgICAgICAgICAgICB2ID09PSAwICYmIGkgJSAxMCA9PT0gTWF0aC5mbG9vcihpICUgMTApICYmIGkgJSAxMCA+PSA1ICYmIGkgJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMCAmJiBpICUgMTAwID09PSBNYXRoLmZsb29yKGkgJSAxMDApICYmIGkgJSAxMDAgPj0gMTIgJiYgaSAlIDEwMCA8PSAxNClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdwdCc6XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDAgJiYgbiA8PSAyICYmICEobiA9PT0gMikpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdybyc6XG4gICAgICAgICAgICBpZiAoaSA9PT0gMSAmJiB2ID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKCEodiA9PT0gMCkgfHwgbiA9PT0gMCB8fFxuICAgICAgICAgICAgICAgICEobiA9PT0gMSkgJiYgbiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDEgJiYgbiAlIDEwMCA8PSAxOSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ3J1JzpcbiAgICAgICAgY2FzZSAndWsnOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwID09PSAxICYmICEoaSAlIDEwMCA9PT0gMTEpKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwID09PSBNYXRoLmZsb29yKGkgJSAxMCkgJiYgaSAlIDEwID49IDIgJiYgaSAlIDEwIDw9IDQgJiZcbiAgICAgICAgICAgICAgICAhKGkgJSAxMDAgPj0gMTIgJiYgaSAlIDEwMCA8PSAxNCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDAgfHxcbiAgICAgICAgICAgICAgICB2ID09PSAwICYmIGkgJSAxMCA9PT0gTWF0aC5mbG9vcihpICUgMTApICYmIGkgJSAxMCA+PSA1ICYmIGkgJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMCAmJiBpICUgMTAwID09PSBNYXRoLmZsb29yKGkgJSAxMDApICYmIGkgJSAxMDAgPj0gMTEgJiYgaSAlIDEwMCA8PSAxNClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdzaGknOlxuICAgICAgICAgICAgaWYgKGkgPT09IDAgfHwgbiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMiAmJiBuIDw9IDEwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnc2knOlxuICAgICAgICAgICAgaWYgKG4gPT09IDAgfHwgbiA9PT0gMSB8fCBpID09PSAwICYmIGYgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdzbCc6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMilcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlR3bztcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmIGkgJSAxMDAgPT09IE1hdGguZmxvb3IoaSAlIDEwMCkgJiYgaSAlIDEwMCA+PSAzICYmIGkgJSAxMDAgPD0gNCB8fCAhKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAndHptJzpcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMCAmJiBuIDw9IDEgfHwgbiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDExICYmIG4gPD0gOTkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICAvLyBXaGVuIHRoZXJlIGlzIG5vIHNwZWNpZmljYXRpb24sIHRoZSBkZWZhdWx0IGlzIGFsd2F5cyBcIm90aGVyXCJcbiAgICAgICAgLy8gU3BlYzogaHR0cDovL2NsZHIudW5pY29k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ZWN0LmRlZmluZVByb3BlcnR5KE5nQ2xhc3MucHJvdG90eXBlLCBcIm5nQ2xhc3NcIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB0aGlzLl9jbGVhbnVwQ2xhc3Nlcyh0aGlzLl9yYXdDbGFzcyk7XG4gICAgICAgICAgICB0aGlzLl9pdGVyYWJsZURpZmZlciA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLl9rZXlWYWx1ZURpZmZlciA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLl9yYXdDbGFzcyA9IHR5cGVvZiB2ID09PSAnc3RyaW5nJyA/IHYuc3BsaXQoL1xccysvKSA6IHY7XG4gICAgICAgICAgICBpZiAodGhpcy5fcmF3Q2xhc3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoybVpc0xpc3RMaWtlSXRlcmFibGUodGhpcy5fcmF3Q2xhc3MpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2l0ZXJhYmxlRGlmZmVyID0gdGhpcy5faXRlcmFibGVEaWZmZXJzLmZpbmQodGhpcy5fcmF3Q2xhc3MpLmNyZWF0ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fa2V5VmFsdWVEaWZmZXIgPSB0aGlzLl9rZXlWYWx1ZURpZmZlcnMuZmluZCh0aGlzLl9yYXdDbGFzcykuY3JlYXRlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuIC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zc10gIT0gbnVsbClcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl90b2dnbGVDbGFzcyhrbGFzcywgIWlzQ2xlYW51cCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30ga2xhc3NcbiAgICAgKiBAcGFyYW0gez99IGVuYWJsZWRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nQ2xhc3MucHJvdG90eXBlLl90b2dnbGVDbGFzcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30ga2xhc3NcbiAgICAgKiBAcGFyYW0gez99IGVuYWJsZWRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChrbGFzcywgZW5hYmxlZCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBrbGFzcyA9IGtsYXNzLnRyaW0oKTtcbiAgICAgICAgaWYgKGtsYXNzKSB7XG4gICAgICAgICAgICBrbGFzcy5zcGxpdCgvXFxzKy9nKS5mb3JFYWNoKGZ1bmN0aW9uIChrbGFzcykge1xuICAgICAgICAgICAgICAgIGlmIChlbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLl9yZW5kZXJlci5hZGRDbGFzcyhfdGhpcy5fbmdFbC5uYXRpdmVFbGVtZW50LCBrbGFzcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5fcmVuZGVyZXIucmVtb3ZlQ2xhc3MoX3RoaXMuX25nRWwubmF0aXZlRWxlbWVudCwga2xhc3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBOZ0NsYXNzLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgd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ICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBlbEluamVjdG9yID0gdGhpcy5uZ0NvbXBvbmVudE91dGxldEluamVjdG9yIHx8IHRoaXMuX3ZpZXdDb250YWluZXJSZWYucGFyZW50SW5qZWN0b3I7XG4gICAgICAgICAgICBpZiAoY2hhbmdlc1snbmdDb21wb25lbnRPdXRsZXROZ01vZHVsZUZhY3RvcnknXSkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9tb2R1bGVSZWYpXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21vZHVsZVJlZi5kZXN0cm95KCk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubmdDb21wb25lbnRPdXRsZXROZ01vZHVsZUZhY3RvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGFyZW50TW9kdWxlID0gZWxJbmplY3Rvci5nZXQoTmdNb2R1bGVSZWYpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9tb2R1bGVSZWYgPSB0aGlzLm5nQ29tcG9uZW50T3V0bGV0TmdNb2R1bGVGYWN0b3J5LmNyZWF0ZShwYXJlbnRNb2R1bGUuaW5qZWN0b3IpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbW9kdWxlUmVmID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIgPSB0aGlzLl9tb2R1bGVSZWYgPyB0aGlzLl9tb2R1bGVSZWYuY29tcG9uZW50RmFjdG9yeVJlc29sdmVyIDpcbiAgICAgICAgICAgICAgICBlbEluamVjdG9yLmdldChDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P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jb3VudDtcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KE5nRm9yT2ZDb250ZXh0LnByb3RvdHlwZSwgXCJmaXJzdFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLmluZGV4ID09PSAwOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoTmdGb3JPZkNvbnRleHQucHJvdG90eXBlLCBcImxhc3RcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpcy5pbmRleCA9PT0gdGhpcy5jb3VudCAtIDE7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShOZ0Zvck9mQ29udGV4dC5wcm90b3R5cGUsIFwiZXZlblwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLmluZGV4ICUgMiA9PT0gMDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KE5nRm9yT2ZDb250ZXh0LnByb3RvdHlwZSwgXCJvZGRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAg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/fSAqLyB2aWV3ID0gLyoqIEB0eXBlIHs/fSAqLyAoKF90aGlzLl92aWV3Q29udGFpbmVyLmdldChhZGp1c3RlZFByZXZpb3VzSW5kZXgpKSk7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3ZpZXdDb250YWluZXIubW92ZSh2aWV3LCBjdXJyZW50SW5kZXgpO1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHR1cGxlID0gbmV3IFJlY29yZFZpZXdUdXBsZShpdGVtLCAvKiogQHR5cGUgez99ICovICh2aWV3KSk7XG4gICAgICAgICAgICAgICAgaW5zZXJ0VHVwbGVzLnB1c2godHVwbGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IGluc2VydFR1cGxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGhpcy5fcGVyVmlld0NoYW5nZShpbnNlcnRUdXBsZXNbaV0udmlldywgaW5zZXJ0VHVwbGVzW2ldLnJlY29yZCk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMCwgLyoqIEB0eXBlIHs/fSAqLyBpbGVuID0gdGhpcy5fdmlld0NvbnRhaW5lci5sZW5ndGg7IGkgPCBpbGVuOyBpKyspIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZpZXdSZWYgPSAvKiogQHR5cGUgez99ICovICh0aGlzLl92aWV3Q29udGFpbmVyLmdldChpKSk7XG4gICAgICAgICAgICB2aWV3UmVmLmNvbnRleHQuaW5kZXggPSBpO1xuICAgICAgICAgICAgdmlld1JlZi5jb250ZXh0LmNvdW50ID0gaWxlbjtcbiAgICAgICAgfVxuICAgICAgICBjaGFuZ2VzLmZvckVhY2hJZGVudGl0eUNoYW5nZShmdW5jdGlvbiAocmVjb3JkKSB7XG4gICAgICAgICAgICB2YXIgLy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GlzLl9lbHNlVGVtcGxhdGVSZWYgPSBudWxsO1xuICAgICAgICB0aGlzLl90aGVuVmlld1JlZiA9IG51bGw7XG4gICAgICAgIHRoaXMuX2Vsc2VWaWV3UmVmID0gbnVsbDtcbiAgICAgICAgdGhpcy5fdGhlblRlbXBsYXRlUmVmID0gdGVtcGxhdGVSZWY7XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShOZ0lmLnByb3RvdHlwZSwgXCJuZ0lmXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSBjb25kaXRpb25cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChjb25kaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuX2NvbnRleHQuJGltcGxpY2l0ID0gdGhpcy5fY29udGV4dC5uZ0lmID0gY29uZGl0aW9uO1xuICAgICAgICAgICAgdGhpcy5fdXBkYXRlVmlldygpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoTmdJZi5wcm90b3R5cGUsIFwibmdJZlRoZW5cIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHRlbXBsYXRlUmVmXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodGVtcGxhdGVSZWYpIHtcbiAgICAgICAgICAgIHRoaXMuX3RoZW5UZW1wbGF0ZVJlZiA9IHRlbXBsYXRlUmVmO1xuICAgICAgICAgICAgdGhpcy5fdGhlblZpZXdSZWYgPSBudWxsOyAvLyBjbGVhciBwcmV2aW91cyB2aWV3IGlmIGFueS5cbiAgICAgICAgICAgIHRoaXMuX3VwZGF0ZVZpZXcoKTtcbiAgICAg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gIHRoaXMuX3RoZW5WaWV3UmVmID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIuY3JlYXRlRW1iZWRkZWRWaWV3KHRoaXMuX3RoZW5UZW1wbGF0ZVJlZiwgdGhpcy5fY29udGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9lbHNlVmlld1JlZikge1xuICAgICAgICAgICAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIuY2xlYXIoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl90aGVuVmlld1JlZiA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2Vsc2VUZW1wbGF0ZVJlZikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9lbHNlVmlld1JlZiA9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl92aWV3Q29udGFpbmVyLmNyZWF0ZUVtYmVkZGVkVmlldyh0aGlzLl9lbHNlVGVtcGxhdGVSZWYsIHRoaXMuX2NvbnRleHQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgTmdJZi5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3sgc2VsZWN0b3I6ICdbbmdJZl0nIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdJZi5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtcbiAgICAgICAgeyB0eXBlOiBWaWV3Q29udGFpbmVyUmVmLCB9LFxuICAgICAgICB7IHR5cGU6IFRlbXBsYXRlUmVmLCB9LFxuICAgIF07IH07XG4gICAgTmdJZi5wcm9wRGVjb3JhdG9ycyA9IHtcbiAgICAgICAgXCJuZ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iBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nU3dpdGNoLnByb3RvdHlwZS5fYWRkQ2FzZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLl9jYXNlQ291bnQrKzsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZpZXdcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nU3dpdGNoLnByb3RvdHlwZS5fYWRkRGVmYXVsdCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2aWV3XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmlldykge1xuICAgICAgICBpZiAoIXRoaXMuX2RlZmF1bHRWaWV3cykge1xuICAgICAgICAgICAgdGhpcy5fZGVmYXVsdFZpZXdzID0gW107XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fZGVmYXVsdFZpZXdzLnB1c2godmlldyk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1N3aXRjaC5wcm90b3R5cGUuX21hdGNoQ2FzZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1hdGNoZWQgPSB2YWx1ZSA9PSB0aGlzLl9uZ1N3aXRjaDtcbiAgICAgICAgdGhpcy5fbGFz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30pO1xuICAgICAgICBpZiAocHJldkN0eEtleXMubGVuZ3RoID09PSBjdXJyQ3R4S2V5cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGZvciAodmFyIF9pID0gMCwgY3VyckN0eEtleXNfMSA9IGN1cnJDdHhLZXlzOyBfaSA8IGN1cnJDdHhLZXlzXzEubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BOYW1lID0gY3VyckN0eEtleXNfMVtfaV07XG4gICAgICAgICAgICAgICAgaWYgKHByZXZDdHhLZXlzLmluZGV4T2YocHJvcE5hbWUpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjdHhcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nVGVtcGxhdGVPdXRsZXQucHJvdG90eXBlLl91cGRhdGVFeGlzdGluZ0NvbnRleHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGN0eFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGN0eCkge1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIF9hID0gT2JqZWN0LmtleXMoY3R4KTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIHZhciBwcm9wTmFtZSA9IF9hW19pXTtcbiAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovICh0aGlzLl92aWV3UmVmLmNvbnRleHQpKVtwcm9wTmFtZV0gPSAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5uZ1RlbXBsYXRlT3V0bGV0Q29udGV4dCk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gICAgc3dpdGNoIChuYW1lKSB7XG4gICAgICAgIGNhc2UgVHJhbnNsYXRpb25UeXBlLk1vbnRoczpcbiAgICAgICAgICAgIHJldHVybiBnZXRMb2NhbGVNb250aE5hbWVzKGxvY2FsZSwgZm9ybSwgd2lkdGgpW2RhdGUuZ2V0TW9udGgoKV07XG4gICAgICAgIGNhc2UgVHJhbnNsYXRpb25UeXBlLkRheXM6XG4gICAgICAgICAgICByZXR1cm4gZ2V0TG9jYWxlRGF5TmFtZXMobG9jYWxlLCBmb3JtLCB3aWR0aClbZGF0ZS5nZXREYXkoKV07XG4gICAgICAgIGNhc2UgVHJhbnNsYXRpb25UeXBlLkRheVBlcmlvZHM6XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdXJyZW50SG91cnNfMSA9IGRhdGUuZ2V0SG91cnMoKTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGN1cnJlbnRNaW51dGVzXzEgPSBkYXRlLmdldE1pbnV0ZXMoKTtcbiAgICAgICAgICAgIGlmIChleHRlbmRlZCkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJ1bGVzID0gZ2V0TG9jYWxlRXh0cmFEYXlQZXJpb2RSdWxlcyhsb2NhbGUpO1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRheVBlcmlvZHNfMSA9IGdldExvY2FsZUV4dHJhRGF5UGVyaW9kcyhsb2NhbGUsIGZvcm0sIHdpZHRoKTtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXN1bHRfMTtcbiAgICAgICAgICAgICAgICBydWxlcy5mb3JFYWNoKGZ1bmN0aW9uIChydWxlLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShydWxlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW9ybmluZywgYWZ0ZXJub29uLCBldmVuaW5nLCBuaWdodFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9hID0gcnVsZVswXSwgaG91cnNGcm9tID0gX2EuaG91cnMsIG1pbnV0ZXNGcm9tID0gX2EubWludXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfYiA9IHJ1bGVbMV0sIGhvdXJzVG8gPSBfYi5ob3VycywgbWludXRlc1RvID0gX2IubWludXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50SG91cnNfMSA+PSBob3Vyc0Zyb20gJiYgY3VycmVudE1pbnV0ZXNfMSA+PSBtaW51dGVzRnJvbSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjdXJyZW50SG91cnNfMSA8IGhvdXJzVG8gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnRIb3Vyc18xID09PSBob3Vyc1RvICYmIGN1cnJlbnRNaW51dGVzXzEgPCBtaW51dGVzVG8pKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdF8xID0gZGF5UGVyaW9kc18xW2luZGV4XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vb24gb3IgbWlkbmlnaHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBob3VycyA9IHJ1bGUuaG91cnMsIG1pbnV0ZXMgPSBydWxlLm1pbnV0ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaG91cnMgPT09IGN1cnJlbnRIb3Vyc18xICYmIG1pbnV0ZXMgPT09IGN1cnJlbnRNaW51dGVzXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRfMSA9IGRheVBlcmlvZHNfMVtpbmRleF07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIC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AgICAgICAgICAgICAgcmV0dXJuICgoem9uZSA+PSAwKSA/ICcrJyA6ICcnKSArIHBhZE51bWJlcihob3VycywgMiwgbWludXNTaWduKSArXG4gICAgICAgICAgICAgICAgICAgIHBhZE51bWJlcihNYXRoLmFicyh6b25lICUgNjApLCAyLCBtaW51c1NpZ24pO1xuICAgICAgICAgICAgY2FzZSBab25lV2lkdGguU2hvcnRHTVQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdHTVQnICsgKCh6b25lID49IDApID8gJysnIDogJycpICsgcGFkTnVtYmVyKGhvdXJzLCAxLCBtaW51c1NpZ24pO1xuICAgICAgICAgICAgY2FzZSBab25lV2lkdGguTG9uZzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ0dNVCcgKyAoKHpvbmUgPj0gMCkgPyAnKycgOiAnJykgKyBwYWROdW1iZXIoaG91cnMsIDIsIG1pbnVzU2lnbikgKyAnOicgK1xuICAgICAgICAgICAgICAgICAgICBwYWROdW1iZXIoTWF0aC5hYnMoem9uZSAlIDYwKSwgMiwgbWludXNTaWduKTtcbiAgICAgICAgICAgIGNhc2UgWm9uZVdpZHRoLkV4dGVuZGVkOlxuICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdaJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoKHpvbmUgPj0gMCkgPyAnKycgOiAnJykgKyBwYWROdW1iZXIoaG91cnMsIDIsIG1pbnVzU2lnbikgKyAnOicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFkTnVtYmVyKE1hdGguYWJzKHpvbmUgJSA2MCksIDIsIG1pbnVzU2lnbik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbmtub3duIHpvbmUgd2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AgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICBjYXNlICdMTCc6XG4gICAgICAgICAgICBmb3JtYXR0ZXIgPSBkYXRlR2V0dGVyKERhdGVUeXBlLk1vbnRoLCAyLCAxKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAvLyBNb250aCBvZiB0aGUgeWVhciAoSmFudWFyeSwgLi4uKSwgc3RyaW5nLCBmb3JtYXRcbiAgICAgICAgY2FzZSAnTU1NJzpcbiAgICAgICAgICAgIGZvcm1hdHRlciA9IGRhdGVTdHJHZXR0ZXIoVHJhbnNsYXRpb25UeXBlLk1vbnRocywgVHJhbnNsYXRpb25XaWR0aC5BYmJyZXZpYXRlZCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU1NTSc6XG4gICAgICAgICAgICBmb3JtYXR0ZXIgPSBkYXRlU3RyR2V0dGVyKFRyYW5zbGF0aW9uVHlwZS5Nb250aHMsIFRyYW5zbGF0aW9uV2lkdGguV2lkZSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU1NTU0nOlxuICAgICAgICAgICAgZm9ybWF0dGVyID0gZGF0ZVN0ckdldHRlcihUcmFuc2xhdGlvblR5cGUuTW9udGhzLCBUcmFuc2xhdGlvbldpZHRoLk5hcnJvdyk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gTW9udGggb2YgdGhlIHllYXIgKEphbnVhcnksIC4uLiksIHN0cmluZywgc3RhbmRhbG9uZVxuICAgICAgICBjYXNlICdMTEwnOlxuICAgICAgICAgICAgZm9ybWF0dGVyID1cbiAgICAgICAgICAgICAgICBkYXRlU3RyR2V0dGVyKFRyYW5zbGF0aW9uVHlwZS5Nb250aHMsIFRyYW5zbGF0aW9uV2lkdGguQWJicmV2aWF0ZWQsIEZvcm1TdHlsZS5TdGFuZGFsb25lKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICdMTExMJ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C0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXxcbiAqICB8IEVyYSAgICAgICAgICAgICAgICB8IEcsIEdHICYgR0dHIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEFEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgR0dHRyAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQW5ubyBEb21pbmkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBHR0dHRyAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFllYXIgICAgICAgICAgICAgICB8IHkgICAgICAgICAgIHwgTnVtZXJpYzogbWluaW11bSBkaWdpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDIsIDIwLCAyMDEsIDIwMTcsIDIwMTczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgeXkgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDIsIDIwLCAwMSwgMTcsIDczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCB5eXkgICAgICAgICB8IE51bWVyaWM6IDMgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMDIsIDAyMCwgMjAxLCAyMDE3LCAyMDE3MyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IHl5eXkgICAgICAgIHwgTnVtZXJpYzogNCBkaWdpdHMgb3IgbW9yZSArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICB8IDAwMDIsIDAwMjAsIDAyMDEsIDIwMTcsIDIwMTczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgTW9udGggICAgICAgICAgICAgIHwgTSAgICAgICAgICAgfCBOdW1lcmljOiAxIGRpZ2l0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgOSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBNTSAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwOSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IE1NTSAgICAgICAgIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFNlcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTU1NTSAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgU2VwdGVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBNTU1NTSAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IE1vbnRoIHN0YW5kYWxvbmUgICB8IEwgICAgICAgICAgIHwgTnVtZXJpYzogMSBkaWdpdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDksIDEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTEwgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDksIDEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBMTEwgICAgICAgICB8IEFiYnJldmlhdGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTZXAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IExMTEwgICAgICAgIHwgV2lkZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFNlcHRlbWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTExMTEwgICAgICAgfCBOYXJyb3cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBXZWVrIG9mIHllYXIgICAgICAgfCB3ICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxLi4uIDUzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IHd3ICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAxLi4uIDUzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgV2VlayBvZiBtb250aCAgICAgIHwgVyAgICAgICAgICAgfCBOdW1lcmljOiAxIGRpZ2l0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMS4uLiA1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBEYXkgb2YgbW9udGggICAgICAgfCBkICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGRkICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFdlZWsgZGF5ICAgICAgICAgICB8IEUsIEVFICYgRUVFIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFR1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgRUVFRSAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgVHVlc2RheSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBFRUVFRSAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IEVFRUVFRSAgICAgIHwgU2hvcnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFR1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kICAgICAgICAgICAgIHwgYSwgYWEgJiBhYWEgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgYW0vcG0gb3IgQU0vUE0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBhYWFhICAgICAgICB8IFdpZGUgKGZhbGxiYWNrIHRvIGBhYCB3aGVuIG1pc3NpbmcpICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbnRlIG1lcmlkaWVtL3Bvc3QgbWVyaWRpZW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGFhYWFhICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGEvcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kKiAgICAgICAgICAgIHwgQiwgQkIgJiBCQkIgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgbWlkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBCQkJCICAgICAgICB8IFdpZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbSwgcG0sIG1pZG5pZ2h0LCBub29uLCBtb3JuaW5nLCBhZnRlcm5vb24sIGV2ZW5pbmcsIG5pZ2h0IHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IEJCQkJCICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IG1kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kIHN0YW5kYWxvbmUqIHwgYiwgYmIgJiBiYmIgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgbWlkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBiYmJiICAgICAgICB8IFdpZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbSwgcG0sIG1pZG5pZ2h0LCBub29uLCBtb3JuaW5nLCBhZnRlcm5vb24sIGV2ZW5pbmcsIG5pZ2h0IHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGJiYmJiICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IG1kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgSG91ciAxLTEyICAgICAgICAgIHwgaCAgICAgICAgICAgfCBOdW1lcmljOiBtaW5pbXVtIGRpZ2l0cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBoaCAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IEhvdXIgMC0yMyAgICAgICAgICB8IEggICAgICAgICAgIHwgTnVtZXJpYzogbWluaW11bSBkaWdpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAsIDIzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgSEggICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDAsIDIzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBNaW51dGUgICAgICAgICAgICAgfCBtICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCA4LCA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IG1tICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDA4LCA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgU2Vjb25kICAgICAgICAgICAgIHwgcyAgICAgICAgICAgfCBOdW1lcmljOiBtaW5pbXVtIGRpZ2l0cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMC4uLiA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBzcyAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMC4uLiA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IEZyYWN0aW9uYWwgc2Vjb25kcyB8IFMgICAgICAgICAgIHwgTnVtZXJpYzogMSBkaWdpdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAuLi4gOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgU1MgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDAuLi4gOTkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBTU1MgICAgICAgICB8IE51bWVyaWM6IDMgZGlnaXRzICsgemVybyBwYWRkZWQgKD0gbWlsbGlzZWNvbmRzKSAgICAgICAgICAgICAgfCAwMDAuLi4gOTk5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFpvbmUgICAgICAgICAgICAgICB8IHosIHp6ICYgenp6IHwgU2hvcnQgc3BlY2lmaWMgbm9uIGxvY2F0aW9uIGZvcm1hdCAoZmFsbGJhY2sgdG8gTykgICAgICAgICAgICB8IEdNVC04ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgenp6eiAgICAgICAgfCBMb25nIHNwZWNpZmljIG5vbiBsb2NhdGlvbiBmb3JtYXQgKGZhbGxiYWNrIHRvIE9PT08pICAgICAgICAgIHwgR01ULTA4OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBaLCBaWiAmIFpaWiB8IElTTzg2MDEgYmFzaWMgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAtMDgwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IFpaWlogICAgICAgIHwgTG9uZyBsb2NhbGl6ZWQgR01UIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEdNVC04OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgWlpaWlogICAgICAgfCBJU084NjAxIGV4dGVuZGVkIGZvcm1hdCArIFogaW5kaWNhdG9yIGZvciBvZmZzZXQgMCAoPSBYWFhYWCkgIHwgLTA4OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBPLCBPTyAmIE9PTyB8IFNob3J0IGxvY2FsaXplZCBHTVQgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBHTVQtOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IE9PT08gICAgICAgIHwgTG9uZyBsb2NhbGl6ZWQgR01UIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEdNVC0wODowMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqXG4gKiBXaGVuIHRoZSBleHByZXNzaW9uIGlzIGEgSVNPIHN0cmluZyB3aXRob3V0IHRpbWUgKGUuZy4gMjAxNi0wOS0xOSkgdGhlIHRpbWUgem9uZSBvZmZzZXQgaXMgbm90XG4gKiBhcHBsaWVkIGFuZCB0aGUgZm9ybWF0dGVkIHRleHQgd2lsbCBoYXZlIHRoZSBzYW1lIGRheSwgbW9udGggYW5kIHllYXIgb2YgdGhlIGV4cHJlc3Npb24uXG4gKlxuICogV0FSTklOR1M6XG4gKiAtIHRoaXMgcGlwZSBoYXMgb25seSBhY2Nlc3MgdG8gZW4tVVMgbG9jYWxlIGRhdGEgYnkgZGVmYX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biAgICAgICAgbmFtZUNvbmRpdGlvbignbW9udGgnLCAzKSxcbiAgICAgICAgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignaG91cicsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignbWludXRlJywgMSksXG4gICAgICAgIGRpZ2l0Q29uZGl0aW9uKCdzZWNvbmQnLCAxKSxcbiAgICBdKSksXG4gICAgJ3lNZGptJzogZGF0ZVBhcnRHZXR0ZXJGYWN0b3J5KGNvbWJpbmUoW1xuICAgICAgICBkaWdpdENvbmRpdGlvbigneWVhcicsIDEpLCBkaWdpdENvbmRpdGlvbignbW9udGgnLCAxKSwgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignaG91cicsIDEpLCBkaWdpdENvbmRpdGlvbignbWludXRlJywgMSlcbiAgICBdKSksXG4gICAgJ3lNTU1NRUVFRWQnOiBkYXRlUGFydEdldHRlckZhY3RvcnkoY29tYmluZShbXG4gICAgICAgIGRpZ2l0Q29uZGl0aW9uKCd5ZWFyJywgMSksIG5hbWVDb25kaXRpb24oJ21vbnRoJywgNCksIG5hbWVDb25kaXRpb24oJ3dlZWtkYXknLCA0KSxcbiAgICAgICAgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpXG4gICAgXSkpLFxuICAgICd5TU1NTWQnOiBkYXRlUGFydEdldHRlckZhY3RvcnkoY29tYmluZShbZGlnaXRDb25kaXRpb24oJ3llYXInLCAxKSwgbmFtZUNvbmRpdGlvbignbW9udGgnLCA0KSwgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpXSkpLFxuICAgICd5TU1NZCc6IGRhdGVQYXJ0R2V0dGVyRmFjdG9yeShjb21iaW5lKFtkaWdpdENvbmRpdGlvbigneWVhcicsIDEpLCBuYW1lQ29uZGl0aW9uKCdtb250aCcsIDMpLCBkaWdpdENvbmRpdGlvbignZGF5JywgMSldKSksXG4gICAgJ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tLS0tLS18LS0tLS0tLS0tLS18XG4gKiAgfCBlcmEgICAgICAgfCAgIEcgICAgfCBHIChBKSAgfCBHR0cgKEFEKSAgICAgfCBHR0dHIChBbm5vIERvbWluaSl8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKiAgfCB5ZWFyICAgICAgfCAgIHkgICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IHkgKDIwMTUpICB8IHl5ICgxNSkgICB8XG4gKiAgfCBtb250aCAgICAgfCAgIE0gICAgfCBMIChTKSAgfCBNTU0gKFNlcCkgICAgfCBNTU1NIChTZXB0ZW1iZXIpICB8IE0gKDkpICAgICB8IE1NICgwOSkgICB8XG4gKiAgfCBkYXkgICAgICAgfCAgIGQgICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGQgKDMpICAgICB8IGRkICgwMykgICB8XG4gKiAgfCB3ZWVrZGF5ICAgfCAgIEUgICAgfCBFIChTKSAgfCBFRUUgKFN1bikgICAgfCBFRUVFIChTdW5kYXkpICAgICB8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKiAgfCBob3VyICAgICAgfCAgIGogICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGogKDEzKSAgICB8IGpqICgxMykgICB8XG4gKiAgfCBob3VyMTIgICAgfCAgIGggICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGggKDEgUE0pICB8IGhoICgwMSBQTSl8XG4gKiAgfCBob3VyMjQgICAgfCAgIEggICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IEggKDEzKSAgICB8IEhIICgxMykgICB8XG4gKiAgfCBtaW51dGUgICAgfCAgIG0gICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IG0gKDUpICAgICB8IG1tICgwNSkgICB8XG4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ICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBtaW5JbnQgPSBwYXR0ZXJuLm1pbkludDtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbWluRnJhY3Rpb24gPSBwYXR0ZXJuLm1pbkZyYWM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1heEZyYWN0aW9uID0gcGF0dGVybi5tYXhGcmFjO1xuICAgICAgICBpZiAoZGlnaXRzSW5mbykge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGFydHMgPSBkaWdpdHNJbmZvLm1hdGNoKE5VTUJFUl9GT1JNQVRfUkVHRVhQKTtcbiAgICAgICAgICAgIGlmIChwYXJ0cyA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJlcy5lcnJvciA9IGRpZ2l0c0luZm8gKyBcIiBpcyBub3QgYSB2YWxpZCBkaWdpdCBpbmZvXCI7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1pbkludFBhcnQgPSBwYXJ0c1sxXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1pbkZyYWN0aW9uUGFydCA9IHBhcnRzWzNdO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbWF4RnJhY3Rpb25QYXJ0ID0gcGFydHNbNV07XG4gICAgICAgICAgICBpZiAobWluSW50UGFydCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgbWluSW50ID0gcGFyc2VJbnRBdXRvUmFkaXgobWluSW50UGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWluRnJhY3Rpb25QYXJ0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBtaW5GcmFjdGlvbiA9IHBhcnNlSW50QXV0b1JhZGl4KG1pbkZyYWN0aW9uUGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF4RnJhY3Rpb25QYXJ0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBtYXhGcmFjdGlvbiA9IHBhcnNlSW50QXV0b1JhZGl4KG1heEZyYWN0aW9uUGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChtaW5GcmFjdGlvblBhcnQgIT0gbnVsbCAmJiBtaW5GcmFjdGlvbiA+IG1heEZyYWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgbWF4RnJhY3Rpb24gPSBtaW5GcmFjdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByb3VuZE51bWJlcihwYXJzZWROdW1iZXIsIG1pbkZyYWN0aW9uLCBtYXhGcmFjdGlvbik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRpZ2l0cyA9IHBhcnNlZE51bWJlci5kaWdpdHM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGludGVnZXJMZW4gPSBwYXJzZWROdW1iZXIuaW50ZWdlckxlbjtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZXhwb25lbnQgPSBwYXJzZWROdW1iZXIuZXhwb25lbnQ7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRlY2ltYWxzID0gW107XG4gICAgICAgIGlzWmVybyA9IGRpZ2l0cy5ldmVyeShmdW5jdGlvbiAoZCkgeyByZXR1cm4gIWQ7IH0pO1xuICAgICAgICAvLyBwYWQgemVyb3MgZm9yIHNtYWxsIG51bWJlcnNcbiAgICAgICAgZm9yICg7IGludGVnZXJMZW4gPCBtaW5JbnQ7IGludGVnZXJMZW4rKykge1xuICAgICAgICAgICAgZGlnaXRzLnVuc2hpZnQoMCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gcGFkIHplcm9zIGZvciBzbWFsbCBudW1iZXJzXG4gICAgICAgIGZvciAoOyBpbnRlZ2VyTGVuIDwgMDsgaW50ZWdl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neSA9IC8qKiBAdHlwZSB7P30gKi8gKChudWxsKSk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXN5bmNQaXBlLnByb3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5fc3Vic2NyaXB0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLl9kaXNwb3NlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gb2JqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBc3luY1BpcGUucHJvdG90eXBlLnRyYW5zZm9ybSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gb2JqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgIGlmICghdGhpcy5fb2JqKSB7XG4gICAgICAgICAgICBpZiAob2JqKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3Vic2NyaWJlKG9iaik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl9sYXRlc3RSZXR1cm5lZFZhbHVlID0gdGhpcy5fbGF0ZXN0VmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fbGF0ZXN0VmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9iaiAhPT0gdGhpcy5fb2JqKSB7XG4gICAgICAgICAgICB0aGlzLl9kaXNwb3NlKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy50cmFuc2Zvcm0oLyoqIEB0eXBlIHs/fSAqLyAob2JqKSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuX2xhdGVzdFZhbHVlID09PSB0aGlzLl9sYXRlc3RSZXR1cm5lZFZhbHVlKSB7XG4gICAgICAgICAgICBy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ZhbHVlXG4gICAgICogQHBhcmFtIHs/fSBtYXBwaW5nXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBJMThuU2VsZWN0UGlwZS5wcm90b3R5cGUudHJhbnNmb3JtID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEBwYXJhbSB7P30gbWFwcGluZ1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlLCBtYXBwaW5nKSB7XG4gICAgICAgIGlmICh2YWx1ZSA9PSBudWxsKVxuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICBpZiAodHlwZW9mIG1hcHBpbmcgIT09ICdvYmplY3QnIHx8IHR5cGVvZiB2YWx1ZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRocm93IGludmFsaWRQaXBlQXJndW1lbnRFcnJvcihJMThuU2VsZWN0UGlwZSwgbWFwcGluZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcHBpbmcuaGFzT3duUHJvcGVydHkodmFsdWUpKSB7XG4gICAgICAgICAgICByZXR1cm4gbWFwcGluZ1t2YWx1ZV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcHBpbmcuaGFzT3duUHJvcGVydHkoJ290aGVyJykpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXBwaW5nWydvdGhlciddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAnJztcbiAgICB9O1xuICAgIEkxOG5TZWxlY3RQaXBlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogUGlwZSwgYXJnczogW3sgbmFtZTogJ2kxOG5TZWxlY3QnLCBwdXJlOiB0cnVlIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgSTE4blNlbGVjdFBpcGUuY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXTsgfTtcbiA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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n"); /***/ }), /* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractControlDirective\", function() { return AbstractControlDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractFormGroupDirective\", function() { return AbstractFormGroupDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CheckboxControlValueAccessor\", function() { return CheckboxControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ControlContainer\", function() { return ControlContainer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_VALUE_ACCESSOR\", function() { return NG_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"COMPOSITION_BUFFER_MODE\", function() { return COMPOSITION_BUFFER_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultValueAccessor\", function() { return DefaultValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControl\", function() { return NgControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControlStatus\", function() { return NgControlStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControlStatusGroup\", function() { return NgControlStatusGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForm\", function() { return NgForm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgModel\", function() { return NgModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgModelGroup\", function() { return NgModelGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RadioControlValueAccessor\", function() { return RadioControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControlDirective\", function() { return FormControlDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControlName\", function() { return FormControlName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroupDirective\", function() { return FormGroupDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormArrayName\", function() { return FormArrayName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroupName\", function() { return FormGroupName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSelectOption\", function() { return NgSelectOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectControlValueAccessor\", function() { return SelectControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectMultipleControlValueAccessor\", function() { return SelectMultipleControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CheckboxRequiredValidator\", function() { return CheckboxRequiredValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EmailValidator\", function() { return EmailValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaxLengthValidator\", function() { return MaxLengthValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MinLengthValidator\", function() { return MinLengthValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PatternValidator\", function() { return PatternValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RequiredValidator\", function() { return RequiredValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormBuilder\", function() { return FormBuilder; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractControl\", function() { return AbstractControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormArray\", function() { return FormArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControl\", function() { return FormControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroup\", function() { return FormGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_ASYNC_VALIDATORS\", function() { return NG_ASYNC_VALIDATORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_VALIDATORS\", function() { return NG_VALIDATORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Validators\", function() { return Validators; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormsModule\", function() { return FormsModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReactiveFormsModule\", function() { return ReactiveFormsModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵba\", function() { return InternalFormsSharedModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵz\", function() { return REACTIVE_DRIVEN_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵx\", function() { return SHARED_FORM_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵy\", function() { return TEMPLATE_DRIVEN_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return CHECKBOX_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return DEFAULT_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return AbstractControlStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return ngControlStatusHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return formDirectiveProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return formControlBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return modelGroupProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbf\", function() { return NgNoValidate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbb\", function() { return NUMBER_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbc\", function() { return NumberValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return RADIO_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return RadioControlRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbd\", function() { return RANGE_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbe\", function() { return RangeValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵj\", function() { return formControlBinding$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵk\", function() { return controlNameBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵl\", function() { return formDirectiveProvider$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵn\", function() { return formArrayNameProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵm\", function() { return formGroupNameProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵo\", function() { return SELECT_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵq\", function() { return NgSelectMultipleOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵp\", function() { return SELECT_MULTIPLE_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵs\", function() { return CHECKBOX_REQUIRED_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵt\", function() { return EMAIL_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵv\", function() { return MAX_LENGTH_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵu\", function() { return MIN_LENGTH_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵw\", function() { return PATTERN_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵr\", function() { return REQUIRED_VALIDATOR; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__ = __webpack_require__(536);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__ = __webpack_require__(247);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__ = __webpack_require__(8);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Base class for control directives.\n *\n * Only used internally in the forms module.\n *\n * \\@stable\n * @abstract\n */\nvar AbstractControlDirective = /** @class */ (function () {\n function AbstractControlDirective() {\n }\n Object.defineProperty(AbstractControlDirective.prototype, \"value\", {\n /** The value of the control. */\n get: /**\n * The value of the control.\n * @return {?}\n */\n function () { return this.control ? this.control.value : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valid\", {\n /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n */\n get: /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n * @return {?}\n */\n function () { return this.control ? this.control.valid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"invalid\", {\n /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n */\n get: /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n * @return {?}\n */\n function () { return this.control ? this.control.invalid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pending\", {\n /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n */\n get: /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n * @return {?}\n */\n function () { return this.control ? this.control.pending : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"disabled\", {\n /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n */\n get: /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n * @return {?}\n */\n function () { return this.control ? this.control.disabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"enabled\", {\n /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n */\n get: /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n * @return {?}\n */\n function () { return this.control ? this.control.enabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"errors\", {\n /**\n * Returns any errors generated by failing validation. If there\n * are no errors, it will return null.\n */\n get: /**\n * Returns any errors generated by failing validation. If there\n * are no errors, it will return null.\n * @return {?}\n */\n function () { return this.control ? this.control.errors : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pristine\", {\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return this.control ? this.control.pristine : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"dirty\", {\n /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return this.control ? this.control.dirty : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"touched\", {\n /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return this.control ? this.control.touched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"status\", {\n get: /**\n * @return {?}\n */\n function () { return this.control ? this.control.status : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"untouched\", {\n /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return this.control ? this.control.untouched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"statusChanges\", {\n /**\n * Emits an event every time the validation status of the control\n * is re-calculated.\n */\n get: /**\n * Emits an event every time the validation status of the control\n * is re-calculated.\n * @return {?}\n */\n function () {\n return this.control ? this.control.statusChanges : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valueChanges\", {\n /**\n * Emits an event every time the value of the control changes, in\n * the UI or programmatically.\n */\n get: /**\n * Emits an event every time the value of the control changes, in\n * the UI or programmatically.\n * @return {?}\n */\n function () {\n return this.control ? this.control.valueChanges : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"path\", {\n /**\n * Returns an array that represents the path from the top-level form\n * to this control. Each index is the string name of the control on\n * that level.\n */\n get: /**\n * Returns an array that represents the path from the top-level form\n * to this control. Each index is the string name of the control on\n * that level.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {@link AbstractControl}.\n */\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {\\@link AbstractControl}.\n * @param {?=} value\n * @return {?}\n */\n AbstractControlDirective.prototype.reset = /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {\\@link AbstractControl}.\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n if (this.control)\n this.control.reset(value);\n };\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.hasError = /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n return this.control ? this.control.hasError(errorCode, path) : false;\n };\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.getError = /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n return this.control ? this.control.getError(errorCode, path) : null;\n };\n return AbstractControlDirective;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A directive that contains multiple {\\@link NgControl}s.\n *\n * Only used by the forms module.\n *\n * \\@stable\n * @abstract\n */\nvar ControlContainer = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(ControlContainer, _super);\n function ControlContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ControlContainer.prototype, \"formDirective\", {\n /**\n * Get the form to which this container belongs.\n */\n get: /**\n * Get the form to which this container belongs.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ControlContainer.prototype, \"path\", {\n /**\n * Get the path to this container.\n */\n get: /**\n * Get the path to this container.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n return ControlContainer;\n}(AbstractControlDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isEmptyInputValue(value) {\n // we don't check for string here so it also works with arrays\n return value == null || value.length === 0;\n}\n/**\n * Providers for validators to be used for {\\@link FormControl}s in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * ### Example\n *\n * ```typescript\n * \\@Directive({\n * selector: '[custom-validator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(control: AbstractControl): ValidationErrors | null {\n * return {\"custom\": true};\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar NG_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgValidators');\n/**\n * Providers for asynchronous validators to be used for {\\@link FormControl}s\n * in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * See {\\@link NG_VALIDATORS} for more details.\n *\n * \\@stable\n */\nvar NG_ASYNC_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgAsyncValidators');\nvar EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\n/**\n * Provides a set of validators used by form controls.\n *\n * A validator is a function that processes a {\\@link FormControl} or collection of\n * controls and returns a map of errors. A null map means that validation has passed.\n *\n * ### Example\n *\n * ```typescript\n * var loginControl = new FormControl(\"\", Validators.required)\n * ```\n *\n * \\@stable\n */\nvar Validators = /** @class */ (function () {\n function Validators() {\n }\n /**\n * Validator that requires controls to have a value greater than a number.\n *`min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n */\n /**\n * Validator that requires controls to have a value greater than a number.\n * `min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n * @param {?} min\n * @return {?}\n */\n Validators.min = /**\n * Validator that requires controls to have a value greater than a number.\n * `min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n * @param {?} min\n * @return {?}\n */\n function (min) {\n return function (control) {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n };\n /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n */\n /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n * @param {?} max\n * @return {?}\n */\n Validators.max = /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n * @param {?} max\n * @return {?}\n */\n function (max) {\n return function (control) {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n };\n /**\n * Validator that requires controls to have a non-empty value.\n */\n /**\n * Validator that requires controls to have a non-empty value.\n * @param {?} control\n * @return {?}\n */\n Validators.required = /**\n * Validator that requires controls to have a non-empty value.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n };\n /**\n * Validator that requires control value to be true.\n */\n /**\n * Validator that requires control value to be true.\n * @param {?} control\n * @return {?}\n */\n Validators.requiredTrue = /**\n * Validator that requires control value to be true.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return control.value === true ? null : { 'required': true };\n };\n /**\n * Validator that performs email validation.\n */\n /**\n * Validator that performs email validation.\n * @param {?} control\n * @return {?}\n */\n Validators.email = /**\n * Validator that performs email validation.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };\n };\n /**\n * Validator that requires controls to have a value of a minimum length.\n */\n /**\n * Validator that requires controls to have a value of a minimum length.\n * @param {?} minLength\n * @return {?}\n */\n Validators.minLength = /**\n * Validator that requires controls to have a value of a minimum length.\n * @param {?} minLength\n * @return {?}\n */\n function (minLength) {\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length < minLength ?\n { 'minlength': { 'requiredLength': minLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires controls to have a value of a maximum length.\n */\n /**\n * Validator that requires controls to have a value of a maximum length.\n * @param {?} maxLength\n * @return {?}\n */\n Validators.maxLength = /**\n * Validator that requires controls to have a value of a maximum length.\n * @param {?} maxLength\n * @return {?}\n */\n function (maxLength) {\n return function (control) {\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length > maxLength ?\n { 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires a control to match a regex to its value.\n */\n /**\n * Validator that requires a control to match a regex to its value.\n * @param {?} pattern\n * @return {?}\n */\n Validators.pattern = /**\n * Validator that requires a control to match a regex to its value.\n * @param {?} pattern\n * @return {?}\n */\n function (pattern) {\n if (!pattern)\n return Validators.nullValidator;\n var /** @type {?} */ regex;\n var /** @type {?} */ regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n };\n /**\n * No-op validator.\n */\n /**\n * No-op validator.\n * @param {?} c\n * @return {?}\n */\n Validators.nullValidator = /**\n * No-op validator.\n * @param {?} c\n * @return {?}\n */\n function (c) { return null; };\n /**\n * @param {?} validators\n * @return {?}\n */\n Validators.compose = /**\n * @param {?} validators\n * @return {?}\n */\n function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n return _mergeErrors(_executeValidators(control, presentValidators));\n };\n };\n /**\n * @param {?} validators\n * @return {?}\n */\n Validators.composeAsync = /**\n * @param {?} validators\n * @return {?}\n */\n function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n var /** @type {?} */ observables = _executeAsyncValidators(control, presentValidators).map(toObservable);\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__[\"forkJoin\"])(observables), _mergeErrors);\n };\n };\n return Validators;\n}());\n/**\n * @param {?} o\n * @return {?}\n */\nfunction isPresent(o) {\n return o != null;\n}\n/**\n * @param {?} r\n * @return {?}\n */\nfunction toObservable(r) {\n var /** @type {?} */ obs = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisPromise\"])(r) ? Object(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__[\"fromPromise\"])(r) : r;\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisObservable\"])(obs))) {\n throw new Error(\"Expected validator to return Promise or Observable.\");\n }\n return obs;\n}\n/**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\nfunction _executeValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n}\n/**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\nfunction _executeAsyncValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n}\n/**\n * @param {?} arrayOfErrors\n * @return {?}\n */\nfunction _mergeErrors(arrayOfErrors) {\n var /** @type {?} */ res = arrayOfErrors.reduce(function (res, errors) {\n return errors != null ? Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */])({}, /** @type {?} */ ((res)), errors) : /** @type {?} */ ((res));\n }, {});\n return Object.keys(res).length === 0 ? null : res;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A `ControlValueAccessor` acts as a bridge between the Angular forms API and a\n * native element in the DOM.\n *\n * Implement this interface if you want to create a custom form control directive\n * that integrates with Angular forms.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Used to provide a {\\@link ControlValueAccessor} for form controls.\n *\n * See {\\@link DefaultValueAccessor} for how to implement one.\n * \\@stable\n */\nvar NG_VALUE_ACCESSOR = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgValueAccessor');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return CheckboxControlValueAccessor; }),\n multi: true,\n};\n/**\n * The accessor for writing a value and listening to changes on a checkbox input element.\n *\n * ### Example\n * ```\n * <input type=\"checkbox\" name=\"rememberLogin\" ngModel>\n * ```\n *\n * \\@stable\n */\nvar CheckboxControlValueAccessor = /** @class */ (function () {\n function CheckboxControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n CheckboxControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',\n host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },\n providers: [CHECKBOX_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n CheckboxControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return CheckboxControlValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar DEFAULT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return DefaultValueAccessor; }),\n multi: true\n};\n/**\n * We must check whether the agent is Android because composition events\n * behave differently between iOS and Android.\n * @return {?}\n */\nfunction _isAndroid() {\n var /** @type {?} */ userAgent = Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__[\"ɵgetDOM\"])() ? Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__[\"ɵgetDOM\"])().getUserAgent() : '';\n return /android (\\d+)/.test(userAgent.toLowerCase());\n}\n/**\n * Turn this mode on if you want form directives to buffer IME input until compositionend\n * \\@experimental\n */\nvar COMPOSITION_BUFFER_MODE = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('CompositionEventMode');\n/**\n * The default accessor for writing a value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"text\" name=\"searchQuery\" ngModel>\n * ```\n *\n * \\@stable\n */\nvar DefaultValueAccessor = /** @class */ (function () {\n function DefaultValueAccessor(_renderer, _elementRef, _compositionMode) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this._compositionMode = _compositionMode;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n /**\n * Whether the user is creating a composition string (IME events).\n */\n this._composing = false;\n if (this._compositionMode == null) {\n this._compositionMode = !_isAndroid();\n }\n }\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n DefaultValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype._handleInput = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!this._compositionMode || (this._compositionMode && !this._composing)) {\n this.onChange(value);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n DefaultValueAccessor.prototype._compositionStart = /**\n * \\@internal\n * @return {?}\n */\n function () { this._composing = true; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype._compositionEnd = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._composing = false;\n this._compositionMode && this.onChange(value);\n };\n DefaultValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',\n // TODO: vsavkin replace the above selector with the one below it once\n // https://github.com/angular/angular/issues/3011 is implemented\n // selector: '[ngModel],[formControl],[formControlName]',\n host: {\n '(input)': '$any(this)._handleInput($event.target.value)',\n '(blur)': 'onTouched()',\n '(compositionstart)': '$any(this)._compositionStart()',\n '(compositionend)': '$any(this)._compositionEnd($event.target.value)'\n },\n providers: [DEFAULT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n DefaultValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [COMPOSITION_BUFFER_MODE,] },] },\n ]; };\n return DefaultValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} validator\n * @return {?}\n */\nfunction normalizeValidator(validator) {\n if ((/** @type {?} */ (validator)).validate) {\n return function (c) { return (/** @type {?} */ (validator)).validate(c); };\n }\n else {\n return /** @type {?} */ (validator);\n }\n}\n/**\n * @param {?} validator\n * @return {?}\n */\nfunction normalizeAsyncValidator(validator) {\n if ((/** @type {?} */ (validator)).validate) {\n return function (c) { return (/** @type {?} */ (validator)).validate(c); };\n }\n else {\n return /** @type {?} */ (validator);\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NUMBER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NumberValueAccessor; }),\n multi: true\n};\n/**\n * The accessor for writing a number value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"number\" [(ngModel)]=\"age\">\n * ```\n */\nvar NumberValueAccessor = /** @class */ (function () {\n function NumberValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n NumberValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n // The value needs to be normalized for IE9, otherwise it is set to 'null' when null\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n NumberValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n NumberValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [NUMBER_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NumberValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return NumberValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction unimplemented() {\n throw new Error('unimplemented');\n}\n/**\n * A base class that all control directive extend.\n * It binds a {\\@link FormControl} object to a DOM element.\n *\n * Used internally by Angular forms.\n *\n * \\@stable\n * @abstract\n */\nvar NgControl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControl, _super);\n function NgControl() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * \\@internal\n */\n _this._parent = null;\n _this.name = null;\n _this.valueAccessor = null;\n /**\n * \\@internal\n */\n _this._rawValidators = [];\n /**\n * \\@internal\n */\n _this._rawAsyncValidators = [];\n return _this;\n }\n Object.defineProperty(NgControl.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgControl.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n return NgControl;\n}(AbstractControlDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar RADIO_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RadioControlValueAccessor; }),\n multi: true\n};\n/**\n * Internal class used by Angular to uncheck radio buttons with the matching name.\n */\nvar RadioControlRegistry = /** @class */ (function () {\n function RadioControlRegistry() {\n this._accessors = [];\n }\n /**\n * @param {?} control\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.add = /**\n * @param {?} control\n * @param {?} accessor\n * @return {?}\n */\n function (control, accessor) {\n this._accessors.push([control, accessor]);\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.remove = /**\n * @param {?} accessor\n * @return {?}\n */\n function (accessor) {\n for (var /** @type {?} */ i = this._accessors.length - 1; i >= 0; --i) {\n if (this._accessors[i][1] === accessor) {\n this._accessors.splice(i, 1);\n return;\n }\n }\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.select = /**\n * @param {?} accessor\n * @return {?}\n */\n function (accessor) {\n var _this = this;\n this._accessors.forEach(function (c) {\n if (_this._isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].fireUncheck(accessor.value);\n }\n });\n };\n /**\n * @param {?} controlPair\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype._isSameGroup = /**\n * @param {?} controlPair\n * @param {?} accessor\n * @return {?}\n */\n function (controlPair, accessor) {\n if (!controlPair[0].control)\n return false;\n return controlPair[0]._parent === accessor._control._parent &&\n controlPair[1].name === accessor.name;\n };\n RadioControlRegistry.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RadioControlRegistry.ctorParameters = function () { return []; };\n return RadioControlRegistry;\n}());\n/**\n * \\@whatItDoes Writes radio control values and listens to radio control changes.\n *\n * Used by {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName}\n * to keep the view synced with the {\\@link FormControl} model.\n *\n * \\@howToUse\n *\n * If you have imported the {\\@link FormsModule} or the {\\@link ReactiveFormsModule}, this\n * value accessor will be active on any radio control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n *\n * ### How to use radio buttons with form directives\n *\n * To use radio buttons in a template-driven form, you'll want to ensure that radio buttons\n * in the same group have the same `name` attribute. Radio buttons with different `name`\n * attributes do not affect each other.\n *\n * {\\@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'}\n *\n * When using radio buttons in a reactive form, radio buttons in the same group should have the\n * same `formControlName`. You can also add a `name` attribute, but it's optional.\n *\n * {\\@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar RadioControlValueAccessor = /** @class */ (function () {\n function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this._registry = _registry;\n this._injector = _injector;\n this.onChange = function () { };\n this.onTouched = function () { };\n }\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._control = this._injector.get(NgControl);\n this._checkName();\n this._registry.add(this._control, this);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this._registry.remove(this); };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._state = value === this.value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this._fn = fn;\n this.onChange = function () {\n fn(_this.value);\n _this._registry.select(_this);\n };\n };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.fireUncheck = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this.writeValue(value); };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RadioControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._checkName = /**\n * @return {?}\n */\n function () {\n if (this.name && this.formControlName && this.name !== this.formControlName) {\n this._throwNameError();\n }\n if (!this.name && this.formControlName)\n this.name = this.formControlName;\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._throwNameError = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n If you define both a name and a formControlName attribute on your radio button, their values\\n must match. Ex: <input type=\\\"radio\\\" formControlName=\\\"food\\\" name=\\\"food\\\">\\n \");\n };\n RadioControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',\n host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },\n providers: [RADIO_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RadioControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: RadioControlRegistry, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n ]; };\n RadioControlValueAccessor.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"formControlName\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RadioControlValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar RANGE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RangeValueAccessor; }),\n multi: true\n};\n/**\n * The accessor for writing a range value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"range\" [(ngModel)]=\"age\" >\n * ```\n */\nvar RangeValueAccessor = /** @class */ (function () {\n function RangeValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n RangeValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RangeValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n RangeValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [RANGE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RangeValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return RangeValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SELECT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return SelectControlValueAccessor; }),\n multi: true\n};\n/**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\nfunction _buildValueString(id, value) {\n if (id == null)\n return \"\" + value;\n if (value && typeof value === 'object')\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n}\n/**\n * @param {?} valueString\n * @return {?}\n */\nfunction _extractId(valueString) {\n return valueString.split(':')[0];\n}\n/**\n * \\@whatItDoes Writes values and listens to changes on a select element.\n *\n * Used by {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName}\n * to keep the view synced with the {\\@link FormControl} model.\n *\n * \\@howToUse\n *\n * If you have imported the {\\@link FormsModule} or the {\\@link ReactiveFormsModule}, this\n * value accessor will be active on any select control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n *\n * ### How to use select controls with form directives\n *\n * To use a select in a template-driven form, simply add an `ngModel` and a `name`\n * attribute to the main `<select>` tag.\n *\n * If your option values are simple strings, you can bind to the normal `value` property\n * on the option. If your option values happen to be objects (and you'd like to save the\n * selection in your form as an object), use `ngValue` instead:\n *\n * {\\@example forms/ts/selectControl/select_control_example.ts region='Component'}\n *\n * In reactive forms, you'll also want to add your form directive (`formControlName` or\n * `formControl`) on the main `<select>` tag. Like in the former example, you have the\n * choice of binding to the `value` or `ngValue` property on the select's options.\n *\n * {\\@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'}\n *\n * ### Caveat: Option selection\n *\n * Angular uses object identity to select option. It's possible for the identities of items\n * to change while the data does not. This can happen, for example, if the items are produced\n * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the\n * second response will produce objects with different identities.\n *\n * To customize the default option comparison algorithm, `<select>` supports `compareWith` input.\n * `compareWith` takes a **function** which has two arguments: `option1` and `option2`.\n * If `compareWith` is given, Angular selects option by the return value of the function.\n *\n * #### Syntax\n *\n * ```\n * <select [compareWith]=\"compareFn\" [(ngModel)]=\"selectedCountries\">\n * <option *ngFor=\"let country of countries\" [ngValue]=\"country\">\n * {{country.name}}\n * </option>\n * </select>\n *\n * compareFn(c1: Country, c2: Country): boolean {\n * return c1 && c2 ? c1.id === c2.id : c1 === c2;\n * }\n * ```\n *\n * Note: We listen to the 'change' event because 'input' events aren't fired\n * for selects in Firefox and IE:\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350\n * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar SelectControlValueAccessor = /** @class */ (function () {\n function SelectControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * \\@internal\n */\n this._optionMap = new Map();\n /**\n * \\@internal\n */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"];\n }\n Object.defineProperty(SelectControlValueAccessor.prototype, \"compareWith\", {\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"compareWith must be a function, but received \" + JSON.stringify(fn));\n }\n this._compareWith = fn;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this.value = value;\n var /** @type {?} */ id = this._getOptionId(value);\n if (id == null) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1);\n }\n var /** @type {?} */ valueString = _buildValueString(id, value);\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.onChange = function (valueString) {\n _this.value = _this._getOptionValue(valueString);\n fn(_this.value);\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n SelectControlValueAccessor.prototype._registerOption = /**\n * \\@internal\n * @return {?}\n */\n function () { return (this._idCounter++).toString(); };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionId = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (this._compareWith(this._optionMap.get(id), value))\n return id;\n }\n return null;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionValue = /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n function (valueString) {\n var /** @type {?} */ id = _extractId(valueString);\n return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;\n };\n SelectControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',\n host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [SELECT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n SelectControlValueAccessor.propDecorators = {\n \"compareWith\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return SelectControlValueAccessor;\n}());\n/**\n * \\@whatItDoes Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * \\@howToUse\n *\n * See docs for {\\@link SelectControlValueAccessor} for usage examples.\n *\n * \\@stable\n */\nvar NgSelectOption = /** @class */ (function () {\n function NgSelectOption(_element, _renderer, _select) {\n this._element = _element;\n this._renderer = _renderer;\n this._select = _select;\n if (this._select)\n this.id = this._select._registerOption();\n }\n Object.defineProperty(NgSelectOption.prototype, \"ngValue\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select == null)\n return;\n this._select._optionMap.set(this.id, value);\n this._setElementValue(_buildValueString(this.id, value));\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgSelectOption.prototype, \"value\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._setElementValue(value);\n if (this._select)\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSelectOption.prototype._setElementValue = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._element.nativeElement, 'value', value);\n };\n /**\n * @return {?}\n */\n NgSelectOption.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n };\n NgSelectOption.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'option' },] },\n ];\n /** @nocollapse */\n NgSelectOption.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: SelectControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n ]; };\n NgSelectOption.propDecorators = {\n \"ngValue\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngValue',] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['value',] },],\n };\n return NgSelectOption;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SELECT_MULTIPLE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return SelectMultipleControlValueAccessor; }),\n multi: true\n};\n/**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\nfunction _buildValueString$1(id, value) {\n if (id == null)\n return \"\" + value;\n if (typeof value === 'string')\n value = \"'\" + value + \"'\";\n if (value && typeof value === 'object')\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n}\n/**\n * @param {?} valueString\n * @return {?}\n */\nfunction _extractId$1(valueString) {\n return valueString.split(':')[0];\n}\n/**\n * The accessor for writing a value and listening to changes on a select element.\n *\n * ### Caveat: Options selection\n *\n * Angular uses object identity to select options. It's possible for the identities of items\n * to change while the data does not. This can happen, for example, if the items are produced\n * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the\n * second response will produce objects with different identities.\n *\n * To customize the default option comparison algorithm, `<select multiple>` supports `compareWith`\n * input. `compareWith` takes a **function** which has two arguments: `option1` and `option2`.\n * If `compareWith` is given, Angular selects options by the return value of the function.\n *\n * #### Syntax\n *\n * ```\n * <select multiple [compareWith]=\"compareFn\" [(ngModel)]=\"selectedCountries\">\n * <option *ngFor=\"let country of countries\" [ngValue]=\"country\">\n * {{country.name}}\n * </option>\n * </select>\n *\n * compareFn(c1: Country, c2: Country): boolean {\n * return c1 && c2 ? c1.id === c2.id : c1 === c2;\n * }\n * ```\n *\n * \\@stable\n */\nvar SelectMultipleControlValueAccessor = /** @class */ (function () {\n function SelectMultipleControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * \\@internal\n */\n this._optionMap = new Map();\n /**\n * \\@internal\n */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"];\n }\n Object.defineProperty(SelectMultipleControlValueAccessor.prototype, \"compareWith\", {\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"compareWith must be a function, but received \" + JSON.stringify(fn));\n }\n this._compareWith = fn;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var _this = this;\n this.value = value;\n var /** @type {?} */ optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n var /** @type {?} */ ids_1 = value.map(function (v) { return _this._getOptionId(v); });\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); };\n }\n else {\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.onChange = function (_) {\n var /** @type {?} */ selected = [];\n if (_.hasOwnProperty('selectedOptions')) {\n var /** @type {?} */ options = _.selectedOptions;\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n else {\n var /** @type {?} */ options = /** @type {?} */ (_.options);\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n if (opt.selected) {\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n _this.value = selected;\n fn(selected);\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._registerOption = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ id = (this._idCounter++).toString();\n this._optionMap.set(id, value);\n return id;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionId = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (this._compareWith(/** @type {?} */ ((this._optionMap.get(id)))._value, value))\n return id;\n }\n return null;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionValue = /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n function (valueString) {\n var /** @type {?} */ id = _extractId$1(valueString);\n return this._optionMap.has(id) ? /** @type {?} */ ((this._optionMap.get(id)))._value : valueString;\n };\n SelectMultipleControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',\n host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },\n providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectMultipleControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n SelectMultipleControlValueAccessor.propDecorators = {\n \"compareWith\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return SelectMultipleControlValueAccessor;\n}());\n/**\n * Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * ### Example\n *\n * ```\n * <select multiple name=\"city\" ngModel>\n * <option *ngFor=\"let c of cities\" [value]=\"c\"></option>\n * </select>\n * ```\n */\nvar NgSelectMultipleOption = /** @class */ (function () {\n function NgSelectMultipleOption(_element, _renderer, _select) {\n this._element = _element;\n this._renderer = _renderer;\n this._select = _select;\n if (this._select) {\n this.id = this._select._registerOption(this);\n }\n }\n Object.defineProperty(NgSelectMultipleOption.prototype, \"ngValue\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select == null)\n return;\n this._value = value;\n this._setElementValue(_buildValueString$1(this.id, value));\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgSelectMultipleOption.prototype, \"value\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select) {\n this._value = value;\n this._setElementValue(_buildValueString$1(this.id, value));\n this._select.writeValue(this._select.value);\n }\n else {\n this._setElementValue(value);\n }\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSelectMultipleOption.prototype._setElementValue = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._element.nativeElement, 'value', value);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} selected\n * @return {?}\n */\n NgSelectMultipleOption.prototype._setSelected = /**\n * \\@internal\n * @param {?} selected\n * @return {?}\n */\n function (selected) {\n this._renderer.setProperty(this._element.nativeElement, 'selected', selected);\n };\n /**\n * @return {?}\n */\n NgSelectMultipleOption.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n };\n NgSelectMultipleOption.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'option' },] },\n ];\n /** @nocollapse */\n NgSelectMultipleOption.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: SelectMultipleControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n ]; };\n NgSelectMultipleOption.propDecorators = {\n \"ngValue\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngValue',] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['value',] },],\n };\n return NgSelectMultipleOption;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} name\n * @param {?} parent\n * @return {?}\n */\nfunction controlPath(name, parent) {\n return /** @type {?} */ ((parent.path)).concat([name]);\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpControl(control, dir) {\n if (!control)\n _throwError(dir, 'Cannot find control with');\n if (!dir.valueAccessor)\n _throwError(dir, 'No value accessor for form control with');\n control.validator = Validators.compose([/** @type {?} */ ((control.validator)), dir.validator]);\n control.asyncValidator = Validators.composeAsync([/** @type {?} */ ((control.asyncValidator)), dir.asyncValidator]); /** @type {?} */\n ((dir.valueAccessor)).writeValue(control.value);\n setUpViewChangePipeline(control, dir);\n setUpModelChangePipeline(control, dir);\n setUpBlurPipeline(control, dir);\n if (/** @type {?} */ ((dir.valueAccessor)).setDisabledState) {\n control.registerOnDisabledChange(function (isDisabled) { /** @type {?} */ ((/** @type {?} */ ((dir.valueAccessor)).setDisabledState))(isDisabled); });\n }\n // re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4\n dir._rawValidators.forEach(function (validator) {\n if ((/** @type {?} */ (validator)).registerOnValidatorChange)\n /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });\n });\n dir._rawAsyncValidators.forEach(function (validator) {\n if ((/** @type {?} */ (validator)).registerOnValidatorChange)\n /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction cleanUpControl(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function () { return _noControlError(dir); }); /** @type {?} */\n ((dir.valueAccessor)).registerOnTouched(function () { return _noControlError(dir); });\n dir._rawValidators.forEach(function (validator) {\n if (validator.registerOnValidatorChange) {\n validator.registerOnValidatorChange(null);\n }\n });\n dir._rawAsyncValidators.forEach(function (validator) {\n if (validator.registerOnValidatorChange) {\n validator.registerOnValidatorChange(null);\n }\n });\n if (control)\n control._clearChangeFns();\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpViewChangePipeline(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function (newValue) {\n control._pendingValue = newValue;\n control._pendingChange = true;\n control._pendingDirty = true;\n if (control.updateOn === 'change')\n updateControl(control, dir);\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpBlurPipeline(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnTouched(function () {\n control._pendingTouched = true;\n if (control.updateOn === 'blur' && control._pendingChange)\n updateControl(control, dir);\n if (control.updateOn !== 'submit')\n control.markAsTouched();\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction updateControl(control, dir) {\n dir.viewToModelUpdate(control._pendingValue);\n if (control._pendingDirty)\n control.markAsDirty();\n control.setValue(control._pendingValue, { emitModelToViewChange: false });\n control._pendingChange = false;\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpModelChangePipeline(control, dir) {\n control.registerOnChange(function (newValue, emitModelEvent) {\n /** @type {?} */ ((\n // control -> view\n dir.valueAccessor)).writeValue(newValue);\n // control -> ngModel\n if (emitModelEvent)\n dir.viewToModelUpdate(newValue);\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpFormContainer(control, dir) {\n if (control == null)\n _throwError(dir, 'Cannot find control with');\n control.validator = Validators.compose([control.validator, dir.validator]);\n control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]);\n}\n/**\n * @param {?} dir\n * @return {?}\n */\nfunction _noControlError(dir) {\n return _throwError(dir, 'There is no FormControl instance attached to form control element with');\n}\n/**\n * @param {?} dir\n * @param {?} message\n * @return {?}\n */\nfunction _throwError(dir, message) {\n var /** @type {?} */ messageEnd;\n if (/** @type {?} */ ((dir.path)).length > 1) {\n messageEnd = \"path: '\" + (/** @type {?} */ ((dir.path))).join(' -> ') + \"'\";\n }\n else if (/** @type {?} */ ((dir.path))[0]) {\n messageEnd = \"name: '\" + dir.path + \"'\";\n }\n else {\n messageEnd = 'unspecified name attribute';\n }\n throw new Error(message + \" \" + messageEnd);\n}\n/**\n * @param {?} validators\n * @return {?}\n */\nfunction composeValidators(validators) {\n return validators != null ? Validators.compose(validators.map(normalizeValidator)) : null;\n}\n/**\n * @param {?} validators\n * @return {?}\n */\nfunction composeAsyncValidators(validators) {\n return validators != null ? Validators.composeAsync(validators.map(normalizeAsyncValidator)) :\n null;\n}\n/**\n * @param {?} changes\n * @param {?} viewModel\n * @return {?}\n */\nfunction isPropertyUpdated(changes, viewModel) {\n if (!changes.hasOwnProperty('model'))\n return false;\n var /** @type {?} */ change = changes['model'];\n if (change.isFirstChange())\n return true;\n return !Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"])(viewModel, change.currentValue);\n}\nvar BUILTIN_ACCESSORS = [\n CheckboxControlValueAccessor,\n RangeValueAccessor,\n NumberValueAccessor,\n SelectControlValueAccessor,\n SelectMultipleControlValueAccessor,\n RadioControlValueAccessor,\n];\n/**\n * @param {?} valueAccessor\n * @return {?}\n */\nfunction isBuiltInAccessor(valueAccessor) {\n return BUILTIN_ACCESSORS.some(function (a) { return valueAccessor.constructor === a; });\n}\n/**\n * @param {?} form\n * @param {?} directives\n * @return {?}\n */\nfunction syncPendingControls(form, directives) {\n form._syncPendingControls();\n directives.forEach(function (dir) {\n var /** @type {?} */ control = /** @type {?} */ (dir.control);\n if (control.updateOn === 'submit' && control._pendingChange) {\n dir.viewToModelUpdate(control._pendingValue);\n control._pendingChange = false;\n }\n });\n}\n/**\n * @param {?} dir\n * @param {?} valueAccessors\n * @return {?}\n */\nfunction selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n var /** @type {?} */ defaultAccessor = undefined;\n var /** @type {?} */ builtinAccessor = undefined;\n var /** @type {?} */ customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}\n/**\n * @template T\n * @param {?} list\n * @param {?} el\n * @return {?}\n */\nfunction removeDir(list, el) {\n var /** @type {?} */ index = list.indexOf(el);\n if (index > -1)\n list.splice(index, 1);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This is a base class for code shared between {\\@link NgModelGroup} and {\\@link FormGroupName}.\n *\n * \\@stable\n */\nvar AbstractFormGroupDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(AbstractFormGroupDirective, _super);\n function AbstractFormGroupDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n AbstractFormGroupDirective.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._checkParentType(); /** @type {?} */\n ((this.formDirective)).addFormGroup(this);\n };\n /**\n * @return {?}\n */\n AbstractFormGroupDirective.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeFormGroup(this);\n }\n };\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"control\", {\n /**\n * Get the {@link FormGroup} backing this binding.\n */\n get: /**\n * Get the {\\@link FormGroup} backing this binding.\n * @return {?}\n */\n function () { return /** @type {?} */ ((this.formDirective)).getFormGroup(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"path\", {\n /**\n * Get the path to this control group.\n */\n get: /**\n * Get the path to this control group.\n * @return {?}\n */\n function () { return controlPath(this.name, this._parent); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"formDirective\", {\n /**\n * Get the {@link Form} to which this group belongs.\n */\n get: /**\n * Get the {\\@link Form} to which this group belongs.\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._validators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._asyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractFormGroupDirective.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () { };\n return AbstractFormGroupDirective;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar AbstractControlStatus = /** @class */ (function () {\n function AbstractControlStatus(cd) {\n this._cd = cd;\n }\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassUntouched\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.untouched : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassTouched\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.touched : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassPristine\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.pristine : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassDirty\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.dirty : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassValid\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.valid : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassInvalid\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.invalid : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassPending\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.pending : false; },\n enumerable: true,\n configurable: true\n });\n return AbstractControlStatus;\n}());\nvar ngControlStatusHost = {\n '[class.ng-untouched]': 'ngClassUntouched',\n '[class.ng-touched]': 'ngClassTouched',\n '[class.ng-pristine]': 'ngClassPristine',\n '[class.ng-dirty]': 'ngClassDirty',\n '[class.ng-valid]': 'ngClassValid',\n '[class.ng-invalid]': 'ngClassInvalid',\n '[class.ng-pending]': 'ngClassPending',\n};\n/**\n * Directive automatically applied to Angular form controls that sets CSS classes\n * based on control status. The following classes are applied as the properties\n * become true:\n *\n * * ng-valid\n * * ng-invalid\n * * ng-pending\n * * ng-pristine\n * * ng-dirty\n * * ng-untouched\n * * ng-touched\n *\n * \\@stable\n */\nvar NgControlStatus = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControlStatus, _super);\n function NgControlStatus(cd) {\n return _super.call(this, cd) || this;\n }\n NgControlStatus.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost },] },\n ];\n /** @nocollapse */\n NgControlStatus.ctorParameters = function () { return [\n { type: NgControl, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] },] },\n ]; };\n return NgControlStatus;\n}(AbstractControlStatus));\n/**\n * Directive automatically applied to Angular form groups that sets CSS classes\n * based on control status (valid/invalid/dirty/etc).\n *\n * \\@stable\n */\nvar NgControlStatusGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControlStatusGroup, _super);\n function NgControlStatusGroup(cd) {\n return _super.call(this, cd) || this;\n }\n NgControlStatusGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',\n host: ngControlStatusHost\n },] },\n ];\n /** @nocollapse */\n NgControlStatusGroup.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] },] },\n ]; };\n return NgControlStatusGroup;\n}(AbstractControlStatus));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Indicates that a FormControl is valid, i.e. that no errors exist in the input value.\n */\nvar VALID = 'VALID';\n/**\n * Indicates that a FormControl is invalid, i.e. that an error exists in the input value.\n */\nvar INVALID = 'INVALID';\n/**\n * Indicates that a FormControl is pending, i.e. that async validation is occurring and\n * errors are not yet available for the input value.\n */\nvar PENDING = 'PENDING';\n/**\n * Indicates that a FormControl is disabled, i.e. that the control is exempt from ancestor\n * calculations of validity or value.\n */\nvar DISABLED = 'DISABLED';\n/**\n * @param {?} control\n * @param {?} path\n * @param {?} delimiter\n * @return {?}\n */\nfunction _find(control, path, delimiter) {\n if (path == null)\n return null;\n if (!(path instanceof Array)) {\n path = (/** @type {?} */ (path)).split(delimiter);\n }\n if (path instanceof Array && (path.length === 0))\n return null;\n return (/** @type {?} */ (path)).reduce(function (v, name) {\n if (v instanceof FormGroup) {\n return v.controls[name] || null;\n }\n if (v instanceof FormArray) {\n return v.at(/** @type {?} */ (name)) || null;\n }\n return null;\n }, control);\n}\n/**\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction coerceToValidator(validatorOrOpts) {\n var /** @type {?} */ validator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).validators :\n validatorOrOpts));\n return Array.isArray(validator) ? composeValidators(validator) : validator || null;\n}\n/**\n * @param {?=} asyncValidator\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction coerceToAsyncValidator(asyncValidator, validatorOrOpts) {\n var /** @type {?} */ origAsyncValidator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).asyncValidators :\n asyncValidator));\n return Array.isArray(origAsyncValidator) ? composeAsyncValidators(origAsyncValidator) :\n origAsyncValidator || null;\n}\n/**\n * @record\n */\n\n/**\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction isOptionsObj(validatorOrOpts) {\n return validatorOrOpts != null && !Array.isArray(validatorOrOpts) &&\n typeof validatorOrOpts === 'object';\n}\n/**\n * \\@whatItDoes This is the base class for {\\@link FormControl}, {\\@link FormGroup}, and\n * {\\@link FormArray}.\n *\n * It provides some of the shared behavior that all controls and groups of controls have, like\n * running validators, calculating status, and resetting state. It also defines the properties\n * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be\n * instantiated directly.\n *\n * \\@stable\n * @abstract\n */\nvar AbstractControl = /** @class */ (function () {\n function AbstractControl(validator, asyncValidator) {\n this.validator = validator;\n this.asyncValidator = asyncValidator;\n /**\n * \\@internal\n */\n this._onCollectionChange = function () { };\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n this.pristine = true;\n /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /**\n * \\@internal\n */\n this._onDisabledChange = [];\n }\n Object.defineProperty(AbstractControl.prototype, \"parent\", {\n /**\n * The parent control.\n */\n get: /**\n * The parent control.\n * @return {?}\n */\n function () { return this._parent; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"valid\", {\n /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n */\n get: /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n * @return {?}\n */\n function () { return this.status === VALID; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"invalid\", {\n /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n */\n get: /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n * @return {?}\n */\n function () { return this.status === INVALID; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"pending\", {\n /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n */\n get: /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n * @return {?}\n */\n function () { return this.status == PENDING; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"disabled\", {\n /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n */\n get: /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n * @return {?}\n */\n function () { return this.status === DISABLED; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"enabled\", {\n /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n */\n get: /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n * @return {?}\n */\n function () { return this.status !== DISABLED; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"dirty\", {\n /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return !this.pristine; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"untouched\", {\n /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return !this.touched; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"updateOn\", {\n /**\n * Returns the update strategy of the `AbstractControl` (i.e.\n * the event on which the control will update itself).\n * Possible values: `'change'` (default) | `'blur'` | `'submit'`\n */\n get: /**\n * Returns the update strategy of the `AbstractControl` (i.e.\n * the event on which the control will update itself).\n * Possible values: `'change'` (default) | `'blur'` | `'submit'`\n * @return {?}\n */\n function () {\n return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change');\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n */\n /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n * @param {?} newValidator\n * @return {?}\n */\n AbstractControl.prototype.setValidators = /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n * @param {?} newValidator\n * @return {?}\n */\n function (newValidator) {\n this.validator = coerceToValidator(newValidator);\n };\n /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n */\n /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n * @param {?} newValidator\n * @return {?}\n */\n AbstractControl.prototype.setAsyncValidators = /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n * @param {?} newValidator\n * @return {?}\n */\n function (newValidator) {\n this.asyncValidator = coerceToAsyncValidator(newValidator);\n };\n /**\n * Empties out the sync validator list.\n */\n /**\n * Empties out the sync validator list.\n * @return {?}\n */\n AbstractControl.prototype.clearValidators = /**\n * Empties out the sync validator list.\n * @return {?}\n */\n function () { this.validator = null; };\n /**\n * Empties out the async validator list.\n */\n /**\n * Empties out the async validator list.\n * @return {?}\n */\n AbstractControl.prototype.clearAsyncValidators = /**\n * Empties out the async validator list.\n * @return {?}\n */\n function () { this.asyncValidator = null; };\n /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n */\n /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsTouched = /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = true;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsTouched(opts);\n }\n };\n /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n */\n /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsUntouched = /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = false;\n this._pendingTouched = false;\n this._forEachChild(function (control) { control.markAsUntouched({ onlySelf: true }); });\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n };\n /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n */\n /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsDirty = /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = false;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsDirty(opts);\n }\n };\n /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n */\n /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsPristine = /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = true;\n this._pendingDirty = false;\n this._forEachChild(function (control) { control.markAsPristine({ onlySelf: true }); });\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n };\n /**\n * Marks the control as `pending`.\n */\n /**\n * Marks the control as `pending`.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsPending = /**\n * Marks the control as `pending`.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = PENDING;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsPending(opts);\n }\n };\n /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n */\n /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.disable = /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = DISABLED;\n (/** @type {?} */ (this)).errors = null;\n this._forEachChild(function (control) { control.disable({ onlySelf: true }); });\n this._updateValue();\n if (opts.emitEvent !== false) {\n (/** @type {?} */ (this.valueChanges)).emit(this.value);\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n this._updateAncestors(!!opts.onlySelf);\n this._onDisabledChange.forEach(function (changeFn) { return changeFn(true); });\n };\n /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n */\n /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.enable = /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = VALID;\n this._forEachChild(function (control) { control.enable({ onlySelf: true }); });\n this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });\n this._updateAncestors(!!opts.onlySelf);\n this._onDisabledChange.forEach(function (changeFn) { return changeFn(false); });\n };\n /**\n * @param {?} onlySelf\n * @return {?}\n */\n AbstractControl.prototype._updateAncestors = /**\n * @param {?} onlySelf\n * @return {?}\n */\n function (onlySelf) {\n if (this._parent && !onlySelf) {\n this._parent.updateValueAndValidity();\n this._parent._updatePristine();\n this._parent._updateTouched();\n }\n };\n /**\n * @param {?} parent\n * @return {?}\n */\n AbstractControl.prototype.setParent = /**\n * @param {?} parent\n * @return {?}\n */\n function (parent) { this._parent = parent; };\n /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n */\n /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.updateValueAndValidity = /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n this._setInitialStatus();\n this._updateValue();\n if (this.enabled) {\n this._cancelExistingSubscription();\n (/** @type {?} */ (this)).errors = this._runValidator();\n (/** @type {?} */ (this)).status = this._calculateStatus();\n if (this.status === VALID || this.status === PENDING) {\n this._runAsyncValidator(opts.emitEvent);\n }\n }\n if (opts.emitEvent !== false) {\n (/** @type {?} */ (this.valueChanges)).emit(this.value);\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n if (this._parent && !opts.onlySelf) {\n this._parent.updateValueAndValidity(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updateTreeValidity = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = { emitEvent: true }; }\n this._forEachChild(function (ctrl) { return ctrl._updateTreeValidity(opts); });\n this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._setInitialStatus = /**\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).status = this._allControlsDisabled() ? DISABLED : VALID;\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._runValidator = /**\n * @return {?}\n */\n function () {\n return this.validator ? this.validator(this) : null;\n };\n /**\n * @param {?=} emitEvent\n * @return {?}\n */\n AbstractControl.prototype._runAsyncValidator = /**\n * @param {?=} emitEvent\n * @return {?}\n */\n function (emitEvent) {\n var _this = this;\n if (this.asyncValidator) {\n (/** @type {?} */ (this)).status = PENDING;\n var /** @type {?} */ obs = toObservable(this.asyncValidator(this));\n this._asyncValidationSubscription =\n obs.subscribe(function (errors) { return _this.setErrors(errors, { emitEvent: emitEvent }); });\n }\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._cancelExistingSubscription = /**\n * @return {?}\n */\n function () {\n if (this._asyncValidationSubscription) {\n this._asyncValidationSubscription.unsubscribe();\n }\n };\n /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n */\n /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n * @param {?} errors\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.setErrors = /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n * @param {?} errors\n * @param {?=} opts\n * @return {?}\n */\n function (errors, opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).errors = errors;\n this._updateControlsErrors(opts.emitEvent !== false);\n };\n /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n */\n /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n * @param {?} path\n * @return {?}\n */\n AbstractControl.prototype.get = /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n * @param {?} path\n * @return {?}\n */\n function (path) { return _find(this, path, '.'); };\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControl.prototype.getError = /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n var /** @type {?} */ control = path ? this.get(path) : this;\n return control && control.errors ? control.errors[errorCode] : null;\n };\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControl.prototype.hasError = /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) { return !!this.getError(errorCode, path); };\n Object.defineProperty(AbstractControl.prototype, \"root\", {\n /**\n * Retrieves the top-level ancestor of this control.\n */\n get: /**\n * Retrieves the top-level ancestor of this control.\n * @return {?}\n */\n function () {\n var /** @type {?} */ x = this;\n while (x._parent) {\n x = x._parent;\n }\n return x;\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} emitEvent\n * @return {?}\n */\n AbstractControl.prototype._updateControlsErrors = /**\n * \\@internal\n * @param {?} emitEvent\n * @return {?}\n */\n function (emitEvent) {\n (/** @type {?} */ (this)).status = this._calculateStatus();\n if (emitEvent) {\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n if (this._parent) {\n this._parent._updateControlsErrors(emitEvent);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._initObservables = /**\n * \\@internal\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).valueChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n (/** @type {?} */ (this)).statusChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._calculateStatus = /**\n * @return {?}\n */\n function () {\n if (this._allControlsDisabled())\n return DISABLED;\n if (this.errors)\n return INVALID;\n if (this._anyControlsHaveStatus(PENDING))\n return PENDING;\n if (this._anyControlsHaveStatus(INVALID))\n return INVALID;\n return VALID;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} status\n * @return {?}\n */\n AbstractControl.prototype._anyControlsHaveStatus = /**\n * \\@internal\n * @param {?} status\n * @return {?}\n */\n function (status) {\n return this._anyControls(function (control) { return control.status === status; });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._anyControlsDirty = /**\n * \\@internal\n * @return {?}\n */\n function () {\n return this._anyControls(function (control) { return control.dirty; });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._anyControlsTouched = /**\n * \\@internal\n * @return {?}\n */\n function () {\n return this._anyControls(function (control) { return control.touched; });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updatePristine = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = !this._anyControlsDirty();\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updateTouched = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = this._anyControlsTouched();\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} formState\n * @return {?}\n */\n AbstractControl.prototype._isBoxedValue = /**\n * \\@internal\n * @param {?} formState\n * @return {?}\n */\n function (formState) {\n return typeof formState === 'object' && formState !== null &&\n Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n AbstractControl.prototype._registerOnCollectionChange = /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onCollectionChange = fn; };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._setUpdateStrategy = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (isOptionsObj(opts) && (/** @type {?} */ (opts)).updateOn != null) {\n this._updateOn = /** @type {?} */ (((/** @type {?} */ (opts)).updateOn));\n }\n };\n return AbstractControl;\n}());\n/**\n * \\@whatItDoes Tracks the value and validation status of an individual form control.\n *\n * It is one of the three fundamental building blocks of Angular forms, along with\n * {\\@link FormGroup} and {\\@link FormArray}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormControl}, you can pass in an initial value as the\n * first argument. Example:\n *\n * ```ts\n * const ctrl = new FormControl('some value');\n * console.log(ctrl.value); // 'some value'\n * ```\n *\n * You can also initialize the control with a form state object on instantiation,\n * which includes both the value and whether or not the control is disabled.\n * You can't use the value key without the disabled key; both are required\n * to use this way of initialization.\n *\n * ```ts\n * const ctrl = new FormControl({value: 'n/a', disabled: true});\n * console.log(ctrl.value); // 'n/a'\n * console.log(ctrl.status); // 'DISABLED'\n * ```\n *\n * The second {\\@link FormControl} argument can accept one of three things:\n * * a sync validator function\n * * an array of sync validator functions\n * * an options object containing validator and/or async validator functions\n *\n * Example of a single sync validator function:\n *\n * ```ts\n * const ctrl = new FormControl('', Validators.required);\n * console.log(ctrl.value); // ''\n * console.log(ctrl.status); // 'INVALID'\n * ```\n *\n * Example using options object:\n *\n * ```ts\n * const ctrl = new FormControl('', {\n * validators: Validators.required,\n * asyncValidators: myAsyncValidator\n * });\n * ```\n *\n * The options object can also be used to define when the control should update.\n * By default, the value and validity of a control updates whenever the value\n * changes. You can configure it to update on the blur event instead by setting\n * the `updateOn` option to `'blur'`.\n *\n * ```ts\n * const c = new FormControl('', { updateOn: 'blur' });\n * ```\n *\n * You can also set `updateOn` to `'submit'`, which will delay value and validity\n * updates until the parent form of the control fires a submit event.\n *\n * See its superclass, {\\@link AbstractControl}, for more properties and methods.\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormControl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControl, _super);\n function FormControl(formState, validatorOrOpts, asyncValidator) {\n if (formState === void 0) { formState = null; }\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n /**\n * \\@internal\n */\n _this._onChange = [];\n _this._applyFormState(formState);\n _this._setUpdateStrategy(validatorOrOpts);\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n _this._initObservables();\n return _this;\n }\n /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n */\n /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.setValue = /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n (/** @type {?} */ (this)).value = this._pendingValue = value;\n if (this._onChange.length && options.emitModelToViewChange !== false) {\n this._onChange.forEach(function (changeFn) { return changeFn(_this.value, options.emitViewToModelChange !== false); });\n }\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n */\n /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {\\@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {\\@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.patchValue = /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {\\@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {\\@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (options === void 0) { options = {}; }\n this.setValue(value, options);\n };\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n * @param {?=} formState\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.reset = /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n * @param {?=} formState\n * @param {?=} options\n * @return {?}\n */\n function (formState, options) {\n if (formState === void 0) { formState = null; }\n if (options === void 0) { options = {}; }\n this._applyFormState(formState);\n this.markAsPristine(options);\n this.markAsUntouched(options);\n this.setValue(this.value, options);\n this._pendingChange = false;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () { };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormControl.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) { return false; };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () { return this.disabled; };\n /**\n * Register a listener for change events.\n */\n /**\n * Register a listener for change events.\n * @param {?} fn\n * @return {?}\n */\n FormControl.prototype.registerOnChange = /**\n * Register a listener for change events.\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange.push(fn); };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._clearChangeFns = /**\n * \\@internal\n * @return {?}\n */\n function () {\n this._onChange = [];\n this._onDisabledChange = [];\n this._onCollectionChange = function () { };\n };\n /**\n * Register a listener for disabled events.\n */\n /**\n * Register a listener for disabled events.\n * @param {?} fn\n * @return {?}\n */\n FormControl.prototype.registerOnDisabledChange = /**\n * Register a listener for disabled events.\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._onDisabledChange.push(fn);\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormControl.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) { };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (this.updateOn === 'submit') {\n if (this._pendingDirty)\n this.markAsDirty();\n if (this._pendingTouched)\n this.markAsTouched();\n if (this._pendingChange) {\n this.setValue(this._pendingValue, { onlySelf: true, emitModelToViewChange: false });\n return true;\n }\n }\n return false;\n };\n /**\n * @param {?} formState\n * @return {?}\n */\n FormControl.prototype._applyFormState = /**\n * @param {?} formState\n * @return {?}\n */\n function (formState) {\n if (this._isBoxedValue(formState)) {\n (/** @type {?} */ (this)).value = this._pendingValue = formState.value;\n formState.disabled ? this.disable({ onlySelf: true, emitEvent: false }) :\n this.enable({ onlySelf: true, emitEvent: false });\n }\n else {\n (/** @type {?} */ (this)).value = this._pendingValue = formState;\n }\n };\n return FormControl;\n}(AbstractControl));\n/**\n * \\@whatItDoes Tracks the value and validity state of a group of {\\@link FormControl}\n * instances.\n *\n * A `FormGroup` aggregates the values of each child {\\@link FormControl} into one object,\n * with each control name as the key. It calculates its status by reducing the statuses\n * of its children. For example, if one of the controls in a group is invalid, the entire\n * group becomes invalid.\n *\n * `FormGroup` is one of the three fundamental building blocks used to define forms in Angular,\n * along with {\\@link FormControl} and {\\@link FormArray}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormGroup}, pass in a collection of child controls as the first\n * argument. The key for each child will be the name under which it is registered.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl('Nancy', Validators.minLength(2)),\n * last: new FormControl('Drew'),\n * });\n *\n * console.log(form.value); // {first: 'Nancy', last; 'Drew'}\n * console.log(form.status); // 'VALID'\n * ```\n *\n * You can also include group-level validators as the second arg, or group-level async\n * validators as the third arg. These come in handy when you want to perform validation\n * that considers the value of more than one child control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('', Validators.minLength(2)),\n * passwordConfirm: new FormControl('', Validators.minLength(2)),\n * }, passwordMatchValidator);\n *\n *\n * function passwordMatchValidator(g: FormGroup) {\n * return g.get('password').value === g.get('passwordConfirm').value\n * ? null : {'mismatch': true};\n * }\n * ```\n *\n * Like {\\@link FormControl} instances, you can alternatively choose to pass in\n * validators and async validators as part of an options object.\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('')\n * passwordConfirm: new FormControl('')\n * }, {validators: passwordMatchValidator, asyncValidators: otherValidator});\n * ```\n *\n * The options object can also be used to set a default value for each child\n * control's `updateOn` property. If you set `updateOn` to `'blur'` at the\n * group level, all child controls will default to 'blur', unless the child\n * has explicitly specified a different `updateOn` value.\n *\n * ```ts\n * const c = new FormGroup({\n * one: new FormControl()\n * }, {updateOn: 'blur'});\n * ```\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroup, _super);\n function FormGroup(controls, validatorOrOpts, asyncValidator) {\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n _this.controls = controls;\n _this._initObservables();\n _this._setUpdateStrategy(validatorOrOpts);\n _this._setUpControls();\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n return _this;\n }\n /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {@link FormGroup#addControl addControl} instead.\n */\n /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {\\@link FormGroup#addControl addControl} instead.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.registerControl = /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {\\@link FormGroup#addControl addControl} instead.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n if (this.controls[name])\n return this.controls[name];\n this.controls[name] = control;\n control.setParent(this);\n control._registerOnCollectionChange(this._onCollectionChange);\n return control;\n };\n /**\n * Add a control to this group.\n */\n /**\n * Add a control to this group.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.addControl = /**\n * Add a control to this group.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n this.registerControl(name, control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Remove a control from this group.\n */\n /**\n * Remove a control from this group.\n * @param {?} name\n * @return {?}\n */\n FormGroup.prototype.removeControl = /**\n * Remove a control from this group.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.controls[name])\n this.controls[name]._registerOnCollectionChange(function () { });\n delete (this.controls[name]);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Replace an existing control.\n */\n /**\n * Replace an existing control.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.setControl = /**\n * Replace an existing control.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n if (this.controls[name])\n this.controls[name]._registerOnCollectionChange(function () { });\n delete (this.controls[name]);\n if (control)\n this.registerControl(name, control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {@link AbstractControl#get get} instead.\n */\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {\\@link AbstractControl#get get} instead.\n * @param {?} controlName\n * @return {?}\n */\n FormGroup.prototype.contains = /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {\\@link AbstractControl#get get} instead.\n * @param {?} controlName\n * @return {?}\n */\n function (controlName) {\n return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;\n };\n /**\n * Sets the value of the {@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n */\n /**\n * Sets the value of the {\\@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.setValue = /**\n * Sets the value of the {\\@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this._checkAllValuesPresent(value);\n Object.keys(value).forEach(function (name) {\n _this._throwIfControlMissing(name);\n _this.controls[name].setValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of the {@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n */\n /**\n * Patches the value of the {\\@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.patchValue = /**\n * Patches the value of the {\\@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n Object.keys(value).forEach(function (name) {\n if (_this.controls[name]) {\n _this.controls[name].patchValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n }\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Resets the {@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the {\\@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.reset = /**\n * Resets the {\\@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (value === void 0) { value = {}; }\n if (options === void 0) { options = {}; }\n this._forEachChild(function (control, name) {\n control.reset(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n this._updatePristine(options);\n this._updateTouched(options);\n };\n /**\n * The aggregate value of the {@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n */\n /**\n * The aggregate value of the {\\@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n * @return {?}\n */\n FormGroup.prototype.getRawValue = /**\n * The aggregate value of the {\\@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n * @return {?}\n */\n function () {\n return this._reduceChildren({}, function (acc, control, name) {\n acc[name] = control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();\n return acc;\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var /** @type {?} */ subtreeUpdated = this._reduceChildren(false, function (updated, child) {\n return child._syncPendingControls() ? true : updated;\n });\n if (subtreeUpdated)\n this.updateValueAndValidity({ onlySelf: true });\n return subtreeUpdated;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} name\n * @return {?}\n */\n FormGroup.prototype._throwIfControlMissing = /**\n * \\@internal\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (!Object.keys(this.controls).length) {\n throw new Error(\"\\n There are no form controls registered with this group yet. If you're using ngModel,\\n you may want to check next tick (e.g. use setTimeout).\\n \");\n }\n if (!this.controls[name]) {\n throw new Error(\"Cannot find form control with name: \" + name + \".\");\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormGroup.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) {\n var _this = this;\n Object.keys(this.controls).forEach(function (k) { return cb(_this.controls[k], k); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._setUpControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this._forEachChild(function (control) {\n control.setParent(_this);\n control._registerOnCollectionChange(_this._onCollectionChange);\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () { (/** @type {?} */ (this)).value = this._reduceValue(); };\n /** @internal */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormGroup.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n var _this = this;\n var /** @type {?} */ res = false;\n this._forEachChild(function (control, name) {\n res = res || (_this.contains(name) && condition(control));\n });\n return res;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._reduceValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n return this._reduceChildren({}, function (acc, control, name) {\n if (control.enabled || _this.disabled) {\n acc[name] = control.value;\n }\n return acc;\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} initValue\n * @param {?} fn\n * @return {?}\n */\n FormGroup.prototype._reduceChildren = /**\n * \\@internal\n * @param {?} initValue\n * @param {?} fn\n * @return {?}\n */\n function (initValue, fn) {\n var /** @type {?} */ res = initValue;\n this._forEachChild(function (control, name) { res = fn(res, control, name); });\n return res;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () {\n for (var _i = 0, _a = Object.keys(this.controls); _i < _a.length; _i++) {\n var controlName = _a[_i];\n if (this.controls[controlName].enabled) {\n return false;\n }\n }\n return Object.keys(this.controls).length > 0 || this.disabled;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n FormGroup.prototype._checkAllValuesPresent = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._forEachChild(function (control, name) {\n if (value[name] === undefined) {\n throw new Error(\"Must supply a value for form control with name: '\" + name + \"'.\");\n }\n });\n };\n return FormGroup;\n}(AbstractControl));\n/**\n * \\@whatItDoes Tracks the value and validity state of an array of {\\@link FormControl},\n * {\\@link FormGroup} or {\\@link FormArray} instances.\n *\n * A `FormArray` aggregates the values of each child {\\@link FormControl} into an array.\n * It calculates its status by reducing the statuses of its children. For example, if one of\n * the controls in a `FormArray` is invalid, the entire array becomes invalid.\n *\n * `FormArray` is one of the three fundamental building blocks used to define forms in Angular,\n * along with {\\@link FormControl} and {\\@link FormGroup}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormArray}, pass in an array of child controls as the first\n * argument.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl('Nancy', Validators.minLength(2)),\n * new FormControl('Drew'),\n * ]);\n *\n * console.log(arr.value); // ['Nancy', 'Drew']\n * console.log(arr.status); // 'VALID'\n * ```\n *\n * You can also include array-level validators and async validators. These come in handy\n * when you want to perform validation that considers the value of more than one child\n * control.\n *\n * The two types of validators can be passed in separately as the second and third arg\n * respectively, or together as part of an options object.\n *\n * ```\n * const arr = new FormArray([\n * new FormControl('Nancy'),\n * new FormControl('Drew')\n * ], {validators: myValidator, asyncValidators: myAsyncValidator});\n * ```\n *\n * The options object can also be used to set a default value for each child\n * control's `updateOn` property. If you set `updateOn` to `'blur'` at the\n * array level, all child controls will default to 'blur', unless the child\n * has explicitly specified a different `updateOn` value.\n *\n * ```ts\n * const c = new FormArray([\n * new FormControl()\n * ], {updateOn: 'blur'});\n * ```\n *\n * ### Adding or removing controls\n *\n * To change the controls in the array, use the `push`, `insert`, or `removeAt` methods\n * in `FormArray` itself. These methods ensure the controls are properly tracked in the\n * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate\n * the `FormArray` directly, as that will result in strange and unexpected behavior such\n * as broken change detection.\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormArray = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormArray, _super);\n function FormArray(controls, validatorOrOpts, asyncValidator) {\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n _this.controls = controls;\n _this._initObservables();\n _this._setUpdateStrategy(validatorOrOpts);\n _this._setUpControls();\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n return _this;\n }\n /**\n * Get the {@link AbstractControl} at the given `index` in the array.\n */\n /**\n * Get the {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype.at = /**\n * Get the {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n function (index) { return this.controls[index]; };\n /**\n * Insert a new {@link AbstractControl} at the end of the array.\n */\n /**\n * Insert a new {\\@link AbstractControl} at the end of the array.\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.push = /**\n * Insert a new {\\@link AbstractControl} at the end of the array.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n this.controls.push(control);\n this._registerControl(control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Insert a new {@link AbstractControl} at the given `index` in the array.\n */\n /**\n * Insert a new {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.insert = /**\n * Insert a new {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n function (index, control) {\n this.controls.splice(index, 0, control);\n this._registerControl(control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Remove the control at the given `index` in the array.\n */\n /**\n * Remove the control at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype.removeAt = /**\n * Remove the control at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n function (index) {\n if (this.controls[index])\n this.controls[index]._registerOnCollectionChange(function () { });\n this.controls.splice(index, 1);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Replace an existing control.\n */\n /**\n * Replace an existing control.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.setControl = /**\n * Replace an existing control.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n function (index, control) {\n if (this.controls[index])\n this.controls[index]._registerOnCollectionChange(function () { });\n this.controls.splice(index, 1);\n if (control) {\n this.controls.splice(index, 0, control);\n this._registerControl(control);\n }\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n Object.defineProperty(FormArray.prototype, \"length\", {\n /**\n * Length of the control array.\n */\n get: /**\n * Length of the control array.\n * @return {?}\n */\n function () { return this.controls.length; },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the value of the {@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n */\n /**\n * Sets the value of the {\\@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.setValue = /**\n * Sets the value of the {\\@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this._checkAllValuesPresent(value);\n value.forEach(function (newValue, index) {\n _this._throwIfControlMissing(index);\n _this.at(index).setValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of the {@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n */\n /**\n * Patches the value of the {\\@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.patchValue = /**\n * Patches the value of the {\\@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n value.forEach(function (newValue, index) {\n if (_this.at(index)) {\n _this.at(index).patchValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });\n }\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Resets the {@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the {\\@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.reset = /**\n * Resets the {\\@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (value === void 0) { value = []; }\n if (options === void 0) { options = {}; }\n this._forEachChild(function (control, index) {\n control.reset(value[index], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n this._updatePristine(options);\n this._updateTouched(options);\n };\n /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n */\n /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n * @return {?}\n */\n FormArray.prototype.getRawValue = /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n * @return {?}\n */\n function () {\n return this.controls.map(function (control) {\n return control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var /** @type {?} */ subtreeUpdated = this.controls.reduce(function (updated, child) {\n return child._syncPendingControls() ? true : updated;\n }, false);\n if (subtreeUpdated)\n this.updateValueAndValidity({ onlySelf: true });\n return subtreeUpdated;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype._throwIfControlMissing = /**\n * \\@internal\n * @param {?} index\n * @return {?}\n */\n function (index) {\n if (!this.controls.length) {\n throw new Error(\"\\n There are no form controls registered with this array yet. If you're using ngModel,\\n you may want to check next tick (e.g. use setTimeout).\\n \");\n }\n if (!this.at(index)) {\n throw new Error(\"Cannot find form control at index \" + index);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormArray.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) {\n this.controls.forEach(function (control, index) { cb(control, index); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n (/** @type {?} */ (this)).value =\n this.controls.filter(function (control) { return control.enabled || _this.disabled; })\n .map(function (control) { return control.value; });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormArray.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n return this.controls.some(function (control) { return control.enabled && condition(control); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._setUpControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this._forEachChild(function (control) { return _this._registerControl(control); });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n FormArray.prototype._checkAllValuesPresent = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._forEachChild(function (control, i) {\n if (value[i] === undefined) {\n throw new Error(\"Must supply a value for form control at index: \" + i + \".\");\n }\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () {\n for (var _i = 0, _a = this.controls; _i < _a.length; _i++) {\n var control = _a[_i];\n if (control.enabled)\n return false;\n }\n return this.controls.length > 0 || this.disabled;\n };\n /**\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype._registerControl = /**\n * @param {?} control\n * @return {?}\n */\n function (control) {\n control.setParent(this);\n control._registerOnCollectionChange(this._onCollectionChange);\n };\n return FormArray;\n}(AbstractControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formDirectiveProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgForm; })\n};\nvar resolvedPromise = Promise.resolve(null);\n/**\n * \\@whatItDoes Creates a top-level {\\@link FormGroup} instance and binds it to a form\n * to track aggregate form value and validation status.\n *\n * \\@howToUse\n *\n * As soon as you import the `FormsModule`, this directive becomes active by default on\n * all `<form>` tags. You don't need to add a special selector.\n *\n * You can export the directive into a local template variable using `ngForm` as the key\n * (ex: `#myForm=\"ngForm\"`). This is optional, but useful. Many properties from the underlying\n * {\\@link FormGroup} instance are duplicated on the directive itself, so a reference to it\n * will give you access to the aggregate value and validity status of the form, as well as\n * user interaction properties like `dirty` and `touched`.\n *\n * To register child controls with the form, you'll want to use {\\@link NgModel} with a\n * `name` attribute. You can also use {\\@link NgModelGroup} if you'd like to create\n * sub-groups within the form.\n *\n * You can listen to the directive's `ngSubmit` event to be notified when the user has\n * triggered a form submission. The `ngSubmit` event will be emitted with the original form\n * submission event.\n *\n * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`.\n * If you want to import the `FormsModule` but skip its usage in some forms,\n * for example, to use native HTML5 validation, you can add `ngNoForm` and the `<form>`\n * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is\n * unnecessary because the `<form>` tags are inert. In that case, you would\n * refrain from using the `formGroup` directive.\n *\n * {\\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgForm = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgForm, _super);\n function NgForm(validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this.submitted = false;\n _this._directives = [];\n _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this.form =\n new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));\n return _this;\n }\n /**\n * @return {?}\n */\n NgForm.prototype.ngAfterViewInit = /**\n * @return {?}\n */\n function () { this._setUpdateStrategy(); };\n Object.defineProperty(NgForm.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"controls\", {\n get: /**\n * @return {?}\n */\n function () { return this.form.controls; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.addControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n (/** @type {?} */ (dir)).control = /** @type {?} */ (container.registerControl(dir.name, dir.control));\n setUpControl(dir.control, dir);\n dir.control.updateValueAndValidity({ emitEvent: false });\n _this._directives.push(dir);\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.getControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.removeControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n removeDir(_this._directives, dir);\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.addFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n var /** @type {?} */ group = new FormGroup({});\n setUpFormContainer(group, dir);\n container.registerControl(dir.name, group);\n group.updateValueAndValidity({ emitEvent: false });\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.removeFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.getFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n NgForm.prototype.updateModel = /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n function (dir, value) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ ctrl = /** @type {?} */ (_this.form.get(/** @type {?} */ ((dir.path))));\n ctrl.setValue(value);\n });\n };\n /**\n * @param {?} value\n * @return {?}\n */\n NgForm.prototype.setValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this.control.setValue(value); };\n /**\n * @param {?} $event\n * @return {?}\n */\n NgForm.prototype.onSubmit = /**\n * @param {?} $event\n * @return {?}\n */\n function ($event) {\n (/** @type {?} */ (this)).submitted = true;\n syncPendingControls(this.form, this._directives);\n this.ngSubmit.emit($event);\n return false;\n };\n /**\n * @return {?}\n */\n NgForm.prototype.onReset = /**\n * @return {?}\n */\n function () { this.resetForm(); };\n /**\n * @param {?=} value\n * @return {?}\n */\n NgForm.prototype.resetForm = /**\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n this.form.reset(value);\n (/** @type {?} */ (this)).submitted = false;\n };\n /**\n * @return {?}\n */\n NgForm.prototype._setUpdateStrategy = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.updateOn != null) {\n this.form._updateOn = this.options.updateOn;\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} path\n * @return {?}\n */\n NgForm.prototype._findContainer = /**\n * \\@internal\n * @param {?} path\n * @return {?}\n */\n function (path) {\n path.pop();\n return path.length ? /** @type {?} */ (this.form.get(path)) : this.form;\n };\n NgForm.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',\n providers: [formDirectiveProvider],\n host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },\n outputs: ['ngSubmit'],\n exportAs: 'ngForm'\n },] },\n ];\n /** @nocollapse */\n NgForm.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n NgForm.propDecorators = {\n \"options\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngFormOptions',] },],\n };\n return NgForm;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar FormErrorExamples = {\n formControlName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <input formControlName=\\\"firstName\\\">\\n </div>\\n\\n In your class:\\n\\n this.myGroup = new FormGroup({\\n firstName: new FormControl()\\n });\",\n formGroupName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <div formGroupName=\\\"person\\\">\\n <input formControlName=\\\"firstName\\\">\\n </div>\\n </div>\\n\\n In your class:\\n\\n this.myGroup = new FormGroup({\\n person: new FormGroup({ firstName: new FormControl() })\\n });\",\n formArrayName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <div formArrayName=\\\"cities\\\">\\n <div *ngFor=\\\"let city of cityArray.controls; index as i\\\">\\n <input [formControlName]=\\\"i\\\">\\n </div>\\n </div>\\n </div>\\n\\n In your class:\\n\\n this.cityArray = new FormArray([new FormControl('SF')]);\\n this.myGroup = new FormGroup({\\n cities: this.cityArray\\n });\",\n ngModelGroup: \"\\n <form>\\n <div ngModelGroup=\\\"person\\\">\\n <input [(ngModel)]=\\\"person.name\\\" name=\\\"firstName\\\">\\n </div>\\n </form>\",\n ngModelWithFormGroup: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <input formControlName=\\\"firstName\\\">\\n <input [(ngModel)]=\\\"showMoreControls\\\" [ngModelOptions]=\\\"{standalone: true}\\\">\\n </div>\\n \"\n};\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar TemplateDrivenErrors = /** @class */ (function () {\n function TemplateDrivenErrors() {\n }\n /**\n * @return {?}\n */\n TemplateDrivenErrors.modelParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\\n formGroup's partner directive \\\"formControlName\\\" instead. Example:\\n\\n \" + FormErrorExamples.formControlName + \"\\n\\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\\n\\n Example:\\n\\n \" + FormErrorExamples.ngModelWithFormGroup);\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.formGroupNameException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\\n\\n Option 1: Use formControlName instead of ngModel (reactive strategy):\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.missingNameException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"If ngModel is used within a form tag, either the name attribute must be set or the form\\n control must be defined as 'standalone' in ngModelOptions.\\n\\n Example 1: <input [(ngModel)]=\\\"person.firstName\\\" name=\\\"first\\\">\\n Example 2: <input [(ngModel)]=\\\"person.firstName\\\" [ngModelOptions]=\\\"{standalone: true}\\\">\");\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.modelGroupParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModelGroup cannot be used with a parent formGroup directive.\\n\\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n return TemplateDrivenErrors;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar modelGroupProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgModelGroup; })\n};\n/**\n * \\@whatItDoes Creates and binds a {\\@link FormGroup} instance to a DOM element.\n *\n * \\@howToUse\n *\n * This directive can only be used as a child of {\\@link NgForm} (or in other words,\n * within `<form>` tags).\n *\n * Use this directive if you'd like to create a sub-group within a form. This can\n * come in handy if you want to validate a sub-group of your form separately from\n * the rest of your form, or if some values in your domain model make more sense to\n * consume together in a nested object.\n *\n * Pass in the name you'd like this sub-group to have and it will become the key\n * for the sub-group in the form's full value. You can also export the directive into\n * a local template variable using `ngModelGroup` (ex: `#myGroup=\"ngModelGroup\"`).\n *\n * {\\@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgModelGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgModelGroup, _super);\n function NgModelGroup(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n NgModelGroup.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {\n TemplateDrivenErrors.modelGroupParentException();\n }\n };\n NgModelGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup' },] },\n ];\n /** @nocollapse */\n NgModelGroup.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n NgModelGroup.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModelGroup',] },],\n };\n return NgModelGroup;\n}(AbstractFormGroupDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formControlBinding = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgModel; })\n};\n/**\n * `ngModel` forces an additional change detection run when its inputs change:\n * E.g.:\n * ```\n * <div>{{myModel.valid}}</div>\n * <input [(ngModel)]=\"myValue\" #myModel=\"ngModel\">\n * ```\n * I.e. `ngModel` can export itself on the element and then be used in the template.\n * Normally, this would result in expressions before the `input` that use the exported directive\n * to have and old value as they have been\n * dirty checked before. As this is a very common case for `ngModel`, we added this second change\n * detection run.\n *\n * Notes:\n * - this is just one extra run no matter how many `ngModel` have been changed.\n * - this is a general problem when using `exportAs` for directives!\n */\nvar resolvedPromise$1 = Promise.resolve(null);\n/**\n * \\@whatItDoes Creates a {\\@link FormControl} instance from a domain model and binds it\n * to a form control element.\n *\n * The {\\@link FormControl} instance will track the value, user interaction, and\n * validation status of the control and keep the view synced with the model. If used\n * within a parent form, the directive will also register itself with the form as a child\n * control.\n *\n * \\@howToUse\n *\n * This directive can be used by itself or as part of a larger form. All you need is the\n * `ngModel` selector to activate it.\n *\n * It accepts a domain model as an optional {\\@link Input}. If you have a one-way binding\n * to `ngModel` with `[]` syntax, changing the value of the domain model in the component\n * class will set the value in the view. If you have a two-way binding with `[()]` syntax\n * (also known as 'banana-box syntax'), the value in the UI will always be synced back to\n * the domain model in your class as well.\n *\n * If you wish to inspect the properties of the associated {\\@link FormControl} (like\n * validity state), you can also export the directive into a local template variable using\n * `ngModel` as the key (ex: `#myVar=\"ngModel\"`). You can then access the control using the\n * directive's `control` property, but most properties you'll need (like `valid` and `dirty`)\n * will fall through to the control anyway, so you can access them directly. You can see a\n * full list of properties directly available in {\\@link AbstractControlDirective}.\n *\n * The following is an example of a simple standalone control using `ngModel`:\n *\n * {\\@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}\n *\n * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute\n * so that the control can be registered with the parent form under that name.\n *\n * It's worth noting that in the context of a parent form, you often can skip one-way or\n * two-way binding because the parent form will sync the value for you. You can access\n * its properties by exporting it into a local template variable using `ngForm` (ex:\n * `#f=\"ngForm\"`). Then you can pass it where it needs to go on submit.\n *\n * If you do need to populate initial values into your form, using a one-way binding for\n * `ngModel` tends to be sufficient as long as you use the exported form's value rather\n * than the domain model's value on submit.\n *\n * Take a look at an example of using `ngModel` within a form:\n *\n * {\\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * To see `ngModel` examples with different form control types, see:\n *\n * * Radio buttons: {\\@link RadioControlValueAccessor}\n * * Selects: {\\@link SelectControlValueAccessor}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgModel = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgModel, _super);\n function NgModel(parent, validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this.control = new FormControl();\n /**\n * \\@internal\n */\n _this._registered = false;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._parent = parent;\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgModel.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._checkForErrors();\n if (!this._registered)\n this._setUpControl();\n if ('isDisabled' in changes) {\n this._updateDisabled(changes);\n }\n if (isPropertyUpdated(changes, this.viewModel)) {\n this._updateValue(this.model);\n this.viewModel = this.model;\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.formDirective && this.formDirective.removeControl(this); };\n Object.defineProperty(NgModel.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._parent ? controlPath(this.name, this._parent) : [this.name];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._rawAsyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} newValue\n * @return {?}\n */\n NgModel.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpControl = /**\n * @return {?}\n */\n function () {\n this._setUpdateStrategy();\n this._isStandalone() ? this._setUpStandalone() :\n this.formDirective.addControl(this);\n this._registered = true;\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpdateStrategy = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.updateOn != null) {\n this.control._updateOn = this.options.updateOn;\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype._isStandalone = /**\n * @return {?}\n */\n function () {\n return !this._parent || !!(this.options && this.options.standalone);\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpStandalone = /**\n * @return {?}\n */\n function () {\n setUpControl(this.control, this);\n this.control.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkForErrors = /**\n * @return {?}\n */\n function () {\n if (!this._isStandalone()) {\n this._checkParentType();\n }\n this._checkName();\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof NgModelGroup) &&\n this._parent instanceof AbstractFormGroupDirective) {\n TemplateDrivenErrors.formGroupNameException();\n }\n else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {\n TemplateDrivenErrors.modelParentException();\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkName = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.name)\n this.name = this.options.name;\n if (!this._isStandalone() && !this.name) {\n TemplateDrivenErrors.missingNameException();\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n NgModel.prototype._updateValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var _this = this;\n resolvedPromise$1.then(function () { _this.control.setValue(value, { emitViewToModelChange: false }); });\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgModel.prototype._updateDisabled = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n var /** @type {?} */ disabledValue = changes['isDisabled'].currentValue;\n var /** @type {?} */ isDisabled = disabledValue === '' || (disabledValue && disabledValue !== 'false');\n resolvedPromise$1.then(function () {\n if (isDisabled && !_this.control.disabled) {\n _this.control.disable();\n }\n else if (!isDisabled && _this.control.disabled) {\n _this.control.enable();\n }\n });\n };\n NgModel.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[ngModel]:not([formControlName]):not([formControl])',\n providers: [formControlBinding],\n exportAs: 'ngModel'\n },] },\n ];\n /** @nocollapse */\n NgModel.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n NgModel.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"options\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModelOptions',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n };\n return NgModel;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ReactiveErrors = /** @class */ (function () {\n function ReactiveErrors() {\n }\n /**\n * @return {?}\n */\n ReactiveErrors.controlParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formControlName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.ngModelGroupException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\\n that also have a \\\"form\\\" prefix: formGroupName, formArrayName, or formGroup.\\n\\n Option 1: Update the parent to be formGroupName (reactive form strategy)\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.missingFormException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formGroup expects a FormGroup instance. Please pass one in.\\n\\n Example:\\n\\n \" + FormErrorExamples.formControlName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.groupParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formGroupName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.arrayParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formArrayName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.disabledAttrWarning = /**\n * @return {?}\n */\n function () {\n console.warn(\"\\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\\n you. We recommend using this approach to avoid 'changed after checked' errors.\\n \\n Example: \\n form = new FormGroup({\\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\\n last: new FormControl('Drew', Validators.required)\\n });\\n \");\n };\n return ReactiveErrors;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formControlBinding$1 = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormControlDirective; })\n};\n/**\n * \\@whatItDoes Syncs a standalone {\\@link FormControl} instance to a form control element.\n *\n * In other words, this directive ensures that any values written to the {\\@link FormControl}\n * instance programmatically will be written to the DOM element (model -> view). Conversely,\n * any values written to the DOM element through user input will be reflected in the\n * {\\@link FormControl} instance (view -> model).\n *\n * \\@howToUse\n *\n * Use this directive if you'd like to create and manage a {\\@link FormControl} instance directly.\n * Simply create a {\\@link FormControl}, save it to your component class, and pass it into the\n * {\\@link FormControlDirective}.\n *\n * This directive is designed to be used as a standalone control. Unlike {\\@link FormControlName},\n * it does not require that your {\\@link FormControl} instance be part of any parent\n * {\\@link FormGroup}, and it won't be registered to any {\\@link FormGroupDirective} that\n * exists above it.\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormControl} instance. See a full list of available properties in\n * {\\@link AbstractControl}.\n *\n * **Set the value**: You can pass in an initial value when instantiating the {\\@link FormControl},\n * or you can set it programmatically later using {\\@link AbstractControl#setValue setValue} or\n * {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the control, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * {\\@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormControlDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControlDirective, _super);\n function FormControlDirective(validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n Object.defineProperty(FormControlDirective.prototype, \"isDisabled\", {\n set: /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlDirective.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if (this._isControlChanged(changes)) {\n setUpControl(this.form, this);\n if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {\n /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);\n }\n this.form.updateValueAndValidity({ emitEvent: false });\n }\n if (isPropertyUpdated(changes, this.viewModel)) {\n this.form.setValue(this.model);\n this.viewModel = this.model;\n }\n };\n Object.defineProperty(FormControlDirective.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._rawAsyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} newValue\n * @return {?}\n */\n FormControlDirective.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlDirective.prototype._isControlChanged = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n return changes.hasOwnProperty('form');\n };\n FormControlDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControl]', providers: [formControlBinding$1], exportAs: 'ngForm' },] },\n ];\n /** @nocollapse */\n FormControlDirective.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n FormControlDirective.propDecorators = {\n \"form\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formControl',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return FormControlDirective;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formDirectiveProvider$1 = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormGroupDirective; })\n};\n/**\n * \\@whatItDoes Binds an existing {\\@link FormGroup} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive accepts an existing {\\@link FormGroup} instance. It will then use this\n * {\\@link FormGroup} instance to match any child {\\@link FormControl}, {\\@link FormGroup},\n * and {\\@link FormArray} instances to child {\\@link FormControlName}, {\\@link FormGroupName},\n * and {\\@link FormArrayName} directives.\n *\n * **Set value**: You can set the form's initial value when instantiating the\n * {\\@link FormGroup}, or you can set it programmatically later using the {\\@link FormGroup}'s\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}\n * methods.\n *\n * **Listen to value**: If you want to listen to changes in the value of the form, you can subscribe\n * to the {\\@link FormGroup}'s {\\@link AbstractControl#valueChanges valueChanges} event. You can also\n * listen to its {\\@link AbstractControl#statusChanges statusChanges} event to be notified when the\n * validation status is re-calculated.\n *\n * Furthermore, you can listen to the directive's `ngSubmit` event to be notified when the user has\n * triggered a form submission. The `ngSubmit` event will be emitted with the original form\n * submission event.\n *\n * ### Example\n *\n * In this example, we create form controls for first name and last name.\n *\n * {\\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormGroupDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroupDirective, _super);\n function FormGroupDirective(_validators, _asyncValidators) {\n var _this = _super.call(this) || this;\n _this._validators = _validators;\n _this._asyncValidators = _asyncValidators;\n _this.submitted = false;\n _this.directives = [];\n _this.form = /** @type {?} */ ((null));\n _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n return _this;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n FormGroupDirective.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._checkFormPresent();\n if (changes.hasOwnProperty('form')) {\n this._updateValidators();\n this._updateDomValue();\n this._updateRegistrations();\n }\n };\n Object.defineProperty(FormGroupDirective.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormGroupDirective.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormGroupDirective.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpControl(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n this.directives.push(dir);\n return ctrl;\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { removeDir(this.directives, dir); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpFormContainer(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpFormContainer(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n FormGroupDirective.prototype.updateModel = /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n function (dir, value) {\n var /** @type {?} */ ctrl = /** @type {?} */ (this.form.get(dir.path));\n ctrl.setValue(value);\n };\n /**\n * @param {?} $event\n * @return {?}\n */\n FormGroupDirective.prototype.onSubmit = /**\n * @param {?} $event\n * @return {?}\n */\n function ($event) {\n (/** @type {?} */ (this)).submitted = true;\n syncPendingControls(this.form, this.directives);\n this.ngSubmit.emit($event);\n return false;\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype.onReset = /**\n * @return {?}\n */\n function () { this.resetForm(); };\n /**\n * @param {?=} value\n * @return {?}\n */\n FormGroupDirective.prototype.resetForm = /**\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n this.form.reset(value);\n (/** @type {?} */ (this)).submitted = false;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroupDirective.prototype._updateDomValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this.directives.forEach(function (dir) {\n var /** @type {?} */ newCtrl = _this.form.get(dir.path);\n if (dir.control !== newCtrl) {\n cleanUpControl(dir.control, dir);\n if (newCtrl)\n setUpControl(newCtrl, dir);\n (/** @type {?} */ (dir)).control = newCtrl;\n }\n });\n this.form._updateTreeValidity({ emitEvent: false });\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._updateRegistrations = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.form._registerOnCollectionChange(function () { return _this._updateDomValue(); });\n if (this._oldForm)\n this._oldForm._registerOnCollectionChange(function () { });\n this._oldForm = this.form;\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._updateValidators = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ sync = composeValidators(this._validators);\n this.form.validator = Validators.compose([/** @type {?} */ ((this.form.validator)), /** @type {?} */ ((sync))]);\n var /** @type {?} */ async = composeAsyncValidators(this._asyncValidators);\n this.form.asyncValidator = Validators.composeAsync([/** @type {?} */ ((this.form.asyncValidator)), /** @type {?} */ ((async))]);\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._checkFormPresent = /**\n * @return {?}\n */\n function () {\n if (!this.form) {\n ReactiveErrors.missingFormException();\n }\n };\n FormGroupDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[formGroup]',\n providers: [formDirectiveProvider$1],\n host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },\n exportAs: 'ngForm'\n },] },\n ];\n /** @nocollapse */\n FormGroupDirective.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormGroupDirective.propDecorators = {\n \"form\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formGroup',] },],\n \"ngSubmit\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"] },],\n };\n return FormGroupDirective;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formGroupNameProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormGroupName; })\n};\n/**\n * \\@whatItDoes Syncs a nested {\\@link FormGroup} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive can only be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the nested {\\@link FormGroup} you want to link, and\n * will look for a {\\@link FormGroup} registered with that name in the parent\n * {\\@link FormGroup} instance you passed into {\\@link FormGroupDirective}.\n *\n * Nested form groups can come in handy when you want to validate a sub-group of a\n * form separately from the rest or when you'd like to group the values of certain\n * controls into their own nested object.\n *\n * **Access the group**: You can access the associated {\\@link FormGroup} using the\n * {\\@link AbstractControl#get get} method. Ex: `this.form.get('name')`.\n *\n * You can also access individual controls within the group using dot syntax.\n * Ex: `this.form.get('name.first')`\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormGroup}. See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set the value**: You can set an initial value for each child control when instantiating\n * the {\\@link FormGroup}, or you can set it programmatically later using\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the group, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * {\\@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormGroupName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroupName, _super);\n function FormGroupName(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroupName.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (_hasInvalidParent(this._parent)) {\n ReactiveErrors.groupParentException();\n }\n };\n FormGroupName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formGroupName]', providers: [formGroupNameProvider] },] },\n ];\n /** @nocollapse */\n FormGroupName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormGroupName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formGroupName',] },],\n };\n return FormGroupName;\n}(AbstractFormGroupDirective));\nvar formArrayNameProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormArrayName; })\n};\n/**\n * \\@whatItDoes Syncs a nested {\\@link FormArray} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive is designed to be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the nested {\\@link FormArray} you want to link, and\n * will look for a {\\@link FormArray} registered with that name in the parent\n * {\\@link FormGroup} instance you passed into {\\@link FormGroupDirective}.\n *\n * Nested form arrays can come in handy when you have a group of form controls but\n * you're not sure how many there will be. Form arrays allow you to create new\n * form controls dynamically.\n *\n * **Access the array**: You can access the associated {\\@link FormArray} using the\n * {\\@link AbstractControl#get get} method on the parent {\\@link FormGroup}.\n * Ex: `this.form.get('cities')`.\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormArray}. See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set the value**: You can set an initial value for each child control when instantiating\n * the {\\@link FormArray}, or you can set the value programmatically later using the\n * {\\@link FormArray}'s {\\@link AbstractControl#setValue setValue} or\n * {\\@link AbstractControl#patchValue patchValue} methods.\n *\n * **Listen to value**: If you want to listen to changes in the value of the array, you can\n * subscribe to the {\\@link FormArray}'s {\\@link AbstractControl#valueChanges valueChanges} event.\n * You can also listen to its {\\@link AbstractControl#statusChanges statusChanges} event to be\n * notified when the validation status is re-calculated.\n *\n * **Add new controls**: You can add new controls to the {\\@link FormArray} dynamically by calling\n * its {\\@link FormArray#push push} method.\n * Ex: `this.form.get('cities').push(new FormControl());`\n *\n * ### Example\n *\n * {\\@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormArrayName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormArrayName, _super);\n function FormArrayName(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /**\n * @return {?}\n */\n FormArrayName.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._checkParentType(); /** @type {?} */\n ((this.formDirective)).addFormArray(this);\n };\n /**\n * @return {?}\n */\n FormArrayName.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeFormArray(this);\n }\n };\n Object.defineProperty(FormArrayName.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((this.formDirective)).getFormArray(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._parent ? /** @type {?} */ (this._parent.formDirective) : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return controlPath(this.name, this._parent); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._validators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._asyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n FormArrayName.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (_hasInvalidParent(this._parent)) {\n ReactiveErrors.arrayParentException();\n }\n };\n FormArrayName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formArrayName]', providers: [formArrayNameProvider] },] },\n ];\n /** @nocollapse */\n FormArrayName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormArrayName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formArrayName',] },],\n };\n return FormArrayName;\n}(ControlContainer));\n/**\n * @param {?} parent\n * @return {?}\n */\nfunction _hasInvalidParent(parent) {\n return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) &&\n !(parent instanceof FormArrayName);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar controlNameBinding = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormControlName; })\n};\n/**\n * \\@whatItDoes Syncs a {\\@link FormControl} in an existing {\\@link FormGroup} to a form control\n * element by name.\n *\n * In other words, this directive ensures that any values written to the {\\@link FormControl}\n * instance programmatically will be written to the DOM element (model -> view). Conversely,\n * any values written to the DOM element through user input will be reflected in the\n * {\\@link FormControl} instance (view -> model).\n *\n * \\@howToUse\n *\n * This directive is designed to be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the {\\@link FormControl} instance you want to\n * link, and will look for a {\\@link FormControl} registered with that name in the\n * closest {\\@link FormGroup} or {\\@link FormArray} above it.\n *\n * **Access the control**: You can access the {\\@link FormControl} associated with\n * this directive by using the {\\@link AbstractControl#get get} method.\n * Ex: `this.form.get('first');`\n *\n * **Get value**: the `value` property is always synced and available on the {\\@link FormControl}.\n * See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set value**: You can set an initial value for the control when instantiating the\n * {\\@link FormControl}, or you can set it programmatically later using\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the control, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * In this example, we create form controls for first name and last name.\n *\n * {\\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}\n *\n * To see `formControlName` examples with different form control types, see:\n *\n * * Radio buttons: {\\@link RadioControlValueAccessor}\n * * Selects: {\\@link SelectControlValueAccessor}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormControlName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControlName, _super);\n function FormControlName(parent, validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this._added = false;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._parent = parent;\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n Object.defineProperty(FormControlName.prototype, \"isDisabled\", {\n set: /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlName.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if (!this._added)\n this._setUpControl();\n if (isPropertyUpdated(changes, this.viewModel)) {\n this.viewModel = this.model;\n this.formDirective.updateModel(this, this.model);\n }\n };\n /**\n * @return {?}\n */\n FormControlName.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeControl(this);\n }\n };\n /**\n * @param {?} newValue\n * @return {?}\n */\n FormControlName.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n Object.defineProperty(FormControlName.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return controlPath(this.name, /** @type {?} */ ((this._parent))); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return /** @type {?} */ ((composeAsyncValidators(this._rawAsyncValidators)));\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n FormControlName.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof FormGroupName) &&\n this._parent instanceof AbstractFormGroupDirective) {\n ReactiveErrors.ngModelGroupException();\n }\n else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) &&\n !(this._parent instanceof FormArrayName)) {\n ReactiveErrors.controlParentException();\n }\n };\n /**\n * @return {?}\n */\n FormControlName.prototype._setUpControl = /**\n * @return {?}\n */\n function () {\n this._checkParentType();\n (/** @type {?} */ (this)).control = this.formDirective.addControl(this);\n if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {\n /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);\n }\n this._added = true;\n };\n FormControlName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControlName]', providers: [controlNameBinding] },] },\n ];\n /** @nocollapse */\n FormControlName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n FormControlName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formControlName',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return FormControlName;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An interface that can be implemented by classes that can act as validators.\n *\n * ## Usage\n *\n * ```typescript\n * \\@Directive({\n * selector: '[custom-validator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(c: Control): {[key: string]: any} {\n * return {\"custom\": true};\n * }\n * }\n * ```\n *\n * \\@stable\n * @record\n */\n\n/**\n * \\@experimental\n * @record\n */\n\nvar REQUIRED_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RequiredValidator; }),\n multi: true\n};\nvar CHECKBOX_REQUIRED_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return CheckboxRequiredValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `required` validator to any controls marked with the\n * `required` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input name=\"fullName\" ngModel required>\n * ```\n *\n * \\@stable\n */\nvar RequiredValidator = /** @class */ (function () {\n function RequiredValidator() {\n }\n Object.defineProperty(RequiredValidator.prototype, \"required\", {\n get: /**\n * @return {?}\n */\n function () { return this._required; },\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._required = value != null && value !== false && \"\" + value !== 'false';\n if (this._onChange)\n this._onChange();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} c\n * @return {?}\n */\n RequiredValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.required ? Validators.required(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RequiredValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n RequiredValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',\n providers: [REQUIRED_VALIDATOR],\n host: { '[attr.required]': 'required ? \"\" : null' }\n },] },\n ];\n /** @nocollapse */\n RequiredValidator.ctorParameters = function () { return []; };\n RequiredValidator.propDecorators = {\n \"required\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RequiredValidator;\n}());\n/**\n * A Directive that adds the `required` validator to checkbox controls marked with the\n * `required` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input type=\"checkbox\" name=\"active\" ngModel required>\n * ```\n *\n * \\@experimental\n */\nvar CheckboxRequiredValidator = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(CheckboxRequiredValidator, _super);\n function CheckboxRequiredValidator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} c\n * @return {?}\n */\n CheckboxRequiredValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.required ? Validators.requiredTrue(c) : null;\n };\n CheckboxRequiredValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',\n providers: [CHECKBOX_REQUIRED_VALIDATOR],\n host: { '[attr.required]': 'required ? \"\" : null' }\n },] },\n ];\n /** @nocollapse */\n CheckboxRequiredValidator.ctorParameters = function () { return []; };\n return CheckboxRequiredValidator;\n}(RequiredValidator));\n/**\n * Provider which adds {\\@link EmailValidator} to {\\@link NG_VALIDATORS}.\n */\nvar EMAIL_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return EmailValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `email` validator to controls marked with the\n * `email` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input type=\"email\" name=\"email\" ngModel email>\n * <input type=\"email\" name=\"email\" ngModel email=\"true\">\n * <input type=\"email\" name=\"email\" ngModel [email]=\"true\">\n * ```\n *\n * \\@experimental\n */\nvar EmailValidator = /** @class */ (function () {\n function EmailValidator() {\n }\n Object.defineProperty(EmailValidator.prototype, \"email\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._enabled = value === '' || value === true || value === 'true';\n if (this._onChange)\n this._onChange();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} c\n * @return {?}\n */\n EmailValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this._enabled ? Validators.email(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n EmailValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n EmailValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[email][formControlName],[email][formControl],[email][ngModel]',\n providers: [EMAIL_VALIDATOR]\n },] },\n ];\n /** @nocollapse */\n EmailValidator.ctorParameters = function () { return []; };\n EmailValidator.propDecorators = {\n \"email\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return EmailValidator;\n}());\n/**\n * \\@stable\n * @record\n */\n\n/**\n * \\@stable\n * @record\n */\n\n/**\n * Provider which adds {\\@link MinLengthValidator} to {\\@link NG_VALIDATORS}.\n *\n * ## Example:\n *\n * {\\@example common/forms/ts/validators/validators.ts region='min'}\n */\nvar MIN_LENGTH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return MinLengthValidator; }),\n multi: true\n};\n/**\n * A directive which installs the {\\@link MinLengthValidator} for any `formControlName`,\n * `formControl`, or control with `ngModel` that also has a `minlength` attribute.\n *\n * \\@stable\n */\nvar MinLengthValidator = /** @class */ (function () {\n function MinLengthValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n MinLengthValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('minlength' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n MinLengthValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.minlength == null ? null : this._validator(c);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n MinLengthValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n MinLengthValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () {\n this._validator = Validators.minLength(parseInt(this.minlength, 10));\n };\n MinLengthValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',\n providers: [MIN_LENGTH_VALIDATOR],\n host: { '[attr.minlength]': 'minlength ? minlength : null' }\n },] },\n ];\n /** @nocollapse */\n MinLengthValidator.ctorParameters = function () { return []; };\n MinLengthValidator.propDecorators = {\n \"minlength\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return MinLengthValidator;\n}());\n/**\n * Provider which adds {\\@link MaxLengthValidator} to {\\@link NG_VALIDATORS}.\n *\n * ## Example:\n *\n * {\\@example common/forms/ts/validators/validators.ts region='max'}\n */\nvar MAX_LENGTH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return MaxLengthValidator; }),\n multi: true\n};\n/**\n * A directive which installs the {\\@link MaxLengthValidator} for any `formControlName,\n * `formControl`,\n * or control with `ngModel` that also has a `maxlength` attribute.\n *\n * \\@stable\n */\nvar MaxLengthValidator = /** @class */ (function () {\n function MaxLengthValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n MaxLengthValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('maxlength' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n MaxLengthValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.maxlength != null ? this._validator(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n MaxLengthValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n MaxLengthValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () {\n this._validator = Validators.maxLength(parseInt(this.maxlength, 10));\n };\n MaxLengthValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',\n providers: [MAX_LENGTH_VALIDATOR],\n host: { '[attr.maxlength]': 'maxlength ? maxlength : null' }\n },] },\n ];\n /** @nocollapse */\n MaxLengthValidator.ctorParameters = function () { return []; };\n MaxLengthValidator.propDecorators = {\n \"maxlength\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return MaxLengthValidator;\n}());\nvar PATTERN_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return PatternValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `pattern` validator to any controls marked with the\n * `pattern` attribute, via the {\\@link NG_VALIDATORS} binding. Uses attribute value\n * as the regex to validate Control value against. Follows pattern attribute\n * semantics; i.e. regex must match entire Control value.\n *\n * ### Example\n *\n * ```\n * <input [name]=\"fullName\" pattern=\"[a-zA-Z ]*\" ngModel>\n * ```\n * \\@stable\n */\nvar PatternValidator = /** @class */ (function () {\n function PatternValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n PatternValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('pattern' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n PatternValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) { return this._validator(c); };\n /**\n * @param {?} fn\n * @return {?}\n */\n PatternValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n PatternValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () { this._validator = Validators.pattern(this.pattern); };\n PatternValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',\n providers: [PATTERN_VALIDATOR],\n host: { '[attr.pattern]': 'pattern ? pattern : null' }\n },] },\n ];\n /** @nocollapse */\n PatternValidator.ctorParameters = function () { return []; };\n PatternValidator.propDecorators = {\n \"pattern\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return PatternValidator;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Creates an {\\@link AbstractControl} from a user-specified configuration.\n *\n * It is essentially syntactic sugar that shortens the `new FormGroup()`,\n * `new FormControl()`, and `new FormArray()` boilerplate that can build up in larger\n * forms.\n *\n * \\@howToUse\n *\n * To use, inject `FormBuilder` into your component class. You can then call its methods\n * directly.\n *\n * {\\@example forms/ts/formBuilder/form_builder_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormBuilder = /** @class */ (function () {\n function FormBuilder() {\n }\n /**\n * Construct a new {@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {@link FormGroup} constructor for more details.\n */\n /**\n * Construct a new {\\@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {\\@link FormGroup} constructor for more details.\n * @param {?} controlsConfig\n * @param {?=} extra\n * @return {?}\n */\n FormBuilder.prototype.group = /**\n * Construct a new {\\@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {\\@link FormGroup} constructor for more details.\n * @param {?} controlsConfig\n * @param {?=} extra\n * @return {?}\n */\n function (controlsConfig, extra) {\n if (extra === void 0) { extra = null; }\n var /** @type {?} */ controls = this._reduceControls(controlsConfig);\n var /** @type {?} */ validator = extra != null ? extra['validator'] : null;\n var /** @type {?} */ asyncValidator = extra != null ? extra['asyncValidator'] : null;\n return new FormGroup(controls, validator, asyncValidator);\n };\n /**\n * Construct a new {@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n */\n /**\n * Construct a new {\\@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n * @param {?} formState\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n FormBuilder.prototype.control = /**\n * Construct a new {\\@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n * @param {?} formState\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n function (formState, validator, asyncValidator) {\n return new FormControl(formState, validator, asyncValidator);\n };\n /**\n * Construct a {@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n */\n /**\n * Construct a {\\@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n * @param {?} controlsConfig\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n FormBuilder.prototype.array = /**\n * Construct a {\\@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n * @param {?} controlsConfig\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n function (controlsConfig, validator, asyncValidator) {\n var _this = this;\n var /** @type {?} */ controls = controlsConfig.map(function (c) { return _this._createControl(c); });\n return new FormArray(controls, validator, asyncValidator);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} controlsConfig\n * @return {?}\n */\n FormBuilder.prototype._reduceControls = /**\n * \\@internal\n * @param {?} controlsConfig\n * @return {?}\n */\n function (controlsConfig) {\n var _this = this;\n var /** @type {?} */ controls = {};\n Object.keys(controlsConfig).forEach(function (controlName) {\n controls[controlName] = _this._createControl(controlsConfig[controlName]);\n });\n return controls;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} controlConfig\n * @return {?}\n */\n FormBuilder.prototype._createControl = /**\n * \\@internal\n * @param {?} controlConfig\n * @return {?}\n */\n function (controlConfig) {\n if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup ||\n controlConfig instanceof FormArray) {\n return controlConfig;\n }\n else if (Array.isArray(controlConfig)) {\n var /** @type {?} */ value = controlConfig[0];\n var /** @type {?} */ validator = controlConfig.length > 1 ? controlConfig[1] : null;\n var /** @type {?} */ asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null;\n return this.control(value, validator, asyncValidator);\n }\n else {\n return this.control(controlConfig);\n }\n };\n FormBuilder.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n FormBuilder.ctorParameters = function () { return []; };\n return FormBuilder;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Adds `novalidate` attribute to all forms by default.\n *\n * `novalidate` is used to disable browser's native form validation.\n *\n * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:\n *\n * ```\n * <form ngNativeValidate></form>\n * ```\n *\n * \\@experimental\n */\nvar NgNoValidate = /** @class */ (function () {\n function NgNoValidate() {\n }\n NgNoValidate.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'form:not([ngNoForm]):not([ngNativeValidate])',\n host: { 'novalidate': '' },\n },] },\n ];\n /** @nocollapse */\n NgNoValidate.ctorParameters = function () { return []; };\n return NgNoValidate;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SHARED_FORM_DIRECTIVES = [\n NgNoValidate,\n NgSelectOption,\n NgSelectMultipleOption,\n DefaultValueAccessor,\n NumberValueAccessor,\n RangeValueAccessor,\n CheckboxControlValueAccessor,\n SelectControlValueAccessor,\n SelectMultipleControlValueAccessor,\n RadioControlValueAccessor,\n NgControlStatus,\n NgControlStatusGroup,\n RequiredValidator,\n MinLengthValidator,\n MaxLengthValidator,\n PatternValidator,\n CheckboxRequiredValidator,\n EmailValidator,\n];\nvar TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];\nvar REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];\n/**\n * Internal module used for sharing directives between FormsModule and ReactiveFormsModule\n */\nvar InternalFormsSharedModule = /** @class */ (function () {\n function InternalFormsSharedModule() {\n }\n InternalFormsSharedModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: SHARED_FORM_DIRECTIVES,\n exports: SHARED_FORM_DIRECTIVES,\n },] },\n ];\n /** @nocollapse */\n InternalFormsSharedModule.ctorParameters = function () { return []; };\n return InternalFormsSharedModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * The ng module for forms.\n * \\@stable\n */\nvar FormsModule = /** @class */ (function () {\n function FormsModule() {\n }\n FormsModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: TEMPLATE_DRIVEN_DIRECTIVES,\n providers: [RadioControlRegistry],\n exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]\n },] },\n ];\n /** @nocollapse */\n FormsModule.ctorParameters = function () { return []; };\n return FormsModule;\n}());\n/**\n * The ng module for reactive forms.\n * \\@stable\n */\nvar ReactiveFormsModule = /** @class */ (function () {\n function ReactiveFormsModule() {\n }\n ReactiveFormsModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: [REACTIVE_DRIVEN_DIRECTIVES],\n providers: [FormBuilder, RadioControlRegistry],\n exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]\n },] },\n ];\n /** @nocollapse */\n ReactiveFormsModule.ctorParameters = function () { return []; };\n return ReactiveFormsModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=forms.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjoz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YmxlZCBjb250cm9scyBhcmUgZXhlbXB0IGZyb20gdmFsaWRhdGlvbiBjaGVja3MgYW5kXG4gICAgICAgICAqIGFyZSBub3QgaW5jbHVkZWQgaW4gdGhlIGFnZ3JlZ2F0ZSB2YWx1ZSBvZiB0aGVpciBhbmNlc3RvclxuICAgICAgICAgKiBjb250cm9scy5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC5kaXNhYmxlZCA6IG51bGw7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2xEaXJlY3RpdmUucHJvdG90eXBlLCBcImVuYWJsZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBlbmFibGVkYCBhcyBsb25nIGFzIGl0cyBgc3RhdHVzICE9PSBESVNBQkxFRGAuXG4gICAgICAgICAqXG4gICAgICAgICAqIEluIG90aGVyIHdvcmRzLCBpdCBoYXMgYSBzdGF0dXMgb2YgYFZBTElEYCwgYElOVkFMSURgLCBvclxuICAgICAgICAgKiBgUEVORElOR2AuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBBIGNvbnRyb2wgaXMgYGVuYWJsZWRgIGFzIGxvbmcgYXMgaXRzIGBzdGF0dXMgIT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogSW4gb3RoZXIgd29yZHMsIGl0IGhhcyBhIHN0YXR1cyBvZiBgVkFMSURgLCBgSU5WQUxJRGAsIG9yXG4gICAgICAgICAqIGBQRU5ESU5HYC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1b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ogbWFyayBpdCBkaXJ0eS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlydHlgIGlmIHRoZSB1c2VyIGhhcyBjaGFuZ2VkIHRoZSB2YWx1ZVxuICAgICAgICAgKiBpbiB0aGUgVUkuXG4gICAgICAgICAqXG4gICAgICAgICAqIE5vdGUgdGhhdCBwcm9ncmFtbWF0aWMgY2hhbmdlcyB0byBhIGNvbnRyb2wncyB2YWx1ZSB3aWxsXG4gICAgICAgICAqICpub3QqIG1hcmsgaXQgZGlydHkuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLmNvbnRyb2wgPyB0aGlzLmNvbnRyb2wuZGlydHkgOiBudWxsOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RDb250cm9sRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ0b3VjaGVkXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBtYXJrZWQgYHRvdWNoZWRgIG9uY2UgdGhlIHVzZXIgaGFzIHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBtYXJrZWQgYHRvdWNoZWRgIG9uY2UgdGhlIHVzZXIgaGFzIHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC50b3VjaGVkIDogbnVsbDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbERpcmVjdGl2ZS5wcm90b3R5cGUsIFwic3RhdHVzXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC5zdGF0dXMgOiBudWxsOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RDb250cm9sRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ1bnRvdWNoZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGB1bnRvdWNoZWRgIGlmIHRoZSB1c2VyIGhhcyBub3QgeWV0IHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgdW50b3VjaGVkYCBpZiB0aGUgdXNlciBoYXMgbm90IHlldCB0cmlnZ2VyZWRcbiAgICAgICAgICogYSBgYmx1cmAgZXZlbnQgb24gaXQuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLmNvbnRyb2wgPyB0aGlzLmNvbnRyb2wudW50b3VjaGVkIDogbnVsbDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYm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5IHRpbWUgdGhlIHZhbHVlIG9mIHRoZSBjb250cm9sIGNoYW5nZXMsIGluXG4gICAgICAgICAqIHRoZSBVSSBvciBwcm9ncmFtbWF0aWNhbGx5LlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC52YWx1ZUNoYW5nZXMgOiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RDb250cm9sRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJwYXRoXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJldHVybnMgYW4gYXJyYXkgdGhhdCByZXByZXNlbnRzIHRoZSBwYXRoIGZyb20gdGhlIHRvcC1sZXZlbCBmb3JtXG4gICAgICAgICAqIHRvIHRoaXMgY29udHJvbC4gRWFjaCBpbmRleCBpcyB0aGUgc3RyaW5nIG5hbWUgb2YgdGhlIGNvbnRyb2wgb25cbiAgICAgICAgICogdGhhdCBsZXZlbC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIFJldHVybnMgYW4gYXJyYXkgdGhhdCByZXByZXNlbnRzIHRoZSBwYXRoIGZyb20gdGhlIHRvcC1sZXZlbCBmb3JtXG4gICAgICAgICAqIHRvIHRoaXMgY29udHJvbC4gRWFjaCBpbmRleCBpcyB0aGUgc3RyaW5nIG5hbWUgb2YgdGhlIGNvbnRyb2wgb25cbiAgICAgICAgICogdGhhdCBsZXZlbC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIG51bGw7IH0sXG4gICAgICA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cmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29udHJvbCkge1xuICAgICAgICByZXR1cm4gRU1BSUxfUkVHRVhQLnRlc3QoY29udHJvbC52YWx1ZSkgPyBudWxsIDogeyAnZW1haWwnOiB0cnVlIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1pbkxlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5taW5MZW5ndGggPSAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1pbkxlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG1pbkxlbmd0aCkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvbnRyb2wpIHtcbiAgICAgICAgICAgIGlmIChpc0VtcHR5SW5wdXRWYWx1ZShjb250cm9sLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudWxsOyAvLyBkb24ndCB2YWxpZGF0ZSBlbXB0eSB2YWx1ZXMgdG8gYWxsb3cgb3B0aW9uYWwgY29udHJvbHNcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxlbmd0aCA9IGNvbnRyb2wudmFsdWUgPyBjb250cm9sLnZhbHVlLmxlbmd0aCA6IDA7XG4gICAgICAgICAgICByZXR1cm4gbGVuZ3RoIDwgbWluTGVuZ3RoID9cbiAgICAgICAgICAgICAgICB7ICdtaW5sZW5ndGgnOiB7ICdyZXF1aXJlZExlbmd0aCc6IG1pbkxlbmd0aCwgJ2FjdHVhbExlbmd0aCc6IGxlbmd0aCB9IH0gOlxuICAgICAgICAgICAgICAgIG51bGw7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1heExlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5tYXhMZW5ndGggPSAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1heExlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG1heExlbmd0aCkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvbnRyb2wpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxlbmd0aCA9IGNvbnRyb2wudmFsdWUgPyBjb250cm9sLnZhbHVlLmxlbmd0aCA6IDA7XG4gICAgICAgICAgICByZXR1cm4gbGVuZ3RoID4gbWF4TGVuZ3RoID9cbiAgICAgICAgICAgICAgICB7ICdtYXhsZW5ndGgnOiB7ICdyZXF1aXJlZExlbmd0aCc6IG1heExlbmd0aCwgJ2FjdHVhbExlbmd0aCc6IGxlbmd0aCB9IH0gOlxuICAgICAgICAgICAgICAgIG51bGw7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBhIGNvbnRyb2wgdG8gbWF0Y2ggYSByZWdleCB0byBpdHMgdmFsdWUuXG4gICAgICovXG4gICAgLyoqXG4gICAgICogVmFsaWRhdG9yIHRoYXQgcmVxdWlyZXMgYSBjb250cm9sIHRvIG1hdGNoIGEgcmVnZXggdG8gaXRzIHZhbHVlLlxuICAgICAqIEBwYXJhbSB7P30gcGF0dGVyblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5wYXR0ZXJuID0gLyoqXG4gICAgICogVmFsaWRhdG9yIHRoYXQgcmVxdWlyZXMgYSBjb250cm9sIHRvIG1hdGNoIGEgcmVnZXggdG8gaXRzIHZhbHVlLlxuICAgICAqIEBwYXJhbSB7P30gcGF0dGVyblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhdHRlcm4pIHtcbiAgICAgICAgaWYgKCFwYXR0ZXJuKVxuICAgICAgICAgICAgcmV0dXJuIFZhbGlkYXRvcnMubnVsbFZhbGlkYXRvcjtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVnZXg7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlZ2V4U3RyO1xuICAgICAgICBpZiAodHlwZW9mIHBhdHRlcm4gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICByZWdleFN0ciA9ICcnO1xuICAgICAgICAgICAgaWYgKHBhdHRlcm4uY2hhckF0KDApICE9PSAnXicpXG4gICAgICAgICAgICAgICAgcmVnZXhTdHIgKz0gJ14nO1xuICAgICAgICAgICAgcmVnZXhTdHIgKz0gcGF0dGVybjtcbiAgICAgICAgICAgIGlmIChwYXR0ZXJuLmNoYXJBdChwYXR0ZXJuLmxlbmd0aCAtIDEpICE9PSAnJCcpXG4gICAgICAgICAgICAgICAgcmVnZXhTdHIgKz0gJyQnO1xuICAgICAgICAgICAgcmVnZXggPSBuZXcgUmVnRXhwKHJlZ2V4U3RyKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJlZ2V4U3RyID0gcGF0dGVybi50b1N0cmluZygpO1xuICAgICAgICAgICAgcmVnZXggPSBwYXR0ZXJuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoY29udHJvbCkge1xuICAgICAgICAgICAgaWYgKGlzRW1wdHlJbnB1dFZhbHVlKGNvbnRyb2wudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7IC8vIGRvbid0IHZhbGlkYXRlIGVtcHR5IHZhbHVlcyB0byBhbGxvdyBvcHRpb25hbCBjb250cm9sc1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWUgPSBjb250cm9sLnZhbHVlO1xuICAgICAgICAgICAgcmV0dXJuIHJlZ2V4LnRlc3QodmFsdWUpID8gbnVsbCA6XG4gICAgICAgICAgICAgICAgeyAncGF0dGVybic6IHsgJ3JlcXVpcmVkUGF0dGVybic6IHJlZ2V4U3RyLCAnYWN0dWFsVmFsdWUnOiB2YWx1ZSB9IH07XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBOby1vcCB2YWxpZGF0b3IuXG4gICAgICovXG4gICAgLyoqXG4gICAgICogTm8tb3AgdmFsaWRhdG9yLlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5udWxsVmFsaWRhdG9yID0gLyoqXG4gICAgICogTm8tb3AgdmFsaWRhdG9yLlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGMpIHsgcmV0dXJuIG51bGw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWxpZGF0b3JzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBWYWxpZGF0b3JzLmNvbXBvc2UgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHZhbGlkYXRvcnNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2YWxpZGF0b3JzKSB7XG4gICAgICAgIGlmICghdmFsaWRhdG9ycylcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwcmVzZW50VmFsaWRhdG9ycyA9IC8qKiBAdHlwZSB7P30gKi8gKHZhbGlkYXRvcnMuZmlsdGVyKGlzUHJlc2VudCkpO1xuICAgICAgICBpZiAocHJlc2VudFZhbGlkYXRvcnMubGVuZ3RoID09IDApXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChjb250cm9sKSB7XG4gICAgICAgICAgICByZXR1cm4gX21lcmdlRXJyb3JzKF9leGVjdXRlVmFsaWRhdG9ycyhjb250cm9sLCBwcmVzZW50VmFsaWRhdG9ycykpO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWxpZGF0b3JzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBWYWxpZGF0b3JzLmNvbXBvc2VBc3luYyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdmFsaWRhdG9yc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbGlkYXRvcnMpIHtcbiAgICAgICAgaWYgKCF2YWxpZGF0b3JzKVxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAg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dGVuZC5cbiAqIEl0IGJpbmRzIGEge1xcQGxpbmsgRm9ybUNvbnRyb2x9IG9iamVjdCB0byBhIERPTSBlbGVtZW50LlxuICpcbiAqIFVzZWQgaW50ZXJuYWxseSBieSBBbmd1bGFyIGZvcm1zLlxuICpcbiAqIFxcQHN0YWJsZVxuICogQGFic3RyYWN0XG4gKi9cbnZhciBOZ0NvbnRyb2wgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgX19leHRlbmRzKE5nQ29udHJvbCwgX3N1cGVyKTtcbiAgICBmdW5jdGlvbiBOZ0NvbnRyb2woKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlciAhPT0gbnVsbCAmJiBfc3VwZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKSB8fCB0aGlzO1xuICAgICAgICAvKipcbiAgICAgICAgICogXFxAaW50ZXJuYWxcbiAgICAgICAgICovXG4gICAgICAgIF90aGlzLl9wYXJlbnQgPSBudWxsO1xuICAgICAgICBfdGhpcy5uYW1lID0gbnVsbDtcbiAgICAgICAgX3RoaXMudmFsdWVBY2Nlc3NvciA9IG51bGw7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAgICAgKi9cbiAgICAgICAgX3RoaXMuX3Jhd1ZhbGlkYXRvcnMgPSBbXTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFxcQGludGVybmFsXG4gICAgICAgICAqL1xuICAgICAgICBfdGhpcy5fcmF3QXN5bmNWYWxpZGF0b3JzID0gW107XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KE5nQ29udHJvbC5wcm90b3R5cGUsIFwidmFsaWRhdG9yXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIC8q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gLyoqIEB0eXBlIHs/fSAqLyBpID0gdGhpcy5fYWNjZXNzb3JzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5fYWNjZXNzb3JzW2ldWzFdID09PSBhY2Nlc3Nvcikge1xuICAgICAgICAgICAgICAgIHRoaXMuX2FjY2Vzc29ycy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGFjY2Vzc29yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSYWRpb0NvbnRyb2xSZWdpc3RyeS5wcm90b3R5cGUuc2VsZWN0ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBhY2Nlc3NvclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGFjY2Vzc29yKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMuX2FjY2Vzc29ycy5mb3JFYWNoKGZ1bmN0aW9uIChjKSB7XG4gICAgICAgICAgICBpZiAoX3RoaXMuX2lzU2FtZUdyb3VwKGMsIGFjY2Vzc29yKSAmJiBjWzFdICE9PSBhY2Nlc3Nvcikge1xuICAgICAgICAgICAgICAgIGNbMV0uZmlyZVVuY2hlY2soYWNjZXNzb3IudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFBhaXJcbiAgICAgKiBAcGFyYW0gez99IGFjY2Vzc29yXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSYWRpb0NvbnRyb2xSZWdpc3RyeS5wcm90b3R5cGUuX2lzU2FtZUdyb3VwID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sUGFpclxuIC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Bhbmd1bGFyL2Zvcm1zYFxuICpcbiAqIFxcQHN0YWJsZVxuICovXG52YXIgU2VsZWN0Q29udHJvbFZhbHVlQWNjZXNzb3IgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gU2VsZWN0Q29udHJvbFZhbHVlQWNjZXNzb3IoX3JlbmRlcmVyLCBfZWxlbWVudFJlZikge1xuICAgICAgICB0aGlzLl9yZW5kZXJlciA9IF9yZW5kZXJlcjtcbiAgICAgICAgdGhpcy5fZWxlbWVudFJlZiA9IF9lbGVtZW50UmVmO1xuICAgICAgICAvKipcbiAgICAgICAgICogXFxAaW50ZXJuYWxcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuX29wdGlvbk1hcCA9IG5ldyBNYXAoKTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFxcQGludGVybmFsXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLl9pZENvdW50ZXIgPSAwO1xuICAgICAgICB0aGlzLm9uQ2hhbmdlID0gZnVuY3Rpb24gKF8pIHsgfTtcbiAgICAgICAgdGhpcy5vblRvdWNoZWQgPSBmdW5jdGlvbiAoKSB7IH07XG4gICAgICAgIHRoaXMuX2NvbXBhcmVXaXRoID0gybVsb29zZUlkZW50aWNhbDtcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNlbGVjdENvbnRyb2xWYWx1ZUFjY2Vzc29yLnByb3RvdHlwZSwgXCJjb21wYXJlV2l0aFwiLCB7XG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gZm5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChmbikge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmbiAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImNvbXBhcmVXaXRoIG11c3QgYmUgYSBmd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sICdkaXNhYmxlZCcsIGlzRGlzYWJsZWQpO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTZWxlY3RDb250cm9sVmFsdWVBY2Nlc3Nvci5wcm90b3R5cGUuX3JlZ2lzdGVyT3B0aW9uID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuICh0aGlzLl9pZENvdW50ZXIrKykudG9TdHJpbmcoKTsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTZWxlY3RDb250cm9sVmFsdWVBY2Nlc3Nvci5wcm90b3R5cGUuX2dldE9wdGlvbklkID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgZm9yICh2YXIgX2kgPSAwLCBfYSA9IEFycmF5LmZyb20odGhpcy5fb3B0aW9uTWFwLmtleXMoKSk7IF9pIDwgX2EubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICB2YXIgaWQgPSBfYVtfaV07XG4gICAgICAgICAgICBpZiAodGhpcy5fY29tcGFyZVdpdGgodGhpcy5fb3B0aW9uTWFwLmdldChpZCksIHZhbHVlKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gaWQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50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lvbigpO1xuICAgIH1cbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoTmdTZWxlY3RPcHRpb24ucHJvdG90eXBlLCBcIm5nVmFsdWVcIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl9zZWxlY3QgPT0gbnVsbClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB0aGlzLl9zZWxlY3QuX29wdGlvbk1hcC5zZXQodGhpcy5pZCwgdmFsdWUpO1xuICAgICAgICAgICAgdGhpcy5fc2V0RWxlbWVudFZhbHVlKF9idWlsZFZhbHVlU3RyaW5nKHRoaXMuaWQsIHZhbHVlKSk7XG4gICAgICAgICAgICB0aGlzLl9zZWxlY3Qud3JpdGVWYWx1ZSh0aGlzLl9zZWxlY3QudmFsdWUpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoTmdTZWxlY3RPcHRpb24ucHJvdG90eXBlLCBcInZhbHVlXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9zZXRFbGVtZW50VmFsdWUodmFsdWUpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX3NlbGVjdClcbiAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3Qud3JpdGVWYWx1ZSh0aGlzLl9zZWxlY3QudmFsdWUpO1xuICAgICAgICB9LFxuICAg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IgLyoqIEB0eXBlIHs/fSAqLyBvcHQgPSBvcHRpb25zLml0ZW0oaSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbCA9IF90aGlzLl9nZXRPcHRpb25WYWx1ZShvcHQudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZC5wdXNoKHZhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0aW9ucyA9IC8qKiBAdHlwZSB7P30gKi8gKF8ub3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IG9wdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0ID0gb3B0aW9ucy5pdGVtKGkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0LnNlbGVjdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2YWwgPSBfdGhpcy5fZ2V0T3B0aW9uVmFsdWUob3B0LnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkLnB1c2godmFsKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF90aGlzLnZhbHVlID0gc2VsZWN0ZWQ7XG4gICAgICAgICAgICBmbihzZWxlY3RlZCk7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTZWxlY3RNdWx0aXBsZUNvbnRyb2xWYWx1ZUFjY2Vzc29yLnByb3RvdHl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ICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zZXRFbGVtZW50VmFsdWUodmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE11bHRpcGxlT3B0aW9uLnByb3RvdHlwZS5fc2V0RWxlbWVudFZhbHVlID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgdGhpcy5fcmVuZGVyZXIuc2V0UHJvcGVydHkodGhpcy5fZWxlbWVudC5uYXRpdmVFbGVtZW50LCAndmFsdWUnLCB2YWx1ZSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHNlbGVjdGVkXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE11bHRpcGxlT3B0aW9uLnByb3RvdHlwZS5fc2V0U2VsZWN0ZWQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gc2VsZWN0ZWRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzZWxlY3RlZCkge1xuICAgICAgICB0aGlzLl9yZW5kZXJlci5zZXRQcm9wZXJ0eSh0aGlzLl9lbGVtZW50Lm5hdGl2ZUVsZW1lbnQsICdzZWxlY3RlZ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ZlRm9ybUdyb3VwKHRoaXMpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RGb3JtR3JvdXBEaXJlY3RpdmUucHJvdG90eXBlLCBcImNvbnRyb2xcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogR2V0IHRoZSB7QGxpbmsgRm9ybUdyb3VwfSBiYWNraW5nIHRoaXMgYmluZGluZy5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEdldCB0aGUge1xcQGxpbmsgRm9ybUdyb3VwfSBiYWNraW5nIHRoaXMgYmluZGluZy5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIC8qKiBAdHlwZSB7P30gKi8gKCh0aGlzLmZvcm1EaXJlY3RpdmUpKS5nZXRGb3JtR3JvdXAodGhpcyk7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdEZvcm1Hcm91cERpcmVjdGl2ZS5wcm90b3R5cGUsIFwicGF0aFwiLCB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBHZXQgdGhlIHBhdGggdG8gdGhpcyBjb250cm9sIGdyb3VwLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogR2V0IHRoZSBwYXRoIHRvIHRoaXMgY29udHJvbCBncm91cC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIGNvbnRyb2xQYXRoKHRoaXMubmFtZSwgdGhpcy5fcGFyZW50KTsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndX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ZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInBhcmVudFwiLCB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBUaGUgcGFyZW50IGNvbnRyb2wuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBUaGUgcGFyZW50IGNvbnRyb2wuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLl9wYXJlbnQ7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInZhbGlkXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgdmFsaWRgIHdoZW4gaXRzIGBzdGF0dXMgPT09IFZBTElEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogSW4gb3JkZXIgdG8gaGF2ZSB0aGlzIHN0YXR1cywgdGhlIGNvbnRyb2wgbXVzdCBoYXZlIHBhc3NlZCBhbGwgaXRzXG4gICAgICAgICAqIHZhbGlkYXRpb24gY2hlY2tzLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGB2YWxpZGAgd2hlbiBpdHMgYHN0YXR1cyA9PT0gVkFMSURgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBJbiBvcmRlciB0byBoYXZlIHRoaXMgc3RhdHVzLCB0aGUgY29udHJvbCBtdXN0IGhhdmUgcGFzc2VkIGFsbCBpdHNcbiAgICAgICAgICogdmFsaWRhdGlvbiBjaGVja3MuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAo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5kXG4gICAgICAgICAqIGFyZSBub3QgaW5jbHVkZWQgaW4gdGhlIGFnZ3JlZ2F0ZSB2YWx1ZSBvZiB0aGVpciBhbmNlc3RvclxuICAgICAgICAgKiBjb250cm9scy5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlzYWJsZWRgIHdoZW4gaXRzIGBzdGF0dXMgPT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogRGlzYWJsZWQgY29udHJvbHMgYXJlIGV4ZW1wdCBmcm9tIHZhbGlkYXRpb24gY2hlY2tzIGFuZFxuICAgICAgICAgKiBhcmUgbm90IGluY2x1ZGVkIGluIHRoZSBhZ2dyZWdhdGUgdmFsdWUgb2YgdGhlaXIgYW5jZXN0b3JcbiAgICAgICAgICogY29udHJvbHMuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLnN0YXR1cyA9PT0gRElTQUJMRUQ7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcImVuYWJsZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBlbmFibGVkYCBhcyBsb25nIGFzIGl0cyBgc3RhdHVzICE9PSBESVNBQkxFRGAuXG4gICAgICAgICAqXG4gICAgICAgICAqIEluIG90aGVyIHdvcmRzLCBpdCBoYXMgYSBzdGF0dXMgb2YgYFZBTElEYCwgYElOVkFMSURgLCBvclxuICAgICAgICAgKiBgUEVORElOR2AuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBBIGNvbnRyb2wgaXMgYGVuYWJsZWRgIGFzIGxvbmcgYXMgaXRzIGBzdGF0dXMgIT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogSW4gb3RoZXIgd29yZHMsIGl0IGhhcyBhIHN0YXR1cyBvZiBgVkFMSURgLCBgSU5WQUxJRGAsIG9yXG4gICAgICAgICAqIGBQRU5ESU5HYC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuc3RhdHVzICE9PSBESVNBQkxFRDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUsIFwiZGlydHlcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBkaXJ0eWAgaWYgdGhlIHVzZXIgaGFzIGNoYW5nZWQgdGhlIHZhbHVlXG4gICAgICAgICAqIGluIHRoZSBVSS5cbiAgICAgICAgICpcbiAgICAgICAgICogTm90ZSB0aGF0IHByb2dyYW1tYXRpYyBjaGFuZ2VzIHRvIGEgY29udHJvbCdzIHZhbHVlIHdpbGxcbiAgICAgICAgICogKm5vdCogbWFyayBpdCBkaXJ0eS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlydHlgIGlmIHRoZSB1c2VyIGhhcyBjaGFuZ2VkIHRoZSB2YWx1ZVxuICAgICAgICAgKiBpbiB0aGUgVUkuXG4gICAgICAgICAqXG4gICAgICAgICAqIE5vdGUgdGhhdCBwcm9ncmFtbWF0aWMgY2hhbmdlcyB0byBhIGNvbnRyb2wncyB2YWx1ZSB3aWxsXG4gICAgICAgICAqICpub3QqIG1hcmsgaXQgZGlydHkuXG4gICAgICAgICAqIEByZXR1cm4gez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IHBhdGhcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlcnJvckNvZGUsIHBhdGgpIHsgcmV0dXJuICEhdGhpcy5nZXRFcnJvcihlcnJvckNvZGUsIHBhdGgpOyB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInJvb3RcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogUmV0cmlldmVzIHRoZSB0b3AtbGV2ZWwgYW5jZXN0b3Igb2YgdGhpcyBjb250cm9sLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogUmV0cmlldmVzIHRoZSB0b3AtbGV2ZWwgYW5jZXN0b3Igb2YgdGhpcyBjb250cm9sLlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8geCA9IHRoaXM7XG4gICAgICAgICAgICB3aGlsZSAoeC5fcGFyZW50KSB7XG4gICAgICAgICAgICAgICAgeCA9IHguX3BhcmVudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB4O1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGVtaXRFdmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fdXBkYXRlQ29udHJvbHNFcnJvcnMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gZW1pdEV2ZW50XG4gICAgICogQHJldH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b250cm9sc0Rpc2FibGVkKCkpXG4gICAgICAgICAgICByZXR1cm4gRElTQUJMRUQ7XG4gICAgICAgIGlmICh0aGlzLmVycm9ycylcbiAgICAgICAgICAgIHJldHVybiBJTlZBTElEO1xuICAgICAgICBpZiAodGhpcy5fYW55Q29udHJvbHNIYXZlU3RhdHVzKFBFTkRJTkcpKVxuICAgICAgICAgICAgcmV0dXJuIFBFTkRJTkc7XG4gICAgICAgIGlmICh0aGlzLl9hbnlDb250cm9sc0hhdmVTdGF0dXMoSU5WQUxJRCkpXG4gICAgICAgICAgICByZXR1cm4gSU5WQUxJRDtcbiAgICAgICAgcmV0dXJuIFZBTElEO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBzdGF0dXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2FueUNvbnRyb2xzSGF2ZVN0YXR1cyA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBzdGF0dXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzdGF0dXMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2FueUNvbnRyb2xzKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBjb250cm9sLnN0YXR1cyA9PT0gc3RhdHVzOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fYW55Q29udHJvbHNEaXJ0eSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9hbnlDb250cm9scyhmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC5kaXJ0eTsgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2FueUNvbnRyb2xzVG91Y2hlZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9hbnlDb250cm9scyhmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC50b3VjaGVkOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7Pz19IG9wdHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX3VwZGF0ZVByaXN0aW5lID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez89fSBvcHRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob3B0cykge1xuICAgICAgICBpZiAob3B0cyA9PT0gdm9pZCAwKSB7IG9wdHMgPSB7fTsgfVxuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnByaXN0aW5lID0gIXRoaXMuX2FueUNvbnRyb2xzRGlydHkoKTtcbiAgICAgICAgaWYgKHRoaXMuX3BhcmVudCAmJiAhb3B0cy5vbmx5U2VsZikge1xuICAgICAgICAgICAgdGhpcy5fcGFyZW50Ll91cGRhdGVQcmlzdGluZShvcHRzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/PX0gb3B0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fdXBkYXRlVG91Y2hlZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/PX0gb3B0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG9wdHMpIHtcbiAgICAgICAgaWYgKG9wdHMgPT09IHZvaWQgMCkgeyBvcHRzID0ge307IH1cbiAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKHRoaXMpKS50b3VjaGVkID0gdGhpcy5fYW55Q29udHJvbHNUb3VjaGVkKCk7XG4gICAgICAgIGlmICh0aGlzLl9wYXJlbnQgJiYgIW9wdHMub25seVNlbGYpIHtcbiAgICAgICAgICAgIHRoaXMuX3BhcmVudC5fdXBkYXRlVG91Y2hlZChvcHRzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBmb3JtU3RhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2lzQm94ZWRWYWx1ZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBmb3JtU3RhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChmb3JtU3RhdGUpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiBmb3JtU3RhdGUgPT09ICdvYmplY3QnICYmIGZvcm1TdGF0ZSAhPT0gbnVsbCAmJlxuICAgICAgICAgICAgT2JqZWN0LmtleXMoZm9ybVN0YXRlKS5sZW5ndGggPT09IDIgJiYgJ3ZhbHVlJyBpbiBmb3JtU3RhdGUgJiYgJ2Rpc2FibGVkJyBpbiBmb3JtU3RhdGU7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLl9yZWdpc3Rlck9uQ29sbGVjdGlvbkNoYW5nZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGZuKSB7IHRoaXMuX29uQ29sbGVjdGlvbkNoYW5nZSA9IGZuOyB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7Pz19IG9wdHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX3NldFVwZGF0ZVN0cmF0ZWd5ID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez89fSBvcHRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob3B0cykge1xuICAgICAgICBpZiAoaXNPcHRpb25zT2JqKG9wdHMpICYmICgvKiogQHR5cGUgez99ICovIChvcHRzKSkudXBkYXRlT24gIT0gbnVsbCkge1xuICAgICAgICAgICAgdGhpcy5fdXBkYXRlT24gPSAvKiogQHR5cGUgez99ICovICgoKC8qKiBAdHlwZSB7P30gKi8gKG9wdHMpKS51cGRhdGVPbikpO1xuICAgICAgICB9X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udHJvbC52YWx1ZSk7ICAvLyAnTmFuY3knXG4gICAgICogYGBgXG4gICAgICpcbiAgICAgKiBPUlxuICAgICAqXG4gICAgICogYGBgXG4gICAgICogdGhpcy5jb250cm9sLnJlc2V0KHt2YWx1ZTogJ05hbmN5JywgZGlzYWJsZWQ6IHRydWV9KTtcbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKHRoaXMuY29udHJvbC52YWx1ZSk7ICAvLyAnTmFuY3knXG4gICAgICogY29uc29sZS5sb2codGhpcy5jb250cm9sLnN0YXR1cyk7ICAvLyAnRElTQUJMRUQnXG4gICAgICogYGBgXG4gICAgICogQHBhcmFtIHs/PX0gZm9ybVN0YXRlXG4gICAgICogQHBhcmFtIHs/PX0gb3B0aW9uc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGZvcm1TdGF0ZSwgb3B0aW9ucykge1xuICAgICAgICBpZiAoZm9ybVN0YXRlID09PSB2b2lkIDApIHsgZm9ybVN0YXRlID0gbnVsbDsgfVxuICAgICAgICBpZiAob3B0aW9ucyA9PT0gdm9pZCAwKSB7IG9wdGlvbnMgPSB7fTsgfVxuICAgICAgICB0aGlzLl9hcHBseUZvcm1TdGF0ZShmb3JtU3RhdGUpO1xuICAgICAgICB0aGlzLm1hcmtBc1ByaXN0aW5lKG9wdGlvbnMpO1xuICAgICAgICB0aGlzLm1hcmtBc1VudG91Y2hlZChvcHRpb25zKTtcbiAgICAgICAgdGhpcy5zZXRWYWx1ZSh0aGlzLnZhbHVlLCBvcHRpb25zKTtcbiAgICAgICAgdGhpcy5fcGVuZGluZ0NoYW5nZSA9IGZhbHNlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1Db250cm9sLnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgP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b25EaXNhYmxlZENoYW5nZS5wdXNoKGZuKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjYlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUNvbnRyb2wucHJvdG90eXBlLl9mb3JFYWNoQ2hpbGQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY2JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjYikgeyB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUNvbnRyb2wucHJvdG90eXBlLl9zeW5jUGVuZGluZ0NvbnRyb2xzID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMudXBkYXRlT24gPT09ICdzdWJtaXQnKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5fcGVuZGluZ0RpcnR5KVxuICAgICAgICAgICAgICAgIHRoaXMubWFya0FzRGlydHkoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9wZW5kaW5nVG91Y2hlZClcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtBc1RvdWNoZWQoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9wZW5kaW5nQ2hhbmdlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZSh0aGlzLl9wZW5kaW5nVmFsdWUsIHsgb25seVNlbGY6IHRydWUsIGVtaXRNb2RlbFRvVmlld0NoYW5nZTogZmFsc2UgfSk7XG4gICAgICAgICAgICAg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gICAgICAgcmV0dXJuIHRoaXMuY29udHJvbHNbbmFtZV07XG4gICAgICAgIHRoaXMuY29udHJvbHNbbmFtZV0gPSBjb250cm9sO1xuICAgICAgICBjb250cm9sLnNldFBhcmVudCh0aGlzKTtcbiAgICAgICAgY29udHJvbC5fcmVnaXN0ZXJPbkNvbGxlY3Rpb25DaGFuZ2UodGhpcy5fb25Db2xsZWN0aW9uQ2hhbmdlKTtcbiAgICAgICAgcmV0dXJuIGNvbnRyb2w7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBBZGQgYSBjb250cm9sIHRvIHRoaXMgZ3JvdXAuXG4gICAgICovXG4gICAgLyoqXG4gICAgICogQWRkIGEgY29udHJvbCB0byB0aGlzIGdyb3VwLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5hZGRDb250cm9sID0gLyoqXG4gICAgICogQWRkIGEgY29udHJvbCB0byB0aGlzIGdyb3VwLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIGNvbnRyb2wpIHtcbiAgICAgICAgdGhpcy5yZWdpc3RlckNvbnRyb2wobmFtZSwgY29udHJvbCk7XG4gICAgICAgIHRoaXMudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICAgICAgICB0aGlzLl9vbkNvbGxlY3Rpb25DaGFuZ2UoKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIFJlbW92ZSBhIGNvbnRyb2wgZnJvbSB0aGlzIGdyb3VwLlxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFJlbW92ZSBhIGNvbnRyb2wgZnJvbSB0aGlzIGdyb3VwLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5yZW1vdmVDb250cm9sID0gLyoqXG4gICAgICogUmVtb3ZlIGEgY29udHJvbCBmcm9tIHRoaXMgZ3JvdXAuXG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobmFtZSkge1xuICAgICAgICBpZiAodGhpcy5jb250cm9sc1tuYW1lXSlcbiAgICAgICAgICAgIHRoaXMuY29udHJvbHNbbmFtZV0uX3JlZ2lzdGVyT25Db2xsZWN0aW9uQ2hhbmdlKGZ1bmN0aW9uICgpIHsgfSk7XG4gICAgICAgIGRlbGV0ZSAodGhpcy5jb250cm9sc1tuYW1lXSk7XG4gICAgICAgIHRoaXMudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICAgICAgICB0aGlzLl9vbkNvbGxlY3Rpb25DaGFuZ2UoKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIFJlcGxhY2UgYW4gZXhpc3RpbmcgY29udHJvbC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBSZXBsYWNlIGFuIGV4aXN0aW5nIGNvbnRyb2wuXG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXAucHJvdG90eXBlLnNldENvbnRyb2wgPSAvKipcbiAgICAgKiBSZXBsYWNlIGFuIGV4aXN0aW5nIGNvbnRyb2wuXG4gICAgICogQHBhcmFtIHs/fSBuYW1lXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobmFtZSwgY29udHJvbCkge1xuICAgICAgICBpZiAodGhpcy5jb250cm9sc1tuYW1lXSlcbiAgICAgICAg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R1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnZhbHVlID0gdGhpcy5fcmVkdWNlVmFsdWUoKTsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbmRpdGlvblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5fYW55Q29udHJvbHMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY29uZGl0aW9uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZGl0aW9uKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IGZhbHNlO1xuICAgICAgICB0aGlzLl9mb3JFYWNoQ2hpbGQoZnVuY3Rpb24gKGNvbnRyb2wsIG5hbWUpIHtcbiAgICAgICAgICAgIHJlcyA9IHJlcyB8fCAoX3RoaXMuY29udGFpbnMobmFtZSkgJiYgY29uZGl0aW9uKGNvbnRyb2wpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1Hcm91cC5wcm90b3R5cGUuX3JlZHVjZVZhbHVlID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcmV0dXJuIHRoaXMuX3JlZHVjZUNoaWxkcmVuKHt9LCBmdW5jdGlvbiAoYWNjLCBjb250cm9sLCBuYW1lKSB7XG4gICAgICAgICAgICBpZiAoY29udHJvbC5lbmFibGVkIHx8IF90aGlzLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgYWNjW25hbWVdID0gY29udHJvbC52YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhY2M7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBpbml0VmFsdWVcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXAucHJvdG90eXBlLl9yZWR1Y2VDaGlsZHJlbiA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBpbml0VmFsdWVcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoaW5pdFZhbHVlLCBmbikge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXMgPSBpbml0VmFsdWU7XG4gICAgICAgIHRoaXMuX2ZvckVhY2hDaGlsZChmdW5jdGlvbiAoY29udHJvbCwgbmFtZSkgeyByZXMgPSBmbihyZXMsIGNvbnRyb2wsIG5hbWUpOyB9KTtcbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwL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lIHRoZSBjb250cm9sIGF0IHRoZSBnaXZlbiBgaW5kZXhgIGluIHRoZSBhcnJheS5cbiAgICAgKiBAcGFyYW0gez99IGluZGV4XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXkucHJvdG90eXBlLnJlbW92ZUF0ID0gLyoqXG4gICAgICogUmVtb3ZlIHRoZSBjb250cm9sIGF0IHRoZSBnaXZlbiBgaW5kZXhgIGluIHRoZSBhcnJheS5cbiAgICAgKiBAcGFyYW0gez99IGluZGV4XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoaW5kZXgpIHtcbiAgICAgICAgaWYgKHRoaXMuY29udHJvbHNbaW5kZXhdKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sc1tpbmRleF0uX3JlZ2lzdGVyT25Db2xsZWN0aW9uQ2hhbmdlKGZ1bmN0aW9uICgpIHsgfSk7XG4gICAgICAgIHRoaXMuY29udHJvbHMuc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgdGhpcy51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KCk7XG4gICAgICAgIHRoaXMuX29uQ29sbGVjdGlvbkNoYW5nZSgpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogUmVwbGFjZSBhbiBleGlzdGluZyBjb250cm9sLlxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFJlcGxhY2UgYW4gZXhpc3RpbmcgY29udHJvbC5cbiAgICAgKiBAcGFyYW0gez99IGluZGV4XG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXkucHJvdG90eXBlLnNldENvbnRyb2wgPSAvKipcbiAgICAgKiBSZXBsYWNlIGFuIGV4aXN0aW5nIGNvbnRyb2wuXG4gICAgICogQHBhcmFtIHs/fSBpbmRleFxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGluZGV4LCBjb250cm9sKSB7XG4gICAgICAgIGlmICh0aGlzLmNvbnRyb2xzW2luZGV4XSlcbiAgICAgICAgICAgIHRoaXMuY29udHJvbHNbaW5kZXhdLl9yZWdpc3Rlck9uQ29sbGVjdGlvbkNoYW5nZShmdW5jdGlvbiAoKSB7IH0pO1xuICAgICAgICB0aGlzLmNvbnRyb2xzLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgIGlmIChjb250cm9sKSB7XG4gICAgICAgICAgICB0aGlzLmNvbnRyb2xzLnNwbGljZShpbmRleCwgMCwgY29udHJvbCk7XG4gICAgICAgICAgICB0aGlzLl9yZWdpc3RlckNvbnRyb2woY29udHJvbCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KCk7XG4gICAgICAgIHRoaXMuX29uQ29sbGVjdGlvbkNoYW5nZSgpO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZvcm1BcnJheS5wcm90b3R5cGUsIFwibGVuZ3RoXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIExlbmd0aCBvZiB0aGUgY29udHJvbCBhcnJheS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIExlbmd0aCBvZiB0aGUgY29udHJvbCBhcnJheS5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbHMubGVuZ3RoOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiAgU2V0cyB0aGUgdmFsdWUgb2YgdGhlIHtAbGluayBGb3JtQXJyYXl9LiBJdCBhY2NlcHRzIGFuIGFycmF5IHRoYXQgbWF0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gb2YgYSBjb250cm9sLlxuICAgICAqXG4gICAgICogICMjIyBFeGFtcGxlXG4gICAgICpcbiAgICAgKiAgYGBgXG4gICAgICogIGNvbnN0IGFyciA9IG5ldyBGb3JtQXJyYXkoW1xuICAgICAqICAgICBuZXcgRm9ybUNvbnRyb2woKSxcbiAgICAgKiAgICAgbmV3IEZvcm1Db250cm9sKClcbiAgICAgKiAgXSk7XG4gICAgICogIGNvbnNvbGUubG9nKGFyci52YWx1ZSk7ICAgLy8gW251bGwsIG51bGxdXG4gICAgICpcbiAgICAgKiAgYXJyLnNldFZhbHVlKFsnTmFuY3knLCAnRHJldyddKTtcbiAgICAgKiAgY29uc29sZS5sb2coYXJyLnZhbHVlKTsgICAvLyBbJ05hbmN5JywgJ0RyZXcnXVxuICAgICAqICBgYGBcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHBhcmFtIHs/PX0gb3B0aW9uc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlLCBvcHRpb25zKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChvcHRpb25zID09PSB2b2lkIDApIHsgb3B0aW9ucyA9IHt9OyB9XG4gICAgICAgIHRoaXMuX2NoZWNrQWxsVmFsdWVzUHJlc2VudCh2YWx1ZSk7XG4gICAgICAgIHZhbHVlLmZvckVhY2goZnVuY3Rpb24gKG5ld1ZhbHVlLCBpbmRleCkge1xuICAgICAgICAgICAgX3RoaXMuX3Rocm93SWZDb250cm9sTWlzc2luZyhpbmRleCk7XG4gICAgICAgICAgICBfdGhpcy5hdChpbmRleCkuc2V0VmFsdWUobmV3VmFsdWUsIHsgb25seVNlbGY6IHRydWUsIGVtaXRFdmVudDogb3B0aW9ucy5lbWl0RXZlbnQgfSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnVwZGF0ZVZhbHVlQW5kVmFsaWRpdHkob3B0aW9ucyk7XG4gICAg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2VwdHMgYm90aCBzdXBlci1zZXRzIGFuZCBzdWItc2V0cyBvZiB0aGUgYXJyYXkgd2l0aG91dCB0aHJvd2luZyBhbiBlcnJvci5cbiAgICAgKlxuICAgICAqICAjIyMgRXhhbXBsZVxuICAgICAqXG4gICAgICogIGBgYFxuICAgICAqICBjb25zdCBhcnIgPSBuZXcgRm9ybUFycmF5KFtcbiAgICAgKiAgICAgbmV3IEZvcm1Db250cm9sKCksXG4gICAgICogICAgIG5ldyBGb3JtQ29udHJvbCgpXG4gICAgICogIF0pO1xuICAgICAqICBjb25zb2xlLmxvZyhhcnIudmFsdWUpOyAgIC8vIFtudWxsLCBudWxsXVxuICAgICAqXG4gICAgICogIGFyci5wYXRjaFZhbHVlKFsnTmFuY3knXSk7XG4gICAgICogIGNvbnNvbGUubG9nKGFyci52YWx1ZSk7ICAgLy8gWydOYW5jeScsIG51bGxdXG4gICAgICogIGBgYFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcGFyYW0gez89fSBvcHRpb25zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUsIG9wdGlvbnMpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgaWYgKG9wdGlvbnMgPT09IHZvaWQgMCkgeyBvcHRpb25zID0ge307IH1cbiAgICAgICAgdmFsdWUuZm9yRWFjaChmdW5jdGlvbiAobmV3VmFsdWUsIGluZGV4KSB7XG4gICAgICAgICAgICBpZiAoX3RoaXMuYXQoaW5kZXgpKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuYXQoaW5kZXgpLnBhdGNoVmFsdWUobmV3VmFsdWUsIHsgb25seVNlbGY6IHRydWUsIGVtaXRFdmVudDogb3B0aW9ucy5lbWl0RXZlbnQgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnVwZGF0ZVZhbHVlQW5kVmFsaWRpdHkob3B0aW9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AgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJDYW5ub3QgZmluZCBmb3JtIGNvbnRyb2wgYXQgaW5kZXggXCIgKyBpbmRleCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY2JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2ZvckVhY2hDaGlsZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjYlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNiKSB7XG4gICAgICAgIHRoaXMuY29udHJvbHMuZm9yRWFjaChmdW5jdGlvbiAoY29udHJvbCwgaW5kZXgpIHsgY2IoY29udHJvbCwgaW5kZXgpOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUFycmF5LnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnZhbHVlID1cbiAgICAgICAgICAgIHRoaXMuY29udHJvbHMuZmlsdGVyKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBjb250cm9sLmVuYWJsZWQgfHwgX3RoaXMuZGlzYWJsZWQ7IH0pXG4gICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC52YWx1ZTsgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbmRpdGlvblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUFycmF5LnByb3RvdHlwZS5fYW55Q29udHJvbHMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY29uZGl0aW9uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZGl0aW9uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNvbnRyb2xzLnNvbWUoZnVuY3Rpb24gKGNvbnRyb2wpIHsgcmV0dXJuIGNvbnRyb2wuZW5hYmxlZCAmJiBjb25kaXRpb24oY29udHJvbCk7IH0pO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXkucHJvdG90eXBlLl9zZXRVcENvbnRyb2xzID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdGhpcy5fZm9yRWFjaENoaWxkKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBfdGhpcy5fcmVnaXN0ZXJDb250cm9sKGNvbnRyb2wpOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2NoZWNrQWxsVmFsdWVzUHJlc2VudCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHRoaXMuX2ZvckVhY2hDaGlsZChmdW5jdGlvbiAoY29udHJvbCwgaSkge1xuICAgICAgICAgICAgaWYgKHZhbHVlW2ldID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJNdXN0IHN1cHBseSBhIHZhbHVlIGZvciBmb3JtIGNvbnRyb2wgYXQgaW5kZXg6IFwiICsgaSArIFwiLlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2FsbENvbnRyb2xzRGlzYWJsZWQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIF9hID0gdGhpcy5jb250cm9sczsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIHZhciBjb250cm9sID0gX2FbX2ldO1xuICAgICAgICAgICAgaWYgKGNvbnRyb2wuZW5hYmxlZClcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuY29udHJvbHMubGVuZ3RoID4gMCB8fCB0aGlzLmRpc2FibGVkO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiA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jb250cm9sczsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nRm9ybS5wcm90b3R5cGUuYWRkQ29udHJvbCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJlc29sdmVkUHJvbWlzZS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRhaW5lciA9IF90aGlzLl9maW5kQ29udGFpbmVyKGRpci5wYXRoKTtcbiAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChkaXIpKS5jb250cm9sID0gLyoqIEB0eXBlIHs/fSAqLyAoY29udGFpbmVyLnJlZ2lzdGVyQ29udHJvbChkaXIubmFtZSwgZGlyLmNvbnRyb2wpKTtcbiAgICAgICAgICAgIHNldFVwQ29udHJvbChkaXIuY29udHJvbCwgZGlyKTtcbiAgICAgICAgICAgIGRpci5jb250cm9sLnVwZGF0ZVZhbHVlQW5kVmFsaWRpdHkoeyBlbWl0RXZlbnQ6IGZhbHNlIH0pO1xuICAgICAgICAgICAgX3RoaXMuX2RpcmVjdGl2ZXMucHVzaChkaXIpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmdldENvbnRyb2wgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5mb3JtLmdldChkaXIucGF0aCkpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLnJlbW92ZUNvbnRyb2wgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb250YWluZXIgPSBfdGhpcy5fZmluZENvbnRhaW5lcihkaXIucGF0aCk7XG4gICAgICAgICAgICBpZiAoY29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyLnJlbW92ZUNvbnRyb2woZGlyLm5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVtb3ZlRGlyKF90aGlzLl9kaXJlY3RpdmVzLCBkaXIpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmFkZEZvcm1Hcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJlc29sdmVkUHJvbWlzZS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRhaW5lciA9IF90aGlzLl9maW5kQ29udGFpbmVyKGRpci5wYXRoKTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGdyb3VwID0gbmV3IEZvcm1Hcm91cCh7fSk7XG4gICAgICAgICAgICBzZXRVcEZvcm1Db250YWluZXIoZ3JvdXAsIGRpcik7XG4gICAgICAgICAgICBjb250YWluZXIucmVnaXN0ZXJDb250cm9sKGRpci5uYW1lLCBncm91cCk7XG4gICAgICAgICAgICBncm91cC51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KHsgZW1pdEV2ZW50OiBmYWxzZSB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5yZW1vdmVGb3JtR3JvdXAgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb250YWluZXIgPSBfdGhpcy5fZmluZENvbnRhaW5lcihkaXIucGF0aCk7XG4gICAgICAgICAgICBpZiAoY29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyLnJlbW92ZUNvbnRyb2woZGlyLm5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmdldEZvcm1Hcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7IHJldHVybiAvKiogQHR5cGUgez99ICovICh0aGlzLmZvcm0uZ2V0KGRpci5wYXRoKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLnVwZGF0ZU1vZGVsID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyLCB2YWx1ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdHJsID0gLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMuZm9ybS5nZXQoLyoqIEB0eXBlIHs/fSAqLyAoKGRpci5wYXRoKSkpKTtcbiAgICAgICAgICAgIGN0cmwuc2V0VmFsdWUodmFsdWUpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nRm9ybS5wcm90b3R5cGUuc2V0VmFsdWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHsgdGhpcy5jb250cm9sLnNldFZhbHVlKHZhbHVlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99ICRldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5v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JldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMgJiYgdGhpcy5vcHRpb25zLnVwZGF0ZU9uICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybS5fdXBkYXRlT24gPSB0aGlzLm9wdGlvbnMudXBkYXRlT247XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gcGF0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5fZmluZENvbnRhaW5lciA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBwYXRoXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGF0aCkge1xuICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICByZXR1cm4gcGF0aC5sZW5ndGggPyAvKiogQHR5cGUgez99ICovICh0aGlzLmZvcm0uZ2V0KHBhdGgpKSA6IHRoaXMuZm9ybTtcbiAgICB9O1xuICAgIE5nRm9ybS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdmb3JtOm5vdChbbmdOb0Zvcm1dKTpub3QoW2Zvcm1Hcm91cF0pLG5nRm9ybSxbbmdGb3JtXScsXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW2Zvcm1EaXJlY3RpdmVQcm92aWRlcl0sXG4gICAgICAgICAgICAgICAgICAgIGhvc3Q6IHsgJyhzdWJtaXQpJzogJ29uU3VibWl0KCRldmVudCknLCAnKHJlc2V0KSc6ICdvblJlc2V0KCknIH0sXG4gICAgICAgICAgICAgICAgICAgIG91dH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gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gIXRoaXMuX3BhcmVudCB8fCAhISh0aGlzLm9wdGlvbnMgJiYgdGhpcy5vcHRpb25zLnN0YW5kYWxvbmUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ01vZGVsLnByb3RvdHlwZS5fc2V0VXBTdGFuZGFsb25lID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHNldFVwQ29udHJvbCh0aGlzLmNvbnRyb2wsIHRoaXMpO1xuICAgICAgICB0aGlzLmNvbnRyb2wudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSh7IGVtaXRFdmVudDogZmFsc2UgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nTW9kZWwucHJvdG90eXBlLl9jaGVja0ZvckVycm9ycyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoIXRoaXMuX2lzU3RhbmRhbG9uZSgpKSB7XG4gICAgICAgICAgICB0aGlzLl9jaGVja1BhcmVudFR5cGUoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9jaGVja05hbWUoKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX2NoZWNrUGFyZW50VHlwZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoISh0aGlzLl9wYXJlbnQgaW5zdGFuY2VvZiBOZ01vZGVsR3JvdXApICYmXG4gICAgICAgICAgICB0aGlzLl9wYXJlbnQgaW5zdGFuY2VvZiBBYnN0cmFjdEZvcm1Hcm91cERpcmVjdGl2ZSkge1xuICAgICAgICAgICAgVGVtcGxhdGVEcml2ZW5FcnJvcnMuZm9ybUdyb3VwTmFtZUV4Y2VwdGlvbigpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKCEodGhpcy5fcGFyZW50IGluc3RhbmNlb2YgTmdNb2RlbEdyb3VwKSAmJiAhKHRoaXMuX3BhcmVudCBpbnN0YW5jZW9mIE5nRm9ybSkpIHtcbiAgICAgICAgICAgIFRlbXBsYXRlRHJpdmVuRXJyb3JzLm1vZGVsUGFyZW50RXhjZXB0aW9uKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX2NoZWNrTmFtZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zICYmIHRoaXMub3B0aW9ucy5uYW1lKVxuICAgICAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5vcHRpb25zLm5hbWU7XG4gICAgICAgIGlmICghdGhpcy5faXNTdGFuZGFsb25lKCkgJiYgIXRoaXMubmFtZSkge1xuICAgICAgICAgICAgVGVtcGxhdGVEcml2ZW5FcnJvcnMubWlzc2luZ05hbWVFeGNlcHRpb24oKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX3VwZGF0ZVZhbHVlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJlc29sdmVkUHJvbWlzZ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gZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtdOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5hZGRDb250cm9sID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChkaXIpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY3RybCA9IHRoaXMuZm9ybS5nZXQoZGlyLnBhdGgpO1xuICAgICAgICBzZXRVcENvbnRyb2woY3RybCwgZGlyKTtcbiAgICAgICAgY3RybC51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KHsgZW1pdEV2ZW50OiBmYWxzZSB9KTtcbiAgICAgICAgdGhpcy5kaXJlY3RpdmVzLnB1c2goZGlyKTtcbiAgICAgICAgcmV0dXJuIGN0cmw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5nZXRDb250cm9sID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChkaXIpIHsgcmV0dXJuIC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuZm9ybS5nZXQoZGlyLnBhdGgpKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG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iAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5mb3JtLmdldChkaXIucGF0aCkpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXBEaXJlY3RpdmUucHJvdG90eXBlLmFkZEZvcm1BcnJheSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGN0cmwgPSB0aGlzLmZvcm0uZ2V0KGRpci5wYXRoKTtcbiAgICAgICAgc2V0VXBGb3JtQ29udGFpbmVyKGN0cmwsIGRpcik7XG4gICAgICAgIGN0cmwudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSh7IGVtaXRFdmVudDogZmFsc2UgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5yZW1vdmVGb3JtQXJyYXkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXBEaXJlY3RpdmUucHJvdG90eXBlLmdldEZvcm1BcnJheSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvb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dXJuIF90aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheU5hbWUucHJvdG90eXBlLm5nT25Jbml0ID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMuX2NoZWNrUGFyZW50VHlwZSgpOyAvKiogQHR5cGUgez99ICovXG4gICAgICAgICgodGhpcy5mb3JtRGlyZWN0aXZlKSkuYWRkRm9ybUFycmF5KHRoaXMpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXlOYW1lLnByb3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5mb3JtRGlyZWN0aXZlKSB7XG4gICAgICAgICAgICB0aGlzLmZvcm1EaXJlY3RpdmUucmVtb3ZlRm9ybUFycmF5KHRoaXMpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwiY29udHJvbFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiAvKiogQHR5cGUgez99ICovICgodGhpcy5mb3JtRGlyZWN0aXZlKSkuZ2V0Rm9ybUFycmF5KHRoaXMpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwiZm9ybURpcmVjdGl2ZVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcGFyZW50ID8gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5fcGFyZW50LmZvcm1EaXJlY3RpdmUpIDogbnVsbDtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZvcm1BcnJheU5hbWUucHJvdG90eXBlLCBcInBhdGhcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gY29udHJvbFBhdGgodGhpcy5uYW1lLCB0aGlzLl9wYXJlbnQpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwidmFsaWRhdG9yXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIGNvbXBvc2VWYWxpZGF0b3JzKHRoaXMuX3ZhbGlkYXRvcnMpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwiYXN5bmNWYWxpZGF0b3JcIiwge1xuICAgICAgICBnZXQ6IC8qKlxu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KHRoaXMuX29uQ2hhbmdlKVxuICAgICAgICAgICAgICAgIHRoaXMuX29uQ2hhbmdlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRW1haWxWYWxpZGF0b3IucHJvdG90eXBlLnZhbGlkYXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYykge1xuICAgICAgICByZXR1cm4gdGhpcy5fZW5hYmxlZCA/IFZhbGlkYXRvcnMuZW1haWwoYykgOiBudWxsO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRW1haWxWYWxpZGF0b3IucHJvdG90eXBlLnJlZ2lzdGVyT25WYWxpZGF0b3JDaGFuZ2UgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHsgdGhpcy5fb25DaGFuZ2UgPSBmbjsgfTtcbiAgICBFbWFpbFZhbGlkYXRvci5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdbZW1haWxdW2Zvcm1Db250cm9sTmFtZV0sW2VtYWlsXVtmb3JtQ29udHJvbF0sW2VtYWlsXVtuZ01vZGVsXScsXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW0VNQUlMX1ZBTElEQVRPUl1cbiAgICAgICAgICAgICAgICB9LF0gfSxcbiAgICBdO1xuICAgIC8qKiBAbm9jb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52YXIgTWluTGVuZ3RoVmFsaWRhdG9yID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE1pbkxlbmd0aFZhbGlkYXRvcigpIHtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjaGFuZ2VzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNaW5MZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLm5nT25DaGFuZ2VzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjaGFuZ2VzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY2hhbmdlcykge1xuICAgICAgICBpZiAoJ21pbmxlbmd0aCcgaW4gY2hhbmdlcykge1xuICAgICAgICAgICAgdGhpcy5fY3JlYXRlVmFsaWRhdG9yKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5fb25DaGFuZ2UpXG4gICAgICAgICAgICAgICAgdGhpcy5fb25DaGFuZ2UoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNaW5MZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLnZhbGlkYXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYykge1xuICAgICAgICByZXR1cm4gdGhpcy5taW5sZW5ndGggPT0gbnVsbCA/IG51bGwgOiB0aGlzLl92YWxpZGF0b3IoYyk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNaW5MZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLnJlZ2lzdGVyT25WYWxpZGF0b3JDaGFuZ2UgPSAvKipcbiAgICAgK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09uQ2hhbmdlcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNoYW5nZXMpIHtcbiAgICAgICAgaWYgKCdtYXhsZW5ndGgnIGluIGNoYW5nZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX2NyZWF0ZVZhbGlkYXRvcigpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX29uQ2hhbmdlKVxuICAgICAgICAgICAgICAgIHRoaXMuX29uQ2hhbmdlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWF4TGVuZ3RoVmFsaWRhdG9yLnByb3RvdHlwZS52YWxpZGF0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWF4bGVuZ3RoICE9IG51bGwgPyB0aGlzLl92YWxpZGF0b3IoYykgOiBudWxsO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWF4TGVuZ3RoVmFsaWRhdG9yLnByb3RvdHlwZS5yZWdpc3Rlck9uVmFsaWRhdG9yQ2hhbmdlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGZuKSB7IHRoaXMuX29uQ2hhbmdlID0gZm47IH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNYXhMZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLl9jcmVhdGVWYWxpZGF0b3IgPSAvKipcbiAgICAgKiBAcmV0dXJu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29udHJvbHM7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbnRyb2xDb25maWdcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1CdWlsZGVyLnByb3RvdHlwZS5fY3JlYXRlQ29udHJvbCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sQ29uZmlnXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29udHJvbENvbmZpZykge1xuICAgICAgICBpZiAoY29udHJvbENvbmZpZyBpbnN0YW5jZW9mIEZvcm1Db250cm9sIHx8IGNvbnRyb2xDb25maWcgaW5zdGFuY2VvZiBGb3JtR3JvdXAgfHxcbiAgICAgICAgICAgIGNvbnRyb2xDb25maWcgaW5zdGFuY2VvZiBGb3JtQXJyYXkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb250cm9sQ29uZmlnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29udHJvbENvbmZpZykpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbHVlID0gY29udHJvbENvbmZpZ1swXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbGlkYXRvciA9IGNvbnRyb2xDb25maWcubGVuZ3RoID4gMSA/IGNvbnRyb2xDb25maWdbMV0gOiBudWxsO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXN5bmNWYWxpZGF0b3IgPSBjb250cm9sQ29uZmlnLmxlbmd0aCA+IDIgPyBjb250cm9sQ29uZmlnWzJdIDogbnVsbDtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnRyb2wodmFsdWUsIHZhbGlkYXRvciwgYXN5bmNWYWxpZGF0b3IpO1xuIC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utable) */ __webpack_exports__[\"a\"] = getValueInRange;\n/* harmony export (immutable) */ __webpack_exports__[\"e\"] = isString;\n/* harmony export (immutable) */ __webpack_exports__[\"d\"] = isNumber;\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = isInteger;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = isDefined;\n/* harmony export (immutable) */ __webpack_exports__[\"f\"] = padNumber;\n/* harmony export (immutable) */ __webpack_exports__[\"g\"] = regExpEscape;\nfunction toInteger(value) {\n return parseInt(\"\" + value, 10);\n}\nfunction toString(value) {\n return (value !== undefined && value !== null) ? \"\" + value : '';\n}\nfunction getValueInRange(value, max, min) {\n if (min === void 0) { min = 0; }\n return Math.max(Math.min(value, max), min);\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction isNumber(value) {\n return !isNaN(toInteger(value));\n}\nfunction isInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction padNumber(value) {\n if (isNumber(value)) {\n return (\"0\" + value).slice(-2);\n }\n else {\n return '';\n }\n}\nfunction regExpEscape(text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n//# sourceMappingURL=util.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvdXRpbC91dGlsLmpzP2RiMjEiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIHRvSW50ZWdlcih2YWx1ZSkge1xuICAgIHJldHVybiBwYXJzZUludChcIlwiICsgdmFsdWUsIDEwKTtcbn1cbmV4cG9ydCBmdW5jdGlvbiB0b1N0cmluZyh2YWx1ZSkge1xuICAgIHJldHVybiA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FxcXFxeJHwjXFxzXS9nLCAnXFxcXCQmJyk7XG59XG4vLyMgc291cmNlTWFwcGluZ1VSTD11dGlsLmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3V0aWwvdXRpbC5qc1xuLy8gbW9kdWxlIGlkID0gMTlcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///19\n"); /***/ }), -/* 20 */, -/* 21 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵregisterLocaleData\", function() { return registerLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgLocaleLocalization\", function() { return NgLocaleLocalization; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgLocalization\", function() { return NgLocalization; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerLocaleData\", function() { return registerLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plural\", function() { return Plural; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NumberFormatStyle\", function() { return NumberFormatStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormStyle\", function() { return FormStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TranslationWidth\", function() { return TranslationWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormatWidth\", function() { return FormatWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NumberSymbol\", function() { return NumberSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WeekDay\", function() { return WeekDay; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCurrencySymbol\", function() { return getCurrencySymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDayPeriods\", function() { return getLocaleDayPeriods; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDayNames\", function() { return getLocaleDayNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleMonthNames\", function() { return getLocaleMonthNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleId\", function() { return getLocaleId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleEraNames\", function() { return getLocaleEraNames; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleWeekEndRange\", function() { return getLocaleWeekEndRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleFirstDayOfWeek\", function() { return getLocaleFirstDayOfWeek; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDateFormat\", function() { return getLocaleDateFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleDateTimeFormat\", function() { return getLocaleDateTimeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleExtraDayPeriodRules\", function() { return getLocaleExtraDayPeriodRules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleExtraDayPeriods\", function() { return getLocaleExtraDayPeriods; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocalePluralCase\", function() { return getLocalePluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleTimeFormat\", function() { return getLocaleTimeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleNumberSymbol\", function() { return getLocaleNumberSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleNumberFormat\", function() { return getLocaleNumberFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleCurrencyName\", function() { return getLocaleCurrencyName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLocaleCurrencySymbol\", function() { return getLocaleCurrencySymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵparseCookieValue\", function() { return parseCookieValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CommonModule\", function() { return CommonModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedI18NPipesModule\", function() { return DeprecatedI18NPipesModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgClass\", function() { return NgClass; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForOf\", function() { return NgForOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForOfContext\", function() { return NgForOfContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgIf\", function() { return NgIf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgIfContext\", function() { return NgIfContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgPlural\", function() { return NgPlural; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgPluralCase\", function() { return NgPluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgStyle\", function() { return NgStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitch\", function() { return NgSwitch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitchCase\", function() { return NgSwitchCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSwitchDefault\", function() { return NgSwitchDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgTemplateOutlet\", function() { return NgTemplateOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgComponentOutlet\", function() { return NgComponentOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOCUMENT\", function() { return DOCUMENT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AsyncPipe\", function() { return AsyncPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DatePipe\", function() { return DatePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I18nPluralPipe\", function() { return I18nPluralPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I18nSelectPipe\", function() { return I18nSelectPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonPipe\", function() { return JsonPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LowerCasePipe\", function() { return LowerCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CurrencyPipe\", function() { return CurrencyPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DecimalPipe\", function() { return DecimalPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PercentPipe\", function() { return PercentPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SlicePipe\", function() { return SlicePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UpperCasePipe\", function() { return UpperCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TitleCasePipe\", function() { return TitleCasePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedDatePipe\", function() { return DeprecatedDatePipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedCurrencyPipe\", function() { return DeprecatedCurrencyPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedDecimalPipe\", function() { return DeprecatedDecimalPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DeprecatedPercentPipe\", function() { return DeprecatedPercentPipe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_BROWSER_ID\", function() { return PLATFORM_BROWSER_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_SERVER_ID\", function() { return PLATFORM_SERVER_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_WORKER_APP_ID\", function() { return PLATFORM_WORKER_APP_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵPLATFORM_WORKER_UI_ID\", function() { return PLATFORM_WORKER_UI_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformBrowser\", function() { return isPlatformBrowser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformServer\", function() { return isPlatformServer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformWorkerApp\", function() { return isPlatformWorkerApp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlatformWorkerUi\", function() { return isPlatformWorkerUi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PlatformLocation\", function() { return PlatformLocation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOCATION_INITIALIZED\", function() { return LOCATION_INITIALIZED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LocationStrategy\", function() { return LocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"APP_BASE_HREF\", function() { return APP_BASE_HREF; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HashLocationStrategy\", function() { return HashLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PathLocationStrategy\", function() { return PathLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Location\", function() { return Location; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return COMMON_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return findLocaleData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return DEPRECATED_PLURAL_FN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return getPluralCase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return COMMON_DEPRECATED_I18N_PIPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return COMMON_PIPES; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n *\n * `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform\n * agnostic.\n * This means that we can have different implementation of `PlatformLocation` for the different\n * platforms that angular supports. For example, `\\@angular/platform-browser` provides an\n * implementation specific to the browser environment, while `\\@angular/platform-webworker` provides\n * one suitable for use with web workers.\n *\n * The `PlatformLocation` class is used directly by all implementations of {\\@link LocationStrategy}\n * when they need to interact with the DOM apis like pushState, popState, etc...\n *\n * {\\@link LocationStrategy} in turn is used by the {\\@link Location} service which is used directly\n * by the {\\@link Router} in order to navigate between routes. Since all interactions between {\\@link\n * Router} /\n * {\\@link Location} / {\\@link LocationStrategy} and DOM apis flow through the `PlatformLocation`\n * class they are all platform independent.\n *\n * \\@stable\n * @abstract\n */\nvar PlatformLocation = /** @class */ (function () {\n function PlatformLocation() {\n }\n return PlatformLocation;\n}());\n/**\n * \\@whatItDoes indicates when a location is initialized\n * \\@experimental\n */\nvar LOCATION_INITIALIZED = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('Location Initialized');\n/**\n * A serializable version of the event from onPopState or onHashChange\n *\n * \\@experimental\n * @record\n */\n\n/**\n * \\@experimental\n * @record\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * `LocationStrategy` is responsible for representing and reading route state\n * from the browser's URL. Angular provides two strategies:\n * {\\@link HashLocationStrategy} and {\\@link PathLocationStrategy}.\n *\n * This is used under the hood of the {\\@link Location} service.\n *\n * Applications should use the {\\@link Router} or {\\@link Location} services to\n * interact with application route state.\n *\n * For instance, {\\@link HashLocationStrategy} produces URLs like\n * `http://example.com#/foo`, and {\\@link PathLocationStrategy} produces\n * `http://example.com/foo` as an equivalent URL.\n *\n * See these two classes for more.\n *\n * \\@stable\n * @abstract\n */\nvar LocationStrategy = /** @class */ (function () {\n function LocationStrategy() {\n }\n return LocationStrategy;\n}());\n/**\n * The `APP_BASE_HREF` token represents the base href to be used with the\n * {\\@link PathLocationStrategy}.\n *\n * If you're using {\\@link PathLocationStrategy}, you must provide a provider to a string\n * representing the URL prefix that should be preserved when generating and recognizing\n * URLs.\n *\n * ### Example\n *\n * ```typescript\n * import {Component, NgModule} from '\\@angular/core';\n * import {APP_BASE_HREF} from '\\@angular/common';\n *\n * \\@NgModule({\n * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * \\@stable\n */\nvar APP_BASE_HREF = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('appBaseHref');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental\n * @record\n */\n\n/**\n * \\@whatItDoes `Location` is a service that applications can use to interact with a browser's URL.\n * \\@description\n * Depending on which {\\@link LocationStrategy} is used, `Location` will either persist\n * to the URL's path or the URL's hash segment.\n *\n * Note: it's better to use {\\@link Router#navigate} service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n * \\@stable\n */\nvar Location = /** @class */ (function () {\n function Location(platformStrategy) {\n var _this = this;\n /**\n * \\@internal\n */\n this._subject = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this._platformStrategy = platformStrategy;\n var /** @type {?} */ browserBaseHref = this._platformStrategy.getBaseHref();\n this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));\n this._platformStrategy.onPopState(function (ev) {\n _this._subject.emit({\n 'url': _this.path(true),\n 'pop': true,\n 'type': ev.type,\n });\n });\n }\n /**\n * Returns the normalized URL path.\n */\n // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n // removed.\n /**\n * Returns the normalized URL path.\n * @param {?=} includeHash\n * @return {?}\n */\n Location.prototype.path = /**\n * Returns the normalized URL path.\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n return this.normalize(this._platformStrategy.path(includeHash));\n };\n /**\n * Normalizes the given path and compares to the current normalized path.\n */\n /**\n * Normalizes the given path and compares to the current normalized path.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.isCurrentPathEqualTo = /**\n * Normalizes the given path and compares to the current normalized path.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n return this.path() == this.normalize(path + Location.normalizeQueryParams(query));\n };\n /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n */\n /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n * @param {?} url\n * @return {?}\n */\n Location.prototype.normalize = /**\n * Given a string representing a URL, returns the normalized URL path without leading or\n * trailing slashes.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));\n };\n /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n */\n /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n * @param {?} url\n * @return {?}\n */\n Location.prototype.prepareExternalUrl = /**\n * Given a string representing a URL, returns the platform-specific external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n if (url && url[0] !== '/') {\n url = '/' + url;\n }\n return this._platformStrategy.prepareExternalUrl(url);\n };\n // TODO: rename this method to pushState\n /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n */\n /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.go = /**\n * Changes the browsers URL to the normalized version of the given URL, and pushes a\n * new item onto the platform's history.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n this._platformStrategy.pushState(null, '', path, query);\n };\n /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n */\n /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n Location.prototype.replaceState = /**\n * Changes the browsers URL to the normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n * @param {?} path\n * @param {?=} query\n * @return {?}\n */\n function (path, query) {\n if (query === void 0) { query = ''; }\n this._platformStrategy.replaceState(null, '', path, query);\n };\n /**\n * Navigates forward in the platform's history.\n */\n /**\n * Navigates forward in the platform's history.\n * @return {?}\n */\n Location.prototype.forward = /**\n * Navigates forward in the platform's history.\n * @return {?}\n */\n function () { this._platformStrategy.forward(); };\n /**\n * Navigates back in the platform's history.\n */\n /**\n * Navigates back in the platform's history.\n * @return {?}\n */\n Location.prototype.back = /**\n * Navigates back in the platform's history.\n * @return {?}\n */\n function () { this._platformStrategy.back(); };\n /**\n * Subscribe to the platform's `popState` events.\n */\n /**\n * Subscribe to the platform's `popState` events.\n * @param {?} onNext\n * @param {?=} onThrow\n * @param {?=} onReturn\n * @return {?}\n */\n Location.prototype.subscribe = /**\n * Subscribe to the platform's `popState` events.\n * @param {?} onNext\n * @param {?=} onThrow\n * @param {?=} onReturn\n * @return {?}\n */\n function (onNext, onThrow, onReturn) {\n return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });\n };\n /**\n * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as\n * is.\n * @param {?} params\n * @return {?}\n */\n Location.normalizeQueryParams = /**\n * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as\n * is.\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return params && params[0] !== '?' ? '?' + params : params;\n };\n /**\n * Given 2 parts of a url, join them with a slash if needed.\n * @param {?} start\n * @param {?} end\n * @return {?}\n */\n Location.joinWithSlash = /**\n * Given 2 parts of a url, join them with a slash if needed.\n * @param {?} start\n * @param {?} end\n * @return {?}\n */\n function (start, end) {\n if (start.length == 0) {\n return end;\n }\n if (end.length == 0) {\n return start;\n }\n var /** @type {?} */ slashes = 0;\n if (start.endsWith('/')) {\n slashes++;\n }\n if (end.startsWith('/')) {\n slashes++;\n }\n if (slashes == 2) {\n return start + end.substring(1);\n }\n if (slashes == 1) {\n return start + end;\n }\n return start + '/' + end;\n };\n /**\n * If url has a trailing slash, remove it, otherwise return url as is. This\n * method looks for the first occurence of either #, ?, or the end of the\n * line as `/` characters after any of these should not be replaced.\n * @param {?} url\n * @return {?}\n */\n Location.stripTrailingSlash = /**\n * If url has a trailing slash, remove it, otherwise return url as is. This\n * method looks for the first occurence of either #, ?, or the end of the\n * line as `/` characters after any of these should not be replaced.\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ match = url.match(/#|\\?|$/);\n var /** @type {?} */ pathEndIdx = match && match.index || url.length;\n var /** @type {?} */ droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n };\n Location.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n Location.ctorParameters = function () { return [\n { type: LocationStrategy, },\n ]; };\n return Location;\n}());\n/**\n * @param {?} baseHref\n * @param {?} url\n * @return {?}\n */\nfunction _stripBaseHref(baseHref, url) {\n return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;\n}\n/**\n * @param {?} url\n * @return {?}\n */\nfunction _stripIndexHtml(url) {\n return url.replace(/\\/index.html$/, '');\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL hash for storing application location data.\n * \\@description\n * `HashLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n * of the browser's URL.\n *\n * For instance, if you call `location.go('/foo')`, the browser's URL will become\n * `example.com#/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar HashLocationStrategy = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(HashLocationStrategy, _super);\n function HashLocationStrategy(_platformLocation, _baseHref) {\n var _this = _super.call(this) || this;\n _this._platformLocation = _platformLocation;\n _this._baseHref = '';\n if (_baseHref != null) {\n _this._baseHref = _baseHref;\n }\n return _this;\n }\n /**\n * @param {?} fn\n * @return {?}\n */\n HashLocationStrategy.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._platformLocation.onPopState(fn);\n this._platformLocation.onHashChange(fn);\n };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.getBaseHref = /**\n * @return {?}\n */\n function () { return this._baseHref; };\n /**\n * @param {?=} includeHash\n * @return {?}\n */\n HashLocationStrategy.prototype.path = /**\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n // the hash value is always prefixed with a `#`\n // and if it is empty then it will stay empty\n var /** @type {?} */ path = this._platformLocation.hash;\n if (path == null)\n path = '#';\n return path.length > 0 ? path.substring(1) : path;\n };\n /**\n * @param {?} internal\n * @return {?}\n */\n HashLocationStrategy.prototype.prepareExternalUrl = /**\n * @param {?} internal\n * @return {?}\n */\n function (internal) {\n var /** @type {?} */ url = Location.joinWithSlash(this._baseHref, internal);\n return url.length > 0 ? ('#' + url) : url;\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n HashLocationStrategy.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, path, queryParams) {\n var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.pushState(state, title, url);\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n HashLocationStrategy.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} path\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, path, queryParams) {\n var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.replaceState(state, title, url);\n };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.forward = /**\n * @return {?}\n */\n function () { this._platformLocation.forward(); };\n /**\n * @return {?}\n */\n HashLocationStrategy.prototype.back = /**\n * @return {?}\n */\n function () { this._platformLocation.back(); };\n HashLocationStrategy.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HashLocationStrategy.ctorParameters = function () { return [\n { type: PlatformLocation, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [APP_BASE_HREF,] },] },\n ]; };\n return HashLocationStrategy;\n}(LocationStrategy));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL for storing application location data.\n * \\@description\n * `PathLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you must provide a {\\@link APP_BASE_HREF}\n * or add a base element to the document. This URL prefix that will be preserved\n * when generating and recognizing URLs.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Similarly, if you add `<base href='/my/app'/>` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar PathLocationStrategy = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(PathLocationStrategy, _super);\n function PathLocationStrategy(_platformLocation, href) {\n var _this = _super.call(this) || this;\n _this._platformLocation = _platformLocation;\n if (href == null) {\n href = _this._platformLocation.getBaseHrefFromDOM();\n }\n if (href == null) {\n throw new Error(\"No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.\");\n }\n _this._baseHref = href;\n return _this;\n }\n /**\n * @param {?} fn\n * @return {?}\n */\n PathLocationStrategy.prototype.onPopState = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._platformLocation.onPopState(fn);\n this._platformLocation.onHashChange(fn);\n };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.getBaseHref = /**\n * @return {?}\n */\n function () { return this._baseHref; };\n /**\n * @param {?} internal\n * @return {?}\n */\n PathLocationStrategy.prototype.prepareExternalUrl = /**\n * @param {?} internal\n * @return {?}\n */\n function (internal) {\n return Location.joinWithSlash(this._baseHref, internal);\n };\n /**\n * @param {?=} includeHash\n * @return {?}\n */\n PathLocationStrategy.prototype.path = /**\n * @param {?=} includeHash\n * @return {?}\n */\n function (includeHash) {\n if (includeHash === void 0) { includeHash = false; }\n var /** @type {?} */ pathname = this._platformLocation.pathname +\n Location.normalizeQueryParams(this._platformLocation.search);\n var /** @type {?} */ hash = this._platformLocation.hash;\n return hash && includeHash ? \"\" + pathname + hash : pathname;\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n PathLocationStrategy.prototype.pushState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, url, queryParams) {\n var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n this._platformLocation.pushState(state, title, externalUrl);\n };\n /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n PathLocationStrategy.prototype.replaceState = /**\n * @param {?} state\n * @param {?} title\n * @param {?} url\n * @param {?} queryParams\n * @return {?}\n */\n function (state, title, url, queryParams) {\n var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n this._platformLocation.replaceState(state, title, externalUrl);\n };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.forward = /**\n * @return {?}\n */\n function () { this._platformLocation.forward(); };\n /**\n * @return {?}\n */\n PathLocationStrategy.prototype.back = /**\n * @return {?}\n */\n function () { this._platformLocation.back(); };\n PathLocationStrategy.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n PathLocationStrategy.ctorParameters = function () { return [\n { type: PlatformLocation, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [APP_BASE_HREF,] },] },\n ]; };\n return PathLocationStrategy;\n}(LocationStrategy));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n/**\n * \\@internal\n */\nvar CURRENCIES = {\n 'AOA': [, 'Kz'],\n 'ARS': [, '$'],\n 'AUD': ['A$', '$'],\n 'BAM': [, 'KM'],\n 'BBD': [, '$'],\n 'BDT': [, '৳'],\n 'BMD': [, '$'],\n 'BND': [, '$'],\n 'BOB': [, 'Bs'],\n 'BRL': ['R$'],\n 'BSD': [, '$'],\n 'BWP': [, 'P'],\n 'BYN': [, 'р.'],\n 'BZD': [, '$'],\n 'CAD': ['CA$', '$'],\n 'CLP': [, '$'],\n 'CNY': ['CN¥', '¥'],\n 'COP': [, '$'],\n 'CRC': [, '₡'],\n 'CUC': [, '$'],\n 'CUP': [, '$'],\n 'CZK': [, 'Kč'],\n 'DKK': [, 'kr'],\n 'DOP': [, '$'],\n 'EGP': [, 'E£'],\n 'ESP': [, '₧'],\n 'EUR': ['€'],\n 'FJD': [, '$'],\n 'FKP': [, '£'],\n 'GBP': ['£'],\n 'GEL': [, '₾'],\n 'GIP': [, '£'],\n 'GNF': [, 'FG'],\n 'GTQ': [, 'Q'],\n 'GYD': [, '$'],\n 'HKD': ['HK$', '$'],\n 'HNL': [, 'L'],\n 'HRK': [, 'kn'],\n 'HUF': [, 'Ft'],\n 'IDR': [, 'Rp'],\n 'ILS': ['₪'],\n 'INR': ['₹'],\n 'ISK': [, 'kr'],\n 'JMD': [, '$'],\n 'JPY': ['¥'],\n 'KHR': [, '៛'],\n 'KMF': [, 'CF'],\n 'KPW': [, '₩'],\n 'KRW': ['₩'],\n 'KYD': [, '$'],\n 'KZT': [, '₸'],\n 'LAK': [, '₭'],\n 'LBP': [, 'L£'],\n 'LKR': [, 'Rs'],\n 'LRD': [, '$'],\n 'LTL': [, 'Lt'],\n 'LVL': [, 'Ls'],\n 'MGA': [, 'Ar'],\n 'MMK': [, 'K'],\n 'MNT': [, '₮'],\n 'MUR': [, 'Rs'],\n 'MXN': ['MX$', '$'],\n 'MYR': [, 'RM'],\n 'NAD': [, '$'],\n 'NGN': [, '₦'],\n 'NIO': [, 'C$'],\n 'NOK': [, 'kr'],\n 'NPR': [, 'Rs'],\n 'NZD': ['NZ$', '$'],\n 'PHP': [, '₱'],\n 'PKR': [, 'Rs'],\n 'PLN': [, 'zł'],\n 'PYG': [, '₲'],\n 'RON': [, 'lei'],\n 'RUB': [, '₽'],\n 'RUR': [, 'р.'],\n 'RWF': [, 'RF'],\n 'SBD': [, '$'],\n 'SEK': [, 'kr'],\n 'SGD': [, '$'],\n 'SHP': [, '£'],\n 'SRD': [, '$'],\n 'SSP': [, '£'],\n 'STD': [, 'Db'],\n 'SYP': [, '£'],\n 'THB': [, '฿'],\n 'TOP': [, 'T$'],\n 'TRY': [, '₺'],\n 'TTD': [, '$'],\n 'TWD': ['NT$', '$'],\n 'UAH': [, '₴'],\n 'USD': ['$'],\n 'UYU': [, '$'],\n 'VEF': [, 'Bs'],\n 'VND': ['₫'],\n 'XAF': ['FCFA'],\n 'XCD': ['EC$', '$'],\n 'XOF': ['CFA'],\n 'XPF': ['CFPF'],\n 'ZAR': [, 'R'],\n 'ZMW': [, 'ZK'],\n};\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n/**\n * @param {?} n\n * @return {?}\n */\nfunction plural(n) {\n var /** @type {?} */ i = Math.floor(Math.abs(n)), /** @type {?} */ v = n.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0)\n return 1;\n return 5;\n}\nvar localeEn = [\n 'en',\n [\n ['a', 'p'],\n ['AM', 'PM'],\n ],\n [\n ['AM', 'PM'],\n ,\n ],\n [\n ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\n ],\n ,\n [\n ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n [\n 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ]\n ],\n ,\n [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 0, [6, 0],\n ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],\n ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],\n [\n '{1}, {0}',\n ,\n '{1} \\'at\\' {0}',\n ],\n ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],\n ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'US Dollar', plural\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental i18n support is experimental.\n */\nvar LOCALE_DATA = {};\n/**\n * Register global data to be used internally by Angular. See the\n * {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} data\n * @param {?=} localeId\n * @param {?=} extraData\n * @return {?}\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[0 /* LocaleId */];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][18 /* ExtraData */] = extraData;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar NumberFormatStyle = {\n Decimal: 0,\n Percent: 1,\n Currency: 2,\n Scientific: 3,\n};\nNumberFormatStyle[NumberFormatStyle.Decimal] = \"Decimal\";\nNumberFormatStyle[NumberFormatStyle.Percent] = \"Percent\";\nNumberFormatStyle[NumberFormatStyle.Currency] = \"Currency\";\nNumberFormatStyle[NumberFormatStyle.Scientific] = \"Scientific\";\n/** @enum {number} */\nvar Plural = {\n Zero: 0,\n One: 1,\n Two: 2,\n Few: 3,\n Many: 4,\n Other: 5,\n};\nPlural[Plural.Zero] = \"Zero\";\nPlural[Plural.One] = \"One\";\nPlural[Plural.Two] = \"Two\";\nPlural[Plural.Few] = \"Few\";\nPlural[Plural.Many] = \"Many\";\nPlural[Plural.Other] = \"Other\";\n/** @enum {number} */\nvar FormStyle = {\n Format: 0,\n Standalone: 1,\n};\nFormStyle[FormStyle.Format] = \"Format\";\nFormStyle[FormStyle.Standalone] = \"Standalone\";\n/** @enum {number} */\nvar TranslationWidth = {\n Narrow: 0,\n Abbreviated: 1,\n Wide: 2,\n Short: 3,\n};\nTranslationWidth[TranslationWidth.Narrow] = \"Narrow\";\nTranslationWidth[TranslationWidth.Abbreviated] = \"Abbreviated\";\nTranslationWidth[TranslationWidth.Wide] = \"Wide\";\nTranslationWidth[TranslationWidth.Short] = \"Short\";\n/** @enum {number} */\nvar FormatWidth = {\n Short: 0,\n Medium: 1,\n Long: 2,\n Full: 3,\n};\nFormatWidth[FormatWidth.Short] = \"Short\";\nFormatWidth[FormatWidth.Medium] = \"Medium\";\nFormatWidth[FormatWidth.Long] = \"Long\";\nFormatWidth[FormatWidth.Full] = \"Full\";\n/** @enum {number} */\nvar NumberSymbol = {\n Decimal: 0,\n Group: 1,\n List: 2,\n PercentSign: 3,\n PlusSign: 4,\n MinusSign: 5,\n Exponential: 6,\n SuperscriptingExponent: 7,\n PerMille: 8,\n Infinity: 9,\n NaN: 10,\n TimeSeparator: 11,\n CurrencyDecimal: 12,\n CurrencyGroup: 13,\n};\nNumberSymbol[NumberSymbol.Decimal] = \"Decimal\";\nNumberSymbol[NumberSymbol.Group] = \"Group\";\nNumberSymbol[NumberSymbol.List] = \"List\";\nNumberSymbol[NumberSymbol.PercentSign] = \"PercentSign\";\nNumberSymbol[NumberSymbol.PlusSign] = \"PlusSign\";\nNumberSymbol[NumberSymbol.MinusSign] = \"MinusSign\";\nNumberSymbol[NumberSymbol.Exponential] = \"Exponential\";\nNumberSymbol[NumberSymbol.SuperscriptingExponent] = \"SuperscriptingExponent\";\nNumberSymbol[NumberSymbol.PerMille] = \"PerMille\";\nNumberSymbol[NumberSymbol.Infinity] = \"Infinity\";\nNumberSymbol[NumberSymbol.NaN] = \"NaN\";\nNumberSymbol[NumberSymbol.TimeSeparator] = \"TimeSeparator\";\nNumberSymbol[NumberSymbol.CurrencyDecimal] = \"CurrencyDecimal\";\nNumberSymbol[NumberSymbol.CurrencyGroup] = \"CurrencyGroup\";\n/** @enum {number} */\nvar WeekDay = {\n Sunday: 0,\n Monday: 1,\n Tuesday: 2,\n Wednesday: 3,\n Thursday: 4,\n Friday: 5,\n Saturday: 6,\n};\nWeekDay[WeekDay.Sunday] = \"Sunday\";\nWeekDay[WeekDay.Monday] = \"Monday\";\nWeekDay[WeekDay.Tuesday] = \"Tuesday\";\nWeekDay[WeekDay.Wednesday] = \"Wednesday\";\nWeekDay[WeekDay.Thursday] = \"Thursday\";\nWeekDay[WeekDay.Friday] = \"Friday\";\nWeekDay[WeekDay.Saturday] = \"Saturday\";\n/**\n * The locale id for the chosen locale (e.g `en-GB`).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleId(locale) {\n return findLocaleData(locale)[0 /* LocaleId */];\n}\n/**\n * Periods of the day (e.g. `[AM, PM]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDayPeriods(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ amPmData = /** @type {?} */ ([data[1 /* DayPeriodsFormat */], data[2 /* DayPeriodsStandalone */]]);\n var /** @type {?} */ amPm = getLastDefinedValue(amPmData, formStyle);\n return getLastDefinedValue(amPm, width);\n}\n/**\n * Days of the week for the Gregorian calendar (e.g. `[Sunday, Monday, ... Saturday]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDayNames(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ daysData = /** @type {?} */ ([data[3 /* DaysFormat */], data[4 /* DaysStandalone */]]);\n var /** @type {?} */ days = getLastDefinedValue(daysData, formStyle);\n return getLastDefinedValue(days, width);\n}\n/**\n * Months of the year for the Gregorian calendar (e.g. `[January, February, ...]` for en-US).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleMonthNames(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ monthsData = /** @type {?} */ ([data[5 /* MonthsFormat */], data[6 /* MonthsStandalone */]]);\n var /** @type {?} */ months = getLastDefinedValue(monthsData, formStyle);\n return getLastDefinedValue(months, width);\n}\n/**\n * Eras for the Gregorian calendar (e.g. AD/BC).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleEraNames(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ erasData = /** @type {?} */ (data[7 /* Eras */]);\n return getLastDefinedValue(erasData, width);\n}\n/**\n * First day of the week for this locale, based on english days (Sunday = 0, Monday = 1, ...).\n * For example in french the value would be 1 because the first day of the week is Monday.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleFirstDayOfWeek(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[8 /* FirstDayOfWeek */];\n}\n/**\n * Range of days in the week that represent the week-end for this locale, based on english days\n * (Sunday = 0, Monday = 1, ...).\n * For example in english the value would be [6,0] for Saturday to Sunday.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleWeekEndRange(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[9 /* WeekendRange */];\n}\n/**\n * Date format that depends on the locale.\n *\n * There are four basic date formats:\n * - `full` should contain long-weekday (EEEE), year (y), long-month (MMMM), day (d).\n *\n * For example, English uses `EEEE, MMMM d, y`, corresponding to a date like\n * \"Tuesday, September 14, 1999\".\n *\n * - `long` should contain year, long-month, day.\n *\n * For example, `MMMM d, y`, corresponding to a date like \"September 14, 1999\".\n *\n * - `medium` should contain year, abbreviated-month (MMM), day.\n *\n * For example, `MMM d, y`, corresponding to a date like \"Sep 14, 1999\".\n * For languages that do not use abbreviated months, use the numeric month (MM/M). For example,\n * `y/MM/dd`, corresponding to a date like \"1999/09/14\".\n *\n * - `short` should contain year, numeric-month (MM/M), and day.\n *\n * For example, `M/d/yy`, corresponding to a date like \"9/14/99\".\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDateFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n return getLastDefinedValue(data[10 /* DateFormat */], width);\n}\n/**\n * Time format that depends on the locale.\n *\n * The standard formats include four basic time formats:\n * - `full` should contain hour (h/H), minute (mm), second (ss), and zone (zzzz).\n * - `long` should contain hour, minute, second, and zone (z)\n * - `medium` should contain hour, minute, second.\n * - `short` should contain hour, minute.\n *\n * Note: The patterns depend on whether the main country using your language uses 12-hour time or\n * not:\n * - For 12-hour time, use a pattern like `hh:mm a` using h to mean a 12-hour clock cycle running\n * 1 through 12 (midnight plus 1 minute is 12:01), or using K to mean a 12-hour clock cycle\n * running 0 through 11 (midnight plus 1 minute is 0:01).\n * - For 24-hour time, use a pattern like `HH:mm` using H to mean a 24-hour clock cycle running 0\n * through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running\n * 1 through 24 (midnight plus 1 minute is 24:01).\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleTimeFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n return getLastDefinedValue(data[11 /* TimeFormat */], width);\n}\n/**\n * Date-time format that depends on the locale.\n *\n * The date-time pattern shows how to combine separate patterns for date (represented by {1})\n * and time (represented by {0}) into a single pattern. It usually doesn't need to be changed.\n * What you want to pay attention to are:\n * - possibly removing a space for languages that don't use it, such as many East Asian languages\n * - possibly adding a comma, other punctuation, or a combining word\n *\n * For example:\n * - English uses `{1} 'at' {0}` or `{1}, {0}` (depending on date style), while Japanese uses\n * `{1}{0}`.\n * - An English formatted date-time using the combining pattern `{1}, {0}` could be\n * `Dec 10, 2010, 3:59:49 PM`. Notice the comma and space between the date portion and the time\n * portion.\n *\n * There are four formats (`full`, `long`, `medium`, `short`); the determination of which to use\n * is normally based on the date style. For example, if the date has a full month and weekday\n * name, the full combining pattern will be used to combine that with a time. If the date has\n * numeric month, the short version of the combining pattern will be used to combine that with a\n * time. English uses `{1} 'at' {0}` for full and long styles, and `{1}, {0}` for medium and short\n * styles.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleDateTimeFormat(locale, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ dateTimeFormatData = /** @type {?} */ (data[12 /* DateTimeFormat */]);\n return getLastDefinedValue(dateTimeFormatData, width);\n}\n/**\n * Number symbol that can be used to replace placeholders in number formats.\n * See {\\@link NumberSymbol} for more information.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} symbol\n * @return {?}\n */\nfunction getLocaleNumberSymbol(locale, symbol) {\n var /** @type {?} */ data = findLocaleData(locale);\n var /** @type {?} */ res = data[13 /* NumberSymbols */][symbol];\n if (typeof res === 'undefined') {\n if (symbol === NumberSymbol.CurrencyDecimal) {\n return data[13 /* NumberSymbols */][NumberSymbol.Decimal];\n }\n else if (symbol === NumberSymbol.CurrencyGroup) {\n return data[13 /* NumberSymbols */][NumberSymbol.Group];\n }\n }\n return res;\n}\n/**\n * Number format that depends on the locale.\n *\n * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`\n * when used to format the number 12345.678 could result in \"12'345,67\". That would happen if the\n * grouping separator for your language is an apostrophe, and the decimal separator is a comma.\n *\n * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders;\n * they stand for the decimal separator, and so on, and are NOT real characters.\n * You must NOT \"translate\" the placeholders; for example, don't change `.` to `,` even though in\n * your language the decimal point is written with a comma. The symbols should be replaced by the\n * local equivalents, using the Number Symbols for your language.\n *\n * Here are the special characters used in number patterns:\n *\n * | Symbol | Meaning |\n * |--------|---------|\n * | . | Replaced automatically by the character used for the decimal point. |\n * | , | Replaced by the \"grouping\" (thousands) separator. |\n * | 0 | Replaced by a digit (or zero if there aren't enough digits). |\n * | # | Replaced by a digit (or nothing if there aren't enough). |\n * | ¤ | This will be replaced by a currency symbol, such as $ or USD. |\n * | % | This marks a percent format. The % symbol may change position, but must be retained. |\n * | E | This marks a scientific format. The E symbol may change position, but must be retained. |\n * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |\n *\n * You can find more information\n * [on the CLDR website](http://cldr.unicode.org/translation/number-patterns)\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} type\n * @return {?}\n */\nfunction getLocaleNumberFormat(locale, type) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[14 /* NumberFormats */][type];\n}\n/**\n * The symbol used to represent the currency for the main country using this locale (e.g. $ for\n * the locale en-US).\n * The symbol will be `null` if the main country cannot be determined.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleCurrencySymbol(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[15 /* CurrencySymbol */] || null;\n}\n/**\n * The name of the currency for the main country using this locale (e.g. USD for the locale\n * en-US).\n * The name will be `null` if the main country cannot be determined.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleCurrencyName(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[16 /* CurrencyName */] || null;\n}\n/**\n * The locale plural function used by ICU expressions to determine the plural case to use.\n * See {\\@link NgPlural} for more information.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocalePluralCase(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n return data[17 /* PluralCase */];\n}\n/**\n * @param {?} data\n * @return {?}\n */\nfunction checkFullData(data) {\n if (!data[18 /* ExtraData */]) {\n throw new Error(\"Missing extra locale data for the locale \\\"\" + data[0 /* LocaleId */] + \"\\\". Use \\\"registerLocaleData\\\" to load new data. See the \\\"I18n guide\\\" on angular.io to know more.\");\n }\n}\n/**\n * Rules used to determine which day period to use (See `dayPeriods` below).\n * The rules can either be an array or a single value. If it's an array, consider it as \"from\"\n * and \"to\". If it's a single value then it means that the period is only valid at this exact\n * value.\n * There is always the same number of rules as the number of day periods, which means that the\n * first rule is applied to the first day period and so on.\n * You should fallback to AM/PM when there are no rules available.\n *\n * Note: this is only available if you load the full locale data.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction getLocaleExtraDayPeriodRules(locale) {\n var /** @type {?} */ data = findLocaleData(locale);\n checkFullData(data);\n var /** @type {?} */ rules = data[18 /* ExtraData */][2 /* ExtraDayPeriodsRules */] || [];\n return rules.map(function (rule) {\n if (typeof rule === 'string') {\n return extractTime(rule);\n }\n return [extractTime(rule[0]), extractTime(rule[1])];\n });\n}\n/**\n * Day Periods indicate roughly how the day is broken up in different languages (e.g. morning,\n * noon, afternoon, midnight, ...).\n * You should use the function {\\@link getLocaleExtraDayPeriodRules} to determine which period to\n * use.\n * You should fallback to AM/PM when there are no day periods available.\n *\n * Note: this is only available if you load the full locale data.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @param {?} formStyle\n * @param {?} width\n * @return {?}\n */\nfunction getLocaleExtraDayPeriods(locale, formStyle, width) {\n var /** @type {?} */ data = findLocaleData(locale);\n checkFullData(data);\n var /** @type {?} */ dayPeriodsData = /** @type {?} */ ([\n data[18 /* ExtraData */][0 /* ExtraDayPeriodFormats */],\n data[18 /* ExtraData */][1 /* ExtraDayPeriodStandalone */]\n ]);\n var /** @type {?} */ dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];\n return getLastDefinedValue(dayPeriods, width) || [];\n}\n/**\n * Returns the first value that is defined in an array, going backwards.\n *\n * To avoid repeating the same data (e.g. when \"format\" and \"standalone\" are the same) we only\n * add the first one to the locale data arrays, the other ones are only defined when different.\n * We use this function to retrieve the first defined value.\n *\n * \\@experimental i18n support is experimental.\n * @template T\n * @param {?} data\n * @param {?} index\n * @return {?}\n */\nfunction getLastDefinedValue(data, index) {\n for (var /** @type {?} */ i = index; i > -1; i--) {\n if (typeof data[i] !== 'undefined') {\n return data[i];\n }\n }\n throw new Error('Locale data API: locale data undefined');\n}\n/**\n * Extract the hours and minutes from a string like \"15:45\"\n * @param {?} time\n * @return {?}\n */\nfunction extractTime(time) {\n var _a = time.split(':'), h = _a[0], m = _a[1];\n return { hours: +h, minutes: +m };\n}\n/**\n * Finds the locale data for a locale id\n *\n * \\@experimental i18n support is experimental.\n * @param {?} locale\n * @return {?}\n */\nfunction findLocaleData(locale) {\n var /** @type {?} */ normalizedLocale = locale.toLowerCase().replace(/_/g, '-');\n var /** @type {?} */ match = LOCALE_DATA[normalizedLocale];\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n var /** @type {?} */ parentLocale = normalizedLocale.split('-')[0];\n match = LOCALE_DATA[parentLocale];\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new Error(\"Missing locale data for the locale \\\"\" + locale + \"\\\".\");\n}\n/**\n * Return the currency symbol for a given currency code, or the code if no symbol available\n * (e.g.: format narrow = $, format wide = US$, code = USD)\n *\n * \\@experimental i18n support is experimental.\n * @param {?} code\n * @param {?} format\n * @return {?}\n */\nfunction getCurrencySymbol(code, format) {\n var /** @type {?} */ currency = CURRENCIES[code] || [];\n var /** @type {?} */ symbolNarrow = currency[1];\n if (format === 'narrow' && typeof symbolNarrow === 'string') {\n return symbolNarrow;\n }\n return currency[0] || code;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @deprecated from v5\n */\nvar DEPRECATED_PLURAL_FN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('UseV4Plurals');\n/**\n * \\@experimental\n * @abstract\n */\nvar NgLocalization = /** @class */ (function () {\n function NgLocalization() {\n }\n return NgLocalization;\n}());\n/**\n * Returns the plural category for a given value.\n * - \"=value\" when the case exists,\n * - the plural category otherwise\n * @param {?} value\n * @param {?} cases\n * @param {?} ngLocalization\n * @param {?=} locale\n * @return {?}\n */\nfunction getPluralCategory(value, cases, ngLocalization, locale) {\n var /** @type {?} */ key = \"=\" + value;\n if (cases.indexOf(key) > -1) {\n return key;\n }\n key = ngLocalization.getPluralCategory(value, locale);\n if (cases.indexOf(key) > -1) {\n return key;\n }\n if (cases.indexOf('other') > -1) {\n return 'other';\n }\n throw new Error(\"No plural message found for value \\\"\" + value + \"\\\"\");\n}\n/**\n * Returns the plural case based on the locale\n *\n * \\@experimental\n */\nvar NgLocaleLocalization = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"b\" /* __extends */])(NgLocaleLocalization, _super);\n function NgLocaleLocalization(locale, /** @deprecated from v5 */\n deprecatedPluralFn) {\n var _this = _super.call(this) || this;\n _this.locale = locale;\n _this.deprecatedPluralFn = deprecatedPluralFn;\n return _this;\n }\n /**\n * @param {?} value\n * @param {?=} locale\n * @return {?}\n */\n NgLocaleLocalization.prototype.getPluralCategory = /**\n * @param {?} value\n * @param {?=} locale\n * @return {?}\n */\n function (value, locale) {\n var /** @type {?} */ plural = this.deprecatedPluralFn ? this.deprecatedPluralFn(locale || this.locale, value) :\n getLocalePluralCase(locale || this.locale)(value);\n switch (plural) {\n case Plural.Zero:\n return 'zero';\n case Plural.One:\n return 'one';\n case Plural.Two:\n return 'two';\n case Plural.Few:\n return 'few';\n case Plural.Many:\n return 'many';\n default:\n return 'other';\n }\n };\n NgLocaleLocalization.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgLocaleLocalization.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [DEPRECATED_PLURAL_FN,] },] },\n ]; };\n return NgLocaleLocalization;\n}(NgLocalization));\n/**\n * Returns the plural case based on the locale\n *\n * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts\n * \\@experimental\n * @param {?} locale\n * @param {?} nLike\n * @return {?}\n */\nfunction getPluralCase(locale, nLike) {\n // TODO(vicb): lazy compute\n if (typeof nLike === 'string') {\n nLike = parseInt(/** @type {?} */ (nLike), 10);\n }\n var /** @type {?} */ n = /** @type {?} */ (nLike);\n var /** @type {?} */ nDecimal = n.toString().replace(/^[^.]*\\.?/, '');\n var /** @type {?} */ i = Math.floor(Math.abs(n));\n var /** @type {?} */ v = nDecimal.length;\n var /** @type {?} */ f = parseInt(nDecimal, 10);\n var /** @type {?} */ t = parseInt(n.toString().replace(/^[^.]*\\.?|0+$/g, ''), 10) || 0;\n var /** @type {?} */ lang = locale.split('-')[0].toLowerCase();\n switch (lang) {\n case 'af':\n case 'asa':\n case 'az':\n case 'bem':\n case 'bez':\n case 'bg':\n case 'brx':\n case 'ce':\n case 'cgg':\n case 'chr':\n case 'ckb':\n case 'ee':\n case 'el':\n case 'eo':\n case 'es':\n case 'eu':\n case 'fo':\n case 'fur':\n case 'gsw':\n case 'ha':\n case 'haw':\n case 'hu':\n case 'jgo':\n case 'jmc':\n case 'ka':\n case 'kk':\n case 'kkj':\n case 'kl':\n case 'ks':\n case 'ksb':\n case 'ky':\n case 'lb':\n case 'lg':\n case 'mas':\n case 'mgo':\n case 'ml':\n case 'mn':\n case 'nb':\n case 'nd':\n case 'ne':\n case 'nn':\n case 'nnh':\n case 'nyn':\n case 'om':\n case 'or':\n case 'os':\n case 'ps':\n case 'rm':\n case 'rof':\n case 'rwk':\n case 'saq':\n case 'seh':\n case 'sn':\n case 'so':\n case 'sq':\n case 'ta':\n case 'te':\n case 'teo':\n case 'tk':\n case 'tr':\n case 'ug':\n case 'uz':\n case 'vo':\n case 'vun':\n case 'wae':\n case 'xog':\n if (n === 1)\n return Plural.One;\n return Plural.Other;\n case 'ak':\n case 'ln':\n case 'mg':\n case 'pa':\n case 'ti':\n if (n === Math.floor(n) && n >= 0 && n <= 1)\n return Plural.One;\n return Plural.Other;\n case 'am':\n case 'as':\n case 'bn':\n case 'fa':\n case 'gu':\n case 'hi':\n case 'kn':\n case 'mr':\n case 'zu':\n if (i === 0 || n === 1)\n return Plural.One;\n return Plural.Other;\n case 'ar':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99)\n return Plural.Many;\n return Plural.Other;\n case 'ast':\n case 'ca':\n case 'de':\n case 'en':\n case 'et':\n case 'fi':\n case 'fy':\n case 'gl':\n case 'it':\n case 'nl':\n case 'sv':\n case 'sw':\n case 'ur':\n case 'yi':\n if (i === 1 && v === 0)\n return Plural.One;\n return Plural.Other;\n case 'be':\n if (n % 10 === 1 && !(n % 100 === 11))\n return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&\n !(n % 100 >= 12 && n % 100 <= 14))\n return Plural.Few;\n if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||\n n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'br':\n if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))\n return Plural.One;\n if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))\n return Plural.Two;\n if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&\n !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||\n n % 100 >= 90 && n % 100 <= 99))\n return Plural.Few;\n if (!(n === 0) && n % 1e6 === 0)\n return Plural.Many;\n return Plural.Other;\n case 'bs':\n case 'hr':\n case 'sr':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14) ||\n f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&\n !(f % 100 >= 12 && f % 100 <= 14))\n return Plural.Few;\n return Plural.Other;\n case 'cs':\n case 'sk':\n if (i === 1 && v === 0)\n return Plural.One;\n if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0)\n return Plural.Few;\n if (!(v === 0))\n return Plural.Many;\n return Plural.Other;\n case 'cy':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n === 3)\n return Plural.Few;\n if (n === 6)\n return Plural.Many;\n return Plural.Other;\n case 'da':\n if (n === 1 || !(t === 0) && (i === 0 || i === 1))\n return Plural.One;\n return Plural.Other;\n case 'dsb':\n case 'hsb':\n if (v === 0 && i % 100 === 1 || f % 100 === 1)\n return Plural.One;\n if (v === 0 && i % 100 === 2 || f % 100 === 2)\n return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||\n f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)\n return Plural.Few;\n return Plural.Other;\n case 'ff':\n case 'fr':\n case 'hy':\n case 'kab':\n if (i === 0 || i === 1)\n return Plural.One;\n return Plural.Other;\n case 'fil':\n if (v === 0 && (i === 1 || i === 2 || i === 3) ||\n v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||\n !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))\n return Plural.One;\n return Plural.Other;\n case 'ga':\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n if (n === Math.floor(n) && n >= 3 && n <= 6)\n return Plural.Few;\n if (n === Math.floor(n) && n >= 7 && n <= 10)\n return Plural.Many;\n return Plural.Other;\n case 'gd':\n if (n === 1 || n === 11)\n return Plural.One;\n if (n === 2 || n === 12)\n return Plural.Two;\n if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19))\n return Plural.Few;\n return Plural.Other;\n case 'gv':\n if (v === 0 && i % 10 === 1)\n return Plural.One;\n if (v === 0 && i % 10 === 2)\n return Plural.Two;\n if (v === 0 &&\n (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))\n return Plural.Few;\n if (!(v === 0))\n return Plural.Many;\n return Plural.Other;\n case 'he':\n if (i === 1 && v === 0)\n return Plural.One;\n if (i === 2 && v === 0)\n return Plural.Two;\n if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0)\n return Plural.Many;\n return Plural.Other;\n case 'is':\n if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0))\n return Plural.One;\n return Plural.Other;\n case 'ksh':\n if (n === 0)\n return Plural.Zero;\n if (n === 1)\n return Plural.One;\n return Plural.Other;\n case 'kw':\n case 'naq':\n case 'se':\n case 'smn':\n if (n === 1)\n return Plural.One;\n if (n === 2)\n return Plural.Two;\n return Plural.Other;\n case 'lag':\n if (n === 0)\n return Plural.Zero;\n if ((i === 0 || i === 1) && !(n === 0))\n return Plural.One;\n return Plural.Other;\n case 'lt':\n if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&\n !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.Few;\n if (!(f === 0))\n return Plural.Many;\n return Plural.Other;\n case 'lv':\n case 'prg':\n if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||\n v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)\n return Plural.Zero;\n if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||\n !(v === 2) && f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mk':\n if (v === 0 && i % 10 === 1 || f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mt':\n if (n === 1)\n return Plural.One;\n if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19)\n return Plural.Many;\n return Plural.Other;\n case 'pl':\n if (i === 1 && v === 0)\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'pt':\n if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2))\n return Plural.One;\n return Plural.Other;\n case 'ro':\n if (i === 1 && v === 0)\n return Plural.One;\n if (!(v === 0) || n === 0 ||\n !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)\n return Plural.Few;\n return Plural.Other;\n case 'ru':\n case 'uk':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && i % 10 === 0 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'shi':\n if (i === 0 || n === 1)\n return Plural.One;\n if (n === Math.floor(n) && n >= 2 && n <= 10)\n return Plural.Few;\n return Plural.Other;\n case 'si':\n if (n === 0 || n === 1 || i === 0 && f === 1)\n return Plural.One;\n return Plural.Other;\n case 'sl':\n if (v === 0 && i % 100 === 1)\n return Plural.One;\n if (v === 0 && i % 100 === 2)\n return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))\n return Plural.Few;\n return Plural.Other;\n case 'tzm':\n if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)\n return Plural.One;\n return Plural.Other;\n // When there is no specification, the default is always \"other\"\n // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules\n // > other (required—general plural form — also used if the language only has a single form)\n default:\n return Plural.Other;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} cookieStr\n * @param {?} name\n * @return {?}\n */\nfunction parseCookieValue(cookieStr, name) {\n name = encodeURIComponent(name);\n for (var _i = 0, _a = cookieStr.split(';'); _i < _a.length; _i++) {\n var cookie = _a[_i];\n var /** @type {?} */ eqIndex = cookie.indexOf('=');\n var _b = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], cookieName = _b[0], cookieValue = _b[1];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds and removes CSS classes on an HTML element.\n *\n * \\@howToUse\n * ```\n * <some-element [ngClass]=\"'first second'\">...</some-element>\n *\n * <some-element [ngClass]=\"['first', 'second']\">...</some-element>\n *\n * <some-element [ngClass]=\"{'first': true, 'second': true, 'third': false}\">...</some-element>\n *\n * <some-element [ngClass]=\"stringExp|arrayExp|objExp\">...</some-element>\n *\n * <some-element [ngClass]=\"{'class1 class2 class3' : true}\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n * - `string` - the CSS classes listed in the string (space delimited) are added,\n * - `Array` - the CSS classes declared as Array elements are added,\n * - `Object` - keys are CSS classes that get added when the expression given in the value\n * evaluates to a truthy value, otherwise they are removed.\n *\n * \\@stable\n */\nvar NgClass = /** @class */ (function () {\n function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {\n this._iterableDiffers = _iterableDiffers;\n this._keyValueDiffers = _keyValueDiffers;\n this._ngEl = _ngEl;\n this._renderer = _renderer;\n this._initialClasses = [];\n }\n Object.defineProperty(NgClass.prototype, \"klass\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._applyInitialClasses(true);\n this._initialClasses = typeof v === 'string' ? v.split(/\\s+/) : [];\n this._applyInitialClasses(false);\n this._applyClasses(this._rawClass, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgClass.prototype, \"ngClass\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._cleanupClasses(this._rawClass);\n this._iterableDiffer = null;\n this._keyValueDiffer = null;\n this._rawClass = typeof v === 'string' ? v.split(/\\s+/) : v;\n if (this._rawClass) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisListLikeIterable\"])(this._rawClass)) {\n this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();\n }\n else {\n this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgClass.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._iterableDiffer) {\n var /** @type {?} */ iterableChanges = this._iterableDiffer.diff(/** @type {?} */ (this._rawClass));\n if (iterableChanges) {\n this._applyIterableChanges(iterableChanges);\n }\n }\n else if (this._keyValueDiffer) {\n var /** @type {?} */ keyValueChanges = this._keyValueDiffer.diff(/** @type {?} */ (this._rawClass));\n if (keyValueChanges) {\n this._applyKeyValueChanges(keyValueChanges);\n }\n }\n };\n /**\n * @param {?} rawClassVal\n * @return {?}\n */\n NgClass.prototype._cleanupClasses = /**\n * @param {?} rawClassVal\n * @return {?}\n */\n function (rawClassVal) {\n this._applyClasses(rawClassVal, true);\n this._applyInitialClasses(false);\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgClass.prototype._applyKeyValueChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n changes.forEachRemovedItem(function (record) {\n if (record.previousValue) {\n _this._toggleClass(record.key, false);\n }\n });\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgClass.prototype._applyIterableChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachAddedItem(function (record) {\n if (typeof record.item === 'string') {\n _this._toggleClass(record.item, true);\n }\n else {\n throw new Error(\"NgClass can only toggle CSS classes expressed as strings, got \" + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵstringify\"])(record.item));\n }\n });\n changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });\n };\n /**\n * @param {?} isCleanup\n * @return {?}\n */\n NgClass.prototype._applyInitialClasses = /**\n * @param {?} isCleanup\n * @return {?}\n */\n function (isCleanup) {\n var _this = this;\n this._initialClasses.forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n };\n /**\n * @param {?} rawClassVal\n * @param {?} isCleanup\n * @return {?}\n */\n NgClass.prototype._applyClasses = /**\n * @param {?} rawClassVal\n * @param {?} isCleanup\n * @return {?}\n */\n function (rawClassVal, isCleanup) {\n var _this = this;\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n (/** @type {?} */ (rawClassVal)).forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n }\n else {\n Object.keys(rawClassVal).forEach(function (klass) {\n if (rawClassVal[klass] != null)\n _this._toggleClass(klass, !isCleanup);\n });\n }\n }\n };\n /**\n * @param {?} klass\n * @param {?} enabled\n * @return {?}\n */\n NgClass.prototype._toggleClass = /**\n * @param {?} klass\n * @param {?} enabled\n * @return {?}\n */\n function (klass, enabled) {\n var _this = this;\n klass = klass.trim();\n if (klass) {\n klass.split(/\\s+/g).forEach(function (klass) {\n if (enabled) {\n _this._renderer.addClass(_this._ngEl.nativeElement, klass);\n }\n else {\n _this._renderer.removeClass(_this._ngEl.nativeElement, klass);\n }\n });\n }\n };\n NgClass.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngClass]' },] },\n ];\n /** @nocollapse */\n NgClass.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"IterableDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"KeyValueDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n NgClass.propDecorators = {\n \"klass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['class',] },],\n \"ngClass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgClass;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Instantiates a single {\\@link Component} type and inserts its Host View into current View.\n * `NgComponentOutlet` provides a declarative approach for dynamic component creation.\n *\n * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and\n * any existing component will get destroyed.\n *\n * ### Fine tune control\n *\n * You can control the component creation process by using the following optional attributes:\n *\n * * `ngComponentOutletInjector`: Optional custom {\\@link Injector} that will be used as parent for\n * the Component. Defaults to the injector of the current view container.\n *\n * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content\n * section of the component, if exists.\n *\n * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other\n * module, then load a component from that module.\n *\n * ### Syntax\n *\n * Simple\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression\"></ng-container>\n * ```\n *\n * Customized injector/content\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n * injector: injectorExpression;\n * content: contentNodesExpression;\">\n * </ng-container>\n * ```\n *\n * Customized ngModuleFactory\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n * ngModuleFactory: moduleFactory;\">\n * </ng-container>\n * ```\n * ## Example\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}\n *\n * A more complete example with additional options:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}\n * A more complete example with ngModuleFactory:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}\n *\n * \\@experimental\n */\nvar NgComponentOutlet = /** @class */ (function () {\n function NgComponentOutlet(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n this._componentRef = null;\n this._moduleRef = null;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgComponentOutlet.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._viewContainerRef.clear();\n this._componentRef = null;\n if (this.ngComponentOutlet) {\n var /** @type {?} */ elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;\n if (changes['ngComponentOutletNgModuleFactory']) {\n if (this._moduleRef)\n this._moduleRef.destroy();\n if (this.ngComponentOutletNgModuleFactory) {\n var /** @type {?} */ parentModule = elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModuleRef\"]);\n this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);\n }\n else {\n this._moduleRef = null;\n }\n }\n var /** @type {?} */ componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :\n elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"]);\n var /** @type {?} */ componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);\n this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);\n }\n };\n /**\n * @return {?}\n */\n NgComponentOutlet.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._moduleRef)\n this._moduleRef.destroy();\n };\n NgComponentOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngComponentOutlet]' },] },\n ];\n /** @nocollapse */\n NgComponentOutlet.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n ]; };\n NgComponentOutlet.propDecorators = {\n \"ngComponentOutlet\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletInjector\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletContent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngComponentOutletNgModuleFactory\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgComponentOutlet;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar NgForOfContext = /** @class */ (function () {\n function NgForOfContext($implicit, ngForOf, index, count) {\n this.$implicit = $implicit;\n this.ngForOf = ngForOf;\n this.index = index;\n this.count = count;\n }\n Object.defineProperty(NgForOfContext.prototype, \"first\", {\n get: /**\n * @return {?}\n */\n function () { return this.index === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"last\", {\n get: /**\n * @return {?}\n */\n function () { return this.index === this.count - 1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"even\", {\n get: /**\n * @return {?}\n */\n function () { return this.index % 2 === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOfContext.prototype, \"odd\", {\n get: /**\n * @return {?}\n */\n function () { return !this.even; },\n enumerable: true,\n configurable: true\n });\n return NgForOfContext;\n}());\n/**\n * The `NgForOf` directive instantiates a template once per item from an iterable. The context\n * for each instantiated template inherits from the outer context with the given loop variable\n * set to the current item from the iterable.\n *\n * ### Local Variables\n *\n * `NgForOf` provides several exported values that can be aliased to local variables:\n *\n * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe (`userStreams |\n * async`).\n * - `index: number`: The index of the current item in the iterable.\n * - `first: boolean`: True when the item is the first item in the iterable.\n * - `last: boolean`: True when the item is the last item in the iterable.\n * - `even: boolean`: True when the item has an even index in the iterable.\n * - `odd: boolean`: True when the item has an odd index in the iterable.\n *\n * ```\n * <li *ngFor=\"let user of userObservable | async as users; index as i; first as isFirst\">\n * {{i}}/{{users.length}}. {{user}} <span *ngIf=\"isFirst\">default</span>\n * </li>\n * ```\n *\n * ### Change Propagation\n *\n * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n * * Otherwise, the DOM element for that item will remain the same.\n *\n * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n * those changes in the DOM. This has important implications for animations and any stateful\n * controls (such as `<input>` elements which accept user input) that are present. Inserted rows can\n * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n * such as user input.\n *\n * It is possible for the identities of elements in the iterator to change while the data does not.\n * This can happen, for example, if the iterator produced from an RPC to the server, and that\n * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with\n * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old\n * elements were deleted and all new elements inserted). This is an expensive operation and should\n * be avoided if possible.\n *\n * To customize the default tracking algorithm, `NgForOf` supports `trackBy` option.\n * `trackBy` takes a function which has two arguments: `index` and `item`.\n * If `trackBy` is given, Angular tracks changes by the return value of the function.\n *\n * ### Syntax\n *\n * - `<li *ngFor=\"let item of items; index as i; trackBy: trackByFn\">...</li>`\n *\n * With `<ng-template>` element:\n *\n * ```\n * <ng-template ngFor let-item [ngForOf]=\"items\" let-i=\"index\" [ngForTrackBy]=\"trackByFn\">\n * <li>...</li>\n * </ng-template>\n * ```\n *\n * ### Example\n *\n * See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed\n * example.\n *\n * \\@stable\n */\nvar NgForOf = /** @class */ (function () {\n function NgForOf(_viewContainer, _template, _differs) {\n this._viewContainer = _viewContainer;\n this._template = _template;\n this._differs = _differs;\n this._differ = null;\n }\n Object.defineProperty(NgForOf.prototype, \"ngForTrackBy\", {\n get: /**\n * @return {?}\n */\n function () { return this._trackByFn; },\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"isDevMode\"])() && fn != null && typeof fn !== 'function') {\n // TODO(vicb): use a log service once there is a public one available\n if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn(\"trackBy must be a function, but received \" + JSON.stringify(fn) + \". \" +\n \"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.\");\n }\n }\n this._trackByFn = fn;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForOf.prototype, \"ngForTemplate\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1\n // The current type is too restrictive; a template that just uses index, for example,\n // should be acceptable.\n if (value) {\n this._template = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n NgForOf.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('ngForOf' in changes) {\n // React on ngForOf changes only once all inputs have been initialized\n var /** @type {?} */ value = changes['ngForOf'].currentValue;\n if (!this._differ && value) {\n try {\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n }\n catch (/** @type {?} */ e) {\n throw new Error(\"Cannot find a differ supporting object '\" + value + \"' of type '\" + getTypeNameForDebugging(value) + \"'. NgFor only supports binding to Iterables such as Arrays.\");\n }\n }\n }\n };\n /**\n * @return {?}\n */\n NgForOf.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._differ) {\n var /** @type {?} */ changes = this._differ.diff(this.ngForOf);\n if (changes)\n this._applyChanges(changes);\n }\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgForOf.prototype._applyChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n var /** @type {?} */ insertTuples = [];\n changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {\n if (item.previousIndex == null) {\n var /** @type {?} */ view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(/** @type {?} */ ((null)), _this.ngForOf, -1, -1), currentIndex);\n var /** @type {?} */ tuple = new RecordViewTuple(item, view);\n insertTuples.push(tuple);\n }\n else if (currentIndex == null) {\n _this._viewContainer.remove(adjustedPreviousIndex);\n }\n else {\n var /** @type {?} */ view = /** @type {?} */ ((_this._viewContainer.get(adjustedPreviousIndex)));\n _this._viewContainer.move(view, currentIndex);\n var /** @type {?} */ tuple = new RecordViewTuple(item, /** @type {?} */ (view));\n insertTuples.push(tuple);\n }\n });\n for (var /** @type {?} */ i = 0; i < insertTuples.length; i++) {\n this._perViewChange(insertTuples[i].view, insertTuples[i].record);\n }\n for (var /** @type {?} */ i = 0, /** @type {?} */ ilen = this._viewContainer.length; i < ilen; i++) {\n var /** @type {?} */ viewRef = /** @type {?} */ (this._viewContainer.get(i));\n viewRef.context.index = i;\n viewRef.context.count = ilen;\n }\n changes.forEachIdentityChange(function (record) {\n var /** @type {?} */ viewRef = /** @type {?} */ (_this._viewContainer.get(record.currentIndex));\n viewRef.context.$implicit = record.item;\n });\n };\n /**\n * @param {?} view\n * @param {?} record\n * @return {?}\n */\n NgForOf.prototype._perViewChange = /**\n * @param {?} view\n * @param {?} record\n * @return {?}\n */\n function (view, record) {\n view.context.$implicit = record.item;\n };\n NgForOf.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngFor][ngForOf]' },] },\n ];\n /** @nocollapse */\n NgForOf.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"IterableDiffers\"], },\n ]; };\n NgForOf.propDecorators = {\n \"ngForOf\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngForTrackBy\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngForTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgForOf;\n}());\nvar RecordViewTuple = /** @class */ (function () {\n function RecordViewTuple(record, view) {\n this.record = record;\n this.view = view;\n }\n return RecordViewTuple;\n}());\n/**\n * @param {?} type\n * @return {?}\n */\nfunction getTypeNameForDebugging(type) {\n return type['name'] || typeof type;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Conditionally includes a template based on the value of an `expression`.\n *\n * `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place\n * when expression is truthy or falsy respectively. Typically the:\n * - `then` template is the inline template of `ngIf` unless bound to a different value.\n * - `else` template is blank unless it is bound.\n *\n * ## Most common usage\n *\n * The most common usage of the `ngIf` directive is to conditionally show the inline template as\n * seen in this example:\n * {\\@example common/ngIf/ts/module.ts region='NgIfSimple'}\n *\n * ## Showing an alternative template using `else`\n *\n * If it is necessary to display a template when the `expression` is falsy use the `else` template\n * binding as shown. Note that the `else` binding points to a `<ng-template>` labeled `#elseBlock`.\n * The template can be defined anywhere in the component view but is typically placed right after\n * `ngIf` for readability.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfElse'}\n *\n * ## Using non-inlined `then` template\n *\n * Usually the `then` template is the inlined template of the `ngIf`, but it can be changed using\n * a binding (just like `else`). Because `then` and `else` are bindings, the template references can\n * change at runtime as shown in this example.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n *\n * ## Storing conditional result in a variable\n *\n * A common pattern is that we need to show a set of properties from the same object. If the\n * object is undefined, then we have to use the safe-traversal-operator `?.` to guard against\n * dereferencing a `null` value. This is especially the case when waiting on async data such as\n * when using the `async` pipe as shown in following example:\n *\n * ```\n * Hello {{ (userStream|async)?.last }}, {{ (userStream|async)?.first }}!\n * ```\n *\n * There are several inefficiencies in the above example:\n * - We create multiple subscriptions on `userStream`. One for each `async` pipe, or two in the\n * example above.\n * - We cannot display an alternative screen while waiting for the data to arrive asynchronously.\n * - We have to use the safe-traversal-operator `?.` to access properties, which is cumbersome.\n * - We have to place the `async` pipe in parenthesis.\n *\n * A better way to do this is to use `ngIf` and store the result of the condition in a local\n * variable as shown in the the example below:\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfAs'}\n *\n * Notice that:\n * - We use only one `async` pipe and hence only one subscription gets created.\n * - `ngIf` stores the result of the `userStream|async` in the local variable `user`.\n * - The local `user` can then be bound repeatedly in a more efficient way.\n * - No need to use the safe-traversal-operator `?.` to access properties as `ngIf` will only\n * display the data if `userStream` returns a value.\n * - We can display an alternative template while waiting for the data.\n *\n * ### Syntax\n *\n * Simple form:\n * - `<div *ngIf=\"condition\">...</div>`\n * - `<ng-template [ngIf]=\"condition\"><div>...</div></ng-template>`\n *\n * Form with an else block:\n * ```\n * <div *ngIf=\"condition; else elseBlock\">...</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with a `then` and `else` block:\n * ```\n * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n * <ng-template #thenBlock>...</ng-template>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with storing the value locally:\n * ```\n * <div *ngIf=\"condition as value; else elseBlock\">{{value}}</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * \\@stable\n */\nvar NgIf = /** @class */ (function () {\n function NgIf(_viewContainer, templateRef) {\n this._viewContainer = _viewContainer;\n this._context = new NgIfContext();\n this._thenTemplateRef = null;\n this._elseTemplateRef = null;\n this._thenViewRef = null;\n this._elseViewRef = null;\n this._thenTemplateRef = templateRef;\n }\n Object.defineProperty(NgIf.prototype, \"ngIf\", {\n set: /**\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgIf.prototype, \"ngIfThen\", {\n set: /**\n * @param {?} templateRef\n * @return {?}\n */\n function (templateRef) {\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgIf.prototype, \"ngIfElse\", {\n set: /**\n * @param {?} templateRef\n * @return {?}\n */\n function (templateRef) {\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgIf.prototype._updateView = /**\n * @return {?}\n */\n function () {\n if (this._context.$implicit) {\n if (!this._thenViewRef) {\n this._viewContainer.clear();\n this._elseViewRef = null;\n if (this._thenTemplateRef) {\n this._thenViewRef =\n this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n }\n }\n }\n else {\n if (!this._elseViewRef) {\n this._viewContainer.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef =\n this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n }\n }\n }\n };\n NgIf.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngIf]' },] },\n ];\n /** @nocollapse */\n NgIf.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n NgIf.propDecorators = {\n \"ngIf\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngIfThen\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngIfElse\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgIf;\n}());\n/**\n * \\@stable\n */\nvar NgIfContext = /** @class */ (function () {\n function NgIfContext() {\n this.$implicit = null;\n this.ngIf = null;\n }\n return NgIfContext;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SwitchView = /** @class */ (function () {\n function SwitchView(_viewContainerRef, _templateRef) {\n this._viewContainerRef = _viewContainerRef;\n this._templateRef = _templateRef;\n this._created = false;\n }\n /**\n * @return {?}\n */\n SwitchView.prototype.create = /**\n * @return {?}\n */\n function () {\n this._created = true;\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n };\n /**\n * @return {?}\n */\n SwitchView.prototype.destroy = /**\n * @return {?}\n */\n function () {\n this._created = false;\n this._viewContainerRef.clear();\n };\n /**\n * @param {?} created\n * @return {?}\n */\n SwitchView.prototype.enforceState = /**\n * @param {?} created\n * @return {?}\n */\n function (created) {\n if (created && !this._created) {\n this.create();\n }\n else if (!created && this._created) {\n this.destroy();\n }\n };\n return SwitchView;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees when the nest match expressions matches the switch\n * expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n * <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n * <ng-container *ngSwitchCase=\"match_expression_3\">\n * <!-- use a ng-container to group multiple root nodes -->\n * <inner-element></inner-element>\n * <inner-other-element></inner-other-element>\n * </ng-container>\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n * \\@description\n *\n * `NgSwitch` stamps out nested views when their match expression value matches the value of the\n * switch expression.\n *\n * In other words:\n * - you define a container element (where you place the directive with a switch expression on the\n * `[ngSwitch]=\"...\"` attribute)\n * - you define inner views inside the `NgSwitch` and place a `*ngSwitchCase` attribute on the view\n * root elements.\n *\n * Elements within `NgSwitch` but outside of a `NgSwitchCase` or `NgSwitchDefault` directives will\n * be preserved at the location.\n *\n * The `ngSwitchCase` directive informs the parent `NgSwitch` of which view to display when the\n * expression is evaluated.\n * When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is\n * stamped out.\n *\n * \\@stable\n */\nvar NgSwitch = /** @class */ (function () {\n function NgSwitch() {\n this._defaultUsed = false;\n this._caseCount = 0;\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n Object.defineProperty(NgSwitch.prototype, \"ngSwitch\", {\n set: /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this._ngSwitch = newValue;\n if (this._caseCount === 0) {\n this._updateDefaultCases(true);\n }\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n NgSwitch.prototype._addCase = /**\n * \\@internal\n * @return {?}\n */\n function () { return this._caseCount++; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} view\n * @return {?}\n */\n NgSwitch.prototype._addDefault = /**\n * \\@internal\n * @param {?} view\n * @return {?}\n */\n function (view) {\n if (!this._defaultViews) {\n this._defaultViews = [];\n }\n this._defaultViews.push(view);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSwitch.prototype._matchCase = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ matched = value == this._ngSwitch;\n this._lastCasesMatched = this._lastCasesMatched || matched;\n this._lastCaseCheckIndex++;\n if (this._lastCaseCheckIndex === this._caseCount) {\n this._updateDefaultCases(!this._lastCasesMatched);\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n return matched;\n };\n /**\n * @param {?} useDefault\n * @return {?}\n */\n NgSwitch.prototype._updateDefaultCases = /**\n * @param {?} useDefault\n * @return {?}\n */\n function (useDefault) {\n if (this._defaultViews && useDefault !== this._defaultUsed) {\n this._defaultUsed = useDefault;\n for (var /** @type {?} */ i = 0; i < this._defaultViews.length; i++) {\n var /** @type {?} */ defaultView = this._defaultViews[i];\n defaultView.enforceState(useDefault);\n }\n }\n };\n NgSwitch.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitch]' },] },\n ];\n /** @nocollapse */\n NgSwitch.ctorParameters = function () { return []; };\n NgSwitch.propDecorators = {\n \"ngSwitch\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgSwitch;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgSwitch} when the\n * given expression evaluate to respectively the same/different value as the switch\n * expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * </container-element>\n * ```\n * \\@description\n *\n * Insert the sub-tree when the expression evaluates to the same value as the enclosing switch\n * expression.\n *\n * If multiple match expressions match the switch expression value, all of them are displayed.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchCase = /** @class */ (function () {\n function NgSwitchCase(viewContainer, templateRef, ngSwitch) {\n this.ngSwitch = ngSwitch;\n ngSwitch._addCase();\n this._view = new SwitchView(viewContainer, templateRef);\n }\n /**\n * @return {?}\n */\n NgSwitchCase.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); };\n NgSwitchCase.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitchCase]' },] },\n ];\n /** @nocollapse */\n NgSwitchCase.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n NgSwitchCase.propDecorators = {\n \"ngSwitchCase\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgSwitchCase;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a view that is added to the parent {\\@link NgSwitch} when no case expressions\n * match the\n * switch expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-other-element *ngSwitchDefault>...</some-other-element>\n * </container-element>\n * ```\n *\n * \\@description\n *\n * Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch\n * expression.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchDefault = /** @class */ (function () {\n function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {\n ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n }\n NgSwitchDefault.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngSwitchDefault]' },] },\n ];\n /** @nocollapse */\n NgSwitchDefault.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n return NgSwitchDefault;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n * <ng-template ngPluralCase=\"=0\">there is nothing</ng-template>\n * <ng-template ngPluralCase=\"=1\">there is one</ng-template>\n * <ng-template ngPluralCase=\"few\">there are a few</ng-template>\n * </some-element>\n * ```\n *\n * \\@description\n *\n * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\n * that match the switch expression's pluralization category.\n *\n * To use this directive you must provide a container element that sets the `[ngPlural]` attribute\n * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their\n * expression:\n * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value\n * matches the switch expression exactly,\n * - otherwise, the view will be treated as a \"category match\", and will only display if exact\n * value matches aren't found and the value maps to its category for the defined locale.\n *\n * See http://cldr.unicode.org/index/cldr-spec/plural-rules\n *\n * \\@experimental\n */\nvar NgPlural = /** @class */ (function () {\n function NgPlural(_localization) {\n this._localization = _localization;\n this._caseViews = {};\n }\n Object.defineProperty(NgPlural.prototype, \"ngPlural\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._switchValue = value;\n this._updateView();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @param {?} switchView\n * @return {?}\n */\n NgPlural.prototype.addCase = /**\n * @param {?} value\n * @param {?} switchView\n * @return {?}\n */\n function (value, switchView) { this._caseViews[value] = switchView; };\n /**\n * @return {?}\n */\n NgPlural.prototype._updateView = /**\n * @return {?}\n */\n function () {\n this._clearViews();\n var /** @type {?} */ cases = Object.keys(this._caseViews);\n var /** @type {?} */ key = getPluralCategory(this._switchValue, cases, this._localization);\n this._activateView(this._caseViews[key]);\n };\n /**\n * @return {?}\n */\n NgPlural.prototype._clearViews = /**\n * @return {?}\n */\n function () {\n if (this._activeView)\n this._activeView.destroy();\n };\n /**\n * @param {?} view\n * @return {?}\n */\n NgPlural.prototype._activateView = /**\n * @param {?} view\n * @return {?}\n */\n function (view) {\n if (view) {\n this._activeView = view;\n this._activeView.create();\n }\n };\n NgPlural.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngPlural]' },] },\n ];\n /** @nocollapse */\n NgPlural.ctorParameters = function () { return [\n { type: NgLocalization, },\n ]; };\n NgPlural.propDecorators = {\n \"ngPlural\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgPlural;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgPlural} when the\n * given expression matches the plural expression according to CLDR rules.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n * <ng-template ngPluralCase=\"=0\">...</ng-template>\n * <ng-template ngPluralCase=\"other\">...</ng-template>\n * </some-element>\n * ```\n *\n * See {\\@link NgPlural} for more details and example.\n *\n * \\@experimental\n */\nvar NgPluralCase = /** @class */ (function () {\n function NgPluralCase(value, template, viewContainer, ngPlural) {\n this.value = value;\n var /** @type {?} */ isANumber = !isNaN(Number(value));\n ngPlural.addCase(isANumber ? \"=\" + value : value, new SwitchView(viewContainer, template));\n }\n NgPluralCase.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngPluralCase]' },] },\n ];\n /** @nocollapse */\n NgPluralCase.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Attribute\"], args: ['ngPluralCase',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: NgPlural, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Host\"] },] },\n ]; };\n return NgPluralCase;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Update an HTML element styles.\n *\n * \\@howToUse\n * ```\n * <some-element [ngStyle]=\"{'font-style': styleExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"{'max-width.px': widthExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"objExp\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The styles are updated according to the value of the expression evaluation:\n * - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),\n * - values are the values assigned to those properties (expressed in the given unit).\n *\n * \\@stable\n */\nvar NgStyle = /** @class */ (function () {\n function NgStyle(_differs, _ngEl, _renderer) {\n this._differs = _differs;\n this._ngEl = _ngEl;\n this._renderer = _renderer;\n }\n Object.defineProperty(NgStyle.prototype, \"ngStyle\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._ngStyle = v;\n if (!this._differ && v) {\n this._differ = this._differs.find(v).create();\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n NgStyle.prototype.ngDoCheck = /**\n * @return {?}\n */\n function () {\n if (this._differ) {\n var /** @type {?} */ changes = this._differ.diff(this._ngStyle);\n if (changes) {\n this._applyChanges(changes);\n }\n }\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgStyle.prototype._applyChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });\n changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n };\n /**\n * @param {?} nameAndUnit\n * @param {?} value\n * @return {?}\n */\n NgStyle.prototype._setStyle = /**\n * @param {?} nameAndUnit\n * @param {?} value\n * @return {?}\n */\n function (nameAndUnit, value) {\n var _a = nameAndUnit.split('.'), name = _a[0], unit = _a[1];\n value = value != null && unit ? \"\" + value + unit : value;\n if (value != null) {\n this._renderer.setStyle(this._ngEl.nativeElement, name, /** @type {?} */ (value));\n }\n else {\n this._renderer.removeStyle(this._ngEl.nativeElement, name);\n }\n };\n NgStyle.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngStyle]' },] },\n ];\n /** @nocollapse */\n NgStyle.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"KeyValueDiffers\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n NgStyle.propDecorators = {\n \"ngStyle\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgStyle;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Inserts an embedded view from a prepared `TemplateRef`\n *\n * \\@howToUse\n * ```\n * <ng-container *ngTemplateOutlet=\"templateRefExp; context: contextExp\"></ng-container>\n * ```\n *\n * \\@description\n *\n * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n * by the local template `let` declarations.\n *\n * Note: using the key `$implicit` in the context object will set it's value as default.\n *\n * ## Example\n *\n * {\\@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n *\n * \\@stable\n */\nvar NgTemplateOutlet = /** @class */ (function () {\n function NgTemplateOutlet(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgTemplateOutlet.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var /** @type {?} */ recreateView = this._shouldRecreateView(changes);\n if (recreateView) {\n if (this._viewRef) {\n this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));\n }\n if (this.ngTemplateOutlet) {\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext);\n }\n }\n else {\n if (this._viewRef && this.ngTemplateOutletContext) {\n this._updateExistingContext(this.ngTemplateOutletContext);\n }\n }\n };\n /**\n * We need to re-create existing embedded view if:\n * - templateRef has changed\n * - context has changes\n *\n * We mark context object as changed when the corresponding object\n * shape changes (new properties are added or existing properties are removed).\n * In other words we consider context with the same properties as \"the same\" even\n * if object reference changes (see https://github.com/angular/angular/issues/13407).\n * @param {?} changes\n * @return {?}\n */\n NgTemplateOutlet.prototype._shouldRecreateView = /**\n * We need to re-create existing embedded view if:\n * - templateRef has changed\n * - context has changes\n *\n * We mark context object as changed when the corresponding object\n * shape changes (new properties are added or existing properties are removed).\n * In other words we consider context with the same properties as \"the same\" even\n * if object reference changes (see https://github.com/angular/angular/issues/13407).\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var /** @type {?} */ ctxChange = changes['ngTemplateOutletContext'];\n return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange));\n };\n /**\n * @param {?} ctxChange\n * @return {?}\n */\n NgTemplateOutlet.prototype._hasContextShapeChanged = /**\n * @param {?} ctxChange\n * @return {?}\n */\n function (ctxChange) {\n var /** @type {?} */ prevCtxKeys = Object.keys(ctxChange.previousValue || {});\n var /** @type {?} */ currCtxKeys = Object.keys(ctxChange.currentValue || {});\n if (prevCtxKeys.length === currCtxKeys.length) {\n for (var _i = 0, currCtxKeys_1 = currCtxKeys; _i < currCtxKeys_1.length; _i++) {\n var propName = currCtxKeys_1[_i];\n if (prevCtxKeys.indexOf(propName) === -1) {\n return true;\n }\n }\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * @param {?} ctx\n * @return {?}\n */\n NgTemplateOutlet.prototype._updateExistingContext = /**\n * @param {?} ctx\n * @return {?}\n */\n function (ctx) {\n for (var _i = 0, _a = Object.keys(ctx); _i < _a.length; _i++) {\n var propName = _a[_i];\n (/** @type {?} */ (this._viewRef.context))[propName] = (/** @type {?} */ (this.ngTemplateOutletContext))[propName];\n }\n };\n NgTemplateOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngTemplateOutlet]' },] },\n ];\n /** @nocollapse */\n NgTemplateOutlet.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n ]; };\n NgTemplateOutlet.propDecorators = {\n \"ngTemplateOutletContext\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngTemplateOutlet\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgTemplateOutlet;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of Angular directives that are likely to be used in each and every Angular\n * application.\n */\nvar COMMON_DIRECTIVES = [\n NgClass,\n NgComponentOutlet,\n NgForOf,\n NgIf,\n NgTemplateOutlet,\n NgStyle,\n NgSwitch,\n NgSwitchCase,\n NgSwitchDefault,\n NgPlural,\n NgPluralCase,\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NAMED_FORMATS = {};\nvar DATE_FORMATS_SPLIT = /((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)/;\n/** @enum {number} */\nvar ZoneWidth = {\n Short: 0,\n ShortGMT: 1,\n Long: 2,\n Extended: 3,\n};\nZoneWidth[ZoneWidth.Short] = \"Short\";\nZoneWidth[ZoneWidth.ShortGMT] = \"ShortGMT\";\nZoneWidth[ZoneWidth.Long] = \"Long\";\nZoneWidth[ZoneWidth.Extended] = \"Extended\";\n/** @enum {number} */\nvar DateType = {\n FullYear: 0,\n Month: 1,\n Date: 2,\n Hours: 3,\n Minutes: 4,\n Seconds: 5,\n Milliseconds: 6,\n Day: 7,\n};\nDateType[DateType.FullYear] = \"FullYear\";\nDateType[DateType.Month] = \"Month\";\nDateType[DateType.Date] = \"Date\";\nDateType[DateType.Hours] = \"Hours\";\nDateType[DateType.Minutes] = \"Minutes\";\nDateType[DateType.Seconds] = \"Seconds\";\nDateType[DateType.Milliseconds] = \"Milliseconds\";\nDateType[DateType.Day] = \"Day\";\n/** @enum {number} */\nvar TranslationType = {\n DayPeriods: 0,\n Days: 1,\n Months: 2,\n Eras: 3,\n};\nTranslationType[TranslationType.DayPeriods] = \"DayPeriods\";\nTranslationType[TranslationType.Days] = \"Days\";\nTranslationType[TranslationType.Months] = \"Months\";\nTranslationType[TranslationType.Eras] = \"Eras\";\n/**\n * Transforms a date to a locale string based on a pattern and a timezone\n *\n * \\@internal\n * @param {?} date\n * @param {?} format\n * @param {?} locale\n * @param {?=} timezone\n * @return {?}\n */\nfunction formatDate(date, format, locale, timezone) {\n var /** @type {?} */ namedFormat = getNamedFormat(locale, format);\n format = namedFormat || format;\n var /** @type {?} */ parts = [];\n var /** @type {?} */ match;\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = parts.concat(match.slice(1));\n var /** @type {?} */ part = parts.pop();\n if (!part) {\n break;\n }\n format = part;\n }\n else {\n parts.push(format);\n break;\n }\n }\n var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n var /** @type {?} */ text = '';\n parts.forEach(function (value) {\n var /** @type {?} */ dateFormatter = getDateFormatter(value);\n text += dateFormatter ?\n dateFormatter(date, locale, dateTimezoneOffset) :\n value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n return text;\n}\n/**\n * @param {?} locale\n * @param {?} format\n * @return {?}\n */\nfunction getNamedFormat(locale, format) {\n var /** @type {?} */ localeId = getLocaleId(locale);\n NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};\n if (NAMED_FORMATS[localeId][format]) {\n return NAMED_FORMATS[localeId][format];\n }\n var /** @type {?} */ formatValue = '';\n switch (format) {\n case 'shortDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Short);\n break;\n case 'mediumDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);\n break;\n case 'longDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Long);\n break;\n case 'fullDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Full);\n break;\n case 'shortTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);\n break;\n case 'mediumTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);\n break;\n case 'longTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);\n break;\n case 'fullTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);\n break;\n case 'short':\n var /** @type {?} */ shortTime = getNamedFormat(locale, 'shortTime');\n var /** @type {?} */ shortDate = getNamedFormat(locale, 'shortDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);\n break;\n case 'medium':\n var /** @type {?} */ mediumTime = getNamedFormat(locale, 'mediumTime');\n var /** @type {?} */ mediumDate = getNamedFormat(locale, 'mediumDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);\n break;\n case 'long':\n var /** @type {?} */ longTime = getNamedFormat(locale, 'longTime');\n var /** @type {?} */ longDate = getNamedFormat(locale, 'longDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);\n break;\n case 'full':\n var /** @type {?} */ fullTime = getNamedFormat(locale, 'fullTime');\n var /** @type {?} */ fullDate = getNamedFormat(locale, 'fullDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);\n break;\n }\n if (formatValue) {\n NAMED_FORMATS[localeId][format] = formatValue;\n }\n return formatValue;\n}\n/**\n * @param {?} str\n * @param {?} opt_values\n * @return {?}\n */\nfunction formatDateTime(str, opt_values) {\n if (opt_values) {\n str = str.replace(/\\{([^}]+)}/g, function (match, key) {\n return (opt_values != null && key in opt_values) ? opt_values[key] : match;\n });\n }\n return str;\n}\n/**\n * @param {?} num\n * @param {?} digits\n * @param {?=} minusSign\n * @param {?=} trim\n * @param {?=} negWrap\n * @return {?}\n */\nfunction padNumber(num, digits, minusSign, trim, negWrap) {\n if (minusSign === void 0) { minusSign = '-'; }\n var /** @type {?} */ neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n }\n else {\n num = -num;\n neg = minusSign;\n }\n }\n var /** @type {?} */ strNum = '' + num;\n while (strNum.length < digits)\n strNum = '0' + strNum;\n if (trim) {\n strNum = strNum.substr(strNum.length - digits);\n }\n return neg + strNum;\n}\n/**\n * Returns a date formatter that transforms a date into its locale digit representation\n * @param {?} name\n * @param {?} size\n * @param {?=} offset\n * @param {?=} trim\n * @param {?=} negWrap\n * @return {?}\n */\nfunction dateGetter(name, size, offset, trim, negWrap) {\n if (offset === void 0) { offset = 0; }\n if (trim === void 0) { trim = false; }\n if (negWrap === void 0) { negWrap = false; }\n return function (date, locale) {\n var /** @type {?} */ part = getDatePart(name, date, size);\n if (offset > 0 || part > -offset) {\n part += offset;\n }\n if (name === DateType.Hours && part === 0 && offset === -12) {\n part = 12;\n }\n return padNumber(part, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim, negWrap);\n };\n}\n/**\n * @param {?} name\n * @param {?} date\n * @param {?} size\n * @return {?}\n */\nfunction getDatePart(name, date, size) {\n switch (name) {\n case DateType.FullYear:\n return date.getFullYear();\n case DateType.Month:\n return date.getMonth();\n case DateType.Date:\n return date.getDate();\n case DateType.Hours:\n return date.getHours();\n case DateType.Minutes:\n return date.getMinutes();\n case DateType.Seconds:\n return date.getSeconds();\n case DateType.Milliseconds:\n var /** @type {?} */ div = size === 1 ? 100 : (size === 2 ? 10 : 1);\n return Math.round(date.getMilliseconds() / div);\n case DateType.Day:\n return date.getDay();\n default:\n throw new Error(\"Unknown DateType value \\\"\" + name + \"\\\".\");\n }\n}\n/**\n * Returns a date formatter that transforms a date into its locale string representation\n * @param {?} name\n * @param {?} width\n * @param {?=} form\n * @param {?=} extended\n * @return {?}\n */\nfunction dateStrGetter(name, width, form, extended) {\n if (form === void 0) { form = FormStyle.Format; }\n if (extended === void 0) { extended = false; }\n return function (date, locale) {\n return getDateTranslation(date, locale, name, width, form, extended);\n };\n}\n/**\n * Returns the locale translation of a date for a given form, type and width\n * @param {?} date\n * @param {?} locale\n * @param {?} name\n * @param {?} width\n * @param {?} form\n * @param {?} extended\n * @return {?}\n */\nfunction getDateTranslation(date, locale, name, width, form, extended) {\n switch (name) {\n case TranslationType.Months:\n return getLocaleMonthNames(locale, form, width)[date.getMonth()];\n case TranslationType.Days:\n return getLocaleDayNames(locale, form, width)[date.getDay()];\n case TranslationType.DayPeriods:\n var /** @type {?} */ currentHours_1 = date.getHours();\n var /** @type {?} */ currentMinutes_1 = date.getMinutes();\n if (extended) {\n var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);\n var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);\n var /** @type {?} */ result_1;\n rules.forEach(function (rule, index) {\n if (Array.isArray(rule)) {\n // morning, afternoon, evening, night\n var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;\n var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;\n if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&\n (currentHours_1 < hoursTo ||\n (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {\n result_1 = dayPeriods_1[index];\n }\n }\n else {\n // noon or midnight\n var hours = rule.hours, minutes = rule.minutes;\n if (hours === currentHours_1 && minutes === currentMinutes_1) {\n result_1 = dayPeriods_1[index];\n }\n }\n });\n if (result_1) {\n return result_1;\n }\n }\n // if no rules for the day periods, we use am/pm by default\n return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];\n case TranslationType.Eras:\n return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];\n default:\n // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n // However Closure Compiler does not understand that and reports an error in typed mode.\n // The `throw new Error` below works around the problem, and the unexpected: never variable\n // makes sure tsc still checks this code is unreachable.\n var /** @type {?} */ unexpected = name;\n throw new Error(\"unexpected translation type \" + unexpected);\n }\n}\n/**\n * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or\n * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,\n * extended = +04:30)\n * @param {?} width\n * @return {?}\n */\nfunction timeZoneGetter(width) {\n return function (date, locale, offset) {\n var /** @type {?} */ zone = -1 * offset;\n var /** @type {?} */ minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var /** @type {?} */ hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}\nvar JANUARY = 0;\nvar THURSDAY = 4;\n/**\n * @param {?} year\n * @return {?}\n */\nfunction getFirstThursdayOfYear(year) {\n var /** @type {?} */ firstDayOfYear = (new Date(year, JANUARY, 1)).getDay();\n return new Date(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);\n}\n/**\n * @param {?} datetime\n * @return {?}\n */\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));\n}\n/**\n * @param {?} size\n * @param {?=} monthBased\n * @return {?}\n */\nfunction weekGetter(size, monthBased) {\n if (monthBased === void 0) { monthBased = false; }\n return function (date, locale) {\n var /** @type {?} */ result;\n if (monthBased) {\n var /** @type {?} */ nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;\n var /** @type {?} */ today = date.getDate();\n result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);\n }\n else {\n var /** @type {?} */ firstThurs = getFirstThursdayOfYear(date.getFullYear());\n var /** @type {?} */ thisThurs = getThursdayThisWeek(date);\n var /** @type {?} */ diff = thisThurs.getTime() - firstThurs.getTime();\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n }\n return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n };\n}\nvar DATE_FORMATS = {};\n/**\n * @param {?} format\n * @return {?}\n */\nfunction getDateFormatter(format) {\n if (DATE_FORMATS[format]) {\n return DATE_FORMATS[format];\n }\n var /** @type {?} */ formatter;\n switch (format) {\n // Era name (AD/BC)\n case 'G':\n case 'GG':\n case 'GGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);\n break;\n case 'GGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);\n break;\n case 'GGGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);\n break;\n // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'y':\n formatter = dateGetter(DateType.FullYear, 1, 0, false, true);\n break;\n // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yy':\n formatter = dateGetter(DateType.FullYear, 2, 0, true, true);\n break;\n // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yyy':\n formatter = dateGetter(DateType.FullYear, 3, 0, false, true);\n break;\n // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'yyyy':\n formatter = dateGetter(DateType.FullYear, 4, 0, false, true);\n break;\n // Month of the year (1-12), numeric\n case 'M':\n case 'L':\n formatter = dateGetter(DateType.Month, 1, 1);\n break;\n case 'MM':\n case 'LL':\n formatter = dateGetter(DateType.Month, 2, 1);\n break;\n // Month of the year (January, ...), string, format\n case 'MMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);\n break;\n case 'MMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);\n break;\n case 'MMMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);\n break;\n // Month of the year (January, ...), string, standalone\n case 'LLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'LLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'LLLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n // Week of the year (1, ... 52)\n case 'w':\n formatter = weekGetter(1);\n break;\n case 'ww':\n formatter = weekGetter(2);\n break;\n // Week of the month (1, ...)\n case 'W':\n formatter = weekGetter(1, true);\n break;\n // Day of the month (1-31)\n case 'd':\n formatter = dateGetter(DateType.Date, 1);\n break;\n case 'dd':\n formatter = dateGetter(DateType.Date, 2);\n break;\n // Day of the Week\n case 'E':\n case 'EE':\n case 'EEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);\n break;\n case 'EEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);\n break;\n case 'EEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);\n break;\n case 'EEEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);\n break;\n // Generic period of the day (am-pm)\n case 'a':\n case 'aa':\n case 'aaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);\n break;\n case 'aaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);\n break;\n case 'aaaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);\n break;\n // Extended period of the day (midnight, at night, ...), standalone\n case 'b':\n case 'bb':\n case 'bbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);\n break;\n case 'bbbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);\n break;\n case 'bbbbb':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);\n break;\n // Extended period of the day (midnight, night, ...), standalone\n case 'B':\n case 'BB':\n case 'BBB':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);\n break;\n case 'BBBB':\n formatter =\n dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);\n break;\n case 'BBBBB':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);\n break;\n // Hour in AM/PM, (1-12)\n case 'h':\n formatter = dateGetter(DateType.Hours, 1, -12);\n break;\n case 'hh':\n formatter = dateGetter(DateType.Hours, 2, -12);\n break;\n // Hour of the day (0-23)\n case 'H':\n formatter = dateGetter(DateType.Hours, 1);\n break;\n // Hour in day, padded (00-23)\n case 'HH':\n formatter = dateGetter(DateType.Hours, 2);\n break;\n // Minute of the hour (0-59)\n case 'm':\n formatter = dateGetter(DateType.Minutes, 1);\n break;\n case 'mm':\n formatter = dateGetter(DateType.Minutes, 2);\n break;\n // Second of the minute (0-59)\n case 's':\n formatter = dateGetter(DateType.Seconds, 1);\n break;\n case 'ss':\n formatter = dateGetter(DateType.Seconds, 2);\n break;\n // Fractional second padded (0-9)\n case 'S':\n formatter = dateGetter(DateType.Milliseconds, 1);\n break;\n case 'SS':\n formatter = dateGetter(DateType.Milliseconds, 2);\n break;\n // = millisecond\n case 'SSS':\n formatter = dateGetter(DateType.Milliseconds, 3);\n break;\n // Timezone ISO8601 short format (-0430)\n case 'Z':\n case 'ZZ':\n case 'ZZZ':\n formatter = timeZoneGetter(ZoneWidth.Short);\n break;\n // Timezone ISO8601 extended format (-04:30)\n case 'ZZZZZ':\n formatter = timeZoneGetter(ZoneWidth.Extended);\n break;\n // Timezone GMT short format (GMT+4)\n case 'O':\n case 'OO':\n case 'OOO':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'z':\n case 'zz':\n case 'zzz':\n formatter = timeZoneGetter(ZoneWidth.ShortGMT);\n break;\n // Timezone GMT long format (GMT+0430)\n case 'OOOO':\n case 'ZZZZ':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'zzzz':\n formatter = timeZoneGetter(ZoneWidth.Long);\n break;\n default:\n return null;\n }\n DATE_FORMATS[format] = formatter;\n return formatter;\n}\n/**\n * @param {?} timezone\n * @param {?} fallback\n * @return {?}\n */\nfunction timezoneToOffset(timezone, fallback) {\n // Support: IE 9-11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(/:/g, '');\n var /** @type {?} */ requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n/**\n * @param {?} date\n * @param {?} minutes\n * @return {?}\n */\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n/**\n * @param {?} date\n * @param {?} timezone\n * @param {?} reverse\n * @return {?}\n */\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n var /** @type {?} */ reverseValue = reverse ? -1 : 1;\n var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();\n var /** @type {?} */ timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} type\n * @param {?} value\n * @return {?}\n */\nfunction invalidPipeArgumentError(type, value) {\n return Error(\"InvalidPipeArgument: '\" + value + \"' for pipe '\" + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵstringify\"])(type) + \"'\");\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ISO8601_DATE_REGEX = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a date according to locale rules.\n * \\@howToUse `date_expression | date[:format[:timezone[:locale]]]`\n * \\@description\n *\n * Where:\n * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string\n * (https://www.w3.org/TR/NOTE-datetime).\n * - `format` indicates which date/time components to include. The format can be predefined as\n * shown below (all examples are given for `en-US`) or custom as shown in the table.\n * - `'short'`: equivalent to `'M/d/yy, h:mm a'` (e.g. `6/15/15, 9:03 AM`)\n * - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (e.g. `Jun 15, 2015, 9:03:01 AM`)\n * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM GMT+1`)\n * - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at\n * 9:03:01 AM GMT+01:00`)\n * - `'shortDate'`: equivalent to `'M/d/yy'` (e.g. `6/15/15`)\n * - `'mediumDate'`: equivalent to `'MMM d, y'` (e.g. `Jun 15, 2015`)\n * - `'longDate'`: equivalent to `'MMMM d, y'` (e.g. `June 15, 2015`)\n * - `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` (e.g. `Monday, June 15, 2015`)\n * - `'shortTime'`: equivalent to `'h:mm a'` (e.g. `9:03 AM`)\n * - `'mediumTime'`: equivalent to `'h:mm:ss a'` (e.g. `9:03:01 AM`)\n * - `'longTime'`: equivalent to `'h:mm:ss a z'` (e.g. `9:03:01 AM GMT+1`)\n * - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (e.g. `9:03:01 AM GMT+01:00`)\n * - `timezone` to be used for formatting. It understands UTC/GMT and the continental US time zone\n * abbreviations, but for general use, use a time zone offset, for example,\n * `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the local system timezone of the end-user's browser will be used.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n *\n * | Field Type | Format | Description | Example Value |\n * |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|\n * | Era | G, GG & GGG | Abbreviated | AD |\n * | | GGGG | Wide | Anno Domini |\n * | | GGGGG | Narrow | A |\n * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | Month | M | Numeric: 1 digit | 9, 12 |\n * | | MM | Numeric: 2 digits + zero padded | 09, 12 |\n * | | MMM | Abbreviated | Sep |\n * | | MMMM | Wide | September |\n * | | MMMMM | Narrow | S |\n * | Month standalone | L | Numeric: 1 digit | 9, 12 |\n * | | LL | Numeric: 2 digits + zero padded | 09, 12 |\n * | | LLL | Abbreviated | Sep |\n * | | LLLL | Wide | September |\n * | | LLLLL | Narrow | S |\n * | Week of year | w | Numeric: minimum digits | 1... 53 |\n * | | ww | Numeric: 2 digits + zero padded | 01... 53 |\n * | Week of month | W | Numeric: 1 digit | 1... 5 |\n * | Day of month | d | Numeric: minimum digits | 1 |\n * | | dd | Numeric: 2 digits + zero padded | 01 |\n * | Week day | E, EE & EEE | Abbreviated | Tue |\n * | | EEEE | Wide | Tuesday |\n * | | EEEEE | Narrow | T |\n * | | EEEEEE | Short | Tu |\n * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |\n * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |\n * | | aaaaa | Narrow | a/p |\n * | Period* | B, BB & BBB | Abbreviated | mid. |\n * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | BBBBB | Narrow | md |\n * | Period standalone* | b, bb & bbb | Abbreviated | mid. |\n * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | bbbbb | Narrow | md |\n * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |\n * | | hh | Numeric: 2 digits + zero padded | 01, 12 |\n * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |\n * | | HH | Numeric: 2 digits + zero padded | 00, 23 |\n * | Minute | m | Numeric: minimum digits | 8, 59 |\n * | | mm | Numeric: 2 digits + zero padded | 08, 59 |\n * | Second | s | Numeric: minimum digits | 0... 59 |\n * | | ss | Numeric: 2 digits + zero padded | 00... 59 |\n * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |\n * | | SS | Numeric: 2 digits + zero padded | 00... 99 |\n * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |\n * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |\n * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |\n * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |\n * | | ZZZZ | Long localized GMT format | GMT-8:00 |\n * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |\n * | | O, OO & OOO | Short localized GMT format | GMT-8 |\n * | | OOOO | Long localized GMT format | GMT-08:00 |\n *\n *\n * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not\n * applied and the formatted text will have the same day, month and year of the expression.\n *\n * WARNINGS:\n * - this pipe has only access to en-US locale data by default. If you want to localize the dates\n * in another language, you will have to import data for other locales.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import additional locale\n * data.\n * - Fields suffixed with * are only available in the extra dataset.\n * See the {\\@linkDocs guide/i18n#i18n-pipes \"I18n guide\"} to know how to import extra locale\n * data.\n * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.\n * Instead users should treat the date as an immutable object and change the reference when the\n * pipe needs to re-run (this is to avoid reformatting the date on every change detection run\n * which would be an expensive operation).\n *\n * ### Examples\n *\n * Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)\n * in the _local_ time and locale is 'en-US':\n *\n * {\\@example common/pipes/ts/date_pipe.ts region='DatePipe'}\n *\n * \\@stable\n */\nvar DatePipe = /** @class */ (function () {\n function DatePipe(locale) {\n this.locale = locale;\n }\n /**\n * @param {?} value\n * @param {?=} format\n * @param {?=} timezone\n * @param {?=} locale\n * @return {?}\n */\n DatePipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} format\n * @param {?=} timezone\n * @param {?=} locale\n * @return {?}\n */\n function (value, format, timezone, locale) {\n if (format === void 0) { format = 'mediumDate'; }\n if (value == null || value === '' || value !== value)\n return null;\n if (typeof value === 'string') {\n value = value.trim();\n }\n var /** @type {?} */ date;\n var /** @type {?} */ match;\n if (isDate$1(value)) {\n date = value;\n }\n else if (!isNaN(value - parseFloat(value))) {\n date = new Date(parseFloat(value));\n }\n else if (typeof value === 'string' && /^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /**\n * For ISO Strings without time the day, month and year must be extracted from the ISO String\n * before Date creation to avoid time offset and errors in the new Date.\n * If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n * date, some browsers (e.g. IE 9) will throw an invalid Date error\n * If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n * is applied\n * Note: ISO months are 0 for January, 1 for February, ...\n */\n var _a = value.split('-').map(function (val) { return +val; }), y = _a[0], m = _a[1], d = _a[2];\n date = new Date(y, m - 1, d);\n }\n else if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {\n date = isoStringToDate(match);\n }\n else {\n date = new Date(value);\n }\n if (!isDate$1(date)) {\n throw invalidPipeArgumentError(DatePipe, value);\n }\n return formatDate(date, format, locale || this.locale, timezone);\n };\n DatePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'date', pure: true },] },\n ];\n /** @nocollapse */\n DatePipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DatePipe;\n}());\n/**\n * \\@internal\n * @param {?} match\n * @return {?}\n */\nfunction isoStringToDate(match) {\n var /** @type {?} */ date = new Date(0);\n var /** @type {?} */ tzHour = 0;\n var /** @type {?} */ tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var /** @type {?} */ dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var /** @type {?} */ timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = +(match[9] + match[10]);\n tzMin = +(match[9] + match[11]);\n }\n dateSetter.call(date, +(match[1]), +(match[2]) - 1, +(match[3]));\n var /** @type {?} */ h = +(match[4] || '0') - tzHour;\n var /** @type {?} */ m = +(match[5] || '0') - tzMin;\n var /** @type {?} */ s = +(match[6] || '0');\n var /** @type {?} */ ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isDate$1(value) {\n return value instanceof Date && !isNaN(value.valueOf());\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar NumberFormatter = /** @class */ (function () {\n function NumberFormatter() {\n }\n /**\n * @param {?} num\n * @param {?} locale\n * @param {?} style\n * @param {?=} opts\n * @return {?}\n */\n NumberFormatter.format = /**\n * @param {?} num\n * @param {?} locale\n * @param {?} style\n * @param {?=} opts\n * @return {?}\n */\n function (num, locale, style, opts) {\n if (opts === void 0) { opts = {}; }\n var minimumIntegerDigits = opts.minimumIntegerDigits, minimumFractionDigits = opts.minimumFractionDigits, maximumFractionDigits = opts.maximumFractionDigits, currency = opts.currency, _a = opts.currencyAsSymbol, currencyAsSymbol = _a === void 0 ? false : _a;\n var /** @type {?} */ options = {\n minimumIntegerDigits: minimumIntegerDigits,\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits,\n style: NumberFormatStyle[style].toLowerCase()\n };\n if (style == NumberFormatStyle.Currency) {\n options.currency = typeof currency == 'string' ? currency : undefined;\n options.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';\n }\n return new Intl.NumberFormat(locale, options).format(num);\n };\n return NumberFormatter;\n}());\nvar DATE_FORMATS_SPLIT$1 = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;\nvar PATTERN_ALIASES = {\n // Keys are quoted so they do not get renamed during closure compilation.\n 'yMMMdjms': datePartGetterFactory(combine([\n digitCondition('year', 1),\n nameCondition('month', 3),\n digitCondition('day', 1),\n digitCondition('hour', 1),\n digitCondition('minute', 1),\n digitCondition('second', 1),\n ])),\n 'yMdjm': datePartGetterFactory(combine([\n digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),\n digitCondition('hour', 1), digitCondition('minute', 1)\n ])),\n 'yMMMMEEEEd': datePartGetterFactory(combine([\n digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),\n digitCondition('day', 1)\n ])),\n 'yMMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),\n 'yMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),\n 'yMd': datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),\n 'jms': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),\n 'jm': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))\n};\nvar DATE_FORMATS$1 = {\n // Keys are quoted so they do not get renamed.\n 'yyyy': datePartGetterFactory(digitCondition('year', 4)),\n 'yy': datePartGetterFactory(digitCondition('year', 2)),\n 'y': datePartGetterFactory(digitCondition('year', 1)),\n 'MMMM': datePartGetterFactory(nameCondition('month', 4)),\n 'MMM': datePartGetterFactory(nameCondition('month', 3)),\n 'MM': datePartGetterFactory(digitCondition('month', 2)),\n 'M': datePartGetterFactory(digitCondition('month', 1)),\n 'LLLL': datePartGetterFactory(nameCondition('month', 4)),\n 'L': datePartGetterFactory(nameCondition('month', 1)),\n 'dd': datePartGetterFactory(digitCondition('day', 2)),\n 'd': datePartGetterFactory(digitCondition('day', 1)),\n 'HH': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),\n 'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),\n 'hh': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),\n 'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n 'jj': datePartGetterFactory(digitCondition('hour', 2)),\n 'j': datePartGetterFactory(digitCondition('hour', 1)),\n 'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),\n 'm': datePartGetterFactory(digitCondition('minute', 1)),\n 'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),\n 's': datePartGetterFactory(digitCondition('second', 1)),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit\n // fractions\n 'sss': datePartGetterFactory(digitCondition('second', 3)),\n 'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),\n 'EEE': datePartGetterFactory(nameCondition('weekday', 3)),\n 'EE': datePartGetterFactory(nameCondition('weekday', 2)),\n 'E': datePartGetterFactory(nameCondition('weekday', 1)),\n 'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n 'Z': timeZoneGetter$1('short'),\n 'z': timeZoneGetter$1('long'),\n 'ww': datePartGetterFactory({}),\n // Week of year, padded (00-53). Week 01 is the week with the\n // first Thursday of the year. not support ?\n 'w': datePartGetterFactory({}),\n // Week of year (0-53). Week 1 is the week with the first Thursday\n // of the year not support ?\n 'G': datePartGetterFactory(nameCondition('era', 1)),\n 'GG': datePartGetterFactory(nameCondition('era', 2)),\n 'GGG': datePartGetterFactory(nameCondition('era', 3)),\n 'GGGG': datePartGetterFactory(nameCondition('era', 4))\n};\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction digitModifier(inner) {\n return function (date, locale) {\n var /** @type {?} */ result = inner(date, locale);\n return result.length == 1 ? '0' + result : result;\n };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourClockExtractor(inner) {\n return function (date, locale) { return inner(date, locale).split(' ')[1]; };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourExtractor(inner) {\n return function (date, locale) { return inner(date, locale).split(' ')[0]; };\n}\n/**\n * @param {?} date\n * @param {?} locale\n * @param {?} options\n * @return {?}\n */\nfunction intlDateFormat(date, locale, options) {\n return new Intl.DateTimeFormat(locale, options).format(date).replace(/[\\u200e\\u200f]/g, '');\n}\n/**\n * @param {?} timezone\n * @return {?}\n */\nfunction timeZoneGetter$1(timezone) {\n // To workaround `Intl` API restriction for single timezone let format with 24 hours\n var /** @type {?} */ options = { hour: '2-digit', hour12: false, timeZoneName: timezone };\n return function (date, locale) {\n var /** @type {?} */ result = intlDateFormat(date, locale, options);\n // Then extract first 3 letters that related to hours\n return result ? result.substring(3) : '';\n };\n}\n/**\n * @param {?} options\n * @param {?} value\n * @return {?}\n */\nfunction hour12Modify(options, value) {\n options.hour12 = value;\n return options;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction digitCondition(prop, len) {\n var /** @type {?} */ result = {};\n result[prop] = len === 2 ? '2-digit' : 'numeric';\n return result;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction nameCondition(prop, len) {\n var /** @type {?} */ result = {};\n if (len < 4) {\n result[prop] = len > 1 ? 'short' : 'narrow';\n }\n else {\n result[prop] = 'long';\n }\n return result;\n}\n/**\n * @param {?} options\n * @return {?}\n */\nfunction combine(options) {\n return options.reduce(function (merged, opt) { return (Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"a\" /* __assign */])({}, merged, opt)); }, {});\n}\n/**\n * @param {?} ret\n * @return {?}\n */\nfunction datePartGetterFactory(ret) {\n return function (date, locale) { return intlDateFormat(date, locale, ret); };\n}\nvar DATE_FORMATTER_CACHE = new Map();\n/**\n * @param {?} format\n * @param {?} date\n * @param {?} locale\n * @return {?}\n */\nfunction dateFormatter(format, date, locale) {\n var /** @type {?} */ fn = PATTERN_ALIASES[format];\n if (fn)\n return fn(date, locale);\n var /** @type {?} */ cacheKey = format;\n var /** @type {?} */ parts = DATE_FORMATTER_CACHE.get(cacheKey);\n if (!parts) {\n parts = [];\n var /** @type {?} */ match = void 0;\n DATE_FORMATS_SPLIT$1.exec(format);\n var /** @type {?} */ _format = format;\n while (_format) {\n match = DATE_FORMATS_SPLIT$1.exec(_format);\n if (match) {\n parts = parts.concat(match.slice(1));\n _format = /** @type {?} */ ((parts.pop()));\n }\n else {\n parts.push(_format);\n _format = null;\n }\n }\n DATE_FORMATTER_CACHE.set(cacheKey, parts);\n }\n return parts.reduce(function (text, part) {\n var /** @type {?} */ fn = DATE_FORMATS$1[part];\n return text + (fn ? fn(date, locale) : partToTime(part));\n }, '');\n}\n/**\n * @param {?} part\n * @return {?}\n */\nfunction partToTime(part) {\n return part === '\\'\\'' ? '\\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n}\nvar DateFormatter = /** @class */ (function () {\n function DateFormatter() {\n }\n /**\n * @param {?} date\n * @param {?} locale\n * @param {?} pattern\n * @return {?}\n */\n DateFormatter.format = /**\n * @param {?} date\n * @param {?} locale\n * @param {?} pattern\n * @return {?}\n */\n function (date, locale, pattern) {\n return dateFormatter(pattern, date, locale);\n };\n return DateFormatter;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a date according to locale rules.\n * \\@howToUse `date_expression | date[:format]`\n * \\@description\n *\n * Where:\n * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string\n * (https://www.w3.org/TR/NOTE-datetime).\n * - `format` indicates which date/time components to include. The format can be predefined as\n * shown below or custom as shown in the table.\n * - `'medium'`: equivalent to `'yMMMdjms'` (e.g. `Sep 3, 2010, 12:05:08 PM` for `en-US`)\n * - `'short'`: equivalent to `'yMdjm'` (e.g. `9/3/2010, 12:05 PM` for `en-US`)\n * - `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. `Friday, September 3, 2010` for `en-US`)\n * - `'longDate'`: equivalent to `'yMMMMd'` (e.g. `September 3, 2010` for `en-US`)\n * - `'mediumDate'`: equivalent to `'yMMMd'` (e.g. `Sep 3, 2010` for `en-US`)\n * - `'shortDate'`: equivalent to `'yMd'` (e.g. `9/3/2010` for `en-US`)\n * - `'mediumTime'`: equivalent to `'jms'` (e.g. `12:05:08 PM` for `en-US`)\n * - `'shortTime'`: equivalent to `'jm'` (e.g. `12:05 PM` for `en-US`)\n *\n *\n * | Component | Symbol | Narrow | Short Form | Long Form | Numeric | 2-digit |\n * |-----------|:------:|--------|--------------|-------------------|-----------|-----------|\n * | era | G | G (A) | GGG (AD) | GGGG (Anno Domini)| - | - |\n * | year | y | - | - | - | y (2015) | yy (15) |\n * | month | M | L (S) | MMM (Sep) | MMMM (September) | M (9) | MM (09) |\n * | day | d | - | - | - | d (3) | dd (03) |\n * | weekday | E | E (S) | EEE (Sun) | EEEE (Sunday) | - | - |\n * | hour | j | - | - | - | j (13) | jj (13) |\n * | hour12 | h | - | - | - | h (1 PM) | hh (01 PM)|\n * | hour24 | H | - | - | - | H (13) | HH (13) |\n * | minute | m | - | - | - | m (5) | mm (05) |\n * | second | s | - | - | - | s (9) | ss (09) |\n * | timezone | z | - | - | z (Pacific Standard Time)| - | - |\n * | timezone | Z | - | Z (GMT-8:00) | - | - | - |\n * | timezone | a | - | a (PM) | - | - | - |\n *\n * In javascript, only the components specified will be respected (not the ordering,\n * punctuations, ...) and details of the formatting will be dependent on the locale.\n *\n * Timezone of the formatted text will be the local system timezone of the end-user's machine.\n *\n * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not\n * applied and the formatted text will have the same day, month and year of the expression.\n *\n * WARNINGS:\n * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.\n * Instead users should treat the date as an immutable object and change the reference when the\n * pipe needs to re-run (this is to avoid reformatting the date on every change detection run\n * which would be an expensive operation).\n * - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera\n * browsers.\n *\n * ### Examples\n *\n * Assuming `dateObj` is (year: 2010, month: 9, day: 3, hour: 12 PM, minute: 05, second: 08)\n * in the _local_ time and locale is 'en-US':\n *\n * {\\@example common/pipes/ts/date_pipe.ts region='DeprecatedDatePipe'}\n *\n * \\@stable\n */\nvar DeprecatedDatePipe = /** @class */ (function () {\n function DeprecatedDatePipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} pattern\n * @return {?}\n */\n DeprecatedDatePipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} pattern\n * @return {?}\n */\n function (value, pattern) {\n if (pattern === void 0) { pattern = 'mediumDate'; }\n if (value == null || value === '' || value !== value)\n return null;\n var /** @type {?} */ date;\n if (typeof value === 'string') {\n value = value.trim();\n }\n if (isDate(value)) {\n date = value;\n }\n else if (!isNaN(value - parseFloat(value))) {\n date = new Date(parseFloat(value));\n }\n else if (typeof value === 'string' && /^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /**\n * For ISO Strings without time the day, month and year must be extracted from the ISO String\n * before Date creation to avoid time offset and errors in the new Date.\n * If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n * date, some browsers (e.g. IE 9) will throw an invalid Date error\n * If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the\n * timeoffset\n * is applied\n * Note: ISO months are 0 for January, 1 for February, ...\n */\n var _a = value.split('-').map(function (val) { return parseInt(val, 10); }), y = _a[0], m = _a[1], d = _a[2];\n date = new Date(y, m - 1, d);\n }\n else {\n date = new Date(value);\n }\n if (!isDate(date)) {\n var /** @type {?} */ match = void 0;\n if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {\n date = isoStringToDate(match);\n }\n else {\n throw invalidPipeArgumentError(DeprecatedDatePipe, value);\n }\n }\n return DateFormatter.format(date, this._locale, DeprecatedDatePipe._ALIASES[pattern] || pattern);\n };\n /**\n * \\@internal\n */\n DeprecatedDatePipe._ALIASES = {\n 'medium': 'yMMMdjms',\n 'short': 'yMdjm',\n 'fullDate': 'yMMMMEEEEd',\n 'longDate': 'yMMMMd',\n 'mediumDate': 'yMMMd',\n 'shortDate': 'yMd',\n 'mediumTime': 'jms',\n 'shortTime': 'jm'\n };\n DeprecatedDatePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'date', pure: true },] },\n ];\n /** @nocollapse */\n DeprecatedDatePipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedDatePipe;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isDate(value) {\n return value instanceof Date && !isNaN(value.valueOf());\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\nvar PATTERN_SEP = ';';\nvar GROUP_SEP = ',';\nvar DIGIT_CHAR = '#';\nvar CURRENCY_CHAR = '¤';\nvar PERCENT_CHAR = '%';\n/**\n * Transform a number to a locale string based on a style and a format\n *\n * \\@internal\n * @param {?} value\n * @param {?} locale\n * @param {?} style\n * @param {?=} digitsInfo\n * @param {?=} currency\n * @return {?}\n */\nfunction formatNumber$1(value, locale, style, digitsInfo, currency) {\n if (currency === void 0) { currency = null; }\n var /** @type {?} */ res = { str: null };\n var /** @type {?} */ format = getLocaleNumberFormat(locale, style);\n var /** @type {?} */ num;\n // Convert strings to numbers\n if (typeof value === 'string' && !isNaN(+value - parseFloat(value))) {\n num = +value;\n }\n else if (typeof value !== 'number') {\n res.error = value + \" is not a number\";\n return res;\n }\n else {\n num = value;\n }\n var /** @type {?} */ pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n var /** @type {?} */ formattedText = '';\n var /** @type {?} */ isZero = false;\n if (!isFinite(num)) {\n formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);\n }\n else {\n var /** @type {?} */ parsedNumber = parseNumber(num);\n if (style === NumberFormatStyle.Percent) {\n parsedNumber = toPercent(parsedNumber);\n }\n var /** @type {?} */ minInt = pattern.minInt;\n var /** @type {?} */ minFraction = pattern.minFrac;\n var /** @type {?} */ maxFraction = pattern.maxFrac;\n if (digitsInfo) {\n var /** @type {?} */ parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);\n if (parts === null) {\n res.error = digitsInfo + \" is not a valid digit info\";\n return res;\n }\n var /** @type {?} */ minIntPart = parts[1];\n var /** @type {?} */ minFractionPart = parts[3];\n var /** @type {?} */ maxFractionPart = parts[5];\n if (minIntPart != null) {\n minInt = parseIntAutoRadix(minIntPart);\n }\n if (minFractionPart != null) {\n minFraction = parseIntAutoRadix(minFractionPart);\n }\n if (maxFractionPart != null) {\n maxFraction = parseIntAutoRadix(maxFractionPart);\n }\n else if (minFractionPart != null && minFraction > maxFraction) {\n maxFraction = minFraction;\n }\n }\n roundNumber(parsedNumber, minFraction, maxFraction);\n var /** @type {?} */ digits = parsedNumber.digits;\n var /** @type {?} */ integerLen = parsedNumber.integerLen;\n var /** @type {?} */ exponent = parsedNumber.exponent;\n var /** @type {?} */ decimals = [];\n isZero = digits.every(function (d) { return !d; });\n // pad zeros for small numbers\n for (; integerLen < minInt; integerLen++) {\n digits.unshift(0);\n }\n // pad zeros for small numbers\n for (; integerLen < 0; integerLen++) {\n digits.unshift(0);\n }\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n }\n else {\n decimals = digits;\n digits = [0];\n }\n // format the integer digits with grouping separators\n var /** @type {?} */ groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n var /** @type {?} */ groupSymbol = currency ? NumberSymbol.CurrencyGroup : NumberSymbol.Group;\n formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));\n // append the decimal digits\n if (decimals.length) {\n var /** @type {?} */ decimalSymbol = currency ? NumberSymbol.CurrencyDecimal : NumberSymbol.Decimal;\n formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');\n }\n if (exponent) {\n formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;\n }\n }\n if (num < 0 && !isZero) {\n formattedText = pattern.negPre + formattedText + pattern.negSuf;\n }\n else {\n formattedText = pattern.posPre + formattedText + pattern.posSuf;\n }\n if (style === NumberFormatStyle.Currency && currency !== null) {\n res.str = formattedText\n .replace(CURRENCY_CHAR, currency)\n .replace(CURRENCY_CHAR, '');\n return res;\n }\n if (style === NumberFormatStyle.Percent) {\n res.str = formattedText.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));\n return res;\n }\n res.str = formattedText;\n return res;\n}\n/**\n * @param {?} format\n * @param {?=} minusSign\n * @return {?}\n */\nfunction parseNumberFormat(format, minusSign) {\n if (minusSign === void 0) { minusSign = '-'; }\n var /** @type {?} */ p = {\n minInt: 1,\n minFrac: 0,\n maxFrac: 0,\n posPre: '',\n posSuf: '',\n negPre: '',\n negSuf: '',\n gSize: 0,\n lgSize: 0\n };\n var /** @type {?} */ patternParts = format.split(PATTERN_SEP);\n var /** @type {?} */ positive = patternParts[0];\n var /** @type {?} */ negative = patternParts[1];\n var /** @type {?} */ positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?\n positive.split(DECIMAL_SEP) :\n [\n positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),\n positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)\n ], /** @type {?} */\n integer = positiveParts[0], /** @type {?} */ fraction = positiveParts[1] || '';\n p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));\n for (var /** @type {?} */ i = 0; i < fraction.length; i++) {\n var /** @type {?} */ ch = fraction.charAt(i);\n if (ch === ZERO_CHAR) {\n p.minFrac = p.maxFrac = i + 1;\n }\n else if (ch === DIGIT_CHAR) {\n p.maxFrac = i + 1;\n }\n else {\n p.posSuf += ch;\n }\n }\n var /** @type {?} */ groups = integer.split(GROUP_SEP);\n p.gSize = groups[1] ? groups[1].length : 0;\n p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;\n if (negative) {\n var /** @type {?} */ trunkLen = positive.length - p.posPre.length - p.posSuf.length, /** @type {?} */\n pos = negative.indexOf(DIGIT_CHAR);\n p.negPre = negative.substr(0, pos).replace(/'/g, '');\n p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');\n }\n else {\n p.negPre = minusSign + p.posPre;\n p.negSuf = p.posSuf;\n }\n return p;\n}\n/**\n * @param {?} parsedNumber\n * @return {?}\n */\nfunction toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var /** @type {?} */ fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}\n/**\n * Parses a number.\n * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/\n * @param {?} num\n * @return {?}\n */\nfunction parseNumber(num) {\n var /** @type {?} */ numStr = Math.abs(num) + '';\n var /** @type {?} */ exponent = 0, /** @type {?} */ digits, /** @type {?} */ integerLen;\n var /** @type {?} */ i, /** @type {?} */ j, /** @type {?} */ zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changes the parsedNumber in-place\n * @param {?} parsedNumber\n * @param {?} minFrac\n * @param {?} maxFrac\n * @return {?}\n */\nfunction roundNumber(parsedNumber, minFrac, maxFrac) {\n if (minFrac > maxFrac) {\n throw new Error(\"The minimum number of digits after fraction (\" + minFrac + \") is higher than the maximum (\" + maxFrac + \").\");\n }\n var /** @type {?} */ digits = parsedNumber.digits;\n var /** @type {?} */ fractionLen = digits.length - parsedNumber.integerLen;\n var /** @type {?} */ fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);\n // The index of the digit to where rounding is to occur\n var /** @type {?} */ roundAt = fractionSize + parsedNumber.integerLen;\n var /** @type {?} */ digit = digits[roundAt];\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.integerLen, roundAt));\n // Set non-fractional digits beyond `roundAt` to 0\n for (var /** @type {?} */ j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n }\n else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.integerLen = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var /** @type {?} */ i = 1; i < roundAt; i++)\n digits[i] = 0;\n }\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var /** @type {?} */ k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.integerLen++;\n }\n digits.unshift(1);\n parsedNumber.integerLen++;\n }\n else {\n digits[roundAt - 1]++;\n }\n }\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++)\n digits.push(0);\n var /** @type {?} */ dropTrailingZeros = fractionSize !== 0;\n // Minimal length = nb of decimals required + current nb of integers\n // Any number besides that is optional and can be removed if it's a trailing 0\n var /** @type {?} */ minLen = minFrac + parsedNumber.integerLen;\n // Do any carrying, e.g. a digit was rounded up to 10\n var /** @type {?} */ carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d < 10 ? d : d - 10; // d % 10\n if (dropTrailingZeros) {\n // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n if (digits[i] === 0 && i >= minLen) {\n digits.pop();\n }\n else {\n dropTrailingZeros = false;\n }\n }\n return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.integerLen++;\n }\n}\n/**\n * \\@internal\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n var /** @type {?} */ result = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} pipe\n * @param {?} locale\n * @param {?} value\n * @param {?} style\n * @param {?=} digits\n * @param {?=} currency\n * @param {?=} currencyAsSymbol\n * @return {?}\n */\nfunction formatNumber(pipe, locale, value, style, digits, currency, currencyAsSymbol) {\n if (currency === void 0) { currency = null; }\n if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }\n if (value == null)\n return null;\n // Convert strings to numbers\n value = typeof value === 'string' && !isNaN(+value - parseFloat(value)) ? +value : value;\n if (typeof value !== 'number') {\n throw invalidPipeArgumentError(pipe, value);\n }\n var /** @type {?} */ minInt;\n var /** @type {?} */ minFraction;\n var /** @type {?} */ maxFraction;\n if (style !== NumberFormatStyle.Currency) {\n // rely on Intl default for currency\n minInt = 1;\n minFraction = 0;\n maxFraction = 3;\n }\n if (digits) {\n var /** @type {?} */ parts = digits.match(NUMBER_FORMAT_REGEXP);\n if (parts === null) {\n throw new Error(digits + \" is not a valid digit info for number pipes\");\n }\n if (parts[1] != null) {\n // min integer digits\n minInt = parseIntAutoRadix(parts[1]);\n }\n if (parts[3] != null) {\n // min fraction digits\n minFraction = parseIntAutoRadix(parts[3]);\n }\n if (parts[5] != null) {\n // max fraction digits\n maxFraction = parseIntAutoRadix(parts[5]);\n }\n }\n return NumberFormatter.format(/** @type {?} */ (value), locale, style, {\n minimumIntegerDigits: minInt,\n minimumFractionDigits: minFraction,\n maximumFractionDigits: maxFraction,\n currency: currency,\n currencyAsSymbol: currencyAsSymbol,\n });\n}\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number according to locale rules.\n * \\@howToUse `number_expression | number[:digitInfo]`\n *\n * Formats a number as text. Group sizing and separator and other locale-specific\n * configurations are based on the active locale.\n *\n * where `expression` is a number:\n * - `digitInfo` is a `string` which has a following format: <br>\n * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>\n * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.\n * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.\n * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.\n *\n * For more information on the acceptable range for each of these numbers and other\n * details see your native internationalization library.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}\n *\n * \\@stable\n */\nvar DeprecatedDecimalPipe = /** @class */ (function () {\n function DeprecatedDecimalPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedDecimalPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n function (value, digits) {\n return formatNumber(DeprecatedDecimalPipe, this._locale, value, NumberFormatStyle.Decimal, digits);\n };\n DeprecatedDecimalPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'number' },] },\n ];\n /** @nocollapse */\n DeprecatedDecimalPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedDecimalPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as a percentage according to locale rules.\n * \\@howToUse `number_expression | percent[:digitInfo]`\n *\n * \\@description\n *\n * Formats a number as percentage.\n *\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}\n *\n * \\@stable\n */\nvar DeprecatedPercentPipe = /** @class */ (function () {\n function DeprecatedPercentPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedPercentPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @return {?}\n */\n function (value, digits) {\n return formatNumber(DeprecatedPercentPipe, this._locale, value, NumberFormatStyle.Percent, digits);\n };\n DeprecatedPercentPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'percent' },] },\n ];\n /** @nocollapse */\n DeprecatedPercentPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedPercentPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as currency using locale rules.\n * \\@howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]`\n * \\@description\n *\n * Use `currency` to format a number as currency.\n *\n * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such\n * as `USD` for the US dollar and `EUR` for the euro.\n * - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.\n * - `true`: use symbol (e.g. `$`).\n * - `false`(default): use code (e.g. `USD`).\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}\n *\n * \\@stable\n */\nvar DeprecatedCurrencyPipe = /** @class */ (function () {\n function DeprecatedCurrencyPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} symbolDisplay\n * @param {?=} digits\n * @return {?}\n */\n DeprecatedCurrencyPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} symbolDisplay\n * @param {?=} digits\n * @return {?}\n */\n function (value, currencyCode, symbolDisplay, digits) {\n if (currencyCode === void 0) { currencyCode = 'USD'; }\n if (symbolDisplay === void 0) { symbolDisplay = false; }\n return formatNumber(DeprecatedCurrencyPipe, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);\n };\n DeprecatedCurrencyPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'currency' },] },\n ];\n /** @nocollapse */\n DeprecatedCurrencyPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DeprecatedCurrencyPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of deprecated i18n pipes that require intl api\n *\n * @deprecated from v5\n */\nvar COMMON_DEPRECATED_I18N_PIPES = [DeprecatedDecimalPipe, DeprecatedPercentPipe, DeprecatedCurrencyPipe, DeprecatedDatePipe];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ObservableStrategy = /** @class */ (function () {\n function ObservableStrategy() {\n }\n /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n ObservableStrategy.prototype.createSubscription = /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n function (async, updateLatestValue) {\n return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });\n };\n /**\n * @param {?} subscription\n * @return {?}\n */\n ObservableStrategy.prototype.dispose = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { subscription.unsubscribe(); };\n /**\n * @param {?} subscription\n * @return {?}\n */\n ObservableStrategy.prototype.onDestroy = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { subscription.unsubscribe(); };\n return ObservableStrategy;\n}());\nvar PromiseStrategy = /** @class */ (function () {\n function PromiseStrategy() {\n }\n /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n PromiseStrategy.prototype.createSubscription = /**\n * @param {?} async\n * @param {?} updateLatestValue\n * @return {?}\n */\n function (async, updateLatestValue) {\n return async.then(updateLatestValue, function (e) { throw e; });\n };\n /**\n * @param {?} subscription\n * @return {?}\n */\n PromiseStrategy.prototype.dispose = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { };\n /**\n * @param {?} subscription\n * @return {?}\n */\n PromiseStrategy.prototype.onDestroy = /**\n * @param {?} subscription\n * @return {?}\n */\n function (subscription) { };\n return PromiseStrategy;\n}());\nvar _promiseStrategy = new PromiseStrategy();\nvar _observableStrategy = new ObservableStrategy();\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Unwraps a value from an asynchronous primitive.\n * \\@howToUse `observable_or_promise_expression | async`\n * \\@description\n * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n * potential memory leaks.\n *\n *\n * ## Examples\n *\n * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n * promise.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n *\n * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n * to the view. The Observable continuously updates the view with the current time.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n *\n * \\@stable\n */\nvar AsyncPipe = /** @class */ (function () {\n function AsyncPipe(_ref) {\n this._ref = _ref;\n this._latestValue = null;\n this._latestReturnedValue = null;\n this._subscription = null;\n this._obj = null;\n this._strategy = /** @type {?} */ ((null));\n }\n /**\n * @return {?}\n */\n AsyncPipe.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._subscription) {\n this._dispose();\n }\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype.transform = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n if (!this._obj) {\n if (obj) {\n this._subscribe(obj);\n }\n this._latestReturnedValue = this._latestValue;\n return this._latestValue;\n }\n if (obj !== this._obj) {\n this._dispose();\n return this.transform(/** @type {?} */ (obj));\n }\n if (this._latestValue === this._latestReturnedValue) {\n return this._latestReturnedValue;\n }\n this._latestReturnedValue = this._latestValue;\n return __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"WrappedValue\"].wrap(this._latestValue);\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype._subscribe = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n var _this = this;\n this._obj = obj;\n this._strategy = this._selectStrategy(obj);\n this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n AsyncPipe.prototype._selectStrategy = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisPromise\"])(obj)) {\n return _promiseStrategy;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ɵisObservable\"])(obj)) {\n return _observableStrategy;\n }\n throw invalidPipeArgumentError(AsyncPipe, obj);\n };\n /**\n * @return {?}\n */\n AsyncPipe.prototype._dispose = /**\n * @return {?}\n */\n function () {\n this._strategy.dispose(/** @type {?} */ ((this._subscription)));\n this._latestValue = null;\n this._latestReturnedValue = null;\n this._subscription = null;\n this._obj = null;\n };\n /**\n * @param {?} async\n * @param {?} value\n * @return {?}\n */\n AsyncPipe.prototype._updateLatestValue = /**\n * @param {?} async\n * @param {?} value\n * @return {?}\n */\n function (async, value) {\n if (async === this._obj) {\n this._latestValue = value;\n this._ref.markForCheck();\n }\n };\n AsyncPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'async', pure: false },] },\n ];\n /** @nocollapse */\n AsyncPipe.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n return AsyncPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms text to lowercase.\n *\n * {\\@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe' }\n *\n * \\@stable\n */\nvar LowerCasePipe = /** @class */ (function () {\n function LowerCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n LowerCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(LowerCasePipe, value);\n }\n return value.toLowerCase();\n };\n LowerCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'lowercase' },] },\n ];\n /** @nocollapse */\n LowerCasePipe.ctorParameters = function () { return []; };\n return LowerCasePipe;\n}());\n/**\n * Helper method to transform a single word to titlecase.\n *\n * \\@stable\n * @param {?} word\n * @return {?}\n */\nfunction titleCaseWord(word) {\n if (!word)\n return word;\n return word[0].toUpperCase() + word.substr(1).toLowerCase();\n}\n/**\n * Transforms text to titlecase.\n *\n * \\@stable\n */\nvar TitleCasePipe = /** @class */ (function () {\n function TitleCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n TitleCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(TitleCasePipe, value);\n }\n return value.split(/\\b/g).map(function (word) { return titleCaseWord(word); }).join('');\n };\n TitleCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'titlecase' },] },\n ];\n /** @nocollapse */\n TitleCasePipe.ctorParameters = function () { return []; };\n return TitleCasePipe;\n}());\n/**\n * Transforms text to uppercase.\n *\n * \\@stable\n */\nvar UpperCasePipe = /** @class */ (function () {\n function UpperCasePipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n UpperCasePipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!value)\n return value;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(UpperCasePipe, value);\n }\n return value.toUpperCase();\n };\n UpperCasePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'uppercase' },] },\n ];\n /** @nocollapse */\n UpperCasePipe.ctorParameters = function () { return []; };\n return UpperCasePipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _INTERPOLATION_REGEXP = /#/g;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Maps a value to a string that pluralizes the value according to locale rules.\n * \\@howToUse `expression | i18nPlural:mapping[:locale]`\n * \\@description\n *\n * Where:\n * - `expression` is a number.\n * - `mapping` is an object that mimics the ICU format, see\n * http://userguide.icu-project.org/formatparse/messages\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}\n *\n * \\@experimental\n */\nvar I18nPluralPipe = /** @class */ (function () {\n function I18nPluralPipe(_localization) {\n this._localization = _localization;\n }\n /**\n * @param {?} value\n * @param {?} pluralMap\n * @param {?=} locale\n * @return {?}\n */\n I18nPluralPipe.prototype.transform = /**\n * @param {?} value\n * @param {?} pluralMap\n * @param {?=} locale\n * @return {?}\n */\n function (value, pluralMap, locale) {\n if (value == null)\n return '';\n if (typeof pluralMap !== 'object' || pluralMap === null) {\n throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);\n }\n var /** @type {?} */ key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);\n return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());\n };\n I18nPluralPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'i18nPlural', pure: true },] },\n ];\n /** @nocollapse */\n I18nPluralPipe.ctorParameters = function () { return [\n { type: NgLocalization, },\n ]; };\n return I18nPluralPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Generic selector that displays the string that matches the current value.\n * \\@howToUse `expression | i18nSelect:mapping`\n * \\@description\n *\n * Where `mapping` is an object that indicates the text that should be displayed\n * for different values of the provided `expression`.\n * If none of the keys of the mapping match the value of the `expression`, then the content\n * of the `other` key is returned when present, otherwise an empty string is returned.\n *\n * ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}\n *\n * \\@experimental\n */\nvar I18nSelectPipe = /** @class */ (function () {\n function I18nSelectPipe() {\n }\n /**\n * @param {?} value\n * @param {?} mapping\n * @return {?}\n */\n I18nSelectPipe.prototype.transform = /**\n * @param {?} value\n * @param {?} mapping\n * @return {?}\n */\n function (value, mapping) {\n if (value == null)\n return '';\n if (typeof mapping !== 'object' || typeof value !== 'string') {\n throw invalidPipeArgumentError(I18nSelectPipe, mapping);\n }\n if (mapping.hasOwnProperty(value)) {\n return mapping[value];\n }\n if (mapping.hasOwnProperty('other')) {\n return mapping['other'];\n }\n return '';\n };\n I18nSelectPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'i18nSelect', pure: true },] },\n ];\n /** @nocollapse */\n I18nSelectPipe.ctorParameters = function () { return []; };\n return I18nSelectPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Converts value into JSON string.\n * \\@howToUse `expression | json`\n * \\@description\n *\n * Converts value into string using `JSON.stringify`. Useful for debugging.\n *\n * ### Example\n * {\\@example common/pipes/ts/json_pipe.ts region='JsonPipe'}\n *\n * \\@stable\n */\nvar JsonPipe = /** @class */ (function () {\n function JsonPipe() {\n }\n /**\n * @param {?} value\n * @return {?}\n */\n JsonPipe.prototype.transform = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { return JSON.stringify(value, null, 2); };\n JsonPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'json', pure: false },] },\n ];\n /** @nocollapse */\n JsonPipe.ctorParameters = function () { return []; };\n return JsonPipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number according to locale rules.\n * \\@howToUse `number_expression | number[:digitInfo[:locale]]`\n *\n * Formats a number as text. Group sizing and separator and other locale-specific\n * configurations are based on the active locale.\n *\n * where `expression` is a number:\n * - `digitInfo` is a `string` which has a following format: <br>\n * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>\n * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.\n * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.\n * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * For more information on the acceptable range for each of these numbers and other\n * details see your native internationalization library.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='NumberPipe'}\n *\n * \\@stable\n */\nvar DecimalPipe = /** @class */ (function () {\n function DecimalPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n DecimalPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, digits, locale) {\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Decimal, digits), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(DecimalPipe, error);\n }\n return str;\n };\n DecimalPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'number' },] },\n ];\n /** @nocollapse */\n DecimalPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return DecimalPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as a percentage according to locale rules.\n * \\@howToUse `number_expression | percent[:digitInfo[:locale]]`\n *\n * \\@description\n *\n * Formats a number as percentage.\n *\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}\n *\n * \\@stable\n */\nvar PercentPipe = /** @class */ (function () {\n function PercentPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n PercentPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, digits, locale) {\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Percent, digits), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(PercentPipe, error);\n }\n return str;\n };\n PercentPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'percent' },] },\n ];\n /** @nocollapse */\n PercentPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return PercentPipe;\n}());\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as currency using locale rules.\n * \\@howToUse `number_expression | currency[:currencyCode[:display[:digitInfo[:locale]]]]`\n * \\@description\n *\n * Use `currency` to format a number as currency.\n *\n * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such\n * as `USD` for the US dollar and `EUR` for the euro.\n * - `display` indicates whether to show the currency symbol or the code.\n * - `code`: use code (e.g. `USD`).\n * - `symbol`(default): use symbol (e.g. `$`).\n * - `symbol-narrow`: some countries have two symbols for their currency, one regular and one\n * narrow (e.g. the canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`).\n * - boolean (deprecated from v5): `true` for symbol and false for `code`\n * If there is no narrow symbol for the chosen currency, the regular symbol will be used.\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n * - `locale` is a `string` defining the locale to use (uses the current {\\@link LOCALE_ID} by\n * default)\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}\n *\n * \\@stable\n */\nvar CurrencyPipe = /** @class */ (function () {\n function CurrencyPipe(_locale) {\n this._locale = _locale;\n }\n /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} display\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n CurrencyPipe.prototype.transform = /**\n * @param {?} value\n * @param {?=} currencyCode\n * @param {?=} display\n * @param {?=} digits\n * @param {?=} locale\n * @return {?}\n */\n function (value, currencyCode, display, digits, locale) {\n if (display === void 0) { display = 'symbol'; }\n if (isEmpty(value))\n return null;\n locale = locale || this._locale;\n if (typeof display === 'boolean') {\n if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn(\"Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \\\"code\\\", \\\"symbol\\\" or \\\"symbol-narrow\\\".\");\n }\n display = display ? 'symbol' : 'code';\n }\n var /** @type {?} */ currency = currencyCode || 'USD';\n if (display !== 'code') {\n currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow');\n }\n var _a = formatNumber$1(value, locale, NumberFormatStyle.Currency, digits, currency), str = _a.str, error = _a.error;\n if (error) {\n throw invalidPipeArgumentError(CurrencyPipe, error);\n }\n return str;\n };\n CurrencyPipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'currency' },] },\n ];\n /** @nocollapse */\n CurrencyPipe.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"LOCALE_ID\"],] },] },\n ]; };\n return CurrencyPipe;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isEmpty(value) {\n return value == null || value === '' || value !== value;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a new List or String containing a subset (slice) of the elements.\n * \\@howToUse `array_or_string_expression | slice:start[:end]`\n * \\@description\n *\n * Where the input expression is a `List` or `String`, and:\n * - `start`: The starting index of the subset to return.\n * - **a positive integer**: return the item at `start` index and all items after\n * in the list or string expression.\n * - **a negative integer**: return the item at `start` index from the end and all items after\n * in the list or string expression.\n * - **if positive and greater than the size of the expression**: return an empty list or string.\n * - **if negative and greater than the size of the expression**: return entire list or string.\n * - `end`: The ending index of the subset to return.\n * - **omitted**: return all items until the end.\n * - **if positive**: return all items before `end` index of the list or string.\n * - **if negative**: return all items before `end` index from the end of the list or string.\n *\n * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`\n * and `String.prototype.slice()`.\n *\n * When operating on a [List], the returned list is always a copy even when all\n * the elements are being returned.\n *\n * When operating on a blank value, the pipe returns the blank value.\n *\n * ## List Example\n *\n * This `ngFor` example:\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}\n *\n * produces the following:\n *\n * <li>b</li>\n * <li>c</li>\n *\n * ## String Examples\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}\n *\n * \\@stable\n */\nvar SlicePipe = /** @class */ (function () {\n function SlicePipe() {\n }\n /**\n * @param {?} value\n * @param {?} start\n * @param {?=} end\n * @return {?}\n */\n SlicePipe.prototype.transform = /**\n * @param {?} value\n * @param {?} start\n * @param {?=} end\n * @return {?}\n */\n function (value, start, end) {\n if (value == null)\n return value;\n if (!this.supports(value)) {\n throw invalidPipeArgumentError(SlicePipe, value);\n }\n return value.slice(start, end);\n };\n /**\n * @param {?} obj\n * @return {?}\n */\n SlicePipe.prototype.supports = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) { return typeof obj === 'string' || Array.isArray(obj); };\n SlicePipe.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Pipe\"], args: [{ name: 'slice', pure: false },] },\n ];\n /** @nocollapse */\n SlicePipe.ctorParameters = function () { return []; };\n return SlicePipe;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A collection of Angular pipes that are likely to be used in each and every application.\n */\nvar COMMON_PIPES = [\n AsyncPipe,\n UpperCasePipe,\n LowerCasePipe,\n JsonPipe,\n SlicePipe,\n DecimalPipe,\n PercentPipe,\n TitleCasePipe,\n CurrencyPipe,\n DatePipe,\n I18nPluralPipe,\n I18nSelectPipe,\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * The module that includes all the basic Angular directives like {\\@link NgIf}, {\\@link NgForOf}, ...\n *\n * \\@stable\n */\nvar CommonModule = /** @class */ (function () {\n function CommonModule() {\n }\n CommonModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [COMMON_DIRECTIVES, COMMON_PIPES],\n exports: [COMMON_DIRECTIVES, COMMON_PIPES],\n providers: [\n { provide: NgLocalization, useClass: NgLocaleLocalization },\n ],\n },] },\n ];\n /** @nocollapse */\n CommonModule.ctorParameters = function () { return []; };\n return CommonModule;\n}());\nvar ɵ0 = getPluralCase;\n/**\n * A module that contains the deprecated i18n pipes.\n *\n * @deprecated from v5\n */\nvar DeprecatedI18NPipesModule = /** @class */ (function () {\n function DeprecatedI18NPipesModule() {\n }\n DeprecatedI18NPipesModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [COMMON_DEPRECATED_I18N_PIPES],\n exports: [COMMON_DEPRECATED_I18N_PIPES],\n providers: [{ provide: DEPRECATED_PLURAL_FN, useValue: ɵ0 }],\n },] },\n ];\n /** @nocollapse */\n DeprecatedI18NPipesModule.ctorParameters = function () { return []; };\n return DeprecatedI18NPipesModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application into a Web Worker).\n *\n * \\@stable\n */\nvar DOCUMENT = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('DocumentToken');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PLATFORM_BROWSER_ID = 'browser';\nvar PLATFORM_SERVER_ID = 'server';\nvar PLATFORM_WORKER_APP_ID = 'browserWorkerApp';\nvar PLATFORM_WORKER_UI_ID = 'browserWorkerUi';\n/**\n * Returns whether a platform id represents a browser platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformBrowser(platformId) {\n return platformId === PLATFORM_BROWSER_ID;\n}\n/**\n * Returns whether a platform id represents a server platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformServer(platformId) {\n return platformId === PLATFORM_SERVER_ID;\n}\n/**\n * Returns whether a platform id represents a web worker app platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerApp(platformId) {\n return platformId === PLATFORM_WORKER_APP_ID;\n}\n/**\n * Returns whether a platform id represents a web worker UI platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerUi(platformId) {\n return platformId === PLATFORM_WORKER_UI_ID;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=common.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvY29tbW9uL2VzbTUvY29tbW9uLmpzPzVlM2MiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZSBBbmd1bGFyIHY1LjIuMlxuICogKGMpIDIwMTAtMjAxOCBHb29nbGUsIEluYy4gaHR0cHM6Ly9hbmd1bGFyLmlvL1xuICogTGljZW5zZTogTUlUXG4gKi9cbmltcG9ydCB7IEF0dHJpYnV0ZSwgQ2hhbmdlRGV0ZWN0b3JSZWYsIENvbXBvbmVudEZhY3RvcnlSZXNvbHZlciwgRGlyZWN0aXZlLCBFbGVtZW50UmVmLCBFdmVudEVtaXR0ZXIsIEhvc3QsIEluamVjdCwgSW5qZWN0YWJsZSwgSW5qZWN0aW9uVG9rZW4sIElucHV0LCBJdGVyYWJsZURpZmZlcnMsIEtleVZhbHVlRGlmZmVycywgTE9DQUxFX0lELCBOZ01vZHVsZSwgTmdNb2R1bGVSZWYsIE9wdGlvbmFsLCBQaXBlLCBSZW5kZXJlcjIsIFRlbXBsYXRlUmVmLCBWZXJzaW9uLCBWaWV3Q29udGFpbmVyUmVmLCBXcmFwcGVkVmFsdWUsIGlzRGV2TW9kZSwgybVpc0xpc3RMaWtlSXRlcmFibGUsIMm1aXNPYnNlcnZhYmxlLCDJtWlzUHJvbWlzZSwgybVzdHJpbmdpZnkgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IF9fYXNzaWduLCBfX2V4dGVuZHMgfSBmcm9tICd0c2xpYic7XG5cbi8qKlxuICogQGZpbGVvdmVydmlldyBhZGRlZCB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JwJ10sXG4gICAgJ0lMUyc6IFsn4oKqJ10sXG4gICAgJ0lOUic6IFsn4oK5J10sXG4gICAgJ0lTSyc6IFssICdrciddLFxuICAgICdKTUQnOiBbLCAnJCddLFxuICAgICdKUFknOiBbJ8KlJ10sXG4gICAgJ0tIUic6IFssICfhn5snXSxcbiAgICAnS01GJzogWywgJ0NGJ10sXG4gICAgJ0tQVyc6IFssICfigqknXSxcbiAgICAnS1JXJzogWyfigqknXSxcbiAgICAnS1lEJzogWywgJyQnXSxcbiAgICAnS1pUJzogWywgJ+KCuCddLFxuICAgICdMQUsnOiBbLCAn4oKtJ10sXG4gICAgJ0xCUCc6IFssICdMwqMnXSxcbiAgICAnTEtSJzogWywgJ1JzJ10sXG4gICAgJ0xSRCc6IFssICckJ10sXG4gICAgJ0xUTCc6IFssICdMdCddLFxuICAgICdMVkwnOiBbLCAnTHMnXSxcbiAgICAnTUdBJzogWywgJ0FyJ10sXG4gICAgJ01NSyc6IFssICdLJ10sXG4gICAgJ01OVCc6IFssICfigq4nXSxcbiAgICAnTVVSJzogWywgJ1JzJ10sXG4gICAgJ01YTic6IFsnTVgkJywgJyQnXSxcbiAgICAnTVlSJzogWywgJ1JNJ10sXG4gICAgJ05BRCc6IFssICckJ10sXG4gICAgJ05HTic6IFssICfigqYnXSxcbiAgICAnTklPJzogWywgJ0MkJ10sXG4gICAgJ05PSyc6IFssICdrciddLFxuICAgICdOUFInOiBbLCAnUnMnXSxcbiAgICAnTlpEJzogWydOWiQnLCAnJCddLFxuICAgICdQSFAnOiBbLCAn4oKxJ10sXG4gICAgJ1BLUic6IFssICdScyddLFxuICAgICdQTE4nOiBbLCAnesWCJ10sXG4gICAgJ1BZRyc6IFssICfigrInXSxcbiAgICAnUk9OJzogWywgJ2xlaSddLFxuICAgICdSVUInOiBbLCAn4oK9J10sXG4gICAgJ1JVUic6IFssICfRgC4nXSxcbiAgICAnUldGJzogWywgJ1JGJ10sXG4gICAgJ1NCRCc6IFssICckJ10sXG4gICA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uICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcGFyYW0gez89fSBsb2NhbGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2YWx1ZSwgbG9jYWxlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBsdXJhbCA9IHRoaXMuZGVwcmVjYXRlZFBsdXJhbEZuID8gdGhpcy5kZXByZWNhdGVkUGx1cmFsRm4obG9jYWxlIHx8IHRoaXMubG9jYWxlLCB2YWx1ZSkgOlxuICAgICAgICAgICAgZ2V0TG9jYWxlUGx1cmFsQ2FzZShsb2NhbGUgfHwgdGhpcy5sb2NhbGUpKHZhbHVlKTtcbiAgICAgICAgc3dpdGNoIChwbHVyYWwpIHtcbiAgICAgICAgICAgIGNhc2UgUGx1cmFsLlplcm86XG4gICAgICAgICAgICAgICAgcmV0dXJuICd6ZXJvJztcbiAgICAgICAgICAgIGNhc2UgUGx1cmFsLk9uZTpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ29uZSc7XG4gICAgICAgICAgICBjYXNlIFBsdXJhbC5Ud286XG4gICAgICAgICAgICAgICAgcmV0dXJuICd0d28nO1xuICAgICAgICAgICAgY2FzZSBQbHVyYWwuRmV3OlxuICAgICAgICAgICAgICAgIHJldHVybiAnZmV3JztcbiAgICAgICAgICAgIGNhc2UgUGx1cmFsLk1hbnk6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdtYW55JztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdvdGhlcic7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE5nTG9jYWxlTG9jYWxpemF0aW9uLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogSW5qZWN0YWJsZSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdMb2NhbGVMb2NhbGl6YXRpb24uY3RvclBhcmFtZX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byc6XG4gICAgICAgIGNhc2UgJ2ptYyc6XG4gICAgICAgIGNhc2UgJ2thJzpcbiAgICAgICAgY2FzZSAna2snOlxuICAgICAgICBjYXNlICdra2onOlxuICAgICAgICBjYXNlICdrbCc6XG4gICAgICAgIGNhc2UgJ2tzJzpcbiAgICAgICAgY2FzZSAna3NiJzpcbiAgICAgICAgY2FzZSAna3knOlxuICAgICAgICBjYXNlICdsYic6XG4gICAgICAgIGNhc2UgJ2xnJzpcbiAgICAgICAgY2FzZSAnbWFzJzpcbiAgICAgICAgY2FzZSAnbWdvJzpcbiAgICAgICAgY2FzZSAnbWwnOlxuICAgICAgICBjYXNlICdtbic6XG4gICAgICAgIGNhc2UgJ25iJzpcbiAgICAgICAgY2FzZSAnbmQnOlxuICAgICAgICBjYXNlICduZSc6XG4gICAgICAgIGNhc2UgJ25uJzpcbiAgICAgICAgY2FzZSAnbm5oJzpcbiAgICAgICAgY2FzZSAnbnluJzpcbiAgICAgICAgY2FzZSAnb20nOlxuICAgICAgICBjYXNlICdvcic6XG4gICAgICAgIGNhc2UgJ29zJzpcbiAgICAgICAgY2FzZSAncHMnOlxuICAgICAgICBjYXNlICdybSc6XG4gICAgICAgIGNhc2UgJ3JvZic6XG4gICAgICAgIGNhc2UgJ3J3ayc6XG4gICAgICAgIGNhc2UgJ3NhcSc6XG4gICAgICAgIGNhc2UgJ3NlaCc6XG4gICAgICAgIGNhc2UgJ3NuJzpcbiAgICAgICAgY2FzZSAnc28nOlxuICAgICAgICBjYXNlICdzcSc6XG4gICAgICAgIGNhc2UgJ3RhJzpcbiAgICAgICAgY2FzZSAndGUnOlxuICAgICAgICBjYXNlICd0ZW8nOlxuICAgICAgICBjYXNlICd0ayc6XG4gICAgICAgIGNhc2UgJ3RyJzpcbiAgICAgICAgY2FzZSAndWcnOlxuICAgICAgICBjYXNlICd1eic6XG4gICAgICAgIGNhc2UgJ3ZvJzpcbiAgICAgICAgY2FzZSAndnVuJzpcbiAgICAgICAgY2FzZSAnd2FlJzpcbiAgICAgICAgY2FzZSAneG9nJzpcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYWsnOlxuICAgICAgICBjYXNlICdsbic6XG4gICAgICAgIGNhc2UgJ21nJzpcbiAgICAgICAgY2FzZSAncGEnOlxuICAgICAgICBjYXNlICd0aSc6XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDAgJiYgbiA8PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYW0nOlxuICAgICAgICBjYXNlICdhcyc6XG4gICAgICAgIGNhc2UgJ2JuJzpcbiAgICAgICAgY2FzZSAnZmEnOlxuICAgICAgICBjYXNlICdndSc6XG4gICAgICAgIGNhc2UgJ2hpJzpcbiAgICAgICAgY2FzZSAna24nOlxuICAgICAgICBjYXNlICdtcic6XG4gICAgICAgIGNhc2UgJ3p1JzpcbiAgICAgICAgICAgIGlmIChpID09PSAwIHx8IG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdhcic6XG4gICAgICAgICAgICBpZiAobiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlplcm87XG4gICAgICAgICAgICBpZiAobiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAzICYmIG4gJSAxMDAgPD0gMTApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDExICYmIG4gJSAxMDAgPD0gOTkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYXN0JzpcbiAgICAgICAgY2FzZSAnY2EnOlxuICAgICAgICBjYXNlICdkZSc6XG4gICAgICAgIGNhc2UgJ2VuJzpcbiAgICAgICAgY2FzZSAnZXQnOlxuICAgICAgICBjYXNlICdmaSc6XG4gICAgICAgIGNhc2UgJ2Z5JzpcbiAgICAgICAgY2FzZSAnZ2wnOlxuICAgICAgICBjYXNlICdpdCc6XG4gICAgICAgIGNhc2UgJ25sJzpcbiAgICAgICAgY2FzZSAnc3YnOlxuICAgICAgICBjYXNlICdzdyc6XG4gICAgICAgIGNhc2UgJ3VyJzpcbiAgICAgICAgY2FzZSAneWknOlxuICAgICAgICAgICAgaWYgKGkgPT09IDEgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2JlJzpcbiAgICAgICAgICAgIGlmIChuICUgMTAgPT09IDEgJiYgIShuICUgMTAwID09PSAxMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgbiAlIDEwID49IDIgJiYgbiAlIDEwIDw9IDQgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTIgJiYgbiAlIDEwMCA8PSAxNCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAwIHx8IG4gJSAxMCA9PT0gTWF0aC5mbG9vcihuICUgMTApICYmIG4gJSAxMCA+PSA1ICYmIG4gJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgbiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDExICYmIG4gJSAxMDAgPD0gMTQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYnInOlxuICAgICAgICAgICAgaWYgKG4gJSAxMCA9PT0gMSAmJiAhKG4gJSAxMDAgPT09IDExIHx8IG4gJSAxMDAgPT09IDcxIHx8IG4gJSAxMDAgPT09IDkxKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuICUgMTAgPT09IDIgJiYgIShuICUgMTAwID09PSAxMiB8fCBuICUgMTAwID09PSA3MiB8fCBuICUgMTAwID09PSA5MikpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgKG4gJSAxMCA+PSAzICYmIG4gJSAxMCA8PSA0IHx8IG4gJSAxMCA9PT0gOSkgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTAgJiYgbiAlIDEwMCA8PSAxOSB8fCBuICUgMTAwID49IDcwICYmIG4gJSAxMDAgPD0gNzkgfHxcbiAgICAgICAgICAgICAgICAgICAgbiAlIDEwMCA+PSA5MCAmJiBuICUgMTAwIDw9IDk5KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKG4gPT09IDApICYmIG4gJSAxZTYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5NYW55O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnYnMnOlxuICAgICAgICBjYXNlICdocic6XG4gICAgICAgIGNhc2UgJ3NyJzpcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmIGkgJSAxMCA9PT0gMSAmJiAhKGkgJSAxMDAgPT09IDExKSB8fCBmICUgMTAgPT09IDEgJiYgIShmICUgMTAwID09PSAxMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IE1hdGguZmxvb3IoaSAlIDEwKSAmJiBpICUgMTAgPj0gMiAmJiBpICUgMTAgPD0gNCAmJlxuICAgICAgICAgICAgICAgICEoaSAlIDEwMCA+PSAxMiAmJiBpICUgMTAwIDw9IDE0KSB8fFxuICAgICAgICAgICAgICAgIGYgJSAxMCA9PT0gTWF0aC5mbG9vcihmICUgMTApICYmIGYgJSAxMCA+PSAyICYmIGYgJSAxMCA8PSA0ICYmXG4gICAgICAgICAgICAgICAgICAgICEoZiAlIDEwMCA+PSAxMiAmJiBmICUgMTAwIDw9IDE0KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2NzJzpcbiAgICAgICAgY2FzZSAnc2snOlxuICAgICAgICAgICAgaWYgKGkgPT09IDEgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChpID09PSBNYXRoLmZsb29yKGkpICYmIGkgPj0gMiAmJiBpIDw9IDQgJiYgdiA9PT0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2N5JzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKG4gPT09IDIpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAobiA9PT0gMylcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmIChuID09PSA2KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2RhJzpcbiAgICAgICAgICAgIGlmIChuID09PSAxIHx8ICEodCA9PT0gMCkgJiYgKGkgPT09IDAgfHwgaSA9PT0gMSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdkc2InOlxuICAgICAgICBjYXNlICdoc2InOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMSB8fCBmICUgMTAwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMiB8fCBmICUgMTAwID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gTWF0aC5mbG9vcihpICUgMTAwKSAmJiBpICUgMTAwID49IDMgJiYgaSAlIDEwMCA8PSA0IHx8XG4gICAgICAgICAgICAgICAgZiAlIDEwMCA9PT0gTWF0aC5mbG9vcihmICUgMTAwKSAmJiBmICUgMTAwID49IDMgJiYgZiAlIDEwMCA8PSA0KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnZmYnOlxuICAgICAgICBjYXNlICdmcic6XG4gICAgICAgIGNhc2UgJ2h5JzpcbiAgICAgICAgY2FzZSAna2FiJzpcbiAgICAgICAgICAgIGlmIChpID09PSAwIHx8IGkgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdmaWwnOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgKGkgPT09IDEgfHwgaSA9PT0gMiB8fCBpID09PSAzKSB8fFxuICAgICAgICAgICAgICAgIHYgPT09IDAgJiYgIShpICUgMTAgPT09IDQgfHwgaSAlIDEwID09PSA2IHx8IGkgJSAxMCA9PT0gOSkgfHxcbiAgICAgICAgICAgICAgICAhKHYgPT09IDApICYmICEoZiAlIDEwID09PSA0IHx8IGYgJSAxMCA9PT0gNiB8fCBmICUgMTAgPT09IDkpKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnZ2EnOlxuICAgICAgICAgICAgaWYgKG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiA9PT0gMilcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlR3bztcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMyAmJiBuIDw9IDYpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDcgJiYgbiA8PSAxMClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdnZCc6XG4gICAgICAgICAgICBpZiAobiA9PT0gMSB8fCBuID09PSAxMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyIHx8IG4gPT09IDEyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKG4gPT09IE1hdGguZmxvb3IobikgJiYgKG4gPj0gMyAmJiBuIDw9IDEwIHx8IG4gPj0gMTMgJiYgbiA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdndic6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDIpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5Ud287XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJlxuICAgICAgICAgICAgICAgIChpICUgMTAwID09PSAwIHx8IGkgJSAxMDAgPT09IDIwIHx8IGkgJSAxMDAgPT09IDQwIHx8IGkgJSAxMDAgPT09IDYwIHx8IGkgJSAxMDAgPT09IDgwKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICghKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2hlJzpcbiAgICAgICAgICAgIGlmIChpID09PSAxICYmIHYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAoaSA9PT0gMiAmJiB2ID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgIShuID49IDAgJiYgbiA8PSAxMCkgJiYgbiAlIDEwID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ2lzJzpcbiAgICAgICAgICAgIGlmICh0ID09PSAwICYmIGkgJSAxMCA9PT0gMSAmJiAhKGkgJSAxMDAgPT09IDExKSB8fCAhKHQgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAna3NoJzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmIChuID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAna3cnOlxuICAgICAgICBjYXNlICduYXEnOlxuICAgICAgICBjYXNlICdzZSc6XG4gICAgICAgIGNhc2UgJ3Ntbic6XG4gICAgICAgICAgICBpZiAobiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSAyKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuVHdvO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbGFnJzpcbiAgICAgICAgICAgIGlmIChuID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuWmVybztcbiAgICAgICAgICAgIGlmICgoaSA9PT0gMCB8fCBpID09PSAxKSAmJiAhKG4gPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbHQnOlxuICAgICAgICAgICAgaWYgKG4gJSAxMCA9PT0gMSAmJiAhKG4gJSAxMDAgPj0gMTEgJiYgbiAlIDEwMCA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSBNYXRoLmZsb29yKG4gJSAxMCkgJiYgbiAlIDEwID49IDIgJiYgbiAlIDEwIDw9IDkgJiZcbiAgICAgICAgICAgICAgICAhKG4gJSAxMDAgPj0gMTEgJiYgbiAlIDEwMCA8PSAxOSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAoIShmID09PSAwKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdsdic6XG4gICAgICAgIGNhc2UgJ3ByZyc6XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAwIHx8IG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAxMSAmJiBuICUgMTAwIDw9IDE5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMiAmJiBmICUgMTAwID09PSBNYXRoLmZsb29yKGYgJSAxMDApICYmIGYgJSAxMDAgPj0gMTEgJiYgZiAlIDEwMCA8PSAxOSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlplcm87XG4gICAgICAgICAgICBpZiAobiAlIDEwID09PSAxICYmICEobiAlIDEwMCA9PT0gMTEpIHx8IHYgPT09IDIgJiYgZiAlIDEwID09PSAxICYmICEoZiAlIDEwMCA9PT0gMTEpIHx8XG4gICAgICAgICAgICAgICAgISh2ID09PSAyKSAmJiBmICUgMTAgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdtayc6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDEgfHwgZiAlIDEwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnbXQnOlxuICAgICAgICAgICAgaWYgKG4gPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAobiA9PT0gMCB8fCBuICUgMTAwID09PSBNYXRoLmZsb29yKG4gJSAxMDApICYmIG4gJSAxMDAgPj0gMiAmJiBuICUgMTAwIDw9IDEwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgaWYgKG4gJSAxMDAgPT09IE1hdGguZmxvb3IobiAlIDEwMCkgJiYgbiAlIDEwMCA+PSAxMSAmJiBuICUgMTAwIDw9IDE5KVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuTWFueTtcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ3BsJzpcbiAgICAgICAgICAgIGlmIChpID09PSAxICYmIHYgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IE1hdGguZmxvb3IoaSAlIDEwKSAmJiBpICUgMTAgPj0gMiAmJiBpICUgMTAgPD0gNCAmJlxuICAgICAgICAgICAgICAgICEoaSAlIDEwMCA+PSAxMiAmJiBpICUgMTAwIDw9IDE0KSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmICEoaSA9PT0gMSkgJiYgaSAlIDEwID09PSBNYXRoLmZsb29yKGkgJSAxMCkgJiYgaSAlIDEwID49IDAgJiYgaSAlIDEwIDw9IDEgfHxcbiAgICAgICAgICAgICAgICB2ID09PSAwICYmIGkgJSAxMCA9PT0gTWF0aC5mbG9vcihpICUgMTApICYmIGkgJSAxMCA+PSA1ICYmIGkgJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMCAmJiBpICUgMTAwID09PSBNYXRoLmZsb29yKGkgJSAxMDApICYmIGkgJSAxMDAgPj0gMTIgJiYgaSAlIDEwMCA8PSAxNClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdwdCc6XG4gICAgICAgICAgICBpZiAobiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDAgJiYgbiA8PSAyICYmICEobiA9PT0gMikpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdybyc6XG4gICAgICAgICAgICBpZiAoaSA9PT0gMSAmJiB2ID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKCEodiA9PT0gMCkgfHwgbiA9PT0gMCB8fFxuICAgICAgICAgICAgICAgICEobiA9PT0gMSkgJiYgbiAlIDEwMCA9PT0gTWF0aC5mbG9vcihuICUgMTAwKSAmJiBuICUgMTAwID49IDEgJiYgbiAlIDEwMCA8PSAxOSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLkZldztcbiAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT3RoZXI7XG4gICAgICAgIGNhc2UgJ3J1JzpcbiAgICAgICAgY2FzZSAndWsnOlxuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwID09PSAxICYmICEoaSAlIDEwMCA9PT0gMTEpKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwID09PSBNYXRoLmZsb29yKGkgJSAxMCkgJiYgaSAlIDEwID49IDIgJiYgaSAlIDEwIDw9IDQgJiZcbiAgICAgICAgICAgICAgICAhKGkgJSAxMDAgPj0gMTIgJiYgaSAlIDEwMCA8PSAxNCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5GZXc7XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAgPT09IDAgfHxcbiAgICAgICAgICAgICAgICB2ID09PSAwICYmIGkgJSAxMCA9PT0gTWF0aC5mbG9vcihpICUgMTApICYmIGkgJSAxMCA+PSA1ICYmIGkgJSAxMCA8PSA5IHx8XG4gICAgICAgICAgICAgICAgdiA9PT0gMCAmJiBpICUgMTAwID09PSBNYXRoLmZsb29yKGkgJSAxMDApICYmIGkgJSAxMDAgPj0gMTEgJiYgaSAlIDEwMCA8PSAxNClcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk1hbnk7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdzaGknOlxuICAgICAgICAgICAgaWYgKGkgPT09IDAgfHwgbiA9PT0gMSlcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLk9uZTtcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMiAmJiBuIDw9IDEwKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAnc2knOlxuICAgICAgICAgICAgaWYgKG4gPT09IDAgfHwgbiA9PT0gMSB8fCBpID09PSAwICYmIGYgPT09IDEpXG4gICAgICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PbmU7XG4gICAgICAgICAgICByZXR1cm4gUGx1cmFsLk90aGVyO1xuICAgICAgICBjYXNlICdzbCc6XG4gICAgICAgICAgICBpZiAodiA9PT0gMCAmJiBpICUgMTAwID09PSAxKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuT25lO1xuICAgICAgICAgICAgaWYgKHYgPT09IDAgJiYgaSAlIDEwMCA9PT0gMilcbiAgICAgICAgICAgICAgICByZXR1cm4gUGx1cmFsLlR3bztcbiAgICAgICAgICAgIGlmICh2ID09PSAwICYmIGkgJSAxMDAgPT09IE1hdGguZmxvb3IoaSAlIDEwMCkgJiYgaSAlIDEwMCA+PSAzICYmIGkgJSAxMDAgPD0gNCB8fCAhKHYgPT09IDApKVxuICAgICAgICAgICAgICAgIHJldHVybiBQbHVyYWwuRmV3O1xuICAgICAgICAgICAgcmV0dXJuIFBsdXJhbC5PdGhlcjtcbiAgICAgICAgY2FzZSAndHptJzpcbiAgICAgICAgICAgIGlmIChuID09PSBNYXRoLmZsb29yKG4pICYmIG4gPj0gMCAmJiBuIDw9IDEgfHwgbiA9PT0gTWF0aC5mbG9vcihuKSAmJiBuID49IDExICYmIG4gPD0gOTkpXG4gICAgICAgIC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VDbGFzcyhrbGFzcywgIWlzQ2xlYW51cCk7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMocmF3Q2xhc3NWYWwpLmZvckVhY2goZnVuY3Rpb24gKGtsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyYXdDbGFzc1ZhbFtrbGFzc10gIT0gbnVsbClcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl90b2dnbGVDbGFzcyhrbGFzcywgIWlzQ2xlYW51cCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30ga2xhc3NcbiAgICAgKiBAcGFyYW0gez99IGVuYWJsZWRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nQ2xhc3MucHJvdG90eXBlLl90b2dnbGVDbGFzcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30ga2xhc3NcbiAgICAgKiBAcGFyYW0gez99IGVuYWJsZWRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChrbGFzcywgZW5hYmxlZCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBrbGFzcyA9IGtsYXNzLnRyaW0oKTtcbiAgICAgICAgaWYgKGtsYXNzKSB7XG4gICAgICAgICAgICBrbGFzcy5zcGxpdCgvXFxzKy9nKS5mb3JFYWNoKGZ1bmN0aW9uIChrbGFzcykge1xuICAgICAgICAgICAgICAgIGlmIChlbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLl9yZW5kZXJlci5hZGRDbGFzcyhfdGhpcy5fbmdFbC5uYXRpdmVFbGVtZW50LCBrbGFzcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICA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4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY2hhbmdlcykge1xuICAgICAgICB0aGlzLl92aWV3Q29udGFpbmVyUmVmLmNsZWFyKCk7XG4gICAgICAgIHRoaXMuX2NvbXBvbmVudFJlZiA9IG51bGw7XG4gICAgICAgIGlmICh0aGlzLm5nQ29tcG9uZW50T3V0bGV0KSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBlbEluamVjdG9yID0gdGhpcy5uZ0NvbXBvbmVudE91dGxldEluamVjdG9yIHx8IHRoaXMuX3ZpZXdDb250YWluZXJSZWYucGFyZW50SW5qZWN0b3I7XG4gICAgICAgICAgICBpZiAoY2hhbmdlc1snbmdDb21wb25lbnRPdXRsZXROZ01vZHVsZUZhY3RvcnknXSkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9tb2R1bGVSZWYpXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21vZHVsZVJlZi5kZXN0cm95KCk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubmdDb21wb25lbnRPdXRsZXROZ01vZHVsZUZhY3RvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGFyZW50TW9kdWxlID0gZWxJbmplY3Rvci5nZXQoTmdNb2R1bGVSZWYpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9tb2R1bGVSZWYgPSB0aGlzLm5nQ29tcG9uZW50T3V0bGV0TmdNb2R1bGVGYWN0b3J5LmNyZWF0ZShwYXJlbnRNb2R1bGUuaW5qZWN0b3IpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbW9kdWxlUmVmID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb21wb25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yVHJhY2tCeVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLl90cmFja0J5Rm47IH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gZm5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChmbikge1xuICAgICAgICAgICAgaWYgKGlzRGV2TW9kZSgpICYmIGZuICE9IG51bGwgJiYgdHlwZW9mIGZuICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETyh2aWNiKTogdXNlIGEgbG9nIHNlcnZpY2Ugb25jZSB0aGVyZSBpcyBhIHB1YmxpYyBvbmUgYXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgaWYgKC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUpICYmIC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUud2FybikpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFwidHJhY2tCeSBtdXN0IGJlIGEgZnVuY3Rpb24sIGJ1dCByZWNlaXZlZCBcIiArIEpTT04uc3RyaW5naWZ5KGZuKSArIFwiLiBcIiArXG4gICAgICAgICAgICAgICAgICAgICAgICBcIlNlZSBodHRwczovL2FuZ3VsYXIuaW8vZG9jcy90cy9sYXRlc3QvYXBpL2NvbW1vbi9pbmRleC9OZ0Zvci1kaXJlY3RpdmUuaHRtbCMhI2NoYW5nZS1wcm9wYWdhdGlvbiBmb3IgbW9yZSBpbmZvcm1hdGlvbi5cIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fdHJhY2tCeUZuID0gZm47XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ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AgICAgICAgIGVsc2UgaWYgKGN1cnJlbnRJbmRleCA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3ZpZXdDb250YWluZXIucmVtb3ZlKGFkanVzdGVkUHJldmlvdXNJbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2aWV3ID0gLyoqIEB0eXBlIHs/fSAqLyAoKF90aGlzLl92aWV3Q29udGFpbmVyLmdldChhZGp1c3RlZFByZXZpb3VzSW5kZXgpKSk7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3ZpZXdDb250YWluZXIubW92ZSh2aWV3LCBjdXJyZW50SW5kZXgpO1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHR1cGxlID0gbmV3IFJlY29yZFZpZXdUdXBsZShpdGVtLCAvKiogQHR5cGUgez99ICovICh2aWV3KSk7XG4gICAgICAgICAgICAgICAgaW5zZXJ0VHVwbGVzLnB1c2godHVwbGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IGluc2VydFR1cGxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGhpcy5fcGVyVmlld0NoYW5nZShpbnNlcnRUdXBsZXNbaV0udmlldywgaW5zZXJ0VHVwbGVzW2ldLnJlY29yZCk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMCwgLyoqIEB0eXBlIHs/fSAqLyBpbGVuID0gdGhpcy5fdmlld0NvbnRhaW5lci5sZW5ndGg7IGkgPCBpbGVuOyBpKyspIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZpZXdSZWYgPSAvKiogQHR5cGUgez99ICovICh0aGlzLl92aWV3Q29udGFpbmVyLmdldCh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X3ZpZXdDb250YWluZXIsIHRlbXBsYXRlUmVmKSB7XG4gICAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIgPSBfdmlld0NvbnRhaW5lcjtcbiAgICAgICAgdGhpcy5fY29udGV4dCA9IG5ldyBOZ0lmQ29udGV4dCgpO1xuICAgICAgICB0aGlzLl90aGVuVGVtcGxhdGVSZWYgPSBudWxsO1xuICAgICAgICB0aGlzLl9lbHNlVGVtcGxhdGVSZWYgPSBudWxsO1xuICAgICAgICB0aGlzLl90aGVuVmlld1JlZiA9IG51bGw7XG4gICAgICAgIHRoaXMuX2Vsc2VWaWV3UmVmID0gbnVsbDtcbiAgICAgICAgdGhpcy5fdGhlblRlbXBsYXRlUmVmID0gdGVtcGxhdGVSZWY7XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShOZ0lmLnByb3RvdHlwZSwgXCJuZ0lmXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSBjb25kaXRpb25cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChjb25kaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuX2NvbnRleHQuJGltcGxpY2l0ID0gdGhpcy5fY29udGV4dC5uZ0lmID0gY29uZGl0aW9uO1xuICAgICAgICAgICAgdGhpcy5fdXBkYXRlVmlldygpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoTmdJZi5wcm90b3R5cGUsIFwibmdJZlRoZW5cIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHRlbXBsYXRlUmVmXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodGVtcGxh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oIXRoaXMuX3RoZW5WaWV3UmVmKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdmlld0NvbnRhaW5lci5jbGVhcigpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2Vsc2VWaWV3UmVmID0gbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fdGhlblRlbXBsYXRlUmVmKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3RoZW5WaWV3UmVmID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIuY3JlYXRlRW1iZWRkZWRWaWV3KHRoaXMuX3RoZW5UZW1wbGF0ZVJlZiwgdGhpcy5fY29udGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9lbHNlVmlld1JlZikge1xuICAgICAgICAgICAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIuY2xlYXIoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl90aGVuVmlld1JlZiA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2Vsc2VUZW1wbGF0ZVJlZikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9lbHNlVmlld1JlZiA9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl92aWV3Q29udGFpbmVyLmNyZWF0ZUVtYmVkZGVkVmlldyh0aGlzLl9lbHNlVGVtcGxhdGVSZWYsIHRoaXMuX2NvbnRleHQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgTmdJZi5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3sgc2VsZWN0b3I6ICdbbmdJZl0nIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTm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gdGhpcy5fdXBkYXRlRGVmYXVsdENhc2VzKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nU3dpdGNoLnByb3RvdHlwZS5fYWRkQ2FzZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLl9jYXNlQ291bnQrKzsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZpZXdcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nU3dpdGNoLnByb3RvdHlwZS5fYWRkRGVmYXVsdCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2aWV3XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmlldykge1xuICAgICAgICBpZiAoIXRoaXMuX2RlZmF1bHRWaWV3cykge1xuICAgICAgICAgICAgdGhpcy5fZGVmYXVsdFZpZXdzID0gW107XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fZGVmYXVsdFZpZXdzLnB1c2godmlldyk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1N3aXRjaC5wcm90b3R5cGUuX21hdGNoQ2FzZSA9IC8qKlxuICAgICAqI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G4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByZXZDdHhLZXlzID0gT2JqZWN0LmtleXMoY3R4Q2hhbmdlLnByZXZpb3VzVmFsdWUgfHwge30pO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdXJyQ3R4S2V5cyA9IE9iamVjdC5rZXlzKGN0eENoYW5nZS5jdXJyZW50VmFsdWUgfHwge30pO1xuICAgICAgICBpZiAocHJldkN0eEtleXMubGVuZ3RoID09PSBjdXJyQ3R4S2V5cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGZvciAodmFyIF9pID0gMCwgY3VyckN0eEtleXNfMSA9IGN1cnJDdHhLZXlzOyBfaSA8IGN1cnJDdHhLZXlzXzEubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BOYW1lID0gY3VyckN0eEtleXNfMVtfaV07XG4gICAgICAgICAgICAgICAgaWYgKHByZXZDdHhLZXlzLmluZGV4T2YocHJvcE5hbWUpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjdHhcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nVGVtcGxhdGVPdXRsZXQucHJvdG90eXBlLl91cGRhdGVFeGlzdGluZ0NvbnRleHQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGN0eFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGN0eCkge1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIF9hID0gT2JqZWN0LmtleXMoY3R4KTsgX2kgPCB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FsdWVzKSB7XG4gICAgICAgIHN0ciA9IHN0ci5yZXBsYWNlKC9cXHsoW159XSspfS9nLCBmdW5jdGlvbiAobWF0Y2gsIGtleSkge1xuICAgICAgICAgICAgcmV0dXJuIChvcHRfdmFsdWVzICE9IG51bGwgJiYga2V5IGluIG9wdF92YWx1ZXMpID8gb3B0X3ZhbHVlc1trZXldIDogbWF0Y2g7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICByZXR1cm4gc3RyO1xufVxuLyoqXG4gKiBAcGFyYW0gez99IG51bVxuICogQHBhcmFtIHs/fSBkaWdpdHNcbiAqIEBwYXJhbSB7Pz19IG1pbnVzU2lnblxuICogQHBhcmFtIHs/PX0gdHJpbVxuICogQHBhcmFtIHs/PX0gbmVnV3JhcFxuICogQHJldHVybiB7P31cbiAqL1xuZnVuY3Rpb24gcGFkTnVtYmVyKG51bSwgZGlnaXRzLCBtaW51c1NpZ24sIHRyaW0sIG5lZ1dyYXApIHtcbiAgICBpZiAobWludXNTaWduID09PSB2b2lkIDApIHsgbWludXNTaWduID0gJy0nOyB9XG4gICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmVnID0gJyc7XG4gICAgaWYgKG51bSA8IDAgfHwgKG5lZ1dyYXAgJiYgbnVtIDw9IDApKSB7XG4gICAgICAgIGlmIChuZWdXcmFwKSB7XG4gICAgICAgICAgICBudW0gPSAtbnVtICsgMTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIG51bSA9IC1udW07XG4gICAgICAgICAgICBuZWcgPSBtaW51c1NpZ247XG4gICAgICAgIH1cbiAgICB9XG4gICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gc3RyTnVtID0gJycgKyBudW07XG4gICAgd2hpbGUgKHN0ck51bS5sZW5ndGggPCBkaWdpdHMpXG4gICAgICAgIHN0ck51bSA9ICcwJyArIHN0ck51bTtcbiAgICBpZiAodHJpbSkge1xuICAgICAgICBzdHJOdW0gPSBzdHJOdW0uc3Vic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B0eXBlIHs/fSAqLyByZXN1bHRfMTtcbiAgICAgICAgICAgICAgICBydWxlcy5mb3JFYWNoKGZ1bmN0aW9uIChydWxlLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShydWxlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW9ybmluZywgYWZ0ZXJub29uLCBldmVuaW5nLCBuaWdodFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9hID0gcnVsZVswXSwgaG91cnNGcm9tID0gX2EuaG91cnMsIG1pbnV0ZXNGcm9tID0gX2EubWludXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfYiA9IHJ1bGVbMV0sIGhvdXJzVG8gPSBfYi5ob3VycywgbWludXRlc1RvID0gX2IubWludXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50SG91cnNfMSA+PSBob3Vyc0Zyb20gJiYgY3VycmVudE1pbnV0ZXNfMSA+PSBtaW51dGVzRnJvbSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjdXJyZW50SG91cnNfMSA8IGhvdXJzVG8gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnRIb3Vyc18xID09PSBob3Vyc1RvICYmIGN1cnJlbnRNaW51dGVzXzEgPCBtaW51dGVzVG8pKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdF8xID0gZGF5UGVyaW9kc18xW2luZGV4XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vb24gb3IgbWlkbmlnaHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBob3VycyA9IHJ1bGUuaG91cnMsIG1pbnV0ZXMgPSBydWxlLm1pbnV0ZXM7XG4gICAgICAgICAg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m9sLk1pbnVzU2lnbik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGhvdXJzID0gem9uZSA+IDAgPyBNYXRoLmZsb29yKHpvbmUgLyA2MCkgOiBNYXRoLmNlaWwoem9uZSAvIDYwKTtcbiAgICAgICAgc3dpdGNoICh3aWR0aCkge1xuICAgICAgICAgICAgY2FzZSBab25lV2lkdGguU2hvcnQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuICgoem9uZSA+PSAwKSA/ICcrJyA6ICcnKSArIHBhZE51bWJlcihob3VycywgMiwgbWludXNTaWduKSArXG4gICAgICAgICAgICAgICAgICAgIHBhZE51bWJlcihNYXRoLmFicyh6b25lICUgNjApLCAyLCBtaW51c1NpZ24pO1xuICAgICAgICAgICAgY2FzZSBab25lV2lkdGguU2hvcnRHTVQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdHTVQnICsgKCh6b25lID49IDApID8gJysnIDogJycpICsgcGFkTnVtYmVyKGhvdXJzLCAxLCBtaW51c1NpZ24pO1xuICAgICAgICAgICAgY2FzZSBab25lV2lkdGguTG9uZzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ0dNVCcgKyAoKHpvbmUgPj0gMCkgPyAnKycgOiAnJykgKyBwYWROdW1iZXIoaG91cnMsIDIsIG1pbnVzU2lnbikgKyAnOicgK1xuICAgICAgICAgICAgICAgICAgICBwYWROdW1iZXIoTWF0aC5hYnMoem9uZSAlIDYwKSwgMiwgbWludXNTaWduKTtcbiAgICAgICAgICAgIGNhc2UgWm9uZVdpZHRoLkV4dGVuZGVkOlxuICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdaJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoKHpvbmUgPj0gMCkgPyAnKycgOiAnJykgKyBwYWROdW1iZXIoaG91cnMsIDIsIG1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KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAvLyBNb250aCBvZiB0aGUgeWVhciAoMS0xMiksIG51bWVyaWNcbiAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgIGNhc2UgJ0wnOlxuICAgICAgICAgICAgZm9ybWF0dGVyID0gZGF0ZUdldHRlcihEYXRlVHlwZS5Nb250aCwgMSwgMSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICBjYXNlICdMTCc6XG4gICAgICAgICAgICBmb3JtYXR0ZXIgPSBkYXRlR2V0dGVyKERhdGVUeXBlLk1vbnRoLCAyLCAxKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAvLyBNb250aCBvZiB0aGUgeWVhciAoSmFudWFyeSwgLi4uKSwgc3RyaW5nLCBmb3JtYXRcbiAgICAgICAgY2FzZSAnTU1NJzpcbiAgICAgICAgICAgIGZvcm1hdHRlciA9IGRhdGVTdHJHZXR0ZXIoVHJhbnNsYXRpb25UeXBlLk1vbnRocywgVHJhbnNsYXRpb25XaWR0aC5BYmJyZXZpYXRlZCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU1NTSc6XG4gICAgICAgICAgICBmb3JtYXR0ZXIgPSBkYXRlU3RyR2V0dGVyKFRyYW5zbGF0aW9uVHlwZS5Nb250aHMsIFRyYW5zbGF0aW9uV2lkdGguV2lkZSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnTU1NTU0nOlxuICAgICAgICAgICAgZm9ybWF0dGVyID0gZGF0ZVN0ckdldHRlcihUcmFuc2xhdGlvblR5cGUuTW9udGhzLCBUcmFuc2xhdGlvbldpZHRoLk5hcnJvdyk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gTW9udGggb2YgdGhlIHllYXIgKEphbnVhcnksIC4uLiksIHN0cmluZywgc3RhbmRhbG9uZVxuICAgICAgICBjYXNlICdMTEwnOl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QgVHlwZSAgICAgICAgIHwgRm9ybWF0ICAgICAgfCBEZXNjcmlwdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgRXhhbXBsZSBWYWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfC0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXxcbiAqICB8IEVyYSAgICAgICAgICAgICAgICB8IEcsIEdHICYgR0dHIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEFEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgR0dHRyAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQW5ubyBEb21pbmkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBHR0dHRyAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFllYXIgICAgICAgICAgICAgICB8IHkgICAgICAgICAgIHwgTnVtZXJpYzogbWluaW11bSBkaWdpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDIsIDIwLCAyMDEsIDIwMTcsIDIwMTczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgeXkgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDIsIDIwLCAwMSwgMTcsIDczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCB5eXkgICAgICAgICB8IE51bWVyaWM6IDMgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMDIsIDAyMCwgMjAxLCAyMDE3LCAyMDE3MyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IHl5eXkgICAgICAgIHwgTnVtZXJpYzogNCBkaWdpdHMgb3IgbW9yZSArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICB8IDAwMDIsIDAwMjAsIDAyMDEsIDIwMTcsIDIwMTczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgTW9udGggICAgICAgICAgICAgIHwgTSAgICAgICAgICAgfCBOdW1lcmljOiAxIGRpZ2l0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgOSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBNTSAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwOSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IE1NTSAgICAgICAgIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFNlcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTU1NTSAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgU2VwdGVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBNTU1NTSAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IE1vbnRoIHN0YW5kYWxvbmUgICB8IEwgICAgICAgICAgIHwgTnVtZXJpYzogMSBkaWdpdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDksIDEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTEwgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDksIDEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBMTEwgICAgICAgICB8IEFiYnJldmlhdGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBTZXAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IExMTEwgICAgICAgIHwgV2lkZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFNlcHRlbWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgTExMTEwgICAgICAgfCBOYXJyb3cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBXZWVrIG9mIHllYXIgICAgICAgfCB3ICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxLi4uIDUzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IHd3ICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAxLi4uIDUzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgV2VlayBvZiBtb250aCAgICAgIHwgVyAgICAgICAgICAgfCBOdW1lcmljOiAxIGRpZ2l0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMS4uLiA1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBEYXkgb2YgbW9udGggICAgICAgfCBkICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGRkICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFdlZWsgZGF5ICAgICAgICAgICB8IEUsIEVFICYgRUVFIHwgQWJicmV2aWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFR1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgRUVFRSAgICAgICAgfCBXaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgVHVlc2RheSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBFRUVFRSAgICAgICB8IE5hcnJvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IEVFRUVFRSAgICAgIHwgU2hvcnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFR1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kICAgICAgICAgICAgIHwgYSwgYWEgJiBhYWEgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgYW0vcG0gb3IgQU0vUE0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBhYWFhICAgICAgICB8IFdpZGUgKGZhbGxiYWNrIHRvIGBhYCB3aGVuIG1pc3NpbmcpICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbnRlIG1lcmlkaWVtL3Bvc3QgbWVyaWRpZW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGFhYWFhICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGEvcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kKiAgICAgICAgICAgIHwgQiwgQkIgJiBCQkIgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgbWlkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBCQkJCICAgICAgICB8IFdpZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbSwgcG0sIG1pZG5pZ2h0LCBub29uLCBtb3JuaW5nLCBhZnRlcm5vb24sIGV2ZW5pbmcsIG5pZ2h0IHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IEJCQkJCICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IG1kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgUGVyaW9kIHN0YW5kYWxvbmUqIHwgYiwgYmIgJiBiYmIgfCBBYmJyZXZpYXRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgbWlkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBiYmJiICAgICAgICB8IFdpZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBhbSwgcG0sIG1pZG5pZ2h0LCBub29uLCBtb3JuaW5nLCBhZnRlcm5vb24sIGV2ZW5pbmcsIG5pZ2h0IHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IGJiYmJiICAgICAgIHwgTmFycm93ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IG1kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgSG91ciAxLTEyICAgICAgICAgIHwgaCAgICAgICAgICAgfCBOdW1lcmljOiBtaW5pbXVtIGRpZ2l0cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBoaCAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMSwgMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IEhvdXIgMC0yMyAgICAgICAgICB8IEggICAgICAgICAgIHwgTnVtZXJpYzogbWluaW11bSBkaWdpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAsIDIzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgSEggICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDAsIDIzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCBNaW51dGUgICAgICAgICAgICAgfCBtICAgICAgICAgICB8IE51bWVyaWM6IG1pbmltdW0gZGlnaXRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCA4LCA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IG1tICAgICAgICAgIHwgTnVtZXJpYzogMiBkaWdpdHMgKyB6ZXJvIHBhZGRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDA4LCA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgU2Vjb25kICAgICAgICAgICAgIHwgcyAgICAgICAgICAgfCBOdW1lcmljOiBtaW5pbXVtIGRpZ2l0cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMC4uLiA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBzcyAgICAgICAgICB8IE51bWVyaWM6IDIgZGlnaXRzICsgemVybyBwYWRkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAwMC4uLiA1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IEZyYWN0aW9uYWwgc2Vjb25kcyB8IFMgICAgICAgICAgIHwgTnVtZXJpYzogMSBkaWdpdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDAuLi4gOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgU1MgICAgICAgICAgfCBOdW1lcmljOiAyIGRpZ2l0cyArIHplcm8gcGFkZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMDAuLi4gOTkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBTU1MgICAgICAgICB8IE51bWVyaWM6IDMgZGlnaXRzICsgemVybyBwYWRkZWQgKD0gbWlsbGlzZWNvbmRzKSAgICAgICAgICAgICAgfCAwMDAuLi4gOTk5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8IFpvbmUgICAgICAgICAgICAgICB8IHosIHp6ICYgenp6IHwgU2hvcnQgc3BlY2lmaWMgbm9uIGxvY2F0aW9uIGZvcm1hdCAoZmFsbGJhY2sgdG8gTykgICAgICAgICAgICB8IEdNVC04ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgenp6eiAgICAgICAgfCBMb25nIHNwZWNpZmljIG5vbiBsb2NhdGlvbiBmb3JtYXQgKGZhbGxiYWNrIHRvIE9PT08pICAgICAgICAgIHwgR01ULTA4OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBaLCBaWiAmIFpaWiB8IElTTzg2MDEgYmFzaWMgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAtMDgwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IFpaWlogICAgICAgIHwgTG9uZyBsb2NhbGl6ZWQgR01UIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEdNVC04OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogIHwgICAgICAgICAgICAgICAgICAgIHwgWlpaWlogICAgICAgfCBJU084NjAxIGV4dGVuZGVkIGZvcm1hdCArIFogaW5kaWNhdG9yIGZvciBvZmZzZXQgMCAoPSBYWFhYWCkgIHwgLTA4OjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgfCAgICAgICAgICAgICAgICAgICAgfCBPLCBPTyAmIE9PTyB8IFNob3J0IGxvY2FsaXplZCBHTVQgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBHTVQtOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICB8ICAgICAgICAgICAgICAgICAgICB8IE9PT08gICAgICAgIHwgTG9uZyBsb2NhbGl6ZWQgR01UIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IEdNVC0wODowMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqXG4gKiBXaGVuIHRoZSBleHByZXNzaW9uIGlzIGEgSVNPIHN0cmluZyB3aXRob3V0IHRpbWUgKGUuZy4gMjAxNi0wOS0xOSkgdGhlIHRpbWUgem9uZSBvZmZzZXQgaXMgbm90XG4gKiBhcH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PSB7XG4gICAgLy8gS2V5cyBhcmUgcXVvdGVkIHNvIHRoZXkgZG8gbm90IGdldCByZW5hbWVkIGR1cmluZyBjbG9zdXJlIGNvbXBpbGF0aW9uLlxuICAgICd5TU1NZGptcyc6IGRhdGVQYXJ0R2V0dGVyRmFjdG9yeShjb21iaW5lKFtcbiAgICAgICAgZGlnaXRDb25kaXRpb24oJ3llYXInLCAxKSxcbiAgICAgICAgbmFtZUNvbmRpdGlvbignbW9udGgnLCAzKSxcbiAgICAgICAgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignaG91cicsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignbWludXRlJywgMSksXG4gICAgICAgIGRpZ2l0Q29uZGl0aW9uKCdzZWNvbmQnLCAxKSxcbiAgICBdKSksXG4gICAgJ3lNZGptJzogZGF0ZVBhcnRHZXR0ZXJGYWN0b3J5KGNvbWJpbmUoW1xuICAgICAgICBkaWdpdENvbmRpdGlvbigneWVhcicsIDEpLCBkaWdpdENvbmRpdGlvbignbW9udGgnLCAxKSwgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpLFxuICAgICAgICBkaWdpdENvbmRpdGlvbignaG91cicsIDEpLCBkaWdpdENvbmRpdGlvbignbWludXRlJywgMSlcbiAgICBdKSksXG4gICAgJ3lNTU1NRUVFRWQnOiBkYXRlUGFydEdldHRlckZhY3RvcnkoY29tYmluZShbXG4gICAgICAgIGRpZ2l0Q29uZGl0aW9uKCd5ZWFyJywgMSksIG5hbWVDb25kaXRpb24oJ21vbnRoJywgNCksIG5hbWVDb25kaXRpb24oJ3dlZWtkYXknLCA0KSxcbiAgICAgICAgZGlnaXRDb25kaXRpb24oJ2RheScsIDEpXG4gICAgXSkpLFxuICAgICd5TU1NTWQnOiBkYXRlUGFydEdldHRlckZhY3RvcnkoY29tYmluZShbZGlnaXRDb25kaXRpb24oJ3llYXInLCAxKSwgbmFtZUNvbmRpdGlvbignbW9ud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gfCBDb21wb25lbnQgfCBTeW1ib2wgfCBOYXJyb3cgfCBTaG9ydCBGb3JtICAgfCBMb25nIEZvcm0gICAgICAgICB8IE51bWVyaWMgICB8IDItZGlnaXQgICB8XG4gKiAgfC0tLS0tLS0tLS0tfDotLS0tLS06fC0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLS18LS0tLS0tLS0tLS18XG4gKiAgfCBlcmEgICAgICAgfCAgIEcgICAgfCBHIChBKSAgfCBHR0cgKEFEKSAgICAgfCBHR0dHIChBbm5vIERvbWluaSl8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKiAgfCB5ZWFyICAgICAgfCAgIHkgICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IHkgKDIwMTUpICB8IHl5ICgxNSkgICB8XG4gKiAgfCBtb250aCAgICAgfCAgIE0gICAgfCBMIChTKSAgfCBNTU0gKFNlcCkgICAgfCBNTU1NIChTZXB0ZW1iZXIpICB8IE0gKDkpICAgICB8IE1NICgwOSkgICB8XG4gKiAgfCBkYXkgICAgICAgfCAgIGQgICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGQgKDMpICAgICB8IGRkICgwMykgICB8XG4gKiAgfCB3ZWVrZGF5ICAgfCAgIEUgICAgfCBFIChTKSAgfCBFRUUgKFN1bikgICAgfCBFRUVFIChTdW5kYXkpICAgICB8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKiAgfCBob3VyICAgICAgfCAgIGogICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGogKDEzKSAgICB8IGpqICgxMykgICB8XG4gKiAgfCBob3VyMTIgICAgfCAgIGggICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IGggKDEgUE0pICB8IGhoICgwMSBQTSl8XG4gKiAgfCBob3VyMjQgICAgfCAgIEggICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IEggKDEzKSAgICB8IEhIICgxMykgICB8XG4gKiAgfCBtaW51dGUgICAgfCAgIG0gICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IG0gKDUpICAgICB8IG1tICgwNSkgICB8XG4gKiAgfCBzZWNvbmQgICAgfCAgIHMgICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IHMgKDkpICAgICB8IHNzICgwOSkgICB8XG4gKiAgfCB0aW1lem9uZSAgfCAgIHogICAgfCAtICAgICAgfCAtICAgICAgICAgICAgfCB6IChQYWNpZmljIFN0YW5kYXJkIFRpbWUpfCAtICB8IC0gICAgICAgICB8XG4gKiAgfCB0aW1lem9uZSAgfCAgIFogICAgfCAtICAgICAgfCBaIChHTVQtODowMCkgfCAtICAgICAgICAgICAgICAgICB8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKiAgfCB0aW1lem9uZSAgfCAgIGEgICAgfCAtICAgICAgfCBhIChQTSkgICAgICAgfCAtICAgICAgICAgICAgICAgICB8IC0gICAgICAgICB8IC0gICAgICAgICB8XG4gKlxuICogSW4gamF2YXNjcmlwdCwgb25seSB0aGUgY29tcG9uZW50cyBzcGVjaWZpZWQgd2lsbCBiZSByZXNwZWN0ZWQgKG5vdCB0aGUgb3JkZXJpbmcsXG4gKiBwdW5jdHVhdGlvbnMsIC4uLikgYW5kIGRldGFpbHMgb2YgdGhlIGZvcm1hdHRpbmcgd2lsbCBiZSBkZXBlbmRlbnQgb24gdGhlIGxvY2FsZS5cbiAqXG4gKiBUaW1lem9uZSBvZiB0aGUgZm9ybWF0dGVkIHRleHQgd2lsbCBiZSB0aGUgbG9jYWwgc3lzdGVtIHRpbWV6b25lIG9mIHRoZSBlbmQtdXNlcidzIG1hY2hpbmUuXG4gKlxuICogV2hlbiB0aGUgZ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KiBAdHlwZSB7P30gKi8gcGFyc2VkTnVtYmVyID0gcGFyc2VOdW1iZXIobnVtKTtcbiAgICAgICAgaWYgKHN0eWxlID09PSBOdW1iZXJGb3JtYXRTdHlsZS5QZXJjZW50KSB7XG4gICAgICAgICAgICBwYXJzZWROdW1iZXIgPSB0b1BlcmNlbnQocGFyc2VkTnVtYmVyKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBtaW5JbnQgPSBwYXR0ZXJuLm1pbkludDtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbWluRnJhY3Rpb24gPSBwYXR0ZXJuLm1pbkZyYWM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1heEZyYWN0aW9uID0gcGF0dGVybi5tYXhGcmFjO1xuICAgICAgICBpZiAoZGlnaXRzSW5mbykge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGFydHMgPSBkaWdpdHNJbmZvLm1hdGNoKE5VTUJFUl9GT1JNQVRfUkVHRVhQKTtcbiAgICAgICAgICAgIGlmIChwYXJ0cyA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJlcy5lcnJvciA9IGRpZ2l0c0luZm8gKyBcIiBpcyBub3QgYSB2YWxpZCBkaWdpdCBpbmZvXCI7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1pbkludFBhcnQgPSBwYXJ0c1sxXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1pbkZyYWN0aW9uUGFydCA9IHBhcnRzWzNdO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbWF4RnJhY3Rpb25QYXJ0ID0gcGFydHNbNV07XG4gICAgICAgICAgICBpZiAobWluSW50UGFydCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgbWluSW50ID0gcGFyc2VJbnRBdXRvUmFkaXgobWluSW50UGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWluRnJhY3Rpb25QYXJ0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBtaW5GcmFjdGlvbiA9IHBhcnNlSW50QXV0b1JhZGl4KG1pbkZyYWN0aW9uUGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF4RnJhY3Rpb25QYXJ0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBtYXhGcmFjdGlvbiA9IHBhcnNlSW50QXV0b1JhZGl4KG1heEZyYWN0aW9uUGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChtaW5GcmFjdGlvblBhcnQgIT0gbnVsbCAmJiBtaW5GcmFjdGlvbiA+IG1heEZyYWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgbWF4RnJhY3Rpb24gPSBtaW5GcmFjdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByb3VuZE51bWJlcihwYXJzZWROdW1iZXIsIG1pbkZyYWN0aW9uLCBtYXhGcmFjdGlvbik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRpZ2l0cyA9IHBhcnNlZE51bWJlci5kaWdpdHM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGludGVnZXJMZW4gPSBwYXJzZWROdW1iZXIuaW50ZWdlckxlbjtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZXhwb25lbnQgPSBwYXJzZWROdW1iZXIuZXhwb25lbnQ7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRlY2ltYWxzID0gW107XG4gICAgICAgIGlzWmVybyA9IGRpZ2l0cy5ldmVyeShmdW5jdGlvbiAoZCkgeyByZXR1cm4gIWQ7IH0pO1xuICAgICAgICAvLyBwYWQgemVyb3MgZm9yIHNtYWxsIG51bWJlcnNcb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ZWYgPSBfcmVmO1xuICAgICAgICB0aGlzLl9sYXRlc3RWYWx1ZSA9IG51bGw7XG4gICAgICAgIHRoaXMuX2xhdGVzdFJldHVybmVkVmFsdWUgPSBudWxsO1xuICAgICAgICB0aGlzLl9zdWJzY3JpcHRpb24gPSBudWxsO1xuICAgICAgICB0aGlzLl9vYmogPSBudWxsO1xuICAgICAgICB0aGlzLl9zdHJhdGVneSA9IC8qKiBAdHlwZSB7P30gKi8gKChudWxsKSk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXN5bmNQaXBlLnByb3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5fc3Vic2NyaXB0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLl9kaXNwb3NlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gb2JqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBc3luY1BpcGUucHJvdG90eXBlLnRyYW5zZm9ybSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gb2JqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgIGlmICghdGhpcy5fb2JqKSB7XG4gICAgICAgICAgICBpZiAob2JqKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3Vic2NyaWJlKG9iaik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl9sYXRlc3RSZXR1cm5lZFZhbHVlID0gdGhpcy5fbGF0ZXN0VmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fbGF0ZXN0VmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9iaiAhPT0gdGhpcy5fb2JqKSB7XG4gICAgICA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ICBBc3luY1BpcGUucHJvdG90eXBlLl9zZWxlY3RTdHJhdGVneSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gb2JqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgIGlmICjJtWlzUHJvbWlzZShvYmopKSB7XG4gICAgICAgICAgICByZXR1cm4gX3Byb21pc2VTdHJhdGVneTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoybVpc09ic2VydmFibGUob2JqKSkge1xuICAgICAgICAgICAgcmV0dXJuIF9vYnNlcnZhYmxlU3RyYXRlZ3k7XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgaW52YWxpZFBpcGVBcmd1bWVudEVycm9yKEFzeW5jUGlwZSwgb2JqKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXN5bmNQaXBlLnByb3RvdHlwZS5fZGlzcG9zZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLl9zdHJhdGVneS5kaXNwb3NlKC8qKiBAdHlwZSB7P30gKi8gKCh0aGlzLl9zdWJzY3JpcHRpb24pKSk7XG4gICAgICAgIHRoaXMuX2xhdGVzdFZhbHVlID0gbnVsbDtcbiAgICAgICAgdGhpcy5fbGF0ZXN0UmV0dXJuZWRWYWx1ZSA9IG51bGw7XG4gICAgICAgIHRoaXMuX3N1YnNjcmlwdGlvbiA9IG51bGw7XG4gICAgICAgIHRoaXMuX29iaiA9IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGFzeW5jXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXN5bmNQaXBlLnByb3RvdHlwZS5fdXBkYXRlTGF0ZXN0VmFsdWUgPSAvKipcbiAgICAgKiBA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lbGVjdFBpcGVDb21wb25lbnQnfVxuICpcbiAqICBcXEBleHBlcmltZW50YWxcbiAqL1xudmFyIEkxOG5TZWxlY3RQaXBlID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIEkxOG5TZWxlY3RQaXBlKCkge1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHBhcmFtIHs/fSBtYXBwaW5nXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBJMThuU2VsZWN0UGlwZS5wcm90b3R5cGUudHJhbnNmb3JtID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEBwYXJhbSB7P30gbWFwcGluZ1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlLCBtYXBwaW5nKSB7XG4gICAgICAgIGlmICh2YWx1ZSA9PSBudWxsKVxuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICBpZiAodHlwZW9mIG1hcHBpbmcgIT09ICdvYmplY3QnIHx8IHR5cGVvZiB2YWx1ZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRocm93IGludmFsaWRQaXBlQXJndW1lbnRFcnJvcihJMThuU2VsZWN0UGlwZSwgbWFwcGluZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcHBpbmcuaGFzT3duUHJvcGVydHkodmFsdWUpKSB7XG4gICAgICAgICAgICByZXR1cm4gbWFwcGluZ1t2YWx1ZV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcHBpbmcuaGFzT3duUHJvcGVydHkoJ290aGVyJykpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXBwaW5nWydvdGhlciddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAnJztcbiAgICB9O1xuICAgIEkxOG5TZWxlY3RQaXBlLmRlY29yYXRvcnMgPSBbX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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///21\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractControlDirective\", function() { return AbstractControlDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractFormGroupDirective\", function() { return AbstractFormGroupDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CheckboxControlValueAccessor\", function() { return CheckboxControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ControlContainer\", function() { return ControlContainer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_VALUE_ACCESSOR\", function() { return NG_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"COMPOSITION_BUFFER_MODE\", function() { return COMPOSITION_BUFFER_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultValueAccessor\", function() { return DefaultValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControl\", function() { return NgControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControlStatus\", function() { return NgControlStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgControlStatusGroup\", function() { return NgControlStatusGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgForm\", function() { return NgForm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgModel\", function() { return NgModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgModelGroup\", function() { return NgModelGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RadioControlValueAccessor\", function() { return RadioControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControlDirective\", function() { return FormControlDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControlName\", function() { return FormControlName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroupDirective\", function() { return FormGroupDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormArrayName\", function() { return FormArrayName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroupName\", function() { return FormGroupName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NgSelectOption\", function() { return NgSelectOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectControlValueAccessor\", function() { return SelectControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectMultipleControlValueAccessor\", function() { return SelectMultipleControlValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CheckboxRequiredValidator\", function() { return CheckboxRequiredValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EmailValidator\", function() { return EmailValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaxLengthValidator\", function() { return MaxLengthValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MinLengthValidator\", function() { return MinLengthValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PatternValidator\", function() { return PatternValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RequiredValidator\", function() { return RequiredValidator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormBuilder\", function() { return FormBuilder; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractControl\", function() { return AbstractControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormArray\", function() { return FormArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormControl\", function() { return FormControl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormGroup\", function() { return FormGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_ASYNC_VALIDATORS\", function() { return NG_ASYNC_VALIDATORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NG_VALIDATORS\", function() { return NG_VALIDATORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Validators\", function() { return Validators; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormsModule\", function() { return FormsModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReactiveFormsModule\", function() { return ReactiveFormsModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵba\", function() { return InternalFormsSharedModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵz\", function() { return REACTIVE_DRIVEN_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵx\", function() { return SHARED_FORM_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵy\", function() { return TEMPLATE_DRIVEN_DIRECTIVES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return CHECKBOX_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return DEFAULT_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return AbstractControlStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return ngControlStatusHost; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return formDirectiveProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return formControlBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return modelGroupProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbf\", function() { return NgNoValidate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbb\", function() { return NUMBER_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbc\", function() { return NumberValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return RADIO_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return RadioControlRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbd\", function() { return RANGE_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵbe\", function() { return RangeValueAccessor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵj\", function() { return formControlBinding$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵk\", function() { return controlNameBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵl\", function() { return formDirectiveProvider$1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵn\", function() { return formArrayNameProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵm\", function() { return formGroupNameProvider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵo\", function() { return SELECT_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵq\", function() { return NgSelectMultipleOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵp\", function() { return SELECT_MULTIPLE_VALUE_ACCESSOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵs\", function() { return CHECKBOX_REQUIRED_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵt\", function() { return EMAIL_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵv\", function() { return MAX_LENGTH_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵu\", function() { return MIN_LENGTH_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵw\", function() { return PATTERN_VALIDATOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵr\", function() { return REQUIRED_VALIDATOR; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__ = __webpack_require__(536);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__ = __webpack_require__(247);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__ = __webpack_require__(8);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Base class for control directives.\n *\n * Only used internally in the forms module.\n *\n * \\@stable\n * @abstract\n */\nvar AbstractControlDirective = /** @class */ (function () {\n function AbstractControlDirective() {\n }\n Object.defineProperty(AbstractControlDirective.prototype, \"value\", {\n /** The value of the control. */\n get: /**\n * The value of the control.\n * @return {?}\n */\n function () { return this.control ? this.control.value : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valid\", {\n /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n */\n get: /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n * @return {?}\n */\n function () { return this.control ? this.control.valid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"invalid\", {\n /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n */\n get: /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n * @return {?}\n */\n function () { return this.control ? this.control.invalid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pending\", {\n /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n */\n get: /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n * @return {?}\n */\n function () { return this.control ? this.control.pending : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"disabled\", {\n /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n */\n get: /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n * @return {?}\n */\n function () { return this.control ? this.control.disabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"enabled\", {\n /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n */\n get: /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n * @return {?}\n */\n function () { return this.control ? this.control.enabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"errors\", {\n /**\n * Returns any errors generated by failing validation. If there\n * are no errors, it will return null.\n */\n get: /**\n * Returns any errors generated by failing validation. If there\n * are no errors, it will return null.\n * @return {?}\n */\n function () { return this.control ? this.control.errors : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pristine\", {\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return this.control ? this.control.pristine : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"dirty\", {\n /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return this.control ? this.control.dirty : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"touched\", {\n /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return this.control ? this.control.touched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"status\", {\n get: /**\n * @return {?}\n */\n function () { return this.control ? this.control.status : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"untouched\", {\n /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return this.control ? this.control.untouched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"statusChanges\", {\n /**\n * Emits an event every time the validation status of the control\n * is re-calculated.\n */\n get: /**\n * Emits an event every time the validation status of the control\n * is re-calculated.\n * @return {?}\n */\n function () {\n return this.control ? this.control.statusChanges : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valueChanges\", {\n /**\n * Emits an event every time the value of the control changes, in\n * the UI or programmatically.\n */\n get: /**\n * Emits an event every time the value of the control changes, in\n * the UI or programmatically.\n * @return {?}\n */\n function () {\n return this.control ? this.control.valueChanges : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"path\", {\n /**\n * Returns an array that represents the path from the top-level form\n * to this control. Each index is the string name of the control on\n * that level.\n */\n get: /**\n * Returns an array that represents the path from the top-level form\n * to this control. Each index is the string name of the control on\n * that level.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {@link AbstractControl}.\n */\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {\\@link AbstractControl}.\n * @param {?=} value\n * @return {?}\n */\n AbstractControlDirective.prototype.reset = /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * For more information, see {\\@link AbstractControl}.\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n if (this.control)\n this.control.reset(value);\n };\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.hasError = /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n return this.control ? this.control.hasError(errorCode, path) : false;\n };\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.getError = /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n return this.control ? this.control.getError(errorCode, path) : null;\n };\n return AbstractControlDirective;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A directive that contains multiple {\\@link NgControl}s.\n *\n * Only used by the forms module.\n *\n * \\@stable\n * @abstract\n */\nvar ControlContainer = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(ControlContainer, _super);\n function ControlContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ControlContainer.prototype, \"formDirective\", {\n /**\n * Get the form to which this container belongs.\n */\n get: /**\n * Get the form to which this container belongs.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ControlContainer.prototype, \"path\", {\n /**\n * Get the path to this container.\n */\n get: /**\n * Get the path to this container.\n * @return {?}\n */\n function () { return null; },\n enumerable: true,\n configurable: true\n });\n return ControlContainer;\n}(AbstractControlDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isEmptyInputValue(value) {\n // we don't check for string here so it also works with arrays\n return value == null || value.length === 0;\n}\n/**\n * Providers for validators to be used for {\\@link FormControl}s in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * ### Example\n *\n * ```typescript\n * \\@Directive({\n * selector: '[custom-validator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(control: AbstractControl): ValidationErrors | null {\n * return {\"custom\": true};\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar NG_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgValidators');\n/**\n * Providers for asynchronous validators to be used for {\\@link FormControl}s\n * in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * See {\\@link NG_VALIDATORS} for more details.\n *\n * \\@stable\n */\nvar NG_ASYNC_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgAsyncValidators');\nvar EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\n/**\n * Provides a set of validators used by form controls.\n *\n * A validator is a function that processes a {\\@link FormControl} or collection of\n * controls and returns a map of errors. A null map means that validation has passed.\n *\n * ### Example\n *\n * ```typescript\n * var loginControl = new FormControl(\"\", Validators.required)\n * ```\n *\n * \\@stable\n */\nvar Validators = /** @class */ (function () {\n function Validators() {\n }\n /**\n * Validator that requires controls to have a value greater than a number.\n *`min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n */\n /**\n * Validator that requires controls to have a value greater than a number.\n * `min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n * @param {?} min\n * @return {?}\n */\n Validators.min = /**\n * Validator that requires controls to have a value greater than a number.\n * `min()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.min(3));`.\n * @param {?} min\n * @return {?}\n */\n function (min) {\n return function (control) {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n };\n /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n */\n /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n * @param {?} max\n * @return {?}\n */\n Validators.max = /**\n * Validator that requires controls to have a value less than a number.\n * `max()` exists only as a function, not as a directive. For example,\n * `control = new FormControl('', Validators.max(15));`.\n * @param {?} max\n * @return {?}\n */\n function (max) {\n return function (control) {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n };\n /**\n * Validator that requires controls to have a non-empty value.\n */\n /**\n * Validator that requires controls to have a non-empty value.\n * @param {?} control\n * @return {?}\n */\n Validators.required = /**\n * Validator that requires controls to have a non-empty value.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n };\n /**\n * Validator that requires control value to be true.\n */\n /**\n * Validator that requires control value to be true.\n * @param {?} control\n * @return {?}\n */\n Validators.requiredTrue = /**\n * Validator that requires control value to be true.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return control.value === true ? null : { 'required': true };\n };\n /**\n * Validator that performs email validation.\n */\n /**\n * Validator that performs email validation.\n * @param {?} control\n * @return {?}\n */\n Validators.email = /**\n * Validator that performs email validation.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };\n };\n /**\n * Validator that requires controls to have a value of a minimum length.\n */\n /**\n * Validator that requires controls to have a value of a minimum length.\n * @param {?} minLength\n * @return {?}\n */\n Validators.minLength = /**\n * Validator that requires controls to have a value of a minimum length.\n * @param {?} minLength\n * @return {?}\n */\n function (minLength) {\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length < minLength ?\n { 'minlength': { 'requiredLength': minLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires controls to have a value of a maximum length.\n */\n /**\n * Validator that requires controls to have a value of a maximum length.\n * @param {?} maxLength\n * @return {?}\n */\n Validators.maxLength = /**\n * Validator that requires controls to have a value of a maximum length.\n * @param {?} maxLength\n * @return {?}\n */\n function (maxLength) {\n return function (control) {\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length > maxLength ?\n { 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires a control to match a regex to its value.\n */\n /**\n * Validator that requires a control to match a regex to its value.\n * @param {?} pattern\n * @return {?}\n */\n Validators.pattern = /**\n * Validator that requires a control to match a regex to its value.\n * @param {?} pattern\n * @return {?}\n */\n function (pattern) {\n if (!pattern)\n return Validators.nullValidator;\n var /** @type {?} */ regex;\n var /** @type {?} */ regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n };\n /**\n * No-op validator.\n */\n /**\n * No-op validator.\n * @param {?} c\n * @return {?}\n */\n Validators.nullValidator = /**\n * No-op validator.\n * @param {?} c\n * @return {?}\n */\n function (c) { return null; };\n /**\n * @param {?} validators\n * @return {?}\n */\n Validators.compose = /**\n * @param {?} validators\n * @return {?}\n */\n function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n return _mergeErrors(_executeValidators(control, presentValidators));\n };\n };\n /**\n * @param {?} validators\n * @return {?}\n */\n Validators.composeAsync = /**\n * @param {?} validators\n * @return {?}\n */\n function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n var /** @type {?} */ observables = _executeAsyncValidators(control, presentValidators).map(toObservable);\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__[\"forkJoin\"])(observables), _mergeErrors);\n };\n };\n return Validators;\n}());\n/**\n * @param {?} o\n * @return {?}\n */\nfunction isPresent(o) {\n return o != null;\n}\n/**\n * @param {?} r\n * @return {?}\n */\nfunction toObservable(r) {\n var /** @type {?} */ obs = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisPromise\"])(r) ? Object(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__[\"fromPromise\"])(r) : r;\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisObservable\"])(obs))) {\n throw new Error(\"Expected validator to return Promise or Observable.\");\n }\n return obs;\n}\n/**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\nfunction _executeValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n}\n/**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\nfunction _executeAsyncValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n}\n/**\n * @param {?} arrayOfErrors\n * @return {?}\n */\nfunction _mergeErrors(arrayOfErrors) {\n var /** @type {?} */ res = arrayOfErrors.reduce(function (res, errors) {\n return errors != null ? Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */])({}, /** @type {?} */ ((res)), errors) : /** @type {?} */ ((res));\n }, {});\n return Object.keys(res).length === 0 ? null : res;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A `ControlValueAccessor` acts as a bridge between the Angular forms API and a\n * native element in the DOM.\n *\n * Implement this interface if you want to create a custom form control directive\n * that integrates with Angular forms.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Used to provide a {\\@link ControlValueAccessor} for form controls.\n *\n * See {\\@link DefaultValueAccessor} for how to implement one.\n * \\@stable\n */\nvar NG_VALUE_ACCESSOR = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('NgValueAccessor');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return CheckboxControlValueAccessor; }),\n multi: true,\n};\n/**\n * The accessor for writing a value and listening to changes on a checkbox input element.\n *\n * ### Example\n * ```\n * <input type=\"checkbox\" name=\"rememberLogin\" ngModel>\n * ```\n *\n * \\@stable\n */\nvar CheckboxControlValueAccessor = /** @class */ (function () {\n function CheckboxControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n CheckboxControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',\n host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },\n providers: [CHECKBOX_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n CheckboxControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return CheckboxControlValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar DEFAULT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return DefaultValueAccessor; }),\n multi: true\n};\n/**\n * We must check whether the agent is Android because composition events\n * behave differently between iOS and Android.\n * @return {?}\n */\nfunction _isAndroid() {\n var /** @type {?} */ userAgent = Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__[\"ɵgetDOM\"])() ? Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__[\"ɵgetDOM\"])().getUserAgent() : '';\n return /android (\\d+)/.test(userAgent.toLowerCase());\n}\n/**\n * Turn this mode on if you want form directives to buffer IME input until compositionend\n * \\@experimental\n */\nvar COMPOSITION_BUFFER_MODE = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('CompositionEventMode');\n/**\n * The default accessor for writing a value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"text\" name=\"searchQuery\" ngModel>\n * ```\n *\n * \\@stable\n */\nvar DefaultValueAccessor = /** @class */ (function () {\n function DefaultValueAccessor(_renderer, _elementRef, _compositionMode) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this._compositionMode = _compositionMode;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n /**\n * Whether the user is creating a composition string (IME events).\n */\n this._composing = false;\n if (this._compositionMode == null) {\n this._compositionMode = !_isAndroid();\n }\n }\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n DefaultValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype._handleInput = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!this._compositionMode || (this._compositionMode && !this._composing)) {\n this.onChange(value);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n DefaultValueAccessor.prototype._compositionStart = /**\n * \\@internal\n * @return {?}\n */\n function () { this._composing = true; };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype._compositionEnd = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._composing = false;\n this._compositionMode && this.onChange(value);\n };\n DefaultValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',\n // TODO: vsavkin replace the above selector with the one below it once\n // https://github.com/angular/angular/issues/3011 is implemented\n // selector: '[ngModel],[formControl],[formControlName]',\n host: {\n '(input)': '$any(this)._handleInput($event.target.value)',\n '(blur)': 'onTouched()',\n '(compositionstart)': '$any(this)._compositionStart()',\n '(compositionend)': '$any(this)._compositionEnd($event.target.value)'\n },\n providers: [DEFAULT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n DefaultValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [COMPOSITION_BUFFER_MODE,] },] },\n ]; };\n return DefaultValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} validator\n * @return {?}\n */\nfunction normalizeValidator(validator) {\n if ((/** @type {?} */ (validator)).validate) {\n return function (c) { return (/** @type {?} */ (validator)).validate(c); };\n }\n else {\n return /** @type {?} */ (validator);\n }\n}\n/**\n * @param {?} validator\n * @return {?}\n */\nfunction normalizeAsyncValidator(validator) {\n if ((/** @type {?} */ (validator)).validate) {\n return function (c) { return (/** @type {?} */ (validator)).validate(c); };\n }\n else {\n return /** @type {?} */ (validator);\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NUMBER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NumberValueAccessor; }),\n multi: true\n};\n/**\n * The accessor for writing a number value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"number\" [(ngModel)]=\"age\">\n * ```\n */\nvar NumberValueAccessor = /** @class */ (function () {\n function NumberValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n NumberValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n // The value needs to be normalized for IE9, otherwise it is set to 'null' when null\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n NumberValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n NumberValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [NUMBER_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NumberValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return NumberValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction unimplemented() {\n throw new Error('unimplemented');\n}\n/**\n * A base class that all control directive extend.\n * It binds a {\\@link FormControl} object to a DOM element.\n *\n * Used internally by Angular forms.\n *\n * \\@stable\n * @abstract\n */\nvar NgControl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControl, _super);\n function NgControl() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * \\@internal\n */\n _this._parent = null;\n _this.name = null;\n _this.valueAccessor = null;\n /**\n * \\@internal\n */\n _this._rawValidators = [];\n /**\n * \\@internal\n */\n _this._rawAsyncValidators = [];\n return _this;\n }\n Object.defineProperty(NgControl.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgControl.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n return NgControl;\n}(AbstractControlDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar RADIO_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RadioControlValueAccessor; }),\n multi: true\n};\n/**\n * Internal class used by Angular to uncheck radio buttons with the matching name.\n */\nvar RadioControlRegistry = /** @class */ (function () {\n function RadioControlRegistry() {\n this._accessors = [];\n }\n /**\n * @param {?} control\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.add = /**\n * @param {?} control\n * @param {?} accessor\n * @return {?}\n */\n function (control, accessor) {\n this._accessors.push([control, accessor]);\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.remove = /**\n * @param {?} accessor\n * @return {?}\n */\n function (accessor) {\n for (var /** @type {?} */ i = this._accessors.length - 1; i >= 0; --i) {\n if (this._accessors[i][1] === accessor) {\n this._accessors.splice(i, 1);\n return;\n }\n }\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.select = /**\n * @param {?} accessor\n * @return {?}\n */\n function (accessor) {\n var _this = this;\n this._accessors.forEach(function (c) {\n if (_this._isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].fireUncheck(accessor.value);\n }\n });\n };\n /**\n * @param {?} controlPair\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype._isSameGroup = /**\n * @param {?} controlPair\n * @param {?} accessor\n * @return {?}\n */\n function (controlPair, accessor) {\n if (!controlPair[0].control)\n return false;\n return controlPair[0]._parent === accessor._control._parent &&\n controlPair[1].name === accessor.name;\n };\n RadioControlRegistry.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RadioControlRegistry.ctorParameters = function () { return []; };\n return RadioControlRegistry;\n}());\n/**\n * \\@whatItDoes Writes radio control values and listens to radio control changes.\n *\n * Used by {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName}\n * to keep the view synced with the {\\@link FormControl} model.\n *\n * \\@howToUse\n *\n * If you have imported the {\\@link FormsModule} or the {\\@link ReactiveFormsModule}, this\n * value accessor will be active on any radio control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n *\n * ### How to use radio buttons with form directives\n *\n * To use radio buttons in a template-driven form, you'll want to ensure that radio buttons\n * in the same group have the same `name` attribute. Radio buttons with different `name`\n * attributes do not affect each other.\n *\n * {\\@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'}\n *\n * When using radio buttons in a reactive form, radio buttons in the same group should have the\n * same `formControlName`. You can also add a `name` attribute, but it's optional.\n *\n * {\\@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar RadioControlValueAccessor = /** @class */ (function () {\n function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this._registry = _registry;\n this._injector = _injector;\n this.onChange = function () { };\n this.onTouched = function () { };\n }\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._control = this._injector.get(NgControl);\n this._checkName();\n this._registry.add(this._control, this);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this._registry.remove(this); };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._state = value === this.value;\n this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this._fn = fn;\n this.onChange = function () {\n fn(_this.value);\n _this._registry.select(_this);\n };\n };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.fireUncheck = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this.writeValue(value); };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RadioControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._checkName = /**\n * @return {?}\n */\n function () {\n if (this.name && this.formControlName && this.name !== this.formControlName) {\n this._throwNameError();\n }\n if (!this.name && this.formControlName)\n this.name = this.formControlName;\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._throwNameError = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n If you define both a name and a formControlName attribute on your radio button, their values\\n must match. Ex: <input type=\\\"radio\\\" formControlName=\\\"food\\\" name=\\\"food\\\">\\n \");\n };\n RadioControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',\n host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },\n providers: [RADIO_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RadioControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: RadioControlRegistry, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n ]; };\n RadioControlValueAccessor.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"formControlName\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RadioControlValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar RANGE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RangeValueAccessor; }),\n multi: true\n};\n/**\n * The accessor for writing a range value and listening to changes that is used by the\n * {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName} directives.\n *\n * ### Example\n * ```\n * <input type=\"range\" [(ngModel)]=\"age\" >\n * ```\n */\nvar RangeValueAccessor = /** @class */ (function () {\n function RangeValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n RangeValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RangeValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n RangeValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [RANGE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RangeValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n return RangeValueAccessor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SELECT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return SelectControlValueAccessor; }),\n multi: true\n};\n/**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\nfunction _buildValueString(id, value) {\n if (id == null)\n return \"\" + value;\n if (value && typeof value === 'object')\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n}\n/**\n * @param {?} valueString\n * @return {?}\n */\nfunction _extractId(valueString) {\n return valueString.split(':')[0];\n}\n/**\n * \\@whatItDoes Writes values and listens to changes on a select element.\n *\n * Used by {\\@link NgModel}, {\\@link FormControlDirective}, and {\\@link FormControlName}\n * to keep the view synced with the {\\@link FormControl} model.\n *\n * \\@howToUse\n *\n * If you have imported the {\\@link FormsModule} or the {\\@link ReactiveFormsModule}, this\n * value accessor will be active on any select control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n *\n * ### How to use select controls with form directives\n *\n * To use a select in a template-driven form, simply add an `ngModel` and a `name`\n * attribute to the main `<select>` tag.\n *\n * If your option values are simple strings, you can bind to the normal `value` property\n * on the option. If your option values happen to be objects (and you'd like to save the\n * selection in your form as an object), use `ngValue` instead:\n *\n * {\\@example forms/ts/selectControl/select_control_example.ts region='Component'}\n *\n * In reactive forms, you'll also want to add your form directive (`formControlName` or\n * `formControl`) on the main `<select>` tag. Like in the former example, you have the\n * choice of binding to the `value` or `ngValue` property on the select's options.\n *\n * {\\@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'}\n *\n * ### Caveat: Option selection\n *\n * Angular uses object identity to select option. It's possible for the identities of items\n * to change while the data does not. This can happen, for example, if the items are produced\n * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the\n * second response will produce objects with different identities.\n *\n * To customize the default option comparison algorithm, `<select>` supports `compareWith` input.\n * `compareWith` takes a **function** which has two arguments: `option1` and `option2`.\n * If `compareWith` is given, Angular selects option by the return value of the function.\n *\n * #### Syntax\n *\n * ```\n * <select [compareWith]=\"compareFn\" [(ngModel)]=\"selectedCountries\">\n * <option *ngFor=\"let country of countries\" [ngValue]=\"country\">\n * {{country.name}}\n * </option>\n * </select>\n *\n * compareFn(c1: Country, c2: Country): boolean {\n * return c1 && c2 ? c1.id === c2.id : c1 === c2;\n * }\n * ```\n *\n * Note: We listen to the 'change' event because 'input' events aren't fired\n * for selects in Firefox and IE:\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350\n * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar SelectControlValueAccessor = /** @class */ (function () {\n function SelectControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * \\@internal\n */\n this._optionMap = new Map();\n /**\n * \\@internal\n */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"];\n }\n Object.defineProperty(SelectControlValueAccessor.prototype, \"compareWith\", {\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"compareWith must be a function, but received \" + JSON.stringify(fn));\n }\n this._compareWith = fn;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this.value = value;\n var /** @type {?} */ id = this._getOptionId(value);\n if (id == null) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1);\n }\n var /** @type {?} */ valueString = _buildValueString(id, value);\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.onChange = function (valueString) {\n _this.value = _this._getOptionValue(valueString);\n fn(_this.value);\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n SelectControlValueAccessor.prototype._registerOption = /**\n * \\@internal\n * @return {?}\n */\n function () { return (this._idCounter++).toString(); };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionId = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (this._compareWith(this._optionMap.get(id), value))\n return id;\n }\n return null;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionValue = /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n function (valueString) {\n var /** @type {?} */ id = _extractId(valueString);\n return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;\n };\n SelectControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',\n host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [SELECT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n SelectControlValueAccessor.propDecorators = {\n \"compareWith\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return SelectControlValueAccessor;\n}());\n/**\n * \\@whatItDoes Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * \\@howToUse\n *\n * See docs for {\\@link SelectControlValueAccessor} for usage examples.\n *\n * \\@stable\n */\nvar NgSelectOption = /** @class */ (function () {\n function NgSelectOption(_element, _renderer, _select) {\n this._element = _element;\n this._renderer = _renderer;\n this._select = _select;\n if (this._select)\n this.id = this._select._registerOption();\n }\n Object.defineProperty(NgSelectOption.prototype, \"ngValue\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select == null)\n return;\n this._select._optionMap.set(this.id, value);\n this._setElementValue(_buildValueString(this.id, value));\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgSelectOption.prototype, \"value\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._setElementValue(value);\n if (this._select)\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSelectOption.prototype._setElementValue = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._element.nativeElement, 'value', value);\n };\n /**\n * @return {?}\n */\n NgSelectOption.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n };\n NgSelectOption.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'option' },] },\n ];\n /** @nocollapse */\n NgSelectOption.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: SelectControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n ]; };\n NgSelectOption.propDecorators = {\n \"ngValue\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngValue',] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['value',] },],\n };\n return NgSelectOption;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SELECT_MULTIPLE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return SelectMultipleControlValueAccessor; }),\n multi: true\n};\n/**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\nfunction _buildValueString$1(id, value) {\n if (id == null)\n return \"\" + value;\n if (typeof value === 'string')\n value = \"'\" + value + \"'\";\n if (value && typeof value === 'object')\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n}\n/**\n * @param {?} valueString\n * @return {?}\n */\nfunction _extractId$1(valueString) {\n return valueString.split(':')[0];\n}\n/**\n * The accessor for writing a value and listening to changes on a select element.\n *\n * ### Caveat: Options selection\n *\n * Angular uses object identity to select options. It's possible for the identities of items\n * to change while the data does not. This can happen, for example, if the items are produced\n * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the\n * second response will produce objects with different identities.\n *\n * To customize the default option comparison algorithm, `<select multiple>` supports `compareWith`\n * input. `compareWith` takes a **function** which has two arguments: `option1` and `option2`.\n * If `compareWith` is given, Angular selects options by the return value of the function.\n *\n * #### Syntax\n *\n * ```\n * <select multiple [compareWith]=\"compareFn\" [(ngModel)]=\"selectedCountries\">\n * <option *ngFor=\"let country of countries\" [ngValue]=\"country\">\n * {{country.name}}\n * </option>\n * </select>\n *\n * compareFn(c1: Country, c2: Country): boolean {\n * return c1 && c2 ? c1.id === c2.id : c1 === c2;\n * }\n * ```\n *\n * \\@stable\n */\nvar SelectMultipleControlValueAccessor = /** @class */ (function () {\n function SelectMultipleControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * \\@internal\n */\n this._optionMap = new Map();\n /**\n * \\@internal\n */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"];\n }\n Object.defineProperty(SelectMultipleControlValueAccessor.prototype, \"compareWith\", {\n set: /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"compareWith must be a function, but received \" + JSON.stringify(fn));\n }\n this._compareWith = fn;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.writeValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var _this = this;\n this.value = value;\n var /** @type {?} */ optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n var /** @type {?} */ ids_1 = value.map(function (v) { return _this._getOptionId(v); });\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); };\n }\n else {\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.onChange = function (_) {\n var /** @type {?} */ selected = [];\n if (_.hasOwnProperty('selectedOptions')) {\n var /** @type {?} */ options = _.selectedOptions;\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n else {\n var /** @type {?} */ options = /** @type {?} */ (_.options);\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n if (opt.selected) {\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n _this.value = selected;\n fn(selected);\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnTouched = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.setDisabledState = /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._registerOption = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var /** @type {?} */ id = (this._idCounter++).toString();\n this._optionMap.set(id, value);\n return id;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionId = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (this._compareWith(/** @type {?} */ ((this._optionMap.get(id)))._value, value))\n return id;\n }\n return null;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionValue = /**\n * \\@internal\n * @param {?} valueString\n * @return {?}\n */\n function (valueString) {\n var /** @type {?} */ id = _extractId$1(valueString);\n return this._optionMap.has(id) ? /** @type {?} */ ((this._optionMap.get(id)))._value : valueString;\n };\n SelectMultipleControlValueAccessor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',\n host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },\n providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectMultipleControlValueAccessor.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n SelectMultipleControlValueAccessor.propDecorators = {\n \"compareWith\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return SelectMultipleControlValueAccessor;\n}());\n/**\n * Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * ### Example\n *\n * ```\n * <select multiple name=\"city\" ngModel>\n * <option *ngFor=\"let c of cities\" [value]=\"c\"></option>\n * </select>\n * ```\n */\nvar NgSelectMultipleOption = /** @class */ (function () {\n function NgSelectMultipleOption(_element, _renderer, _select) {\n this._element = _element;\n this._renderer = _renderer;\n this._select = _select;\n if (this._select) {\n this.id = this._select._registerOption(this);\n }\n }\n Object.defineProperty(NgSelectMultipleOption.prototype, \"ngValue\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select == null)\n return;\n this._value = value;\n this._setElementValue(_buildValueString$1(this.id, value));\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgSelectMultipleOption.prototype, \"value\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (this._select) {\n this._value = value;\n this._setElementValue(_buildValueString$1(this.id, value));\n this._select.writeValue(this._select.value);\n }\n else {\n this._setElementValue(value);\n }\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n NgSelectMultipleOption.prototype._setElementValue = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._renderer.setProperty(this._element.nativeElement, 'value', value);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} selected\n * @return {?}\n */\n NgSelectMultipleOption.prototype._setSelected = /**\n * \\@internal\n * @param {?} selected\n * @return {?}\n */\n function (selected) {\n this._renderer.setProperty(this._element.nativeElement, 'selected', selected);\n };\n /**\n * @return {?}\n */\n NgSelectMultipleOption.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n };\n NgSelectMultipleOption.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'option' },] },\n ];\n /** @nocollapse */\n NgSelectMultipleOption.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: SelectMultipleControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n ]; };\n NgSelectMultipleOption.propDecorators = {\n \"ngValue\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngValue',] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['value',] },],\n };\n return NgSelectMultipleOption;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} name\n * @param {?} parent\n * @return {?}\n */\nfunction controlPath(name, parent) {\n return /** @type {?} */ ((parent.path)).concat([name]);\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpControl(control, dir) {\n if (!control)\n _throwError(dir, 'Cannot find control with');\n if (!dir.valueAccessor)\n _throwError(dir, 'No value accessor for form control with');\n control.validator = Validators.compose([/** @type {?} */ ((control.validator)), dir.validator]);\n control.asyncValidator = Validators.composeAsync([/** @type {?} */ ((control.asyncValidator)), dir.asyncValidator]); /** @type {?} */\n ((dir.valueAccessor)).writeValue(control.value);\n setUpViewChangePipeline(control, dir);\n setUpModelChangePipeline(control, dir);\n setUpBlurPipeline(control, dir);\n if (/** @type {?} */ ((dir.valueAccessor)).setDisabledState) {\n control.registerOnDisabledChange(function (isDisabled) { /** @type {?} */ ((/** @type {?} */ ((dir.valueAccessor)).setDisabledState))(isDisabled); });\n }\n // re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4\n dir._rawValidators.forEach(function (validator) {\n if ((/** @type {?} */ (validator)).registerOnValidatorChange)\n /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });\n });\n dir._rawAsyncValidators.forEach(function (validator) {\n if ((/** @type {?} */ (validator)).registerOnValidatorChange)\n /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction cleanUpControl(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function () { return _noControlError(dir); }); /** @type {?} */\n ((dir.valueAccessor)).registerOnTouched(function () { return _noControlError(dir); });\n dir._rawValidators.forEach(function (validator) {\n if (validator.registerOnValidatorChange) {\n validator.registerOnValidatorChange(null);\n }\n });\n dir._rawAsyncValidators.forEach(function (validator) {\n if (validator.registerOnValidatorChange) {\n validator.registerOnValidatorChange(null);\n }\n });\n if (control)\n control._clearChangeFns();\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpViewChangePipeline(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function (newValue) {\n control._pendingValue = newValue;\n control._pendingChange = true;\n control._pendingDirty = true;\n if (control.updateOn === 'change')\n updateControl(control, dir);\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpBlurPipeline(control, dir) {\n /** @type {?} */ ((dir.valueAccessor)).registerOnTouched(function () {\n control._pendingTouched = true;\n if (control.updateOn === 'blur' && control._pendingChange)\n updateControl(control, dir);\n if (control.updateOn !== 'submit')\n control.markAsTouched();\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction updateControl(control, dir) {\n dir.viewToModelUpdate(control._pendingValue);\n if (control._pendingDirty)\n control.markAsDirty();\n control.setValue(control._pendingValue, { emitModelToViewChange: false });\n control._pendingChange = false;\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpModelChangePipeline(control, dir) {\n control.registerOnChange(function (newValue, emitModelEvent) {\n /** @type {?} */ ((\n // control -> view\n dir.valueAccessor)).writeValue(newValue);\n // control -> ngModel\n if (emitModelEvent)\n dir.viewToModelUpdate(newValue);\n });\n}\n/**\n * @param {?} control\n * @param {?} dir\n * @return {?}\n */\nfunction setUpFormContainer(control, dir) {\n if (control == null)\n _throwError(dir, 'Cannot find control with');\n control.validator = Validators.compose([control.validator, dir.validator]);\n control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]);\n}\n/**\n * @param {?} dir\n * @return {?}\n */\nfunction _noControlError(dir) {\n return _throwError(dir, 'There is no FormControl instance attached to form control element with');\n}\n/**\n * @param {?} dir\n * @param {?} message\n * @return {?}\n */\nfunction _throwError(dir, message) {\n var /** @type {?} */ messageEnd;\n if (/** @type {?} */ ((dir.path)).length > 1) {\n messageEnd = \"path: '\" + (/** @type {?} */ ((dir.path))).join(' -> ') + \"'\";\n }\n else if (/** @type {?} */ ((dir.path))[0]) {\n messageEnd = \"name: '\" + dir.path + \"'\";\n }\n else {\n messageEnd = 'unspecified name attribute';\n }\n throw new Error(message + \" \" + messageEnd);\n}\n/**\n * @param {?} validators\n * @return {?}\n */\nfunction composeValidators(validators) {\n return validators != null ? Validators.compose(validators.map(normalizeValidator)) : null;\n}\n/**\n * @param {?} validators\n * @return {?}\n */\nfunction composeAsyncValidators(validators) {\n return validators != null ? Validators.composeAsync(validators.map(normalizeAsyncValidator)) :\n null;\n}\n/**\n * @param {?} changes\n * @param {?} viewModel\n * @return {?}\n */\nfunction isPropertyUpdated(changes, viewModel) {\n if (!changes.hasOwnProperty('model'))\n return false;\n var /** @type {?} */ change = changes['model'];\n if (change.isFirstChange())\n return true;\n return !Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵlooseIdentical\"])(viewModel, change.currentValue);\n}\nvar BUILTIN_ACCESSORS = [\n CheckboxControlValueAccessor,\n RangeValueAccessor,\n NumberValueAccessor,\n SelectControlValueAccessor,\n SelectMultipleControlValueAccessor,\n RadioControlValueAccessor,\n];\n/**\n * @param {?} valueAccessor\n * @return {?}\n */\nfunction isBuiltInAccessor(valueAccessor) {\n return BUILTIN_ACCESSORS.some(function (a) { return valueAccessor.constructor === a; });\n}\n/**\n * @param {?} form\n * @param {?} directives\n * @return {?}\n */\nfunction syncPendingControls(form, directives) {\n form._syncPendingControls();\n directives.forEach(function (dir) {\n var /** @type {?} */ control = /** @type {?} */ (dir.control);\n if (control.updateOn === 'submit' && control._pendingChange) {\n dir.viewToModelUpdate(control._pendingValue);\n control._pendingChange = false;\n }\n });\n}\n/**\n * @param {?} dir\n * @param {?} valueAccessors\n * @return {?}\n */\nfunction selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n var /** @type {?} */ defaultAccessor = undefined;\n var /** @type {?} */ builtinAccessor = undefined;\n var /** @type {?} */ customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}\n/**\n * @template T\n * @param {?} list\n * @param {?} el\n * @return {?}\n */\nfunction removeDir(list, el) {\n var /** @type {?} */ index = list.indexOf(el);\n if (index > -1)\n list.splice(index, 1);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This is a base class for code shared between {\\@link NgModelGroup} and {\\@link FormGroupName}.\n *\n * \\@stable\n */\nvar AbstractFormGroupDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(AbstractFormGroupDirective, _super);\n function AbstractFormGroupDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return {?}\n */\n AbstractFormGroupDirective.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._checkParentType(); /** @type {?} */\n ((this.formDirective)).addFormGroup(this);\n };\n /**\n * @return {?}\n */\n AbstractFormGroupDirective.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeFormGroup(this);\n }\n };\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"control\", {\n /**\n * Get the {@link FormGroup} backing this binding.\n */\n get: /**\n * Get the {\\@link FormGroup} backing this binding.\n * @return {?}\n */\n function () { return /** @type {?} */ ((this.formDirective)).getFormGroup(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"path\", {\n /**\n * Get the path to this control group.\n */\n get: /**\n * Get the path to this control group.\n * @return {?}\n */\n function () { return controlPath(this.name, this._parent); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"formDirective\", {\n /**\n * Get the {@link Form} to which this group belongs.\n */\n get: /**\n * Get the {\\@link Form} to which this group belongs.\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._validators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractFormGroupDirective.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._asyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractFormGroupDirective.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () { };\n return AbstractFormGroupDirective;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar AbstractControlStatus = /** @class */ (function () {\n function AbstractControlStatus(cd) {\n this._cd = cd;\n }\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassUntouched\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.untouched : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassTouched\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.touched : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassPristine\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.pristine : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassDirty\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.dirty : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassValid\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.valid : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassInvalid\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.invalid : false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlStatus.prototype, \"ngClassPending\", {\n get: /**\n * @return {?}\n */\n function () { return this._cd.control ? this._cd.control.pending : false; },\n enumerable: true,\n configurable: true\n });\n return AbstractControlStatus;\n}());\nvar ngControlStatusHost = {\n '[class.ng-untouched]': 'ngClassUntouched',\n '[class.ng-touched]': 'ngClassTouched',\n '[class.ng-pristine]': 'ngClassPristine',\n '[class.ng-dirty]': 'ngClassDirty',\n '[class.ng-valid]': 'ngClassValid',\n '[class.ng-invalid]': 'ngClassInvalid',\n '[class.ng-pending]': 'ngClassPending',\n};\n/**\n * Directive automatically applied to Angular form controls that sets CSS classes\n * based on control status. The following classes are applied as the properties\n * become true:\n *\n * * ng-valid\n * * ng-invalid\n * * ng-pending\n * * ng-pristine\n * * ng-dirty\n * * ng-untouched\n * * ng-touched\n *\n * \\@stable\n */\nvar NgControlStatus = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControlStatus, _super);\n function NgControlStatus(cd) {\n return _super.call(this, cd) || this;\n }\n NgControlStatus.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost },] },\n ];\n /** @nocollapse */\n NgControlStatus.ctorParameters = function () { return [\n { type: NgControl, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] },] },\n ]; };\n return NgControlStatus;\n}(AbstractControlStatus));\n/**\n * Directive automatically applied to Angular form groups that sets CSS classes\n * based on control status (valid/invalid/dirty/etc).\n *\n * \\@stable\n */\nvar NgControlStatusGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgControlStatusGroup, _super);\n function NgControlStatusGroup(cd) {\n return _super.call(this, cd) || this;\n }\n NgControlStatusGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',\n host: ngControlStatusHost\n },] },\n ];\n /** @nocollapse */\n NgControlStatusGroup.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] },] },\n ]; };\n return NgControlStatusGroup;\n}(AbstractControlStatus));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Indicates that a FormControl is valid, i.e. that no errors exist in the input value.\n */\nvar VALID = 'VALID';\n/**\n * Indicates that a FormControl is invalid, i.e. that an error exists in the input value.\n */\nvar INVALID = 'INVALID';\n/**\n * Indicates that a FormControl is pending, i.e. that async validation is occurring and\n * errors are not yet available for the input value.\n */\nvar PENDING = 'PENDING';\n/**\n * Indicates that a FormControl is disabled, i.e. that the control is exempt from ancestor\n * calculations of validity or value.\n */\nvar DISABLED = 'DISABLED';\n/**\n * @param {?} control\n * @param {?} path\n * @param {?} delimiter\n * @return {?}\n */\nfunction _find(control, path, delimiter) {\n if (path == null)\n return null;\n if (!(path instanceof Array)) {\n path = (/** @type {?} */ (path)).split(delimiter);\n }\n if (path instanceof Array && (path.length === 0))\n return null;\n return (/** @type {?} */ (path)).reduce(function (v, name) {\n if (v instanceof FormGroup) {\n return v.controls[name] || null;\n }\n if (v instanceof FormArray) {\n return v.at(/** @type {?} */ (name)) || null;\n }\n return null;\n }, control);\n}\n/**\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction coerceToValidator(validatorOrOpts) {\n var /** @type {?} */ validator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).validators :\n validatorOrOpts));\n return Array.isArray(validator) ? composeValidators(validator) : validator || null;\n}\n/**\n * @param {?=} asyncValidator\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction coerceToAsyncValidator(asyncValidator, validatorOrOpts) {\n var /** @type {?} */ origAsyncValidator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).asyncValidators :\n asyncValidator));\n return Array.isArray(origAsyncValidator) ? composeAsyncValidators(origAsyncValidator) :\n origAsyncValidator || null;\n}\n/**\n * @record\n */\n\n/**\n * @param {?=} validatorOrOpts\n * @return {?}\n */\nfunction isOptionsObj(validatorOrOpts) {\n return validatorOrOpts != null && !Array.isArray(validatorOrOpts) &&\n typeof validatorOrOpts === 'object';\n}\n/**\n * \\@whatItDoes This is the base class for {\\@link FormControl}, {\\@link FormGroup}, and\n * {\\@link FormArray}.\n *\n * It provides some of the shared behavior that all controls and groups of controls have, like\n * running validators, calculating status, and resetting state. It also defines the properties\n * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be\n * instantiated directly.\n *\n * \\@stable\n * @abstract\n */\nvar AbstractControl = /** @class */ (function () {\n function AbstractControl(validator, asyncValidator) {\n this.validator = validator;\n this.asyncValidator = asyncValidator;\n /**\n * \\@internal\n */\n this._onCollectionChange = function () { };\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n this.pristine = true;\n /**\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /**\n * \\@internal\n */\n this._onDisabledChange = [];\n }\n Object.defineProperty(AbstractControl.prototype, \"parent\", {\n /**\n * The parent control.\n */\n get: /**\n * The parent control.\n * @return {?}\n */\n function () { return this._parent; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"valid\", {\n /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n */\n get: /**\n * A control is `valid` when its `status === VALID`.\n *\n * In order to have this status, the control must have passed all its\n * validation checks.\n * @return {?}\n */\n function () { return this.status === VALID; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"invalid\", {\n /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n */\n get: /**\n * A control is `invalid` when its `status === INVALID`.\n *\n * In order to have this status, the control must have failed\n * at least one of its validation checks.\n * @return {?}\n */\n function () { return this.status === INVALID; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"pending\", {\n /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n */\n get: /**\n * A control is `pending` when its `status === PENDING`.\n *\n * In order to have this status, the control must be in the\n * middle of conducting a validation check.\n * @return {?}\n */\n function () { return this.status == PENDING; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"disabled\", {\n /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n */\n get: /**\n * A control is `disabled` when its `status === DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n * @return {?}\n */\n function () { return this.status === DISABLED; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"enabled\", {\n /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n */\n get: /**\n * A control is `enabled` as long as its `status !== DISABLED`.\n *\n * In other words, it has a status of `VALID`, `INVALID`, or\n * `PENDING`.\n * @return {?}\n */\n function () { return this.status !== DISABLED; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"dirty\", {\n /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n */\n get: /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * Note that programmatic changes to a control's value will\n * *not* mark it dirty.\n * @return {?}\n */\n function () { return !this.pristine; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"untouched\", {\n /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n */\n get: /**\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n * @return {?}\n */\n function () { return !this.touched; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControl.prototype, \"updateOn\", {\n /**\n * Returns the update strategy of the `AbstractControl` (i.e.\n * the event on which the control will update itself).\n * Possible values: `'change'` (default) | `'blur'` | `'submit'`\n */\n get: /**\n * Returns the update strategy of the `AbstractControl` (i.e.\n * the event on which the control will update itself).\n * Possible values: `'change'` (default) | `'blur'` | `'submit'`\n * @return {?}\n */\n function () {\n return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change');\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n */\n /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n * @param {?} newValidator\n * @return {?}\n */\n AbstractControl.prototype.setValidators = /**\n * Sets the synchronous validators that are active on this control. Calling\n * this will overwrite any existing sync validators.\n * @param {?} newValidator\n * @return {?}\n */\n function (newValidator) {\n this.validator = coerceToValidator(newValidator);\n };\n /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n */\n /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n * @param {?} newValidator\n * @return {?}\n */\n AbstractControl.prototype.setAsyncValidators = /**\n * Sets the async validators that are active on this control. Calling this\n * will overwrite any existing async validators.\n * @param {?} newValidator\n * @return {?}\n */\n function (newValidator) {\n this.asyncValidator = coerceToAsyncValidator(newValidator);\n };\n /**\n * Empties out the sync validator list.\n */\n /**\n * Empties out the sync validator list.\n * @return {?}\n */\n AbstractControl.prototype.clearValidators = /**\n * Empties out the sync validator list.\n * @return {?}\n */\n function () { this.validator = null; };\n /**\n * Empties out the async validator list.\n */\n /**\n * Empties out the async validator list.\n * @return {?}\n */\n AbstractControl.prototype.clearAsyncValidators = /**\n * Empties out the async validator list.\n * @return {?}\n */\n function () { this.asyncValidator = null; };\n /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n */\n /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsTouched = /**\n * Marks the control as `touched`.\n *\n * This will also mark all direct ancestors as `touched` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = true;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsTouched(opts);\n }\n };\n /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n */\n /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsUntouched = /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, it will also mark all children as `untouched`\n * to maintain the model, and re-calculate the `touched` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = false;\n this._pendingTouched = false;\n this._forEachChild(function (control) { control.markAsUntouched({ onlySelf: true }); });\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n };\n /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n */\n /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsDirty = /**\n * Marks the control as `dirty`.\n *\n * This will also mark all direct ancestors as `dirty` to maintain\n * the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = false;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsDirty(opts);\n }\n };\n /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n */\n /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsPristine = /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, it will also mark all children as `pristine`\n * to maintain the model, and re-calculate the `pristine` status of all parent\n * controls.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = true;\n this._pendingDirty = false;\n this._forEachChild(function (control) { control.markAsPristine({ onlySelf: true }); });\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n };\n /**\n * Marks the control as `pending`.\n */\n /**\n * Marks the control as `pending`.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.markAsPending = /**\n * Marks the control as `pending`.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = PENDING;\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsPending(opts);\n }\n };\n /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n */\n /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.disable = /**\n * Disables the control. This means the control will be exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children will be disabled to maintain the model.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = DISABLED;\n (/** @type {?} */ (this)).errors = null;\n this._forEachChild(function (control) { control.disable({ onlySelf: true }); });\n this._updateValue();\n if (opts.emitEvent !== false) {\n (/** @type {?} */ (this.valueChanges)).emit(this.value);\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n this._updateAncestors(!!opts.onlySelf);\n this._onDisabledChange.forEach(function (changeFn) { return changeFn(true); });\n };\n /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n */\n /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.enable = /**\n * Enables the control. This means the control will be included in validation checks and\n * the aggregate value of its parent. Its status is re-calculated based on its value and\n * its validators.\n *\n * If the control has children, all children will be enabled.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).status = VALID;\n this._forEachChild(function (control) { control.enable({ onlySelf: true }); });\n this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });\n this._updateAncestors(!!opts.onlySelf);\n this._onDisabledChange.forEach(function (changeFn) { return changeFn(false); });\n };\n /**\n * @param {?} onlySelf\n * @return {?}\n */\n AbstractControl.prototype._updateAncestors = /**\n * @param {?} onlySelf\n * @return {?}\n */\n function (onlySelf) {\n if (this._parent && !onlySelf) {\n this._parent.updateValueAndValidity();\n this._parent._updatePristine();\n this._parent._updateTouched();\n }\n };\n /**\n * @param {?} parent\n * @return {?}\n */\n AbstractControl.prototype.setParent = /**\n * @param {?} parent\n * @return {?}\n */\n function (parent) { this._parent = parent; };\n /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n */\n /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.updateValueAndValidity = /**\n * Re-calculates the value and validation status of the control.\n *\n * By default, it will also update the value and validity of its ancestors.\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n this._setInitialStatus();\n this._updateValue();\n if (this.enabled) {\n this._cancelExistingSubscription();\n (/** @type {?} */ (this)).errors = this._runValidator();\n (/** @type {?} */ (this)).status = this._calculateStatus();\n if (this.status === VALID || this.status === PENDING) {\n this._runAsyncValidator(opts.emitEvent);\n }\n }\n if (opts.emitEvent !== false) {\n (/** @type {?} */ (this.valueChanges)).emit(this.value);\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n if (this._parent && !opts.onlySelf) {\n this._parent.updateValueAndValidity(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updateTreeValidity = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = { emitEvent: true }; }\n this._forEachChild(function (ctrl) { return ctrl._updateTreeValidity(opts); });\n this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._setInitialStatus = /**\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).status = this._allControlsDisabled() ? DISABLED : VALID;\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._runValidator = /**\n * @return {?}\n */\n function () {\n return this.validator ? this.validator(this) : null;\n };\n /**\n * @param {?=} emitEvent\n * @return {?}\n */\n AbstractControl.prototype._runAsyncValidator = /**\n * @param {?=} emitEvent\n * @return {?}\n */\n function (emitEvent) {\n var _this = this;\n if (this.asyncValidator) {\n (/** @type {?} */ (this)).status = PENDING;\n var /** @type {?} */ obs = toObservable(this.asyncValidator(this));\n this._asyncValidationSubscription =\n obs.subscribe(function (errors) { return _this.setErrors(errors, { emitEvent: emitEvent }); });\n }\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._cancelExistingSubscription = /**\n * @return {?}\n */\n function () {\n if (this._asyncValidationSubscription) {\n this._asyncValidationSubscription.unsubscribe();\n }\n };\n /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n */\n /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n * @param {?} errors\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype.setErrors = /**\n * Sets errors on a form control.\n *\n * This is used when validations are run manually by the user, rather than automatically.\n *\n * Calling `setErrors` will also update the validity of the parent control.\n *\n * ### Example\n *\n * ```\n * const login = new FormControl(\"someLogin\");\n * login.setErrors({\n * \"notUnique\": true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({\"notUnique\": true});\n *\n * login.setValue(\"someOtherLogin\");\n *\n * expect(login.valid).toEqual(true);\n * ```\n * @param {?} errors\n * @param {?=} opts\n * @return {?}\n */\n function (errors, opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).errors = errors;\n this._updateControlsErrors(opts.emitEvent !== false);\n };\n /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n */\n /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n * @param {?} path\n * @return {?}\n */\n AbstractControl.prototype.get = /**\n * Retrieves a child control given the control's name or path.\n *\n * Paths can be passed in as an array or a string delimited by a dot.\n *\n * To get a control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name']);`\n * @param {?} path\n * @return {?}\n */\n function (path) { return _find(this, path, '.'); };\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControl.prototype.getError = /**\n * Returns error data if the control with the given path has the error specified. Otherwise\n * returns null or undefined.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) {\n var /** @type {?} */ control = path ? this.get(path) : this;\n return control && control.errors ? control.errors[errorCode] : null;\n };\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n */\n /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControl.prototype.hasError = /**\n * Returns true if the control with the given path has the error specified. Otherwise\n * returns false.\n *\n * If no path is given, it checks for the error on the present control.\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n function (errorCode, path) { return !!this.getError(errorCode, path); };\n Object.defineProperty(AbstractControl.prototype, \"root\", {\n /**\n * Retrieves the top-level ancestor of this control.\n */\n get: /**\n * Retrieves the top-level ancestor of this control.\n * @return {?}\n */\n function () {\n var /** @type {?} */ x = this;\n while (x._parent) {\n x = x._parent;\n }\n return x;\n },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} emitEvent\n * @return {?}\n */\n AbstractControl.prototype._updateControlsErrors = /**\n * \\@internal\n * @param {?} emitEvent\n * @return {?}\n */\n function (emitEvent) {\n (/** @type {?} */ (this)).status = this._calculateStatus();\n if (emitEvent) {\n (/** @type {?} */ (this.statusChanges)).emit(this.status);\n }\n if (this._parent) {\n this._parent._updateControlsErrors(emitEvent);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._initObservables = /**\n * \\@internal\n * @return {?}\n */\n function () {\n (/** @type {?} */ (this)).valueChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n (/** @type {?} */ (this)).statusChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n };\n /**\n * @return {?}\n */\n AbstractControl.prototype._calculateStatus = /**\n * @return {?}\n */\n function () {\n if (this._allControlsDisabled())\n return DISABLED;\n if (this.errors)\n return INVALID;\n if (this._anyControlsHaveStatus(PENDING))\n return PENDING;\n if (this._anyControlsHaveStatus(INVALID))\n return INVALID;\n return VALID;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} status\n * @return {?}\n */\n AbstractControl.prototype._anyControlsHaveStatus = /**\n * \\@internal\n * @param {?} status\n * @return {?}\n */\n function (status) {\n return this._anyControls(function (control) { return control.status === status; });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._anyControlsDirty = /**\n * \\@internal\n * @return {?}\n */\n function () {\n return this._anyControls(function (control) { return control.dirty; });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n AbstractControl.prototype._anyControlsTouched = /**\n * \\@internal\n * @return {?}\n */\n function () {\n return this._anyControls(function (control) { return control.touched; });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updatePristine = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).pristine = !this._anyControlsDirty();\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._updateTouched = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (opts === void 0) { opts = {}; }\n (/** @type {?} */ (this)).touched = this._anyControlsTouched();\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} formState\n * @return {?}\n */\n AbstractControl.prototype._isBoxedValue = /**\n * \\@internal\n * @param {?} formState\n * @return {?}\n */\n function (formState) {\n return typeof formState === 'object' && formState !== null &&\n Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n AbstractControl.prototype._registerOnCollectionChange = /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onCollectionChange = fn; };\n /** @internal */\n /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n AbstractControl.prototype._setUpdateStrategy = /**\n * \\@internal\n * @param {?=} opts\n * @return {?}\n */\n function (opts) {\n if (isOptionsObj(opts) && (/** @type {?} */ (opts)).updateOn != null) {\n this._updateOn = /** @type {?} */ (((/** @type {?} */ (opts)).updateOn));\n }\n };\n return AbstractControl;\n}());\n/**\n * \\@whatItDoes Tracks the value and validation status of an individual form control.\n *\n * It is one of the three fundamental building blocks of Angular forms, along with\n * {\\@link FormGroup} and {\\@link FormArray}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormControl}, you can pass in an initial value as the\n * first argument. Example:\n *\n * ```ts\n * const ctrl = new FormControl('some value');\n * console.log(ctrl.value); // 'some value'\n * ```\n *\n * You can also initialize the control with a form state object on instantiation,\n * which includes both the value and whether or not the control is disabled.\n * You can't use the value key without the disabled key; both are required\n * to use this way of initialization.\n *\n * ```ts\n * const ctrl = new FormControl({value: 'n/a', disabled: true});\n * console.log(ctrl.value); // 'n/a'\n * console.log(ctrl.status); // 'DISABLED'\n * ```\n *\n * The second {\\@link FormControl} argument can accept one of three things:\n * * a sync validator function\n * * an array of sync validator functions\n * * an options object containing validator and/or async validator functions\n *\n * Example of a single sync validator function:\n *\n * ```ts\n * const ctrl = new FormControl('', Validators.required);\n * console.log(ctrl.value); // ''\n * console.log(ctrl.status); // 'INVALID'\n * ```\n *\n * Example using options object:\n *\n * ```ts\n * const ctrl = new FormControl('', {\n * validators: Validators.required,\n * asyncValidators: myAsyncValidator\n * });\n * ```\n *\n * The options object can also be used to define when the control should update.\n * By default, the value and validity of a control updates whenever the value\n * changes. You can configure it to update on the blur event instead by setting\n * the `updateOn` option to `'blur'`.\n *\n * ```ts\n * const c = new FormControl('', { updateOn: 'blur' });\n * ```\n *\n * You can also set `updateOn` to `'submit'`, which will delay value and validity\n * updates until the parent form of the control fires a submit event.\n *\n * See its superclass, {\\@link AbstractControl}, for more properties and methods.\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormControl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControl, _super);\n function FormControl(formState, validatorOrOpts, asyncValidator) {\n if (formState === void 0) { formState = null; }\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n /**\n * \\@internal\n */\n _this._onChange = [];\n _this._applyFormState(formState);\n _this._setUpdateStrategy(validatorOrOpts);\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n _this._initObservables();\n return _this;\n }\n /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n */\n /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.setValue = /**\n * Set the value of the form control to `value`.\n *\n * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`\n * and not its parent component. This defaults to false.\n *\n * If `emitEvent` is `true`, this\n * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults\n * to true (as it falls through to `updateValueAndValidity`).\n *\n * If `emitModelToViewChange` is `true`, the view will be notified about the new value\n * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not\n * specified.\n *\n * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the\n * model. This is the default behavior if `emitViewToModelChange` is not specified.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n (/** @type {?} */ (this)).value = this._pendingValue = value;\n if (this._onChange.length && options.emitModelToViewChange !== false) {\n this._onChange.forEach(function (changeFn) { return changeFn(_this.value, options.emitViewToModelChange !== false); });\n }\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n */\n /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {\\@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {\\@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.patchValue = /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {\\@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {\\@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (options === void 0) { options = {}; }\n this.setValue(value, options);\n };\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n * @param {?=} formState\n * @param {?=} options\n * @return {?}\n */\n FormControl.prototype.reset = /**\n * Resets the form control. This means by default:\n *\n * * it is marked as `pristine`\n * * it is marked as `untouched`\n * * value is set to null\n *\n * You can also reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * Ex:\n *\n * ```ts\n * this.control.reset('Nancy');\n *\n * console.log(this.control.value); // 'Nancy'\n * ```\n *\n * OR\n *\n * ```\n * this.control.reset({value: 'Nancy', disabled: true});\n *\n * console.log(this.control.value); // 'Nancy'\n * console.log(this.control.status); // 'DISABLED'\n * ```\n * @param {?=} formState\n * @param {?=} options\n * @return {?}\n */\n function (formState, options) {\n if (formState === void 0) { formState = null; }\n if (options === void 0) { options = {}; }\n this._applyFormState(formState);\n this.markAsPristine(options);\n this.markAsUntouched(options);\n this.setValue(this.value, options);\n this._pendingChange = false;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () { };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormControl.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) { return false; };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () { return this.disabled; };\n /**\n * Register a listener for change events.\n */\n /**\n * Register a listener for change events.\n * @param {?} fn\n * @return {?}\n */\n FormControl.prototype.registerOnChange = /**\n * Register a listener for change events.\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange.push(fn); };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._clearChangeFns = /**\n * \\@internal\n * @return {?}\n */\n function () {\n this._onChange = [];\n this._onDisabledChange = [];\n this._onCollectionChange = function () { };\n };\n /**\n * Register a listener for disabled events.\n */\n /**\n * Register a listener for disabled events.\n * @param {?} fn\n * @return {?}\n */\n FormControl.prototype.registerOnDisabledChange = /**\n * Register a listener for disabled events.\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n this._onDisabledChange.push(fn);\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormControl.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) { };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormControl.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (this.updateOn === 'submit') {\n if (this._pendingDirty)\n this.markAsDirty();\n if (this._pendingTouched)\n this.markAsTouched();\n if (this._pendingChange) {\n this.setValue(this._pendingValue, { onlySelf: true, emitModelToViewChange: false });\n return true;\n }\n }\n return false;\n };\n /**\n * @param {?} formState\n * @return {?}\n */\n FormControl.prototype._applyFormState = /**\n * @param {?} formState\n * @return {?}\n */\n function (formState) {\n if (this._isBoxedValue(formState)) {\n (/** @type {?} */ (this)).value = this._pendingValue = formState.value;\n formState.disabled ? this.disable({ onlySelf: true, emitEvent: false }) :\n this.enable({ onlySelf: true, emitEvent: false });\n }\n else {\n (/** @type {?} */ (this)).value = this._pendingValue = formState;\n }\n };\n return FormControl;\n}(AbstractControl));\n/**\n * \\@whatItDoes Tracks the value and validity state of a group of {\\@link FormControl}\n * instances.\n *\n * A `FormGroup` aggregates the values of each child {\\@link FormControl} into one object,\n * with each control name as the key. It calculates its status by reducing the statuses\n * of its children. For example, if one of the controls in a group is invalid, the entire\n * group becomes invalid.\n *\n * `FormGroup` is one of the three fundamental building blocks used to define forms in Angular,\n * along with {\\@link FormControl} and {\\@link FormArray}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormGroup}, pass in a collection of child controls as the first\n * argument. The key for each child will be the name under which it is registered.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl('Nancy', Validators.minLength(2)),\n * last: new FormControl('Drew'),\n * });\n *\n * console.log(form.value); // {first: 'Nancy', last; 'Drew'}\n * console.log(form.status); // 'VALID'\n * ```\n *\n * You can also include group-level validators as the second arg, or group-level async\n * validators as the third arg. These come in handy when you want to perform validation\n * that considers the value of more than one child control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('', Validators.minLength(2)),\n * passwordConfirm: new FormControl('', Validators.minLength(2)),\n * }, passwordMatchValidator);\n *\n *\n * function passwordMatchValidator(g: FormGroup) {\n * return g.get('password').value === g.get('passwordConfirm').value\n * ? null : {'mismatch': true};\n * }\n * ```\n *\n * Like {\\@link FormControl} instances, you can alternatively choose to pass in\n * validators and async validators as part of an options object.\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('')\n * passwordConfirm: new FormControl('')\n * }, {validators: passwordMatchValidator, asyncValidators: otherValidator});\n * ```\n *\n * The options object can also be used to set a default value for each child\n * control's `updateOn` property. If you set `updateOn` to `'blur'` at the\n * group level, all child controls will default to 'blur', unless the child\n * has explicitly specified a different `updateOn` value.\n *\n * ```ts\n * const c = new FormGroup({\n * one: new FormControl()\n * }, {updateOn: 'blur'});\n * ```\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroup, _super);\n function FormGroup(controls, validatorOrOpts, asyncValidator) {\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n _this.controls = controls;\n _this._initObservables();\n _this._setUpdateStrategy(validatorOrOpts);\n _this._setUpControls();\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n return _this;\n }\n /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {@link FormGroup#addControl addControl} instead.\n */\n /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {\\@link FormGroup#addControl addControl} instead.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.registerControl = /**\n * Registers a control with the group's list of controls.\n *\n * This method does not update the value or validity of the control, so for most cases you'll want\n * to use {\\@link FormGroup#addControl addControl} instead.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n if (this.controls[name])\n return this.controls[name];\n this.controls[name] = control;\n control.setParent(this);\n control._registerOnCollectionChange(this._onCollectionChange);\n return control;\n };\n /**\n * Add a control to this group.\n */\n /**\n * Add a control to this group.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.addControl = /**\n * Add a control to this group.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n this.registerControl(name, control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Remove a control from this group.\n */\n /**\n * Remove a control from this group.\n * @param {?} name\n * @return {?}\n */\n FormGroup.prototype.removeControl = /**\n * Remove a control from this group.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.controls[name])\n this.controls[name]._registerOnCollectionChange(function () { });\n delete (this.controls[name]);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Replace an existing control.\n */\n /**\n * Replace an existing control.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n FormGroup.prototype.setControl = /**\n * Replace an existing control.\n * @param {?} name\n * @param {?} control\n * @return {?}\n */\n function (name, control) {\n if (this.controls[name])\n this.controls[name]._registerOnCollectionChange(function () { });\n delete (this.controls[name]);\n if (control)\n this.registerControl(name, control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {@link AbstractControl#get get} instead.\n */\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {\\@link AbstractControl#get get} instead.\n * @param {?} controlName\n * @return {?}\n */\n FormGroup.prototype.contains = /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * It will return false for disabled controls. If you'd like to check for existence in the group\n * only, use {\\@link AbstractControl#get get} instead.\n * @param {?} controlName\n * @return {?}\n */\n function (controlName) {\n return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;\n };\n /**\n * Sets the value of the {@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n */\n /**\n * Sets the value of the {\\@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.setValue = /**\n * Sets the value of the {\\@link FormGroup}. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this._checkAllValuesPresent(value);\n Object.keys(value).forEach(function (name) {\n _this._throwIfControlMissing(name);\n _this.controls[name].setValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of the {@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n */\n /**\n * Patches the value of the {\\@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.patchValue = /**\n * Patches the value of the {\\@link FormGroup}. It accepts an object with control\n * names as keys, and will do its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * ### Example\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n *\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n Object.keys(value).forEach(function (name) {\n if (_this.controls[name]) {\n _this.controls[name].patchValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n }\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Resets the {@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the {\\@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n FormGroup.prototype.reset = /**\n * Resets the {\\@link FormGroup}. This means by default:\n *\n * * The group and all descendants are marked `pristine`\n * * The group and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * can be a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * ### Example\n *\n * ```ts\n * this.form.reset({first: 'name', last: 'last name'});\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * - OR -\n *\n * ```\n * this.form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(this.form.value); // {first: 'name', last: 'last name'}\n * console.log(this.form.get('first').status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (value === void 0) { value = {}; }\n if (options === void 0) { options = {}; }\n this._forEachChild(function (control, name) {\n control.reset(value[name], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n this._updatePristine(options);\n this._updateTouched(options);\n };\n /**\n * The aggregate value of the {@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n */\n /**\n * The aggregate value of the {\\@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n * @return {?}\n */\n FormGroup.prototype.getRawValue = /**\n * The aggregate value of the {\\@link FormGroup}, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the group.\n * @return {?}\n */\n function () {\n return this._reduceChildren({}, function (acc, control, name) {\n acc[name] = control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();\n return acc;\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var /** @type {?} */ subtreeUpdated = this._reduceChildren(false, function (updated, child) {\n return child._syncPendingControls() ? true : updated;\n });\n if (subtreeUpdated)\n this.updateValueAndValidity({ onlySelf: true });\n return subtreeUpdated;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} name\n * @return {?}\n */\n FormGroup.prototype._throwIfControlMissing = /**\n * \\@internal\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (!Object.keys(this.controls).length) {\n throw new Error(\"\\n There are no form controls registered with this group yet. If you're using ngModel,\\n you may want to check next tick (e.g. use setTimeout).\\n \");\n }\n if (!this.controls[name]) {\n throw new Error(\"Cannot find form control with name: \" + name + \".\");\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormGroup.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) {\n var _this = this;\n Object.keys(this.controls).forEach(function (k) { return cb(_this.controls[k], k); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._setUpControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this._forEachChild(function (control) {\n control.setParent(_this);\n control._registerOnCollectionChange(_this._onCollectionChange);\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () { (/** @type {?} */ (this)).value = this._reduceValue(); };\n /** @internal */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormGroup.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n var _this = this;\n var /** @type {?} */ res = false;\n this._forEachChild(function (control, name) {\n res = res || (_this.contains(name) && condition(control));\n });\n return res;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._reduceValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n return this._reduceChildren({}, function (acc, control, name) {\n if (control.enabled || _this.disabled) {\n acc[name] = control.value;\n }\n return acc;\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} initValue\n * @param {?} fn\n * @return {?}\n */\n FormGroup.prototype._reduceChildren = /**\n * \\@internal\n * @param {?} initValue\n * @param {?} fn\n * @return {?}\n */\n function (initValue, fn) {\n var /** @type {?} */ res = initValue;\n this._forEachChild(function (control, name) { res = fn(res, control, name); });\n return res;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroup.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () {\n for (var _i = 0, _a = Object.keys(this.controls); _i < _a.length; _i++) {\n var controlName = _a[_i];\n if (this.controls[controlName].enabled) {\n return false;\n }\n }\n return Object.keys(this.controls).length > 0 || this.disabled;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n FormGroup.prototype._checkAllValuesPresent = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._forEachChild(function (control, name) {\n if (value[name] === undefined) {\n throw new Error(\"Must supply a value for form control with name: '\" + name + \"'.\");\n }\n });\n };\n return FormGroup;\n}(AbstractControl));\n/**\n * \\@whatItDoes Tracks the value and validity state of an array of {\\@link FormControl},\n * {\\@link FormGroup} or {\\@link FormArray} instances.\n *\n * A `FormArray` aggregates the values of each child {\\@link FormControl} into an array.\n * It calculates its status by reducing the statuses of its children. For example, if one of\n * the controls in a `FormArray` is invalid, the entire array becomes invalid.\n *\n * `FormArray` is one of the three fundamental building blocks used to define forms in Angular,\n * along with {\\@link FormControl} and {\\@link FormGroup}.\n *\n * \\@howToUse\n *\n * When instantiating a {\\@link FormArray}, pass in an array of child controls as the first\n * argument.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl('Nancy', Validators.minLength(2)),\n * new FormControl('Drew'),\n * ]);\n *\n * console.log(arr.value); // ['Nancy', 'Drew']\n * console.log(arr.status); // 'VALID'\n * ```\n *\n * You can also include array-level validators and async validators. These come in handy\n * when you want to perform validation that considers the value of more than one child\n * control.\n *\n * The two types of validators can be passed in separately as the second and third arg\n * respectively, or together as part of an options object.\n *\n * ```\n * const arr = new FormArray([\n * new FormControl('Nancy'),\n * new FormControl('Drew')\n * ], {validators: myValidator, asyncValidators: myAsyncValidator});\n * ```\n *\n * The options object can also be used to set a default value for each child\n * control's `updateOn` property. If you set `updateOn` to `'blur'` at the\n * array level, all child controls will default to 'blur', unless the child\n * has explicitly specified a different `updateOn` value.\n *\n * ```ts\n * const c = new FormArray([\n * new FormControl()\n * ], {updateOn: 'blur'});\n * ```\n *\n * ### Adding or removing controls\n *\n * To change the controls in the array, use the `push`, `insert`, or `removeAt` methods\n * in `FormArray` itself. These methods ensure the controls are properly tracked in the\n * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate\n * the `FormArray` directly, as that will result in strange and unexpected behavior such\n * as broken change detection.\n *\n * * **npm package**: `\\@angular/forms`\n *\n * \\@stable\n */\nvar FormArray = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormArray, _super);\n function FormArray(controls, validatorOrOpts, asyncValidator) {\n var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;\n _this.controls = controls;\n _this._initObservables();\n _this._setUpdateStrategy(validatorOrOpts);\n _this._setUpControls();\n _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n return _this;\n }\n /**\n * Get the {@link AbstractControl} at the given `index` in the array.\n */\n /**\n * Get the {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype.at = /**\n * Get the {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n function (index) { return this.controls[index]; };\n /**\n * Insert a new {@link AbstractControl} at the end of the array.\n */\n /**\n * Insert a new {\\@link AbstractControl} at the end of the array.\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.push = /**\n * Insert a new {\\@link AbstractControl} at the end of the array.\n * @param {?} control\n * @return {?}\n */\n function (control) {\n this.controls.push(control);\n this._registerControl(control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Insert a new {@link AbstractControl} at the given `index` in the array.\n */\n /**\n * Insert a new {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.insert = /**\n * Insert a new {\\@link AbstractControl} at the given `index` in the array.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n function (index, control) {\n this.controls.splice(index, 0, control);\n this._registerControl(control);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Remove the control at the given `index` in the array.\n */\n /**\n * Remove the control at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype.removeAt = /**\n * Remove the control at the given `index` in the array.\n * @param {?} index\n * @return {?}\n */\n function (index) {\n if (this.controls[index])\n this.controls[index]._registerOnCollectionChange(function () { });\n this.controls.splice(index, 1);\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n /**\n * Replace an existing control.\n */\n /**\n * Replace an existing control.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype.setControl = /**\n * Replace an existing control.\n * @param {?} index\n * @param {?} control\n * @return {?}\n */\n function (index, control) {\n if (this.controls[index])\n this.controls[index]._registerOnCollectionChange(function () { });\n this.controls.splice(index, 1);\n if (control) {\n this.controls.splice(index, 0, control);\n this._registerControl(control);\n }\n this.updateValueAndValidity();\n this._onCollectionChange();\n };\n Object.defineProperty(FormArray.prototype, \"length\", {\n /**\n * Length of the control array.\n */\n get: /**\n * Length of the control array.\n * @return {?}\n */\n function () { return this.controls.length; },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets the value of the {@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n */\n /**\n * Sets the value of the {\\@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.setValue = /**\n * Sets the value of the {\\@link FormArray}. It accepts an array that matches\n * the structure of the control.\n *\n * This method performs strict checks, so it will throw an error if you try\n * to set the value of a control that doesn't exist or if you exclude the\n * value of a control.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.setValue(['Nancy', 'Drew']);\n * console.log(arr.value); // ['Nancy', 'Drew']\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this._checkAllValuesPresent(value);\n value.forEach(function (newValue, index) {\n _this._throwIfControlMissing(index);\n _this.at(index).setValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Patches the value of the {@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n */\n /**\n * Patches the value of the {\\@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.patchValue = /**\n * Patches the value of the {\\@link FormArray}. It accepts an array that matches the\n * structure of the control, and will do its best to match the values to the correct\n * controls in the group.\n *\n * It accepts both super-sets and sub-sets of the array without throwing an error.\n *\n * ### Example\n *\n * ```\n * const arr = new FormArray([\n * new FormControl(),\n * new FormControl()\n * ]);\n * console.log(arr.value); // [null, null]\n *\n * arr.patchValue(['Nancy']);\n * console.log(arr.value); // ['Nancy', null]\n * ```\n * @param {?} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n value.forEach(function (newValue, index) {\n if (_this.at(index)) {\n _this.at(index).patchValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });\n }\n });\n this.updateValueAndValidity(options);\n };\n /**\n * Resets the {@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n */\n /**\n * Resets the {\\@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n FormArray.prototype.reset = /**\n * Resets the {\\@link FormArray}. This means by default:\n *\n * * The array and all descendants are marked `pristine`\n * * The array and all descendants are marked `untouched`\n * * The value of all descendants will be null or null maps\n *\n * You can also reset to a specific form state by passing in an array of states\n * that matches the structure of the control. The state can be a standalone value\n * or a form state object with both a value and a disabled status.\n *\n * ### Example\n *\n * ```ts\n * this.arr.reset(['name', 'last name']);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * ```\n *\n * - OR -\n *\n * ```\n * this.arr.reset([\n * {value: 'name', disabled: true},\n * 'last'\n * ]);\n *\n * console.log(this.arr.value); // ['name', 'last name']\n * console.log(this.arr.get(0).status); // 'DISABLED'\n * ```\n * @param {?=} value\n * @param {?=} options\n * @return {?}\n */\n function (value, options) {\n if (value === void 0) { value = []; }\n if (options === void 0) { options = {}; }\n this._forEachChild(function (control, index) {\n control.reset(value[index], { onlySelf: true, emitEvent: options.emitEvent });\n });\n this.updateValueAndValidity(options);\n this._updatePristine(options);\n this._updateTouched(options);\n };\n /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n */\n /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n * @return {?}\n */\n FormArray.prototype.getRawValue = /**\n * The aggregate value of the array, including any disabled controls.\n *\n * If you'd like to include all values regardless of disabled status, use this method.\n * Otherwise, the `value` property is the best way to get the value of the array.\n * @return {?}\n */\n function () {\n return this.controls.map(function (control) {\n return control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._syncPendingControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var /** @type {?} */ subtreeUpdated = this.controls.reduce(function (updated, child) {\n return child._syncPendingControls() ? true : updated;\n }, false);\n if (subtreeUpdated)\n this.updateValueAndValidity({ onlySelf: true });\n return subtreeUpdated;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} index\n * @return {?}\n */\n FormArray.prototype._throwIfControlMissing = /**\n * \\@internal\n * @param {?} index\n * @return {?}\n */\n function (index) {\n if (!this.controls.length) {\n throw new Error(\"\\n There are no form controls registered with this array yet. If you're using ngModel,\\n you may want to check next tick (e.g. use setTimeout).\\n \");\n }\n if (!this.at(index)) {\n throw new Error(\"Cannot find form control at index \" + index);\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n FormArray.prototype._forEachChild = /**\n * \\@internal\n * @param {?} cb\n * @return {?}\n */\n function (cb) {\n this.controls.forEach(function (control, index) { cb(control, index); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._updateValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n (/** @type {?} */ (this)).value =\n this.controls.filter(function (control) { return control.enabled || _this.disabled; })\n .map(function (control) { return control.value; });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n FormArray.prototype._anyControls = /**\n * \\@internal\n * @param {?} condition\n * @return {?}\n */\n function (condition) {\n return this.controls.some(function (control) { return control.enabled && condition(control); });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._setUpControls = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this._forEachChild(function (control) { return _this._registerControl(control); });\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n FormArray.prototype._checkAllValuesPresent = /**\n * \\@internal\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._forEachChild(function (control, i) {\n if (value[i] === undefined) {\n throw new Error(\"Must supply a value for form control at index: \" + i + \".\");\n }\n });\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormArray.prototype._allControlsDisabled = /**\n * \\@internal\n * @return {?}\n */\n function () {\n for (var _i = 0, _a = this.controls; _i < _a.length; _i++) {\n var control = _a[_i];\n if (control.enabled)\n return false;\n }\n return this.controls.length > 0 || this.disabled;\n };\n /**\n * @param {?} control\n * @return {?}\n */\n FormArray.prototype._registerControl = /**\n * @param {?} control\n * @return {?}\n */\n function (control) {\n control.setParent(this);\n control._registerOnCollectionChange(this._onCollectionChange);\n };\n return FormArray;\n}(AbstractControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formDirectiveProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgForm; })\n};\nvar resolvedPromise = Promise.resolve(null);\n/**\n * \\@whatItDoes Creates a top-level {\\@link FormGroup} instance and binds it to a form\n * to track aggregate form value and validation status.\n *\n * \\@howToUse\n *\n * As soon as you import the `FormsModule`, this directive becomes active by default on\n * all `<form>` tags. You don't need to add a special selector.\n *\n * You can export the directive into a local template variable using `ngForm` as the key\n * (ex: `#myForm=\"ngForm\"`). This is optional, but useful. Many properties from the underlying\n * {\\@link FormGroup} instance are duplicated on the directive itself, so a reference to it\n * will give you access to the aggregate value and validity status of the form, as well as\n * user interaction properties like `dirty` and `touched`.\n *\n * To register child controls with the form, you'll want to use {\\@link NgModel} with a\n * `name` attribute. You can also use {\\@link NgModelGroup} if you'd like to create\n * sub-groups within the form.\n *\n * You can listen to the directive's `ngSubmit` event to be notified when the user has\n * triggered a form submission. The `ngSubmit` event will be emitted with the original form\n * submission event.\n *\n * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`.\n * If you want to import the `FormsModule` but skip its usage in some forms,\n * for example, to use native HTML5 validation, you can add `ngNoForm` and the `<form>`\n * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is\n * unnecessary because the `<form>` tags are inert. In that case, you would\n * refrain from using the `formGroup` directive.\n *\n * {\\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgForm = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgForm, _super);\n function NgForm(validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this.submitted = false;\n _this._directives = [];\n _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this.form =\n new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));\n return _this;\n }\n /**\n * @return {?}\n */\n NgForm.prototype.ngAfterViewInit = /**\n * @return {?}\n */\n function () { this._setUpdateStrategy(); };\n Object.defineProperty(NgForm.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgForm.prototype, \"controls\", {\n get: /**\n * @return {?}\n */\n function () { return this.form.controls; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.addControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n (/** @type {?} */ (dir)).control = /** @type {?} */ (container.registerControl(dir.name, dir.control));\n setUpControl(dir.control, dir);\n dir.control.updateValueAndValidity({ emitEvent: false });\n _this._directives.push(dir);\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.getControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.removeControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n removeDir(_this._directives, dir);\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.addFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n var /** @type {?} */ group = new FormGroup({});\n setUpFormContainer(group, dir);\n container.registerControl(dir.name, group);\n group.updateValueAndValidity({ emitEvent: false });\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.removeFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ container = _this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n NgForm.prototype.getFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n NgForm.prototype.updateModel = /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n function (dir, value) {\n var _this = this;\n resolvedPromise.then(function () {\n var /** @type {?} */ ctrl = /** @type {?} */ (_this.form.get(/** @type {?} */ ((dir.path))));\n ctrl.setValue(value);\n });\n };\n /**\n * @param {?} value\n * @return {?}\n */\n NgForm.prototype.setValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) { this.control.setValue(value); };\n /**\n * @param {?} $event\n * @return {?}\n */\n NgForm.prototype.onSubmit = /**\n * @param {?} $event\n * @return {?}\n */\n function ($event) {\n (/** @type {?} */ (this)).submitted = true;\n syncPendingControls(this.form, this._directives);\n this.ngSubmit.emit($event);\n return false;\n };\n /**\n * @return {?}\n */\n NgForm.prototype.onReset = /**\n * @return {?}\n */\n function () { this.resetForm(); };\n /**\n * @param {?=} value\n * @return {?}\n */\n NgForm.prototype.resetForm = /**\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n this.form.reset(value);\n (/** @type {?} */ (this)).submitted = false;\n };\n /**\n * @return {?}\n */\n NgForm.prototype._setUpdateStrategy = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.updateOn != null) {\n this.form._updateOn = this.options.updateOn;\n }\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} path\n * @return {?}\n */\n NgForm.prototype._findContainer = /**\n * \\@internal\n * @param {?} path\n * @return {?}\n */\n function (path) {\n path.pop();\n return path.length ? /** @type {?} */ (this.form.get(path)) : this.form;\n };\n NgForm.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',\n providers: [formDirectiveProvider],\n host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },\n outputs: ['ngSubmit'],\n exportAs: 'ngForm'\n },] },\n ];\n /** @nocollapse */\n NgForm.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n NgForm.propDecorators = {\n \"options\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngFormOptions',] },],\n };\n return NgForm;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar FormErrorExamples = {\n formControlName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <input formControlName=\\\"firstName\\\">\\n </div>\\n\\n In your class:\\n\\n this.myGroup = new FormGroup({\\n firstName: new FormControl()\\n });\",\n formGroupName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <div formGroupName=\\\"person\\\">\\n <input formControlName=\\\"firstName\\\">\\n </div>\\n </div>\\n\\n In your class:\\n\\n this.myGroup = new FormGroup({\\n person: new FormGroup({ firstName: new FormControl() })\\n });\",\n formArrayName: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <div formArrayName=\\\"cities\\\">\\n <div *ngFor=\\\"let city of cityArray.controls; index as i\\\">\\n <input [formControlName]=\\\"i\\\">\\n </div>\\n </div>\\n </div>\\n\\n In your class:\\n\\n this.cityArray = new FormArray([new FormControl('SF')]);\\n this.myGroup = new FormGroup({\\n cities: this.cityArray\\n });\",\n ngModelGroup: \"\\n <form>\\n <div ngModelGroup=\\\"person\\\">\\n <input [(ngModel)]=\\\"person.name\\\" name=\\\"firstName\\\">\\n </div>\\n </form>\",\n ngModelWithFormGroup: \"\\n <div [formGroup]=\\\"myGroup\\\">\\n <input formControlName=\\\"firstName\\\">\\n <input [(ngModel)]=\\\"showMoreControls\\\" [ngModelOptions]=\\\"{standalone: true}\\\">\\n </div>\\n \"\n};\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar TemplateDrivenErrors = /** @class */ (function () {\n function TemplateDrivenErrors() {\n }\n /**\n * @return {?}\n */\n TemplateDrivenErrors.modelParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\\n formGroup's partner directive \\\"formControlName\\\" instead. Example:\\n\\n \" + FormErrorExamples.formControlName + \"\\n\\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\\n\\n Example:\\n\\n \" + FormErrorExamples.ngModelWithFormGroup);\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.formGroupNameException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\\n\\n Option 1: Use formControlName instead of ngModel (reactive strategy):\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.missingNameException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"If ngModel is used within a form tag, either the name attribute must be set or the form\\n control must be defined as 'standalone' in ngModelOptions.\\n\\n Example 1: <input [(ngModel)]=\\\"person.firstName\\\" name=\\\"first\\\">\\n Example 2: <input [(ngModel)]=\\\"person.firstName\\\" [ngModelOptions]=\\\"{standalone: true}\\\">\");\n };\n /**\n * @return {?}\n */\n TemplateDrivenErrors.modelGroupParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"\\n ngModelGroup cannot be used with a parent formGroup directive.\\n\\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n return TemplateDrivenErrors;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar modelGroupProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgModelGroup; })\n};\n/**\n * \\@whatItDoes Creates and binds a {\\@link FormGroup} instance to a DOM element.\n *\n * \\@howToUse\n *\n * This directive can only be used as a child of {\\@link NgForm} (or in other words,\n * within `<form>` tags).\n *\n * Use this directive if you'd like to create a sub-group within a form. This can\n * come in handy if you want to validate a sub-group of your form separately from\n * the rest of your form, or if some values in your domain model make more sense to\n * consume together in a nested object.\n *\n * Pass in the name you'd like this sub-group to have and it will become the key\n * for the sub-group in the form's full value. You can also export the directive into\n * a local template variable using `ngModelGroup` (ex: `#myGroup=\"ngModelGroup\"`).\n *\n * {\\@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgModelGroup = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgModelGroup, _super);\n function NgModelGroup(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n NgModelGroup.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {\n TemplateDrivenErrors.modelGroupParentException();\n }\n };\n NgModelGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup' },] },\n ];\n /** @nocollapse */\n NgModelGroup.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n NgModelGroup.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModelGroup',] },],\n };\n return NgModelGroup;\n}(AbstractFormGroupDirective));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formControlBinding = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return NgModel; })\n};\n/**\n * `ngModel` forces an additional change detection run when its inputs change:\n * E.g.:\n * ```\n * <div>{{myModel.valid}}</div>\n * <input [(ngModel)]=\"myValue\" #myModel=\"ngModel\">\n * ```\n * I.e. `ngModel` can export itself on the element and then be used in the template.\n * Normally, this would result in expressions before the `input` that use the exported directive\n * to have and old value as they have been\n * dirty checked before. As this is a very common case for `ngModel`, we added this second change\n * detection run.\n *\n * Notes:\n * - this is just one extra run no matter how many `ngModel` have been changed.\n * - this is a general problem when using `exportAs` for directives!\n */\nvar resolvedPromise$1 = Promise.resolve(null);\n/**\n * \\@whatItDoes Creates a {\\@link FormControl} instance from a domain model and binds it\n * to a form control element.\n *\n * The {\\@link FormControl} instance will track the value, user interaction, and\n * validation status of the control and keep the view synced with the model. If used\n * within a parent form, the directive will also register itself with the form as a child\n * control.\n *\n * \\@howToUse\n *\n * This directive can be used by itself or as part of a larger form. All you need is the\n * `ngModel` selector to activate it.\n *\n * It accepts a domain model as an optional {\\@link Input}. If you have a one-way binding\n * to `ngModel` with `[]` syntax, changing the value of the domain model in the component\n * class will set the value in the view. If you have a two-way binding with `[()]` syntax\n * (also known as 'banana-box syntax'), the value in the UI will always be synced back to\n * the domain model in your class as well.\n *\n * If you wish to inspect the properties of the associated {\\@link FormControl} (like\n * validity state), you can also export the directive into a local template variable using\n * `ngModel` as the key (ex: `#myVar=\"ngModel\"`). You can then access the control using the\n * directive's `control` property, but most properties you'll need (like `valid` and `dirty`)\n * will fall through to the control anyway, so you can access them directly. You can see a\n * full list of properties directly available in {\\@link AbstractControlDirective}.\n *\n * The following is an example of a simple standalone control using `ngModel`:\n *\n * {\\@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}\n *\n * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute\n * so that the control can be registered with the parent form under that name.\n *\n * It's worth noting that in the context of a parent form, you often can skip one-way or\n * two-way binding because the parent form will sync the value for you. You can access\n * its properties by exporting it into a local template variable using `ngForm` (ex:\n * `#f=\"ngForm\"`). Then you can pass it where it needs to go on submit.\n *\n * If you do need to populate initial values into your form, using a one-way binding for\n * `ngModel` tends to be sufficient as long as you use the exported form's value rather\n * than the domain model's value on submit.\n *\n * Take a look at an example of using `ngModel` within a form:\n *\n * {\\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * To see `ngModel` examples with different form control types, see:\n *\n * * Radio buttons: {\\@link RadioControlValueAccessor}\n * * Selects: {\\@link SelectControlValueAccessor}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: `FormsModule`\n *\n * \\@stable\n */\nvar NgModel = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(NgModel, _super);\n function NgModel(parent, validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this.control = new FormControl();\n /**\n * \\@internal\n */\n _this._registered = false;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._parent = parent;\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n NgModel.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._checkForErrors();\n if (!this._registered)\n this._setUpControl();\n if ('isDisabled' in changes) {\n this._updateDisabled(changes);\n }\n if (isPropertyUpdated(changes, this.viewModel)) {\n this._updateValue(this.model);\n this.viewModel = this.model;\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.formDirective && this.formDirective.removeControl(this); };\n Object.defineProperty(NgModel.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._parent ? controlPath(this.name, this._parent) : [this.name];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgModel.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._rawAsyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} newValue\n * @return {?}\n */\n NgModel.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpControl = /**\n * @return {?}\n */\n function () {\n this._setUpdateStrategy();\n this._isStandalone() ? this._setUpStandalone() :\n this.formDirective.addControl(this);\n this._registered = true;\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpdateStrategy = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.updateOn != null) {\n this.control._updateOn = this.options.updateOn;\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype._isStandalone = /**\n * @return {?}\n */\n function () {\n return !this._parent || !!(this.options && this.options.standalone);\n };\n /**\n * @return {?}\n */\n NgModel.prototype._setUpStandalone = /**\n * @return {?}\n */\n function () {\n setUpControl(this.control, this);\n this.control.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkForErrors = /**\n * @return {?}\n */\n function () {\n if (!this._isStandalone()) {\n this._checkParentType();\n }\n this._checkName();\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof NgModelGroup) &&\n this._parent instanceof AbstractFormGroupDirective) {\n TemplateDrivenErrors.formGroupNameException();\n }\n else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {\n TemplateDrivenErrors.modelParentException();\n }\n };\n /**\n * @return {?}\n */\n NgModel.prototype._checkName = /**\n * @return {?}\n */\n function () {\n if (this.options && this.options.name)\n this.name = this.options.name;\n if (!this._isStandalone() && !this.name) {\n TemplateDrivenErrors.missingNameException();\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n NgModel.prototype._updateValue = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n var _this = this;\n resolvedPromise$1.then(function () { _this.control.setValue(value, { emitViewToModelChange: false }); });\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n NgModel.prototype._updateDisabled = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n var _this = this;\n var /** @type {?} */ disabledValue = changes['isDisabled'].currentValue;\n var /** @type {?} */ isDisabled = disabledValue === '' || (disabledValue && disabledValue !== 'false');\n resolvedPromise$1.then(function () {\n if (isDisabled && !_this.control.disabled) {\n _this.control.disable();\n }\n else if (!isDisabled && _this.control.disabled) {\n _this.control.enable();\n }\n });\n };\n NgModel.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[ngModel]:not([formControlName]):not([formControl])',\n providers: [formControlBinding],\n exportAs: 'ngModel'\n },] },\n ];\n /** @nocollapse */\n NgModel.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n NgModel.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"options\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModelOptions',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n };\n return NgModel;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ReactiveErrors = /** @class */ (function () {\n function ReactiveErrors() {\n }\n /**\n * @return {?}\n */\n ReactiveErrors.controlParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formControlName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.ngModelGroupException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\\n that also have a \\\"form\\\" prefix: formGroupName, formArrayName, or formGroup.\\n\\n Option 1: Update the parent to be formGroupName (reactive form strategy)\\n\\n \" + FormErrorExamples.formGroupName + \"\\n\\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\\n\\n \" + FormErrorExamples.ngModelGroup);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.missingFormException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formGroup expects a FormGroup instance. Please pass one in.\\n\\n Example:\\n\\n \" + FormErrorExamples.formControlName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.groupParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formGroupName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.arrayParentException = /**\n * @return {?}\n */\n function () {\n throw new Error(\"formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\\n directive and pass it an existing FormGroup instance (you can create one in your class).\\n\\n Example:\\n\\n \" + FormErrorExamples.formArrayName);\n };\n /**\n * @return {?}\n */\n ReactiveErrors.disabledAttrWarning = /**\n * @return {?}\n */\n function () {\n console.warn(\"\\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\\n you. We recommend using this approach to avoid 'changed after checked' errors.\\n \\n Example: \\n form = new FormGroup({\\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\\n last: new FormControl('Drew', Validators.required)\\n });\\n \");\n };\n return ReactiveErrors;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formControlBinding$1 = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormControlDirective; })\n};\n/**\n * \\@whatItDoes Syncs a standalone {\\@link FormControl} instance to a form control element.\n *\n * In other words, this directive ensures that any values written to the {\\@link FormControl}\n * instance programmatically will be written to the DOM element (model -> view). Conversely,\n * any values written to the DOM element through user input will be reflected in the\n * {\\@link FormControl} instance (view -> model).\n *\n * \\@howToUse\n *\n * Use this directive if you'd like to create and manage a {\\@link FormControl} instance directly.\n * Simply create a {\\@link FormControl}, save it to your component class, and pass it into the\n * {\\@link FormControlDirective}.\n *\n * This directive is designed to be used as a standalone control. Unlike {\\@link FormControlName},\n * it does not require that your {\\@link FormControl} instance be part of any parent\n * {\\@link FormGroup}, and it won't be registered to any {\\@link FormGroupDirective} that\n * exists above it.\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormControl} instance. See a full list of available properties in\n * {\\@link AbstractControl}.\n *\n * **Set the value**: You can pass in an initial value when instantiating the {\\@link FormControl},\n * or you can set it programmatically later using {\\@link AbstractControl#setValue setValue} or\n * {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the control, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * {\\@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormControlDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControlDirective, _super);\n function FormControlDirective(validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n Object.defineProperty(FormControlDirective.prototype, \"isDisabled\", {\n set: /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlDirective.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if (this._isControlChanged(changes)) {\n setUpControl(this.form, this);\n if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {\n /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);\n }\n this.form.updateValueAndValidity({ emitEvent: false });\n }\n if (isPropertyUpdated(changes, this.viewModel)) {\n this.form.setValue(this.model);\n this.viewModel = this.model;\n }\n };\n Object.defineProperty(FormControlDirective.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._rawAsyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlDirective.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} newValue\n * @return {?}\n */\n FormControlDirective.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlDirective.prototype._isControlChanged = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n return changes.hasOwnProperty('form');\n };\n FormControlDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControl]', providers: [formControlBinding$1], exportAs: 'ngForm' },] },\n ];\n /** @nocollapse */\n FormControlDirective.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n FormControlDirective.propDecorators = {\n \"form\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formControl',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return FormControlDirective;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formDirectiveProvider$1 = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormGroupDirective; })\n};\n/**\n * \\@whatItDoes Binds an existing {\\@link FormGroup} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive accepts an existing {\\@link FormGroup} instance. It will then use this\n * {\\@link FormGroup} instance to match any child {\\@link FormControl}, {\\@link FormGroup},\n * and {\\@link FormArray} instances to child {\\@link FormControlName}, {\\@link FormGroupName},\n * and {\\@link FormArrayName} directives.\n *\n * **Set value**: You can set the form's initial value when instantiating the\n * {\\@link FormGroup}, or you can set it programmatically later using the {\\@link FormGroup}'s\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}\n * methods.\n *\n * **Listen to value**: If you want to listen to changes in the value of the form, you can subscribe\n * to the {\\@link FormGroup}'s {\\@link AbstractControl#valueChanges valueChanges} event. You can also\n * listen to its {\\@link AbstractControl#statusChanges statusChanges} event to be notified when the\n * validation status is re-calculated.\n *\n * Furthermore, you can listen to the directive's `ngSubmit` event to be notified when the user has\n * triggered a form submission. The `ngSubmit` event will be emitted with the original form\n * submission event.\n *\n * ### Example\n *\n * In this example, we create form controls for first name and last name.\n *\n * {\\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormGroupDirective = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroupDirective, _super);\n function FormGroupDirective(_validators, _asyncValidators) {\n var _this = _super.call(this) || this;\n _this._validators = _validators;\n _this._asyncValidators = _asyncValidators;\n _this.submitted = false;\n _this.directives = [];\n _this.form = /** @type {?} */ ((null));\n _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n return _this;\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n FormGroupDirective.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n this._checkFormPresent();\n if (changes.hasOwnProperty('form')) {\n this._updateValidators();\n this._updateDomValue();\n this._updateRegistrations();\n }\n };\n Object.defineProperty(FormGroupDirective.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormGroupDirective.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return this.form; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormGroupDirective.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return []; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpControl(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n this.directives.push(dir);\n return ctrl;\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeControl = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { removeDir(this.directives, dir); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpFormContainer(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getFormGroup = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.addFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) {\n var /** @type {?} */ ctrl = this.form.get(dir.path);\n setUpFormContainer(ctrl, dir);\n ctrl.updateValueAndValidity({ emitEvent: false });\n };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.removeFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { };\n /**\n * @param {?} dir\n * @return {?}\n */\n FormGroupDirective.prototype.getFormArray = /**\n * @param {?} dir\n * @return {?}\n */\n function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };\n /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n FormGroupDirective.prototype.updateModel = /**\n * @param {?} dir\n * @param {?} value\n * @return {?}\n */\n function (dir, value) {\n var /** @type {?} */ ctrl = /** @type {?} */ (this.form.get(dir.path));\n ctrl.setValue(value);\n };\n /**\n * @param {?} $event\n * @return {?}\n */\n FormGroupDirective.prototype.onSubmit = /**\n * @param {?} $event\n * @return {?}\n */\n function ($event) {\n (/** @type {?} */ (this)).submitted = true;\n syncPendingControls(this.form, this.directives);\n this.ngSubmit.emit($event);\n return false;\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype.onReset = /**\n * @return {?}\n */\n function () { this.resetForm(); };\n /**\n * @param {?=} value\n * @return {?}\n */\n FormGroupDirective.prototype.resetForm = /**\n * @param {?=} value\n * @return {?}\n */\n function (value) {\n if (value === void 0) { value = undefined; }\n this.form.reset(value);\n (/** @type {?} */ (this)).submitted = false;\n };\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroupDirective.prototype._updateDomValue = /**\n * \\@internal\n * @return {?}\n */\n function () {\n var _this = this;\n this.directives.forEach(function (dir) {\n var /** @type {?} */ newCtrl = _this.form.get(dir.path);\n if (dir.control !== newCtrl) {\n cleanUpControl(dir.control, dir);\n if (newCtrl)\n setUpControl(newCtrl, dir);\n (/** @type {?} */ (dir)).control = newCtrl;\n }\n });\n this.form._updateTreeValidity({ emitEvent: false });\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._updateRegistrations = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.form._registerOnCollectionChange(function () { return _this._updateDomValue(); });\n if (this._oldForm)\n this._oldForm._registerOnCollectionChange(function () { });\n this._oldForm = this.form;\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._updateValidators = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ sync = composeValidators(this._validators);\n this.form.validator = Validators.compose([/** @type {?} */ ((this.form.validator)), /** @type {?} */ ((sync))]);\n var /** @type {?} */ async = composeAsyncValidators(this._asyncValidators);\n this.form.asyncValidator = Validators.composeAsync([/** @type {?} */ ((this.form.asyncValidator)), /** @type {?} */ ((async))]);\n };\n /**\n * @return {?}\n */\n FormGroupDirective.prototype._checkFormPresent = /**\n * @return {?}\n */\n function () {\n if (!this.form) {\n ReactiveErrors.missingFormException();\n }\n };\n FormGroupDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[formGroup]',\n providers: [formDirectiveProvider$1],\n host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },\n exportAs: 'ngForm'\n },] },\n ];\n /** @nocollapse */\n FormGroupDirective.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormGroupDirective.propDecorators = {\n \"form\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formGroup',] },],\n \"ngSubmit\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"] },],\n };\n return FormGroupDirective;\n}(ControlContainer));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar formGroupNameProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormGroupName; })\n};\n/**\n * \\@whatItDoes Syncs a nested {\\@link FormGroup} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive can only be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the nested {\\@link FormGroup} you want to link, and\n * will look for a {\\@link FormGroup} registered with that name in the parent\n * {\\@link FormGroup} instance you passed into {\\@link FormGroupDirective}.\n *\n * Nested form groups can come in handy when you want to validate a sub-group of a\n * form separately from the rest or when you'd like to group the values of certain\n * controls into their own nested object.\n *\n * **Access the group**: You can access the associated {\\@link FormGroup} using the\n * {\\@link AbstractControl#get get} method. Ex: `this.form.get('name')`.\n *\n * You can also access individual controls within the group using dot syntax.\n * Ex: `this.form.get('name.first')`\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormGroup}. See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set the value**: You can set an initial value for each child control when instantiating\n * the {\\@link FormGroup}, or you can set it programmatically later using\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the group, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * {\\@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormGroupName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormGroupName, _super);\n function FormGroupName(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /** @internal */\n /**\n * \\@internal\n * @return {?}\n */\n FormGroupName.prototype._checkParentType = /**\n * \\@internal\n * @return {?}\n */\n function () {\n if (_hasInvalidParent(this._parent)) {\n ReactiveErrors.groupParentException();\n }\n };\n FormGroupName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formGroupName]', providers: [formGroupNameProvider] },] },\n ];\n /** @nocollapse */\n FormGroupName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormGroupName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formGroupName',] },],\n };\n return FormGroupName;\n}(AbstractFormGroupDirective));\nvar formArrayNameProvider = {\n provide: ControlContainer,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormArrayName; })\n};\n/**\n * \\@whatItDoes Syncs a nested {\\@link FormArray} to a DOM element.\n *\n * \\@howToUse\n *\n * This directive is designed to be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the nested {\\@link FormArray} you want to link, and\n * will look for a {\\@link FormArray} registered with that name in the parent\n * {\\@link FormGroup} instance you passed into {\\@link FormGroupDirective}.\n *\n * Nested form arrays can come in handy when you have a group of form controls but\n * you're not sure how many there will be. Form arrays allow you to create new\n * form controls dynamically.\n *\n * **Access the array**: You can access the associated {\\@link FormArray} using the\n * {\\@link AbstractControl#get get} method on the parent {\\@link FormGroup}.\n * Ex: `this.form.get('cities')`.\n *\n * **Get the value**: the `value` property is always synced and available on the\n * {\\@link FormArray}. See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set the value**: You can set an initial value for each child control when instantiating\n * the {\\@link FormArray}, or you can set the value programmatically later using the\n * {\\@link FormArray}'s {\\@link AbstractControl#setValue setValue} or\n * {\\@link AbstractControl#patchValue patchValue} methods.\n *\n * **Listen to value**: If you want to listen to changes in the value of the array, you can\n * subscribe to the {\\@link FormArray}'s {\\@link AbstractControl#valueChanges valueChanges} event.\n * You can also listen to its {\\@link AbstractControl#statusChanges statusChanges} event to be\n * notified when the validation status is re-calculated.\n *\n * **Add new controls**: You can add new controls to the {\\@link FormArray} dynamically by calling\n * its {\\@link FormArray#push push} method.\n * Ex: `this.form.get('cities').push(new FormControl());`\n *\n * ### Example\n *\n * {\\@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: `ReactiveFormsModule`\n *\n * \\@stable\n */\nvar FormArrayName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormArrayName, _super);\n function FormArrayName(parent, validators, asyncValidators) {\n var _this = _super.call(this) || this;\n _this._parent = parent;\n _this._validators = validators;\n _this._asyncValidators = asyncValidators;\n return _this;\n }\n /**\n * @return {?}\n */\n FormArrayName.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n this._checkParentType(); /** @type {?} */\n ((this.formDirective)).addFormArray(this);\n };\n /**\n * @return {?}\n */\n FormArrayName.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeFormArray(this);\n }\n };\n Object.defineProperty(FormArrayName.prototype, \"control\", {\n get: /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((this.formDirective)).getFormArray(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._parent ? /** @type {?} */ (this._parent.formDirective) : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return controlPath(this.name, this._parent); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._validators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormArrayName.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return composeAsyncValidators(this._asyncValidators);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n FormArrayName.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (_hasInvalidParent(this._parent)) {\n ReactiveErrors.arrayParentException();\n }\n };\n FormArrayName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formArrayName]', providers: [formArrayNameProvider] },] },\n ];\n /** @nocollapse */\n FormArrayName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n ]; };\n FormArrayName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formArrayName',] },],\n };\n return FormArrayName;\n}(ControlContainer));\n/**\n * @param {?} parent\n * @return {?}\n */\nfunction _hasInvalidParent(parent) {\n return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) &&\n !(parent instanceof FormArrayName);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar controlNameBinding = {\n provide: NgControl,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return FormControlName; })\n};\n/**\n * \\@whatItDoes Syncs a {\\@link FormControl} in an existing {\\@link FormGroup} to a form control\n * element by name.\n *\n * In other words, this directive ensures that any values written to the {\\@link FormControl}\n * instance programmatically will be written to the DOM element (model -> view). Conversely,\n * any values written to the DOM element through user input will be reflected in the\n * {\\@link FormControl} instance (view -> model).\n *\n * \\@howToUse\n *\n * This directive is designed to be used with a parent {\\@link FormGroupDirective} (selector:\n * `[formGroup]`).\n *\n * It accepts the string name of the {\\@link FormControl} instance you want to\n * link, and will look for a {\\@link FormControl} registered with that name in the\n * closest {\\@link FormGroup} or {\\@link FormArray} above it.\n *\n * **Access the control**: You can access the {\\@link FormControl} associated with\n * this directive by using the {\\@link AbstractControl#get get} method.\n * Ex: `this.form.get('first');`\n *\n * **Get value**: the `value` property is always synced and available on the {\\@link FormControl}.\n * See a full list of available properties in {\\@link AbstractControl}.\n *\n * **Set value**: You can set an initial value for the control when instantiating the\n * {\\@link FormControl}, or you can set it programmatically later using\n * {\\@link AbstractControl#setValue setValue} or {\\@link AbstractControl#patchValue patchValue}.\n *\n * **Listen to value**: If you want to listen to changes in the value of the control, you can\n * subscribe to the {\\@link AbstractControl#valueChanges valueChanges} event. You can also listen to\n * {\\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is\n * re-calculated.\n *\n * ### Example\n *\n * In this example, we create form controls for first name and last name.\n *\n * {\\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}\n *\n * To see `formControlName` examples with different form control types, see:\n *\n * * Radio buttons: {\\@link RadioControlValueAccessor}\n * * Selects: {\\@link SelectControlValueAccessor}\n *\n * **npm package**: `\\@angular/forms`\n *\n * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormControlName = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(FormControlName, _super);\n function FormControlName(parent, validators, asyncValidators, valueAccessors) {\n var _this = _super.call(this) || this;\n _this._added = false;\n _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n _this._parent = parent;\n _this._rawValidators = validators || [];\n _this._rawAsyncValidators = asyncValidators || [];\n _this.valueAccessor = selectValueAccessor(_this, valueAccessors);\n return _this;\n }\n Object.defineProperty(FormControlName.prototype, \"isDisabled\", {\n set: /**\n * @param {?} isDisabled\n * @return {?}\n */\n function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n FormControlName.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if (!this._added)\n this._setUpControl();\n if (isPropertyUpdated(changes, this.viewModel)) {\n this.viewModel = this.model;\n this.formDirective.updateModel(this, this.model);\n }\n };\n /**\n * @return {?}\n */\n FormControlName.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n if (this.formDirective) {\n this.formDirective.removeControl(this);\n }\n };\n /**\n * @param {?} newValue\n * @return {?}\n */\n FormControlName.prototype.viewToModelUpdate = /**\n * @param {?} newValue\n * @return {?}\n */\n function (newValue) {\n this.viewModel = newValue;\n this.update.emit(newValue);\n };\n Object.defineProperty(FormControlName.prototype, \"path\", {\n get: /**\n * @return {?}\n */\n function () { return controlPath(this.name, /** @type {?} */ ((this._parent))); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"formDirective\", {\n get: /**\n * @return {?}\n */\n function () { return this._parent ? this._parent.formDirective : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"validator\", {\n get: /**\n * @return {?}\n */\n function () { return composeValidators(this._rawValidators); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FormControlName.prototype, \"asyncValidator\", {\n get: /**\n * @return {?}\n */\n function () {\n return /** @type {?} */ ((composeAsyncValidators(this._rawAsyncValidators)));\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n FormControlName.prototype._checkParentType = /**\n * @return {?}\n */\n function () {\n if (!(this._parent instanceof FormGroupName) &&\n this._parent instanceof AbstractFormGroupDirective) {\n ReactiveErrors.ngModelGroupException();\n }\n else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) &&\n !(this._parent instanceof FormArrayName)) {\n ReactiveErrors.controlParentException();\n }\n };\n /**\n * @return {?}\n */\n FormControlName.prototype._setUpControl = /**\n * @return {?}\n */\n function () {\n this._checkParentType();\n (/** @type {?} */ (this)).control = this.formDirective.addControl(this);\n if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {\n /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);\n }\n this._added = true;\n };\n FormControlName.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: '[formControlName]', providers: [controlNameBinding] },] },\n ];\n /** @nocollapse */\n FormControlName.ctorParameters = function () { return [\n { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Host\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_ASYNC_VALIDATORS,] },] },\n { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Self\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [NG_VALUE_ACCESSOR,] },] },\n ]; };\n FormControlName.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['formControlName',] },],\n \"model\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['ngModel',] },],\n \"update\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['ngModelChange',] },],\n \"isDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return FormControlName;\n}(NgControl));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An interface that can be implemented by classes that can act as validators.\n *\n * ## Usage\n *\n * ```typescript\n * \\@Directive({\n * selector: '[custom-validator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(c: Control): {[key: string]: any} {\n * return {\"custom\": true};\n * }\n * }\n * ```\n *\n * \\@stable\n * @record\n */\n\n/**\n * \\@experimental\n * @record\n */\n\nvar REQUIRED_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return RequiredValidator; }),\n multi: true\n};\nvar CHECKBOX_REQUIRED_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return CheckboxRequiredValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `required` validator to any controls marked with the\n * `required` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input name=\"fullName\" ngModel required>\n * ```\n *\n * \\@stable\n */\nvar RequiredValidator = /** @class */ (function () {\n function RequiredValidator() {\n }\n Object.defineProperty(RequiredValidator.prototype, \"required\", {\n get: /**\n * @return {?}\n */\n function () { return this._required; },\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._required = value != null && value !== false && \"\" + value !== 'false';\n if (this._onChange)\n this._onChange();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} c\n * @return {?}\n */\n RequiredValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.required ? Validators.required(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RequiredValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n RequiredValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',\n providers: [REQUIRED_VALIDATOR],\n host: { '[attr.required]': 'required ? \"\" : null' }\n },] },\n ];\n /** @nocollapse */\n RequiredValidator.ctorParameters = function () { return []; };\n RequiredValidator.propDecorators = {\n \"required\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RequiredValidator;\n}());\n/**\n * A Directive that adds the `required` validator to checkbox controls marked with the\n * `required` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input type=\"checkbox\" name=\"active\" ngModel required>\n * ```\n *\n * \\@experimental\n */\nvar CheckboxRequiredValidator = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __extends */])(CheckboxRequiredValidator, _super);\n function CheckboxRequiredValidator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} c\n * @return {?}\n */\n CheckboxRequiredValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.required ? Validators.requiredTrue(c) : null;\n };\n CheckboxRequiredValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',\n providers: [CHECKBOX_REQUIRED_VALIDATOR],\n host: { '[attr.required]': 'required ? \"\" : null' }\n },] },\n ];\n /** @nocollapse */\n CheckboxRequiredValidator.ctorParameters = function () { return []; };\n return CheckboxRequiredValidator;\n}(RequiredValidator));\n/**\n * Provider which adds {\\@link EmailValidator} to {\\@link NG_VALIDATORS}.\n */\nvar EMAIL_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return EmailValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `email` validator to controls marked with the\n * `email` attribute, via the {\\@link NG_VALIDATORS} binding.\n *\n * ### Example\n *\n * ```\n * <input type=\"email\" name=\"email\" ngModel email>\n * <input type=\"email\" name=\"email\" ngModel email=\"true\">\n * <input type=\"email\" name=\"email\" ngModel [email]=\"true\">\n * ```\n *\n * \\@experimental\n */\nvar EmailValidator = /** @class */ (function () {\n function EmailValidator() {\n }\n Object.defineProperty(EmailValidator.prototype, \"email\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this._enabled = value === '' || value === true || value === 'true';\n if (this._onChange)\n this._onChange();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} c\n * @return {?}\n */\n EmailValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this._enabled ? Validators.email(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n EmailValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n EmailValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[email][formControlName],[email][formControl],[email][ngModel]',\n providers: [EMAIL_VALIDATOR]\n },] },\n ];\n /** @nocollapse */\n EmailValidator.ctorParameters = function () { return []; };\n EmailValidator.propDecorators = {\n \"email\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return EmailValidator;\n}());\n/**\n * \\@stable\n * @record\n */\n\n/**\n * \\@stable\n * @record\n */\n\n/**\n * Provider which adds {\\@link MinLengthValidator} to {\\@link NG_VALIDATORS}.\n *\n * ## Example:\n *\n * {\\@example common/forms/ts/validators/validators.ts region='min'}\n */\nvar MIN_LENGTH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return MinLengthValidator; }),\n multi: true\n};\n/**\n * A directive which installs the {\\@link MinLengthValidator} for any `formControlName`,\n * `formControl`, or control with `ngModel` that also has a `minlength` attribute.\n *\n * \\@stable\n */\nvar MinLengthValidator = /** @class */ (function () {\n function MinLengthValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n MinLengthValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('minlength' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n MinLengthValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.minlength == null ? null : this._validator(c);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n MinLengthValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n MinLengthValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () {\n this._validator = Validators.minLength(parseInt(this.minlength, 10));\n };\n MinLengthValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',\n providers: [MIN_LENGTH_VALIDATOR],\n host: { '[attr.minlength]': 'minlength ? minlength : null' }\n },] },\n ];\n /** @nocollapse */\n MinLengthValidator.ctorParameters = function () { return []; };\n MinLengthValidator.propDecorators = {\n \"minlength\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return MinLengthValidator;\n}());\n/**\n * Provider which adds {\\@link MaxLengthValidator} to {\\@link NG_VALIDATORS}.\n *\n * ## Example:\n *\n * {\\@example common/forms/ts/validators/validators.ts region='max'}\n */\nvar MAX_LENGTH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return MaxLengthValidator; }),\n multi: true\n};\n/**\n * A directive which installs the {\\@link MaxLengthValidator} for any `formControlName,\n * `formControl`,\n * or control with `ngModel` that also has a `maxlength` attribute.\n *\n * \\@stable\n */\nvar MaxLengthValidator = /** @class */ (function () {\n function MaxLengthValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n MaxLengthValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('maxlength' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n MaxLengthValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) {\n return this.maxlength != null ? this._validator(c) : null;\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n MaxLengthValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n MaxLengthValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () {\n this._validator = Validators.maxLength(parseInt(this.maxlength, 10));\n };\n MaxLengthValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',\n providers: [MAX_LENGTH_VALIDATOR],\n host: { '[attr.maxlength]': 'maxlength ? maxlength : null' }\n },] },\n ];\n /** @nocollapse */\n MaxLengthValidator.ctorParameters = function () { return []; };\n MaxLengthValidator.propDecorators = {\n \"maxlength\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return MaxLengthValidator;\n}());\nvar PATTERN_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"forwardRef\"])(function () { return PatternValidator; }),\n multi: true\n};\n/**\n * A Directive that adds the `pattern` validator to any controls marked with the\n * `pattern` attribute, via the {\\@link NG_VALIDATORS} binding. Uses attribute value\n * as the regex to validate Control value against. Follows pattern attribute\n * semantics; i.e. regex must match entire Control value.\n *\n * ### Example\n *\n * ```\n * <input [name]=\"fullName\" pattern=\"[a-zA-Z ]*\" ngModel>\n * ```\n * \\@stable\n */\nvar PatternValidator = /** @class */ (function () {\n function PatternValidator() {\n }\n /**\n * @param {?} changes\n * @return {?}\n */\n PatternValidator.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) {\n if ('pattern' in changes) {\n this._createValidator();\n if (this._onChange)\n this._onChange();\n }\n };\n /**\n * @param {?} c\n * @return {?}\n */\n PatternValidator.prototype.validate = /**\n * @param {?} c\n * @return {?}\n */\n function (c) { return this._validator(c); };\n /**\n * @param {?} fn\n * @return {?}\n */\n PatternValidator.prototype.registerOnValidatorChange = /**\n * @param {?} fn\n * @return {?}\n */\n function (fn) { this._onChange = fn; };\n /**\n * @return {?}\n */\n PatternValidator.prototype._createValidator = /**\n * @return {?}\n */\n function () { this._validator = Validators.pattern(this.pattern); };\n PatternValidator.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',\n providers: [PATTERN_VALIDATOR],\n host: { '[attr.pattern]': 'pattern ? pattern : null' }\n },] },\n ];\n /** @nocollapse */\n PatternValidator.ctorParameters = function () { return []; };\n PatternValidator.propDecorators = {\n \"pattern\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return PatternValidator;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Creates an {\\@link AbstractControl} from a user-specified configuration.\n *\n * It is essentially syntactic sugar that shortens the `new FormGroup()`,\n * `new FormControl()`, and `new FormArray()` boilerplate that can build up in larger\n * forms.\n *\n * \\@howToUse\n *\n * To use, inject `FormBuilder` into your component class. You can then call its methods\n * directly.\n *\n * {\\@example forms/ts/formBuilder/form_builder_example.ts region='Component'}\n *\n * * **npm package**: `\\@angular/forms`\n *\n * * **NgModule**: {\\@link ReactiveFormsModule}\n *\n * \\@stable\n */\nvar FormBuilder = /** @class */ (function () {\n function FormBuilder() {\n }\n /**\n * Construct a new {@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {@link FormGroup} constructor for more details.\n */\n /**\n * Construct a new {\\@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {\\@link FormGroup} constructor for more details.\n * @param {?} controlsConfig\n * @param {?=} extra\n * @return {?}\n */\n FormBuilder.prototype.group = /**\n * Construct a new {\\@link FormGroup} with the given map of configuration.\n * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.\n *\n * See the {\\@link FormGroup} constructor for more details.\n * @param {?} controlsConfig\n * @param {?=} extra\n * @return {?}\n */\n function (controlsConfig, extra) {\n if (extra === void 0) { extra = null; }\n var /** @type {?} */ controls = this._reduceControls(controlsConfig);\n var /** @type {?} */ validator = extra != null ? extra['validator'] : null;\n var /** @type {?} */ asyncValidator = extra != null ? extra['asyncValidator'] : null;\n return new FormGroup(controls, validator, asyncValidator);\n };\n /**\n * Construct a new {@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n */\n /**\n * Construct a new {\\@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n * @param {?} formState\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n FormBuilder.prototype.control = /**\n * Construct a new {\\@link FormControl} with the given `formState`,`validator`, and\n * `asyncValidator`.\n *\n * `formState` can either be a standalone value for the form control or an object\n * that contains both a value and a disabled status.\n *\n * @param {?} formState\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n function (formState, validator, asyncValidator) {\n return new FormControl(formState, validator, asyncValidator);\n };\n /**\n * Construct a {@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n */\n /**\n * Construct a {\\@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n * @param {?} controlsConfig\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n FormBuilder.prototype.array = /**\n * Construct a {\\@link FormArray} from the given `controlsConfig` array of\n * configuration, with the given optional `validator` and `asyncValidator`.\n * @param {?} controlsConfig\n * @param {?=} validator\n * @param {?=} asyncValidator\n * @return {?}\n */\n function (controlsConfig, validator, asyncValidator) {\n var _this = this;\n var /** @type {?} */ controls = controlsConfig.map(function (c) { return _this._createControl(c); });\n return new FormArray(controls, validator, asyncValidator);\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} controlsConfig\n * @return {?}\n */\n FormBuilder.prototype._reduceControls = /**\n * \\@internal\n * @param {?} controlsConfig\n * @return {?}\n */\n function (controlsConfig) {\n var _this = this;\n var /** @type {?} */ controls = {};\n Object.keys(controlsConfig).forEach(function (controlName) {\n controls[controlName] = _this._createControl(controlsConfig[controlName]);\n });\n return controls;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} controlConfig\n * @return {?}\n */\n FormBuilder.prototype._createControl = /**\n * \\@internal\n * @param {?} controlConfig\n * @return {?}\n */\n function (controlConfig) {\n if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup ||\n controlConfig instanceof FormArray) {\n return controlConfig;\n }\n else if (Array.isArray(controlConfig)) {\n var /** @type {?} */ value = controlConfig[0];\n var /** @type {?} */ validator = controlConfig.length > 1 ? controlConfig[1] : null;\n var /** @type {?} */ asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null;\n return this.control(value, validator, asyncValidator);\n }\n else {\n return this.control(controlConfig);\n }\n };\n FormBuilder.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n FormBuilder.ctorParameters = function () { return []; };\n return FormBuilder;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Adds `novalidate` attribute to all forms by default.\n *\n * `novalidate` is used to disable browser's native form validation.\n *\n * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:\n *\n * ```\n * <form ngNativeValidate></form>\n * ```\n *\n * \\@experimental\n */\nvar NgNoValidate = /** @class */ (function () {\n function NgNoValidate() {\n }\n NgNoValidate.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: 'form:not([ngNoForm]):not([ngNativeValidate])',\n host: { 'novalidate': '' },\n },] },\n ];\n /** @nocollapse */\n NgNoValidate.ctorParameters = function () { return []; };\n return NgNoValidate;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar SHARED_FORM_DIRECTIVES = [\n NgNoValidate,\n NgSelectOption,\n NgSelectMultipleOption,\n DefaultValueAccessor,\n NumberValueAccessor,\n RangeValueAccessor,\n CheckboxControlValueAccessor,\n SelectControlValueAccessor,\n SelectMultipleControlValueAccessor,\n RadioControlValueAccessor,\n NgControlStatus,\n NgControlStatusGroup,\n RequiredValidator,\n MinLengthValidator,\n MaxLengthValidator,\n PatternValidator,\n CheckboxRequiredValidator,\n EmailValidator,\n];\nvar TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];\nvar REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];\n/**\n * Internal module used for sharing directives between FormsModule and ReactiveFormsModule\n */\nvar InternalFormsSharedModule = /** @class */ (function () {\n function InternalFormsSharedModule() {\n }\n InternalFormsSharedModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: SHARED_FORM_DIRECTIVES,\n exports: SHARED_FORM_DIRECTIVES,\n },] },\n ];\n /** @nocollapse */\n InternalFormsSharedModule.ctorParameters = function () { return []; };\n return InternalFormsSharedModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * The ng module for forms.\n * \\@stable\n */\nvar FormsModule = /** @class */ (function () {\n function FormsModule() {\n }\n FormsModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: TEMPLATE_DRIVEN_DIRECTIVES,\n providers: [RadioControlRegistry],\n exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]\n },] },\n ];\n /** @nocollapse */\n FormsModule.ctorParameters = function () { return []; };\n return FormsModule;\n}());\n/**\n * The ng module for reactive forms.\n * \\@stable\n */\nvar ReactiveFormsModule = /** @class */ (function () {\n function ReactiveFormsModule() {\n }\n ReactiveFormsModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{\n declarations: [REACTIVE_DRIVEN_DIRECTIVES],\n providers: [FormBuilder, RadioControlRegistry],\n exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]\n },] },\n ];\n /** @nocollapse */\n ReactiveFormsModule.ctorParameters = function () { return []; };\n return ReactiveFormsModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=forms.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvZm9ybXMvZXNtNS9mb3Jtcy5qcz9lYzMzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBfX2Fzc2lnbiwgX19leHRlbmRzIH0gZnJvbSAndHNsaWInO1xuaW1wb3J0IHsgRGlyZWN0aXZlLCBFbGVtZW50UmVmLCBFdmVudEVtaXR0ZXIsIEhvc3QsIEluamVjdCwgSW5qZWN0YWJsZSwgSW5qZWN0aW9uVG9rZW4sIEluamVjdG9yLCBJbnB1dCwgTmdNb2R1bGUsIE9wdGlvbmFsLCBPdXRwdXQsIFJlbmRlcmVyMiwgU2VsZiwgU2tpcFNlbGYsIFZlcnNpb24sIGZvcndhcmRSZWYsIMm1aXNPYnNlcnZhYmxlLCDJtWlzUHJvbWlzZSwgybVsb29zZUlkZW50aWNhbCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgZm9ya0pvaW4gfSBmcm9tICdyeGpzL29ic2VydmFibGUvZm9ya0pvaW4nO1xuaW1wb3J0IHsgZnJvbVByb21pc2UgfSBmcm9tICdyeGpzL29ic2VydmFibGUvZnJvbVByb21pc2UnO1xuaW1wb3J0IHsgbWFwIH0gZnJvbSAncnhqcy9vcGVyYXRvci9tYXAnO1xuaW1wb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GNvbnRyb2xzLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBkaXNhYmxlZGAgd2hlbiBpdHMgYHN0YXR1cyA9PT0gRElTQUJMRURgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBEaXNhYmxlZCBjb250cm9scyBhcmUgZXhlbXB0IGZyb20gdmFsaWRhdGlvbiBjaGVja3MgYW5kXG4gICAgICAgICAqIGFyZSBub3QgaW5jbHVkZWQgaW4gdGhlIGFnZ3JlZ2F0ZSB2YWx1ZSBvZiB0aGVpciBhbmNlc3RvclxuICAgICAgICAgKiBjb250cm9scy5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC5kaXNhYmxlZCA6IG51bGw7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2xEaXJlY3RpdmUucHJvdG90eXBlLCBcImVuYWJsZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBlbmFibGVkYCBhcyBsb25nIGFzIGl0cyBgc3RhdHVzICE9PSBESVNBQkxFRGAuXG4gICAgICAgICAqXG4gICAgICAgICAqIEluIG90aGVyIHdvcmRzLCBpdCBoYXMgYSBzdGF0dXMgb2YgYFZBTElEYCwgYElOVkFMSURgLCBvclxuICAgICAgICAgKiBgUEVORElOR2AuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBBIGNvbnRyb2wgaXMgYGVuYWJsZWRgIGFzIGxvbmcgYXMgaXRzIGBzdGF0dXMgIT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAg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W5nZWQgdGhlIHZhbHVlXG4gICAgICAgICAqIGluIHRoZSBVSS5cbiAgICAgICAgICpcbiAgICAgICAgICogTm90ZSB0aGF0IHByb2dyYW1tYXRpYyBjaGFuZ2VzIHRvIGEgY29udHJvbCdzIHZhbHVlIHdpbGxcbiAgICAgICAgICogKm5vdCogbWFyayBpdCBkaXJ0eS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlydHlgIGlmIHRoZSB1c2VyIGhhcyBjaGFuZ2VkIHRoZSB2YWx1ZVxuICAgICAgICAgKiBpbiB0aGUgVUkuXG4gICAgICAgICAqXG4gICAgICAgICAqIE5vdGUgdGhhdCBwcm9ncmFtbWF0aWMgY2hhbmdlcyB0byBhIGNvbnRyb2wncyB2YWx1ZSB3aWxsXG4gICAgICAgICAqICpub3QqIG1hcmsgaXQgZGlydHkuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLmNvbnRyb2wgPyB0aGlzLmNvbnRyb2wuZGlydHkgOiBudWxsOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RDb250cm9sRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ0b3VjaGVkXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBtYXJrZWQgYHRvdWNoZWRgIG9uY2UgdGhlIHVzZXIgaGFzIHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBtYXJrZWQgYHRvdWNoZWRgIG9uY2UgdGhlIHVzZXIgaGFzIHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC50b3VjaGVkIDogbnVsbDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbERpcmVjdGl2ZS5wcm90b3R5cGUsIFwic3RhdHVzXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbCA/IHRoaXMuY29udHJvbC5zdGF0dXMgOiBudWxsOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RDb250cm9sRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ1bnRvdWNoZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGB1bnRvdWNoZWRgIGlmIHRoZSB1c2VyIGhhcyBub3QgeWV0IHRyaWdnZXJlZFxuICAgICAgICAgKiBhIGBibHVyYCBldmVudCBvbiBpdC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgdW50b3VjaGVkYCBpZiB0aGUgdXNlciBoYXMgbm90IHlldCB0cmlnZ2VyZWRcbiAgICAgICAgICogYSBgYmx1cmAgZXZlbnQgb24gaXQuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gIC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EBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5lbWFpbCA9IC8qKlxuICAgICAqIFZhbGlkYXRvciB0aGF0IHBlcmZvcm1zIGVtYWlsIHZhbGlkYXRpb24uXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29udHJvbCkge1xuICAgICAgICByZXR1cm4gRU1BSUxfUkVHRVhQLnRlc3QoY29udHJvbC52YWx1ZSkgPyBudWxsIDogeyAnZW1haWwnOiB0cnVlIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1pbkxlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5taW5MZW5ndGggPSAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtaW5pbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1pbkxlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG1pbkxlbmd0aCkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvbnRyb2wpIHtcbiAgICAgICAgICAgIGlmIChpc0VtcHR5SW5wdXRWYWx1ZShjb250cm9sLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudWxsOyAvLyBkb24ndCB2YWxpZGF0ZSBlbXB0eSB2YWx1ZXMgdG8gYWxsb3cgb3B0aW9uYWwgY29udHJvbHNcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxlbmd0aCA9IGNvbnRyb2wudmFsdWUgPyBjb250cm9sLnZhbHVlLmxlbmd0aCA6IDA7XG4gICAgICAgICAgICByZXR1cm4gbGVuZ3RoIDwgbWluTGVuZ3RoID9cbiAgICAgICAgICAgICAgICB7ICdtaW5sZW5ndGgnOiB7ICdyZXF1aXJlZExlbmd0aCc6IG1pbkxlbmd0aCwgJ2FjdHVhbExlbmd0aCc6IGxlbmd0aCB9IH0gOlxuICAgICAgICAgICAgICAgIG51bGw7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1heExlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5tYXhMZW5ndGggPSAvKipcbiAgICAgKiBWYWxpZGF0b3IgdGhhdCByZXF1aXJlcyBjb250cm9scyB0byBoYXZlIGEgdmFsdWUgb2YgYSBtYXhpbXVtIGxlbmd0aC5cbiAgICAgKiBAcGFyYW0gez99IG1heExlbmd0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG1heExlbmd0aCkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvbnRyb2wpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxlbmd0aC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N0ciA9ICcnO1xuICAgICAgICAgICAgaWYgKHBhdHRlcm4uY2hhckF0KDApICE9PSAnXicpXG4gICAgICAgICAgICAgICAgcmVnZXhTdHIgKz0gJ14nO1xuICAgICAgICAgICAgcmVnZXhTdHIgKz0gcGF0dGVybjtcbiAgICAgICAgICAgIGlmIChwYXR0ZXJuLmNoYXJBdChwYXR0ZXJuLmxlbmd0aCAtIDEpICE9PSAnJCcpXG4gICAgICAgICAgICAgICAgcmVnZXhTdHIgKz0gJyQnO1xuICAgICAgICAgICAgcmVnZXggPSBuZXcgUmVnRXhwKHJlZ2V4U3RyKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJlZ2V4U3RyID0gcGF0dGVybi50b1N0cmluZygpO1xuICAgICAgICAgICAgcmVnZXggPSBwYXR0ZXJuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoY29udHJvbCkge1xuICAgICAgICAgICAgaWYgKGlzRW1wdHlJbnB1dFZhbHVlKGNvbnRyb2wudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7IC8vIGRvbid0IHZhbGlkYXRlIGVtcHR5IHZhbHVlcyB0byBhbGxvdyBvcHRpb25hbCBjb250cm9sc1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWUgPSBjb250cm9sLnZhbHVlO1xuICAgICAgICAgICAgcmV0dXJuIHJlZ2V4LnRlc3QodmFsdWUpID8gbnVsbCA6XG4gICAgICAgICAgICAgICAgeyAncGF0dGVybic6IHsgJ3JlcXVpcmVkUGF0dGVybic6IHJlZ2V4U3RyLCAnYWN0dWFsVmFsdWUnOiB2YWx1ZSB9IH07XG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBOby1vcCB2YWxpZGF0b3IuXG4gICAgICovXG4gICAgLyoqXG4gICAgICogTm8tb3AgdmFsaWRhdG9yLlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVmFsaWRhdG9ycy5udWxsVmFsaWRhdG9yID0gLyoqXG4gICAgICogTm8tb3AgdmFsaWRhdG9yLlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGMpIHsgcmV0dXJuIG51bGw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWxpZGF0b3JzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBWYWxpZGF0b3JzLmNvbXBvc2UgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHZhbGlkYXRvcnNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2YWxpZGF0b3JzKSB7XG4gICAgICAgIGlmICghdmFsaWRhdG9ycylcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwcmVzZW50VmFsaWRhdG9ycyA9IC8qKiBAdHlwZSB7P30gKi8gKHZhbGlkYXRvcnMuZmlsdGVyKGlzUHJlc2VudCkpO1xuICAgICAgICBpZiAocHJlc2VudFZhbGlkYXRvcnMubGVuZ3RoID09IDApXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChjb250cm9sKSB7XG4gICAgICAgICAgICByZXR1cm4gX21lcmdlRXJyb3JzKF9leGVjdXRlVmFsaWRhdG9ycyhjb250cm9sLCBwcmVzZW50VmFsaWRhdG9ycykpO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWxpZGF0b3JzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBWYWxpZGF0b3JzLmNvbXBvc2VBc3luYyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdmFsaWRhdG9yc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbGlkYXRvcnMpIHtcbiAgICAgICAgaWYgKCF2YWxpZGF0b3JzKVxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByZXNlbnRWYWxpZGF0b3JzID0gLyoqIEB0eXBlIHs/fSAqLyAodmFsaWRhdG9ycy5maWx0ZXIoaXNQcmVzZW50KSk7XG4gICAgICAgIGlmIChwcmVzZW50VmFsaWRhdG9ycy5sZW5ndGggPT0gMClcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvbnRyb2wpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9ic2VydmFibGVzID0gX2V4ZWN1dGVBc3luY1ZhbGlkYXRvcnMoY29udHJvbCwgcHJlc2VudFZhbGlkYXRvcnMpLm1hcCh0b09ic2VydmFibGUpO1xuICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKGZvcmtKb2luKG9ic2VydmFibGVzKSwgX21lcmdlRXJyb3JzKTtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIHJldHVybiBWYWxpZGF0b3JzO1xufSgpKTtcbi8qKlxuICogQHBhcmFtIHs/fSBvXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBpc1ByZXNlbnQobykge1xuICAgIHJldHVybiBvICE9IG51bGw7XG59XG4vKipcbiAqIEBwYXJhbSB7P30gclxuICogQHJldHVybiB7P31cbiAqL1xuZnVuY3Rpb24gdG9PYnNlcnZhYmxlKHIpIHtcbiAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvYnMgPSDJtWlzUHJvbWlzZShyKSA/IGZyb21Qcm9taXNlKHIpIDogcjtcbiAgICBpZiAoISjJtWlzT2JzZXJ2YWJsZShvYnMpKSkge1xuIC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rpc2FibGVkXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoaXNEaXNhYmxlZCkge1xuICAgICAgICB0aGlzLl9yZW5kZXJlci5zZXRQcm9wZXJ0eSh0aGlzLl9lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQsICdkaXNhYmxlZCcsIGlzRGlzYWJsZWQpO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTZWxlY3RDb250cm9sVmFsdWVBY2Nlc3Nvci5wcm90b3R5cGUuX3JlZ2lzdGVyT3B0aW9uID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuICh0aGlzLl9pZENvdW50ZXIrKykudG9TdHJpbmcoKTsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTZWxlY3RDb250cm9sVmFsdWVBY2Nlc3Nvci5wcm90b3R5cGUuX2dldE9wdGlvbklkID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgZm9yICh2YXIgX2kgPSAwLCBfYSA9IEFycmF5LmZyb20odGhpcy5fb3B0aW9uTWFwLmtleXMoKSk7IF9pIDwgX2EubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICB2YXIgaWQgPSBfYVtfaV07XG4gICAgICAgICAgICBpZiAodGhpcy5fY29tcGFyZVdpdGgodGhpcy5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Ll9zZXRFbGVtZW50VmFsdWUodmFsdWUpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX3NlbGVjdClcbiAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3Qud3JpdGVWYWx1ZSh0aGlzLl9zZWxlY3QudmFsdWUpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE9wdGlvbi5wcm90b3R5cGUuX3NldEVsZW1lbnRWYWx1ZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHRoaXMuX3JlbmRlcmVyLnNldFByb3BlcnR5KHRoaXMuX2VsZW1lbnQubmF0aXZlRWxlbWVudCwgJ3ZhbHVlJywgdmFsdWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE9wdGlvbi5wcm90b3R5cGUubmdPbkRlc3Ryb3kgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMuX3NlbGVjdCkge1xuICAgICAgICAgICAgdGhpcy5fc2VsZWN0Ll9vcHRpb25NYXAuZGVsZXRlKHRoaXMuaWQpO1xuICAgICAgICAgICAgdGhpcy5fc2VsZWN0LndyaXRlVmFsdWUodGhpcy5fc2VsZWN0LnZhbHVlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgTmdTZWx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LmRlZmluZVByb3BlcnR5KFNlbGVjdE11bHRpcGxlQ29udHJvbFZhbHVlQWNjZXNzb3IucHJvdG90eXBlLCBcImNvbXBhcmVXaXRoXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSBmblxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKGZuKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZuICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiY29tcGFyZVdpdGggbXVzdCBiZSBhIGZ1bmN0aW9uLCBidXQgcmVjZWl2ZWQgXCIgKyBKU09OLnN0cmluZ2lmeShmbikpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fY29tcGFyZVdpdGggPSBmbjtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU2VsZWN0TXVsdGlwbGVDb250cm9sVmFsdWVBY2Nlc3Nvci5wcm90b3R5cGUud3JpdGVWYWx1ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9wdGlvblNlbGVjdGVkU3RhdGVTZXR0ZXI7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgICAgLy8gY29udmVydC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5cGUgez99ICovIG9wdGlvbnMgPSBfLnNlbGVjdGVkT3B0aW9ucztcbiAgICAgICAgICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGkgPSAwOyBpIDwgb3B0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvcHQgPSBvcHRpb25zLml0ZW0oaSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbCA9IF90aGlzLl9nZXRPcHRpb25WYWx1ZShvcHQudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZC5wdXNoKHZhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0aW9ucyA9IC8qKiBAdHlwZSB7P30gKi8gKF8ub3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gMDsgaSA8IG9wdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0ID0gb3B0aW9ucy5pdGVtKGkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0LnNlbGVjdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2YWwgPSBfdGhpcy5fZ2V0T3B0aW9uVmFsdWUob3B0LnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkLnB1c2godmFsKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF90aGlzLnZhbHVlID0gc2VsZWN0ZWQ7XG4gICAgICAgICAgICBmbihzZW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bGVtZW50VmFsdWUoX2J1aWxkVmFsdWVTdHJpbmckMSh0aGlzLmlkLCB2YWx1ZSkpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdC53cml0ZVZhbHVlKHRoaXMuX3NlbGVjdC52YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zZXRFbGVtZW50VmFsdWUodmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE11bHRpcGxlT3B0aW9uLnByb3RvdHlwZS5fc2V0RWxlbWVudFZhbHVlID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgdGhpcy5fcmVuZGVyZXIuc2V0UHJvcGVydHkodGhpcy5fZWxlbWVudC5uYXRpdmVFbGVtZW50LCAndmFsdWUnLCB2YWx1ZSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHNlbGVjdGVkXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ1NlbGVjdE11bHRpcGxlT3B0aW9uLnByb3RvdHlwZS5fc2V0U2VsZWN0ZWQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gc2VsZWN0ZWRcb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5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5mb3JtRGlyZWN0aXZlKSB7XG4gICAgICAgICAgICB0aGlzLmZvcm1EaXJlY3RpdmUucmVtb3ZlRm9ybUdyb3VwKHRoaXMpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWJzdHJhY3RGb3JtR3JvdXBEaXJlY3RpdmUucHJvdG90eXBlLCBcImNvbnRyb2xcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogR2V0IHRoZSB7QGxpbmsgRm9ybUdyb3VwfSBiYWNraW5nIHRoaXMgYmluZGluZy5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEdldCB0aGUge1xcQGxpbmsgRm9ybUdyb3VwfSBiYWNraW5nIHRoaXMgYmluZGluZy5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIC8qKiBAdHlwZSB7P30gKi8gKCh0aGlzLmZvcm1EaXJlY3RpdmUpKS5nZXRGb3JtR3JvdXAodGhpcyk7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdEZvcm1Hcm91cERpcmVjdGl2ZS5wcm90b3R5cGUsIFwicGF0aFwiLCB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBHZXQgdGhlIHBhdGggdG8gdGhpcyBjb250cm9sIGdyb3VwLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogR2V0IHRoZSBwYXRoIHRvIHRoaXMgY29udHJvbCBncm91cC5cbiAgICAgICAgICogQHJldH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1xuICAgICAgICB0aGlzLnRvdWNoZWQgPSBmYWxzZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFxcQGludGVybmFsXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLl9vbkRpc2FibGVkQ2hhbmdlID0gW107XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInBhcmVudFwiLCB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBUaGUgcGFyZW50IGNvbnRyb2wuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBUaGUgcGFyZW50IGNvbnRyb2wuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLl9wYXJlbnQ7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInZhbGlkXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgdmFsaWRgIHdoZW4gaXRzIGBzdGF0dXMgPT09IFZBTElEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogSW4gb3JkZXIgdG8gaGF2ZSB0aGlzIHN0YXR1cywgdGhlIGNvbnRyb2wgbXVzdCBoYXZlIHBhc3NlZCBhbGwgaXRzXG4gICAgICAgICAqIHZhbGlkYXRpb24gY2hlY2tzLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGB2YWxpZGAgd2hlbiBpdHMgYHN0YXR1cyA9PT0gVkFMSURgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBJbiBvcmRlciB0byBoYXZlI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ogQSBjb250cm9sIGlzIGBkaXNhYmxlZGAgd2hlbiBpdHMgYHN0YXR1cyA9PT0gRElTQUJMRURgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBEaXNhYmxlZCBjb250cm9scyBhcmUgZXhlbXB0IGZyb20gdmFsaWRhdGlvbiBjaGVja3MgYW5kXG4gICAgICAgICAqIGFyZSBub3QgaW5jbHVkZWQgaW4gdGhlIGFnZ3JlZ2F0ZSB2YWx1ZSBvZiB0aGVpciBhbmNlc3RvclxuICAgICAgICAgKiBjb250cm9scy5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlzYWJsZWRgIHdoZW4gaXRzIGBzdGF0dXMgPT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogRGlzYWJsZWQgY29udHJvbHMgYXJlIGV4ZW1wdCBmcm9tIHZhbGlkYXRpb24gY2hlY2tzIGFuZFxuICAgICAgICAgKiBhcmUgbm90IGluY2x1ZGVkIGluIHRoZSBhZ2dyZWdhdGUgdmFsdWUgb2YgdGhlaXIgYW5jZXN0b3JcbiAgICAgICAgICogY29udHJvbHMuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLnN0YXR1cyA9PT0gRElTQUJMRUQ7IH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcImVuYWJsZWRcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBlbmFibGVkYCBhcyBsb25nIGFzIGl0cyBgc3RhdHVzICE9PSBESVNBQkxFRGAuXG4gICAgICAgICAqXG4gICAgICAgICAqIEluIG90aGVyIHdvcmRzLCBpdCBoYXMgYSBzdGF0dXMgb2YgYFZBTElEYCwgYElOVkFMSURgLCBvclxuICAgICAgICAgKiBgUEVORElOR2AuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBBIGNvbnRyb2wgaXMgYGVuYWJsZWRgIGFzIGxvbmcgYXMgaXRzIGBzdGF0dXMgIT09IERJU0FCTEVEYC5cbiAgICAgICAgICpcbiAgICAgICAgICogSW4gb3RoZXIgd29yZHMsIGl0IGhhcyBhIHN0YXR1cyBvZiBgVkFMSURgLCBgSU5WQUxJRGAsIG9yXG4gICAgICAgICAqIGBQRU5ESU5HYC5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuc3RhdHVzICE9PSBESVNBQkxFRDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUsIFwiZGlydHlcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogQSBjb250cm9sIGlzIGBkaXJ0eWAgaWYgdGhlIHVzZXIgaGFzIGNoYW5nZWQgdGhlIHZhbHVlXG4gICAgICAgICAqIGluIHRoZSBVSS5cbiAgICAgICAgICpcbiAgICAgICAgICogTm90ZSB0aGF0IHByb2dyYW1tYXRpYyBjaGFuZ2VzIHRvIGEgY29udHJvbCdzIHZhbHVlIHdpbGxcbiAgICAgICAgICogKm5vdCogbWFyayBpdCBkaXJ0eS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgZGlydHlgIGlmIHRoZSB1c2VyIGhhcyBjaGFuZ2VkIHRoZSB2YWx1ZVxuICAgICAgICAgKiBpbiB0aGUgVUkuXG4gICAgICAgICAqXG4gICAgICAgICAqIE5vdGUgdGhhdCBwcm9ncmFtbWF0aWMgY2hhbmdlcyB0byBhIGNvbnRyb2wncyB2YWx1ZSB3aWxsXG4gICAgICAgICAqICpub3QqIG1hcmsgaXQgZGlydHkuXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiAhdGhpcy5wcmlzdGluZTsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUsIFwidW50b3VjaGVkXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgY29udHJvbCBpcyBgdW50b3VjaGVkYCBpZiB0aGUgdXNlciBoYXMgbm90IHlldCB0cmlnZ2VyZWRcbiAgICAgICAgICogYSBgYmx1cmAgZXZlbnQgb24gaXQuXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBBIGNvbnRyb2wgaXMgYHVudG91Y2hlZGAgaWYgdGhlIHVzZXIgaGFzIG5vdCB5ZXQgdHJpZ2dlcmVkXG4gICAgICAgICAqIGEgYGJsdXJgIGV2ZW50IG9uIGl0LlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gIXRoaXMudG91Y2hlZDsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUsIFwidXBkYXRlT25cIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogUmV0dXJucyB0aGU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W50OiBvcHRzLmVtaXRFdmVudCB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fc2V0SW5pdGlhbFN0YXR1cyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnN0YXR1cyA9IHRoaXMuX2FsbENvbnRyb2xzRGlzYWJsZWQoKSA/IERJU0FCTEVEIDogVkFMSUQ7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX3J1blZhbGlkYXRvciA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy52YWxpZGF0b3IgPyB0aGlzLnZhbGlkYXRvcih0aGlzKSA6IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez89fSBlbWl0RXZlbnRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX3J1bkFzeW5jVmFsaWRhdG9yID0gLyoqXG4gICAgICogQHBhcmFtIHs/PX0gZW1pdEV2ZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZW1pdEV2ZW50KSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmICh0aGlzLmFzeW5jVmFsaWRhdG9yKSB7XG4gICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnN0YXR1cyA9IFBFTkRJTkc7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBv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LlxuICAgICAqXG4gICAgICogSWYgbm8gcGF0aCBpcyBnaXZlbiwgaXQgY2hlY2tzIGZvciB0aGUgZXJyb3Igb24gdGhlIHByZXNlbnQgY29udHJvbC5cbiAgICAgKiBAcGFyYW0gez99IGVycm9yQ29kZVxuICAgICAqIEBwYXJhbSB7Pz19IHBhdGhcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChlcnJvckNvZGUsIHBhdGgpIHsgcmV0dXJuICEhdGhpcy5nZXRFcnJvcihlcnJvckNvZGUsIHBhdGgpOyB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYnN0cmFjdENvbnRyb2wucHJvdG90eXBlLCBcInJvb3RcIiwge1xuICAgICAgICAvKipcbiAgICAgICAgICogUmV0cmlldmVzIHRoZSB0b3AtbGV2ZWwgYW5jZXN0b3Igb2YgdGhpcyBjb250cm9sLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogUmV0cmlldmVzIHRoZSB0b3AtbGV2ZWwgYW5jZXN0b3Igb2YgdGhpcyBjb250cm9sLlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8geCA9IHRoaXM7XG4gICAgICAgICAgICB3aGlsZSAoeC5fcGFyZW50KSB7XG4gICAgICAgICAgICAgICAgeCA9IHguX3BhcmVudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB4O1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGVtaXRFdmVudFxuICAgICAqIEByZXR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gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fY2FsY3VsYXRlU3RhdHVzID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLl9hbGxDb250cm9sc0Rpc2FibGVkKCkpXG4gICAgICAgICAgICByZXR1cm4gRElTQUJMRUQ7XG4gICAgICAgIGlmICh0aGlzLmVycm9ycylcbiAgICAgICAgICAgIHJldHVybiBJTlZBTElEO1xuICAgICAgICBpZiAodGhpcy5fYW55Q29udHJvbHNIYXZlU3RhdHVzKFBFTkRJTkcpKVxuICAgICAgICAgICAgcmV0dXJuIFBFTkRJTkc7XG4gICAgICAgIGlmICh0aGlzLl9hbnlDb250cm9sc0hhdmVTdGF0dXMoSU5WQUxJRCkpXG4gICAgICAgICAgICByZXR1cm4gSU5WQUxJRDtcbiAgICAgICAgcmV0dXJuIFZBTElEO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBzdGF0dXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2FueUNvbnRyb2xzSGF2ZVN0YXR1cyA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBzdGF0dXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzdGF0dXMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2FueUNvbnRyb2xzKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBjb250cm9sLnN0YXR1cyA9PT0gc3RhdHVzOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fYW55Q29udHJvbHNEaXJ0eSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9hbnlDb250cm9scyhmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC5kaXJ0eTsgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2FueUNvbnRyb2xzVG91Y2hlZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9hbnlDb250cm9scyhmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC50b3VjaGVkOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7Pz19IG9wdHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX3VwZGF0ZVByaXN0aW5lID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez89fSBvcHRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAob3B0cykge1xuICAgICAgICBpZiAob3B0cyA9PT0gdm9pZCAwKSB7IG9wdHMgPSB7fTsgfVxuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnByaXN0aW5lID0gIXRoaXMuX2FueUNvbnRyb2xzRGlydHkoKTtcbiAgICAgICAgaWYgKHRoaXMuX3BhcmVudCAmJiAhb3B0cy5vbmx5U2VsZikge1xuICAgICAgICAgICAgdGhpcy5fcGFyZW50Ll91cGRhdGVQcmlzdGluZShvcHRzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/PX0gb3B0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWJzdHJhY3RDb250cm9sLnByb3RvdHlwZS5fdXBkYXRlVG91Y2hlZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/PX0gb3B0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG9wdHMpIHtcbiAgICAgICAgaWYgKG9wdHMgPT09IHZvaWQgMCkgeyBvcHRzID0ge307IH1cbiAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKHRoaXMpKS50b3VjaGVkID0gdGhpcy5fYW55Q29udHJvbHNUb3VjaGVkKCk7XG4gICAgICAgIGlmICh0aGlzLl9wYXJlbnQgJiYgIW9wdHMub25seVNlbGYpIHtcbiAgICAgICAgICAgIHRoaXMuX3BhcmVudC5fdXBkYXRlVG91Y2hlZChvcHRzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBmb3JtU3RhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFic3RyYWN0Q29udHJvbC5wcm90b3R5cGUuX2lzQm94ZWRWYWx1ZSA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/f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Y2Fubm90IGJlIGNhbGN1bGF0ZWQpLlxuICAgICAqXG4gICAgICogRXg6XG4gICAgICpcbiAgICAgKiBgYGB0c1xuICAgICAqIHRoaXMuY29udHJvbC5yZXNldCgnTmFuY3knKTtcbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKHRoaXMuY29udHJvbC52YWx1ZSk7ICAvLyAnTmFuY3knXG4gICAgICogYGBgXG4gICAgICpcbiAgICAgKiBPUlxuICAgICAqXG4gICAgICogYGBgXG4gICAgICogdGhpcy5jb250cm9sLnJlc2V0KHt2YWx1ZTogJ05hbmN5JywgZGlzYWJsZWQ6IHRydWV9KTtcbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKHRoaXMuY29udHJvbC52YWx1ZSk7ICAvLyAnTmFuY3knXG4gICAgICogY29uc29sZS5sb2codGhpcy5jb250cm9sLnN0YXR1cyk7ICAvLyAnRElTQUJMRUQnXG4gICAgICogYGBgXG4gICAgICogQHBhcmFtIHs/PX0gZm9ybVN0YXRlXG4gICAgICogQHBhcmFtIHs/PX0gb3B0aW9uc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGZvcm1TdGF0ZSwgb3B0aW9ucykge1xuICAgICAgICBpZiAoZm9ybVN0YXRlID09PSB2b2lkIDApIHsgZm9ybVN0YXRlID0gbnVsbDsgfVxuICAgICAgICBpZiAob3B0aW9ucyA9PT0gdm9pZCAwKSB7IG9wdGlvbnMgPSB7fTsgfVxuICAgICAgICB0aGlzLl9hcHBseUZvcm1TdGF0ZShmb3JtU3RhdGUpO1xuICAgICAgICB0aGlzLm1hcmtBc1ByaXN0aW5lKG9wdGlvbnMpO1xuICAgICAgICB0aGlzLm1hcmtBc1VudG91Y2hlZChvcHRpb25zKTtcbiAgICAgICAgdGhpcy5zZXRWYWx1ZSh0aGlzLnZhbHVlLCBvcHRpb25zKTtcbiAgICAgICAgdGhpcy5fcGVuZGluZ0NoYW5nZSA9IGZhbHNlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1Db250cm9sLnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB9O1xuICAgIC8qKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjb25kaXRpb25cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1Db250cm9sLnByb3RvdHlwZS5fYW55Q29udHJvbHMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY29uZGl0aW9uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZGl0aW9uKSB7IHJldHVybiBmYWxzZTsgfTtcbiAgICAvKipcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUNvbnRyb2wucHJvdG90eXBlLl9hbGxDb250cm9sc0Rpc2FibGVkID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuZGlzYWJsZWQ7IH07XG4gICAgLyoqXG4gICAgICogUmVnaXN0ZXIgYSBsaXN0ZW5lciBmb3IgY2hhbmdlIGV2ZW50cy5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBSZWdpc3RlciBhIGxpc3RlbmVyIG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AgICAqIFJlZ2lzdGVyIGEgbGlzdGVuZXIgZm9yIGRpc2FibGVkIGV2ZW50cy5cbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHtcbiAgICAgICAgdGhpcy5fb25EaXNhYmxlZENoYW5nZS5wdXNoKGZuKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjYlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUNvbnRyb2wucHJvdG90eXBlLl9mb3JFYWNoQ2hpbGQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY2JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjYikgeyB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUNvbnRyb2wucHJvdG90eXBlLl9zeW5jUGVuZGluZ0NvbnRyb2xzID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMudXBkYXRlT24gPT09ICdzdWJtaXQnKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5fcGVuZGluZ0RpcnR5KVxuICAgICAgICAgICAgICAgIHRoaXMubWFya0FzRGlydHkoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9wZW5kaW5nVG91Y2hlZClcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtBc1RvdWNoZWQoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9w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IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IGNvbnRyb2xcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChuYW1lLCBjb250cm9sKSB7XG4gICAgICAgIGlmICh0aGlzLmNvbnRyb2xzW25hbWVdKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29udHJvbHNbbmFtZV07XG4gICAgICAgIHRoaXMuY29udHJvbHNbbmFtZV0gPSBjb250cm9sO1xuICAgICAgICBjb250cm9sLnNldFBhcmVudCh0aGlzKTtcbiAgICAgICAgY29udHJvbC5fcmVnaXN0ZXJPbkNvbGxlY3Rpb25DaGFuZ2UodGhpcy5fb25Db2xsZWN0aW9uQ2hhbmdlKTtcbiAgICAgICAgcmV0dXJuIGNvbnRyb2w7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBBZGQgYSBjb250cm9sIHRvIHRoaXMgZ3JvdXAuXG4gICAgICovXG4gICAgLyoqXG4gICAgICogQWRkIGEgY29udHJvbCB0byB0aGlzIGdyb3VwLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5hZGRDb250cm9sID0gLyoqXG4gICAgICogQWRkIGEgY29udHJvbCB0byB0aGlzIGdyb3VwLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIGNvbnRyb2wpIHtcbiAgICAgICAgdGhpcy5yZWdpc3RlckNvbnRyb2wobmFtZSwgY29udHJvbCk7XG4gICAgICAgIHRoaXMudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICAgICAgICB0aGlzLl9vbkNvbGxlY3Rpb25DaGFuZ2UoKTtcbiAgICB9O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yT25Db2xsZWN0aW9uQ2hhbmdlKF90aGlzLl9vbkNvbGxlY3Rpb25DaGFuZ2UpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnZhbHVlID0gdGhpcy5fcmVkdWNlVmFsdWUoKTsgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbmRpdGlvblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5fYW55Q29udHJvbHMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY29uZGl0aW9uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZGl0aW9uKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IGZhbHNlO1xuICAgICAgICB0aGlzLl9mb3JFYWNoQ2hpbGQoZnVuY3Rpb24gKGNvbnRyb2wsIG5hbWUpIHtcbiAgICAgICAgICAgIHJlcyA9IHJlcyB8fCAoX3RoaXMuY29udGFpbnMobmFtZSkgJiYgY29uZGl0aW9uKGNvbnRyb2wpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1Hcm91cC5wcm90b3R5cGUuX3JlZHVjZVZhbHVlID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcmV0dXJuIHRoaXMuX3JlZHVjZUNoaWxkcmVuKHt9LCBmdW5jdGlvbiAoYWNjLCBjb250cm9sLCBuYW1lKSB7XG4gICAgICAgICAgICBpZiAoY29udHJvbC5lbmFibGVkIHx8IF90aGlzLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgYWNjW25hbWVdID0gY29udHJvbC52YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhY2M7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBpbml0VmFsdWVcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXAucHJvdG90eXBlLl9yZWR1Y2VDaGlsZHJlbiA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBpbml0VmFsdWVcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoaW5pdFZhbHVlLCBmbikge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXMgPSBpbml0VmFsdWU7XG4gICAgICAgIHRoaXMuX2ZvckVhY2hDaGlsZChmdW5jdGlvbiAoY29udHJvbCwgbmFtZSkgeyByZXMgPSBmbihyZXMsIGNvbnRyb2wsIG5hbWUpOyB9KTtcbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwLnByb3RvdHlwZS5fYWxsQ29udHJvbHNEaXNhYmxlZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGZvciAodmFyIF9pID0gMCwgX2EgPSBPYmplY3Qua2V5cyh0aGlzLmNvbnRyb2xzKTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIHZhciBjb250cm9sTmFtZSA9IF9hW19pXTtcbiAgICAgICAgICAgIGlmICh0aGlzLmNvbnRyb2xzW2NvbnRyb2xOYW1lXS5lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBPYmplY3Qua2V5cyh0aGlzLmNvbnRyb2xzKS5sZW5ndGggPiAwIHx8IHRoaXMuZGlzYWJsZWQ7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXAucHJvdG90eXBlLl9jaGVja0FsbFZhbHVlc1ByZXNlbnQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICB0aGlzLl9mb3JFYWNoQ2hpbGQoZnVuY3Rp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ICAqL1xuICAgIGZ1bmN0aW9uIChjb250cm9sKSB7XG4gICAgICAgIHRoaXMuY29udHJvbHMucHVzaChjb250cm9sKTtcbiAgICAgICAgdGhpcy5fcmVnaXN0ZXJDb250cm9sKGNvbnRyb2wpO1xuICAgICAgICB0aGlzLnVwZGF0ZVZhbHVlQW5kVmFsaWRpdHkoKTtcbiAgICAgICAgdGhpcy5fb25Db2xsZWN0aW9uQ2hhbmdlKCk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBJbnNlcnQgYSBuZXcge0BsaW5rIEFic3RyYWN0Q29udHJvbH0gYXQgdGhlIGdpdmVuIGBpbmRleGAgaW4gdGhlIGFycmF5LlxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIEluc2VydCBhIG5ldyB7XFxAbGluayBBYnN0cmFjdENvbnRyb2x9IGF0IHRoZSBnaXZlbiBgaW5kZXhgIGluIHRoZSBhcnJheS5cbiAgICAgKiBAcGFyYW0gez99IGluZGV4XG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXkucHJvdG90eXBlLmluc2VydCA9IC8qKlxuICAgICAqIEluc2VydCBhIG5ldyB7XFxAbGluayBBYnN0cmFjdENvbnRyb2x9IGF0IHRoZSBnaXZlbiBgaW5kZXhgIGluIHRoZSBhcnJheS5cbiAgICAgKiBAcGFyYW0gez99IGluZGV4XG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoaW5kZXgsIGNvbnRyb2wpIHtcbiAgICAgICAgdGhpcy5jb250cm9scy5zcGxpY2UoaW5kZXgsIDAsIGNvbnRyb2wpO1xuICAgICAgICB0aGlzLl9yZWdpc3RlckNvbnRyb2woY29udHJvbCk7XG4gICAgICAgIHRoaXMudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICAgICAgICB0aGlzLl9vb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3JtQXJyYXkucHJvdG90eXBlLnNldENvbnRyb2wgPSAvKipcbiAgICAgKiBSZXBsYWNlIGFuIGV4aXN0aW5nIGNvbnRyb2wuXG4gICAgICogQHBhcmFtIHs/fSBpbmRleFxuICAgICAqIEBwYXJhbSB7P30gY29udHJvbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGluZGV4LCBjb250cm9sKSB7XG4gICAgICAgIGlmICh0aGlzLmNvbnRyb2xzW2luZGV4XSlcbiAgICAgICAgICAgIHRoaXMuY29udHJvbHNbaW5kZXhdLl9yZWdpc3Rlck9uQ29sbGVjdGlvbkNoYW5nZShmdW5jdGlvbiAoKSB7IH0pO1xuICAgICAgICB0aGlzLmNvbnRyb2xzLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgIGlmIChjb250cm9sKSB7XG4gICAgICAgICAgICB0aGlzLmNvbnRyb2xzLnNwbGljZShpbmRleCwgMCwgY29udHJvbCk7XG4gICAgICAgICAgICB0aGlzLl9yZWdpc3RlckNvbnRyb2woY29udHJvbCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KCk7XG4gICAgICAgIHRoaXMuX29uQ29sbGVjdGlvbkNoYW5nZSgpO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZvcm1BcnJheS5wcm90b3R5cGUsIFwibGVuZ3RoXCIsIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIExlbmd0aCBvZiB0aGUgY29udHJvbCBhcnJheS5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIExlbmd0aCBvZiB0aGUgY29udHJvbCBhcnJheS5cbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuY29udHJvbHMubGVuZ3RoOyB9LFxuICAgICAgICBlbnVtZXJhYm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byBpdCB3aWxsIHRocm93IGFuIGVycm9yIGlmIHlvdSB0cnlcbiAgICAgKiB0byBzZXQgdGhlIHZhbHVlIG9mIGEgY29udHJvbCB0aGF0IGRvZXNuJ3QgZXhpc3Qgb3IgaWYgeW91IGV4Y2x1ZGUgdGhlXG4gICAgICogdmFsdWUgb2YgYSBjb250cm9sLlxuICAgICAqXG4gICAgICogICMjIyBFeGFtcGxlXG4gICAgICpcbiAgICAgKiAgYGBgXG4gICAgICogIGNvbnN0IGFyciA9IG5ldyBGb3JtQXJyYXkoW1xuICAgICAqICAgICBuZXcgRm9ybUNvbnRyb2woKSxcbiAgICAgKiAgICAgbmV3IEZvcm1Db250cm9sKClcbiAgICAgKiAgXSk7XG4gICAgICogIGNvbnNvbGUubG9nKGFyci52YWx1ZSk7ICAgLy8gW251bGwsIG51bGxdXG4gICAgICpcbiAgICAgKiAgYXJyLnNldFZhbHVlKFsnTmFuY3knLCAnRHJldyddKTtcbiAgICAgKiAgY29uc29sZS5sb2coYXJyLnZhbHVlKTsgICAvLyBbJ05hbmN5JywgJ0RyZXcnXVxuICAgICAqICBgYGBcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHBhcmFtIHs/PX0gb3B0aW9uc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlLCBvcHRpb25zKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChvcHRpb25zID09PSB2b2lkIDApIHsgb3B0aW9ucyA9IHt9OyB9XG4gICAgICAgIHRoaXMuX2NoZWNrQWxsVmFsdWVzUHJlc2VudCh2YWx1ZSk7XG4gICAgICAgIHZhbHVlLmZvckVhY2goZnVuY3Rpb24gKG5ld1ZhbHVlLCBpbmRleCkge1xuICAgICAgICAgICAgX3RoaXMuX3Rocm93SWZDb250cm9sTWlzc2luZyhpbmRleCk7XG4gICAgICAgICAgICBfdGhpcy5hdChpbmRleCkuc2V0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Ugb2YgdGhlIGNvbnRyb2wsIGFuZCB3aWxsIGRvIGl0cyBiZXN0IHRvIG1hdGNoIHRoZSB2YWx1ZXMgdG8gdGhlIGNvcnJlY3RcbiAgICAgKiAgY29udHJvbHMgaW4gdGhlIGdyb3VwLlxuICAgICAqXG4gICAgICogIEl0IGFjY2VwdHMgYm90aCBzdXBlci1zZXRzIGFuZCBzdWItc2V0cyBvZiB0aGUgYXJyYXkgd2l0aG91dCB0aHJvd2luZyBhbiBlcnJvci5cbiAgICAgKlxuICAgICAqICAjIyMgRXhhbXBsZVxuICAgICAqXG4gICAgICogIGBgYFxuICAgICAqICBjb25zdCBhcnIgPSBuZXcgRm9ybUFycmF5KFtcbiAgICAgKiAgICAgbmV3IEZvcm1Db250cm9sKCksXG4gICAgICogICAgIG5ldyBGb3JtQ29udHJvbCgpXG4gICAgICogIF0pO1xuICAgICAqICBjb25zb2xlLmxvZyhhcnIudmFsdWUpOyAgIC8vIFtudWxsLCBudWxsXVxuICAgICAqXG4gICAgICogIGFyci5wYXRjaFZhbHVlKFsnTmFuY3knXSk7XG4gICAgICogIGNvbnNvbGUubG9nKGFyci52YWx1ZSk7ICAgLy8gWydOYW5jeScsIG51bGxdXG4gICAgICogIGBgYFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcGFyYW0gez89fSBvcHRpb25zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUsIG9wdGlvbnMpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgaWYgKG9wdGlvbnMgPT09IHZvaWQgMCkgeyBvcHRpb25zID0ge307IH1cbiAgICAgICAgdmFsdWUuZm9yRWFjaChmdW5jdGlvbiAobmV3VmFsdWUsIGluZGV4KSB7XG4gICAgICAgICAgICBpZiAoX3RoaXMuYXQoaW5kZXgpKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuYXQoaW5kZXgpLnBhdGNoVmFsd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b2RlbCxcXG4gICAgICAgIHlvdSBtYXkgd2FudCB0byBjaGVjayBuZXh0IHRpY2sgKGUuZy4gdXNlIHNldFRpbWVvdXQpLlxcbiAgICAgIFwiKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXRoaXMuYXQoaW5kZXgpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJDYW5ub3QgZmluZCBmb3JtIGNvbnRyb2wgYXQgaW5kZXggXCIgKyBpbmRleCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY2JcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2ZvckVhY2hDaGlsZCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjYlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNiKSB7XG4gICAgICAgIHRoaXMuY29udHJvbHMuZm9yRWFjaChmdW5jdGlvbiAoY29udHJvbCwgaW5kZXgpIHsgY2IoY29udHJvbCwgaW5kZXgpOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUFycmF5LnByb3RvdHlwZS5fdXBkYXRlVmFsdWUgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnZhbHVlID1cbiAgICAgICAgICAgIHRoaXMuY29udHJvbHMuZmlsdGVyKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBjb250cm9sLmVuYWJsZWQgfHwgX3RoaXMuZGlzYWJsZWQ7IH0pXG4gICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAoY29udHJvbCkgeyByZXR1cm4gY29udHJvbC52YWx1ZTsgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbmRpdGlvblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUFycmF5LnByb3RvdHlwZS5fYW55Q29udHJvbHMgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gY29uZGl0aW9uXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZGl0aW9uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNvbnRyb2xzLnNvbWUoZnVuY3Rpb24gKGNvbnRyb2wpIHsgcmV0dXJuIGNvbnRyb2wuZW5hYmxlZCAmJiBjb25kaXRpb24oY29udHJvbCk7IH0pO1xuICAgIH07XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXkucHJvdG90eXBlLl9zZXRVcENvbnRyb2xzID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdGhpcy5fZm9yRWFjaENoaWxkKGZ1bmN0aW9uIChjb250cm9sKSB7IHJldHVybiBfdGhpcy5fcmVnaXN0ZXJDb250cm9sKGNvbnRyb2wpOyB9KTtcbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2NoZWNrQWxsVmFsdWVzUHJlc2VudCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHRoaXMuX2ZvckVhY2hDaGlsZChmdW5jdGlvbiAoY29udHJvbCwgaSkge1xuICAgICAgICAgICAgaWYgKHZhbHVlW2ldID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJNdXN0IHN1cHBseSBhIHZhbHVlIGZvciBmb3JtIGNvbnRyb2wgYXQgaW5kZXg6IFwiICsgaSArIFwiLlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheS5wcm90b3R5cGUuX2FsbENvbnRyb2xzRGlzYWJsZWQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIF9hID0gdGhpcy5jb250cm9sczsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIHZhciBjb250cm9sID0gX2FbX2ldO1xuICAgICAgICAgICAgaWYgKGNvbnRyb2wuZW5hYmxlZClcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgIC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ZXJ0eShOZ0Zvcm0ucHJvdG90eXBlLCBcImNvbnRyb2xzXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMuZm9ybS5jb250cm9sczsgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nRm9ybS5wcm90b3R5cGUuYWRkQ29udHJvbCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJlc29sdmVkUHJvbWlzZS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRhaW5lciA9IF90aGlzLl9maW5kQ29udGFpbmVyKGRpci5wYXRoKTtcbiAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChkaXIpKS5jb250cm9sID0gLyoqIEB0eXBlIHs/fSAqLyAoY29udGFpbmVyLnJlZ2lzdGVyQ29udHJvbChkaXIubmFtZSwgZGlyLmNvbnRyb2wpKTtcbiAgICAgICAgICAgIHNldFVwQ29udHJvbChkaXIuY29udHJvbCwgZGlyKTtcbiAgICAgICAgICAgIGRpci5jb250cm9sLnVwZGF0ZVZhbHVlQW5kVmFsaWRpdHkoeyBlbWl0RXZlbnQ6IGZhbHNlIH0pO1xuICAgICAgICAgICAgX3RoaXMuX2RpcmVjdGl2ZXMucHVzaChkaXIpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmdldENvbnRyb2wgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5mb3JtLmdldChkaXIucGF0aCkpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLnJlbW92ZUNvbnRyb2wgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb250YWluZXIgPSBfdGhpcy5fZmluZENvbnRhaW5lcihkaXIucGF0aCk7XG4gICAgICAgICAgICBpZiAoY29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyLnJlbW92ZUNvbnRyb2woZGlyLm5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVtb3ZlRGlyKF90aGlzLl9kaXJlY3RpdmVzLCBkaXIpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmFkZEZvcm1Hcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJlc29sdmVkUHJvbWlzZS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRhaW5lciA9IF90aGlzLl9maW5kQ29udGFpbmVyKGRpci5wYXRoKTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGdyb3VwID0gbmV3IEZvcm1Hcm91cCh7fSk7XG4gICAgICAgICAgICBzZXRVcEZvcm1Db250YWluZXIoZ3JvdXAsIGRpcik7XG4gICAgICAgICAgICBjb250YWluZXIucmVnaXN0ZXJDb250cm9sKGRpci5uYW1lLCBncm91cCk7XG4gICAgICAgICAgICBncm91cC51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KHsgZW1pdEV2ZW50OiBmYWxzZSB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5yZW1vdmVGb3JtR3JvdXAgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb250YWluZXIgPSBfdGhpcy5fZmluZENvbnRhaW5lcihkaXIucGF0aCk7XG4gICAgICAgICAgICBpZiAoY29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyLnJlbW92ZUNvbnRyb2woZGlyLm5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLmdldEZvcm1Hcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7IHJldHVybiAvKiogQHR5cGUgez99ICovICh0aGlzLmZvcm0uZ2V0KGRpci5wYXRoKSk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLnVwZGF0ZU1vZGVsID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyLCB2YWx1ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXNvbHZlZFByb21pc2UudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdHJsID0gLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMuZm9ybS5nZXQoLyoqIEB0eXBlIHs/fSAqLyAoKGRpci5wYXRoKSkpKTtcbiAgICAgICAgICAgIGN0cmwuc2V0VmFsdWUodmFsdWUpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nRm9ybS5wcm90b3R5cGUuc2V0VmFsdWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodmFsdWUpIHsgdGhpcy5jb250cm9sLnNldFZhbHVlKHZhbHVlKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99ICRldmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5vblN1Ym1pdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gJGV2ZW50XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoJGV2ZW50KSB7XG4gICAgICAgICgvKiogQHR5cGUgez99ICovICh0aGlzKSkuc3VibWl0dGVkID0gdHJ1ZTtcbiAgICAgICAgc3luY1BlbmRpbmdDb250cm9scyh0aGlzLmZvcm0sIHRoaXMuX2RpcmVjdGl2ZXMpO1xuICAgICAgICB0aGlzLm5nU3VibWl0LmVtaXQoJGV2ZW50KTtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ0Zvcm0ucHJvdG90eXBlLm9uUmVzZXQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHsgdGhpcy5yZXNldEZvcm0oKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez89fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5yZXNldEZvcm0gPSAvKipcbiAgICAgKiBAcGFyYW0gez89fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIGlmICh2YWx1ZSA9PT0gdm9pZCAwKSB7IHZhbHVlID0gdW5kZWZpbmVkOyB9XG4gICAgICAgIHRoaXMuZm9ybS5yZXNldCh2YWx1ZSk7XG4gICAgICAgICgvKiogQHR5cGUgez99ICovICh0aGlzKSkuc3VibWl0dGVkID0gZmFsc2U7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nRm9ybS5wcm90b3R5cGUuX3NldFVwZGF0ZVN0cmF0ZWd5ID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMgJiYgdGhpcy5vcHRpb25zLnVwZGF0ZU9uICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybS5fdXBkYXRlT24gPSB0aGlzLm9wdGlvbnMudXBkYXRlT247XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gcGF0aFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdGb3JtLnByb3RvdHlwZS5fZmluZENvbnRhaW5lciA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBwYXRoXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocGF0aCkge1xuICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICByZXR1cm4gcGF0aC5sZW5ndGggPyAvKiogQHR5cGUgez99ICovICh0aGlzLmZvcm0uZ2V0KHBhdGgpKSA6IHRoaXMuZm9ybTtcbiAgICB9O1xuICAgIE5nRm9ybS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdmb3JtOm5vdChbbmdOb0Zvcm1dKTpub3QoW2Zvcm1Hcm91cF0pLG5nRm9ybSxbbmdGb3JtXScsXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVycz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m9wdGlvbnMudXBkYXRlT247XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX2lzU3RhbmRhbG9uZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gIXRoaXMuX3BhcmVudCB8fCAhISh0aGlzLm9wdGlvbnMgJiYgdGhpcy5vcHRpb25zLnN0YW5kYWxvbmUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBOZ01vZGVsLnByb3RvdHlwZS5fc2V0VXBTdGFuZGFsb25lID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHNldFVwQ29udHJvbCh0aGlzLmNvbnRyb2wsIHRoaXMpO1xuICAgICAgICB0aGlzLmNvbnRyb2wudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSh7IGVtaXRFdmVudDogZmFsc2UgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIE5nTW9kZWwucHJvdG90eXBlLl9jaGVja0ZvckVycm9ycyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoIXRoaXMuX2lzU3RhbmRhbG9uZSgpKSB7XG4gICAgICAgICAgICB0aGlzLl9jaGVja1BhcmVudFR5cGUoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9jaGVja05hbWUoKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX2NoZWNrUGFyZW50VHlwZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoISh0aGlzLl9wYXJlbnQgaW5zdGFuY2VvZiBOZ01vZGVsR3JvdXApICYmXG4gICAgICAgICAgICB0aGlzLl9wYXJlbnQgaW5zdGFuY2VvZiBBYnN0cmFjdEZvcm1Hcm91cERpcmVjdGl2ZSkge1xuICAgICAgICAgICAgVGVtcGxhdGVEcml2ZW5FcnJvcnMuZm9ybUdyb3VwTmFtZUV4Y2VwdGlvbigpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKCEodGhpcy5fcGFyZW50IGluc3RhbmNlb2YgTmdNb2RlbEdyb3VwKSAmJiAhKHRoaXMuX3BhcmVudCBpbnN0YW5jZW9mIE5nRm9ybSkpIHtcbiAgICAgICAgICAgIFRlbXBsYXRlRHJpdmVuRXJyb3JzLm1vZGVsUGFyZW50RXhjZXB0aW9uKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX2NoZWNrTmFtZSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zICYmIHRoaXMub3B0aW9ucy5uYW1lKVxuICAgICAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5vcHRpb25zLm5hbWU7XG4gICAgICAgIGlmICghdGhpcy5faXNTdGFuZGFsb25lKCkgJiYgIXRoaXMubmFtZSkge1xuICAgICAgICAgICAgVGVtcGxhdGVEcml2ZW5FcnJvcnMubWlzc2luZ05hbWVFeGNlcHRpb24oKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2YWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTmdNb2RlbC5wcm90b3R5cGUuX3VwZGF0ZVZhbHV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ICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJwYXRoXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtdOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5hZGRDb250cm9sID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChkaXIpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY3RybCA9IHRoaXMuZm9ybS5nZXQoZGlyLnBhdGgpO1xuICAgICAgICBzZXRVcENvbnRyb2woY3RybCwgZGlyKTtcbiAgICAgICAgY3RybC51cGRhdGVWYWx1ZUFuZFZhbGlkaXR5KHsgZW1pdEV2ZW50OiBmYWxzZSB9KTtcbiAgICAgICAgdGhpcy5kaXJlY3RpdmVzLnB1c2goZGlyKTtcbiAgICAgICAgcmV0dXJuIGN0cmw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5nZXRDb250cm9sID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBkaXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAg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IGZ1bmN0aW9uIChkaXIpIHsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5nZXRGb3JtR3JvdXAgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5mb3JtLmdldChkaXIucGF0aCkpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtR3JvdXBEaXJlY3RpdmUucHJvdG90eXBlLmFkZEZvcm1BcnJheSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZGlyKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGN0cmwgPSB0aGlzLmZvcm0uZ2V0KGRpci5wYXRoKTtcbiAgICAgICAgc2V0VXBGb3JtQ29udGFpbmVyKGN0cmwsIGRpcik7XG4gICAgICAgIGN0cmwudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSh7IGVtaXRFdmVudDogZmFsc2UgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRm9ybUdyb3VwRGlyZWN0aXZlLnByb3RvdHlwZS5yZW1vdmVGb3JtQXJyYXkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGRpclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGRpcikgeyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gZGlyXG4gICAgICogQ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ICAgIF90aGlzLl9wYXJlbnQgPSBwYXJlbnQ7XG4gICAgICAgIF90aGlzLl92YWxpZGF0b3JzID0gdmFsaWRhdG9ycztcbiAgICAgICAgX3RoaXMuX2FzeW5jVmFsaWRhdG9ycyA9IGFzeW5jVmFsaWRhdG9ycztcbiAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1BcnJheU5hbWUucHJvdG90eXBlLm5nT25Jbml0ID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMuX2NoZWNrUGFyZW50VHlwZSgpOyAvKiogQHR5cGUgez99ICovXG4gICAgICAgICgodGhpcy5mb3JtRGlyZWN0aXZlKSkuYWRkRm9ybUFycmF5KHRoaXMpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBGb3JtQXJyYXlOYW1lLnByb3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5mb3JtRGlyZWN0aXZlKSB7XG4gICAgICAgICAgICB0aGlzLmZvcm1EaXJlY3RpdmUucmVtb3ZlRm9ybUFycmF5KHRoaXMpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwiY29udHJvbFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiAvKiogQHR5cGUgez99ICovICgodGhpcy5mb3JtRGlyZWN0aXZlKSkuZ2V0Rm9ybUFycmF5KHRoaXMpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwiZm9ybURpcmVjdGl2ZVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcGFyZW50ID8gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5fcGFyZW50LmZvcm1EaXJlY3RpdmUpIDogbnVsbDtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZvcm1BcnJheU5hbWUucHJvdG90eXBlLCBcInBhdGhcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gY29udHJvbFBhdGgodGhpcy5uYW1lLCB0aGlzLl9wYXJlbnQpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoRm9ybUFycmF5TmFtZS5wcm90b3R5cGUsIFwidmFsaWRhdG9yXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHsgcmV0dXJuIGNvbXBvc2VWYWxpZGF0b3JzKHRoaXMuX3ZhbGlkYXRvcnMpOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0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AgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUmVxdWlyZWRWYWxpZGF0b3IucHJvdG90eXBlLnZhbGlkYXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYykge1xuICAgICAgICByZXR1cm4gdGhpcy5yZXF1aXJlZCA/IFZhbGlkYXRvcnMucmVxdWlyZWQoYykgOiBudWxsO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUmVxdWlyZWRWYWxpZGF0b3IucHJvdG90eXBlLnJlZ2lzdGVyT25WYWxpZGF0b3JDaGFuZ2UgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHsgdGhpcy5fb25DaGFuZ2UgPSBmbjsgfTtcbiAgICBSZXF1aXJlZFZhbGlkYXRvci5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICc6bm90KFt0eXBlPWNoZWNrYm94XSlbcmVxdWlyZWRdW2Zvcm1Db250cm9sTmFtZV0sOm5vdChbdHlwZT1jaGVja2JveF0pW3JlcXVpcmVkXVtmb3JtQ29udHJvbF0sOm5vdChbdHlwZT1jaGVja2JveF0pW3JlcXVpcmVkXVtuZ01vZGVsXScsXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1JFUVVJUkVEX1ZBTElEQVRPUl0sXG4gICAgICAgICAgICAgICAgICAgIGhvc3Q6IHsgJ1thdHRyLnJlcXVpcmVkXSc6ICdyZXF1aXJlZCA/IFwiXCIgOiBudWxsJyB9XG4gICAgICAgICAgICAgICAgfSxdIH0sXG4gICAgXTtcbiAgICAv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AgICovXG4gICAgICAgIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fZW5hYmxlZCA9IHZhbHVlID09PSAnJyB8fCB2YWx1ZSA9PT0gdHJ1ZSB8fCB2YWx1ZSA9PT0gJ3RydWUnO1xuICAgICAgICAgICAgaWYgKHRoaXMuX29uQ2hhbmdlKVxuICAgICAgICAgICAgICAgIHRoaXMuX29uQ2hhbmdlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRW1haWxWYWxpZGF0b3IucHJvdG90eXBlLnZhbGlkYXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYykge1xuICAgICAgICByZXR1cm4gdGhpcy5fZW5hYmxlZCA/IFZhbGlkYXRvcnMuZW1haWwoYykgOiBudWxsO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRW1haWxWYWxpZGF0b3IucHJvdG90eXBlLnJlZ2lzdGVyT25WYWxpZGF0b3JDaGFuZ2UgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHsgdGhpcy5fb25DaGFuZ2UgPSBmbjsgfTtcbiAgICBFbWFpbFZhbGlkYXRvci5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdbZW1haWxdW2Zvcm1Db250cm9sTmFtZV0s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3IgYW55IGBmb3JtQ29udHJvbE5hbWVgLFxuICogYGZvcm1Db250cm9sYCwgb3IgY29udHJvbCB3aXRoIGBuZ01vZGVsYCB0aGF0IGFsc28gaGFzIGEgYG1pbmxlbmd0aGAgYXR0cmlidXRlLlxuICpcbiAqIFxcQHN0YWJsZVxuICovXG52YXIgTWluTGVuZ3RoVmFsaWRhdG9yID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE1pbkxlbmd0aFZhbGlkYXRvcigpIHtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjaGFuZ2VzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNaW5MZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLm5nT25DaGFuZ2VzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjaGFuZ2VzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY2hhbmdlcykge1xuICAgICAgICBpZiAoJ21pbmxlbmd0aCcgaW4gY2hhbmdlcykge1xuICAgICAgICAgICAgdGhpcy5fY3JlYXRlVmFsaWRhdG9yKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5fb25DaGFuZ2UpXG4gICAgICAgICAgICAgICAgdGhpcy5fb25DaGFuZ2UoKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBNaW5MZW5ndGhWYWxpZGF0b3IucHJvdG90eXBlLnZhbGlkYXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYykge1xuICAgICAgICByZXR1cm4gdGhpcy5taW5sZW5ndGggPT0gbnVsbCA/IG51bGwgOiB0aGlzLl92YWxpZGF0b3IoYyk7XG4gICAgf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biBNYXhMZW5ndGhWYWxpZGF0b3IoKSB7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWF4TGVuZ3RoVmFsaWRhdG9yLnByb3RvdHlwZS5uZ09uQ2hhbmdlcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNoYW5nZXMpIHtcbiAgICAgICAgaWYgKCdtYXhsZW5ndGgnIGluIGNoYW5nZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX2NyZWF0ZVZhbGlkYXRvcigpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX29uQ2hhbmdlKVxuICAgICAgICAgICAgICAgIHRoaXMuX29uQ2hhbmdlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWF4TGVuZ3RoVmFsaWRhdG9yLnByb3RvdHlwZS52YWxpZGF0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWF4bGVuZ3RoICE9IG51bGwgPyB0aGlzLl92YWxpZGF0b3IoYykgOiBudWxsO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgTWF4TGVuZ3RoVmFsaWRhdG9yLnByb3RvdHlwZS5yZWdpc3Rlck9uVmFsaWRhdG9yQ2hhbmdlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGZuKSB7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oqXG4gICAgICogQHBhcmFtIHs/fSBjaGFuZ2VzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY2hhbmdlcykge1xuICAgICAgICBpZiAoJ3BhdHRlcm4nIGluIGNoYW5nZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX2NyZWF0ZVZhbGlkYXRvcigpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX29uQ2hhbmdlKVxuICAgICAgICAgICAgICAgIHRoaXMuX29uQ2hhbmdlKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUGF0dGVyblZhbGlkYXRvci5wcm90b3R5cGUudmFsaWRhdGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjKSB7IHJldHVybiB0aGlzLl92YWxpZGF0b3IoYyk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBmblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUGF0dGVyblZhbGlkYXRvci5wcm90b3R5cGUucmVnaXN0ZXJPblZhbGlkYXRvckNoYW5nZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gZm5cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChmbikgeyB0aGlzLl9vbkNoYW5nZSA9IGZuOyB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUGF0dGVyblZhbGlkYXRvci5wcm90b3R5cGUuX2NyZWF0ZVZhbGlkYXRvciA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB0aGlzLl92YWxpZGF0b3IgPSBWYWxpZGF0b3JzLnBhdHRlcm4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oY29udHJvbE5hbWUpIHtcbiAgICAgICAgICAgIGNvbnRyb2xzW2NvbnRyb2xOYW1lXSA9IF90aGlzLl9jcmVhdGVDb250cm9sKGNvbnRyb2xzQ29uZmlnW2NvbnRyb2xOYW1lXSk7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gY29udHJvbHM7XG4gICAgfTtcbiAgICAvKiogQGludGVybmFsICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGNvbnRyb2xDb25maWdcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEZvcm1CdWlsZGVyLnByb3RvdHlwZS5fY3JlYXRlQ29udHJvbCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSBjb250cm9sQ29uZmlnXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29udHJvbENvbmZpZykge1xuICAgICAgICBpZiAoY29udHJvbENvbmZpZyBpbnN0YW5jZW9mIEZvcm1Db250cm9sIHx8IGNvbnRyb2xDb25maWcgaW5zdGFuY2VvZiBGb3JtR3JvdXAgfHxcbiAgICAgICAgICAgIGNvbnRyb2xDb25maWcgaW5zdGFuY2VvZiBGb3JtQXJyYXkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb250cm9sQ29uZmlnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29udHJvbENvbmZpZykpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbHVlID0gY29udHJvbENvbmZpZ1swXTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbGlkYXRvciA9IGNvbnRyb2xDb25maWcubGVuZ3RoID4gMSA/IGNvbnRyb2xDb25maWdbMV0gOiBudWxsO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXN5bmNWY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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///20\n"); /***/ }), +/* 21 */, /* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -117,7 +117,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCalendar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbCalendarGregorian; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nfunction fromJSDate(jsDate) {\n return new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());\n}\nfunction toJSDate(date) {\n var jsDate = new Date(date.year, date.month - 1, date.day, 12);\n // this is done avoid 30 -> 1930 conversion\n if (!isNaN(jsDate.getTime())) {\n jsDate.setFullYear(date.year);\n }\n return jsDate;\n}\nvar NgbCalendar = (function () {\n function NgbCalendar() {\n }\n NgbCalendar.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendar.ctorParameters = function () { return []; };\n return NgbCalendar;\n}());\n\nvar NgbCalendarGregorian = (function (_super) {\n __extends(NgbCalendarGregorian, _super);\n function NgbCalendarGregorian() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbCalendarGregorian.prototype.getDaysPerWeek = function () { return 7; };\n NgbCalendarGregorian.prototype.getMonths = function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };\n NgbCalendarGregorian.prototype.getWeeksPerMonth = function () { return 6; };\n NgbCalendarGregorian.prototype.getNext = function (date, period, number) {\n if (period === void 0) { period = 'd'; }\n if (number === void 0) { number = 1; }\n var jsDate = toJSDate(date);\n switch (period) {\n case 'y':\n return new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year + number, 1, 1);\n case 'm':\n jsDate = new Date(date.year, date.month + number - 1, 1, 12);\n break;\n case 'd':\n jsDate.setDate(jsDate.getDate() + number);\n break;\n default:\n return date;\n }\n return fromJSDate(jsDate);\n };\n NgbCalendarGregorian.prototype.getPrev = function (date, period, number) {\n if (period === void 0) { period = 'd'; }\n if (number === void 0) { number = 1; }\n return this.getNext(date, period, -number);\n };\n NgbCalendarGregorian.prototype.getWeekday = function (date) {\n var jsDate = toJSDate(date);\n var day = jsDate.getDay();\n // in JS Date Sun=0, in ISO 8601 Sun=7\n return day === 0 ? 7 : day;\n };\n NgbCalendarGregorian.prototype.getWeekNumber = function (week, firstDayOfWeek) {\n // in JS Date Sun=0, in ISO 8601 Sun=7\n if (firstDayOfWeek === 7) {\n firstDayOfWeek = 0;\n }\n var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\n var date = week[thursdayIndex];\n var jsDate = toJSDate(date);\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\n var time = jsDate.getTime();\n jsDate.setMonth(0); // Compare with Jan 1\n jsDate.setDate(1);\n return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;\n };\n NgbCalendarGregorian.prototype.getToday = function () { return fromJSDate(new Date()); };\n NgbCalendarGregorian.prototype.isValid = function (date) {\n if (!date || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.year) || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.month) || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.day)) {\n return false;\n }\n var jsDate = toJSDate(date);\n return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&\n jsDate.getDate() === date.day;\n };\n NgbCalendarGregorian.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendarGregorian.ctorParameters = function () { return []; };\n return NgbCalendarGregorian;\n}(NgbCalendar));\n\n//# sourceMappingURL=ngb-calendar.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvZGF0ZXBpY2tlci9uZ2ItY2FsZW5kYXIuanM/OTVjNiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX19leHRlbmRzID0gKHRoaXMgJiYgdGhpcy5fX2V4dGVuZHMpIHx8IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGV4dGVuZFN0YXRpY3MgPSBPYmplY3Quc2V0UHJvdG90eXBlT2YgfHxcbiAgICAgICAgKHsgX19wcm90b19fOiBbXSB9IGluc3RhbmNlb2YgQXJyYXkgJiYgZnVuY3Rpb24gKGQsIGIpIHsgZC5fX3Byb3RvX18gPSBiOyB9KSB8fFxuICAgICAgICBmdW5jdGlvbiAoZCwgYikgeyBmb3IgKHZhciBwIGluIGIpIGlmIChiLmhhc093blByb3Blcn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291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///54\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCalendar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbCalendarGregorian; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nfunction fromJSDate(jsDate) {\n return new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());\n}\nfunction toJSDate(date) {\n var jsDate = new Date(date.year, date.month - 1, date.day, 12);\n // this is done avoid 30 -> 1930 conversion\n if (!isNaN(jsDate.getTime())) {\n jsDate.setFullYear(date.year);\n }\n return jsDate;\n}\nvar NgbCalendar = (function () {\n function NgbCalendar() {\n }\n NgbCalendar.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendar.ctorParameters = function () { return []; };\n return NgbCalendar;\n}());\n\nvar NgbCalendarGregorian = (function (_super) {\n __extends(NgbCalendarGregorian, _super);\n function NgbCalendarGregorian() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbCalendarGregorian.prototype.getDaysPerWeek = function () { return 7; };\n NgbCalendarGregorian.prototype.getMonths = function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };\n NgbCalendarGregorian.prototype.getWeeksPerMonth = function () { return 6; };\n NgbCalendarGregorian.prototype.getNext = function (date, period, number) {\n if (period === void 0) { period = 'd'; }\n if (number === void 0) { number = 1; }\n var jsDate = toJSDate(date);\n switch (period) {\n case 'y':\n return new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year + number, 1, 1);\n case 'm':\n jsDate = new Date(date.year, date.month + number - 1, 1, 12);\n break;\n case 'd':\n jsDate.setDate(jsDate.getDate() + number);\n break;\n default:\n return date;\n }\n return fromJSDate(jsDate);\n };\n NgbCalendarGregorian.prototype.getPrev = function (date, period, number) {\n if (period === void 0) { period = 'd'; }\n if (number === void 0) { number = 1; }\n return this.getNext(date, period, -number);\n };\n NgbCalendarGregorian.prototype.getWeekday = function (date) {\n var jsDate = toJSDate(date);\n var day = jsDate.getDay();\n // in JS Date Sun=0, in ISO 8601 Sun=7\n return day === 0 ? 7 : day;\n };\n NgbCalendarGregorian.prototype.getWeekNumber = function (week, firstDayOfWeek) {\n // in JS Date Sun=0, in ISO 8601 Sun=7\n if (firstDayOfWeek === 7) {\n firstDayOfWeek = 0;\n }\n var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\n var date = week[thursdayIndex];\n var jsDate = toJSDate(date);\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\n var time = jsDate.getTime();\n jsDate.setMonth(0); // Compare with Jan 1\n jsDate.setDate(1);\n return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;\n };\n NgbCalendarGregorian.prototype.getToday = function () { return fromJSDate(new Date()); };\n NgbCalendarGregorian.prototype.isValid = function (date) {\n if (!date || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.year) || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.month) || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"c\" /* isInteger */])(date.day)) {\n return false;\n }\n var jsDate = toJSDate(date);\n return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&\n jsDate.getDate() === date.day;\n };\n NgbCalendarGregorian.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendarGregorian.ctorParameters = function () { return []; };\n return NgbCalendarGregorian;\n}(NgbCalendar));\n\n//# sourceMappingURL=ngb-calendar.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvZGF0ZXBpY2tlci9uZ2ItY2FsZW5kYXIuanM/OTVjNiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX19leHRlbmRzID0gKHRoaXMgJiYgdGhpcy5fX2V4dGVuZHMpIHx8IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGV4dGVuZFN0YXRpY3MgPSBPYmplY3Quc2V0UHJvdG90eXBlT2YgfHxcbiAgICAgICAgKHsgX19wcm90b19fOiBbXSB9IGluc3RhbmNlb2YgQXJyYXkgJiYgZnVuY3Rpb24gKGQsIGIpIHsgZC5fX3Byb3RvX18gPSBiOyB9KSB8fFxuICAgICAgICBmdW5jdGlvbiAoZCwgYikgeyBmb3IgKHZhciBwIGluIGIpIGlmIChiLmhhc093blByb3BlcnR5KHApKSBkW3BdID0gYltwXTsgfTtcbiAgICByZXR1cm4gZnVuY3Rpb24gKGQsIGIpIHtcbiAgICAgICAgZXh0ZW5kU3RhdGljcyhkLCBiKTtcbiAgICAgICAgZnVuY3Rpb24gX18oKSB7IHRoaXMuY29uc3RydWN0b3IgPSBkOyB9XG4gICAgICAg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LWNhbGVuZGFyLmpzXG4vLyBtb2R1bGUgaWQgPSA1NFxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///54\n"); /***/ }), /* 55 */, @@ -153,7 +153,7 @@ eval("\nvar __extends = (this && this.__extends) || function (d, b) {\n for ( /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLink\", function() { return RouterLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLinkWithHref\", function() { return RouterLinkWithHref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLinkActive\", function() { return RouterLinkActive; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterOutlet\", function() { return RouterOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivationEnd\", function() { return ActivationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivationStart\", function() { return ActivationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildActivationEnd\", function() { return ChildActivationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildActivationStart\", function() { return ChildActivationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GuardsCheckEnd\", function() { return GuardsCheckEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GuardsCheckStart\", function() { return GuardsCheckStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationCancel\", function() { return NavigationCancel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationEnd\", function() { return NavigationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationError\", function() { return NavigationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationStart\", function() { return NavigationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResolveEnd\", function() { return ResolveEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResolveStart\", function() { return ResolveStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteConfigLoadEnd\", function() { return RouteConfigLoadEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteConfigLoadStart\", function() { return RouteConfigLoadStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterEvent\", function() { return RouterEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RoutesRecognized\", function() { return RoutesRecognized; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteReuseStrategy\", function() { return RouteReuseStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Router\", function() { return Router; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTES\", function() { return ROUTES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTER_CONFIGURATION\", function() { return ROUTER_CONFIGURATION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTER_INITIALIZER\", function() { return ROUTER_INITIALIZER; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterModule\", function() { return RouterModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"provideRoutes\", function() { return provideRoutes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildrenOutletContexts\", function() { return ChildrenOutletContexts; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OutletContext\", function() { return OutletContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NoPreloading\", function() { return NoPreloading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PreloadAllModules\", function() { return PreloadAllModules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PreloadingStrategy\", function() { return PreloadingStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterPreloader\", function() { return RouterPreloader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivatedRoute\", function() { return ActivatedRoute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivatedRouteSnapshot\", function() { return ActivatedRouteSnapshot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterState\", function() { return RouterState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterStateSnapshot\", function() { return RouterStateSnapshot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PRIMARY_OUTLET\", function() { return PRIMARY_OUTLET; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertToParamMap\", function() { return convertToParamMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlHandlingStrategy\", function() { return UrlHandlingStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultUrlSerializer\", function() { return DefaultUrlSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSegment\", function() { return UrlSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSegmentGroup\", function() { return UrlSegmentGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSerializer\", function() { return UrlSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlTree\", function() { return UrlTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵROUTER_PROVIDERS\", function() { return ROUTER_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵflatten\", function() { return flatten; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return ROUTER_FORROOT_GUARD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return RouterInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return getAppInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return getBootstrapListener; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return provideForRootGuard; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return provideLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵj\", function() { return provideRouterInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return rootRoute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return routerNgProbeToken; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return setupRouter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵk\", function() { return Tree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵl\", function() { return TreeNode; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__ = __webpack_require__(165);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__ = __webpack_require__(118);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__ = __webpack_require__(243);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__ = __webpack_require__(510);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__ = __webpack_require__(10);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__ = __webpack_require__(511);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__ = __webpack_require__(246);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__ = __webpack_require__(518);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__ = __webpack_require__(520);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__ = __webpack_require__(166);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__ = __webpack_require__(247);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__ = __webpack_require__(522);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__ = __webpack_require__(524);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__ = __webpack_require__(526);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__ = __webpack_require__(527);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__angular_platform_browser__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Base for events the Router goes through, as opposed to events tied to a specific\n * Route. `RouterEvent`s will only be fired one time for any given navigation.\n *\n * Example:\n *\n * ```\n * class MyService {\n * constructor(public router: Router, logger: Logger) {\n * router.events.filter(e => e instanceof RouterEvent).subscribe(e => {\n * logger.log(e.id, e.url);\n * });\n * }\n * }\n * ```\n *\n * \\@experimental\n */\nvar RouterEvent = /** @class */ (function () {\n function RouterEvent(id, url) {\n this.id = id;\n this.url = url;\n }\n return RouterEvent;\n}());\n/**\n * \\@whatItDoes Represents an event triggered when a navigation starts.\n *\n * \\@stable\n */\nvar NavigationStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationStart, _super);\n function NavigationStart() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationStart.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return \"NavigationStart(id: \" + this.id + \", url: '\" + this.url + \"')\"; };\n return NavigationStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation ends successfully.\n *\n * \\@stable\n */\nvar NavigationEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationEnd, _super);\n function NavigationEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationEnd.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"NavigationEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"')\";\n };\n return NavigationEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation is canceled.\n *\n * \\@stable\n */\nvar NavigationCancel = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationCancel, _super);\n function NavigationCancel(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, reason) {\n var _this = _super.call(this, id, url) || this;\n _this.reason = reason;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationCancel.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return \"NavigationCancel(id: \" + this.id + \", url: '\" + this.url + \"')\"; };\n return NavigationCancel;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation fails due to an unexpected error.\n *\n * \\@stable\n */\nvar NavigationError = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationError, _super);\n function NavigationError(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, error) {\n var _this = _super.call(this, id, url) || this;\n _this.error = error;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationError.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"NavigationError(id: \" + this.id + \", url: '\" + this.url + \"', error: \" + this.error + \")\";\n };\n return NavigationError;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when routes are recognized.\n *\n * \\@stable\n */\nvar RoutesRecognized = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RoutesRecognized, _super);\n function RoutesRecognized(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n RoutesRecognized.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"RoutesRecognized(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return RoutesRecognized;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the start of the Guard phase of routing.\n *\n * \\@experimental\n */\nvar GuardsCheckStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GuardsCheckStart, _super);\n function GuardsCheckStart(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n GuardsCheckStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"GuardsCheckStart(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return GuardsCheckStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the end of the Guard phase of routing.\n *\n * \\@experimental\n */\nvar GuardsCheckEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GuardsCheckEnd, _super);\n function GuardsCheckEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state, shouldActivate) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n _this.shouldActivate = shouldActivate;\n return _this;\n }\n /**\n * @return {?}\n */\n GuardsCheckEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"GuardsCheckEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \", shouldActivate: \" + this.shouldActivate + \")\";\n };\n return GuardsCheckEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the start of the Resolve phase of routing. The timing of this\n * event may change, thus it's experimental. In the current iteration it will run\n * in the \"resolve\" phase whether there's things to resolve or not. In the future this\n * behavior may change to only run when there are things to be resolved.\n *\n * \\@experimental\n */\nvar ResolveStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ResolveStart, _super);\n function ResolveStart(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n ResolveStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"ResolveStart(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return ResolveStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the end of the Resolve phase of routing. See note on\n * {\\@link ResolveStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ResolveEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ResolveEnd, _super);\n function ResolveEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n ResolveEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"ResolveEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return ResolveEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered before lazy loading a route config.\n *\n * \\@experimental\n */\nvar RouteConfigLoadStart = /** @class */ (function () {\n function RouteConfigLoadStart(route) {\n this.route = route;\n }\n /**\n * @return {?}\n */\n RouteConfigLoadStart.prototype.toString = /**\n * @return {?}\n */\n function () { return \"RouteConfigLoadStart(path: \" + this.route.path + \")\"; };\n return RouteConfigLoadStart;\n}());\n/**\n * \\@whatItDoes Represents an event triggered when a route has been lazy loaded.\n *\n * \\@experimental\n */\nvar RouteConfigLoadEnd = /** @class */ (function () {\n function RouteConfigLoadEnd(route) {\n this.route = route;\n }\n /**\n * @return {?}\n */\n RouteConfigLoadEnd.prototype.toString = /**\n * @return {?}\n */\n function () { return \"RouteConfigLoadEnd(path: \" + this.route.path + \")\"; };\n return RouteConfigLoadEnd;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ChildActivationEnd} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ChildActivationStart = /** @class */ (function () {\n function ChildActivationStart(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ChildActivationStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ChildActivationStart(path: '\" + path + \"')\";\n };\n return ChildActivationStart;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ChildActivationStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ChildActivationEnd = /** @class */ (function () {\n function ChildActivationEnd(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ChildActivationEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ChildActivationEnd(path: '\" + path + \"')\";\n };\n return ChildActivationEnd;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ActivationEnd} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ActivationStart = /** @class */ (function () {\n function ActivationStart(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ActivationStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ActivationStart(path: '\" + path + \"')\";\n };\n return ActivationStart;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ActivationStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ActivationEnd = /** @class */ (function () {\n function ActivationEnd(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ActivationEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ActivationEnd(path: '\" + path + \"')\";\n };\n return ActivationEnd;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Name of the primary outlet.\n *\n * \\@stable\n */\nvar PRIMARY_OUTLET = 'primary';\n/**\n * Matrix and Query parameters.\n *\n * `ParamMap` makes it easier to work with parameters as they could have either a single value or\n * multiple value. Because this should be known by the user, calling `get` or `getAll` returns the\n * correct type (either `string` or `string[]`).\n *\n * The API is inspired by the URLSearchParams interface.\n * see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n *\n * \\@stable\n * @record\n */\n\nvar ParamsAsMap = /** @class */ (function () {\n function ParamsAsMap(params) {\n this.params = params || {};\n }\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.has = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { return this.params.hasOwnProperty(name); };\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.get = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.has(name)) {\n var /** @type {?} */ v = this.params[name];\n return Array.isArray(v) ? v[0] : v;\n }\n return null;\n };\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.getAll = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.has(name)) {\n var /** @type {?} */ v = this.params[name];\n return Array.isArray(v) ? v : [v];\n }\n return [];\n };\n Object.defineProperty(ParamsAsMap.prototype, \"keys\", {\n get: /**\n * @return {?}\n */\n function () { return Object.keys(this.params); },\n enumerable: true,\n configurable: true\n });\n return ParamsAsMap;\n}());\n/**\n * Convert a {\\@link Params} instance to a {\\@link ParamMap}.\n *\n * \\@stable\n * @param {?} params\n * @return {?}\n */\nfunction convertToParamMap(params) {\n return new ParamsAsMap(params);\n}\nvar NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';\n/**\n * @param {?} message\n * @return {?}\n */\nfunction navigationCancelingError(message) {\n var /** @type {?} */ error = Error('NavigationCancelingError: ' + message);\n (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR] = true;\n return error;\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction isNavigationCancelingError(error) {\n return error && (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR];\n}\n/**\n * @param {?} segments\n * @param {?} segmentGroup\n * @param {?} route\n * @return {?}\n */\nfunction defaultUrlMatcher(segments, segmentGroup, route) {\n var /** @type {?} */ parts = /** @type {?} */ ((route.path)).split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var /** @type {?} */ posParams = {};\n // Check each config part against the actual URL\n for (var /** @type {?} */ index = 0; index < parts.length; index++) {\n var /** @type {?} */ part = parts[index];\n var /** @type {?} */ segment = segments[index];\n var /** @type {?} */ isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * See {\\@link Routes} for more details.\n * \\@stable\n * @record\n */\n\nvar LoadedRouterConfig = /** @class */ (function () {\n function LoadedRouterConfig(routes, module) {\n this.routes = routes;\n this.module = module;\n }\n return LoadedRouterConfig;\n}());\n/**\n * @param {?} config\n * @param {?=} parentPath\n * @return {?}\n */\nfunction validateConfig(config, parentPath) {\n if (parentPath === void 0) { parentPath = ''; }\n // forEach doesn't iterate undefined values\n for (var /** @type {?} */ i = 0; i < config.length; i++) {\n var /** @type {?} */ route = config[i];\n var /** @type {?} */ fullPath = getFullPath(parentPath, route);\n validateNode(route, fullPath);\n }\n}\n/**\n * @param {?} route\n * @param {?} fullPath\n * @return {?}\n */\nfunction validateNode(route, fullPath) {\n if (!route) {\n throw new Error(\"\\n Invalid configuration of route '\" + fullPath + \"': Encountered undefined route.\\n The reason might be an extra comma.\\n\\n Example:\\n const routes: Routes = [\\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\\n { path: 'dashboard', component: DashboardComponent },, << two commas\\n { path: 'detail/:id', component: HeroDetailComponent }\\n ];\\n \");\n }\n if (Array.isArray(route)) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': Array cannot be specified\");\n }\n if (!route.component && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': a componentless route cannot have a named outlet set\");\n }\n if (route.redirectTo && route.children) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and children cannot be used together\");\n }\n if (route.redirectTo && route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and loadChildren cannot be used together\");\n }\n if (route.children && route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': children and loadChildren cannot be used together\");\n }\n if (route.redirectTo && route.component) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and component cannot be used together\");\n }\n if (route.path && route.matcher) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': path and matcher cannot be used together\");\n }\n if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"'. One of the following must be provided: component, redirectTo, children or loadChildren\");\n }\n if (route.path === void 0 && route.matcher === void 0) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': routes must have either a path or a matcher specified\");\n }\n if (typeof route.path === 'string' && route.path.charAt(0) === '/') {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': path cannot start with a slash\");\n }\n if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {\n var /** @type {?} */ exp = \"The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.\";\n throw new Error(\"Invalid configuration of route '{path: \\\"\" + fullPath + \"\\\", redirectTo: \\\"\" + route.redirectTo + \"\\\"}': please provide 'pathMatch'. \" + exp);\n }\n if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': pathMatch can only be set to 'prefix' or 'full'\");\n }\n if (route.children) {\n validateConfig(route.children, fullPath);\n }\n}\n/**\n * @param {?} parentPath\n * @param {?} currentRoute\n * @return {?}\n */\nfunction getFullPath(parentPath, currentRoute) {\n if (!currentRoute) {\n return parentPath;\n }\n if (!parentPath && !currentRoute.path) {\n return '';\n }\n else if (parentPath && !currentRoute.path) {\n return parentPath + \"/\";\n }\n else if (!parentPath && currentRoute.path) {\n return currentRoute.path;\n }\n else {\n return parentPath + \"/\" + currentRoute.path;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction shallowEqualArrays(a, b) {\n if (a.length !== b.length)\n return false;\n for (var /** @type {?} */ i = 0; i < a.length; ++i) {\n if (!shallowEqual(a[i], b[i]))\n return false;\n }\n return true;\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction shallowEqual(a, b) {\n var /** @type {?} */ k1 = Object.keys(a);\n var /** @type {?} */ k2 = Object.keys(b);\n if (k1.length != k2.length) {\n return false;\n }\n var /** @type {?} */ key;\n for (var /** @type {?} */ i = 0; i < k1.length; i++) {\n key = k1[i];\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Flattens single-level nested arrays.\n * @template T\n * @param {?} arr\n * @return {?}\n */\nfunction flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n/**\n * Return the last element of an array.\n * @template T\n * @param {?} a\n * @return {?}\n */\nfunction last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}\n/**\n * Verifys all booleans in an array are `true`.\n * @param {?} bools\n * @return {?}\n */\n\n/**\n * @template K, V\n * @param {?} map\n * @param {?} callback\n * @return {?}\n */\nfunction forEach(map$$1, callback) {\n for (var /** @type {?} */ prop in map$$1) {\n if (map$$1.hasOwnProperty(prop)) {\n callback(map$$1[prop], prop);\n }\n }\n}\n/**\n * @template A, B\n * @param {?} obj\n * @param {?} fn\n * @return {?}\n */\nfunction waitForMap(obj, fn) {\n if (Object.keys(obj).length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({});\n }\n var /** @type {?} */ waitHead = [];\n var /** @type {?} */ waitTail = [];\n var /** @type {?} */ res = {};\n forEach(obj, function (a, k) {\n var /** @type {?} */ mapped = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(fn(k, a), function (r) { return res[k] = r; });\n if (k === PRIMARY_OUTLET) {\n waitHead.push(mapped);\n }\n else {\n waitTail.push(mapped);\n }\n });\n var /** @type {?} */ concat$ = __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__[\"concatAll\"].call(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"].apply(void 0, waitHead.concat(waitTail)));\n var /** @type {?} */ last$ = __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__[\"last\"].call(concat$);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(last$, function () { return res; });\n}\n/**\n * ANDs Observables by merging all input observables, reducing to an Observable verifying all\n * input Observables return `true`.\n * @param {?} observables\n * @return {?}\n */\nfunction andObservables(observables) {\n var /** @type {?} */ merged$ = __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__[\"mergeAll\"].call(observables);\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(merged$, function (result) { return result === true; });\n}\n/**\n * @template T\n * @param {?} value\n * @return {?}\n */\nfunction wrapIntoObservable(value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisObservable\"])(value)) {\n return value;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisPromise\"])(value)) {\n // Use `Promise.resolve()` to wrap promise-like instances.\n // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n // change detection.\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(Promise.resolve(value));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(/** @type {?} */ (value));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction createEmptyUrlTree() {\n return new UrlTree(new UrlSegmentGroup([], {}), {}, null);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @param {?} exact\n * @return {?}\n */\nfunction containsTree(container, containee, exact) {\n if (exact) {\n return equalQueryParams(container.queryParams, containee.queryParams) &&\n equalSegmentGroups(container.root, containee.root);\n }\n return containsQueryParams(container.queryParams, containee.queryParams) &&\n containsSegmentGroup(container.root, containee.root);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction equalQueryParams(container, containee) {\n return shallowEqual(container, containee);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction equalSegmentGroups(container, containee) {\n if (!equalPath(container.segments, containee.segments))\n return false;\n if (container.numberOfChildren !== containee.numberOfChildren)\n return false;\n for (var /** @type {?} */ c in containee.children) {\n if (!container.children[c])\n return false;\n if (!equalSegmentGroups(container.children[c], containee.children[c]))\n return false;\n }\n return true;\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction containsQueryParams(container, containee) {\n return Object.keys(containee).length <= Object.keys(container).length &&\n Object.keys(containee).every(function (key) { return containee[key] === container[key]; });\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction containsSegmentGroup(container, containee) {\n return containsSegmentGroupHelper(container, containee, containee.segments);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @param {?} containeePaths\n * @return {?}\n */\nfunction containsSegmentGroupHelper(container, containee, containeePaths) {\n if (container.segments.length > containeePaths.length) {\n var /** @type {?} */ current = container.segments.slice(0, containeePaths.length);\n if (!equalPath(current, containeePaths))\n return false;\n if (containee.hasChildren())\n return false;\n return true;\n }\n else if (container.segments.length === containeePaths.length) {\n if (!equalPath(container.segments, containeePaths))\n return false;\n for (var /** @type {?} */ c in containee.children) {\n if (!container.children[c])\n return false;\n if (!containsSegmentGroup(container.children[c], containee.children[c]))\n return false;\n }\n return true;\n }\n else {\n var /** @type {?} */ current = containeePaths.slice(0, container.segments.length);\n var /** @type {?} */ next = containeePaths.slice(container.segments.length);\n if (!equalPath(container.segments, current))\n return false;\n if (!container.children[PRIMARY_OUTLET])\n return false;\n return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next);\n }\n}\n/**\n * \\@whatItDoes Represents the parsed URL.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree =\n * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');\n * const f = tree.fragment; // return 'fragment'\n * const q = tree.queryParams; // returns {debug: 'true'}\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'\n * g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'\n * g.children['support'].segments; // return 1 segment 'help'\n * }\n * }\n * ```\n *\n * \\@description\n *\n * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a\n * serialized tree.\n * UrlTree is a data structure that provides a lot of affordances in dealing with URLs\n *\n * \\@stable\n */\nvar UrlTree = /** @class */ (function () {\n /** @internal */\n function UrlTree(root, queryParams, fragment) {\n this.root = root;\n this.queryParams = queryParams;\n this.fragment = fragment;\n }\n Object.defineProperty(UrlTree.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlTree.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return DEFAULT_SERIALIZER.serialize(this); };\n return UrlTree;\n}());\n/**\n * \\@whatItDoes Represents the parsed URL segment group.\n *\n * See {\\@link UrlTree} for more information.\n *\n * \\@stable\n */\nvar UrlSegmentGroup = /** @class */ (function () {\n function UrlSegmentGroup(segments, children) {\n var _this = this;\n this.segments = segments;\n this.children = children;\n /**\n * The parent node in the url tree\n */\n this.parent = null;\n forEach(children, function (v, k) { return v.parent = _this; });\n }\n /** Whether the segment has child segments */\n /**\n * Whether the segment has child segments\n * @return {?}\n */\n UrlSegmentGroup.prototype.hasChildren = /**\n * Whether the segment has child segments\n * @return {?}\n */\n function () { return this.numberOfChildren > 0; };\n Object.defineProperty(UrlSegmentGroup.prototype, \"numberOfChildren\", {\n /** Number of child segments */\n get: /**\n * Number of child segments\n * @return {?}\n */\n function () { return Object.keys(this.children).length; },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlSegmentGroup.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return serializePaths(this); };\n return UrlSegmentGroup;\n}());\n/**\n * \\@whatItDoes Represents a single URL segment.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree = router.parseUrl('/team;id=33');\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments;\n * s[0].path; // returns 'team'\n * s[0].parameters; // returns {id: 33}\n * }\n * }\n * ```\n *\n * \\@description\n *\n * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix\n * parameters associated with the segment.\n *\n * \\@stable\n */\nvar UrlSegment = /** @class */ (function () {\n function UrlSegment(path, parameters) {\n this.path = path;\n this.parameters = parameters;\n }\n Object.defineProperty(UrlSegment.prototype, \"parameterMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._parameterMap) {\n this._parameterMap = convertToParamMap(this.parameters);\n }\n return this._parameterMap;\n },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlSegment.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return serializePath(this); };\n return UrlSegment;\n}());\n/**\n * @param {?} as\n * @param {?} bs\n * @return {?}\n */\nfunction equalSegments(as, bs) {\n return equalPath(as, bs) && as.every(function (a, i) { return shallowEqual(a.parameters, bs[i].parameters); });\n}\n/**\n * @param {?} as\n * @param {?} bs\n * @return {?}\n */\nfunction equalPath(as, bs) {\n if (as.length !== bs.length)\n return false;\n return as.every(function (a, i) { return a.path === bs[i].path; });\n}\n/**\n * @template T\n * @param {?} segment\n * @param {?} fn\n * @return {?}\n */\nfunction mapChildrenIntoArray(segment, fn) {\n var /** @type {?} */ res = [];\n forEach(segment.children, function (child, childOutlet) {\n if (childOutlet === PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n forEach(segment.children, function (child, childOutlet) {\n if (childOutlet !== PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n return res;\n}\n/**\n * \\@whatItDoes Serializes and deserializes a URL string into a URL tree.\n *\n * \\@description The url serialization strategy is customizable. You can\n * make all URLs case insensitive by providing a custom UrlSerializer.\n *\n * See {\\@link DefaultUrlSerializer} for an example of a URL serializer.\n *\n * \\@stable\n * @abstract\n */\nvar UrlSerializer = /** @class */ (function () {\n function UrlSerializer() {\n }\n return UrlSerializer;\n}());\n/**\n * \\@whatItDoes A default implementation of the {\\@link UrlSerializer}.\n *\n * \\@description\n *\n * Example URLs:\n *\n * ```\n * /inbox/33(popup:compose)\n * /inbox/33;open=true/messages/44\n * ```\n *\n * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the\n * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to\n * specify route specific parameters.\n *\n * \\@stable\n */\nvar DefaultUrlSerializer = /** @class */ (function () {\n function DefaultUrlSerializer() {\n }\n /** Parses a url into a {@link UrlTree} */\n /**\n * Parses a url into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n DefaultUrlSerializer.prototype.parse = /**\n * Parses a url into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n };\n /** Converts a {@link UrlTree} into a url */\n /**\n * Converts a {\\@link UrlTree} into a url\n * @param {?} tree\n * @return {?}\n */\n DefaultUrlSerializer.prototype.serialize = /**\n * Converts a {\\@link UrlTree} into a url\n * @param {?} tree\n * @return {?}\n */\n function (tree) {\n var /** @type {?} */ segment = \"/\" + serializeSegment(tree.root, true);\n var /** @type {?} */ query = serializeQueryParams(tree.queryParams);\n var /** @type {?} */ fragment = typeof tree.fragment === \"string\" ? \"#\" + encodeURI((/** @type {?} */ ((tree.fragment)))) : '';\n return \"\" + segment + query + fragment;\n };\n return DefaultUrlSerializer;\n}());\nvar DEFAULT_SERIALIZER = new DefaultUrlSerializer();\n/**\n * @param {?} segment\n * @return {?}\n */\nfunction serializePaths(segment) {\n return segment.segments.map(function (p) { return serializePath(p); }).join('/');\n}\n/**\n * @param {?} segment\n * @param {?} root\n * @return {?}\n */\nfunction serializeSegment(segment, root) {\n if (!segment.hasChildren()) {\n return serializePaths(segment);\n }\n if (root) {\n var /** @type {?} */ primary = segment.children[PRIMARY_OUTLET] ?\n serializeSegment(segment.children[PRIMARY_OUTLET], false) :\n '';\n var /** @type {?} */ children_1 = [];\n forEach(segment.children, function (v, k) {\n if (k !== PRIMARY_OUTLET) {\n children_1.push(k + \":\" + serializeSegment(v, false));\n }\n });\n return children_1.length > 0 ? primary + \"(\" + children_1.join('//') + \")\" : primary;\n }\n else {\n var /** @type {?} */ children = mapChildrenIntoArray(segment, function (v, k) {\n if (k === PRIMARY_OUTLET) {\n return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];\n }\n return [k + \":\" + serializeSegment(v, false)];\n });\n return serializePaths(segment) + \"/(\" + children.join('//') + \")\";\n }\n}\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"\\@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n * @param {?} s\n * @return {?}\n */\nfunction encode(s) {\n return encodeURIComponent(s)\n .replace(/%40/g, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';');\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction decode(s) {\n return decodeURIComponent(s);\n}\n/**\n * @param {?} path\n * @return {?}\n */\nfunction serializePath(path) {\n return \"\" + encode(path.path) + serializeParams(path.parameters);\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction serializeParams(params) {\n return Object.keys(params).map(function (key) { return \";\" + encode(key) + \"=\" + encode(params[key]); }).join('');\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction serializeQueryParams(params) {\n var /** @type {?} */ strParams = Object.keys(params).map(function (name) {\n var /** @type {?} */ value = params[name];\n return Array.isArray(value) ? value.map(function (v) { return encode(name) + \"=\" + encode(v); }).join('&') :\n encode(name) + \"=\" + encode(value);\n });\n return strParams.length ? \"?\" + strParams.join(\"&\") : '';\n}\nvar SEGMENT_RE = /^[^\\/()?;=&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchSegments(str) {\n var /** @type {?} */ match = str.match(SEGMENT_RE);\n return match ? match[0] : '';\n}\nvar QUERY_PARAM_RE = /^[^=?&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchQueryParams(str) {\n var /** @type {?} */ match = str.match(QUERY_PARAM_RE);\n return match ? match[0] : '';\n}\nvar QUERY_PARAM_VALUE_RE = /^[^?&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchUrlQueryParamValue(str) {\n var /** @type {?} */ match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}\nvar UrlParser = /** @class */ (function () {\n function UrlParser(url) {\n this.url = url;\n this.remaining = url;\n }\n /**\n * @return {?}\n */\n UrlParser.prototype.parseRootSegment = /**\n * @return {?}\n */\n function () {\n this.consumeOptional('/');\n if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {\n return new UrlSegmentGroup([], {});\n }\n // The root segment group never has segments\n return new UrlSegmentGroup([], this.parseChildren());\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseQueryParams = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ params = {};\n if (this.consumeOptional('?')) {\n do {\n this.parseQueryParam(params);\n } while (this.consumeOptional('&'));\n }\n return params;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseFragment = /**\n * @return {?}\n */\n function () {\n return this.consumeOptional('#') ? decodeURI(this.remaining) : null;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseChildren = /**\n * @return {?}\n */\n function () {\n if (this.remaining === '') {\n return {};\n }\n this.consumeOptional('/');\n var /** @type {?} */ segments = [];\n if (!this.peekStartsWith('(')) {\n segments.push(this.parseSegment());\n }\n while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {\n this.capture('/');\n segments.push(this.parseSegment());\n }\n var /** @type {?} */ children = {};\n if (this.peekStartsWith('/(')) {\n this.capture('/');\n children = this.parseParens(true);\n }\n var /** @type {?} */ res = {};\n if (this.peekStartsWith('(')) {\n res = this.parseParens(false);\n }\n if (segments.length > 0 || Object.keys(children).length > 0) {\n res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);\n }\n return res;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseSegment = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(\"Empty path url segment cannot have parameters: '\" + this.remaining + \"'.\");\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseMatrixParams = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ params = {};\n while (this.consumeOptional(';')) {\n this.parseParam(params);\n }\n return params;\n };\n /**\n * @param {?} params\n * @return {?}\n */\n UrlParser.prototype.parseParam = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n var /** @type {?} */ key = matchSegments(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n var /** @type {?} */ value = '';\n if (this.consumeOptional('=')) {\n var /** @type {?} */ valueMatch = matchSegments(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n params[decode(key)] = decode(value);\n };\n /**\n * @param {?} params\n * @return {?}\n */\n UrlParser.prototype.parseQueryParam = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n var /** @type {?} */ key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n var /** @type {?} */ value = '';\n if (this.consumeOptional('=')) {\n var /** @type {?} */ valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n var /** @type {?} */ decodedKey = decode(key);\n var /** @type {?} */ decodedVal = decode(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n var /** @type {?} */ currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n };\n /**\n * @param {?} allowPrimary\n * @return {?}\n */\n UrlParser.prototype.parseParens = /**\n * @param {?} allowPrimary\n * @return {?}\n */\n function (allowPrimary) {\n var /** @type {?} */ segments = {};\n this.capture('(');\n while (!this.consumeOptional(')') && this.remaining.length > 0) {\n var /** @type {?} */ path = matchSegments(this.remaining);\n var /** @type {?} */ next = this.remaining[path.length];\n // if is is not one of these characters, then the segment was unescaped\n // or the group was not closed\n if (next !== '/' && next !== ')' && next !== ';') {\n throw new Error(\"Cannot parse url '\" + this.url + \"'\");\n }\n var /** @type {?} */ outletName = /** @type {?} */ ((undefined));\n if (path.indexOf(':') > -1) {\n outletName = path.substr(0, path.indexOf(':'));\n this.capture(outletName);\n this.capture(':');\n }\n else if (allowPrimary) {\n outletName = PRIMARY_OUTLET;\n }\n var /** @type {?} */ children = this.parseChildren();\n segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :\n new UrlSegmentGroup([], children);\n this.consumeOptional('//');\n }\n return segments;\n };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.peekStartsWith = /**\n * @param {?} str\n * @return {?}\n */\n function (str) { return this.remaining.startsWith(str); };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.consumeOptional = /**\n * @param {?} str\n * @return {?}\n */\n function (str) {\n if (this.peekStartsWith(str)) {\n this.remaining = this.remaining.substring(str.length);\n return true;\n }\n return false;\n };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.capture = /**\n * @param {?} str\n * @return {?}\n */\n function (str) {\n if (!this.consumeOptional(str)) {\n throw new Error(\"Expected \\\"\" + str + \"\\\".\");\n }\n };\n return UrlParser;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NoMatch = /** @class */ (function () {\n function NoMatch(segmentGroup) {\n this.segmentGroup = segmentGroup || null;\n }\n return NoMatch;\n}());\nvar AbsoluteRedirect = /** @class */ (function () {\n function AbsoluteRedirect(urlTree) {\n this.urlTree = urlTree;\n }\n return AbsoluteRedirect;\n}());\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction noMatch(segmentGroup) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(new NoMatch(segmentGroup)); });\n}\n/**\n * @param {?} newTree\n * @return {?}\n */\nfunction absoluteRedirect(newTree) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(new AbsoluteRedirect(newTree)); });\n}\n/**\n * @param {?} redirectTo\n * @return {?}\n */\nfunction namedOutletsRedirect(redirectTo) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) {\n return obs.error(new Error(\"Only absolute redirects can have named outlets. redirectTo: '\" + redirectTo + \"'\"));\n });\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction canLoadFails(route) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) {\n return obs.error(navigationCancelingError(\"Cannot load children because the guard of the route \\\"path: '\" + route.path + \"'\\\" returned false\"));\n });\n}\n/**\n * Returns the `UrlTree` with the redirection applied.\n *\n * Lazy modules are loaded along the way.\n * @param {?} moduleInjector\n * @param {?} configLoader\n * @param {?} urlSerializer\n * @param {?} urlTree\n * @param {?} config\n * @return {?}\n */\nfunction applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n}\nvar ApplyRedirects = /** @class */ (function () {\n function ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n this.configLoader = configLoader;\n this.urlSerializer = urlSerializer;\n this.urlTree = urlTree;\n this.config = config;\n this.allowRedirects = true;\n this.ngModule = moduleInjector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n }\n /**\n * @return {?}\n */\n ApplyRedirects.prototype.apply = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ expanded$ = this.expandSegmentGroup(this.ngModule, this.config, this.urlTree.root, PRIMARY_OUTLET);\n var /** @type {?} */ urlTrees$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (rootSegmentGroup) {\n return _this.createUrlTree(rootSegmentGroup, _this.urlTree.queryParams, /** @type {?} */ ((_this.urlTree.fragment)));\n });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(urlTrees$, function (e) {\n if (e instanceof AbsoluteRedirect) {\n // after an absolute redirect we do not apply any more redirects!\n // after an absolute redirect we do not apply any more redirects!\n _this.allowRedirects = false;\n // we need to run matching, so we can fetch all lazy-loaded modules\n return _this.match(e.urlTree);\n }\n if (e instanceof NoMatch) {\n throw _this.noMatchError(e);\n }\n throw e;\n });\n };\n /**\n * @param {?} tree\n * @return {?}\n */\n ApplyRedirects.prototype.match = /**\n * @param {?} tree\n * @return {?}\n */\n function (tree) {\n var _this = this;\n var /** @type {?} */ expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);\n var /** @type {?} */ mapped$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (rootSegmentGroup) {\n return _this.createUrlTree(rootSegmentGroup, tree.queryParams, /** @type {?} */ ((tree.fragment)));\n });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(mapped$, function (e) {\n if (e instanceof NoMatch) {\n throw _this.noMatchError(e);\n }\n throw e;\n });\n };\n /**\n * @param {?} e\n * @return {?}\n */\n ApplyRedirects.prototype.noMatchError = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return new Error(\"Cannot match any routes. URL Segment: '\" + e.segmentGroup + \"'\");\n };\n /**\n * @param {?} rootCandidate\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\n ApplyRedirects.prototype.createUrlTree = /**\n * @param {?} rootCandidate\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\n function (rootCandidate, queryParams, fragment) {\n var /** @type {?} */ root = rootCandidate.segments.length > 0 ?\n new UrlSegmentGroup([], (_a = {}, _a[PRIMARY_OUTLET] = rootCandidate, _a)) :\n rootCandidate;\n return new UrlTree(root, queryParams, fragment);\n var _a;\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentGroup = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, routes, segmentGroup, outlet) {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.expandChildren(ngModule, routes, segmentGroup), function (children) { return new UrlSegmentGroup([], children); });\n }\n return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @return {?}\n */\n ApplyRedirects.prototype.expandChildren = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @return {?}\n */\n function (ngModule, routes, segmentGroup) {\n var _this = this;\n return waitForMap(segmentGroup.children, function (childOutlet, child) { return _this.expandSegmentGroup(ngModule, routes, child, childOutlet); });\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} segments\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegment = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} segments\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {\n var _this = this;\n var /** @type {?} */ routes$ = __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"].apply(void 0, routes);\n var /** @type {?} */ processedRoutes$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(routes$, function (r) {\n var /** @type {?} */ expanded$ = _this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(expanded$, function (e) {\n if (e instanceof NoMatch) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null);\n }\n throw e;\n });\n });\n var /** @type {?} */ concattedProcessedRoutes$ = __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__[\"concatAll\"].call(processedRoutes$);\n var /** @type {?} */ first$ = __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(concattedProcessedRoutes$, function (s) { return !!s; });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(first$, function (e, _) {\n if (e instanceof __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__[\"EmptyError\"] || e.name === 'EmptyError') {\n if (_this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup([], {}));\n }\n throw new NoMatch(segmentGroup);\n }\n throw e;\n });\n };\n /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.noLeftoversInUrl = /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (segmentGroup, segments, outlet) {\n return segments.length === 0 && !segmentGroup.children[outlet];\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} paths\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentAgainstRoute = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} paths\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {\n if (getOutlet(route) !== outlet) {\n return noMatch(segmentGroup);\n }\n if (route.redirectTo === undefined) {\n return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths);\n }\n if (allowRedirects && this.allowRedirects) {\n return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);\n }\n return noMatch(segmentGroup);\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, segments, outlet) {\n if (route.path === '**') {\n return this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet);\n }\n return this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet);\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} route\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} route\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, routes, route, outlet) {\n var _this = this;\n var /** @type {?} */ newTree = this.applyRedirectCommands([], /** @type {?} */ ((route.redirectTo)), {});\n if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(this.lineralizeSegments(route, newTree), function (newSegments) {\n var /** @type {?} */ group = new UrlSegmentGroup(newSegments, {});\n return _this.expandSegment(ngModule, group, routes, newSegments, outlet, false);\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, segments, outlet) {\n var _this = this;\n var _a = match(segmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild, positionalParamSegments = _a.positionalParamSegments;\n if (!matched)\n return noMatch(segmentGroup);\n var /** @type {?} */ newTree = this.applyRedirectCommands(consumedSegments, /** @type {?} */ ((route.redirectTo)), /** @type {?} */ (positionalParamSegments));\n if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(this.lineralizeSegments(route, newTree), function (newSegments) {\n return _this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} rawSegmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\n ApplyRedirects.prototype.matchSegmentAgainstRoute = /**\n * @param {?} ngModule\n * @param {?} rawSegmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\n function (ngModule, rawSegmentGroup, route, segments) {\n var _this = this;\n if (route.path === '**') {\n if (route.loadChildren) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.configLoader.load(ngModule.injector, route), function (cfg) {\n route._loadedConfig = cfg;\n return new UrlSegmentGroup(segments, {});\n });\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup(segments, {}));\n }\n var _a = match(rawSegmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild;\n if (!matched)\n return noMatch(rawSegmentGroup);\n var /** @type {?} */ rawSlicedSegments = segments.slice(lastChild);\n var /** @type {?} */ childConfig$ = this.getChildConfig(ngModule, route);\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(childConfig$, function (routerConfig) {\n var /** @type {?} */ childModule = routerConfig.module;\n var /** @type {?} */ childConfig = routerConfig.routes;\n var _a = split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n var /** @type {?} */ expanded$_1 = _this.expandChildren(childModule, childConfig, segmentGroup);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$_1, function (children) { return new UrlSegmentGroup(consumedSegments, children); });\n }\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup(consumedSegments, {}));\n }\n var /** @type {?} */ expanded$ = _this.expandSegment(childModule, segmentGroup, childConfig, slicedSegments, PRIMARY_OUTLET, true);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (cs) {\n return new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children);\n });\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n ApplyRedirects.prototype.getChildConfig = /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n function (ngModule, route) {\n var _this = this;\n if (route.children) {\n // The children belong to the same module\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new LoadedRouterConfig(route.children, ngModule));\n }\n if (route.loadChildren) {\n // lazy children belong to the loaded module\n if (route._loadedConfig !== undefined) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(route._loadedConfig);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(runCanLoadGuard(ngModule.injector, route), function (shouldLoad) {\n if (shouldLoad) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.configLoader.load(ngModule.injector, route), function (cfg) {\n route._loadedConfig = cfg;\n return cfg;\n });\n }\n return canLoadFails(route);\n });\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new LoadedRouterConfig([], ngModule));\n };\n /**\n * @param {?} route\n * @param {?} urlTree\n * @return {?}\n */\n ApplyRedirects.prototype.lineralizeSegments = /**\n * @param {?} route\n * @param {?} urlTree\n * @return {?}\n */\n function (route, urlTree) {\n var /** @type {?} */ res = [];\n var /** @type {?} */ c = urlTree.root;\n while (true) {\n res = res.concat(c.segments);\n if (c.numberOfChildren === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(res);\n }\n if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {\n return namedOutletsRedirect(/** @type {?} */ ((route.redirectTo)));\n }\n c = c.children[PRIMARY_OUTLET];\n }\n };\n /**\n * @param {?} segments\n * @param {?} redirectTo\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.applyRedirectCommands = /**\n * @param {?} segments\n * @param {?} redirectTo\n * @param {?} posParams\n * @return {?}\n */\n function (segments, redirectTo, posParams) {\n return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);\n };\n /**\n * @param {?} redirectTo\n * @param {?} urlTree\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.applyRedirectCreatreUrlTree = /**\n * @param {?} redirectTo\n * @param {?} urlTree\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, urlTree, segments, posParams) {\n var /** @type {?} */ newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);\n return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);\n };\n /**\n * @param {?} redirectToParams\n * @param {?} actualParams\n * @return {?}\n */\n ApplyRedirects.prototype.createQueryParams = /**\n * @param {?} redirectToParams\n * @param {?} actualParams\n * @return {?}\n */\n function (redirectToParams, actualParams) {\n var /** @type {?} */ res = {};\n forEach(redirectToParams, function (v, k) {\n var /** @type {?} */ copySourceValue = typeof v === 'string' && v.startsWith(':');\n if (copySourceValue) {\n var /** @type {?} */ sourceName = v.substring(1);\n res[k] = actualParams[sourceName];\n }\n else {\n res[k] = v;\n }\n });\n return res;\n };\n /**\n * @param {?} redirectTo\n * @param {?} group\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.createSegmentGroup = /**\n * @param {?} redirectTo\n * @param {?} group\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, group, segments, posParams) {\n var _this = this;\n var /** @type {?} */ updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);\n var /** @type {?} */ children = {};\n forEach(group.children, function (child, name) {\n children[name] = _this.createSegmentGroup(redirectTo, child, segments, posParams);\n });\n return new UrlSegmentGroup(updatedSegments, children);\n };\n /**\n * @param {?} redirectTo\n * @param {?} redirectToSegments\n * @param {?} actualSegments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.createSegments = /**\n * @param {?} redirectTo\n * @param {?} redirectToSegments\n * @param {?} actualSegments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, redirectToSegments, actualSegments, posParams) {\n var _this = this;\n return redirectToSegments.map(function (s) {\n return s.path.startsWith(':') ? _this.findPosParam(redirectTo, s, posParams) :\n _this.findOrReturn(s, actualSegments);\n });\n };\n /**\n * @param {?} redirectTo\n * @param {?} redirectToUrlSegment\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.findPosParam = /**\n * @param {?} redirectTo\n * @param {?} redirectToUrlSegment\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, redirectToUrlSegment, posParams) {\n var /** @type {?} */ pos = posParams[redirectToUrlSegment.path.substring(1)];\n if (!pos)\n throw new Error(\"Cannot redirect to '\" + redirectTo + \"'. Cannot find '\" + redirectToUrlSegment.path + \"'.\");\n return pos;\n };\n /**\n * @param {?} redirectToUrlSegment\n * @param {?} actualSegments\n * @return {?}\n */\n ApplyRedirects.prototype.findOrReturn = /**\n * @param {?} redirectToUrlSegment\n * @param {?} actualSegments\n * @return {?}\n */\n function (redirectToUrlSegment, actualSegments) {\n var /** @type {?} */ idx = 0;\n for (var _i = 0, actualSegments_1 = actualSegments; _i < actualSegments_1.length; _i++) {\n var s = actualSegments_1[_i];\n if (s.path === redirectToUrlSegment.path) {\n actualSegments.splice(idx);\n return s;\n }\n idx++;\n }\n return redirectToUrlSegment;\n };\n return ApplyRedirects;\n}());\n/**\n * @param {?} moduleInjector\n * @param {?} route\n * @return {?}\n */\nfunction runCanLoadGuard(moduleInjector, route) {\n var /** @type {?} */ canLoad = route.canLoad;\n if (!canLoad || canLoad.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canLoad), function (injectionToken) {\n var /** @type {?} */ guard = moduleInjector.get(injectionToken);\n return wrapIntoObservable(guard.canLoad ? guard.canLoad(route) : guard(route));\n });\n return andObservables(obs);\n}\n/**\n * @param {?} segmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\nfunction match(segmentGroup, route, segments) {\n if (route.path === '') {\n if ((route.pathMatch === 'full') && (segmentGroup.hasChildren() || segments.length > 0)) {\n return { matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };\n }\n return { matched: true, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };\n }\n var /** @type {?} */ matcher = route.matcher || defaultUrlMatcher;\n var /** @type {?} */ res = matcher(segments, segmentGroup, route);\n if (!res) {\n return {\n matched: false,\n consumedSegments: /** @type {?} */ ([]),\n lastChild: 0,\n positionalParamSegments: {},\n };\n }\n return {\n matched: true,\n consumedSegments: /** @type {?} */ ((res.consumed)),\n lastChild: /** @type {?} */ ((res.consumed.length)),\n positionalParamSegments: /** @type {?} */ ((res.posParams)),\n };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} slicedSegments\n * @param {?} config\n * @return {?}\n */\nfunction split(segmentGroup, consumedSegments, slicedSegments, config) {\n if (slicedSegments.length > 0 &&\n containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptySegments(config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n return { segmentGroup: mergeTrivialChildren(s), slicedSegments: [] };\n }\n if (slicedSegments.length === 0 &&\n containsEmptyPathRedirects(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s = new UrlSegmentGroup(segmentGroup.segments, addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));\n return { segmentGroup: mergeTrivialChildren(s), slicedSegments: slicedSegments };\n }\n return { segmentGroup: segmentGroup, slicedSegments: slicedSegments };\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction mergeTrivialChildren(s) {\n if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {\n var /** @type {?} */ c = s.children[PRIMARY_OUTLET];\n return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);\n }\n return s;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @param {?} children\n * @return {?}\n */\nfunction addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {\n var /** @type {?} */ res = {};\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var r = routes_1[_i];\n if (isEmptyPathRedirect(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, children, res);\n}\n/**\n * @param {?} routes\n * @param {?} primarySegmentGroup\n * @return {?}\n */\nfunction createChildrenForEmptySegments(routes, primarySegmentGroup) {\n var /** @type {?} */ res = {};\n res[PRIMARY_OUTLET] = primarySegmentGroup;\n for (var _i = 0, routes_2 = routes; _i < routes_2.length; _i++) {\n var r = routes_2[_i];\n if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return res;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, segments, routes) {\n return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r) && getOutlet(r) !== PRIMARY_OUTLET; });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathRedirects(segmentGroup, segments, routes) {\n return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r); });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} r\n * @return {?}\n */\nfunction isEmptyPathRedirect(segmentGroup, segments, r) {\n if ((segmentGroup.hasChildren() || segments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n return r.path === '' && r.redirectTo !== undefined;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getOutlet(route) {\n return route.outlet || PRIMARY_OUTLET;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar Tree = /** @class */ (function () {\n function Tree(root) {\n this._root = root;\n }\n Object.defineProperty(Tree.prototype, \"root\", {\n get: /**\n * @return {?}\n */\n function () { return this._root.value; },\n enumerable: true,\n configurable: true\n });\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.parent = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ p = this.pathFromRoot(t);\n return p.length > 1 ? p[p.length - 2] : null;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.children = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ n = findNode(t, this._root);\n return n ? n.children.map(function (t) { return t.value; }) : [];\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.firstChild = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ n = findNode(t, this._root);\n return n && n.children.length > 0 ? n.children[0].value : null;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.siblings = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ p = findPath(t, this._root);\n if (p.length < 2)\n return [];\n var /** @type {?} */ c = p[p.length - 2].children.map(function (c) { return c.value; });\n return c.filter(function (cc) { return cc !== t; });\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.pathFromRoot = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) { return findPath(t, this._root).map(function (s) { return s.value; }); };\n return Tree;\n}());\n/**\n * @template T\n * @param {?} value\n * @param {?} node\n * @return {?}\n */\nfunction findNode(value, node) {\n if (value === node.value)\n return node;\n for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n var child = _a[_i];\n var /** @type {?} */ node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n return null;\n}\n/**\n * @template T\n * @param {?} value\n * @param {?} node\n * @return {?}\n */\nfunction findPath(value, node) {\n if (value === node.value)\n return [node];\n for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n var child = _a[_i];\n var /** @type {?} */ path = findPath(value, child);\n if (path.length) {\n path.unshift(node);\n return path;\n }\n }\n return [];\n}\nvar TreeNode = /** @class */ (function () {\n function TreeNode(value, children) {\n this.value = value;\n this.children = children;\n }\n /**\n * @return {?}\n */\n TreeNode.prototype.toString = /**\n * @return {?}\n */\n function () { return \"TreeNode(\" + this.value + \")\"; };\n return TreeNode;\n}());\n/**\n * @template T\n * @param {?} node\n * @return {?}\n */\nfunction nodeChildrenAsMap(node) {\n var /** @type {?} */ map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Represents the state of the router.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const root: ActivatedRoute = state.root;\n * const child = root.firstChild;\n * const id: Observable<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * \\@description\n * RouterState is a tree of activated routes. Every node in this tree knows about the \"consumed\" URL\n * segments, the extracted parameters, and the resolved data.\n *\n * See {\\@link ActivatedRoute} for more information.\n *\n * \\@stable\n */\nvar RouterState = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RouterState, _super);\n /** @internal */\n function RouterState(root, snapshot) {\n var _this = _super.call(this, root) || this;\n _this.snapshot = snapshot;\n setRouterState(/** @type {?} */ (_this), root);\n return _this;\n }\n /**\n * @return {?}\n */\n RouterState.prototype.toString = /**\n * @return {?}\n */\n function () { return this.snapshot.toString(); };\n return RouterState;\n}(Tree));\n/**\n * @param {?} urlTree\n * @param {?} rootComponent\n * @return {?}\n */\nfunction createEmptyState(urlTree, rootComponent) {\n var /** @type {?} */ snapshot = createEmptyStateSnapshot(urlTree, rootComponent);\n var /** @type {?} */ emptyUrl = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]([new UrlSegment('', {})]);\n var /** @type {?} */ emptyParams = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ emptyData = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ emptyQueryParams = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ fragment = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]('');\n var /** @type {?} */ activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root);\n activated.snapshot = snapshot.root;\n return new RouterState(new TreeNode(activated, []), snapshot);\n}\n/**\n * @param {?} urlTree\n * @param {?} rootComponent\n * @return {?}\n */\nfunction createEmptyStateSnapshot(urlTree, rootComponent) {\n var /** @type {?} */ emptyParams = {};\n var /** @type {?} */ emptyData = {};\n var /** @type {?} */ emptyQueryParams = {};\n var /** @type {?} */ fragment = '';\n var /** @type {?} */ activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {});\n return new RouterStateSnapshot('', new TreeNode(activated, []));\n}\n/**\n * \\@whatItDoes Contains the information about a route associated with a component loaded in an\n * outlet.\n * An `ActivatedRoute` can also be used to traverse the router state tree.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({...})\n * class MyComponent {\n * constructor(route: ActivatedRoute) {\n * const id: Observable<string> = route.params.map(p => p.id);\n * const url: Observable<string> = route.url.map(segments => segments.join(''));\n * // route.data includes both `data` and `resolve`\n * const user = route.data.map(d => d.user);\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar ActivatedRoute = /** @class */ (function () {\n /** @internal */\n function ActivatedRoute(url, params, queryParams, fragment, data, outlet, component, futureSnapshot) {\n this.url = url;\n this.params = params;\n this.queryParams = queryParams;\n this.fragment = fragment;\n this.data = data;\n this.outlet = outlet;\n this.component = component;\n this._futureSnapshot = futureSnapshot;\n }\n Object.defineProperty(ActivatedRoute.prototype, \"routeConfig\", {\n /** The configuration used to match this route */\n get: /**\n * The configuration used to match this route\n * @return {?}\n */\n function () { return this._futureSnapshot.routeConfig; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"root\", {\n /** The root of the router state */\n get: /**\n * The root of the router state\n * @return {?}\n */\n function () { return this._routerState.root; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"parent\", {\n /** The parent of this route in the router state tree */\n get: /**\n * The parent of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.parent(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"firstChild\", {\n /** The first child of this route in the router state tree */\n get: /**\n * The first child of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.firstChild(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"children\", {\n /** The children of this route in the router state tree */\n get: /**\n * The children of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.children(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"pathFromRoot\", {\n /** The path from the root of the router state tree to this route */\n get: /**\n * The path from the root of the router state tree to this route\n * @return {?}\n */\n function () { return this._routerState.pathFromRoot(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"paramMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._paramMap) {\n this._paramMap = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.params, function (p) { return convertToParamMap(p); });\n }\n return this._paramMap;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap =\n __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.queryParams, function (p) { return convertToParamMap(p); });\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n ActivatedRoute.prototype.toString = /**\n * @return {?}\n */\n function () {\n return this.snapshot ? this.snapshot.toString() : \"Future(\" + this._futureSnapshot + \")\";\n };\n return ActivatedRoute;\n}());\n/**\n * Returns the inherited params, data, and resolve for a given route.\n * By default, this only inherits values up to the nearest path-less or component-less route.\n * \\@internal\n * @param {?} route\n * @param {?=} paramsInheritanceStrategy\n * @return {?}\n */\nfunction inheritedParamsDataResolve(route, paramsInheritanceStrategy) {\n if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }\n var /** @type {?} */ pathFromRoot = route.pathFromRoot;\n var /** @type {?} */ inheritingStartingFrom = 0;\n if (paramsInheritanceStrategy !== 'always') {\n inheritingStartingFrom = pathFromRoot.length - 1;\n while (inheritingStartingFrom >= 1) {\n var /** @type {?} */ current = pathFromRoot[inheritingStartingFrom];\n var /** @type {?} */ parent_1 = pathFromRoot[inheritingStartingFrom - 1];\n // current route is an empty path => inherits its parent's params and data\n if (current.routeConfig && current.routeConfig.path === '') {\n inheritingStartingFrom--;\n // parent is componentless => current route should inherit its params and data\n }\n else if (!parent_1.component) {\n inheritingStartingFrom--;\n }\n else {\n break;\n }\n }\n }\n return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));\n}\n/**\n * \\@internal\n * @param {?} pathFromRoot\n * @return {?}\n */\nfunction flattenInherited(pathFromRoot) {\n return pathFromRoot.reduce(function (res, curr) {\n var /** @type {?} */ params = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.params, curr.params);\n var /** @type {?} */ data = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.data, curr.data);\n var /** @type {?} */ resolve = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.resolve, curr._resolvedData);\n return { params: params, data: data, resolve: resolve };\n }, /** @type {?} */ ({ params: {}, data: {}, resolve: {} }));\n}\n/**\n * \\@whatItDoes Contains the information about a route associated with a component loaded in an\n * outlet\n * at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router\n * state tree.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'./my-component.html'})\n * class MyComponent {\n * constructor(route: ActivatedRoute) {\n * const id: string = route.snapshot.params.id;\n * const url: string = route.snapshot.url.join('');\n * const user = route.snapshot.data.user;\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar ActivatedRouteSnapshot = /** @class */ (function () {\n /** @internal */\n function ActivatedRouteSnapshot(url, params, queryParams, fragment, data, outlet, component, routeConfig, urlSegment, lastPathIndex, resolve) {\n this.url = url;\n this.params = params;\n this.queryParams = queryParams;\n this.fragment = fragment;\n this.data = data;\n this.outlet = outlet;\n this.component = component;\n this.routeConfig = routeConfig;\n this._urlSegment = urlSegment;\n this._lastPathIndex = lastPathIndex;\n this._resolve = resolve;\n }\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"root\", {\n /** The root of the router state */\n get: /**\n * The root of the router state\n * @return {?}\n */\n function () { return this._routerState.root; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"parent\", {\n /** The parent of this route in the router state tree */\n get: /**\n * The parent of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.parent(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"firstChild\", {\n /** The first child of this route in the router state tree */\n get: /**\n * The first child of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.firstChild(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"children\", {\n /** The children of this route in the router state tree */\n get: /**\n * The children of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.children(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"pathFromRoot\", {\n /** The path from the root of the router state tree to this route */\n get: /**\n * The path from the root of the router state tree to this route\n * @return {?}\n */\n function () { return this._routerState.pathFromRoot(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"paramMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._paramMap) {\n this._paramMap = convertToParamMap(this.params);\n }\n return this._paramMap;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n ActivatedRouteSnapshot.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ url = this.url.map(function (segment) { return segment.toString(); }).join('/');\n var /** @type {?} */ matched = this.routeConfig ? this.routeConfig.path : '';\n return \"Route(url:'\" + url + \"', path:'\" + matched + \"')\";\n };\n return ActivatedRouteSnapshot;\n}());\n/**\n * \\@whatItDoes Represents the state of the router at a moment in time.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const snapshot: RouterStateSnapshot = state.snapshot;\n * const root: ActivatedRouteSnapshot = snapshot.root;\n * const child = root.firstChild;\n * const id: Observable<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * \\@description\n * RouterStateSnapshot is a tree of activated route snapshots. Every node in this tree knows about\n * the \"consumed\" URL segments, the extracted parameters, and the resolved data.\n *\n * \\@stable\n */\nvar RouterStateSnapshot = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RouterStateSnapshot, _super);\n /** @internal */\n function RouterStateSnapshot(url, root) {\n var _this = _super.call(this, root) || this;\n _this.url = url;\n setRouterState(/** @type {?} */ (_this), root);\n return _this;\n }\n /**\n * @return {?}\n */\n RouterStateSnapshot.prototype.toString = /**\n * @return {?}\n */\n function () { return serializeNode(this._root); };\n return RouterStateSnapshot;\n}(Tree));\n/**\n * @template U, T\n * @param {?} state\n * @param {?} node\n * @return {?}\n */\nfunction setRouterState(state, node) {\n node.value._routerState = state;\n node.children.forEach(function (c) { return setRouterState(state, c); });\n}\n/**\n * @param {?} node\n * @return {?}\n */\nfunction serializeNode(node) {\n var /** @type {?} */ c = node.children.length > 0 ? \" { \" + node.children.map(serializeNode).join(', ') + \" } \" : '';\n return \"\" + node.value + c;\n}\n/**\n * The expectation is that the activate route is created with the right set of parameters.\n * So we push new values into the observables only when they are not the initial values.\n * And we detect that by checking if the snapshot field is set.\n * @param {?} route\n * @return {?}\n */\nfunction advanceActivatedRoute(route) {\n if (route.snapshot) {\n var /** @type {?} */ currentSnapshot = route.snapshot;\n var /** @type {?} */ nextSnapshot = route._futureSnapshot;\n route.snapshot = nextSnapshot;\n if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {\n (/** @type {?} */ (route.queryParams)).next(nextSnapshot.queryParams);\n }\n if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n (/** @type {?} */ (route.fragment)).next(nextSnapshot.fragment);\n }\n if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n (/** @type {?} */ (route.params)).next(nextSnapshot.params);\n }\n if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n (/** @type {?} */ (route.url)).next(nextSnapshot.url);\n }\n if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n (/** @type {?} */ (route.data)).next(nextSnapshot.data);\n }\n }\n else {\n route.snapshot = route._futureSnapshot;\n // this is for resolved data\n (/** @type {?} */ (route.data)).next(route._futureSnapshot.data);\n }\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction equalParamsAndUrlSegments(a, b) {\n var /** @type {?} */ equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);\n var /** @type {?} */ parentsMismatch = !a.parent !== !b.parent;\n return equalUrlParams && !parentsMismatch &&\n (!a.parent || equalParamsAndUrlSegments(a.parent, /** @type {?} */ ((b.parent))));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?} prevState\n * @return {?}\n */\nfunction createRouterState(routeReuseStrategy, curr, prevState) {\n var /** @type {?} */ root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);\n return new RouterState(root, curr);\n}\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?=} prevState\n * @return {?}\n */\nfunction createNode(routeReuseStrategy, curr, prevState) {\n // reuse an activated route that is currently displayed on the screen\n if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {\n var /** @type {?} */ value = prevState.value;\n value._futureSnapshot = curr.value;\n var /** @type {?} */ children = createOrReuseChildren(routeReuseStrategy, curr, prevState);\n return new TreeNode(value, children);\n // retrieve an activated route that is used to be displayed, but is not currently displayed\n }\n else if (routeReuseStrategy.retrieve(curr.value)) {\n var /** @type {?} */ tree = (/** @type {?} */ (routeReuseStrategy.retrieve(curr.value))).route;\n setFutureSnapshotsOfActivatedRoutes(curr, tree);\n return tree;\n }\n else {\n var /** @type {?} */ value = createActivatedRoute(curr.value);\n var /** @type {?} */ children = curr.children.map(function (c) { return createNode(routeReuseStrategy, c); });\n return new TreeNode(value, children);\n }\n}\n/**\n * @param {?} curr\n * @param {?} result\n * @return {?}\n */\nfunction setFutureSnapshotsOfActivatedRoutes(curr, result) {\n if (curr.value.routeConfig !== result.value.routeConfig) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');\n }\n if (curr.children.length !== result.children.length) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');\n }\n result.value._futureSnapshot = curr.value;\n for (var /** @type {?} */ i = 0; i < curr.children.length; ++i) {\n setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);\n }\n}\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?} prevState\n * @return {?}\n */\nfunction createOrReuseChildren(routeReuseStrategy, curr, prevState) {\n return curr.children.map(function (child) {\n for (var _i = 0, _a = prevState.children; _i < _a.length; _i++) {\n var p = _a[_i];\n if (routeReuseStrategy.shouldReuseRoute(p.value.snapshot, child.value)) {\n return createNode(routeReuseStrategy, child, p);\n }\n }\n return createNode(routeReuseStrategy, child);\n });\n}\n/**\n * @param {?} c\n * @return {?}\n */\nfunction createActivatedRoute(c) {\n return new ActivatedRoute(new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.url), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.params), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.queryParams), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.fragment), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.data), c.outlet, c.component, c);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} route\n * @param {?} urlTree\n * @param {?} commands\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\nfunction createUrlTree(route, urlTree, commands, queryParams, fragment) {\n if (commands.length === 0) {\n return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);\n }\n var /** @type {?} */ nav = computeNavigation(commands);\n if (nav.toRoot()) {\n return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);\n }\n var /** @type {?} */ startingPosition = findStartingPosition(nav, urlTree, route);\n var /** @type {?} */ segmentGroup = startingPosition.processChildren ?\n updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :\n updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);\n return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);\n}\n/**\n * @param {?} command\n * @return {?}\n */\nfunction isMatrixParams(command) {\n return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;\n}\n/**\n * @param {?} oldSegmentGroup\n * @param {?} newSegmentGroup\n * @param {?} urlTree\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\nfunction tree(oldSegmentGroup, newSegmentGroup, urlTree, queryParams, fragment) {\n var /** @type {?} */ qp = {};\n if (queryParams) {\n forEach(queryParams, function (value, name) {\n qp[name] = Array.isArray(value) ? value.map(function (v) { return \"\" + v; }) : \"\" + value;\n });\n }\n if (urlTree.root === oldSegmentGroup) {\n return new UrlTree(newSegmentGroup, qp, fragment);\n }\n return new UrlTree(replaceSegment(urlTree.root, oldSegmentGroup, newSegmentGroup), qp, fragment);\n}\n/**\n * @param {?} current\n * @param {?} oldSegment\n * @param {?} newSegment\n * @return {?}\n */\nfunction replaceSegment(current, oldSegment, newSegment) {\n var /** @type {?} */ children = {};\n forEach(current.children, function (c, outletName) {\n if (c === oldSegment) {\n children[outletName] = newSegment;\n }\n else {\n children[outletName] = replaceSegment(c, oldSegment, newSegment);\n }\n });\n return new UrlSegmentGroup(current.segments, children);\n}\nvar Navigation = /** @class */ (function () {\n function Navigation(isAbsolute, numberOfDoubleDots, commands) {\n this.isAbsolute = isAbsolute;\n this.numberOfDoubleDots = numberOfDoubleDots;\n this.commands = commands;\n if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {\n throw new Error('Root segment cannot have matrix parameters');\n }\n var /** @type {?} */ cmdWithOutlet = commands.find(function (c) { return typeof c === 'object' && c != null && c.outlets; });\n if (cmdWithOutlet && cmdWithOutlet !== last$1(commands)) {\n throw new Error('{outlets:{}} has to be the last command');\n }\n }\n /**\n * @return {?}\n */\n Navigation.prototype.toRoot = /**\n * @return {?}\n */\n function () {\n return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';\n };\n return Navigation;\n}());\n/**\n * Transforms commands to a normalized `Navigation`\n * @param {?} commands\n * @return {?}\n */\nfunction computeNavigation(commands) {\n if ((typeof commands[0] === 'string') && commands.length === 1 && commands[0] === '/') {\n return new Navigation(true, 0, commands);\n }\n var /** @type {?} */ numberOfDoubleDots = 0;\n var /** @type {?} */ isAbsolute = false;\n var /** @type {?} */ res = commands.reduce(function (res, cmd, cmdIdx) {\n if (typeof cmd === 'object' && cmd != null) {\n if (cmd.outlets) {\n var /** @type {?} */ outlets_1 = {};\n forEach(cmd.outlets, function (commands, name) {\n outlets_1[name] = typeof commands === 'string' ? commands.split('/') : commands;\n });\n return res.concat([{ outlets: outlets_1 }]);\n }\n if (cmd.segmentPath) {\n return res.concat([cmd.segmentPath]);\n }\n }\n if (!(typeof cmd === 'string')) {\n return res.concat([cmd]);\n }\n if (cmdIdx === 0) {\n cmd.split('/').forEach(function (urlPart, partIndex) {\n if (partIndex == 0 && urlPart === '.') {\n // skip './a'\n }\n else if (partIndex == 0 && urlPart === '') {\n // '/a'\n isAbsolute = true;\n }\n else if (urlPart === '..') {\n // '../a'\n numberOfDoubleDots++;\n }\n else if (urlPart != '') {\n res.push(urlPart);\n }\n });\n return res;\n }\n return res.concat([cmd]);\n }, []);\n return new Navigation(isAbsolute, numberOfDoubleDots, res);\n}\nvar Position = /** @class */ (function () {\n function Position(segmentGroup, processChildren, index) {\n this.segmentGroup = segmentGroup;\n this.processChildren = processChildren;\n this.index = index;\n }\n return Position;\n}());\n/**\n * @param {?} nav\n * @param {?} tree\n * @param {?} route\n * @return {?}\n */\nfunction findStartingPosition(nav, tree, route) {\n if (nav.isAbsolute) {\n return new Position(tree.root, true, 0);\n }\n if (route.snapshot._lastPathIndex === -1) {\n return new Position(route.snapshot._urlSegment, true, 0);\n }\n var /** @type {?} */ modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;\n var /** @type {?} */ index = route.snapshot._lastPathIndex + modifier;\n return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots);\n}\n/**\n * @param {?} group\n * @param {?} index\n * @param {?} numberOfDoubleDots\n * @return {?}\n */\nfunction createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {\n var /** @type {?} */ g = group;\n var /** @type {?} */ ci = index;\n var /** @type {?} */ dd = numberOfDoubleDots;\n while (dd > ci) {\n dd -= ci;\n g = /** @type {?} */ ((g.parent));\n if (!g) {\n throw new Error('Invalid number of \\'../\\'');\n }\n ci = g.segments.length;\n }\n return new Position(g, false, ci - dd);\n}\n/**\n * @param {?} command\n * @return {?}\n */\nfunction getPath(command) {\n if (typeof command === 'object' && command != null && command.outlets) {\n return command.outlets[PRIMARY_OUTLET];\n }\n return \"\" + command;\n}\n/**\n * @param {?} commands\n * @return {?}\n */\nfunction getOutlets(commands) {\n if (!(typeof commands[0] === 'object'))\n return _a = {}, _a[PRIMARY_OUTLET] = commands, _a;\n if (commands[0].outlets === undefined)\n return _b = {}, _b[PRIMARY_OUTLET] = commands, _b;\n return commands[0].outlets;\n var _a, _b;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction updateSegmentGroup(segmentGroup, startIndex, commands) {\n if (!segmentGroup) {\n segmentGroup = new UrlSegmentGroup([], {});\n }\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return updateSegmentGroupChildren(segmentGroup, startIndex, commands);\n }\n var /** @type {?} */ m = prefixedWith(segmentGroup, startIndex, commands);\n var /** @type {?} */ slicedCommands = commands.slice(m.commandIndex);\n if (m.match && m.pathIndex < segmentGroup.segments.length) {\n var /** @type {?} */ g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});\n g.children[PRIMARY_OUTLET] =\n new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children);\n return updateSegmentGroupChildren(g, 0, slicedCommands);\n }\n else if (m.match && slicedCommands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n }\n else if (m.match && !segmentGroup.hasChildren()) {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n }\n else if (m.match) {\n return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);\n }\n else {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n }\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction updateSegmentGroupChildren(segmentGroup, startIndex, commands) {\n if (commands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n }\n else {\n var /** @type {?} */ outlets_2 = getOutlets(commands);\n var /** @type {?} */ children_1 = {};\n forEach(outlets_2, function (commands, outlet) {\n if (commands !== null) {\n children_1[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);\n }\n });\n forEach(segmentGroup.children, function (child, childOutlet) {\n if (outlets_2[childOutlet] === undefined) {\n children_1[childOutlet] = child;\n }\n });\n return new UrlSegmentGroup(segmentGroup.segments, children_1);\n }\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction prefixedWith(segmentGroup, startIndex, commands) {\n var /** @type {?} */ currentCommandIndex = 0;\n var /** @type {?} */ currentPathIndex = startIndex;\n var /** @type {?} */ noMatch = { match: false, pathIndex: 0, commandIndex: 0 };\n while (currentPathIndex < segmentGroup.segments.length) {\n if (currentCommandIndex >= commands.length)\n return noMatch;\n var /** @type {?} */ path = segmentGroup.segments[currentPathIndex];\n var /** @type {?} */ curr = getPath(commands[currentCommandIndex]);\n var /** @type {?} */ next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;\n if (currentPathIndex > 0 && curr === undefined)\n break;\n if (curr && next && (typeof next === 'object') && next.outlets === undefined) {\n if (!compare(curr, next, path))\n return noMatch;\n currentCommandIndex += 2;\n }\n else {\n if (!compare(curr, {}, path))\n return noMatch;\n currentCommandIndex++;\n }\n currentPathIndex++;\n }\n return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction createNewSegmentGroup(segmentGroup, startIndex, commands) {\n var /** @type {?} */ paths = segmentGroup.segments.slice(0, startIndex);\n var /** @type {?} */ i = 0;\n while (i < commands.length) {\n if (typeof commands[i] === 'object' && commands[i].outlets !== undefined) {\n var /** @type {?} */ children = createNewSegmentChildren(commands[i].outlets);\n return new UrlSegmentGroup(paths, children);\n }\n // if we start with an object literal, we need to reuse the path part from the segment\n if (i === 0 && isMatrixParams(commands[0])) {\n var /** @type {?} */ p = segmentGroup.segments[startIndex];\n paths.push(new UrlSegment(p.path, commands[0]));\n i++;\n continue;\n }\n var /** @type {?} */ curr = getPath(commands[i]);\n var /** @type {?} */ next = (i < commands.length - 1) ? commands[i + 1] : null;\n if (curr && next && isMatrixParams(next)) {\n paths.push(new UrlSegment(curr, stringify(next)));\n i += 2;\n }\n else {\n paths.push(new UrlSegment(curr, {}));\n i++;\n }\n }\n return new UrlSegmentGroup(paths, {});\n}\n/**\n * @param {?} outlets\n * @return {?}\n */\nfunction createNewSegmentChildren(outlets) {\n var /** @type {?} */ children = {};\n forEach(outlets, function (commands, outlet) {\n if (commands !== null) {\n children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);\n }\n });\n return children;\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction stringify(params) {\n var /** @type {?} */ res = {};\n forEach(params, function (v, k) { return res[k] = \"\" + v; });\n return res;\n}\n/**\n * @param {?} path\n * @param {?} params\n * @param {?} segment\n * @return {?}\n */\nfunction compare(path, params, segment) {\n return path == segment.path && shallowEqual(params, segment.parameters);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CanActivate = /** @class */ (function () {\n function CanActivate(path) {\n this.path = path;\n this.route = this.path[this.path.length - 1];\n }\n return CanActivate;\n}());\nvar CanDeactivate = /** @class */ (function () {\n function CanDeactivate(component, route) {\n this.component = component;\n this.route = route;\n }\n return CanDeactivate;\n}());\n/**\n * This class bundles the actions involved in preactivation of a route.\n */\nvar PreActivation = /** @class */ (function () {\n function PreActivation(future, curr, moduleInjector, forwardEvent) {\n this.future = future;\n this.curr = curr;\n this.moduleInjector = moduleInjector;\n this.forwardEvent = forwardEvent;\n this.canActivateChecks = [];\n this.canDeactivateChecks = [];\n }\n /**\n * @param {?} parentContexts\n * @return {?}\n */\n PreActivation.prototype.initialize = /**\n * @param {?} parentContexts\n * @return {?}\n */\n function (parentContexts) {\n var /** @type {?} */ futureRoot = this.future._root;\n var /** @type {?} */ currRoot = this.curr ? this.curr._root : null;\n this.setupChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.checkGuards = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!this.isDeactivating() && !this.isActivating()) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n }\n var /** @type {?} */ canDeactivate$ = this.runCanDeactivateChecks();\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(canDeactivate$, function (canDeactivate) { return canDeactivate ? _this.runCanActivateChecks() : Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false); });\n };\n /**\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n PreActivation.prototype.resolveData = /**\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n function (paramsInheritanceStrategy) {\n var _this = this;\n if (!this.isActivating())\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null);\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canActivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(checks$, function (check) { return _this.runResolve(check.route, paramsInheritanceStrategy); });\n return __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__[\"reduce\"].call(runningChecks$, function (_, __) { return _; });\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.isDeactivating = /**\n * @return {?}\n */\n function () { return this.canDeactivateChecks.length !== 0; };\n /**\n * @return {?}\n */\n PreActivation.prototype.isActivating = /**\n * @return {?}\n */\n function () { return this.canActivateChecks.length !== 0; };\n /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @param {?} futurePath\n * @return {?}\n */\n PreActivation.prototype.setupChildRouteGuards = /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @param {?} futurePath\n * @return {?}\n */\n function (futureNode, currNode, contexts, futurePath) {\n var _this = this;\n var /** @type {?} */ prevChildren = nodeChildrenAsMap(currNode);\n // Process the children of the future route\n futureNode.children.forEach(function (c) {\n _this.setupRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]));\n delete prevChildren[c.value.outlet];\n });\n // Process any children left from the current route (not active for the future route)\n forEach(prevChildren, function (v, k) {\n return _this.deactivateRouteAndItsChildren(v, /** @type {?} */ ((contexts)).getContext(k));\n });\n };\n /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @param {?} futurePath\n * @return {?}\n */\n PreActivation.prototype.setupRouteGuards = /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @param {?} futurePath\n * @return {?}\n */\n function (futureNode, currNode, parentContexts, futurePath) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n var /** @type {?} */ context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;\n // reusing the node\n if (curr && future.routeConfig === curr.routeConfig) {\n var /** @type {?} */ shouldRunGuardsAndResolvers = this.shouldRunGuardsAndResolvers(curr, future, /** @type {?} */ ((future.routeConfig)).runGuardsAndResolvers);\n if (shouldRunGuardsAndResolvers) {\n this.canActivateChecks.push(new CanActivate(futurePath));\n }\n else {\n // we need to set the data\n future.data = curr.data;\n future._resolvedData = curr._resolvedData;\n }\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n this.setupChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath);\n // if we have a componentless route, we recurse but keep the same outlet map.\n }\n else {\n this.setupChildRouteGuards(futureNode, currNode, parentContexts, futurePath);\n }\n if (shouldRunGuardsAndResolvers) {\n var /** @type {?} */ outlet = /** @type {?} */ ((/** @type {?} */ ((context)).outlet));\n this.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));\n }\n }\n else {\n if (curr) {\n this.deactivateRouteAndItsChildren(currNode, context);\n }\n this.canActivateChecks.push(new CanActivate(futurePath));\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n this.setupChildRouteGuards(futureNode, null, context ? context.children : null, futurePath);\n // if we have a componentless route, we recurse but keep the same outlet map.\n }\n else {\n this.setupChildRouteGuards(futureNode, null, parentContexts, futurePath);\n }\n }\n };\n /**\n * @param {?} curr\n * @param {?} future\n * @param {?} mode\n * @return {?}\n */\n PreActivation.prototype.shouldRunGuardsAndResolvers = /**\n * @param {?} curr\n * @param {?} future\n * @param {?} mode\n * @return {?}\n */\n function (curr, future, mode) {\n switch (mode) {\n case 'always':\n return true;\n case 'paramsOrQueryParamsChange':\n return !equalParamsAndUrlSegments(curr, future) ||\n !shallowEqual(curr.queryParams, future.queryParams);\n case 'paramsChange':\n default:\n return !equalParamsAndUrlSegments(curr, future);\n }\n };\n /**\n * @param {?} route\n * @param {?} context\n * @return {?}\n */\n PreActivation.prototype.deactivateRouteAndItsChildren = /**\n * @param {?} route\n * @param {?} context\n * @return {?}\n */\n function (route, context) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(route);\n var /** @type {?} */ r = route.value;\n forEach(children, function (node, childName) {\n if (!r.component) {\n _this.deactivateRouteAndItsChildren(node, context);\n }\n else if (context) {\n _this.deactivateRouteAndItsChildren(node, context.children.getContext(childName));\n }\n else {\n _this.deactivateRouteAndItsChildren(node, null);\n }\n });\n if (!r.component) {\n this.canDeactivateChecks.push(new CanDeactivate(null, r));\n }\n else if (context && context.outlet && context.outlet.isActivated) {\n this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));\n }\n else {\n this.canDeactivateChecks.push(new CanDeactivate(null, r));\n }\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.runCanDeactivateChecks = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canDeactivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(checks$, function (check) { return _this.runCanDeactivate(check.component, check.route); });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(runningChecks$, function (result) { return result === true; });\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.runCanActivateChecks = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canActivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(checks$, function (check) {\n return andObservables(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])([\n _this.fireChildActivationStart(check.route.parent), _this.fireActivationStart(check.route),\n _this.runCanActivateChild(check.path), _this.runCanActivate(check.route)\n ]));\n });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(runningChecks$, function (result) { return result === true; });\n // this.fireChildActivationStart(check.path),\n };\n /**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.fireActivationStart = /**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n function (snapshot) {\n if (snapshot !== null && this.forwardEvent) {\n this.forwardEvent(new ActivationStart(snapshot));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n };\n /**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.fireChildActivationStart = /**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n function (snapshot) {\n if (snapshot !== null && this.forwardEvent) {\n this.forwardEvent(new ChildActivationStart(snapshot));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n };\n /**\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.runCanActivate = /**\n * @param {?} future\n * @return {?}\n */\n function (future) {\n var _this = this;\n var /** @type {?} */ canActivate = future.routeConfig ? future.routeConfig.canActivate : null;\n if (!canActivate || canActivate.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canActivate), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, future);\n var /** @type {?} */ observable;\n if (guard.canActivate) {\n observable = wrapIntoObservable(guard.canActivate(future, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(future, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return andObservables(obs);\n };\n /**\n * @param {?} path\n * @return {?}\n */\n PreActivation.prototype.runCanActivateChild = /**\n * @param {?} path\n * @return {?}\n */\n function (path) {\n var _this = this;\n var /** @type {?} */ future = path[path.length - 1];\n var /** @type {?} */ canActivateChildGuards = path.slice(0, path.length - 1)\n .reverse()\n .map(function (p) { return _this.extractCanActivateChild(p); })\n .filter(function (_) { return _ !== null; });\n return andObservables(__WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canActivateChildGuards), function (d) {\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(d.guards), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, d.node);\n var /** @type {?} */ observable;\n if (guard.canActivateChild) {\n observable = wrapIntoObservable(guard.canActivateChild(future, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(future, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return andObservables(obs);\n }));\n };\n /**\n * @param {?} p\n * @return {?}\n */\n PreActivation.prototype.extractCanActivateChild = /**\n * @param {?} p\n * @return {?}\n */\n function (p) {\n var /** @type {?} */ canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;\n if (!canActivateChild || canActivateChild.length === 0)\n return null;\n return { node: p, guards: canActivateChild };\n };\n /**\n * @param {?} component\n * @param {?} curr\n * @return {?}\n */\n PreActivation.prototype.runCanDeactivate = /**\n * @param {?} component\n * @param {?} curr\n * @return {?}\n */\n function (component, curr) {\n var _this = this;\n var /** @type {?} */ canDeactivate = curr && curr.routeConfig ? curr.routeConfig.canDeactivate : null;\n if (!canDeactivate || canDeactivate.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ canDeactivate$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canDeactivate), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, curr);\n var /** @type {?} */ observable;\n if (guard.canDeactivate) {\n observable =\n wrapIntoObservable(guard.canDeactivate(component, curr, _this.curr, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(component, curr, _this.curr, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(canDeactivate$, function (result) { return result === true; });\n };\n /**\n * @param {?} future\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n PreActivation.prototype.runResolve = /**\n * @param {?} future\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n function (future, paramsInheritanceStrategy) {\n var /** @type {?} */ resolve = future._resolve;\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.resolveNode(resolve, future), function (resolvedData) {\n future._resolvedData = resolvedData;\n future.data = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, future.data, inheritedParamsDataResolve(future, paramsInheritanceStrategy).resolve);\n return null;\n });\n };\n /**\n * @param {?} resolve\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.resolveNode = /**\n * @param {?} resolve\n * @param {?} future\n * @return {?}\n */\n function (resolve, future) {\n var _this = this;\n var /** @type {?} */ keys = Object.keys(resolve);\n if (keys.length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({});\n }\n if (keys.length === 1) {\n var /** @type {?} */ key_1 = keys[0];\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.getResolver(resolve[key_1], future), function (value) {\n return _a = {}, _a[key_1] = value, _a;\n var _a;\n });\n }\n var /** @type {?} */ data = {};\n var /** @type {?} */ runningResolvers$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(keys), function (key) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.getResolver(resolve[key], future), function (value) {\n data[key] = value;\n return value;\n });\n });\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(__WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__[\"last\"].call(runningResolvers$), function () { return data; });\n };\n /**\n * @param {?} injectionToken\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.getResolver = /**\n * @param {?} injectionToken\n * @param {?} future\n * @return {?}\n */\n function (injectionToken, future) {\n var /** @type {?} */ resolver = this.getToken(injectionToken, future);\n return resolver.resolve ? wrapIntoObservable(resolver.resolve(future, this.future)) :\n wrapIntoObservable(resolver(future, this.future));\n };\n /**\n * @param {?} token\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.getToken = /**\n * @param {?} token\n * @param {?} snapshot\n * @return {?}\n */\n function (token, snapshot) {\n var /** @type {?} */ config = closestLoadedConfig(snapshot);\n var /** @type {?} */ injector = config ? config.module.injector : this.moduleInjector;\n return injector.get(token);\n };\n return PreActivation;\n}());\n/**\n * @param {?} snapshot\n * @return {?}\n */\nfunction closestLoadedConfig(snapshot) {\n if (!snapshot)\n return null;\n for (var /** @type {?} */ s = snapshot.parent; s; s = s.parent) {\n var /** @type {?} */ route = s.routeConfig;\n if (route && route._loadedConfig)\n return route._loadedConfig;\n }\n return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NoMatch$1 = /** @class */ (function () {\n function NoMatch() {\n }\n return NoMatch;\n}());\n/**\n * @param {?} rootComponentType\n * @param {?} config\n * @param {?} urlTree\n * @param {?} url\n * @param {?=} paramsInheritanceStrategy\n * @return {?}\n */\nfunction recognize(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {\n if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }\n return new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy)\n .recognize();\n}\nvar Recognizer = /** @class */ (function () {\n function Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {\n this.rootComponentType = rootComponentType;\n this.config = config;\n this.urlTree = urlTree;\n this.url = url;\n this.paramsInheritanceStrategy = paramsInheritanceStrategy;\n }\n /**\n * @return {?}\n */\n Recognizer.prototype.recognize = /**\n * @return {?}\n */\n function () {\n try {\n var /** @type {?} */ rootSegmentGroup = split$1(this.urlTree.root, [], [], this.config).segmentGroup;\n var /** @type {?} */ children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);\n var /** @type {?} */ root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});\n var /** @type {?} */ rootNode = new TreeNode(root, children);\n var /** @type {?} */ routeState = new RouterStateSnapshot(this.url, rootNode);\n this.inheritParamsAndData(routeState._root);\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(routeState);\n }\n catch (/** @type {?} */ e) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(e); });\n }\n };\n /**\n * @param {?} routeNode\n * @return {?}\n */\n Recognizer.prototype.inheritParamsAndData = /**\n * @param {?} routeNode\n * @return {?}\n */\n function (routeNode) {\n var _this = this;\n var /** @type {?} */ route = routeNode.value;\n var /** @type {?} */ i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);\n route.params = Object.freeze(i.params);\n route.data = Object.freeze(i.data);\n routeNode.children.forEach(function (n) { return _this.inheritParamsAndData(n); });\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegmentGroup = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n function (config, segmentGroup, outlet) {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return this.processChildren(config, segmentGroup);\n }\n return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @return {?}\n */\n Recognizer.prototype.processChildren = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @return {?}\n */\n function (config, segmentGroup) {\n var _this = this;\n var /** @type {?} */ children = mapChildrenIntoArray(segmentGroup, function (child, childOutlet) { return _this.processSegmentGroup(config, child, childOutlet); });\n checkOutletNameUniqueness(children);\n sortActivatedRouteSnapshots(children);\n return children;\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegment = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (config, segmentGroup, segments, outlet) {\n for (var _i = 0, config_1 = config; _i < config_1.length; _i++) {\n var r = config_1[_i];\n try {\n return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);\n }\n catch (/** @type {?} */ e) {\n if (!(e instanceof NoMatch$1))\n throw e;\n }\n }\n if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return [];\n }\n throw new NoMatch$1();\n };\n /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.noLeftoversInUrl = /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (segmentGroup, segments, outlet) {\n return segments.length === 0 && !segmentGroup.children[outlet];\n };\n /**\n * @param {?} route\n * @param {?} rawSegment\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegmentAgainstRoute = /**\n * @param {?} route\n * @param {?} rawSegment\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (route, rawSegment, segments, outlet) {\n if (route.redirectTo)\n throw new NoMatch$1();\n if ((route.outlet || PRIMARY_OUTLET) !== outlet)\n throw new NoMatch$1();\n var /** @type {?} */ snapshot;\n var /** @type {?} */ consumedSegments = [];\n var /** @type {?} */ rawSlicedSegments = [];\n if (route.path === '**') {\n var /** @type {?} */ params = segments.length > 0 ? /** @type {?} */ ((last$1(segments))).parameters : {};\n snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));\n }\n else {\n var /** @type {?} */ result = match$1(rawSegment, route, segments);\n consumedSegments = result.consumedSegments;\n rawSlicedSegments = segments.slice(result.lastChild);\n snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));\n }\n var /** @type {?} */ childConfig = getChildConfig(route);\n var _a = split$1(rawSegment, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n var /** @type {?} */ children_1 = this.processChildren(childConfig, segmentGroup);\n return [new TreeNode(snapshot, children_1)];\n }\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return [new TreeNode(snapshot, [])];\n }\n var /** @type {?} */ children = this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);\n return [new TreeNode(snapshot, children)];\n };\n return Recognizer;\n}());\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction sortActivatedRouteSnapshots(nodes) {\n nodes.sort(function (a, b) {\n if (a.value.outlet === PRIMARY_OUTLET)\n return -1;\n if (b.value.outlet === PRIMARY_OUTLET)\n return 1;\n return a.value.outlet.localeCompare(b.value.outlet);\n });\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getChildConfig(route) {\n if (route.children) {\n return route.children;\n }\n if (route.loadChildren) {\n return /** @type {?} */ ((route._loadedConfig)).routes;\n }\n return [];\n}\n/**\n * @param {?} segmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\nfunction match$1(segmentGroup, route, segments) {\n if (route.path === '') {\n if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n throw new NoMatch$1();\n }\n return { consumedSegments: [], lastChild: 0, parameters: {} };\n }\n var /** @type {?} */ matcher = route.matcher || defaultUrlMatcher;\n var /** @type {?} */ res = matcher(segments, segmentGroup, route);\n if (!res)\n throw new NoMatch$1();\n var /** @type {?} */ posParams = {};\n forEach(/** @type {?} */ ((res.posParams)), function (v, k) { posParams[k] = v.path; });\n var /** @type {?} */ parameters = res.consumed.length > 0 ? Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, posParams, res.consumed[res.consumed.length - 1].parameters) :\n posParams;\n return { consumedSegments: res.consumed, lastChild: res.consumed.length, parameters: parameters };\n}\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction checkOutletNameUniqueness(nodes) {\n var /** @type {?} */ names = {};\n nodes.forEach(function (n) {\n var /** @type {?} */ routeWithSameOutletName = names[n.value.outlet];\n if (routeWithSameOutletName) {\n var /** @type {?} */ p = routeWithSameOutletName.url.map(function (s) { return s.toString(); }).join('/');\n var /** @type {?} */ c = n.value.url.map(function (s) { return s.toString(); }).join('/');\n throw new Error(\"Two segments cannot have the same outlet name: '\" + p + \"' and '\" + c + \"'.\");\n }\n names[n.value.outlet] = n.value;\n });\n}\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction getSourceSegmentGroup(segmentGroup) {\n var /** @type {?} */ s = segmentGroup;\n while (s._sourceSegment) {\n s = s._sourceSegment;\n }\n return s;\n}\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction getPathIndexShift(segmentGroup) {\n var /** @type {?} */ s = segmentGroup;\n var /** @type {?} */ res = (s._segmentIndexShift ? s._segmentIndexShift : 0);\n while (s._sourceSegment) {\n s = s._sourceSegment;\n res += (s._segmentIndexShift ? s._segmentIndexShift : 0);\n }\n return res - 1;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} slicedSegments\n * @param {?} config\n * @return {?}\n */\nfunction split$1(segmentGroup, consumedSegments, slicedSegments, config) {\n if (slicedSegments.length > 0 &&\n containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s_1 = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n s_1._sourceSegment = segmentGroup;\n s_1._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s_1, slicedSegments: [] };\n }\n if (slicedSegments.length === 0 &&\n containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s_2 = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));\n s_2._sourceSegment = segmentGroup;\n s_2._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s_2, slicedSegments: slicedSegments };\n }\n var /** @type {?} */ s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s, slicedSegments: slicedSegments };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @param {?} children\n * @return {?}\n */\nfunction addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {\n var /** @type {?} */ res = {};\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var r = routes_1[_i];\n if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet$1(r)]) {\n var /** @type {?} */ s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = segmentGroup.segments.length;\n res[getOutlet$1(r)] = s;\n }\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, children, res);\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} routes\n * @param {?} primarySegment\n * @return {?}\n */\nfunction createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {\n var /** @type {?} */ res = {};\n res[PRIMARY_OUTLET] = primarySegment;\n primarySegment._sourceSegment = segmentGroup;\n primarySegment._segmentIndexShift = consumedSegments.length;\n for (var _i = 0, routes_2 = routes; _i < routes_2.length; _i++) {\n var r = routes_2[_i];\n if (r.path === '' && getOutlet$1(r) !== PRIMARY_OUTLET) {\n var /** @type {?} */ s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n res[getOutlet$1(r)] = s;\n }\n }\n return res;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) {\n return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet$1(r) !== PRIMARY_OUTLET; });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathMatches(segmentGroup, slicedSegments, routes) {\n return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r); });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} r\n * @return {?}\n */\nfunction emptyPathMatch(segmentGroup, slicedSegments, r) {\n if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n return r.path === '' && r.redirectTo === undefined;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getOutlet$1(route) {\n return route.outlet || PRIMARY_OUTLET;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getData(route) {\n return route.data || {};\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getResolve(route) {\n return route.resolve || {};\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Provides a way to customize when activated routes get reused.\n *\n * \\@experimental\n * @abstract\n */\nvar RouteReuseStrategy = /** @class */ (function () {\n function RouteReuseStrategy() {\n }\n return RouteReuseStrategy;\n}());\n/**\n * Does not detach any subtrees. Reuses routes as long as their route config is the same.\n */\nvar DefaultRouteReuseStrategy = /** @class */ (function () {\n function DefaultRouteReuseStrategy() {\n }\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldDetach = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return false; };\n /**\n * @param {?} route\n * @param {?} detachedTree\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.store = /**\n * @param {?} route\n * @param {?} detachedTree\n * @return {?}\n */\n function (route, detachedTree) { };\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldAttach = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return false; };\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.retrieve = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return null; };\n /**\n * @param {?} future\n * @param {?} curr\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldReuseRoute = /**\n * @param {?} future\n * @param {?} curr\n * @return {?}\n */\n function (future, curr) {\n return future.routeConfig === curr.routeConfig;\n };\n return DefaultRouteReuseStrategy;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@docsNotRequired\n * \\@experimental\n */\nvar ROUTES = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTES');\nvar RouterConfigLoader = /** @class */ (function () {\n function RouterConfigLoader(loader, compiler, onLoadStartListener, onLoadEndListener) {\n this.loader = loader;\n this.compiler = compiler;\n this.onLoadStartListener = onLoadStartListener;\n this.onLoadEndListener = onLoadEndListener;\n }\n /**\n * @param {?} parentInjector\n * @param {?} route\n * @return {?}\n */\n RouterConfigLoader.prototype.load = /**\n * @param {?} parentInjector\n * @param {?} route\n * @return {?}\n */\n function (parentInjector, route) {\n var _this = this;\n if (this.onLoadStartListener) {\n this.onLoadStartListener(route);\n }\n var /** @type {?} */ moduleFactory$ = this.loadModuleFactory(/** @type {?} */ ((route.loadChildren)));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(moduleFactory$, function (factory) {\n if (_this.onLoadEndListener) {\n _this.onLoadEndListener(route);\n }\n var /** @type {?} */ module = factory.create(parentInjector);\n return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)), module);\n });\n };\n /**\n * @param {?} loadChildren\n * @return {?}\n */\n RouterConfigLoader.prototype.loadModuleFactory = /**\n * @param {?} loadChildren\n * @return {?}\n */\n function (loadChildren) {\n var _this = this;\n if (typeof loadChildren === 'string') {\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(this.loader.load(loadChildren));\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(wrapIntoObservable(loadChildren()), function (t) {\n if (t instanceof __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactory\"]) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(t);\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(_this.compiler.compileModuleAsync(t));\n }\n });\n }\n };\n return RouterConfigLoader;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Provides a way to migrate AngularJS applications to Angular.\n *\n * \\@experimental\n * @abstract\n */\nvar UrlHandlingStrategy = /** @class */ (function () {\n function UrlHandlingStrategy() {\n }\n return UrlHandlingStrategy;\n}());\n/**\n * \\@experimental\n */\nvar DefaultUrlHandlingStrategy = /** @class */ (function () {\n function DefaultUrlHandlingStrategy() {\n }\n /**\n * @param {?} url\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.shouldProcessUrl = /**\n * @param {?} url\n * @return {?}\n */\n function (url) { return true; };\n /**\n * @param {?} url\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.extract = /**\n * @param {?} url\n * @return {?}\n */\n function (url) { return url; };\n /**\n * @param {?} newUrlPart\n * @param {?} wholeUrl\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.merge = /**\n * @param {?} newUrlPart\n * @param {?} wholeUrl\n * @return {?}\n */\n function (newUrlPart, wholeUrl) { return newUrlPart; };\n return DefaultUrlHandlingStrategy;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Represents the extra options used during navigation.\n *\n * \\@stable\n * @record\n */\n\n/**\n * @param {?} error\n * @return {?}\n */\nfunction defaultErrorHandler(error) {\n throw error;\n}\n/**\n * \\@internal\n * @param {?} snapshot\n * @return {?}\n */\nfunction defaultRouterHook(snapshot) {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n}\n/**\n * \\@whatItDoes Provides the navigation and url manipulation capabilities.\n *\n * See {\\@link Routes} for more details and examples.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar Router = /** @class */ (function () {\n /**\n * Creates the router service.\n */\n // TODO: vsavkin make internal after the final is out.\n function Router(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {\n var _this = this;\n this.rootComponentType = rootComponentType;\n this.urlSerializer = urlSerializer;\n this.rootContexts = rootContexts;\n this.location = location;\n this.config = config;\n this.navigations = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](/** @type {?} */ ((null)));\n this.navigationId = 0;\n this.events = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n /**\n * Error handler that is invoked when a navigation errors.\n *\n * See {\\@link ErrorHandler} for more information.\n */\n this.errorHandler = defaultErrorHandler;\n /**\n * Indicates if at least one navigation happened.\n */\n this.navigated = false;\n /**\n * Used by RouterModule. This allows us to\n * pause the navigation either before preactivation or after it.\n * \\@internal\n */\n this.hooks = {\n beforePreactivation: defaultRouterHook,\n afterPreactivation: defaultRouterHook\n };\n /**\n * Extracts and merges URLs. Used for AngularJS to Angular migrations.\n */\n this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();\n this.routeReuseStrategy = new DefaultRouteReuseStrategy();\n /**\n * Define what the router should do if it receives a navigation request to the current URL.\n * By default, the router will ignore this navigation. However, this prevents features such\n * as a \"refresh\" button. Use this option to configure the behavior when navigating to the\n * current URL. Default is 'ignore'.\n */\n this.onSameUrlNavigation = 'ignore';\n /**\n * Defines how the router merges params, data and resolved data from parent to child\n * routes. Available options are:\n *\n * - `'emptyOnly'`, the default, only inherits parent params for path-less or component-less\n * routes.\n * - `'always'`, enables unconditional inheritance of parent params.\n */\n this.paramsInheritanceStrategy = 'emptyOnly';\n var /** @type {?} */ onLoadStart = function (r) { return _this.triggerEvent(new RouteConfigLoadStart(r)); };\n var /** @type {?} */ onLoadEnd = function (r) { return _this.triggerEvent(new RouteConfigLoadEnd(r)); };\n this.ngModule = injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n this.resetConfig(config);\n this.currentUrlTree = createEmptyUrlTree();\n this.rawUrlTree = this.currentUrlTree;\n this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);\n this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);\n this.processNavigations();\n }\n /**\n * @internal\n * TODO: this should be removed once the constructor of the router made internal\n */\n /**\n * \\@internal\n * TODO: this should be removed once the constructor of the router made internal\n * @param {?} rootComponentType\n * @return {?}\n */\n Router.prototype.resetRootComponentType = /**\n * \\@internal\n * TODO: this should be removed once the constructor of the router made internal\n * @param {?} rootComponentType\n * @return {?}\n */\n function (rootComponentType) {\n this.rootComponentType = rootComponentType;\n // TODO: vsavkin router 4.0 should make the root component set to null\n // this will simplify the lifecycle of the router.\n this.routerState.root.component = this.rootComponentType;\n };\n /**\n * Sets up the location change listener and performs the initial navigation.\n */\n /**\n * Sets up the location change listener and performs the initial navigation.\n * @return {?}\n */\n Router.prototype.initialNavigation = /**\n * Sets up the location change listener and performs the initial navigation.\n * @return {?}\n */\n function () {\n this.setUpLocationChangeListener();\n if (this.navigationId === 0) {\n this.navigateByUrl(this.location.path(true), { replaceUrl: true });\n }\n };\n /**\n * Sets up the location change listener.\n */\n /**\n * Sets up the location change listener.\n * @return {?}\n */\n Router.prototype.setUpLocationChangeListener = /**\n * Sets up the location change listener.\n * @return {?}\n */\n function () {\n var _this = this;\n // Zone.current.wrap is needed because of the issue with RxJS scheduler,\n // which does not work properly with zone.js in IE and Safari\n if (!this.locationSubscription) {\n this.locationSubscription = /** @type {?} */ (this.location.subscribe(Zone.current.wrap(function (change) {\n var /** @type {?} */ rawUrlTree = _this.urlSerializer.parse(change['url']);\n var /** @type {?} */ source = change['type'] === 'popstate' ? 'popstate' : 'hashchange';\n setTimeout(function () { _this.scheduleNavigation(rawUrlTree, source, { replaceUrl: true }); }, 0);\n })));\n }\n };\n Object.defineProperty(Router.prototype, \"url\", {\n /** The current url */\n get: /**\n * The current url\n * @return {?}\n */\n function () { return this.serializeUrl(this.currentUrlTree); },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} e\n * @return {?}\n */\n Router.prototype.triggerEvent = /**\n * \\@internal\n * @param {?} e\n * @return {?}\n */\n function (e) { (/** @type {?} */ (this.events)).next(e); };\n /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n */\n /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n * @param {?} config\n * @return {?}\n */\n Router.prototype.resetConfig = /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n * @param {?} config\n * @return {?}\n */\n function (config) {\n validateConfig(config);\n this.config = config;\n this.navigated = false;\n };\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n Router.prototype.ngOnDestroy = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { this.dispose(); };\n /** Disposes of the router */\n /**\n * Disposes of the router\n * @return {?}\n */\n Router.prototype.dispose = /**\n * Disposes of the router\n * @return {?}\n */\n function () {\n if (this.locationSubscription) {\n this.locationSubscription.unsubscribe();\n this.locationSubscription = /** @type {?} */ ((null));\n }\n };\n /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n */\n /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n * @param {?} commands\n * @param {?=} navigationExtras\n * @return {?}\n */\n Router.prototype.createUrlTree = /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n * @param {?} commands\n * @param {?=} navigationExtras\n * @return {?}\n */\n function (commands, navigationExtras) {\n if (navigationExtras === void 0) { navigationExtras = {}; }\n var relativeTo = navigationExtras.relativeTo, queryParams = navigationExtras.queryParams, fragment = navigationExtras.fragment, preserveQueryParams = navigationExtras.preserveQueryParams, queryParamsHandling = navigationExtras.queryParamsHandling, preserveFragment = navigationExtras.preserveFragment;\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && preserveQueryParams && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n var /** @type {?} */ a = relativeTo || this.routerState.root;\n var /** @type {?} */ f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n var /** @type {?} */ q = null;\n if (queryParamsHandling) {\n switch (queryParamsHandling) {\n case 'merge':\n q = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, this.currentUrlTree.queryParams, queryParams);\n break;\n case 'preserve':\n q = this.currentUrlTree.queryParams;\n break;\n default:\n q = queryParams || null;\n }\n }\n else {\n q = preserveQueryParams ? this.currentUrlTree.queryParams : queryParams || null;\n }\n if (q !== null) {\n q = this.removeEmptyProps(q);\n }\n return createUrlTree(a, this.currentUrlTree, commands, /** @type {?} */ ((q)), /** @type {?} */ ((f)));\n };\n /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n */\n /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n * @param {?} url\n * @param {?=} extras\n * @return {?}\n */\n Router.prototype.navigateByUrl = /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n * @param {?} url\n * @param {?=} extras\n * @return {?}\n */\n function (url, extras) {\n if (extras === void 0) { extras = { skipLocationChange: false }; }\n var /** @type {?} */ urlTree = url instanceof UrlTree ? url : this.parseUrl(url);\n var /** @type {?} */ mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);\n return this.scheduleNavigation(mergedTree, 'imperative', extras);\n };\n /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n */\n /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n * @param {?} commands\n * @param {?=} extras\n * @return {?}\n */\n Router.prototype.navigate = /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n * @param {?} commands\n * @param {?=} extras\n * @return {?}\n */\n function (commands, extras) {\n if (extras === void 0) { extras = { skipLocationChange: false }; }\n validateCommands(commands);\n return this.navigateByUrl(this.createUrlTree(commands, extras), extras);\n };\n /** Serializes a {@link UrlTree} into a string */\n /**\n * Serializes a {\\@link UrlTree} into a string\n * @param {?} url\n * @return {?}\n */\n Router.prototype.serializeUrl = /**\n * Serializes a {\\@link UrlTree} into a string\n * @param {?} url\n * @return {?}\n */\n function (url) { return this.urlSerializer.serialize(url); };\n /** Parses a string into a {@link UrlTree} */\n /**\n * Parses a string into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n Router.prototype.parseUrl = /**\n * Parses a string into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n function (url) { return this.urlSerializer.parse(url); };\n /** Returns whether the url is activated */\n /**\n * Returns whether the url is activated\n * @param {?} url\n * @param {?} exact\n * @return {?}\n */\n Router.prototype.isActive = /**\n * Returns whether the url is activated\n * @param {?} url\n * @param {?} exact\n * @return {?}\n */\n function (url, exact) {\n if (url instanceof UrlTree) {\n return containsTree(this.currentUrlTree, url, exact);\n }\n var /** @type {?} */ urlTree = this.urlSerializer.parse(url);\n return containsTree(this.currentUrlTree, urlTree, exact);\n };\n /**\n * @param {?} params\n * @return {?}\n */\n Router.prototype.removeEmptyProps = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return Object.keys(params).reduce(function (result, key) {\n var /** @type {?} */ value = params[key];\n if (value !== null && value !== undefined) {\n result[key] = value;\n }\n return result;\n }, {});\n };\n /**\n * @return {?}\n */\n Router.prototype.processNavigations = /**\n * @return {?}\n */\n function () {\n var _this = this;\n __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"]\n .call(this.navigations, function (nav) {\n if (nav) {\n _this.executeScheduledNavigation(nav);\n // a failed navigation should not stop the router from processing\n // further navigations => the catch\n return nav.promise.catch(function () { });\n }\n else {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n }\n })\n .subscribe(function () { });\n };\n /**\n * @param {?} rawUrl\n * @param {?} source\n * @param {?} extras\n * @return {?}\n */\n Router.prototype.scheduleNavigation = /**\n * @param {?} rawUrl\n * @param {?} source\n * @param {?} extras\n * @return {?}\n */\n function (rawUrl, source, extras) {\n var /** @type {?} */ lastNavigation = this.navigations.value;\n // If the user triggers a navigation imperatively (e.g., by using navigateByUrl),\n // and that navigation results in 'replaceState' that leads to the same URL,\n // we should skip those.\n if (lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a popstate was emitted first.\n if (lastNavigation && source == 'hashchange' && lastNavigation.source === 'popstate' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a hashchange was emitted first.\n if (lastNavigation && source == 'popstate' && lastNavigation.source === 'hashchange' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n var /** @type {?} */ resolve = null;\n var /** @type {?} */ reject = null;\n var /** @type {?} */ promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n var /** @type {?} */ id = ++this.navigationId;\n this.navigations.next({ id: id, source: source, rawUrl: rawUrl, extras: extras, resolve: resolve, reject: reject, promise: promise });\n // Make sure that the error is propagated even though `processNavigations` catch\n // handler does not rethrow\n return promise.catch(function (e) { return Promise.reject(e); });\n };\n /**\n * @param {?} __0\n * @return {?}\n */\n Router.prototype.executeScheduledNavigation = /**\n * @param {?} __0\n * @return {?}\n */\n function (_a) {\n var _this = this;\n var id = _a.id, rawUrl = _a.rawUrl, extras = _a.extras, resolve = _a.resolve, reject = _a.reject;\n var /** @type {?} */ url = this.urlHandlingStrategy.extract(rawUrl);\n var /** @type {?} */ urlTransition = !this.navigated || url.toString() !== this.currentUrlTree.toString();\n if ((this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&\n this.urlHandlingStrategy.shouldProcessUrl(rawUrl)) {\n (/** @type {?} */ (this.events)).next(new NavigationStart(id, this.serializeUrl(url)));\n Promise.resolve()\n .then(function (_) {\n return _this.runNavigate(url, rawUrl, !!extras.skipLocationChange, !!extras.replaceUrl, id, null);\n })\n .then(resolve, reject);\n // we cannot process the current URL, but we could process the previous one =>\n // we need to do some cleanup\n }\n else if (urlTransition && this.rawUrlTree &&\n this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)) {\n (/** @type {?} */ (this.events)).next(new NavigationStart(id, this.serializeUrl(url)));\n Promise.resolve()\n .then(function (_) {\n return _this.runNavigate(url, rawUrl, false, false, id, createEmptyState(url, _this.rootComponentType).snapshot);\n })\n .then(resolve, reject);\n }\n else {\n this.rawUrlTree = rawUrl;\n resolve(null);\n }\n };\n /**\n * @param {?} url\n * @param {?} rawUrl\n * @param {?} skipLocationChange\n * @param {?} replaceUrl\n * @param {?} id\n * @param {?} precreatedState\n * @return {?}\n */\n Router.prototype.runNavigate = /**\n * @param {?} url\n * @param {?} rawUrl\n * @param {?} skipLocationChange\n * @param {?} replaceUrl\n * @param {?} id\n * @param {?} precreatedState\n * @return {?}\n */\n function (url, rawUrl, skipLocationChange, replaceUrl, id, precreatedState) {\n var _this = this;\n if (id !== this.navigationId) {\n (/** @type {?} */ (this.events))\n .next(new NavigationCancel(id, this.serializeUrl(url), \"Navigation ID \" + id + \" is not equal to the current navigation id \" + this.navigationId));\n return Promise.resolve(false);\n }\n return new Promise(function (resolvePromise, rejectPromise) {\n // create an observable of the url and route state snapshot\n // this operation do not result in any side effects\n var /** @type {?} */ urlAndSnapshot$;\n if (!precreatedState) {\n var /** @type {?} */ moduleInjector = _this.ngModule.injector;\n var /** @type {?} */ redirectsApplied$ = applyRedirects(moduleInjector, _this.configLoader, _this.urlSerializer, url, _this.config);\n urlAndSnapshot$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(redirectsApplied$, function (appliedUrl) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(recognize(_this.rootComponentType, _this.config, appliedUrl, _this.serializeUrl(appliedUrl), _this.paramsInheritanceStrategy), function (snapshot) {\n (/** @type {?} */ (_this.events))\n .next(new RoutesRecognized(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot));\n return { appliedUrl: appliedUrl, snapshot: snapshot };\n });\n });\n }\n else {\n urlAndSnapshot$ = Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({ appliedUrl: url, snapshot: precreatedState });\n }\n var /** @type {?} */ beforePreactivationDone$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(urlAndSnapshot$, function (p) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.hooks.beforePreactivation(p.snapshot), function () { return p; });\n });\n // run preactivation: guards and data resolvers\n var /** @type {?} */ preActivation;\n var /** @type {?} */ preactivationSetup$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(beforePreactivationDone$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot;\n var /** @type {?} */ moduleInjector = _this.ngModule.injector;\n preActivation = new PreActivation(snapshot, _this.routerState.snapshot, moduleInjector, function (evt) { return _this.triggerEvent(evt); });\n preActivation.initialize(_this.rootContexts);\n return { appliedUrl: appliedUrl, snapshot: snapshot };\n });\n var /** @type {?} */ preactivationCheckGuards$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationSetup$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot;\n if (_this.navigationId !== id)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false);\n _this.triggerEvent(new GuardsCheckStart(id, _this.serializeUrl(url), appliedUrl, snapshot));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preActivation.checkGuards(), function (shouldActivate) {\n _this.triggerEvent(new GuardsCheckEnd(id, _this.serializeUrl(url), appliedUrl, snapshot, shouldActivate));\n return { appliedUrl: appliedUrl, snapshot: snapshot, shouldActivate: shouldActivate };\n });\n });\n var /** @type {?} */ preactivationResolveData$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationCheckGuards$, function (p) {\n if (_this.navigationId !== id)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false);\n if (p.shouldActivate && preActivation.isActivating()) {\n _this.triggerEvent(new ResolveStart(id, _this.serializeUrl(url), p.appliedUrl, p.snapshot));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preActivation.resolveData(_this.paramsInheritanceStrategy), function () {\n _this.triggerEvent(new ResolveEnd(id, _this.serializeUrl(url), p.appliedUrl, p.snapshot));\n return p;\n });\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(p);\n }\n });\n var /** @type {?} */ preactivationDone$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationResolveData$, function (p) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.hooks.afterPreactivation(p.snapshot), function () { return p; });\n });\n // create router state\n // this operation has side effects => route state is being affected\n var /** @type {?} */ routerState$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preactivationDone$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot, shouldActivate = _a.shouldActivate;\n if (shouldActivate) {\n var /** @type {?} */ state = createRouterState(_this.routeReuseStrategy, snapshot, _this.routerState);\n return { appliedUrl: appliedUrl, state: state, shouldActivate: shouldActivate };\n }\n else {\n return { appliedUrl: appliedUrl, state: null, shouldActivate: shouldActivate };\n }\n });\n // applied the new router state\n // this operation has side effects\n var /** @type {?} */ navigationIsSuccessful;\n var /** @type {?} */ storedState = _this.routerState;\n var /** @type {?} */ storedUrl = _this.currentUrlTree;\n routerState$\n .forEach(function (_a) {\n var appliedUrl = _a.appliedUrl, state = _a.state, shouldActivate = _a.shouldActivate;\n if (!shouldActivate || id !== _this.navigationId) {\n navigationIsSuccessful = false;\n return;\n }\n _this.currentUrlTree = appliedUrl;\n _this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);\n (/** @type {?} */ (_this)).routerState = state;\n if (!skipLocationChange) {\n var /** @type {?} */ path = _this.urlSerializer.serialize(_this.rawUrlTree);\n if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {\n _this.location.replaceState(path);\n }\n else {\n _this.location.go(path);\n }\n }\n new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })\n .activate(_this.rootContexts);\n navigationIsSuccessful = true;\n })\n .then(function () {\n if (navigationIsSuccessful) {\n _this.navigated = true;\n (/** @type {?} */ (_this.events))\n .next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));\n resolvePromise(true);\n }\n else {\n _this.resetUrlToCurrentUrlTree();\n (/** @type {?} */ (_this.events))\n .next(new NavigationCancel(id, _this.serializeUrl(url), ''));\n resolvePromise(false);\n }\n }, function (e) {\n if (isNavigationCancelingError(e)) {\n _this.navigated = true;\n _this.resetStateAndUrl(storedState, storedUrl, rawUrl);\n (/** @type {?} */ (_this.events))\n .next(new NavigationCancel(id, _this.serializeUrl(url), e.message));\n resolvePromise(false);\n }\n else {\n _this.resetStateAndUrl(storedState, storedUrl, rawUrl);\n (/** @type {?} */ (_this.events))\n .next(new NavigationError(id, _this.serializeUrl(url), e));\n try {\n resolvePromise(_this.errorHandler(e));\n }\n catch (/** @type {?} */ ee) {\n rejectPromise(ee);\n }\n }\n });\n });\n };\n /**\n * @param {?} storedState\n * @param {?} storedUrl\n * @param {?} rawUrl\n * @return {?}\n */\n Router.prototype.resetStateAndUrl = /**\n * @param {?} storedState\n * @param {?} storedUrl\n * @param {?} rawUrl\n * @return {?}\n */\n function (storedState, storedUrl, rawUrl) {\n (/** @type {?} */ (this)).routerState = storedState;\n this.currentUrlTree = storedUrl;\n this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);\n this.resetUrlToCurrentUrlTree();\n };\n /**\n * @return {?}\n */\n Router.prototype.resetUrlToCurrentUrlTree = /**\n * @return {?}\n */\n function () {\n this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree));\n };\n return Router;\n}());\nvar ActivateRoutes = /** @class */ (function () {\n function ActivateRoutes(routeReuseStrategy, futureState, currState, forwardEvent) {\n this.routeReuseStrategy = routeReuseStrategy;\n this.futureState = futureState;\n this.currState = currState;\n this.forwardEvent = forwardEvent;\n }\n /**\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.activate = /**\n * @param {?} parentContexts\n * @return {?}\n */\n function (parentContexts) {\n var /** @type {?} */ futureRoot = this.futureState._root;\n var /** @type {?} */ currRoot = this.currState ? this.currState._root : null;\n this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);\n advanceActivatedRoute(this.futureState.root);\n this.activateChildRoutes(futureRoot, currRoot, parentContexts);\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateChildRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n function (futureNode, currNode, contexts) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(currNode);\n // Recurse on the routes active in the future state to de-activate deeper children\n futureNode.children.forEach(function (futureChild) {\n var /** @type {?} */ childOutletName = futureChild.value.outlet;\n _this.deactivateRoutes(futureChild, children[childOutletName], contexts);\n delete children[childOutletName];\n });\n // De-activate the routes that will not be re-used\n forEach(children, function (v, childName) {\n _this.deactivateRouteAndItsChildren(v, contexts);\n });\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContext\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContext\n * @return {?}\n */\n function (futureNode, currNode, parentContext) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n if (future === curr) {\n // Reusing the node, check to see if the children need to be de-activated\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n var /** @type {?} */ context = parentContext.getContext(future.outlet);\n if (context) {\n this.deactivateChildRoutes(futureNode, currNode, context.children);\n }\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.deactivateChildRoutes(futureNode, currNode, parentContext);\n }\n }\n else {\n if (curr) {\n // Deactivate the current route which will not be re-used\n this.deactivateRouteAndItsChildren(currNode, parentContext);\n }\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRouteAndItsChildren = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {\n this.detachAndStoreRouteSubtree(route, parentContexts);\n }\n else {\n this.deactivateRouteAndOutlet(route, parentContexts);\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.detachAndStoreRouteSubtree = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n var /** @type {?} */ context = parentContexts.getContext(route.value.outlet);\n if (context && context.outlet) {\n var /** @type {?} */ componentRef = context.outlet.detach();\n var /** @type {?} */ contexts = context.children.onOutletDeactivated();\n this.routeReuseStrategy.store(route.value.snapshot, { componentRef: componentRef, route: route, contexts: contexts });\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRouteAndOutlet = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n var _this = this;\n var /** @type {?} */ context = parentContexts.getContext(route.value.outlet);\n if (context) {\n var /** @type {?} */ children = nodeChildrenAsMap(route);\n var /** @type {?} */ contexts_1 = route.value.component ? context.children : parentContexts;\n forEach(children, function (v, k) { return _this.deactivateRouteAndItsChildren(v, contexts_1); });\n if (context.outlet) {\n // Destroy the component\n context.outlet.deactivate();\n // Destroy the contexts for all the outlets that were in the component\n context.children.onOutletDeactivated();\n }\n }\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n ActivateRoutes.prototype.activateChildRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n function (futureNode, currNode, contexts) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(currNode);\n futureNode.children.forEach(function (c) {\n _this.activateRoutes(c, children[c.value.outlet], contexts);\n _this.forwardEvent(new ActivationEnd(c.value.snapshot));\n });\n if (futureNode.children.length) {\n this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));\n }\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.activateRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @return {?}\n */\n function (futureNode, currNode, parentContexts) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n advanceActivatedRoute(future);\n // reusing the node\n if (future === curr) {\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n var /** @type {?} */ context = parentContexts.getOrCreateContext(future.outlet);\n this.activateChildRoutes(futureNode, currNode, context.children);\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, currNode, parentContexts);\n }\n }\n else {\n if (future.component) {\n // if we have a normal route, we need to place the component into the outlet and recurse.\n var /** @type {?} */ context = parentContexts.getOrCreateContext(future.outlet);\n if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {\n var /** @type {?} */ stored = (/** @type {?} */ (this.routeReuseStrategy.retrieve(future.snapshot)));\n this.routeReuseStrategy.store(future.snapshot, null);\n context.children.onOutletReAttached(stored.contexts);\n context.attachRef = stored.componentRef;\n context.route = stored.route.value;\n if (context.outlet) {\n // Attach right away when the outlet has already been instantiated\n // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated\n context.outlet.attach(stored.componentRef, stored.route.value);\n }\n advanceActivatedRouteNodeAndItsChildren(stored.route);\n }\n else {\n var /** @type {?} */ config = parentLoadedConfig(future.snapshot);\n var /** @type {?} */ cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;\n context.route = future;\n context.resolver = cmpFactoryResolver;\n if (context.outlet) {\n // Activate the outlet when it has already been instantiated\n // Otherwise it will get activated from its `ngOnInit` when instantiated\n context.outlet.activateWith(future, cmpFactoryResolver);\n }\n this.activateChildRoutes(futureNode, null, context.children);\n }\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, null, parentContexts);\n }\n }\n };\n return ActivateRoutes;\n}());\n/**\n * @param {?} node\n * @return {?}\n */\nfunction advanceActivatedRouteNodeAndItsChildren(node) {\n advanceActivatedRoute(node.value);\n node.children.forEach(advanceActivatedRouteNodeAndItsChildren);\n}\n/**\n * @param {?} snapshot\n * @return {?}\n */\nfunction parentLoadedConfig(snapshot) {\n for (var /** @type {?} */ s = snapshot.parent; s; s = s.parent) {\n var /** @type {?} */ route = s.routeConfig;\n if (route && route._loadedConfig)\n return route._loadedConfig;\n if (route && route.component)\n return null;\n }\n return null;\n}\n/**\n * @param {?} commands\n * @return {?}\n */\nfunction validateCommands(commands) {\n for (var /** @type {?} */ i = 0; i < commands.length; i++) {\n var /** @type {?} */ cmd = commands[i];\n if (cmd == null) {\n throw new Error(\"The requested path contains \" + cmd + \" segment at index \" + i);\n }\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Lets you link to specific parts of your app.\n *\n * \\@howToUse\n *\n * Consider the following route configuration:\n * `[{ path: 'user/:name', component: UserCmp }]`\n *\n * When linking to this `user/:name` route, you can write:\n * `<a routerLink='/user/bob'>link to user component</a>`\n *\n * \\@description\n *\n * The RouterLink directives let you link to specific parts of your app.\n *\n * When the link is static, you can use the directive as follows:\n * `<a routerLink=\"/user/bob\">link to user component</a>`\n *\n * If you use dynamic values to generate the link, you can pass an array of path\n * segments, followed by the params for each segment.\n *\n * For instance `['/team', teamId, 'user', userName, {details: true}]`\n * means that we want to generate a link to `/team/11/user/bob;details=true`.\n *\n * Multiple static segments can be merged into one\n * (e.g., `['/team/11/user', userName, {details: true}]`).\n *\n * The first segment name can be prepended with `/`, `./`, or `../`:\n * * If the first segment begins with `/`, the router will look up the route from the root of the\n * app.\n * * If the first segment begins with `./`, or doesn't begin with a slash, the router will\n * instead look in the children of the current activated route.\n * * And if the first segment begins with `../`, the router will go up one level.\n *\n * You can set query params and fragment as follows:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" fragment=\"education\">\n * link to user component\n * </a>\n * ```\n * RouterLink will use these to generate this link: `/user/bob#education?debug=true`.\n *\n * (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the\n * directive to preserve the current query params and fragment:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" preserveQueryParams preserveFragment>\n * link to user component\n * </a>\n * ```\n *\n * You can tell the directive to how to handle queryParams, available options are:\n * - `'merge'`: merge the queryParams into the current queryParams\n * - `'preserve'`: preserve the current queryParams\n * - default/`''`: use the queryParams only\n *\n * Same options for {\\@link NavigationExtras#queryParamsHandling\n * NavigationExtras#queryParamsHandling}.\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" queryParamsHandling=\"merge\">\n * link to user component\n * </a>\n * ```\n *\n * The router link directive always treats the provided input as a delta to the current url.\n *\n * For instance, if the current url is `/user/(box//aux:team)`.\n *\n * Then the following link `<a [routerLink]=\"['/user/jim']\">Jim</a>` will generate the link\n * `/user/(jim//aux:team)`.\n *\n * See {\\@link Router#createUrlTree createUrlTree} for more information.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLink = /** @class */ (function () {\n function RouterLink(router, route, tabIndex, renderer, el) {\n this.router = router;\n this.route = route;\n this.commands = [];\n if (tabIndex == null) {\n renderer.setAttribute(el.nativeElement, 'tabindex', '0');\n }\n }\n Object.defineProperty(RouterLink.prototype, \"routerLink\", {\n set: /**\n * @param {?} commands\n * @return {?}\n */\n function (commands) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n }\n else {\n this.commands = [];\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterLink.prototype, \"preserveQueryParams\", {\n set: /**\n * @deprecated 4.0.0 use `queryParamsHandling` instead.\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated!, use queryParamsHandling instead.');\n }\n this.preserve = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n RouterLink.prototype.onClick = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return true;\n };\n Object.defineProperty(RouterLink.prototype, \"urlTree\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.router.createUrlTree(this.commands, {\n relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n },\n enumerable: true,\n configurable: true\n });\n RouterLink.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: ':not(a)[routerLink]' },] },\n ];\n /** @nocollapse */\n RouterLink.ctorParameters = function () { return [\n { type: Router, },\n { type: ActivatedRoute, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Attribute\"], args: ['tabindex',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n RouterLink.propDecorators = {\n \"queryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"fragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParamsHandling\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveFragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"skipLocationChange\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"replaceUrl\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"routerLink\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveQueryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"onClick\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostListener\"], args: ['click',] },],\n };\n return RouterLink;\n}());\n/**\n * \\@whatItDoes Lets you link to specific parts of your app.\n *\n * See {\\@link RouterLink} for more information.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLinkWithHref = /** @class */ (function () {\n function RouterLinkWithHref(router, route, locationStrategy) {\n var _this = this;\n this.router = router;\n this.route = route;\n this.locationStrategy = locationStrategy;\n this.commands = [];\n this.subscription = router.events.subscribe(function (s) {\n if (s instanceof NavigationEnd) {\n _this.updateTargetUrlAndHref();\n }\n });\n }\n Object.defineProperty(RouterLinkWithHref.prototype, \"routerLink\", {\n set: /**\n * @param {?} commands\n * @return {?}\n */\n function (commands) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n }\n else {\n this.commands = [];\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterLinkWithHref.prototype, \"preserveQueryParams\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n this.preserve = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n RouterLinkWithHref.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) { this.updateTargetUrlAndHref(); };\n /**\n * @return {?}\n */\n RouterLinkWithHref.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @param {?} button\n * @param {?} ctrlKey\n * @param {?} metaKey\n * @param {?} shiftKey\n * @return {?}\n */\n RouterLinkWithHref.prototype.onClick = /**\n * @param {?} button\n * @param {?} ctrlKey\n * @param {?} metaKey\n * @param {?} shiftKey\n * @return {?}\n */\n function (button, ctrlKey, metaKey, shiftKey) {\n if (button !== 0 || ctrlKey || metaKey || shiftKey) {\n return true;\n }\n if (typeof this.target === 'string' && this.target != '_self') {\n return true;\n }\n var /** @type {?} */ extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return false;\n };\n /**\n * @return {?}\n */\n RouterLinkWithHref.prototype.updateTargetUrlAndHref = /**\n * @return {?}\n */\n function () {\n this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));\n };\n Object.defineProperty(RouterLinkWithHref.prototype, \"urlTree\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.router.createUrlTree(this.commands, {\n relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n },\n enumerable: true,\n configurable: true\n });\n RouterLinkWithHref.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'a[routerLink]' },] },\n ];\n /** @nocollapse */\n RouterLinkWithHref.ctorParameters = function () { return [\n { type: Router, },\n { type: ActivatedRoute, },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LocationStrategy\"], },\n ]; };\n RouterLinkWithHref.propDecorators = {\n \"target\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostBinding\"], args: ['attr.target',] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"fragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParamsHandling\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveFragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"skipLocationChange\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"replaceUrl\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"href\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostBinding\"] },],\n \"routerLink\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveQueryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"onClick\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostListener\"], args: ['click', ['$event.button', '$event.ctrlKey', '$event.metaKey', '$event.shiftKey'],] },],\n };\n return RouterLinkWithHref;\n}());\n/**\n * @param {?} s\n * @return {?}\n */\nfunction attrBoolValue(s) {\n return s === '' || !!s;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Lets you add a CSS class to an element when the link's route becomes active.\n *\n * \\@howToUse\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\">Bob</a>\n * ```\n *\n * \\@description\n *\n * The RouterLinkActive directive lets you add a CSS class to an element when the link's route\n * becomes active.\n *\n * Consider the following example:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\">Bob</a>\n * ```\n *\n * When the url is either '/user' or '/user/bob', the active-link class will\n * be added to the `a` tag. If the url changes, the class will be removed.\n *\n * You can set more than one class, as follows:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"class1 class2\">Bob</a>\n * <a routerLink=\"/user/bob\" [routerLinkActive]=\"['class1', 'class2']\">Bob</a>\n * ```\n *\n * You can configure RouterLinkActive by passing `exact: true`. This will add the classes\n * only when the url matches the link exactly.\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact:\n * true}\">Bob</a>\n * ```\n *\n * You can assign the RouterLinkActive instance to a template variable and directly check\n * the `isActive` status.\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive #rla=\"routerLinkActive\">\n * Bob {{ rla.isActive ? '(already open)' : ''}}\n * </a>\n * ```\n *\n * Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink.\n *\n * ```\n * <div routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact: true}\">\n * <a routerLink=\"/user/jim\">Jim</a>\n * <a routerLink=\"/user/bob\">Bob</a>\n * </div>\n * ```\n *\n * This will set the active-link class on the div tag if the url is either '/user/jim' or\n * '/user/bob'.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLinkActive = /** @class */ (function () {\n function RouterLinkActive(router, element, renderer, cdr) {\n var _this = this;\n this.router = router;\n this.element = element;\n this.renderer = renderer;\n this.cdr = cdr;\n this.classes = [];\n this.isActive = false;\n this.routerLinkActiveOptions = { exact: false };\n this.subscription = router.events.subscribe(function (s) {\n if (s instanceof NavigationEnd) {\n _this.update();\n }\n });\n }\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.ngAfterContentInit = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.links.changes.subscribe(function (_) { return _this.update(); });\n this.linksWithHrefs.changes.subscribe(function (_) { return _this.update(); });\n this.update();\n };\n Object.defineProperty(RouterLinkActive.prototype, \"routerLinkActive\", {\n set: /**\n * @param {?} data\n * @return {?}\n */\n function (data) {\n var /** @type {?} */ classes = Array.isArray(data) ? data : data.split(' ');\n this.classes = classes.filter(function (c) { return !!c; });\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n RouterLinkActive.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) { this.update(); };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.update = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!this.links || !this.linksWithHrefs || !this.router.navigated)\n return;\n Promise.resolve().then(function () {\n var /** @type {?} */ hasActiveLinks = _this.hasActiveLinks();\n if (_this.isActive !== hasActiveLinks) {\n (/** @type {?} */ (_this)).isActive = hasActiveLinks;\n _this.classes.forEach(function (c) {\n if (hasActiveLinks) {\n _this.renderer.addClass(_this.element.nativeElement, c);\n }\n else {\n _this.renderer.removeClass(_this.element.nativeElement, c);\n }\n });\n }\n });\n };\n /**\n * @param {?} router\n * @return {?}\n */\n RouterLinkActive.prototype.isLinkActive = /**\n * @param {?} router\n * @return {?}\n */\n function (router) {\n var _this = this;\n return function (link) {\n return router.isActive(link.urlTree, _this.routerLinkActiveOptions.exact);\n };\n };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.hasActiveLinks = /**\n * @return {?}\n */\n function () {\n return this.links.some(this.isLinkActive(this.router)) ||\n this.linksWithHrefs.some(this.isLinkActive(this.router));\n };\n RouterLinkActive.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[routerLinkActive]',\n exportAs: 'routerLinkActive',\n },] },\n ];\n /** @nocollapse */\n RouterLinkActive.ctorParameters = function () { return [\n { type: Router, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n RouterLinkActive.propDecorators = {\n \"links\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ContentChildren\"], args: [RouterLink, { descendants: true },] },],\n \"linksWithHrefs\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ContentChildren\"], args: [RouterLinkWithHref, { descendants: true },] },],\n \"routerLinkActiveOptions\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"routerLinkActive\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RouterLinkActive;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Store contextual information about a {\\@link RouterOutlet}\n *\n * \\@stable\n */\nvar OutletContext = /** @class */ (function () {\n function OutletContext() {\n this.outlet = null;\n this.route = null;\n this.resolver = null;\n this.children = new ChildrenOutletContexts();\n this.attachRef = null;\n }\n return OutletContext;\n}());\n/**\n * Store contextual information about the children (= nested) {\\@link RouterOutlet}\n *\n * \\@stable\n */\nvar ChildrenOutletContexts = /** @class */ (function () {\n function ChildrenOutletContexts() {\n this.contexts = new Map();\n }\n /** Called when a `RouterOutlet` directive is instantiated */\n /**\n * Called when a `RouterOutlet` directive is instantiated\n * @param {?} childName\n * @param {?} outlet\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onChildOutletCreated = /**\n * Called when a `RouterOutlet` directive is instantiated\n * @param {?} childName\n * @param {?} outlet\n * @return {?}\n */\n function (childName, outlet) {\n var /** @type {?} */ context = this.getOrCreateContext(childName);\n context.outlet = outlet;\n this.contexts.set(childName, context);\n };\n /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n */\n /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onChildOutletDestroyed = /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n * @param {?} childName\n * @return {?}\n */\n function (childName) {\n var /** @type {?} */ context = this.getContext(childName);\n if (context) {\n context.outlet = null;\n }\n };\n /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n */\n /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onOutletDeactivated = /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n * @return {?}\n */\n function () {\n var /** @type {?} */ contexts = this.contexts;\n this.contexts = new Map();\n return contexts;\n };\n /**\n * @param {?} contexts\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onOutletReAttached = /**\n * @param {?} contexts\n * @return {?}\n */\n function (contexts) { this.contexts = contexts; };\n /**\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.getOrCreateContext = /**\n * @param {?} childName\n * @return {?}\n */\n function (childName) {\n var /** @type {?} */ context = this.getContext(childName);\n if (!context) {\n context = new OutletContext();\n this.contexts.set(childName, context);\n }\n return context;\n };\n /**\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.getContext = /**\n * @param {?} childName\n * @return {?}\n */\n function (childName) { return this.contexts.get(childName) || null; };\n return ChildrenOutletContexts;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Acts as a placeholder that Angular dynamically fills based on the current router\n * state.\n *\n * \\@howToUse\n *\n * ```\n * <router-outlet></router-outlet>\n * <router-outlet name='left'></router-outlet>\n * <router-outlet name='right'></router-outlet>\n * ```\n *\n * A router outlet will emit an activate event any time a new component is being instantiated,\n * and a deactivate event when it is being destroyed.\n *\n * ```\n * <router-outlet\n * (activate)='onActivate($event)'\n * (deactivate)='onDeactivate($event)'></router-outlet>\n * ```\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterOutlet = /** @class */ (function () {\n function RouterOutlet(parentContexts, location, resolver, name, changeDetector) {\n this.parentContexts = parentContexts;\n this.location = location;\n this.resolver = resolver;\n this.changeDetector = changeDetector;\n this.activated = null;\n this._activatedRoute = null;\n this.activateEvents = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n this.deactivateEvents = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n this.name = name || PRIMARY_OUTLET;\n parentContexts.onChildOutletCreated(this.name, this);\n }\n /**\n * @return {?}\n */\n RouterOutlet.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.parentContexts.onChildOutletDestroyed(this.name); };\n /**\n * @return {?}\n */\n RouterOutlet.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n if (!this.activated) {\n // If the outlet was not instantiated at the time the route got activated we need to populate\n // the outlet when it is initialized (ie inside a NgIf)\n var /** @type {?} */ context = this.parentContexts.getContext(this.name);\n if (context && context.route) {\n if (context.attachRef) {\n // `attachRef` is populated when there is an existing component to mount\n this.attach(context.attachRef, context.route);\n }\n else {\n // otherwise the component defined in the configuration is created\n this.activateWith(context.route, context.resolver || null);\n }\n }\n }\n };\n Object.defineProperty(RouterOutlet.prototype, \"isActivated\", {\n get: /**\n * @return {?}\n */\n function () { return !!this.activated; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"component\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n return this.activated.instance;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"activatedRoute\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n return /** @type {?} */ (this._activatedRoute);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"activatedRouteData\", {\n get: /**\n * @return {?}\n */\n function () {\n if (this._activatedRoute) {\n return this._activatedRoute.snapshot.data;\n }\n return {};\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n */\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n * @return {?}\n */\n RouterOutlet.prototype.detach = /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n this.location.detach();\n var /** @type {?} */ cmp = this.activated;\n this.activated = null;\n this._activatedRoute = null;\n return cmp;\n };\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n */\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n * @param {?} ref\n * @param {?} activatedRoute\n * @return {?}\n */\n RouterOutlet.prototype.attach = /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n * @param {?} ref\n * @param {?} activatedRoute\n * @return {?}\n */\n function (ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n };\n /**\n * @return {?}\n */\n RouterOutlet.prototype.deactivate = /**\n * @return {?}\n */\n function () {\n if (this.activated) {\n var /** @type {?} */ c = this.component;\n this.activated.destroy();\n this.activated = null;\n this._activatedRoute = null;\n this.deactivateEvents.emit(c);\n }\n };\n /**\n * @param {?} activatedRoute\n * @param {?} resolver\n * @return {?}\n */\n RouterOutlet.prototype.activateWith = /**\n * @param {?} activatedRoute\n * @param {?} resolver\n * @return {?}\n */\n function (activatedRoute, resolver) {\n if (this.isActivated) {\n throw new Error('Cannot activate an already activated outlet');\n }\n this._activatedRoute = activatedRoute;\n var /** @type {?} */ snapshot = activatedRoute._futureSnapshot;\n var /** @type {?} */ component = /** @type {?} */ (/** @type {?} */ ((snapshot.routeConfig)).component);\n resolver = resolver || this.resolver;\n var /** @type {?} */ factory = resolver.resolveComponentFactory(component);\n var /** @type {?} */ childContexts = this.parentContexts.getOrCreateContext(this.name).children;\n var /** @type {?} */ injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);\n this.activated = this.location.createComponent(factory, this.location.length, injector);\n // Calling `markForCheck` to make sure we will run the change detection when the\n // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.\n this.changeDetector.markForCheck();\n this.activateEvents.emit(this.activated.instance);\n };\n RouterOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'router-outlet', exportAs: 'outlet' },] },\n ];\n /** @nocollapse */\n RouterOutlet.ctorParameters = function () { return [\n { type: ChildrenOutletContexts, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactoryResolver\"], },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Attribute\"], args: ['name',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n RouterOutlet.propDecorators = {\n \"activateEvents\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['activate',] },],\n \"deactivateEvents\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['deactivate',] },],\n };\n return RouterOutlet;\n}());\nvar OutletInjector = /** @class */ (function () {\n function OutletInjector(route, childContexts, parent) {\n this.route = route;\n this.childContexts = childContexts;\n this.parent = parent;\n }\n /**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\n OutletInjector.prototype.get = /**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\n function (token, notFoundValue) {\n if (token === ActivatedRoute) {\n return this.route;\n }\n if (token === ChildrenOutletContexts) {\n return this.childContexts;\n }\n return this.parent.get(token, notFoundValue);\n };\n return OutletInjector;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n*@license\n*Copyright Google Inc. All Rights Reserved.\n*\n*Use of this source code is governed by an MIT-style license that can be\n*found in the LICENSE file at https://angular.io/license\n*/\n/**\n * \\@whatItDoes Provides a preloading strategy.\n *\n * \\@experimental\n * @abstract\n */\nvar PreloadingStrategy = /** @class */ (function () {\n function PreloadingStrategy() {\n }\n return PreloadingStrategy;\n}());\n/**\n * \\@whatItDoes Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * \\@howToUse\n *\n * ```\n * RouteModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * \\@experimental\n */\nvar PreloadAllModules = /** @class */ (function () {\n function PreloadAllModules() {\n }\n /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n PreloadAllModules.prototype.preload = /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n function (route, fn) {\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(fn(), function () { return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null); });\n };\n return PreloadAllModules;\n}());\n/**\n * \\@whatItDoes Provides a preloading strategy that does not preload any modules.\n *\n * \\@description\n *\n * This strategy is enabled by default.\n *\n * \\@experimental\n */\nvar NoPreloading = /** @class */ (function () {\n function NoPreloading() {\n }\n /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n NoPreloading.prototype.preload = /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n function (route, fn) { return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null); };\n return NoPreloading;\n}());\n/**\n * The preloader optimistically loads all router configurations to\n * make navigations into lazily-loaded sections of the application faster.\n *\n * The preloader runs in the background. When the router bootstraps, the preloader\n * starts listening to all navigation events. After every such event, the preloader\n * will check if any configurations can be loaded lazily.\n *\n * If a route is protected by `canLoad` guards, the preloaded will not load it.\n *\n * \\@stable\n */\nvar RouterPreloader = /** @class */ (function () {\n function RouterPreloader(router, moduleLoader, compiler, injector, preloadingStrategy) {\n this.router = router;\n this.injector = injector;\n this.preloadingStrategy = preloadingStrategy;\n var /** @type {?} */ onStartLoad = function (r) { return router.triggerEvent(new RouteConfigLoadStart(r)); };\n var /** @type {?} */ onEndLoad = function (r) { return router.triggerEvent(new RouteConfigLoadEnd(r)); };\n this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);\n }\n /**\n * @return {?}\n */\n RouterPreloader.prototype.setUpPreloading = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ navigations$ = __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__[\"filter\"].call(this.router.events, function (e) { return e instanceof NavigationEnd; });\n this.subscription = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(navigations$, function () { return _this.preload(); }).subscribe(function () { });\n };\n /**\n * @return {?}\n */\n RouterPreloader.prototype.preload = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ ngModule = this.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n return this.processRoutes(ngModule, this.router.config);\n };\n // TODO(jasonaden): This class relies on code external to the class to call setUpPreloading. If\n // this hasn't been done, ngOnDestroy will fail as this.subscription will be undefined. This\n // should be refactored.\n /**\n * @return {?}\n */\n RouterPreloader.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @return {?}\n */\n RouterPreloader.prototype.processRoutes = /**\n * @param {?} ngModule\n * @param {?} routes\n * @return {?}\n */\n function (ngModule, routes) {\n var /** @type {?} */ res = [];\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var route = routes_1[_i];\n // we already have the config loaded, just recurse\n if (route.loadChildren && !route.canLoad && route._loadedConfig) {\n var /** @type {?} */ childConfig = route._loadedConfig;\n res.push(this.processRoutes(childConfig.module, childConfig.routes));\n // no config loaded, fetch the config\n }\n else if (route.loadChildren && !route.canLoad) {\n res.push(this.preloadConfig(ngModule, route));\n // recurse into children\n }\n else if (route.children) {\n res.push(this.processRoutes(ngModule, route.children));\n }\n }\n return __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__[\"mergeAll\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(res));\n };\n /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n RouterPreloader.prototype.preloadConfig = /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n function (ngModule, route) {\n var _this = this;\n return this.preloadingStrategy.preload(route, function () {\n var /** @type {?} */ loaded$ = _this.loader.load(ngModule.injector, route);\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(loaded$, function (config) {\n route._loadedConfig = config;\n return _this.processRoutes(config.module, config.routes);\n });\n });\n };\n RouterPreloader.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RouterPreloader.ctorParameters = function () { return [\n { type: Router, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n { type: PreloadingStrategy, },\n ]; };\n return RouterPreloader;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Contains a list of directives\n * \\@stable\n */\nvar ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive];\n/**\n * \\@whatItDoes Is used in DI to configure the router.\n * \\@stable\n */\nvar ROUTER_CONFIGURATION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTER_CONFIGURATION');\n/**\n * \\@docsNotRequired\n */\nvar ROUTER_FORROOT_GUARD = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTER_FORROOT_GUARD');\nvar ROUTER_PROVIDERS = [\n __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"Location\"],\n { provide: UrlSerializer, useClass: DefaultUrlSerializer },\n {\n provide: Router,\n useFactory: setupRouter,\n deps: [\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"], UrlSerializer, ChildrenOutletContexts, __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"Location\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"],\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], ROUTES, ROUTER_CONFIGURATION,\n [UrlHandlingStrategy, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()], [RouteReuseStrategy, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()]\n ]\n },\n ChildrenOutletContexts,\n { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], useClass: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SystemJsNgModuleLoader\"] },\n RouterPreloader,\n NoPreloading,\n PreloadAllModules,\n { provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },\n];\n/**\n * @return {?}\n */\nfunction routerNgProbeToken() {\n return new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"]('Router', Router);\n}\n/**\n * \\@whatItDoes Adds router directives and providers.\n *\n * \\@howToUse\n *\n * RouterModule can be imported multiple times: once per lazily-loaded bundle.\n * Since the router deals with a global shared resource--location, we cannot have\n * more than one router service active.\n *\n * That is why there are two ways to create the module: `RouterModule.forRoot` and\n * `RouterModule.forChild`.\n *\n * * `forRoot` creates a module that contains all the directives, the given routes, and the router\n * service itself.\n * * `forChild` creates a module that contains all the directives and the given routes, but does not\n * include the router service.\n *\n * When registered at the root, the module should be used as follows\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forRoot(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * For submodules and lazy loaded submodules the module should be used as follows:\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forChild(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * \\@description\n *\n * Managing state transitions is one of the hardest parts of building applications. This is\n * especially true on the web, where you also need to ensure that the state is reflected in the URL.\n * In addition, we often want to split applications into multiple bundles and load them on demand.\n * Doing this transparently is not trivial.\n *\n * The Angular router solves these problems. Using the router, you can declaratively specify\n * application states, manage state transitions while taking care of the URL, and load bundles on\n * demand.\n *\n * [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an\n * overview of how the router should be used.\n *\n * \\@stable\n */\nvar RouterModule = /** @class */ (function () {\n // Note: We are injecting the Router so it gets created eagerly...\n function RouterModule(guard, router) {\n }\n /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {@link ExtraOptions} for more details.\n */\n /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {\\@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {\\@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {\\@link ExtraOptions} for more details.\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n RouterModule.forRoot = /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {\\@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {\\@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {\\@link ExtraOptions} for more details.\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n function (routes, config) {\n return {\n ngModule: RouterModule,\n providers: [\n ROUTER_PROVIDERS,\n provideRoutes(routes),\n {\n provide: ROUTER_FORROOT_GUARD,\n useFactory: provideForRootGuard,\n deps: [[Router, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"]()]]\n },\n { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LocationStrategy\"],\n useFactory: provideLocationStrategy,\n deps: [\n __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"], [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"APP_BASE_HREF\"]), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()], ROUTER_CONFIGURATION\n ]\n },\n {\n provide: PreloadingStrategy,\n useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :\n NoPreloading\n },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"], multi: true, useFactory: routerNgProbeToken },\n provideRouterInitializer(),\n ],\n };\n };\n /**\n * Creates a module with all the router directives and a provider registering routes.\n */\n /**\n * Creates a module with all the router directives and a provider registering routes.\n * @param {?} routes\n * @return {?}\n */\n RouterModule.forChild = /**\n * Creates a module with all the router directives and a provider registering routes.\n * @param {?} routes\n * @return {?}\n */\n function (routes) {\n return { ngModule: RouterModule, providers: [provideRoutes(routes)] };\n };\n RouterModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{ declarations: ROUTER_DIRECTIVES, exports: ROUTER_DIRECTIVES },] },\n ];\n /** @nocollapse */\n RouterModule.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [ROUTER_FORROOT_GUARD,] },] },\n { type: Router, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] },] },\n ]; };\n return RouterModule;\n}());\n/**\n * @param {?} platformLocationStrategy\n * @param {?} baseHref\n * @param {?=} options\n * @return {?}\n */\nfunction provideLocationStrategy(platformLocationStrategy, baseHref, options) {\n if (options === void 0) { options = {}; }\n return options.useHash ? new __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"HashLocationStrategy\"](platformLocationStrategy, baseHref) :\n new __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PathLocationStrategy\"](platformLocationStrategy, baseHref);\n}\n/**\n * @param {?} router\n * @return {?}\n */\nfunction provideForRootGuard(router) {\n if (router) {\n throw new Error(\"RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.\");\n }\n return 'guarded';\n}\n/**\n * \\@whatItDoes Registers routes.\n *\n * \\@howToUse\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forChild(ROUTES)],\n * providers: [provideRoutes(EXTRA_ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * \\@stable\n * @param {?} routes\n * @return {?}\n */\nfunction provideRoutes(routes) {\n return [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ANALYZE_FOR_ENTRY_COMPONENTS\"], multi: true, useValue: routes },\n { provide: ROUTES, multi: true, useValue: routes },\n ];\n}\n/**\n * \\@whatItDoes Represents options to configure the router.\n *\n * \\@stable\n * @record\n */\n\n/**\n * @param {?} ref\n * @param {?} urlSerializer\n * @param {?} contexts\n * @param {?} location\n * @param {?} injector\n * @param {?} loader\n * @param {?} compiler\n * @param {?} config\n * @param {?=} opts\n * @param {?=} urlHandlingStrategy\n * @param {?=} routeReuseStrategy\n * @return {?}\n */\nfunction setupRouter(ref, urlSerializer, contexts, location, injector, loader, compiler, config, opts, urlHandlingStrategy, routeReuseStrategy) {\n if (opts === void 0) { opts = {}; }\n var /** @type {?} */ router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n if (opts.errorHandler) {\n router.errorHandler = opts.errorHandler;\n }\n if (opts.enableTracing) {\n var /** @type {?} */ dom_1 = Object(__WEBPACK_IMPORTED_MODULE_20__angular_platform_browser__[\"ɵgetDOM\"])();\n router.events.subscribe(function (e) {\n dom_1.logGroup(\"Router Event: \" + ((/** @type {?} */ (e.constructor))).name);\n dom_1.log(e.toString());\n dom_1.log(e);\n dom_1.logGroupEnd();\n });\n }\n if (opts.onSameUrlNavigation) {\n router.onSameUrlNavigation = opts.onSameUrlNavigation;\n }\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n return router;\n}\n/**\n * @param {?} router\n * @return {?}\n */\nfunction rootRoute(router) {\n return router.routerState.root;\n}\n/**\n * To initialize the router properly we need to do in two steps:\n *\n * We need to start the navigation in a APP_INITIALIZER to block the bootstrap if\n * a resolver or a guards executes asynchronously. Second, we need to actually run\n * activation in a BOOTSTRAP_LISTENER. We utilize the afterPreactivation\n * hook provided by the router to do that.\n *\n * The router navigation starts, reaches the point when preactivation is done, and then\n * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.\n */\nvar RouterInitializer = /** @class */ (function () {\n function RouterInitializer(injector) {\n this.injector = injector;\n this.initNavigation = false;\n this.resultOfPreactivationDone = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n }\n /**\n * @return {?}\n */\n RouterInitializer.prototype.appInitializer = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ p = this.injector.get(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LOCATION_INITIALIZED\"], Promise.resolve(null));\n return p.then(function () {\n var /** @type {?} */ resolve = /** @type {?} */ ((null));\n var /** @type {?} */ res = new Promise(function (r) { return resolve = r; });\n var /** @type {?} */ router = _this.injector.get(Router);\n var /** @type {?} */ opts = _this.injector.get(ROUTER_CONFIGURATION);\n if (_this.isLegacyDisabled(opts) || _this.isLegacyEnabled(opts)) {\n resolve(true);\n }\n else if (opts.initialNavigation === 'disabled') {\n router.setUpLocationChangeListener();\n resolve(true);\n }\n else if (opts.initialNavigation === 'enabled') {\n router.hooks.afterPreactivation = function () {\n // only the initial navigation should be delayed\n if (!_this.initNavigation) {\n _this.initNavigation = true;\n resolve(true);\n return _this.resultOfPreactivationDone;\n // subsequent navigations should not be delayed\n }\n else {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n }\n };\n router.initialNavigation();\n }\n else {\n throw new Error(\"Invalid initialNavigation options: '\" + opts.initialNavigation + \"'\");\n }\n return res;\n });\n };\n /**\n * @param {?} bootstrappedComponentRef\n * @return {?}\n */\n RouterInitializer.prototype.bootstrapListener = /**\n * @param {?} bootstrappedComponentRef\n * @return {?}\n */\n function (bootstrappedComponentRef) {\n var /** @type {?} */ opts = this.injector.get(ROUTER_CONFIGURATION);\n var /** @type {?} */ preloader = this.injector.get(RouterPreloader);\n var /** @type {?} */ router = this.injector.get(Router);\n var /** @type {?} */ ref = this.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"]);\n if (bootstrappedComponentRef !== ref.components[0]) {\n return;\n }\n if (this.isLegacyEnabled(opts)) {\n router.initialNavigation();\n }\n else if (this.isLegacyDisabled(opts)) {\n router.setUpLocationChangeListener();\n }\n preloader.setUpPreloading();\n router.resetRootComponentType(ref.componentTypes[0]);\n this.resultOfPreactivationDone.next(/** @type {?} */ ((null)));\n this.resultOfPreactivationDone.complete();\n };\n /**\n * @param {?} opts\n * @return {?}\n */\n RouterInitializer.prototype.isLegacyEnabled = /**\n * @param {?} opts\n * @return {?}\n */\n function (opts) {\n return opts.initialNavigation === 'legacy_enabled' || opts.initialNavigation === true ||\n opts.initialNavigation === undefined;\n };\n /**\n * @param {?} opts\n * @return {?}\n */\n RouterInitializer.prototype.isLegacyDisabled = /**\n * @param {?} opts\n * @return {?}\n */\n function (opts) {\n return opts.initialNavigation === 'legacy_disabled' || opts.initialNavigation === false;\n };\n RouterInitializer.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RouterInitializer.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n ]; };\n return RouterInitializer;\n}());\n/**\n * @param {?} r\n * @return {?}\n */\nfunction getAppInitializer(r) {\n return r.appInitializer.bind(r);\n}\n/**\n * @param {?} r\n * @return {?}\n */\nfunction getBootstrapListener(r) {\n return r.bootstrapListener.bind(r);\n}\n/**\n * A token for the router initializer that will be called after the app is bootstrapped.\n *\n * \\@experimental\n */\nvar ROUTER_INITIALIZER = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('Router Initializer');\n/**\n * @return {?}\n */\nfunction provideRouterInitializer() {\n return [\n RouterInitializer,\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n multi: true,\n useFactory: getAppInitializer,\n deps: [RouterInitializer]\n },\n { provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_BOOTSTRAP_LISTENER\"], multi: true, useExisting: ROUTER_INITIALIZER },\n ];\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=router.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvcm91dGVyL2VzbTUvcm91dGVyLmpzPzZkZjMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZSBBbmd1bGFyIHY1LjIuMlxuICogKGMpIDIwMTAtMjAxOCBHb29nbGUsIEluYy4gaHR0cHM6Ly9hbmd1bGFyLmlvL1xuICogTGljZW5zZTogTUlUXG4gKi9cbmltcG9ydCB7IEFQUF9CQVNFX0hSRUYsIEhhc2hMb2NhdGlvblN0cmF0ZWd5LCBMT0NBVElPTl9JTklUSUFMSVpFRCwgTG9jYXRpb24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mIGNoaWxkIHNlZ21lbnRzICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIE51bWJlciBvZiBjaGlsZCBzZWdtZW50c1xuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gT2JqZWN0LmtleXModGhpcy5jaGlsZHJlbikubGVuZ3RoOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGRvY3NOb3RSZXF1aXJlZCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGRvY3NOb3RSZXF1aXJlZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsU2VnbWVudEdyb3VwLnByb3RvdHlwZS50b1N0cmluZyA9IC8qKlxuICAgICAqIFxcQGRvY3NOb3RSZXF1aXJlZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gc2VyaWFsaXplUGF0aHModGhpcyk7IH07XG4gICAgcmV0dXJuIFVybFNlZ21lbnRHcm91cDtcbn0oKSk7XG4vKipcbiAqIFxcQHdoYXRJdERvZXMgUmVwcmVzZW50cyBhIHNpbmdsZSBVUkwgc2VnbWVudC5cbiAqXG4gKiBcXEBob3dUb1VzZVxuICpcbiAqIGBgYFxuICogXFxAQ29tcG9uZW50KHt0ZW1wbGF0ZVVybDondGVtcGxhdGUuaHRtbCd9KVxuICogY2xhc3MgTXlDb21wb25lbnQge1xuICogICBjb25zdHJ1Y3Rvcihyb3V0ZXI6IFJvdXRlcikge1xuICogICAgIGNvbnN0IHRyZWU6IFVybFRyZWUgPSByb3V0ZXIucGFyc2VVcmwoJy90ZWFtO2lkPTMzJyk7XG4gKiAgICAgY29uc3QgZzogVXJsU2VnbWVudEdyb3VwID0gdHJlZS5yb290LmNoaWxkcmVuW1BSSU1BUll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plU2VnbWVudChzZWdtZW50LmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXSwgZmFsc2UpIDpcbiAgICAgICAgICAgICcnO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjaGlsZHJlbl8xID0gW107XG4gICAgICAgIGZvckVhY2goc2VnbWVudC5jaGlsZHJlbiwgZnVuY3Rpb24gKHYsIGspIHtcbiAgICAgICAgICAgIGlmIChrICE9PSBQUklNQVJZX09VVExFVCkge1xuICAgICAgICAgICAgICAgIGNoaWxkcmVuXzEucHVzaChrICsgXCI6XCIgKyBzZXJpYWxpemVTZWdtZW50KHYsIGZhbHNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gY2hpbGRyZW5fMS5sZW5ndGggPiAwID8gcHJpbWFyeSArIFwiKFwiICsgY2hpbGRyZW5fMS5qb2luKCcvLycpICsgXCIpXCIgOiBwcmltYXJ5O1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2hpbGRyZW4gPSBtYXBDaGlsZHJlbkludG9BcnJheShzZWdtZW50LCBmdW5jdGlvbiAodiwgaykge1xuICAgICAgICAgICAgaWYgKGsgPT09IFBSSU1BUllfT1VUTEVUKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtzZXJpYWxpemVTZWdtZW50KHNlZ21lbnQuY2hpbGRyZW5bUFJJTUFSWV9PVVRMRVRdLCBmYWxzZSldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIFtrICsgXCI6XCIgKyBzZXJpYWxpemVTZWdtZW50KHYsIGZhbHNlKV07XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gc2VyaWFsaXplUGF0aHMoc2VnbWVudCkgKyBcIi8oXCIgKyBjaGlsZHJlbi5qb2luKCcvLycpICsgXCIpXCI7XG4gICAgfVxufVxuLyoqXG4gKiBUaGlzIG1ldGhvZCBpcyB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oqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIFVybFBhcnNlcih1cmwpIHtcbiAgICAgICAgdGhpcy51cmwgPSB1cmw7XG4gICAgICAgIHRoaXMucmVtYWluaW5nID0gdXJsO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFVybFBhcnNlci5wcm90b3R5cGUucGFyc2VSb290U2VnbWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmNvbnN1bWVPcHRpb25hbCgnLycpO1xuICAgICAgICBpZiAodGhpcy5yZW1haW5pbmcgPT09ICcnIHx8IHRoaXMucGVla1N0YXJ0c1dpdGgoJz8nKSB8fCB0aGlzLnBlZWtTdGFydHNXaXRoKCcjJykpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgVXJsU2VnbWVudEdyb3VwKFtdLCB7fSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVGhlIHJvb3Qgc2VnbWVudCBncm91cCBuZXZlciBoYXMgc2VnbWVudHNcbiAgICAgICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIHRoaXMucGFyc2VDaGlsZHJlbigpKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVF1ZXJ5UGFyYW1zID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhcmFtcyA9IHt9O1xuICAgICAgICBpZiAodGhpcy5jb25zdW1lT3B0aW9uYWwoJz8nKSkge1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIHRoaXMucGFyc2VRdWVyeVBhcmFtKHBhcmFtcyk7XG4gICAgICAgICAgICB9IHdoaWxlICh0aGlzLmNvbnN1bWVPcHRpb25hbCgnJicpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFyYW1zO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBhcnNlRnJhZ21lbnQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZU9wdGlvbmFsKCcjJykgPyBkZWNvZGVVUkkodGhpcy5yZW1haW5pbmcpIDogbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZUNoaWxkcmVuID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJlbWFpbmluZyA9PT0gJycpIHtcbiAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmNvbnN1bWVPcHRpb25hbCgnLycpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzZWdtZW50cyA9IFtdO1xuICAgICAgICBpZiAoIXRoaXMucGVla1N0YXJ0c1dpdGgoJygnKSkge1xuICAgICAgICAgICAgc2VnbWVudHMucHVzaCh0aGlzLnBhcnNlU2VnbWVudCgpKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAodGhpcy5wZWVrU3RhcnRzV2l0aCgnLycpICYmICF0aGlzLnBlZWtTdGFydHNXaXRoKCcvLycpICYmICF0aGlzLnBlZWtTdGFydHNXaXRoKCcvKCcpKSB7XG4gICAgICAgICAgICB0aGlzLmNhcHR1cmUoJy8nKTtcbiAgICAgICAgICAgIHNlZ21lbnRzLnB1c2godGhpcy5wYXJzZVNlZ21lbnQoKSk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2hpbGRyZW4gPSB7fTtcbiAgICAgICAgaWYgKHRoaXMucGVla1N0YXJ0c1dpdGgoJy8oJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2FwdHVyZSgnLycpO1xuICAgICAgICAgICAgY2hpbGRyZW4gPSB0aGlzLnBhcnNlUGFyZW5zKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IHt9O1xuICAgICAgICBpZiAodGhpcy5wZWVrU3RhcnRzV2l0aCgnKCcpKSB7XG4gICAgICAgICAgICByZXMgPSB0aGlzLnBhcnNlUGFyZW5zKGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc2VnbWVudHMubGVuZ3RoID4gMCB8fCBPYmplY3Qua2V5cyhjaGlsZHJlbikubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgcmVzW1BSSU1BUllfT1VUTEVUXSA9IG5ldyBVcmxTZWdtZW50R3JvdXAoc2VnbWVudHMsIGNoaWxkcmVuKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXRoID0gbWF0Y2hTZWdtZW50cyh0aGlzLnJlbWFpbmluZyk7XG4gICAgICAgIGlmIChwYXRoID09PSAnJyAmJiB0aGlzLnBlZWtTdGFydHNXaXRoKCc7JykpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVtcHR5IHBhdGggdXJsIHNlZ21lbnQgY2Fubm90IGhhdmUgcGFyYW1ldGVyczogJ1wiICsgdGhpcy5yZW1haW5pbmcgKyBcIicuXCIpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY2FwdHVyZShwYXRoKTtcbiAgICAgICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50KGRlY29kZShwYXRoKSwgdGhpcy5wYXJzZU1hdHJpeFBhcmFtcygpKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZU1hdHJpeFBhcmFtcyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXJhbXMgPSB7fTtcbiAgICAgICAgd2hpbGUgKHRoaXMuY29uc3VtZU9wdGlvbmFsKCc7JykpIHtcbiAgICAgICAgICAgIHRoaXMucGFyc2VQYXJhbShwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwYXJhbXM7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVBhcmFtID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJhbXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChwYXJhbXMpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8ga2V5ID0gbWF0Y2hTZWdtZW50cyh0aGlzLnJlbWFpbmluZyk7XG4gICAgICAgIGlmICgha2V5KSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jYXB0dXJlKGtleSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovI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AgaWYgKHZhbHVlTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlTWF0Y2g7XG4gICAgICAgICAgICAgICAgdGhpcy5jYXB0dXJlKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBkZWNvZGVkS2V5ID0gZGVjb2RlKGtleSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRlY29kZWRWYWwgPSBkZWNvZGUodmFsdWUpO1xuICAgICAgICBpZiAocGFyYW1zLmhhc093blByb3BlcnR5KGRlY29kZWRLZXkpKSB7XG4gICAgICAgICAgICAvLyBBcHBlbmQgdG8gZXhpc3RpbmcgdmFsdWVzXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdXJyZW50VmFsID0gcGFyYW1zW2RlY29kZWRLZXldO1xuICAgICAgICAgICAgaWYgKCFBcnJheS5pc0FycmF5KGN1cnJlbnRWYWwpKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudFZhbCA9IFtjdXJyZW50VmFsXTtcbiAgICAgICAgICAgICAgICBwYXJhbXNbZGVjb2RlZEtleV0gPSBjdXJyZW50VmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudFZhbC5wdXNoKGRlY29kZWRWYWwpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IHZhbHVlXG4gICAgICAgICAgICBwYXJhbXNbZGVjb2RlZEtleV0gPSBkZWNvZGVkVmFsO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGFsbG93UHJpbWFyeVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVBhcmVucyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYWxsb3dQcmltYXJ5XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYWxsb3dQcmltYXJ5KSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHNlZ21lbnRzID0ge307XG4gICAgICAgIHRoaXMuY2FwdHVyZSgnKCcpO1xuICAgICAgICB3aGlsZSAoIXRoaXMuY29uc3VtZU9wdGlvbmFsKCcpJykgJiYgdGhpcy5yZW1haW5pbmcubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGF0aCA9IG1hdGNoU2VnbWVudHModGhpcy5yZW1haW5pbmcpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmV4dCA9IHRoaXMucmVtYWluaW5nW3BhdGgubGVuZ3RoXTtcbiAgICAgICAgICAgIC8vIGlmIGlzIGlzIG5vdCBvbmUgb2YgdGhlc2UgY2hhcmFjdGVycywgdGhlbiB0aGUgc2VnbWVudCB3YXMgdW5lc2NhcGVkXG4gICAgICAgICAgICAvLyBvciB0aGUgZ3JvdXAgd2FzIG5vdCBjbG9zZWRcbiAgICAgICAgICAgIGlmIChuZXh0ICE9PSAnLycgJiYgbmV4dCAhPT0gJyknICYmIG5leHQgIT09ICc7Jykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkNhbm5vdCBwYXJzZSB1cmwgJ1wiICsgdGhpcy51cmwgKyBcIidcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvdXRsZXROYW1lID0gLyoqIEB0eXBlIHs/fSAqLyAoKHVuZGVmaW5lZCkpO1xuICAgICAgICAgICAgaWYgKHBhdGguaW5kZXhPZignOicpID4gLTEpIHtcbiAgICAgICAgICAgICAgICBvdXRsZXROYW1lID0gcGF0aC5zdWJzdHIoMCwgcGF0aC5pbmRleE9mKCc6JykpO1xuICAgICAgICAgICAgICAgIHRoaXMuY2FwdHVyZShvdXRsZXROYW1lKTtcbiAgICAgICAgICAgICAgICB0aGlzLmNhcHR1cmUoJzonKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGFsbG93UHJpbWFyeSkge1xuICAgICAgICAgICAgICAgIG91dGxldE5hbWUgPSBQUklNQVJZX09VVExFVDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNoaWxkcmVuID0gdGhpcy5wYXJzZUNoaWxkcmVuKCk7XG4gICAgICAgICAgICBzZWdtZW50c1tvdXRsZXROYW1lXSA9IE9iamVjdC5rZXlzKGNoaWxkcmVuKS5sZW5ndGggPT09IDEgPyBjaGlsZHJlbltQUklNQVJZX09VVExFVF0gOlxuICAgICAgICAgICAgICAgIG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIGNoaWxkcmVuKTtcbiAgICAgICAgICAgIHRoaXMuY29uc3VtZU9wdGlvbmFsKCcvLycpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzZWdtZW50cztcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBlZWtTdGFydHNXaXRoID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdHJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzdHIpIHsgcmV0dXJuIHRoaXMucmVtYWluaW5nLnN0YXJ0c1dpdGgoc3RyKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0clxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5jb25zdW1lT3B0aW9uYWwgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0clxuICAgICAqIEByZXR1cm4gez99XG4gICAgICov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4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLm1hdGNoID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB0cmVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodHJlZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBleHBhbmRlZCQgPSB0aGlzLmV4cGFuZFNlZ21lbnRHcm91cCh0aGlzLm5nTW9kdWxlLCB0aGlzLmNvbmZpZywgdHJlZS5yb290LCBQUklNQVJZX09VVExFVCk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1hcHBlZCQgPSBtYXAuY2FsbChleHBhbmRlZCQsIGZ1bmN0aW9uIChyb290U2VnbWVudEdyb3VwKSB7XG4gICAgICAgICAgICByZXR1cm4gX3RoaXMuY3JlYXRlVXJsVHJlZShyb290U2VnbWVudEdyb3VwLCB0cmVlLnF1ZXJ5UGFyYW1zLCAvKiogQHR5cGUgez99ICovICgodHJlZS5mcmFnbWVudCkpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiBfY2F0Y2guY2FsbChtYXBwZWQkLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBOb01hdGNoKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgX3RoaXMubm9NYXRjaEVycm9yKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFwcGx5UmVkaXJlY3RzLnByb3RvdHlwZS5ub01hdGNoRXJyb3IgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL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dXJuIF9jYXRjaC5jYWxsKGZpcnN0JCwgZnVuY3Rpb24gKGUsIF8pIHtcbiAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgRW1wdHlFcnJvciB8fCBlLm5hbWUgPT09ICdFbXB0eUVycm9yJykge1xuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5ub0xlZnRvdmVyc0luVXJsKHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9mKG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIHt9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBOb01hdGNoKHNlZ21lbnRHcm91cCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudEdyb3VwXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUubm9MZWZ0b3ZlcnNJblVybCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudEdyb3VwXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoc2VnbWVudEdyb3VwLCBzZWdtZW50cywgb3V0bGV0KSB7XG4gICAgICAgIHJldHVybiBzZWdtZW50cy5sZW5ndGggPT09IDAgJiYgIXNlZ21lbnRHcm91cC5jaGlsZHJlbltvdXRsZXRdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZ01vZHVsZVxuICAgICAqIEBwYXJhbSB7P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3RDaGlsZCkpLCBvdXRsZXQsIGZhbHNlKTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5nTW9kdWxlXG4gICAgICogQHBhcmFtIHs/fSByYXdTZWdtZW50R3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLm1hdGNoU2VnbWVudEFnYWluc3RSb3V0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmdNb2R1bGVcbiAgICAgKiBAcGFyYW0gez99IHJhd1NlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobmdNb2R1bGUsIHJhd1NlZ21lbnRHcm91cCwgcm91dGUsIHNlZ21lbnRzKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChyb3V0ZS5wYXRoID09PSAnKionKSB7XG4gICAgICAgICAgICBpZiAocm91dGUubG9hZENoaWxkcmVuKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHRoaXMuY29uZmlnTG9hZGVyLmxvYWQobmdNb2R1bGUuaW5qZWN0b3IsIHJvdXRlKSwgZnVuY3Rpb24gKGNmZykge1xuICAgICAgICAgICAgICAgICAgICByb3V0ZS5fbG9hZGVkQ29uZmlnID0gY2ZnO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFVybFNlZ21lbnRHcm91cChzZWdtZW50cywge30pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG9mKG5ldyBVcmxTZWdtZW50R3Jv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XRlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUuZ2V0Q2hpbGRDb25maWcgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5nTW9kdWxlXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5nTW9kdWxlLCByb3V0ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAocm91dGUuY2hpbGRyZW4pIHtcbiAgICAgICAgICAgIC8vIFRoZSBjaGlsZHJlbiBiZWxvbmcgdG8gdGhlIHNhbWUgbW9kdWxlXG4gICAgICAgICAgICByZXR1cm4gb2YobmV3IExvYWRlZFJvdXRlckNvbmZpZyhyb3V0ZS5jaGlsZHJlbiwgbmdNb2R1bGUpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocm91dGUubG9hZENoaWxkcmVuKSB7XG4gICAgICAgICAgICAvLyBsYXp5IGNoaWxkcmVuIGJlbG9uZyB0byB0aGUgbG9hZGVkIG1vZHVsZVxuICAgICAgICAgICAgaWYgKHJvdXRlLl9sb2FkZWRDb25maWcgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBvZihyb3V0ZS5fbG9hZGVkQ29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBtZXJnZU1hcC5jYWxsKHJ1bkNhbkxvYWRHdWFyZChuZ01vZHVsZS5pbmplY3Rvciwgcm91dGUpLCBmdW5jdGlvbiAoc2hvdWxkTG9hZCkge1xuICAgICAgICAgICAgICAgIGlmIChzaG91bGRMb2FkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChfdGhpcy5jb25maWdMb2FkZXIubG9hZChuZ01vZHVsZS5pbmplY3Rvciwgcm91dGUpLCBmdW5jdGlvbiAoY2ZnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByb3V0ZS5fbG9hZGVkQ29uZmlnID0gY2ZnO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNmZztcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjYW5Mb2FkRmFpbHMocm91dGUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9mKG5ldyBMb2FkZWRSb3V0ZXJDb25maWcoW10sIG5nTW9kdWxlKSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSB1cmxUcmVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUubGluZXJhbGl6ZVNlZ21lbnRzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEBwYXJhbSB7P30gdXJsVHJlZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJvdXRlLCB1cmxUcmVlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IFtdO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjID0gdXJsVHJlZS5yb290O1xuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgcmVzID0gcmVzLmNvbmNhdChjLnNlZ21lbnRzKTtcbiAgICAgICAgICAgIGlmIChjLm51bWJlck9mQ2hpbGRyZW4gPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2YocmVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjLm51bWJlck9mQ2hpbGRyZW4gPiAxIHx8ICFjLmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuYW1lZE91dGxldHNSZWRpcmVjdCgvKiogQHR5cGUgez99ICovICgocm91dGUucmVkaXJlY3RUbykpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGMgPSBjLmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1xuICAgICAqIEBwYXJhbSB7P30gcG9zUGFyYW1zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUuYXBwbHlSZWRpcmVjdENvbW1hbmRzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1xuICAgICAqIEBwYXJhbSB7P30gcG9zUGFyYW1zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoc2VnbWVudHMsIHJlZGlyZWN0VG8sIHBvc1BhcmFtcykge1xuICAgICAgICByZXR1cm4gdGhpcy5hcHBseVJlZGlyZWN0Q3JlYXRyZVVybFRyZWUocmVkaXJlY3RUbywgdGhpcy51cmxTZXJpYWxpemVyLnBhcnNlKHJlZGlyZWN0VG8pLCBzZWdtZW50cywgcG9zUGFyYW1zKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1xuICAgICAqIEBwYXJhbSB7P30gdXJsVHJlZVxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IHBvc1BhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLmFwcGx5UmVkaXJlY3RDcmVhdHJlVXJsVHJlZSA9IC8qKlxuIC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GZ1bmN0aW9uICh2LCBrKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb3B5U291cmNlVmFsdWUgPSB0eXBlb2YgdiA9PT0gJ3N0cmluZycgJiYgdi5zdGFydHNXaXRoKCc6Jyk7XG4gICAgICAgICAgICBpZiAoY29weVNvdXJjZVZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gc291cmNlTmFtZSA9IHYuc3Vic3RyaW5nKDEpO1xuICAgICAgICAgICAgICAgIHJlc1trXSA9IGFjdHVhbFBhcmFtc1tzb3VyY2VOYW1lXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc1trXSA9IHY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByZWRpcmVjdFRvXG4gICAgICogQHBhcmFtIHs/fSBncm91cFxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IHBvc1BhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLmNyZWF0ZVNlZ21lbnRHcm91cCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1xuICAgICAqIEBwYXJhbSB7P30gZ3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBwb3NQYXJhbXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChyZWRpcmVjdFRvLCBncm91cCwgc2VnbWVudHMsIHBvc1BhcmFtcykge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fS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VcmxTZWdtZW50LnBhdGggKyBcIicuXCIpO1xuICAgICAgICByZXR1cm4gcG9zO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByZWRpcmVjdFRvVXJsU2VnbWVudFxuICAgICAqIEBwYXJhbSB7P30gYWN0dWFsU2VnbWVudHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFwcGx5UmVkaXJlY3RzLnByb3RvdHlwZS5maW5kT3JSZXR1cm4gPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHJlZGlyZWN0VG9VcmxTZWdtZW50XG4gICAgICogQHBhcmFtIHs/fSBhY3R1YWxTZWdtZW50c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJlZGlyZWN0VG9VcmxTZWdtZW50LCBhY3R1YWxTZWdtZW50cykge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpZHggPSAwO1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIGFjdHVhbFNlZ21lbnRzXzEgPSBhY3R1YWxTZWdtZW50czsgX2kgPCBhY3R1YWxTZWdtZW50c18xLmxlbmd0aDsgX2krKykge1xuICAgICAgICAgICAgdmFyIHMgPSBhY3R1YWxTZWdtZW50c18xW19pXTtcbiAgICAgICAgICAgIGlmIChzLnBhdGggPT09IHJlZGlyZWN0VG9VcmxTZWdtZW50LnBhdGgpIHtcbiAgICAgICAgICAgICAgICBhY3R1YWxTZWdtZW50cy5zcGxpY2UoaWR4KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlkeCsrO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZWRpcmVjdFRvVXJsU2VnbWVudDtcbiAgICB9O1xuICAgIHJldHVybiBBcHBseVJlZGlyZWN0cztcbn0oKSk7XG4vKipcbiAqIEBwYXJhbSB7P30gbW9kdWxlSW5qZWN0b3JcbiAqIEB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iAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVHJlZS5wcm90b3R5cGUucGFyZW50ID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh0KSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHAgPSB0aGlzLnBhdGhGcm9tUm9vdCh0KTtcbiAgICAgICAgcmV0dXJuIHAubGVuZ3RoID4gMSA/IHBbcC5sZW5ndGggLSAyXSA6IG51bGw7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVHJlZS5wcm90b3R5cGUuY2hpbGRyZW4gPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbiA9IGZpbmROb2RlKHQsIHRoaXMuX3Jvb3QpO1xuICAgICAgICByZXR1cm4gbiA/IG4uY2hpbGRyZW4ubWFwKGZ1bmN0aW9uICh0KSB7IHJldHVybiB0LnZhbHVlOyB9KSA6IFtdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFRyZWUucHJvdG90eXBlLmZpcnN0Q2hpbGQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbiA9IGZpbmROb2RlKHQsIHRoaXMuX3Jvb3QpO1xuICAgICAgICByZXR1cm4gbiAmJiBuLmNoaWxkcmVuLmxlbmd0aCA+IDAgPyBuLmNoaWxkcmVuWzBdLnZhbHVlIDogbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBUcmVlLnByb3RvdHlwZS5zaWJsaW5ncyA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwID0gZmluZFBhdGgodCwgdGhpcy5fcm9vdCk7XG4gICAgICAgIGlmIChwLmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGMgPSBwW3AubGVuZ3RoIC0gMl0uY2hpbGRyZW4ubWFwKGZ1bmN0aW9uIChjKSB7IHJldHVybiBjLnZhbHVlOyB9KTtcbiAgICAgICAgcmV0dXJuIGMuZmlsdGVyKGZ1bmN0aW9uIChjYykgeyByZXR1cm4gY2MgIT09IHQ7IH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHRcbiAgICAgKiBAcmV0dXJuIHs/fVxu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hbU1hcCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3BhcmFtTWFwID0gbWFwLmNhbGwodGhpcy5wYXJhbXMsIGZ1bmN0aW9uIChwKSB7IHJldHVybiBjb252ZXJ0VG9QYXJhbU1hcChwKTsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcGFyYW1NYXA7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBY3RpdmF0ZWRSb3V0ZS5wcm90b3R5cGUsIFwicXVlcnlQYXJhbU1hcFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX3F1ZXJ5UGFyYW1NYXApIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9xdWVyeVBhcmFtTWFwID1cbiAgICAgICAgICAgICAgICAgICAgbWFwLmNhbGwodGhpcy5xdWVyeVBhcmFtcywgZnVuY3Rpb24gKHApIHsgcmV0dXJuIGNvbnZlcnRUb1BhcmFtTWFwKHApOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9xdWVyeVBhcmFtTWFwO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFjdGl2YXRlZFJvdXRlLnByb3RvdHlwZS50b1N0cmluZyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpc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NfMVtuYW1lXSA9IHR5cGVvZiBjb21tYW5kcyA9PT0gJ3N0cmluZycgPyBjb21tYW5kcy5zcGxpdCgnLycpIDogY29tbWFuZHM7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5jb25jYXQoW3sgb3V0bGV0czogb3V0bGV0c18xIH1dKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjbWQuc2VnbWVudFBhdGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzLmNvbmNhdChbY21kLnNlZ21lbnRQYXRoXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCEodHlwZW9mIGNtZCA9PT0gJ3N0cmluZycpKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzLmNvbmNhdChbY21kXSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNtZElkeCA9PT0gMCkge1xuICAgICAgICAgICAgY21kLnNwbGl0KCcvJykuZm9yRWFjaChmdW5jdGlvbiAodXJsUGFydCwgcGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKHBhcnRJbmRleCA9PSAwICYmIHVybFBhcnQgPT09ICcuJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBza2lwICcuL2EnXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBhcnRJbmRleCA9PSAwICYmIHVybFBhcnQgPT09ICcnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vICAnL2EnXG4gICAgICAgICAgICAgICAgICAgIGlzQWJzb2x1dGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh1cmxQYXJ0ID09PSAnLi4nKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vICAnLi4vYSdcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVyT2ZEb3VibGVEb3RzKys7XG4gICAgICAgICAgICAg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V4OiAwIH07XG4gICAgd2hpbGUgKGN1cnJlbnRQYXRoSW5kZXggPCBzZWdtZW50R3JvdXAuc2VnbWVudHMubGVuZ3RoKSB7XG4gICAgICAgIGlmIChjdXJyZW50Q29tbWFuZEluZGV4ID49IGNvbW1hbmRzLmxlbmd0aClcbiAgICAgICAgICAgIHJldHVybiBub01hdGNoO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXRoID0gc2VnbWVudEdyb3VwLnNlZ21lbnRzW2N1cnJlbnRQYXRoSW5kZXhdO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdXJyID0gZ2V0UGF0aChjb21tYW5kc1tjdXJyZW50Q29tbWFuZEluZGV4XSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5leHQgPSBjdXJyZW50Q29tbWFuZEluZGV4IDwgY29tbWFuZHMubGVuZ3RoIC0gMSA/IGNvbW1hbmRzW2N1cnJlbnRDb21tYW5kSW5kZXggKyAxXSA6IG51bGw7XG4gICAgICAgIGlmIChjdXJyZW50UGF0aEluZGV4ID4gMCAmJiBjdXJyID09PSB1bmRlZmluZWQpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgaWYgKGN1cnIgJiYgbmV4dCAmJiAodHlwZW9mIG5leHQgPT09ICdvYmplY3QnKSAmJiBuZXh0Lm91dGxldHMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgaWYgKCFjb21wYXJlKGN1cnIsIG5leHQsIHBhdGgpKVxuICAgICAgICAgICAgICAgIHJldHVybiBub01hdGNoO1xuICAgICAgICAgICAgY3VycmVudENvbW1hbmRJbmRleCArPSAyO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFjb21wYXJlKGN1cnIsIHt9LCBwYXRoKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9NYXRjaDtcbiAgICAgICAgICAgIGN1cnJlbnRDb21tYW5kSW5kZXgrKzt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GFyYW1zKGNvbW1hbmRzWzBdKSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcCA9IHNlZ21lbnRHcm91cC5zZWdtZW50c1tzdGFydEluZGV4XTtcbiAgICAgICAgICAgIHBhdGhzLnB1c2gobmV3IFVybFNlZ21lbnQocC5wYXRoLCBjb21tYW5kc1swXSkpO1xuICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY3VyciA9IGdldFBhdGgoY29tbWFuZHNbaV0pO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBuZXh0ID0gKGkgPCBjb21tYW5kcy5sZW5ndGggLSAxKSA/IGNvbW1hbmRzW2kgKyAxXSA6IG51bGw7XG4gICAgICAgIGlmIChjdXJyICYmIG5leHQgJiYgaXNNYXRyaXhQYXJhbXMobmV4dCkpIHtcbiAgICAgICAgICAgIHBhdGhzLnB1c2gobmV3IFVybFNlZ21lbnQoY3Vyciwgc3RyaW5naWZ5KG5leHQpKSk7XG4gICAgICAgICAgICBpICs9IDI7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwYXRocy5wdXNoKG5ldyBVcmxTZWdtZW50KGN1cnIsIHt9KSk7XG4gICAgICAgICAgICBpKys7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50R3JvdXAocGF0aHMsIHt9KTtcbn1cbi8qKlxuICogQHBhcmFtIHs/fSBvdXRsZXRzXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBjcmVhdGVOZXdTZWdtZW50Q2hpbGRyZW4ob3V0bGV0cykge1xuICAgIHZhciAvKiogQHR5cGUgez99ICovIGNoaWxkcmVuID0ge307XG4gICAgZm9yRWFjaChvdXRsZXRzLCBmdW5jdGlvbiAoY29tbWFuZHMsIG91dGxldCkge1xu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JsZXMobWFwLmNhbGwoZnJvbShjYW5BY3RpdmF0ZUNoaWxkR3VhcmRzKSwgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9icyA9IG1hcC5jYWxsKGZyb20oZC5ndWFyZHMpLCBmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGd1YXJkID0gX3RoaXMuZ2V0VG9rZW4oYywgZC5ub2RlKTtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvYnNlcnZhYmxlO1xuICAgICAgICAgICAgICAgIGlmIChndWFyZC5jYW5BY3RpdmF0ZUNoaWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIG9ic2VydmFibGUgPSB3cmFwSW50b09ic2VydmFibGUoZ3VhcmQuY2FuQWN0aXZhdGVDaGlsZChmdXR1cmUsIF90aGlzLmZ1dHVyZSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2YWJsZSA9IHdyYXBJbnRvT2JzZXJ2YWJsZShndWFyZChmdXR1cmUsIF90aGlzLmZ1dHVyZSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZmlyc3QuY2FsbChvYnNlcnZhYmxlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIGFuZE9ic2VydmFibGVzKG9icyk7XG4gICAgICAgIH0pKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUHJlQWN0aXZhdGlvbi5wcm90b3R5cGUuZXh0cmFjdENhbkFjdGl2YXRlQ2hpbGQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xu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PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIG9mKHt9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoa2V5cy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleV8xID0ga2V5c1swXTtcbiAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbCh0aGlzLmdldFJlc29sdmVyKHJlc29sdmVba2V5XzFdLCBmdXR1cmUpLCBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX2EgPSB7fSwgX2Fba2V5XzFdID0gdmFsdWUsIF9hO1xuICAgICAgICAgICAgICAgIHZhciBfYTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRhdGEgPSB7fTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcnVubmluZ1Jlc29sdmVycyQgPSBtZXJnZU1hcC5jYWxsKGZyb20oa2V5cyksIGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChfdGhpcy5nZXRSZXNvbHZlcihyZXNvbHZlW2tleV0sIGZ1dHVyZSksIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgIGRhdGFba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIG1hcC5jYWxsKGxhc3QuY2FsbChydW5uaW5nUmVzb2x2ZXJzJCksIGZ1bmN0aW9uICgpIHsgcmV0dXJuIGRhdGE7IH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBpbmplY3Rpb25Ub2tlblxuICAgICAqIEBwYXJhbSB7P30gZnV0dXJlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBQcmVBY3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FtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSZWNvZ25pemVyLnByb3RvdHlwZS5wcm9jZXNzU2VnbWVudEdyb3VwID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZmlnLCBzZWdtZW50R3JvdXAsIG91dGxldCkge1xuICAgICAgICBpZiAoc2VnbWVudEdyb3VwLnNlZ21lbnRzLmxlbmd0aCA9PT0gMCAmJiBzZWdtZW50R3JvdXAuaGFzQ2hpbGRyZW4oKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJvY2Vzc0NoaWxkcmVuKGNvbmZpZywgc2VnbWVudEdyb3VwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wcm9jZXNzU2VnbWVudChjb25maWcsIHNlZ21lbnRHcm91cCwgc2VnbWVudEdyb3VwLnNlZ21lbnRzLCBvdXRsZXQpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUmVjb2duaXplci5wcm90b3R5cGUucHJvY2Vzc0NoaWxkcmVuID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbmZpZywgc2VnbWVudEdyb3VwKSB7XG4gICAgICAgIHZhciBfdGhpcyA9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AgICAgICAgIHJldHVybiB0aGlzLnByb2Nlc3NTZWdtZW50QWdhaW5zdFJvdXRlKHIsIHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoLyoqIEB0eXBlIHs/fSAqLyBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIE5vTWF0Y2gkMSkpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMubm9MZWZ0b3ZlcnNJblVybChzZWdtZW50R3JvdXAsIHNlZ21lbnRzLCBvdXRsZXQpKSB7XG4gICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IE5vTWF0Y2gkMSgpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50R3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBvdXRsZXRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJlY29nbml6ZXIucHJvdG90eXBlLm5vTGVmdG92ZXJzSW5VcmwgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IG91dGxldFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCkge1xuICAgICAgICByZXR1cm4gc2VnbWVudHMubGVuZ3RoID09PSAwICYmICFzZWdtZW50R3JvdXAuY2hpbGRyZW5bb3V0bGV0XTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHJhd1NlZ21lbnRcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBvdXRsZXRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJlY29nbml6ZXIucHJvdG90eXBlLnByb2Nlc3NTZWdtZW50QWdhaW5zdFJvdXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEBwYXJhbSB7P30gcmF3U2VnbWVudFxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IG91dGxldFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJvdXRlLCByYXdTZWdtZW50LCBzZWdtZW50cywgb3V0bGV0KSB7XG4gICAgICAgIGlmIChyb3V0ZS5yZWRpcmVjdFRvKVxuICAgICAgICAgICAgdGhyb3cgbmV3IE5vTWF0Y2gkMSgpO1xuICAgICAgICBpZiAoKHJvdXRlLm91dGxldCB8fCBQUklNQVJZX09VVExFVCkgIT09IG91dGxldClcbiAgICAgICAgICAgIHRocm93IG5ldyBOb01hdGNoJDEoKTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gc25hcHNob3Q7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnN1bWVkU2VnbWVudHMgPSBbXTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmF3U2xpY2VkU2VnbWVudHMgPSBbXTtcbiAgICAgICAgaWYgKHJvdXRlLnBhdGggPT09ICcqKicpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhcmFtcyA9IHNlZ21lbnRzLmxlbmd0aCA+IDAgPyAvKiogQHR5cGUgez99ICovICgobGFzdCQxKHNlZ21lbnRzKSkpLnBhcmFtZXRlcnMgOiB7fTtcbiAgICAgICAgICAgIHNuYXBzaG90ID0gbmV3IEFjdGl2Y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AgICAgICAgdGhpcy5jb21waWxlciA9IGNvbXBpbGVyO1xuICAgICAgICB0aGlzLm9uTG9hZFN0YXJ0TGlzdGVuZXIgPSBvbkxvYWRTdGFydExpc3RlbmVyO1xuICAgICAgICB0aGlzLm9uTG9hZEVuZExpc3RlbmVyID0gb25Mb2FkRW5kTGlzdGVuZXI7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyZW50SW5qZWN0b3JcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXJDb25maWdMb2FkZXIucHJvdG90eXBlLmxvYWQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudEluamVjdG9yXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmVudEluamVjdG9yLCByb3V0ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAodGhpcy5vbkxvYWRTdGFydExpc3RlbmVyKSB7XG4gICAgICAgICAgICB0aGlzLm9uTG9hZFN0YXJ0TGlzdGVuZXIocm91dGUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1vZHVsZUZhY3RvcnkkID0gdGhpcy5sb2FkTW9kdWxlRmFjdG9yeSgvKiogQHR5cGUgez99ICovICgocm91dGUubG9hZENoaWxkcmVuKSkpO1xuICAgICAgICByZXR1cm4gbWFwLmNhbGwobW9kdWxlRmFjdG9yeSQsIGZ1bmN0aW9uIChmYWN0b3J5KSB7XG4gICAgICAgICAgICBpZiAoX3RoaXMub25Mb2FkRW5kTGlzdGVuZXIpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5vbkxvYWRFbmRMaXN0ZW5lcihyb3V0ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBtb2R1bGUgPSBmYWN0b3J5LmNyZWF0ZShwYXJlbnRJbmplY3Rvcik7XG4gICAgICAgICAgICByZXR1cm4gbmV3IExvYWRlZFJvdXRlckNvbmZpZyhmbGF0dGVuKG1vZHVsZS5pbmplY3Rvci5nZXQoUk9VVEVTKSksIG1vZHVsZSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBsb2FkQ2hpbGRyZW5cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlckNvbmZpZ0xvYWRlci5wcm90b3R5cGUubG9hZE1vZHVsZUZhY3RvcnkgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGxvYWRDaGlsZHJlblxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGxvYWRDaGlsZHJlbikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAodHlwZW9mIGxvYWRDaGlsZHJlbiA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHJldHVybiBmcm9tUHJvbWlzZSh0aGlzLmxvYWRlci5sb2FkKGxvYWRDaGlsZHJlbikpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG1lcmdlTWFwLmNhbGwod3JhcEludG9PYnNlcnZhYmxlKGxvYWRDaGlsZHJlbigpKSwgZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICBpZiAodCBpbnN0YW5jZW9mIE5nTW9kdWxlRmFjdG9yeSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2YodCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnJvbVByb21pc2UoX3RoaXMuY29tcGlsZXIuY29tcGlsZU1vZHVsZUFzeW5jKHQpKTtcbiAgIC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ICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0VXJsSGFuZGxpbmdTdHJhdGVneS5wcm90b3R5cGUuc2hvdWxkUHJvY2Vzc1VybCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodXJsKSB7IHJldHVybiB0cnVlOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBEZWZhdWx0VXJsSGFuZGxpbmdTdHJhdGVneS5wcm90b3R5cGUuZXh0cmFjdCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodXJsKSB7IHJldHVybiB1cmw7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZXdVcmxQYXJ0XG4gICAgICogQHBhcmFtIHs/fSB3aG9sZVVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgRGVmYXVsdFVybEhhbmRsaW5nU3RyYXRlZ3kucHJvdG90eXBlLm1lcmdlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZXdVcmxQYXJ0XG4gICAgICogQHBhcmFtIHs/fSB3aG9sZVVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5ld1VybFBhcnQsIHdob2xlVXJsKSB7IHJldHVybiBuZXdVcmxQYXJ0OyB9O1xuICAgIHJldHVybiBEZWZhdWx0VXJsSGFuZGxpbmdTdHJhdGVneTtcbn0oKSk7XG5cbi8qKlxuICogQGZpbGVvdmVydmlldyBhZGRlZCBieSB0c2lja2xlXG4gKiBAc3VwcHJlc3Mge2NoZWNrVHlwZXN9IGNoZWNrZWQgYnkgdHNjXG4gKi9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qL1xuICAgIC8qKlxuICAgICAqIFBhcnNlcyBhIHN0cmluZyBpbnRvIGEge1xcQGxpbmsgVXJsVHJlZX1cbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyLnByb3RvdHlwZS5wYXJzZVVybCA9IC8qKlxuICAgICAqIFBhcnNlcyBhIHN0cmluZyBpbnRvIGEge1xcQGxpbmsgVXJsVHJlZX1cbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkgeyByZXR1cm4gdGhpcy51cmxTZXJpYWxpemVyLnBhcnNlKHVybCk7IH07XG4gICAgLyoqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZCAqL1xuICAgIC8qKlxuICAgICAqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZFxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHBhcmFtIHs/fSBleGFjdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyLnByb3RvdHlwZS5pc0FjdGl2ZSA9IC8qKlxuICAgICAqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZFxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHBhcmFtIHs/fSBleGFjdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCwgZXhhY3QpIHtcbiAgICAgICAgaWYgKHVybCBpbnN0YW5jZW9mIFVybFRyZWUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb250YWluc1RyZWUodGhpcy5jdXJyZW50VXJsVHJlZSwgdXJsLCBleGFjdCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdXJsVHJlZSA9IHRoaXMudXJsU2VyaWFsaXplci5wYXJzZSh1cmwpO1xuICAgICAgICByZXR1cm4gY29udGFpbnNUcmVlKHRoaXMuY3VycmVudFVybFRyZWUsIHVybFRyZWUsIGV4YWN0KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyYW1zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXIucHJvdG90eXBlLnJlbW92ZUVtcHR5UHJvcHMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmFtcykge1xuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMocGFyYW1zKS5yZWR1Y2UoZnVuY3Rpb24gKHJlc3VsdCwga2V5KSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2YWx1ZSA9IHBhcmFtc1trZXldO1xuICAgICAgICAgICAgaWYgKHZhbHVlICE9PSBudWxsICYmIHZhbHVlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfSwge30pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXIucHJvdG90eXBlLnByb2Nlc3NOYXZpZ2F0aW9ucyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBjb25jYXRNYXBcbiAgICAgICAgICAgIC5jYWxsKHRoaXMubmF2aWdhdGlvbnMsIGZ1bmN0aW9uIChuYXYpIHtcbiAgICAgICAgICAgIGlmIChuYXYpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5leGVjdXRlU2NoZWR1bG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IXByZWNyZWF0ZWRTdGF0ZSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1vZHVsZUluamVjdG9yID0gX3RoaXMubmdNb2R1bGUuaW5qZWN0b3I7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVkaXJlY3RzQXBwbGllZCQgPSBhcHBseVJlZGlyZWN0cyhtb2R1bGVJbmplY3RvciwgX3RoaXMuY29uZmlnTG9hZGVyLCBfdGhpcy51cmxTZXJpYWxpemVyLCB1cmwsIF90aGlzLmNvbmZpZyk7XG4gICAgICAgICAgICAgICAgdXJsQW5kU25hcHNob3QkID0gbWVyZ2VNYXAuY2FsbChyZWRpcmVjdHNBcHBsaWVkJCwgZnVuY3Rpb24gKGFwcGxpZWRVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlY29nbml6ZShfdGhpcy5yb290Q29tcG9uZW50VHlwZSwgX3RoaXMuY29uZmlnLCBhcHBsaWVkVXJsLCBfdGhpcy5zZXJpYWxpemVVcmwoYXBwbGllZFVybCksIF90aGlzLnBhcmFtc0luaGVyaXRhbmNlU3RyYXRlZ3kpLCBmdW5jdGlvbiAoc25hcHNob3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChfdGhpcy5ldmVudHMpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5uZXh0KG5ldyBSb3V0ZXNSZWNvZ25pemVkKGlkLCBfdGhpcy5zZXJpYWxpemVVcmwodXJsKSwgX3RoaXMuc2VyaWFsaXplVXJsKGFwcGxpZWRVcmwpLCBzbmFwc2hvdCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgYXBwbGllZFVybDogYXBwbGllZFVybCwgc25hcHNob3Q6IHNuYXBzaG90IH07XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICA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JuIHsgYXBwbGllZFVybDogYXBwbGllZFVybCwgc25hcHNob3Q6IHNuYXBzaG90LCBzaG91bGRBY3RpdmF0ZTogc2hvdWxkQWN0aXZhdGUgfTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcHJlYWN0aXZhdGlvblJlc29sdmVEYXRhJCA9IG1lcmdlTWFwLmNhbGwocHJlYWN0aXZhdGlvbkNoZWNrR3VhcmRzJCwgZnVuY3Rpb24gKHApIHtcbiAgICAgICAgICAgICAgICBpZiAoX3RoaXMubmF2aWdhdGlvbklkICE9PSBpZClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9mKGZhbHNlKTtcbiAgICAgICAgICAgICAgICBpZiAocC5zaG91bGRBY3RpdmF0ZSAmJiBwcmVBY3RpdmF0aW9uLmlzQWN0aXZhdGluZygpKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnRyaWdnZXJFdmVudChuZXcgUmVzb2x2ZVN0YXJ0KGlkLCBfdGhpcy5zZXJpYWxpemVVcmwodXJsKSwgcC5hcHBsaWVkVXJsLCBwLnNuYXBzaG90KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChwcmVBY3RpdmF0aW9uLnJlc29sdmVEYXRhKF90aGlzLnBhcmFtc0luaGVyaXRhbmNlU3RyYXRlZ3kpLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy50cmlnZ2VyRXZlbnQobmV3IFJlc29sdmVFbmQoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBwLmFwcGxpZWRVcmwsIHAuc25hcHNob3QpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAg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UsIHNob3VsZEFjdGl2YXRlOiBzaG91bGRBY3RpdmF0ZSB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgYXBwbGllZFVybDogYXBwbGllZFVybCwgc3RhdGU6IG51bGwsIHNob3VsZEFjdGl2YXRlOiBzaG91bGRBY3RpdmF0ZSB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgLy8gYXBwbGllZCB0aGUgbmV3IHJvdXRlciBzdGF0ZVxuICAgICAgICAgICAgLy8gdGhpcyBvcGVyYXRpb24gaGFzIHNpZGUgZWZmZWN0c1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmF2aWdhdGlvbklzU3VjY2Vzc2Z1bDtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHN0b3JlZFN0YXRlID0gX3RoaXMucm91dGVyU3RhdGU7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzdG9yZWRVcmwgPSBfdGhpcy5jdXJyZW50VXJsVHJlZTtcbiAgICAgICAgICAgIHJvdXRlclN0YXRlJFxuICAgICAgICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgIHZhciBhcHBsaWVkVXJsID0gX2EuYXBwbGllZFVybCwgc3RhdGUgPSBfYS5zdGF0ZSwgc2hvdWxkQWN0aXZhdGUgPSBfYS5zaG91bGRBY3RpdmF0ZTtcbiAgICAgICAgICAgICAgICBpZiAoIXNob3VsZEFjdGl2YXRlIHx8IGlkICE9PSBfdGhpcy5uYXZpZ2F0aW9uSWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbmF2aWdhdGlvbklzU3VjY2Vzc2Z1bCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF90aGlzLmN1cnJlbnRVcmxUcmVlID0gYXBwbGllZFVybDtcbiAgICAgICAgICAgICAgICBfdGhpcy5yYXdVcmxUcmVlID0gX3RoaXMudXJsSGFuZGxpbmdTdHJhdGVneS5tZXJnZShfdGhpcy5jdXJyZW50VXJsVHJlZSwgcmF3VXJsKTtcbiAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMpKS5yb3V0ZXJTdGF0ZSA9IHN0YXRlO1xuICAgICAgICAgICAgICAgIGlmICghc2tpcExvY2F0aW9uQ2hhbmdlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhdGggPSBfdGhpcy51cmxTZXJpYWxpemVyLnNlcmlhbGl6ZShfdGhpcy5yYXdVcmxUcmVlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKF90aGlzLmxvY2F0aW9uLmlzQ3VycmVudFBhdGhFcXVhbFRvKHBhdGgpIHx8IHJlcGxhY2VVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmxvY2F0aW9uLnJlcGxhY2VTdGF0ZShwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmxvY2F0aW9uLmdvKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ldyBBY3RpdmF0ZVJvdXRlcyhfdGhpcy5yb3V0ZVJldXNlU3RyYXRlZ3ksIHN0YXRlLCBzdG9yZWRTdGF0ZSwgZnVuY3Rpb24gKGV2dCkgeyByZXR1cm4gX3RoaXMudHJpZ2dlckV2ZW50KGV2dCk7IH0pXG4gICAgICAgICAgICAgICAgICAgIC5hY3RpdmF0ZShfdGhpcy5yb290Q29udGV4dHMpO1xuICAgICAgICAgICAgICAgIG5hdmlnYXRpb25Jc1N1Y2Nlc3NmdWwgPSB0cnVlO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKG5hdmlnYXRpb25Jc1N1Y2Nlc3NmdWwpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMubmF2aWdhdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKF90aGlzLmV2ZW50cykpXG4gICAgICAgICAgICAgICAgICAgICAgICAubmV4dChuZXcgTmF2aWdhdGlvbkVuZChpZCwgX3RoaXMuc2VyaWFsaXplVXJsKHVybCksIF90aGlzLnNlcmlhbGl6ZVVybChfdGhpcy5jdXJyZW50VXJsVHJlZSkpKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZVByb21pc2UodHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXNldFVybFRvQ3VycmVudFVybFRyZWUoKTtcbiAgICAgICAgICAgICAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKF90aGlzLmV2ZW50cykpXG4gICAgICAgICAgICAgICAgICAgICAgICAubmV4dChuZXcgTmF2aWdhdGlvbkNhbmNlbChpZCwgX3RoaXMuc2VyaWFsaXplVXJsKHVybCksICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVQcm9taXNlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIGlmIChpc05hdmlnYXRpb25DYW5jZWxpbmdFcnJvcihlKSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5uYXZpZ2F0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXNldFN0YXRlQW5kVXJsKHN0b3JlZFN0YXRlLCBzdG9yZWRVcmwsIHJhd1VybCk7XG4gICAgICAgICAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChfdGhpcy5ldmVudHMpKVxuICAgICAgICAgICAgICAgICAgICAgICAgLm5leHQobmV3IE5hdmlnYXRpb25DYW5jZWwoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBlLm1lc3NhZ2UpKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZVByb21pc2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMucmVzZXRTdGF0ZUFuZFVybChzdG9yZWRTdGF0ZSwgc3RvcmVkVXJsLCByYXdVcmwpO1xuICAgICAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMuZXZlbnRzKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5uZXh0KG5ldyBOYXZpZ2F0aW9uRXJyb3IoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBlKSk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlUHJvbWlzZShfdGhpcy5lcnJvckhhbmRsZXIoZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNhdGNoICgvKiogQHR5cGUgez99ICovIGVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3RQcm9taXNlKGVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RvcmVkU3RhdGVcbiAgICAgKiBAcGFyYW0gez99IHN0b3JlZFVybFxuICAgICAqIEBwYXJhbSB7P30gcmF3VXJsXG4gICAgIC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ICAgIC8vIElmIHdlIGhhdmUgYSBub3JtYWwgcm91dGUsIHdlIG5lZWQgdG8gZ28gdGhyb3VnaCBhbiBvdXRsZXQuXG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29udGV4dCA9IHBhcmVudENvbnRleHQuZ2V0Q29udGV4dChmdXR1cmUub3V0bGV0KTtcbiAgICAgICAgICAgICAgICBpZiAoY29udGV4dCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlYWN0aXZhdGVDaGlsZFJvdXRlcyhmdXR1cmVOb2RlLCBjdXJyTm9kZSwgY29udGV4dC5jaGlsZHJlbik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgd2UgaGF2ZSBhIGNvbXBvbmVudGxlc3Mgcm91dGUsIHdlIHJlY3Vyc2UgYnV0IGtlZXAgdGhlIHNhbWUgb3V0bGV0IG1hcC5cbiAgICAgICAgICAgICAgICB0aGlzLmRlYWN0aXZhdGVDaGlsZFJvdXRlcyhmdXR1cmVOb2RlLCBjdXJyTm9kZSwgcGFyZW50Q29udGV4dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAoY3Vycikge1xuICAgICAgICAgICAgICAgIC8vIERlYWN0aXZhdGUgdGhlIGN1cnJlbnQgcm91dGUgd2hpY2ggd2lsbCBub3QgYmUgcmUtdXNlZFxuICAgICAgICAgICAgICAgIHRoaXMuZGVhY3RpdmF0ZVJvdXRlQW5kSXRzQ2hpbGRyZW4oY3Vyck5vZGUsIHBhcmVudENvbnRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRDb250ZXh0c1xuICAgICAqIEByZXR1cm4gez99X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pO1xuICAgICAgICBpZiAoY29udGV4dCAmJiBjb250ZXh0Lm91dGxldCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29tcG9uZW50UmVmID0gY29udGV4dC5vdXRsZXQuZGV0YWNoKCk7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjb250ZXh0cyA9IGNvbnRleHQuY2hpbGRyZW4ub25PdXRsZXREZWFjdGl2YXRlZCgpO1xuICAgICAgICAgICAgdGhpcy5yb3V0ZVJldXNlU3RyYXRlZ3kuc3RvcmUocm91dGUudmFsdWUuc25hcHNob3QsIHsgY29tcG9uZW50UmVmOiBjb21wb25lbnRSZWYsIHJvdXRlOiByb3V0ZSwgY29udGV4dHM6IGNvbnRleHRzIH0pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRDb250ZXh0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWN0aXZhdGVSb3V0ZXMucHJvdG90eXBlLmRlYWN0aXZhdGVSb3V0ZUFuZE91dGxldCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudENvbnRleHRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGUsIHBhcmVudENvbnRleHRzKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRleHQgPSBwYXJlbnRDb250ZXh0cy5nZXRDb250ZXh0KHJvdXRlLnZhbHVlLm91dGxldCk7XG4gICAgICAgIGlmIChjb250ZXh0KSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjaGlsZHJlbiA9IG5vZGVDaGlsZHJlbkFzTWFwKHJvdXRlKTtcbi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9tIGBSb3V0ZXJPdXRsZXQubmdPbkluaXRgIHdoZW4gaXQgaXMgaW5zdGFudGlhdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm91dGxldC5hdHRhY2goc3RvcmVkLmNvbXBvbmVudFJlZiwgc3RvcmVkLnJvdXRlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhZHZhbmNlQWN0aXZhdGVkUm91dGVOb2RlQW5kSXRzQ2hpbGRyZW4oc3RvcmVkLnJvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbmZpZyA9IHBhcmVudExvYWRlZENvbmZpZyhmdXR1cmUuc25hcHNob3QpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjbXBGYWN0b3J5UmVzb2x2ZXIgPSBjb25maWcgPyBjb25maWcubW9kdWxlLmNvbXBvbmVudEZhY3RvcnlSZXNvbHZlciA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucm91dGUgPSBmdXR1cmU7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucmVzb2x2ZXIgPSBjbXBGYWN0b3J5UmVzb2x2ZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250ZXh0Lm91dGxldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZhdGUgdGhlIG91dGxldCB3aGVuIGl0IGhhcyBhbHJlYWR5IGJlZW4gaW5zdGFudGlhdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UgaXQgd2lsbCBnZXQgYWN0aXZhdGVkIGZyb20gaXRzIGBuZ09uSW5pdGAgd2hlbiBpbnN0YW50aWF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQub3V0bGV0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gpICYmIC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUpICYmIC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUud2FybikpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ3ByZXNlcnZlUXVlcnlQYXJhbXMgaXMgZGVwcmVjYXRlZCEsIHVzZSBxdWVyeVBhcmFtc0hhbmRsaW5nIGluc3RlYWQuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnByZXNlcnZlID0gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGluay5wcm90b3R5cGUub25DbGljayA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBleHRyYXMgPSB7XG4gICAgICAgICAgICBza2lwTG9jYXRpb25DaGFuZ2U6IGF0dHJCb29sVmFsdWUodGhpcy5za2lwTG9jYXRpb25DaGFuZ2UpLFxuICAgICAgICAgICAgcmVwbGFjZVVybDogYXR0ckJvb2xWYWx1ZSh0aGlzLnJlcGxhY2VVcmwpLFxuICAgICAgICB9O1xuICAgICAgICB0aGlzLnJvdXRlci5uYXZpZ2F0ZUJ5VXJsKHRoaXMudXJsVHJlZSwgZXh0cmFzKTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoUm91dGVyTGluay5wcm90b3R5cGUsIFwidXJsVHJlZVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZ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b24gKCkge1xuICAgIGZ1bmN0aW9uIFJvdXRlckxpbmtXaXRoSHJlZihyb3V0ZXIsIHJvdXRlLCBsb2NhdGlvblN0cmF0ZWd5KSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMucm91dGVyID0gcm91dGVyO1xuICAgICAgICB0aGlzLnJvdXRlID0gcm91dGU7XG4gICAgICAgIHRoaXMubG9jYXRpb25TdHJhdGVneSA9IGxvY2F0aW9uU3RyYXRlZ3k7XG4gICAgICAgIHRoaXMuY29tbWFuZHMgPSBbXTtcbiAgICAgICAgdGhpcy5zdWJzY3JpcHRpb24gPSByb3V0ZXIuZXZlbnRzLnN1YnNjcmliZShmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgaWYgKHMgaW5zdGFuY2VvZiBOYXZpZ2F0aW9uRW5kKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMudXBkYXRlVGFyZ2V0VXJsQW5kSHJlZigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFJvdXRlckxpbmtXaXRoSHJlZi5wcm90b3R5cGUsIFwicm91dGVyTGlua1wiLCB7XG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gY29tbWFuZHNcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChjb21tYW5kcykge1xuICAgICAgICAgICAgaWYgKGNvbW1hbmRzICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzID0gQXJyYXkuaXNBcnJheShjb21tYW5kcykgPyBjb21tYW5kcyA6IFtjb21tYW5kc107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShSb3V0ZXJMaW5rV2l0aEhyZWYucHJvdG90eXBlLCBcInByZXNlcnZlUXVlcnlQYXJhbXNcIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmIChpc0Rldk1vZGUoKSAmJiAvKiogQHR5cGUgez99ICovIChjb25zb2xlKSAmJiAvKiogQHR5cGUgez99ICovIChjb25zb2xlLndhcm4pKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCdwcmVzZXJ2ZVF1ZXJ5UGFyYW1zIGlzIGRlcHJlY2F0ZWQsIHVzZSBxdWVyeVBhcmFtc0hhbmRsaW5nIGluc3RlYWQuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnByZXNlcnZlID0gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGlua1dpdGhIcmVmLnByb3RvdHlwZS5uZ09uQ2hhbmdlcyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNoYW5nZXMpIHsgdGhpcy51cGRhdGVUYXJnZXRVcmxBbmRIcmVmKCk7IH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9c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nVuY3Rpb24gKGMpIHsgcmV0dXJuICEhYzsgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hhbmdlc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGlua0FjdGl2ZS5wcm90b3R5cGUubmdPbkNoYW5nZXMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGNoYW5nZXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjaGFuZ2VzKSB7IHRoaXMudXBkYXRlKCk7IH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXJMaW5rQWN0aXZlLnByb3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB0aGlzLnN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpOyB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGlua0FjdGl2ZS5wcm90b3R5cGUudXBkYXRlID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmICghdGhpcy5saW5rcyB8fCAhdGhpcy5saW5rc1dpdGhIcmVmcyB8fCAhdGhpcy5yb3V0ZXIubmF2aWdhdGVkKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBQcm9taXNlLnJlc29sdmUoKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGhhc0FjdGl2ZUxpbmtzID0gX3RoaXMuaGFzQWN0aXZlTGlua3MoKTtcbiAgICAgICAgICAgIGlmIChfdGhpcy5pc0FjdGl2ZSAhPT0gaGFzQWN0aXZlTGlua3MpIHtcbiAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMpKS5pc0FjdGl2ZSA9IGhhc0FjdGl2ZUxpbmtzO1xuICAgICAgICAgICAgICAgIF90aGlzLmNsYXNzZXMuZm9yRWFjaChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaGFzQWN0aXZlTGlua3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnJlbmRlcmVyLmFkZENsYXNzKF90aGlzLmVsZW1lbnQubmF0aXZlRWxlbWVudCwgYyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZW5kZXJlci5yZW1vdmVDbGFzcyhfdGhpcy5lbGVtZW50Lm5hdGl2ZUVsZW1lbnQsIGMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlckxpbmtBY3RpdmUucHJvdG90eXBlLmlzTGlua0FjdGl2ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGVyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAobGluaykge1xuICAgICAgICAgICAgcmV0dXJuIHJvdXRlci5pc0FjdGl2ZShsaW5rLnVybFRyZWUsIF90aGlzLnJvd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0byBwb3B1bGF0ZVxuICAgICAgICAgICAgLy8gdGhlIG91dGxldCB3aGVuIGl0IGlzIGluaXRpYWxpemVkIChpZSBpbnNpZGUgYSBOZ0lmKVxuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29udGV4dCA9IHRoaXMucGFyZW50Q29udGV4dHMuZ2V0Q29udGV4dCh0aGlzLm5hbWUpO1xuICAgICAgICAgICAgaWYgKGNvbnRleHQgJiYgY29udGV4dC5yb3V0ZSkge1xuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmF0dGFjaFJlZikge1xuICAgICAgICAgICAgICAgICAgICAvLyBgYXR0YWNoUmVmYCBpcyBwb3B1bGF0ZWQgd2hlbiB0aGVyZSBpcyBhbiBleGlzdGluZyBjb21wb25lbnQgdG8gbW91bnRcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hdHRhY2goY29udGV4dC5hdHRhY2hSZWYsIGNvbnRleHQucm91dGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHRoZSBjb21wb25lbnQgZGVmaW5lZCBpbiB0aGUgY29uZmlndXJhdGlvbiBpcyBjcmVhdGVkXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZhdGVXaXRoKGNvbnRleHQucm91dGUsIGNvbnRleHQucmVzb2x2ZXIgfHwgbnVsbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoUm91dGVyT3V0bGV0LnByb3RvdHlwZSwgXCJpc0FjdGl2YXRlZFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiAhIXRoaXMuYWN0aXZhdGVkOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoUm91dGVyT3V0bGV0LnByb3RvdHlwZSwgXCJjb21wb25lbnRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmFjdGl2YXRlZClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ091dGxldCBpcyBub3QgYWN0aXZhdGVkJyk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hY3RpdmF0ZWQuaW5zdGFuY2U7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShSb3V0ZXJPdXRsZXQucHJvdG90eXBlLCBcImFjdGl2YXRlZFJvdXRlXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5hY3RpdmF0ZWQpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdPdXRsZXQgaXMgbm90IGFjdGl2YXRlZCcpO1xuICAgICAgICAgICAgcmV0dXJuIC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuX2FjdGl2YXRlZFJvdXRlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFJvdXRlck91dGxldC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IFJvdXRlck91dGxldDtcbn0oKSk7XG52YXIgT3V0bGV0SW5qZWN0b3IgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gT3V0bGV0SW5qZWN0b3Iocm91dGUsIGNoaWxkQ29udGV4dHMsIHBhcmVudCkge1xuICAgICAgICB0aGlzLnJvdXRlID0gcm91dGU7XG4gICAgICAgIHRoaXMuY2hpbGRDb250ZXh0cyA9IGNoaWxkQ29udGV4dHM7XG4gICAgICAgIHRoaXMucGFyZW50ID0gcGFyZW50O1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHRva2VuXG4gICAgICogQHBhcmFtIHs/PX0gbm90Rm91bmRWYWx1ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgT3V0bGV0SW5qZWN0b3IucHJvdG90eXBlLmdldCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdG9rZW5cbiAgICAgKiBAcGFyYW0gez89fSBub3RGb3VuZFZhbHVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodG9rZW4sIG5vdEZvdW5kVmFsdWUpIHtcbiAgICAgICAgaWYgKHRva2VuID09PSBBY3RpdmF0ZWRSb3V0ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucm91dGU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRva2VuID09PSBDaGlsZHJlbk91dGxldENvbnRleHRzKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5jaGlsZENvbnRleHRzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcmVudC5nZXQodG9rZW4sIG5vdEZvdW5kVmFsdWUpO1xuICAgIH07XG4gICAgcmV0dXJuIE91dGxldEluamVjdG9yO1xufSgpKTtcblxuLyoqXG4gKiBAZmlsZW92ZXJ2aWV3IGFkZGVkIGJ5IHRzaWNrbGVcbiAqIEBzdXBwcmVzcyB7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VuKSB7XG4gICAgICAgICAgICAgICAgcmVzLnB1c2godGhpcy5wcm9jZXNzUm91dGVzKG5nTW9kdWxlLCByb3V0ZS5jaGlsZHJlbikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtZXJnZUFsbC5jYWxsKGZyb20ocmVzKSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5nTW9kdWxlXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyUHJlbG9hZGVyLnByb3RvdHlwZS5wcmVsb2FkQ29uZmlnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZ01vZHVsZVxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChuZ01vZHVsZSwgcm91dGUpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcmV0dXJuIHRoaXMucHJlbG9hZGluZ1N0cmF0ZWd5LnByZWxvYWQocm91dGUsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGxvYWRlZCQgPSBfdGhpcy5sb2FkZXIubG9hZChuZ01vZHVsZS5pbmplY3Rvciwgcm91dGUpO1xuICAgICAgICAgICAgcmV0dXJuIG1lcmdlTWFwLmNhbGwobG9hZGVkJCwgZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICAgICAgICAgIHJvdXRlLl9sb2FkZWRDb25maWcgPSBjb25maWc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLnByb2Nlc3NSb3V0ZXMoY29uZmlnLm1vZHVsZSwgY29uZmlnLnJvdXRlcyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBSb3V0ZXJQcmVsb2FkZXIuZGVjb3Jh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gKiBAcGFyYW0gez89fSBjb25maWdcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChyb3V0ZXMsIGNvbmZpZykge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbmdNb2R1bGU6IFJvdXRlck1vZHVsZSxcbiAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgIFJPVVRFUl9QUk9WSURFUlMsXG4gICAgICAgICAgICAgICAgcHJvdmlkZVJvdXRlcyhyb3V0ZXMpLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvdmlkZTogUk9VVEVSX0ZPUlJPT1RfR1VBUkQsXG4gICAgICAgICAgICAgICAgICAgIHVzZUZhY3Rvcnk6IHByb3ZpZGVGb3JSb290R3VhcmQsXG4gICAgICAgICAgICAgICAgICAgIGRlcHM6IFtbUm91dGVyLCBuZXcgT3B0aW9uYWwoKSwgbmV3IFNraXBTZWxmKCldXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgeyBwcm92aWRlOiBST1VURVJfQ09ORklHVVJBVElPTiwgdXNlVmFsdWU6IGNvbmZpZyA/IGNvbmZpZyA6IHt9IH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBMb2NhdGlvblN0cmF0ZWd5LFxuICAgICAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBwcm92aWRlTG9jYXRpb25TdHJhdGVneSxcbiAgICAgICAgICAgICAgICAgICAgZGVwczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgUGxhdGZvcm1Mb2NhdGlvbiwgW25ldyBJbmplY3QoQVBQX0JBU0VfSFJFRiksIG5ldyBPcHRpb25hbCgpXSwgUk9VVEVSX0NPTkZJR1VSQVRJT05cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgIC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XplcihpbmplY3Rvcikge1xuICAgICAgICB0aGlzLmluamVjdG9yID0gaW5qZWN0b3I7XG4gICAgICAgIHRoaXMuaW5pdE5hdmlnYXRpb24gPSBmYWxzZTtcbiAgICAgICAgdGhpcy5yZXN1bHRPZlByZWFjdGl2YXRpb25Eb25lID0gbmV3IFN1YmplY3QoKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXJJbml0aWFsaXplci5wcm90b3R5cGUuYXBwSW5pdGlhbGl6ZXIgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcCA9IHRoaXMuaW5qZWN0b3IuZ2V0KExPQ0FUSU9OX0lOSVRJQUxJWkVELCBQcm9taXNlLnJlc29sdmUobnVsbCkpO1xuICAgICAgICByZXR1cm4gcC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlc29sdmUgPSAvKiogQHR5cGUgez99ICovICgobnVsbCkpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzID0gbmV3IFByb21pc2UoZnVuY3Rpb24gKHIpIHsgcmV0dXJuIHJlc29sdmUgPSByOyB9KTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJvdXRlciA9IF90aGlzLmluamVjdG9yLmdldChSb3V0ZXIpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0cyA9IF90aGlzLmluamVjdG9yLmdldChST1VURVJfQ09ORklHVVJBVElPTik7XG4gICAgICAgICAgICBpZiAoX3RoaXMuaXNMZWdhY3lEaXNhYmxlZChvcHRzKSB8fCBfdGhpcy5pc0xlZ2FjeUVuYWJsZWQob3B0cykpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAob3B0cy5pbml0aWFsTmF2aWdhdGlvbiA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgICAgICAgICAgIHJvdXRlci5zZXRVcExvY2F0aW9uQ2hhbmdlTGlzdGVuZXIoKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAob3B0cy5pbml0aWFsTmF2aWdhdGlvbiA9PT0gJ2VuYWJsZWQnKSB7XG4gICAgICAgICAgICAgICAgcm91dGVyLmhvb2tzLmFmdGVyUHJlYWN0aXZhdGlvbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gb25seSB0aGUgaW5pdGlhbCBuYXZpZ2F0aW9uIHNob3VsZCBiZSBkZWxheWVkXG4gICAgICAgICAgICAgICAgICAgIGlmICghX3RoaXMuaW5pdE5hdmlnYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmluaXROYXZpZ2F0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUodHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMucmVzdWx0T2ZQcmVhY3RpdmF0aW9uRG9uZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1YnNlcXVlbnQgbmF2aWdhdGlvbnMgc2hvdWxkIG5vdCBiZSBkZWxheWVkXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAob2YobnVsbCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByb3V0ZXIuaW5pdGlhbE5hdmlnYXRpb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkludmFsaWQgaW5pdGlhbE5hdmlnYXRpb24gb3B0aW9uczogJ1wiICsgb3B0cy5pbml0aWFsTmF2aWdhdGlvbiArIFwiJ1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBib290c3RyYXBwZWRDb21wb25lbnRSZWZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlckluaXRpYWxpemVyLnByb3RvdHlwZS5ib290c3RyYXBMaXN0ZW5lciA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYm9vdHN0cmFwcGVkQ29tcG9uZW50UmVmXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYm9vdHN0cmFwcGVkQ29tcG9uZW50UmVmKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9wdHMgPSB0aGlzLmluamVjdG9yLmdldChST1VURVJfQ09ORklHVVJBVElPTik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByZWxvYWRlciA9IHRoaXMuaW5qZWN0b3IuZ2V0KFJvdXRlclByZWxvYWRlcik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJvdXRlciA9IHRoaXMuaW5qZWN0b3IuZ2V0KFJvdXRlcik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlZiA9IHRoaXMuaW5qZWN0b3IuZ2V0KEFwcGxpY2F0aW9uUmVmKTtcbiAgICAgICAgaWYgKGJvb3RzdHJhcHBlZENvbXBvbmVudFJlZiAhPT0gcmVmLmNvbXBvbmVudHNbMF0pIHtcbiAgICAgICAgICAgIHJldHVyb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0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///66\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLink\", function() { return RouterLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLinkWithHref\", function() { return RouterLinkWithHref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterLinkActive\", function() { return RouterLinkActive; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterOutlet\", function() { return RouterOutlet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivationEnd\", function() { return ActivationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivationStart\", function() { return ActivationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildActivationEnd\", function() { return ChildActivationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildActivationStart\", function() { return ChildActivationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GuardsCheckEnd\", function() { return GuardsCheckEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GuardsCheckStart\", function() { return GuardsCheckStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationCancel\", function() { return NavigationCancel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationEnd\", function() { return NavigationEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationError\", function() { return NavigationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NavigationStart\", function() { return NavigationStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResolveEnd\", function() { return ResolveEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResolveStart\", function() { return ResolveStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteConfigLoadEnd\", function() { return RouteConfigLoadEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteConfigLoadStart\", function() { return RouteConfigLoadStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterEvent\", function() { return RouterEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RoutesRecognized\", function() { return RoutesRecognized; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouteReuseStrategy\", function() { return RouteReuseStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Router\", function() { return Router; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTES\", function() { return ROUTES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTER_CONFIGURATION\", function() { return ROUTER_CONFIGURATION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROUTER_INITIALIZER\", function() { return ROUTER_INITIALIZER; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterModule\", function() { return RouterModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"provideRoutes\", function() { return provideRoutes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ChildrenOutletContexts\", function() { return ChildrenOutletContexts; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OutletContext\", function() { return OutletContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NoPreloading\", function() { return NoPreloading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PreloadAllModules\", function() { return PreloadAllModules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PreloadingStrategy\", function() { return PreloadingStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterPreloader\", function() { return RouterPreloader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivatedRoute\", function() { return ActivatedRoute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ActivatedRouteSnapshot\", function() { return ActivatedRouteSnapshot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterState\", function() { return RouterState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RouterStateSnapshot\", function() { return RouterStateSnapshot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PRIMARY_OUTLET\", function() { return PRIMARY_OUTLET; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertToParamMap\", function() { return convertToParamMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlHandlingStrategy\", function() { return UrlHandlingStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultUrlSerializer\", function() { return DefaultUrlSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSegment\", function() { return UrlSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSegmentGroup\", function() { return UrlSegmentGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlSerializer\", function() { return UrlSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UrlTree\", function() { return UrlTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵROUTER_PROVIDERS\", function() { return ROUTER_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵflatten\", function() { return flatten; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return ROUTER_FORROOT_GUARD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return RouterInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return getAppInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵi\", function() { return getBootstrapListener; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return provideForRootGuard; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return provideLocationStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵj\", function() { return provideRouterInitializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return rootRoute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return routerNgProbeToken; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return setupRouter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵk\", function() { return Tree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵl\", function() { return TreeNode; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__ = __webpack_require__(165);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__ = __webpack_require__(118);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__ = __webpack_require__(243);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__ = __webpack_require__(510);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__ = __webpack_require__(10);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__ = __webpack_require__(511);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__ = __webpack_require__(246);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__ = __webpack_require__(518);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__ = __webpack_require__(520);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__ = __webpack_require__(166);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__ = __webpack_require__(247);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__ = __webpack_require__(522);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__ = __webpack_require__(524);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__ = __webpack_require__(526);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__ = __webpack_require__(527);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__angular_platform_browser__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Base for events the Router goes through, as opposed to events tied to a specific\n * Route. `RouterEvent`s will only be fired one time for any given navigation.\n *\n * Example:\n *\n * ```\n * class MyService {\n * constructor(public router: Router, logger: Logger) {\n * router.events.filter(e => e instanceof RouterEvent).subscribe(e => {\n * logger.log(e.id, e.url);\n * });\n * }\n * }\n * ```\n *\n * \\@experimental\n */\nvar RouterEvent = /** @class */ (function () {\n function RouterEvent(id, url) {\n this.id = id;\n this.url = url;\n }\n return RouterEvent;\n}());\n/**\n * \\@whatItDoes Represents an event triggered when a navigation starts.\n *\n * \\@stable\n */\nvar NavigationStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationStart, _super);\n function NavigationStart() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationStart.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return \"NavigationStart(id: \" + this.id + \", url: '\" + this.url + \"')\"; };\n return NavigationStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation ends successfully.\n *\n * \\@stable\n */\nvar NavigationEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationEnd, _super);\n function NavigationEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationEnd.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"NavigationEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"')\";\n };\n return NavigationEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation is canceled.\n *\n * \\@stable\n */\nvar NavigationCancel = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationCancel, _super);\n function NavigationCancel(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, reason) {\n var _this = _super.call(this, id, url) || this;\n _this.reason = reason;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationCancel.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return \"NavigationCancel(id: \" + this.id + \", url: '\" + this.url + \"')\"; };\n return NavigationCancel;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when a navigation fails due to an unexpected error.\n *\n * \\@stable\n */\nvar NavigationError = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(NavigationError, _super);\n function NavigationError(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, error) {\n var _this = _super.call(this, id, url) || this;\n _this.error = error;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n NavigationError.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"NavigationError(id: \" + this.id + \", url: '\" + this.url + \"', error: \" + this.error + \")\";\n };\n return NavigationError;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered when routes are recognized.\n *\n * \\@stable\n */\nvar RoutesRecognized = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RoutesRecognized, _super);\n function RoutesRecognized(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n RoutesRecognized.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () {\n return \"RoutesRecognized(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return RoutesRecognized;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the start of the Guard phase of routing.\n *\n * \\@experimental\n */\nvar GuardsCheckStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GuardsCheckStart, _super);\n function GuardsCheckStart(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n GuardsCheckStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"GuardsCheckStart(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return GuardsCheckStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the end of the Guard phase of routing.\n *\n * \\@experimental\n */\nvar GuardsCheckEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(GuardsCheckEnd, _super);\n function GuardsCheckEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state, shouldActivate) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n _this.shouldActivate = shouldActivate;\n return _this;\n }\n /**\n * @return {?}\n */\n GuardsCheckEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"GuardsCheckEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \", shouldActivate: \" + this.shouldActivate + \")\";\n };\n return GuardsCheckEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the start of the Resolve phase of routing. The timing of this\n * event may change, thus it's experimental. In the current iteration it will run\n * in the \"resolve\" phase whether there's things to resolve or not. In the future this\n * behavior may change to only run when there are things to be resolved.\n *\n * \\@experimental\n */\nvar ResolveStart = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ResolveStart, _super);\n function ResolveStart(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n ResolveStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"ResolveStart(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return ResolveStart;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents the end of the Resolve phase of routing. See note on\n * {\\@link ResolveStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ResolveEnd = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(ResolveEnd, _super);\n function ResolveEnd(/** @docsNotRequired */\n /** @docsNotRequired */\n id, /** @docsNotRequired */\n /** @docsNotRequired */\n url, urlAfterRedirects, state) {\n var _this = _super.call(this, id, url) || this;\n _this.urlAfterRedirects = urlAfterRedirects;\n _this.state = state;\n return _this;\n }\n /**\n * @return {?}\n */\n ResolveEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n return \"ResolveEnd(id: \" + this.id + \", url: '\" + this.url + \"', urlAfterRedirects: '\" + this.urlAfterRedirects + \"', state: \" + this.state + \")\";\n };\n return ResolveEnd;\n}(RouterEvent));\n/**\n * \\@whatItDoes Represents an event triggered before lazy loading a route config.\n *\n * \\@experimental\n */\nvar RouteConfigLoadStart = /** @class */ (function () {\n function RouteConfigLoadStart(route) {\n this.route = route;\n }\n /**\n * @return {?}\n */\n RouteConfigLoadStart.prototype.toString = /**\n * @return {?}\n */\n function () { return \"RouteConfigLoadStart(path: \" + this.route.path + \")\"; };\n return RouteConfigLoadStart;\n}());\n/**\n * \\@whatItDoes Represents an event triggered when a route has been lazy loaded.\n *\n * \\@experimental\n */\nvar RouteConfigLoadEnd = /** @class */ (function () {\n function RouteConfigLoadEnd(route) {\n this.route = route;\n }\n /**\n * @return {?}\n */\n RouteConfigLoadEnd.prototype.toString = /**\n * @return {?}\n */\n function () { return \"RouteConfigLoadEnd(path: \" + this.route.path + \")\"; };\n return RouteConfigLoadEnd;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ChildActivationEnd} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ChildActivationStart = /** @class */ (function () {\n function ChildActivationStart(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ChildActivationStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ChildActivationStart(path: '\" + path + \"')\";\n };\n return ChildActivationStart;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ChildActivationStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ChildActivationEnd = /** @class */ (function () {\n function ChildActivationEnd(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ChildActivationEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ChildActivationEnd(path: '\" + path + \"')\";\n };\n return ChildActivationEnd;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ActivationEnd} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ActivationStart = /** @class */ (function () {\n function ActivationStart(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ActivationStart.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ActivationStart(path: '\" + path + \"')\";\n };\n return ActivationStart;\n}());\n/**\n * \\@whatItDoes Represents the start of end of the Resolve phase of routing. See note on\n * {\\@link ActivationStart} for use of this experimental API.\n *\n * \\@experimental\n */\nvar ActivationEnd = /** @class */ (function () {\n function ActivationEnd(snapshot) {\n this.snapshot = snapshot;\n }\n /**\n * @return {?}\n */\n ActivationEnd.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return \"ActivationEnd(path: '\" + path + \"')\";\n };\n return ActivationEnd;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Name of the primary outlet.\n *\n * \\@stable\n */\nvar PRIMARY_OUTLET = 'primary';\n/**\n * Matrix and Query parameters.\n *\n * `ParamMap` makes it easier to work with parameters as they could have either a single value or\n * multiple value. Because this should be known by the user, calling `get` or `getAll` returns the\n * correct type (either `string` or `string[]`).\n *\n * The API is inspired by the URLSearchParams interface.\n * see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n *\n * \\@stable\n * @record\n */\n\nvar ParamsAsMap = /** @class */ (function () {\n function ParamsAsMap(params) {\n this.params = params || {};\n }\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.has = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { return this.params.hasOwnProperty(name); };\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.get = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.has(name)) {\n var /** @type {?} */ v = this.params[name];\n return Array.isArray(v) ? v[0] : v;\n }\n return null;\n };\n /**\n * @param {?} name\n * @return {?}\n */\n ParamsAsMap.prototype.getAll = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (this.has(name)) {\n var /** @type {?} */ v = this.params[name];\n return Array.isArray(v) ? v : [v];\n }\n return [];\n };\n Object.defineProperty(ParamsAsMap.prototype, \"keys\", {\n get: /**\n * @return {?}\n */\n function () { return Object.keys(this.params); },\n enumerable: true,\n configurable: true\n });\n return ParamsAsMap;\n}());\n/**\n * Convert a {\\@link Params} instance to a {\\@link ParamMap}.\n *\n * \\@stable\n * @param {?} params\n * @return {?}\n */\nfunction convertToParamMap(params) {\n return new ParamsAsMap(params);\n}\nvar NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';\n/**\n * @param {?} message\n * @return {?}\n */\nfunction navigationCancelingError(message) {\n var /** @type {?} */ error = Error('NavigationCancelingError: ' + message);\n (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR] = true;\n return error;\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction isNavigationCancelingError(error) {\n return error && (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR];\n}\n/**\n * @param {?} segments\n * @param {?} segmentGroup\n * @param {?} route\n * @return {?}\n */\nfunction defaultUrlMatcher(segments, segmentGroup, route) {\n var /** @type {?} */ parts = /** @type {?} */ ((route.path)).split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var /** @type {?} */ posParams = {};\n // Check each config part against the actual URL\n for (var /** @type {?} */ index = 0; index < parts.length; index++) {\n var /** @type {?} */ part = parts[index];\n var /** @type {?} */ segment = segments[index];\n var /** @type {?} */ isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * See {\\@link Routes} for more details.\n * \\@stable\n * @record\n */\n\nvar LoadedRouterConfig = /** @class */ (function () {\n function LoadedRouterConfig(routes, module) {\n this.routes = routes;\n this.module = module;\n }\n return LoadedRouterConfig;\n}());\n/**\n * @param {?} config\n * @param {?=} parentPath\n * @return {?}\n */\nfunction validateConfig(config, parentPath) {\n if (parentPath === void 0) { parentPath = ''; }\n // forEach doesn't iterate undefined values\n for (var /** @type {?} */ i = 0; i < config.length; i++) {\n var /** @type {?} */ route = config[i];\n var /** @type {?} */ fullPath = getFullPath(parentPath, route);\n validateNode(route, fullPath);\n }\n}\n/**\n * @param {?} route\n * @param {?} fullPath\n * @return {?}\n */\nfunction validateNode(route, fullPath) {\n if (!route) {\n throw new Error(\"\\n Invalid configuration of route '\" + fullPath + \"': Encountered undefined route.\\n The reason might be an extra comma.\\n\\n Example:\\n const routes: Routes = [\\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\\n { path: 'dashboard', component: DashboardComponent },, << two commas\\n { path: 'detail/:id', component: HeroDetailComponent }\\n ];\\n \");\n }\n if (Array.isArray(route)) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': Array cannot be specified\");\n }\n if (!route.component && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': a componentless route cannot have a named outlet set\");\n }\n if (route.redirectTo && route.children) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and children cannot be used together\");\n }\n if (route.redirectTo && route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and loadChildren cannot be used together\");\n }\n if (route.children && route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': children and loadChildren cannot be used together\");\n }\n if (route.redirectTo && route.component) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': redirectTo and component cannot be used together\");\n }\n if (route.path && route.matcher) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': path and matcher cannot be used together\");\n }\n if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"'. One of the following must be provided: component, redirectTo, children or loadChildren\");\n }\n if (route.path === void 0 && route.matcher === void 0) {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': routes must have either a path or a matcher specified\");\n }\n if (typeof route.path === 'string' && route.path.charAt(0) === '/') {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': path cannot start with a slash\");\n }\n if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {\n var /** @type {?} */ exp = \"The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.\";\n throw new Error(\"Invalid configuration of route '{path: \\\"\" + fullPath + \"\\\", redirectTo: \\\"\" + route.redirectTo + \"\\\"}': please provide 'pathMatch'. \" + exp);\n }\n if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {\n throw new Error(\"Invalid configuration of route '\" + fullPath + \"': pathMatch can only be set to 'prefix' or 'full'\");\n }\n if (route.children) {\n validateConfig(route.children, fullPath);\n }\n}\n/**\n * @param {?} parentPath\n * @param {?} currentRoute\n * @return {?}\n */\nfunction getFullPath(parentPath, currentRoute) {\n if (!currentRoute) {\n return parentPath;\n }\n if (!parentPath && !currentRoute.path) {\n return '';\n }\n else if (parentPath && !currentRoute.path) {\n return parentPath + \"/\";\n }\n else if (!parentPath && currentRoute.path) {\n return currentRoute.path;\n }\n else {\n return parentPath + \"/\" + currentRoute.path;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction shallowEqualArrays(a, b) {\n if (a.length !== b.length)\n return false;\n for (var /** @type {?} */ i = 0; i < a.length; ++i) {\n if (!shallowEqual(a[i], b[i]))\n return false;\n }\n return true;\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction shallowEqual(a, b) {\n var /** @type {?} */ k1 = Object.keys(a);\n var /** @type {?} */ k2 = Object.keys(b);\n if (k1.length != k2.length) {\n return false;\n }\n var /** @type {?} */ key;\n for (var /** @type {?} */ i = 0; i < k1.length; i++) {\n key = k1[i];\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Flattens single-level nested arrays.\n * @template T\n * @param {?} arr\n * @return {?}\n */\nfunction flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n/**\n * Return the last element of an array.\n * @template T\n * @param {?} a\n * @return {?}\n */\nfunction last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}\n/**\n * Verifys all booleans in an array are `true`.\n * @param {?} bools\n * @return {?}\n */\n\n/**\n * @template K, V\n * @param {?} map\n * @param {?} callback\n * @return {?}\n */\nfunction forEach(map$$1, callback) {\n for (var /** @type {?} */ prop in map$$1) {\n if (map$$1.hasOwnProperty(prop)) {\n callback(map$$1[prop], prop);\n }\n }\n}\n/**\n * @template A, B\n * @param {?} obj\n * @param {?} fn\n * @return {?}\n */\nfunction waitForMap(obj, fn) {\n if (Object.keys(obj).length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({});\n }\n var /** @type {?} */ waitHead = [];\n var /** @type {?} */ waitTail = [];\n var /** @type {?} */ res = {};\n forEach(obj, function (a, k) {\n var /** @type {?} */ mapped = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(fn(k, a), function (r) { return res[k] = r; });\n if (k === PRIMARY_OUTLET) {\n waitHead.push(mapped);\n }\n else {\n waitTail.push(mapped);\n }\n });\n var /** @type {?} */ concat$ = __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__[\"concatAll\"].call(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"].apply(void 0, waitHead.concat(waitTail)));\n var /** @type {?} */ last$ = __WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__[\"last\"].call(concat$);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(last$, function () { return res; });\n}\n/**\n * ANDs Observables by merging all input observables, reducing to an Observable verifying all\n * input Observables return `true`.\n * @param {?} observables\n * @return {?}\n */\nfunction andObservables(observables) {\n var /** @type {?} */ merged$ = __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__[\"mergeAll\"].call(observables);\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(merged$, function (result) { return result === true; });\n}\n/**\n * @template T\n * @param {?} value\n * @return {?}\n */\nfunction wrapIntoObservable(value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisObservable\"])(value)) {\n return value;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵisPromise\"])(value)) {\n // Use `Promise.resolve()` to wrap promise-like instances.\n // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n // change detection.\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(Promise.resolve(value));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(/** @type {?} */ (value));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction createEmptyUrlTree() {\n return new UrlTree(new UrlSegmentGroup([], {}), {}, null);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @param {?} exact\n * @return {?}\n */\nfunction containsTree(container, containee, exact) {\n if (exact) {\n return equalQueryParams(container.queryParams, containee.queryParams) &&\n equalSegmentGroups(container.root, containee.root);\n }\n return containsQueryParams(container.queryParams, containee.queryParams) &&\n containsSegmentGroup(container.root, containee.root);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction equalQueryParams(container, containee) {\n return shallowEqual(container, containee);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction equalSegmentGroups(container, containee) {\n if (!equalPath(container.segments, containee.segments))\n return false;\n if (container.numberOfChildren !== containee.numberOfChildren)\n return false;\n for (var /** @type {?} */ c in containee.children) {\n if (!container.children[c])\n return false;\n if (!equalSegmentGroups(container.children[c], containee.children[c]))\n return false;\n }\n return true;\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction containsQueryParams(container, containee) {\n return Object.keys(containee).length <= Object.keys(container).length &&\n Object.keys(containee).every(function (key) { return containee[key] === container[key]; });\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @return {?}\n */\nfunction containsSegmentGroup(container, containee) {\n return containsSegmentGroupHelper(container, containee, containee.segments);\n}\n/**\n * @param {?} container\n * @param {?} containee\n * @param {?} containeePaths\n * @return {?}\n */\nfunction containsSegmentGroupHelper(container, containee, containeePaths) {\n if (container.segments.length > containeePaths.length) {\n var /** @type {?} */ current = container.segments.slice(0, containeePaths.length);\n if (!equalPath(current, containeePaths))\n return false;\n if (containee.hasChildren())\n return false;\n return true;\n }\n else if (container.segments.length === containeePaths.length) {\n if (!equalPath(container.segments, containeePaths))\n return false;\n for (var /** @type {?} */ c in containee.children) {\n if (!container.children[c])\n return false;\n if (!containsSegmentGroup(container.children[c], containee.children[c]))\n return false;\n }\n return true;\n }\n else {\n var /** @type {?} */ current = containeePaths.slice(0, container.segments.length);\n var /** @type {?} */ next = containeePaths.slice(container.segments.length);\n if (!equalPath(container.segments, current))\n return false;\n if (!container.children[PRIMARY_OUTLET])\n return false;\n return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next);\n }\n}\n/**\n * \\@whatItDoes Represents the parsed URL.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree =\n * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');\n * const f = tree.fragment; // return 'fragment'\n * const q = tree.queryParams; // returns {debug: 'true'}\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'\n * g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'\n * g.children['support'].segments; // return 1 segment 'help'\n * }\n * }\n * ```\n *\n * \\@description\n *\n * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a\n * serialized tree.\n * UrlTree is a data structure that provides a lot of affordances in dealing with URLs\n *\n * \\@stable\n */\nvar UrlTree = /** @class */ (function () {\n /** @internal */\n function UrlTree(root, queryParams, fragment) {\n this.root = root;\n this.queryParams = queryParams;\n this.fragment = fragment;\n }\n Object.defineProperty(UrlTree.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlTree.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return DEFAULT_SERIALIZER.serialize(this); };\n return UrlTree;\n}());\n/**\n * \\@whatItDoes Represents the parsed URL segment group.\n *\n * See {\\@link UrlTree} for more information.\n *\n * \\@stable\n */\nvar UrlSegmentGroup = /** @class */ (function () {\n function UrlSegmentGroup(segments, children) {\n var _this = this;\n this.segments = segments;\n this.children = children;\n /**\n * The parent node in the url tree\n */\n this.parent = null;\n forEach(children, function (v, k) { return v.parent = _this; });\n }\n /** Whether the segment has child segments */\n /**\n * Whether the segment has child segments\n * @return {?}\n */\n UrlSegmentGroup.prototype.hasChildren = /**\n * Whether the segment has child segments\n * @return {?}\n */\n function () { return this.numberOfChildren > 0; };\n Object.defineProperty(UrlSegmentGroup.prototype, \"numberOfChildren\", {\n /** Number of child segments */\n get: /**\n * Number of child segments\n * @return {?}\n */\n function () { return Object.keys(this.children).length; },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlSegmentGroup.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return serializePaths(this); };\n return UrlSegmentGroup;\n}());\n/**\n * \\@whatItDoes Represents a single URL segment.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree = router.parseUrl('/team;id=33');\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments;\n * s[0].path; // returns 'team'\n * s[0].parameters; // returns {id: 33}\n * }\n * }\n * ```\n *\n * \\@description\n *\n * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix\n * parameters associated with the segment.\n *\n * \\@stable\n */\nvar UrlSegment = /** @class */ (function () {\n function UrlSegment(path, parameters) {\n this.path = path;\n this.parameters = parameters;\n }\n Object.defineProperty(UrlSegment.prototype, \"parameterMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._parameterMap) {\n this._parameterMap = convertToParamMap(this.parameters);\n }\n return this._parameterMap;\n },\n enumerable: true,\n configurable: true\n });\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n UrlSegment.prototype.toString = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return serializePath(this); };\n return UrlSegment;\n}());\n/**\n * @param {?} as\n * @param {?} bs\n * @return {?}\n */\nfunction equalSegments(as, bs) {\n return equalPath(as, bs) && as.every(function (a, i) { return shallowEqual(a.parameters, bs[i].parameters); });\n}\n/**\n * @param {?} as\n * @param {?} bs\n * @return {?}\n */\nfunction equalPath(as, bs) {\n if (as.length !== bs.length)\n return false;\n return as.every(function (a, i) { return a.path === bs[i].path; });\n}\n/**\n * @template T\n * @param {?} segment\n * @param {?} fn\n * @return {?}\n */\nfunction mapChildrenIntoArray(segment, fn) {\n var /** @type {?} */ res = [];\n forEach(segment.children, function (child, childOutlet) {\n if (childOutlet === PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n forEach(segment.children, function (child, childOutlet) {\n if (childOutlet !== PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n return res;\n}\n/**\n * \\@whatItDoes Serializes and deserializes a URL string into a URL tree.\n *\n * \\@description The url serialization strategy is customizable. You can\n * make all URLs case insensitive by providing a custom UrlSerializer.\n *\n * See {\\@link DefaultUrlSerializer} for an example of a URL serializer.\n *\n * \\@stable\n * @abstract\n */\nvar UrlSerializer = /** @class */ (function () {\n function UrlSerializer() {\n }\n return UrlSerializer;\n}());\n/**\n * \\@whatItDoes A default implementation of the {\\@link UrlSerializer}.\n *\n * \\@description\n *\n * Example URLs:\n *\n * ```\n * /inbox/33(popup:compose)\n * /inbox/33;open=true/messages/44\n * ```\n *\n * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the\n * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to\n * specify route specific parameters.\n *\n * \\@stable\n */\nvar DefaultUrlSerializer = /** @class */ (function () {\n function DefaultUrlSerializer() {\n }\n /** Parses a url into a {@link UrlTree} */\n /**\n * Parses a url into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n DefaultUrlSerializer.prototype.parse = /**\n * Parses a url into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n };\n /** Converts a {@link UrlTree} into a url */\n /**\n * Converts a {\\@link UrlTree} into a url\n * @param {?} tree\n * @return {?}\n */\n DefaultUrlSerializer.prototype.serialize = /**\n * Converts a {\\@link UrlTree} into a url\n * @param {?} tree\n * @return {?}\n */\n function (tree) {\n var /** @type {?} */ segment = \"/\" + serializeSegment(tree.root, true);\n var /** @type {?} */ query = serializeQueryParams(tree.queryParams);\n var /** @type {?} */ fragment = typeof tree.fragment === \"string\" ? \"#\" + encodeURI((/** @type {?} */ ((tree.fragment)))) : '';\n return \"\" + segment + query + fragment;\n };\n return DefaultUrlSerializer;\n}());\nvar DEFAULT_SERIALIZER = new DefaultUrlSerializer();\n/**\n * @param {?} segment\n * @return {?}\n */\nfunction serializePaths(segment) {\n return segment.segments.map(function (p) { return serializePath(p); }).join('/');\n}\n/**\n * @param {?} segment\n * @param {?} root\n * @return {?}\n */\nfunction serializeSegment(segment, root) {\n if (!segment.hasChildren()) {\n return serializePaths(segment);\n }\n if (root) {\n var /** @type {?} */ primary = segment.children[PRIMARY_OUTLET] ?\n serializeSegment(segment.children[PRIMARY_OUTLET], false) :\n '';\n var /** @type {?} */ children_1 = [];\n forEach(segment.children, function (v, k) {\n if (k !== PRIMARY_OUTLET) {\n children_1.push(k + \":\" + serializeSegment(v, false));\n }\n });\n return children_1.length > 0 ? primary + \"(\" + children_1.join('//') + \")\" : primary;\n }\n else {\n var /** @type {?} */ children = mapChildrenIntoArray(segment, function (v, k) {\n if (k === PRIMARY_OUTLET) {\n return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];\n }\n return [k + \":\" + serializeSegment(v, false)];\n });\n return serializePaths(segment) + \"/(\" + children.join('//') + \")\";\n }\n}\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"\\@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n * @param {?} s\n * @return {?}\n */\nfunction encode(s) {\n return encodeURIComponent(s)\n .replace(/%40/g, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';');\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction decode(s) {\n return decodeURIComponent(s);\n}\n/**\n * @param {?} path\n * @return {?}\n */\nfunction serializePath(path) {\n return \"\" + encode(path.path) + serializeParams(path.parameters);\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction serializeParams(params) {\n return Object.keys(params).map(function (key) { return \";\" + encode(key) + \"=\" + encode(params[key]); }).join('');\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction serializeQueryParams(params) {\n var /** @type {?} */ strParams = Object.keys(params).map(function (name) {\n var /** @type {?} */ value = params[name];\n return Array.isArray(value) ? value.map(function (v) { return encode(name) + \"=\" + encode(v); }).join('&') :\n encode(name) + \"=\" + encode(value);\n });\n return strParams.length ? \"?\" + strParams.join(\"&\") : '';\n}\nvar SEGMENT_RE = /^[^\\/()?;=&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchSegments(str) {\n var /** @type {?} */ match = str.match(SEGMENT_RE);\n return match ? match[0] : '';\n}\nvar QUERY_PARAM_RE = /^[^=?&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchQueryParams(str) {\n var /** @type {?} */ match = str.match(QUERY_PARAM_RE);\n return match ? match[0] : '';\n}\nvar QUERY_PARAM_VALUE_RE = /^[^?&#]+/;\n/**\n * @param {?} str\n * @return {?}\n */\nfunction matchUrlQueryParamValue(str) {\n var /** @type {?} */ match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}\nvar UrlParser = /** @class */ (function () {\n function UrlParser(url) {\n this.url = url;\n this.remaining = url;\n }\n /**\n * @return {?}\n */\n UrlParser.prototype.parseRootSegment = /**\n * @return {?}\n */\n function () {\n this.consumeOptional('/');\n if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {\n return new UrlSegmentGroup([], {});\n }\n // The root segment group never has segments\n return new UrlSegmentGroup([], this.parseChildren());\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseQueryParams = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ params = {};\n if (this.consumeOptional('?')) {\n do {\n this.parseQueryParam(params);\n } while (this.consumeOptional('&'));\n }\n return params;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseFragment = /**\n * @return {?}\n */\n function () {\n return this.consumeOptional('#') ? decodeURI(this.remaining) : null;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseChildren = /**\n * @return {?}\n */\n function () {\n if (this.remaining === '') {\n return {};\n }\n this.consumeOptional('/');\n var /** @type {?} */ segments = [];\n if (!this.peekStartsWith('(')) {\n segments.push(this.parseSegment());\n }\n while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {\n this.capture('/');\n segments.push(this.parseSegment());\n }\n var /** @type {?} */ children = {};\n if (this.peekStartsWith('/(')) {\n this.capture('/');\n children = this.parseParens(true);\n }\n var /** @type {?} */ res = {};\n if (this.peekStartsWith('(')) {\n res = this.parseParens(false);\n }\n if (segments.length > 0 || Object.keys(children).length > 0) {\n res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);\n }\n return res;\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseSegment = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(\"Empty path url segment cannot have parameters: '\" + this.remaining + \"'.\");\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n };\n /**\n * @return {?}\n */\n UrlParser.prototype.parseMatrixParams = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ params = {};\n while (this.consumeOptional(';')) {\n this.parseParam(params);\n }\n return params;\n };\n /**\n * @param {?} params\n * @return {?}\n */\n UrlParser.prototype.parseParam = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n var /** @type {?} */ key = matchSegments(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n var /** @type {?} */ value = '';\n if (this.consumeOptional('=')) {\n var /** @type {?} */ valueMatch = matchSegments(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n params[decode(key)] = decode(value);\n };\n /**\n * @param {?} params\n * @return {?}\n */\n UrlParser.prototype.parseQueryParam = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n var /** @type {?} */ key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n var /** @type {?} */ value = '';\n if (this.consumeOptional('=')) {\n var /** @type {?} */ valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n var /** @type {?} */ decodedKey = decode(key);\n var /** @type {?} */ decodedVal = decode(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n var /** @type {?} */ currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n };\n /**\n * @param {?} allowPrimary\n * @return {?}\n */\n UrlParser.prototype.parseParens = /**\n * @param {?} allowPrimary\n * @return {?}\n */\n function (allowPrimary) {\n var /** @type {?} */ segments = {};\n this.capture('(');\n while (!this.consumeOptional(')') && this.remaining.length > 0) {\n var /** @type {?} */ path = matchSegments(this.remaining);\n var /** @type {?} */ next = this.remaining[path.length];\n // if is is not one of these characters, then the segment was unescaped\n // or the group was not closed\n if (next !== '/' && next !== ')' && next !== ';') {\n throw new Error(\"Cannot parse url '\" + this.url + \"'\");\n }\n var /** @type {?} */ outletName = /** @type {?} */ ((undefined));\n if (path.indexOf(':') > -1) {\n outletName = path.substr(0, path.indexOf(':'));\n this.capture(outletName);\n this.capture(':');\n }\n else if (allowPrimary) {\n outletName = PRIMARY_OUTLET;\n }\n var /** @type {?} */ children = this.parseChildren();\n segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :\n new UrlSegmentGroup([], children);\n this.consumeOptional('//');\n }\n return segments;\n };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.peekStartsWith = /**\n * @param {?} str\n * @return {?}\n */\n function (str) { return this.remaining.startsWith(str); };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.consumeOptional = /**\n * @param {?} str\n * @return {?}\n */\n function (str) {\n if (this.peekStartsWith(str)) {\n this.remaining = this.remaining.substring(str.length);\n return true;\n }\n return false;\n };\n /**\n * @param {?} str\n * @return {?}\n */\n UrlParser.prototype.capture = /**\n * @param {?} str\n * @return {?}\n */\n function (str) {\n if (!this.consumeOptional(str)) {\n throw new Error(\"Expected \\\"\" + str + \"\\\".\");\n }\n };\n return UrlParser;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NoMatch = /** @class */ (function () {\n function NoMatch(segmentGroup) {\n this.segmentGroup = segmentGroup || null;\n }\n return NoMatch;\n}());\nvar AbsoluteRedirect = /** @class */ (function () {\n function AbsoluteRedirect(urlTree) {\n this.urlTree = urlTree;\n }\n return AbsoluteRedirect;\n}());\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction noMatch(segmentGroup) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(new NoMatch(segmentGroup)); });\n}\n/**\n * @param {?} newTree\n * @return {?}\n */\nfunction absoluteRedirect(newTree) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(new AbsoluteRedirect(newTree)); });\n}\n/**\n * @param {?} redirectTo\n * @return {?}\n */\nfunction namedOutletsRedirect(redirectTo) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) {\n return obs.error(new Error(\"Only absolute redirects can have named outlets. redirectTo: '\" + redirectTo + \"'\"));\n });\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction canLoadFails(route) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) {\n return obs.error(navigationCancelingError(\"Cannot load children because the guard of the route \\\"path: '\" + route.path + \"'\\\" returned false\"));\n });\n}\n/**\n * Returns the `UrlTree` with the redirection applied.\n *\n * Lazy modules are loaded along the way.\n * @param {?} moduleInjector\n * @param {?} configLoader\n * @param {?} urlSerializer\n * @param {?} urlTree\n * @param {?} config\n * @return {?}\n */\nfunction applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n}\nvar ApplyRedirects = /** @class */ (function () {\n function ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n this.configLoader = configLoader;\n this.urlSerializer = urlSerializer;\n this.urlTree = urlTree;\n this.config = config;\n this.allowRedirects = true;\n this.ngModule = moduleInjector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n }\n /**\n * @return {?}\n */\n ApplyRedirects.prototype.apply = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ expanded$ = this.expandSegmentGroup(this.ngModule, this.config, this.urlTree.root, PRIMARY_OUTLET);\n var /** @type {?} */ urlTrees$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (rootSegmentGroup) {\n return _this.createUrlTree(rootSegmentGroup, _this.urlTree.queryParams, /** @type {?} */ ((_this.urlTree.fragment)));\n });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(urlTrees$, function (e) {\n if (e instanceof AbsoluteRedirect) {\n // after an absolute redirect we do not apply any more redirects!\n // after an absolute redirect we do not apply any more redirects!\n _this.allowRedirects = false;\n // we need to run matching, so we can fetch all lazy-loaded modules\n return _this.match(e.urlTree);\n }\n if (e instanceof NoMatch) {\n throw _this.noMatchError(e);\n }\n throw e;\n });\n };\n /**\n * @param {?} tree\n * @return {?}\n */\n ApplyRedirects.prototype.match = /**\n * @param {?} tree\n * @return {?}\n */\n function (tree) {\n var _this = this;\n var /** @type {?} */ expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);\n var /** @type {?} */ mapped$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (rootSegmentGroup) {\n return _this.createUrlTree(rootSegmentGroup, tree.queryParams, /** @type {?} */ ((tree.fragment)));\n });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(mapped$, function (e) {\n if (e instanceof NoMatch) {\n throw _this.noMatchError(e);\n }\n throw e;\n });\n };\n /**\n * @param {?} e\n * @return {?}\n */\n ApplyRedirects.prototype.noMatchError = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return new Error(\"Cannot match any routes. URL Segment: '\" + e.segmentGroup + \"'\");\n };\n /**\n * @param {?} rootCandidate\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\n ApplyRedirects.prototype.createUrlTree = /**\n * @param {?} rootCandidate\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\n function (rootCandidate, queryParams, fragment) {\n var /** @type {?} */ root = rootCandidate.segments.length > 0 ?\n new UrlSegmentGroup([], (_a = {}, _a[PRIMARY_OUTLET] = rootCandidate, _a)) :\n rootCandidate;\n return new UrlTree(root, queryParams, fragment);\n var _a;\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentGroup = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, routes, segmentGroup, outlet) {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.expandChildren(ngModule, routes, segmentGroup), function (children) { return new UrlSegmentGroup([], children); });\n }\n return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @return {?}\n */\n ApplyRedirects.prototype.expandChildren = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} segmentGroup\n * @return {?}\n */\n function (ngModule, routes, segmentGroup) {\n var _this = this;\n return waitForMap(segmentGroup.children, function (childOutlet, child) { return _this.expandSegmentGroup(ngModule, routes, child, childOutlet); });\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} segments\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegment = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} segments\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {\n var _this = this;\n var /** @type {?} */ routes$ = __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"].apply(void 0, routes);\n var /** @type {?} */ processedRoutes$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(routes$, function (r) {\n var /** @type {?} */ expanded$ = _this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(expanded$, function (e) {\n if (e instanceof NoMatch) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null);\n }\n throw e;\n });\n });\n var /** @type {?} */ concattedProcessedRoutes$ = __WEBPACK_IMPORTED_MODULE_12_rxjs_operator_concatAll__[\"concatAll\"].call(processedRoutes$);\n var /** @type {?} */ first$ = __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(concattedProcessedRoutes$, function (s) { return !!s; });\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(first$, function (e, _) {\n if (e instanceof __WEBPACK_IMPORTED_MODULE_14_rxjs_util_EmptyError__[\"EmptyError\"] || e.name === 'EmptyError') {\n if (_this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup([], {}));\n }\n throw new NoMatch(segmentGroup);\n }\n throw e;\n });\n };\n /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.noLeftoversInUrl = /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (segmentGroup, segments, outlet) {\n return segments.length === 0 && !segmentGroup.children[outlet];\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} paths\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentAgainstRoute = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} paths\n * @param {?} outlet\n * @param {?} allowRedirects\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {\n if (getOutlet(route) !== outlet) {\n return noMatch(segmentGroup);\n }\n if (route.redirectTo === undefined) {\n return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths);\n }\n if (allowRedirects && this.allowRedirects) {\n return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);\n }\n return noMatch(segmentGroup);\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, segments, outlet) {\n if (route.path === '**') {\n return this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet);\n }\n return this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet);\n };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} route\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} routes\n * @param {?} route\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, routes, route, outlet) {\n var _this = this;\n var /** @type {?} */ newTree = this.applyRedirectCommands([], /** @type {?} */ ((route.redirectTo)), {});\n if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(this.lineralizeSegments(route, newTree), function (newSegments) {\n var /** @type {?} */ group = new UrlSegmentGroup(newSegments, {});\n return _this.expandSegment(ngModule, group, routes, newSegments, outlet, false);\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect = /**\n * @param {?} ngModule\n * @param {?} segmentGroup\n * @param {?} routes\n * @param {?} route\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (ngModule, segmentGroup, routes, route, segments, outlet) {\n var _this = this;\n var _a = match(segmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild, positionalParamSegments = _a.positionalParamSegments;\n if (!matched)\n return noMatch(segmentGroup);\n var /** @type {?} */ newTree = this.applyRedirectCommands(consumedSegments, /** @type {?} */ ((route.redirectTo)), /** @type {?} */ (positionalParamSegments));\n if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(this.lineralizeSegments(route, newTree), function (newSegments) {\n return _this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} rawSegmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\n ApplyRedirects.prototype.matchSegmentAgainstRoute = /**\n * @param {?} ngModule\n * @param {?} rawSegmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\n function (ngModule, rawSegmentGroup, route, segments) {\n var _this = this;\n if (route.path === '**') {\n if (route.loadChildren) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.configLoader.load(ngModule.injector, route), function (cfg) {\n route._loadedConfig = cfg;\n return new UrlSegmentGroup(segments, {});\n });\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup(segments, {}));\n }\n var _a = match(rawSegmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild;\n if (!matched)\n return noMatch(rawSegmentGroup);\n var /** @type {?} */ rawSlicedSegments = segments.slice(lastChild);\n var /** @type {?} */ childConfig$ = this.getChildConfig(ngModule, route);\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(childConfig$, function (routerConfig) {\n var /** @type {?} */ childModule = routerConfig.module;\n var /** @type {?} */ childConfig = routerConfig.routes;\n var _a = split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n var /** @type {?} */ expanded$_1 = _this.expandChildren(childModule, childConfig, segmentGroup);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$_1, function (children) { return new UrlSegmentGroup(consumedSegments, children); });\n }\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new UrlSegmentGroup(consumedSegments, {}));\n }\n var /** @type {?} */ expanded$ = _this.expandSegment(childModule, segmentGroup, childConfig, slicedSegments, PRIMARY_OUTLET, true);\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(expanded$, function (cs) {\n return new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children);\n });\n });\n };\n /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n ApplyRedirects.prototype.getChildConfig = /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n function (ngModule, route) {\n var _this = this;\n if (route.children) {\n // The children belong to the same module\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new LoadedRouterConfig(route.children, ngModule));\n }\n if (route.loadChildren) {\n // lazy children belong to the loaded module\n if (route._loadedConfig !== undefined) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(route._loadedConfig);\n }\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(runCanLoadGuard(ngModule.injector, route), function (shouldLoad) {\n if (shouldLoad) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.configLoader.load(ngModule.injector, route), function (cfg) {\n route._loadedConfig = cfg;\n return cfg;\n });\n }\n return canLoadFails(route);\n });\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(new LoadedRouterConfig([], ngModule));\n };\n /**\n * @param {?} route\n * @param {?} urlTree\n * @return {?}\n */\n ApplyRedirects.prototype.lineralizeSegments = /**\n * @param {?} route\n * @param {?} urlTree\n * @return {?}\n */\n function (route, urlTree) {\n var /** @type {?} */ res = [];\n var /** @type {?} */ c = urlTree.root;\n while (true) {\n res = res.concat(c.segments);\n if (c.numberOfChildren === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(res);\n }\n if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {\n return namedOutletsRedirect(/** @type {?} */ ((route.redirectTo)));\n }\n c = c.children[PRIMARY_OUTLET];\n }\n };\n /**\n * @param {?} segments\n * @param {?} redirectTo\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.applyRedirectCommands = /**\n * @param {?} segments\n * @param {?} redirectTo\n * @param {?} posParams\n * @return {?}\n */\n function (segments, redirectTo, posParams) {\n return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);\n };\n /**\n * @param {?} redirectTo\n * @param {?} urlTree\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.applyRedirectCreatreUrlTree = /**\n * @param {?} redirectTo\n * @param {?} urlTree\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, urlTree, segments, posParams) {\n var /** @type {?} */ newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);\n return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);\n };\n /**\n * @param {?} redirectToParams\n * @param {?} actualParams\n * @return {?}\n */\n ApplyRedirects.prototype.createQueryParams = /**\n * @param {?} redirectToParams\n * @param {?} actualParams\n * @return {?}\n */\n function (redirectToParams, actualParams) {\n var /** @type {?} */ res = {};\n forEach(redirectToParams, function (v, k) {\n var /** @type {?} */ copySourceValue = typeof v === 'string' && v.startsWith(':');\n if (copySourceValue) {\n var /** @type {?} */ sourceName = v.substring(1);\n res[k] = actualParams[sourceName];\n }\n else {\n res[k] = v;\n }\n });\n return res;\n };\n /**\n * @param {?} redirectTo\n * @param {?} group\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.createSegmentGroup = /**\n * @param {?} redirectTo\n * @param {?} group\n * @param {?} segments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, group, segments, posParams) {\n var _this = this;\n var /** @type {?} */ updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);\n var /** @type {?} */ children = {};\n forEach(group.children, function (child, name) {\n children[name] = _this.createSegmentGroup(redirectTo, child, segments, posParams);\n });\n return new UrlSegmentGroup(updatedSegments, children);\n };\n /**\n * @param {?} redirectTo\n * @param {?} redirectToSegments\n * @param {?} actualSegments\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.createSegments = /**\n * @param {?} redirectTo\n * @param {?} redirectToSegments\n * @param {?} actualSegments\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, redirectToSegments, actualSegments, posParams) {\n var _this = this;\n return redirectToSegments.map(function (s) {\n return s.path.startsWith(':') ? _this.findPosParam(redirectTo, s, posParams) :\n _this.findOrReturn(s, actualSegments);\n });\n };\n /**\n * @param {?} redirectTo\n * @param {?} redirectToUrlSegment\n * @param {?} posParams\n * @return {?}\n */\n ApplyRedirects.prototype.findPosParam = /**\n * @param {?} redirectTo\n * @param {?} redirectToUrlSegment\n * @param {?} posParams\n * @return {?}\n */\n function (redirectTo, redirectToUrlSegment, posParams) {\n var /** @type {?} */ pos = posParams[redirectToUrlSegment.path.substring(1)];\n if (!pos)\n throw new Error(\"Cannot redirect to '\" + redirectTo + \"'. Cannot find '\" + redirectToUrlSegment.path + \"'.\");\n return pos;\n };\n /**\n * @param {?} redirectToUrlSegment\n * @param {?} actualSegments\n * @return {?}\n */\n ApplyRedirects.prototype.findOrReturn = /**\n * @param {?} redirectToUrlSegment\n * @param {?} actualSegments\n * @return {?}\n */\n function (redirectToUrlSegment, actualSegments) {\n var /** @type {?} */ idx = 0;\n for (var _i = 0, actualSegments_1 = actualSegments; _i < actualSegments_1.length; _i++) {\n var s = actualSegments_1[_i];\n if (s.path === redirectToUrlSegment.path) {\n actualSegments.splice(idx);\n return s;\n }\n idx++;\n }\n return redirectToUrlSegment;\n };\n return ApplyRedirects;\n}());\n/**\n * @param {?} moduleInjector\n * @param {?} route\n * @return {?}\n */\nfunction runCanLoadGuard(moduleInjector, route) {\n var /** @type {?} */ canLoad = route.canLoad;\n if (!canLoad || canLoad.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canLoad), function (injectionToken) {\n var /** @type {?} */ guard = moduleInjector.get(injectionToken);\n return wrapIntoObservable(guard.canLoad ? guard.canLoad(route) : guard(route));\n });\n return andObservables(obs);\n}\n/**\n * @param {?} segmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\nfunction match(segmentGroup, route, segments) {\n if (route.path === '') {\n if ((route.pathMatch === 'full') && (segmentGroup.hasChildren() || segments.length > 0)) {\n return { matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };\n }\n return { matched: true, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };\n }\n var /** @type {?} */ matcher = route.matcher || defaultUrlMatcher;\n var /** @type {?} */ res = matcher(segments, segmentGroup, route);\n if (!res) {\n return {\n matched: false,\n consumedSegments: /** @type {?} */ ([]),\n lastChild: 0,\n positionalParamSegments: {},\n };\n }\n return {\n matched: true,\n consumedSegments: /** @type {?} */ ((res.consumed)),\n lastChild: /** @type {?} */ ((res.consumed.length)),\n positionalParamSegments: /** @type {?} */ ((res.posParams)),\n };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} slicedSegments\n * @param {?} config\n * @return {?}\n */\nfunction split(segmentGroup, consumedSegments, slicedSegments, config) {\n if (slicedSegments.length > 0 &&\n containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptySegments(config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n return { segmentGroup: mergeTrivialChildren(s), slicedSegments: [] };\n }\n if (slicedSegments.length === 0 &&\n containsEmptyPathRedirects(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s = new UrlSegmentGroup(segmentGroup.segments, addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));\n return { segmentGroup: mergeTrivialChildren(s), slicedSegments: slicedSegments };\n }\n return { segmentGroup: segmentGroup, slicedSegments: slicedSegments };\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction mergeTrivialChildren(s) {\n if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {\n var /** @type {?} */ c = s.children[PRIMARY_OUTLET];\n return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);\n }\n return s;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @param {?} children\n * @return {?}\n */\nfunction addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {\n var /** @type {?} */ res = {};\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var r = routes_1[_i];\n if (isEmptyPathRedirect(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, children, res);\n}\n/**\n * @param {?} routes\n * @param {?} primarySegmentGroup\n * @return {?}\n */\nfunction createChildrenForEmptySegments(routes, primarySegmentGroup) {\n var /** @type {?} */ res = {};\n res[PRIMARY_OUTLET] = primarySegmentGroup;\n for (var _i = 0, routes_2 = routes; _i < routes_2.length; _i++) {\n var r = routes_2[_i];\n if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return res;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, segments, routes) {\n return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r) && getOutlet(r) !== PRIMARY_OUTLET; });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathRedirects(segmentGroup, segments, routes) {\n return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r); });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} r\n * @return {?}\n */\nfunction isEmptyPathRedirect(segmentGroup, segments, r) {\n if ((segmentGroup.hasChildren() || segments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n return r.path === '' && r.redirectTo !== undefined;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getOutlet(route) {\n return route.outlet || PRIMARY_OUTLET;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar Tree = /** @class */ (function () {\n function Tree(root) {\n this._root = root;\n }\n Object.defineProperty(Tree.prototype, \"root\", {\n get: /**\n * @return {?}\n */\n function () { return this._root.value; },\n enumerable: true,\n configurable: true\n });\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.parent = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ p = this.pathFromRoot(t);\n return p.length > 1 ? p[p.length - 2] : null;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.children = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ n = findNode(t, this._root);\n return n ? n.children.map(function (t) { return t.value; }) : [];\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.firstChild = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ n = findNode(t, this._root);\n return n && n.children.length > 0 ? n.children[0].value : null;\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.siblings = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) {\n var /** @type {?} */ p = findPath(t, this._root);\n if (p.length < 2)\n return [];\n var /** @type {?} */ c = p[p.length - 2].children.map(function (c) { return c.value; });\n return c.filter(function (cc) { return cc !== t; });\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n Tree.prototype.pathFromRoot = /**\n * \\@internal\n * @param {?} t\n * @return {?}\n */\n function (t) { return findPath(t, this._root).map(function (s) { return s.value; }); };\n return Tree;\n}());\n/**\n * @template T\n * @param {?} value\n * @param {?} node\n * @return {?}\n */\nfunction findNode(value, node) {\n if (value === node.value)\n return node;\n for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n var child = _a[_i];\n var /** @type {?} */ node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n return null;\n}\n/**\n * @template T\n * @param {?} value\n * @param {?} node\n * @return {?}\n */\nfunction findPath(value, node) {\n if (value === node.value)\n return [node];\n for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n var child = _a[_i];\n var /** @type {?} */ path = findPath(value, child);\n if (path.length) {\n path.unshift(node);\n return path;\n }\n }\n return [];\n}\nvar TreeNode = /** @class */ (function () {\n function TreeNode(value, children) {\n this.value = value;\n this.children = children;\n }\n /**\n * @return {?}\n */\n TreeNode.prototype.toString = /**\n * @return {?}\n */\n function () { return \"TreeNode(\" + this.value + \")\"; };\n return TreeNode;\n}());\n/**\n * @template T\n * @param {?} node\n * @return {?}\n */\nfunction nodeChildrenAsMap(node) {\n var /** @type {?} */ map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Represents the state of the router.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const root: ActivatedRoute = state.root;\n * const child = root.firstChild;\n * const id: Observable<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * \\@description\n * RouterState is a tree of activated routes. Every node in this tree knows about the \"consumed\" URL\n * segments, the extracted parameters, and the resolved data.\n *\n * See {\\@link ActivatedRoute} for more information.\n *\n * \\@stable\n */\nvar RouterState = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RouterState, _super);\n /** @internal */\n function RouterState(root, snapshot) {\n var _this = _super.call(this, root) || this;\n _this.snapshot = snapshot;\n setRouterState(/** @type {?} */ (_this), root);\n return _this;\n }\n /**\n * @return {?}\n */\n RouterState.prototype.toString = /**\n * @return {?}\n */\n function () { return this.snapshot.toString(); };\n return RouterState;\n}(Tree));\n/**\n * @param {?} urlTree\n * @param {?} rootComponent\n * @return {?}\n */\nfunction createEmptyState(urlTree, rootComponent) {\n var /** @type {?} */ snapshot = createEmptyStateSnapshot(urlTree, rootComponent);\n var /** @type {?} */ emptyUrl = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]([new UrlSegment('', {})]);\n var /** @type {?} */ emptyParams = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ emptyData = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ emptyQueryParams = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]({});\n var /** @type {?} */ fragment = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"]('');\n var /** @type {?} */ activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root);\n activated.snapshot = snapshot.root;\n return new RouterState(new TreeNode(activated, []), snapshot);\n}\n/**\n * @param {?} urlTree\n * @param {?} rootComponent\n * @return {?}\n */\nfunction createEmptyStateSnapshot(urlTree, rootComponent) {\n var /** @type {?} */ emptyParams = {};\n var /** @type {?} */ emptyData = {};\n var /** @type {?} */ emptyQueryParams = {};\n var /** @type {?} */ fragment = '';\n var /** @type {?} */ activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {});\n return new RouterStateSnapshot('', new TreeNode(activated, []));\n}\n/**\n * \\@whatItDoes Contains the information about a route associated with a component loaded in an\n * outlet.\n * An `ActivatedRoute` can also be used to traverse the router state tree.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({...})\n * class MyComponent {\n * constructor(route: ActivatedRoute) {\n * const id: Observable<string> = route.params.map(p => p.id);\n * const url: Observable<string> = route.url.map(segments => segments.join(''));\n * // route.data includes both `data` and `resolve`\n * const user = route.data.map(d => d.user);\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar ActivatedRoute = /** @class */ (function () {\n /** @internal */\n function ActivatedRoute(url, params, queryParams, fragment, data, outlet, component, futureSnapshot) {\n this.url = url;\n this.params = params;\n this.queryParams = queryParams;\n this.fragment = fragment;\n this.data = data;\n this.outlet = outlet;\n this.component = component;\n this._futureSnapshot = futureSnapshot;\n }\n Object.defineProperty(ActivatedRoute.prototype, \"routeConfig\", {\n /** The configuration used to match this route */\n get: /**\n * The configuration used to match this route\n * @return {?}\n */\n function () { return this._futureSnapshot.routeConfig; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"root\", {\n /** The root of the router state */\n get: /**\n * The root of the router state\n * @return {?}\n */\n function () { return this._routerState.root; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"parent\", {\n /** The parent of this route in the router state tree */\n get: /**\n * The parent of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.parent(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"firstChild\", {\n /** The first child of this route in the router state tree */\n get: /**\n * The first child of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.firstChild(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"children\", {\n /** The children of this route in the router state tree */\n get: /**\n * The children of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.children(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"pathFromRoot\", {\n /** The path from the root of the router state tree to this route */\n get: /**\n * The path from the root of the router state tree to this route\n * @return {?}\n */\n function () { return this._routerState.pathFromRoot(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"paramMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._paramMap) {\n this._paramMap = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.params, function (p) { return convertToParamMap(p); });\n }\n return this._paramMap;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRoute.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap =\n __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.queryParams, function (p) { return convertToParamMap(p); });\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n ActivatedRoute.prototype.toString = /**\n * @return {?}\n */\n function () {\n return this.snapshot ? this.snapshot.toString() : \"Future(\" + this._futureSnapshot + \")\";\n };\n return ActivatedRoute;\n}());\n/**\n * Returns the inherited params, data, and resolve for a given route.\n * By default, this only inherits values up to the nearest path-less or component-less route.\n * \\@internal\n * @param {?} route\n * @param {?=} paramsInheritanceStrategy\n * @return {?}\n */\nfunction inheritedParamsDataResolve(route, paramsInheritanceStrategy) {\n if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }\n var /** @type {?} */ pathFromRoot = route.pathFromRoot;\n var /** @type {?} */ inheritingStartingFrom = 0;\n if (paramsInheritanceStrategy !== 'always') {\n inheritingStartingFrom = pathFromRoot.length - 1;\n while (inheritingStartingFrom >= 1) {\n var /** @type {?} */ current = pathFromRoot[inheritingStartingFrom];\n var /** @type {?} */ parent_1 = pathFromRoot[inheritingStartingFrom - 1];\n // current route is an empty path => inherits its parent's params and data\n if (current.routeConfig && current.routeConfig.path === '') {\n inheritingStartingFrom--;\n // parent is componentless => current route should inherit its params and data\n }\n else if (!parent_1.component) {\n inheritingStartingFrom--;\n }\n else {\n break;\n }\n }\n }\n return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));\n}\n/**\n * \\@internal\n * @param {?} pathFromRoot\n * @return {?}\n */\nfunction flattenInherited(pathFromRoot) {\n return pathFromRoot.reduce(function (res, curr) {\n var /** @type {?} */ params = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.params, curr.params);\n var /** @type {?} */ data = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.data, curr.data);\n var /** @type {?} */ resolve = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, res.resolve, curr._resolvedData);\n return { params: params, data: data, resolve: resolve };\n }, /** @type {?} */ ({ params: {}, data: {}, resolve: {} }));\n}\n/**\n * \\@whatItDoes Contains the information about a route associated with a component loaded in an\n * outlet\n * at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router\n * state tree.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'./my-component.html'})\n * class MyComponent {\n * constructor(route: ActivatedRoute) {\n * const id: string = route.snapshot.params.id;\n * const url: string = route.snapshot.url.join('');\n * const user = route.snapshot.data.user;\n * }\n * }\n * ```\n *\n * \\@stable\n */\nvar ActivatedRouteSnapshot = /** @class */ (function () {\n /** @internal */\n function ActivatedRouteSnapshot(url, params, queryParams, fragment, data, outlet, component, routeConfig, urlSegment, lastPathIndex, resolve) {\n this.url = url;\n this.params = params;\n this.queryParams = queryParams;\n this.fragment = fragment;\n this.data = data;\n this.outlet = outlet;\n this.component = component;\n this.routeConfig = routeConfig;\n this._urlSegment = urlSegment;\n this._lastPathIndex = lastPathIndex;\n this._resolve = resolve;\n }\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"root\", {\n /** The root of the router state */\n get: /**\n * The root of the router state\n * @return {?}\n */\n function () { return this._routerState.root; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"parent\", {\n /** The parent of this route in the router state tree */\n get: /**\n * The parent of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.parent(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"firstChild\", {\n /** The first child of this route in the router state tree */\n get: /**\n * The first child of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.firstChild(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"children\", {\n /** The children of this route in the router state tree */\n get: /**\n * The children of this route in the router state tree\n * @return {?}\n */\n function () { return this._routerState.children(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"pathFromRoot\", {\n /** The path from the root of the router state tree to this route */\n get: /**\n * The path from the root of the router state tree to this route\n * @return {?}\n */\n function () { return this._routerState.pathFromRoot(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"paramMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._paramMap) {\n this._paramMap = convertToParamMap(this.params);\n }\n return this._paramMap;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ActivatedRouteSnapshot.prototype, \"queryParamMap\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n ActivatedRouteSnapshot.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ url = this.url.map(function (segment) { return segment.toString(); }).join('/');\n var /** @type {?} */ matched = this.routeConfig ? this.routeConfig.path : '';\n return \"Route(url:'\" + url + \"', path:'\" + matched + \"')\";\n };\n return ActivatedRouteSnapshot;\n}());\n/**\n * \\@whatItDoes Represents the state of the router at a moment in time.\n *\n * \\@howToUse\n *\n * ```\n * \\@Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const snapshot: RouterStateSnapshot = state.snapshot;\n * const root: ActivatedRouteSnapshot = snapshot.root;\n * const child = root.firstChild;\n * const id: Observable<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * \\@description\n * RouterStateSnapshot is a tree of activated route snapshots. Every node in this tree knows about\n * the \"consumed\" URL segments, the extracted parameters, and the resolved data.\n *\n * \\@stable\n */\nvar RouterStateSnapshot = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"b\" /* __extends */])(RouterStateSnapshot, _super);\n /** @internal */\n function RouterStateSnapshot(url, root) {\n var _this = _super.call(this, root) || this;\n _this.url = url;\n setRouterState(/** @type {?} */ (_this), root);\n return _this;\n }\n /**\n * @return {?}\n */\n RouterStateSnapshot.prototype.toString = /**\n * @return {?}\n */\n function () { return serializeNode(this._root); };\n return RouterStateSnapshot;\n}(Tree));\n/**\n * @template U, T\n * @param {?} state\n * @param {?} node\n * @return {?}\n */\nfunction setRouterState(state, node) {\n node.value._routerState = state;\n node.children.forEach(function (c) { return setRouterState(state, c); });\n}\n/**\n * @param {?} node\n * @return {?}\n */\nfunction serializeNode(node) {\n var /** @type {?} */ c = node.children.length > 0 ? \" { \" + node.children.map(serializeNode).join(', ') + \" } \" : '';\n return \"\" + node.value + c;\n}\n/**\n * The expectation is that the activate route is created with the right set of parameters.\n * So we push new values into the observables only when they are not the initial values.\n * And we detect that by checking if the snapshot field is set.\n * @param {?} route\n * @return {?}\n */\nfunction advanceActivatedRoute(route) {\n if (route.snapshot) {\n var /** @type {?} */ currentSnapshot = route.snapshot;\n var /** @type {?} */ nextSnapshot = route._futureSnapshot;\n route.snapshot = nextSnapshot;\n if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {\n (/** @type {?} */ (route.queryParams)).next(nextSnapshot.queryParams);\n }\n if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n (/** @type {?} */ (route.fragment)).next(nextSnapshot.fragment);\n }\n if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n (/** @type {?} */ (route.params)).next(nextSnapshot.params);\n }\n if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n (/** @type {?} */ (route.url)).next(nextSnapshot.url);\n }\n if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n (/** @type {?} */ (route.data)).next(nextSnapshot.data);\n }\n }\n else {\n route.snapshot = route._futureSnapshot;\n // this is for resolved data\n (/** @type {?} */ (route.data)).next(route._futureSnapshot.data);\n }\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction equalParamsAndUrlSegments(a, b) {\n var /** @type {?} */ equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);\n var /** @type {?} */ parentsMismatch = !a.parent !== !b.parent;\n return equalUrlParams && !parentsMismatch &&\n (!a.parent || equalParamsAndUrlSegments(a.parent, /** @type {?} */ ((b.parent))));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?} prevState\n * @return {?}\n */\nfunction createRouterState(routeReuseStrategy, curr, prevState) {\n var /** @type {?} */ root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);\n return new RouterState(root, curr);\n}\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?=} prevState\n * @return {?}\n */\nfunction createNode(routeReuseStrategy, curr, prevState) {\n // reuse an activated route that is currently displayed on the screen\n if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {\n var /** @type {?} */ value = prevState.value;\n value._futureSnapshot = curr.value;\n var /** @type {?} */ children = createOrReuseChildren(routeReuseStrategy, curr, prevState);\n return new TreeNode(value, children);\n // retrieve an activated route that is used to be displayed, but is not currently displayed\n }\n else if (routeReuseStrategy.retrieve(curr.value)) {\n var /** @type {?} */ tree = (/** @type {?} */ (routeReuseStrategy.retrieve(curr.value))).route;\n setFutureSnapshotsOfActivatedRoutes(curr, tree);\n return tree;\n }\n else {\n var /** @type {?} */ value = createActivatedRoute(curr.value);\n var /** @type {?} */ children = curr.children.map(function (c) { return createNode(routeReuseStrategy, c); });\n return new TreeNode(value, children);\n }\n}\n/**\n * @param {?} curr\n * @param {?} result\n * @return {?}\n */\nfunction setFutureSnapshotsOfActivatedRoutes(curr, result) {\n if (curr.value.routeConfig !== result.value.routeConfig) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');\n }\n if (curr.children.length !== result.children.length) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');\n }\n result.value._futureSnapshot = curr.value;\n for (var /** @type {?} */ i = 0; i < curr.children.length; ++i) {\n setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);\n }\n}\n/**\n * @param {?} routeReuseStrategy\n * @param {?} curr\n * @param {?} prevState\n * @return {?}\n */\nfunction createOrReuseChildren(routeReuseStrategy, curr, prevState) {\n return curr.children.map(function (child) {\n for (var _i = 0, _a = prevState.children; _i < _a.length; _i++) {\n var p = _a[_i];\n if (routeReuseStrategy.shouldReuseRoute(p.value.snapshot, child.value)) {\n return createNode(routeReuseStrategy, child, p);\n }\n }\n return createNode(routeReuseStrategy, child);\n });\n}\n/**\n * @param {?} c\n * @return {?}\n */\nfunction createActivatedRoute(c) {\n return new ActivatedRoute(new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.url), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.params), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.queryParams), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.fragment), new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](c.data), c.outlet, c.component, c);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} route\n * @param {?} urlTree\n * @param {?} commands\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\nfunction createUrlTree(route, urlTree, commands, queryParams, fragment) {\n if (commands.length === 0) {\n return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);\n }\n var /** @type {?} */ nav = computeNavigation(commands);\n if (nav.toRoot()) {\n return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);\n }\n var /** @type {?} */ startingPosition = findStartingPosition(nav, urlTree, route);\n var /** @type {?} */ segmentGroup = startingPosition.processChildren ?\n updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :\n updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);\n return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);\n}\n/**\n * @param {?} command\n * @return {?}\n */\nfunction isMatrixParams(command) {\n return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;\n}\n/**\n * @param {?} oldSegmentGroup\n * @param {?} newSegmentGroup\n * @param {?} urlTree\n * @param {?} queryParams\n * @param {?} fragment\n * @return {?}\n */\nfunction tree(oldSegmentGroup, newSegmentGroup, urlTree, queryParams, fragment) {\n var /** @type {?} */ qp = {};\n if (queryParams) {\n forEach(queryParams, function (value, name) {\n qp[name] = Array.isArray(value) ? value.map(function (v) { return \"\" + v; }) : \"\" + value;\n });\n }\n if (urlTree.root === oldSegmentGroup) {\n return new UrlTree(newSegmentGroup, qp, fragment);\n }\n return new UrlTree(replaceSegment(urlTree.root, oldSegmentGroup, newSegmentGroup), qp, fragment);\n}\n/**\n * @param {?} current\n * @param {?} oldSegment\n * @param {?} newSegment\n * @return {?}\n */\nfunction replaceSegment(current, oldSegment, newSegment) {\n var /** @type {?} */ children = {};\n forEach(current.children, function (c, outletName) {\n if (c === oldSegment) {\n children[outletName] = newSegment;\n }\n else {\n children[outletName] = replaceSegment(c, oldSegment, newSegment);\n }\n });\n return new UrlSegmentGroup(current.segments, children);\n}\nvar Navigation = /** @class */ (function () {\n function Navigation(isAbsolute, numberOfDoubleDots, commands) {\n this.isAbsolute = isAbsolute;\n this.numberOfDoubleDots = numberOfDoubleDots;\n this.commands = commands;\n if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {\n throw new Error('Root segment cannot have matrix parameters');\n }\n var /** @type {?} */ cmdWithOutlet = commands.find(function (c) { return typeof c === 'object' && c != null && c.outlets; });\n if (cmdWithOutlet && cmdWithOutlet !== last$1(commands)) {\n throw new Error('{outlets:{}} has to be the last command');\n }\n }\n /**\n * @return {?}\n */\n Navigation.prototype.toRoot = /**\n * @return {?}\n */\n function () {\n return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';\n };\n return Navigation;\n}());\n/**\n * Transforms commands to a normalized `Navigation`\n * @param {?} commands\n * @return {?}\n */\nfunction computeNavigation(commands) {\n if ((typeof commands[0] === 'string') && commands.length === 1 && commands[0] === '/') {\n return new Navigation(true, 0, commands);\n }\n var /** @type {?} */ numberOfDoubleDots = 0;\n var /** @type {?} */ isAbsolute = false;\n var /** @type {?} */ res = commands.reduce(function (res, cmd, cmdIdx) {\n if (typeof cmd === 'object' && cmd != null) {\n if (cmd.outlets) {\n var /** @type {?} */ outlets_1 = {};\n forEach(cmd.outlets, function (commands, name) {\n outlets_1[name] = typeof commands === 'string' ? commands.split('/') : commands;\n });\n return res.concat([{ outlets: outlets_1 }]);\n }\n if (cmd.segmentPath) {\n return res.concat([cmd.segmentPath]);\n }\n }\n if (!(typeof cmd === 'string')) {\n return res.concat([cmd]);\n }\n if (cmdIdx === 0) {\n cmd.split('/').forEach(function (urlPart, partIndex) {\n if (partIndex == 0 && urlPart === '.') {\n // skip './a'\n }\n else if (partIndex == 0 && urlPart === '') {\n // '/a'\n isAbsolute = true;\n }\n else if (urlPart === '..') {\n // '../a'\n numberOfDoubleDots++;\n }\n else if (urlPart != '') {\n res.push(urlPart);\n }\n });\n return res;\n }\n return res.concat([cmd]);\n }, []);\n return new Navigation(isAbsolute, numberOfDoubleDots, res);\n}\nvar Position = /** @class */ (function () {\n function Position(segmentGroup, processChildren, index) {\n this.segmentGroup = segmentGroup;\n this.processChildren = processChildren;\n this.index = index;\n }\n return Position;\n}());\n/**\n * @param {?} nav\n * @param {?} tree\n * @param {?} route\n * @return {?}\n */\nfunction findStartingPosition(nav, tree, route) {\n if (nav.isAbsolute) {\n return new Position(tree.root, true, 0);\n }\n if (route.snapshot._lastPathIndex === -1) {\n return new Position(route.snapshot._urlSegment, true, 0);\n }\n var /** @type {?} */ modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;\n var /** @type {?} */ index = route.snapshot._lastPathIndex + modifier;\n return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots);\n}\n/**\n * @param {?} group\n * @param {?} index\n * @param {?} numberOfDoubleDots\n * @return {?}\n */\nfunction createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {\n var /** @type {?} */ g = group;\n var /** @type {?} */ ci = index;\n var /** @type {?} */ dd = numberOfDoubleDots;\n while (dd > ci) {\n dd -= ci;\n g = /** @type {?} */ ((g.parent));\n if (!g) {\n throw new Error('Invalid number of \\'../\\'');\n }\n ci = g.segments.length;\n }\n return new Position(g, false, ci - dd);\n}\n/**\n * @param {?} command\n * @return {?}\n */\nfunction getPath(command) {\n if (typeof command === 'object' && command != null && command.outlets) {\n return command.outlets[PRIMARY_OUTLET];\n }\n return \"\" + command;\n}\n/**\n * @param {?} commands\n * @return {?}\n */\nfunction getOutlets(commands) {\n if (!(typeof commands[0] === 'object'))\n return _a = {}, _a[PRIMARY_OUTLET] = commands, _a;\n if (commands[0].outlets === undefined)\n return _b = {}, _b[PRIMARY_OUTLET] = commands, _b;\n return commands[0].outlets;\n var _a, _b;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction updateSegmentGroup(segmentGroup, startIndex, commands) {\n if (!segmentGroup) {\n segmentGroup = new UrlSegmentGroup([], {});\n }\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return updateSegmentGroupChildren(segmentGroup, startIndex, commands);\n }\n var /** @type {?} */ m = prefixedWith(segmentGroup, startIndex, commands);\n var /** @type {?} */ slicedCommands = commands.slice(m.commandIndex);\n if (m.match && m.pathIndex < segmentGroup.segments.length) {\n var /** @type {?} */ g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});\n g.children[PRIMARY_OUTLET] =\n new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children);\n return updateSegmentGroupChildren(g, 0, slicedCommands);\n }\n else if (m.match && slicedCommands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n }\n else if (m.match && !segmentGroup.hasChildren()) {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n }\n else if (m.match) {\n return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);\n }\n else {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n }\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction updateSegmentGroupChildren(segmentGroup, startIndex, commands) {\n if (commands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n }\n else {\n var /** @type {?} */ outlets_2 = getOutlets(commands);\n var /** @type {?} */ children_1 = {};\n forEach(outlets_2, function (commands, outlet) {\n if (commands !== null) {\n children_1[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);\n }\n });\n forEach(segmentGroup.children, function (child, childOutlet) {\n if (outlets_2[childOutlet] === undefined) {\n children_1[childOutlet] = child;\n }\n });\n return new UrlSegmentGroup(segmentGroup.segments, children_1);\n }\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction prefixedWith(segmentGroup, startIndex, commands) {\n var /** @type {?} */ currentCommandIndex = 0;\n var /** @type {?} */ currentPathIndex = startIndex;\n var /** @type {?} */ noMatch = { match: false, pathIndex: 0, commandIndex: 0 };\n while (currentPathIndex < segmentGroup.segments.length) {\n if (currentCommandIndex >= commands.length)\n return noMatch;\n var /** @type {?} */ path = segmentGroup.segments[currentPathIndex];\n var /** @type {?} */ curr = getPath(commands[currentCommandIndex]);\n var /** @type {?} */ next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;\n if (currentPathIndex > 0 && curr === undefined)\n break;\n if (curr && next && (typeof next === 'object') && next.outlets === undefined) {\n if (!compare(curr, next, path))\n return noMatch;\n currentCommandIndex += 2;\n }\n else {\n if (!compare(curr, {}, path))\n return noMatch;\n currentCommandIndex++;\n }\n currentPathIndex++;\n }\n return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} startIndex\n * @param {?} commands\n * @return {?}\n */\nfunction createNewSegmentGroup(segmentGroup, startIndex, commands) {\n var /** @type {?} */ paths = segmentGroup.segments.slice(0, startIndex);\n var /** @type {?} */ i = 0;\n while (i < commands.length) {\n if (typeof commands[i] === 'object' && commands[i].outlets !== undefined) {\n var /** @type {?} */ children = createNewSegmentChildren(commands[i].outlets);\n return new UrlSegmentGroup(paths, children);\n }\n // if we start with an object literal, we need to reuse the path part from the segment\n if (i === 0 && isMatrixParams(commands[0])) {\n var /** @type {?} */ p = segmentGroup.segments[startIndex];\n paths.push(new UrlSegment(p.path, commands[0]));\n i++;\n continue;\n }\n var /** @type {?} */ curr = getPath(commands[i]);\n var /** @type {?} */ next = (i < commands.length - 1) ? commands[i + 1] : null;\n if (curr && next && isMatrixParams(next)) {\n paths.push(new UrlSegment(curr, stringify(next)));\n i += 2;\n }\n else {\n paths.push(new UrlSegment(curr, {}));\n i++;\n }\n }\n return new UrlSegmentGroup(paths, {});\n}\n/**\n * @param {?} outlets\n * @return {?}\n */\nfunction createNewSegmentChildren(outlets) {\n var /** @type {?} */ children = {};\n forEach(outlets, function (commands, outlet) {\n if (commands !== null) {\n children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);\n }\n });\n return children;\n}\n/**\n * @param {?} params\n * @return {?}\n */\nfunction stringify(params) {\n var /** @type {?} */ res = {};\n forEach(params, function (v, k) { return res[k] = \"\" + v; });\n return res;\n}\n/**\n * @param {?} path\n * @param {?} params\n * @param {?} segment\n * @return {?}\n */\nfunction compare(path, params, segment) {\n return path == segment.path && shallowEqual(params, segment.parameters);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CanActivate = /** @class */ (function () {\n function CanActivate(path) {\n this.path = path;\n this.route = this.path[this.path.length - 1];\n }\n return CanActivate;\n}());\nvar CanDeactivate = /** @class */ (function () {\n function CanDeactivate(component, route) {\n this.component = component;\n this.route = route;\n }\n return CanDeactivate;\n}());\n/**\n * This class bundles the actions involved in preactivation of a route.\n */\nvar PreActivation = /** @class */ (function () {\n function PreActivation(future, curr, moduleInjector, forwardEvent) {\n this.future = future;\n this.curr = curr;\n this.moduleInjector = moduleInjector;\n this.forwardEvent = forwardEvent;\n this.canActivateChecks = [];\n this.canDeactivateChecks = [];\n }\n /**\n * @param {?} parentContexts\n * @return {?}\n */\n PreActivation.prototype.initialize = /**\n * @param {?} parentContexts\n * @return {?}\n */\n function (parentContexts) {\n var /** @type {?} */ futureRoot = this.future._root;\n var /** @type {?} */ currRoot = this.curr ? this.curr._root : null;\n this.setupChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.checkGuards = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!this.isDeactivating() && !this.isActivating()) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n }\n var /** @type {?} */ canDeactivate$ = this.runCanDeactivateChecks();\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(canDeactivate$, function (canDeactivate) { return canDeactivate ? _this.runCanActivateChecks() : Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false); });\n };\n /**\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n PreActivation.prototype.resolveData = /**\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n function (paramsInheritanceStrategy) {\n var _this = this;\n if (!this.isActivating())\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null);\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canActivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(checks$, function (check) { return _this.runResolve(check.route, paramsInheritanceStrategy); });\n return __WEBPACK_IMPORTED_MODULE_19_rxjs_operator_reduce__[\"reduce\"].call(runningChecks$, function (_, __) { return _; });\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.isDeactivating = /**\n * @return {?}\n */\n function () { return this.canDeactivateChecks.length !== 0; };\n /**\n * @return {?}\n */\n PreActivation.prototype.isActivating = /**\n * @return {?}\n */\n function () { return this.canActivateChecks.length !== 0; };\n /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @param {?} futurePath\n * @return {?}\n */\n PreActivation.prototype.setupChildRouteGuards = /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @param {?} futurePath\n * @return {?}\n */\n function (futureNode, currNode, contexts, futurePath) {\n var _this = this;\n var /** @type {?} */ prevChildren = nodeChildrenAsMap(currNode);\n // Process the children of the future route\n futureNode.children.forEach(function (c) {\n _this.setupRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]));\n delete prevChildren[c.value.outlet];\n });\n // Process any children left from the current route (not active for the future route)\n forEach(prevChildren, function (v, k) {\n return _this.deactivateRouteAndItsChildren(v, /** @type {?} */ ((contexts)).getContext(k));\n });\n };\n /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @param {?} futurePath\n * @return {?}\n */\n PreActivation.prototype.setupRouteGuards = /**\n * Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in\n * proper state to run `checkGuards()` method.\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @param {?} futurePath\n * @return {?}\n */\n function (futureNode, currNode, parentContexts, futurePath) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n var /** @type {?} */ context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;\n // reusing the node\n if (curr && future.routeConfig === curr.routeConfig) {\n var /** @type {?} */ shouldRunGuardsAndResolvers = this.shouldRunGuardsAndResolvers(curr, future, /** @type {?} */ ((future.routeConfig)).runGuardsAndResolvers);\n if (shouldRunGuardsAndResolvers) {\n this.canActivateChecks.push(new CanActivate(futurePath));\n }\n else {\n // we need to set the data\n future.data = curr.data;\n future._resolvedData = curr._resolvedData;\n }\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n this.setupChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath);\n // if we have a componentless route, we recurse but keep the same outlet map.\n }\n else {\n this.setupChildRouteGuards(futureNode, currNode, parentContexts, futurePath);\n }\n if (shouldRunGuardsAndResolvers) {\n var /** @type {?} */ outlet = /** @type {?} */ ((/** @type {?} */ ((context)).outlet));\n this.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));\n }\n }\n else {\n if (curr) {\n this.deactivateRouteAndItsChildren(currNode, context);\n }\n this.canActivateChecks.push(new CanActivate(futurePath));\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n this.setupChildRouteGuards(futureNode, null, context ? context.children : null, futurePath);\n // if we have a componentless route, we recurse but keep the same outlet map.\n }\n else {\n this.setupChildRouteGuards(futureNode, null, parentContexts, futurePath);\n }\n }\n };\n /**\n * @param {?} curr\n * @param {?} future\n * @param {?} mode\n * @return {?}\n */\n PreActivation.prototype.shouldRunGuardsAndResolvers = /**\n * @param {?} curr\n * @param {?} future\n * @param {?} mode\n * @return {?}\n */\n function (curr, future, mode) {\n switch (mode) {\n case 'always':\n return true;\n case 'paramsOrQueryParamsChange':\n return !equalParamsAndUrlSegments(curr, future) ||\n !shallowEqual(curr.queryParams, future.queryParams);\n case 'paramsChange':\n default:\n return !equalParamsAndUrlSegments(curr, future);\n }\n };\n /**\n * @param {?} route\n * @param {?} context\n * @return {?}\n */\n PreActivation.prototype.deactivateRouteAndItsChildren = /**\n * @param {?} route\n * @param {?} context\n * @return {?}\n */\n function (route, context) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(route);\n var /** @type {?} */ r = route.value;\n forEach(children, function (node, childName) {\n if (!r.component) {\n _this.deactivateRouteAndItsChildren(node, context);\n }\n else if (context) {\n _this.deactivateRouteAndItsChildren(node, context.children.getContext(childName));\n }\n else {\n _this.deactivateRouteAndItsChildren(node, null);\n }\n });\n if (!r.component) {\n this.canDeactivateChecks.push(new CanDeactivate(null, r));\n }\n else if (context && context.outlet && context.outlet.isActivated) {\n this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));\n }\n else {\n this.canDeactivateChecks.push(new CanDeactivate(null, r));\n }\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.runCanDeactivateChecks = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canDeactivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(checks$, function (check) { return _this.runCanDeactivate(check.component, check.route); });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(runningChecks$, function (result) { return result === true; });\n };\n /**\n * @return {?}\n */\n PreActivation.prototype.runCanActivateChecks = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ checks$ = Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(this.canActivateChecks);\n var /** @type {?} */ runningChecks$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(checks$, function (check) {\n return andObservables(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])([\n _this.fireChildActivationStart(check.route.parent), _this.fireActivationStart(check.route),\n _this.runCanActivateChild(check.path), _this.runCanActivate(check.route)\n ]));\n });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(runningChecks$, function (result) { return result === true; });\n // this.fireChildActivationStart(check.path),\n };\n /**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.fireActivationStart = /**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n function (snapshot) {\n if (snapshot !== null && this.forwardEvent) {\n this.forwardEvent(new ActivationStart(snapshot));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n };\n /**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.fireChildActivationStart = /**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n * @param {?} snapshot\n * @return {?}\n */\n function (snapshot) {\n if (snapshot !== null && this.forwardEvent) {\n this.forwardEvent(new ChildActivationStart(snapshot));\n }\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n };\n /**\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.runCanActivate = /**\n * @param {?} future\n * @return {?}\n */\n function (future) {\n var _this = this;\n var /** @type {?} */ canActivate = future.routeConfig ? future.routeConfig.canActivate : null;\n if (!canActivate || canActivate.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canActivate), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, future);\n var /** @type {?} */ observable;\n if (guard.canActivate) {\n observable = wrapIntoObservable(guard.canActivate(future, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(future, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return andObservables(obs);\n };\n /**\n * @param {?} path\n * @return {?}\n */\n PreActivation.prototype.runCanActivateChild = /**\n * @param {?} path\n * @return {?}\n */\n function (path) {\n var _this = this;\n var /** @type {?} */ future = path[path.length - 1];\n var /** @type {?} */ canActivateChildGuards = path.slice(0, path.length - 1)\n .reverse()\n .map(function (p) { return _this.extractCanActivateChild(p); })\n .filter(function (_) { return _ !== null; });\n return andObservables(__WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canActivateChildGuards), function (d) {\n var /** @type {?} */ obs = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(d.guards), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, d.node);\n var /** @type {?} */ observable;\n if (guard.canActivateChild) {\n observable = wrapIntoObservable(guard.canActivateChild(future, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(future, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return andObservables(obs);\n }));\n };\n /**\n * @param {?} p\n * @return {?}\n */\n PreActivation.prototype.extractCanActivateChild = /**\n * @param {?} p\n * @return {?}\n */\n function (p) {\n var /** @type {?} */ canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;\n if (!canActivateChild || canActivateChild.length === 0)\n return null;\n return { node: p, guards: canActivateChild };\n };\n /**\n * @param {?} component\n * @param {?} curr\n * @return {?}\n */\n PreActivation.prototype.runCanDeactivate = /**\n * @param {?} component\n * @param {?} curr\n * @return {?}\n */\n function (component, curr) {\n var _this = this;\n var /** @type {?} */ canDeactivate = curr && curr.routeConfig ? curr.routeConfig.canDeactivate : null;\n if (!canDeactivate || canDeactivate.length === 0)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(true);\n var /** @type {?} */ canDeactivate$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(canDeactivate), function (c) {\n var /** @type {?} */ guard = _this.getToken(c, curr);\n var /** @type {?} */ observable;\n if (guard.canDeactivate) {\n observable =\n wrapIntoObservable(guard.canDeactivate(component, curr, _this.curr, _this.future));\n }\n else {\n observable = wrapIntoObservable(guard(component, curr, _this.curr, _this.future));\n }\n return __WEBPACK_IMPORTED_MODULE_13_rxjs_operator_first__[\"first\"].call(observable);\n });\n return __WEBPACK_IMPORTED_MODULE_16_rxjs_operator_every__[\"every\"].call(canDeactivate$, function (result) { return result === true; });\n };\n /**\n * @param {?} future\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n PreActivation.prototype.runResolve = /**\n * @param {?} future\n * @param {?} paramsInheritanceStrategy\n * @return {?}\n */\n function (future, paramsInheritanceStrategy) {\n var /** @type {?} */ resolve = future._resolve;\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.resolveNode(resolve, future), function (resolvedData) {\n future._resolvedData = resolvedData;\n future.data = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, future.data, inheritedParamsDataResolve(future, paramsInheritanceStrategy).resolve);\n return null;\n });\n };\n /**\n * @param {?} resolve\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.resolveNode = /**\n * @param {?} resolve\n * @param {?} future\n * @return {?}\n */\n function (resolve, future) {\n var _this = this;\n var /** @type {?} */ keys = Object.keys(resolve);\n if (keys.length === 0) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({});\n }\n if (keys.length === 1) {\n var /** @type {?} */ key_1 = keys[0];\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(this.getResolver(resolve[key_1], future), function (value) {\n return _a = {}, _a[key_1] = value, _a;\n var _a;\n });\n }\n var /** @type {?} */ data = {};\n var /** @type {?} */ runningResolvers$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(keys), function (key) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.getResolver(resolve[key], future), function (value) {\n data[key] = value;\n return value;\n });\n });\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(__WEBPACK_IMPORTED_MODULE_17_rxjs_operator_last__[\"last\"].call(runningResolvers$), function () { return data; });\n };\n /**\n * @param {?} injectionToken\n * @param {?} future\n * @return {?}\n */\n PreActivation.prototype.getResolver = /**\n * @param {?} injectionToken\n * @param {?} future\n * @return {?}\n */\n function (injectionToken, future) {\n var /** @type {?} */ resolver = this.getToken(injectionToken, future);\n return resolver.resolve ? wrapIntoObservable(resolver.resolve(future, this.future)) :\n wrapIntoObservable(resolver(future, this.future));\n };\n /**\n * @param {?} token\n * @param {?} snapshot\n * @return {?}\n */\n PreActivation.prototype.getToken = /**\n * @param {?} token\n * @param {?} snapshot\n * @return {?}\n */\n function (token, snapshot) {\n var /** @type {?} */ config = closestLoadedConfig(snapshot);\n var /** @type {?} */ injector = config ? config.module.injector : this.moduleInjector;\n return injector.get(token);\n };\n return PreActivation;\n}());\n/**\n * @param {?} snapshot\n * @return {?}\n */\nfunction closestLoadedConfig(snapshot) {\n if (!snapshot)\n return null;\n for (var /** @type {?} */ s = snapshot.parent; s; s = s.parent) {\n var /** @type {?} */ route = s.routeConfig;\n if (route && route._loadedConfig)\n return route._loadedConfig;\n }\n return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NoMatch$1 = /** @class */ (function () {\n function NoMatch() {\n }\n return NoMatch;\n}());\n/**\n * @param {?} rootComponentType\n * @param {?} config\n * @param {?} urlTree\n * @param {?} url\n * @param {?=} paramsInheritanceStrategy\n * @return {?}\n */\nfunction recognize(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {\n if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }\n return new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy)\n .recognize();\n}\nvar Recognizer = /** @class */ (function () {\n function Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {\n this.rootComponentType = rootComponentType;\n this.config = config;\n this.urlTree = urlTree;\n this.url = url;\n this.paramsInheritanceStrategy = paramsInheritanceStrategy;\n }\n /**\n * @return {?}\n */\n Recognizer.prototype.recognize = /**\n * @return {?}\n */\n function () {\n try {\n var /** @type {?} */ rootSegmentGroup = split$1(this.urlTree.root, [], [], this.config).segmentGroup;\n var /** @type {?} */ children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);\n var /** @type {?} */ root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});\n var /** @type {?} */ rootNode = new TreeNode(root, children);\n var /** @type {?} */ routeState = new RouterStateSnapshot(this.url, rootNode);\n this.inheritParamsAndData(routeState._root);\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(routeState);\n }\n catch (/** @type {?} */ e) {\n return new __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__[\"Observable\"](function (obs) { return obs.error(e); });\n }\n };\n /**\n * @param {?} routeNode\n * @return {?}\n */\n Recognizer.prototype.inheritParamsAndData = /**\n * @param {?} routeNode\n * @return {?}\n */\n function (routeNode) {\n var _this = this;\n var /** @type {?} */ route = routeNode.value;\n var /** @type {?} */ i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);\n route.params = Object.freeze(i.params);\n route.data = Object.freeze(i.data);\n routeNode.children.forEach(function (n) { return _this.inheritParamsAndData(n); });\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegmentGroup = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} outlet\n * @return {?}\n */\n function (config, segmentGroup, outlet) {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return this.processChildren(config, segmentGroup);\n }\n return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @return {?}\n */\n Recognizer.prototype.processChildren = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @return {?}\n */\n function (config, segmentGroup) {\n var _this = this;\n var /** @type {?} */ children = mapChildrenIntoArray(segmentGroup, function (child, childOutlet) { return _this.processSegmentGroup(config, child, childOutlet); });\n checkOutletNameUniqueness(children);\n sortActivatedRouteSnapshots(children);\n return children;\n };\n /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegment = /**\n * @param {?} config\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (config, segmentGroup, segments, outlet) {\n for (var _i = 0, config_1 = config; _i < config_1.length; _i++) {\n var r = config_1[_i];\n try {\n return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);\n }\n catch (/** @type {?} */ e) {\n if (!(e instanceof NoMatch$1))\n throw e;\n }\n }\n if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return [];\n }\n throw new NoMatch$1();\n };\n /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.noLeftoversInUrl = /**\n * @param {?} segmentGroup\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (segmentGroup, segments, outlet) {\n return segments.length === 0 && !segmentGroup.children[outlet];\n };\n /**\n * @param {?} route\n * @param {?} rawSegment\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n Recognizer.prototype.processSegmentAgainstRoute = /**\n * @param {?} route\n * @param {?} rawSegment\n * @param {?} segments\n * @param {?} outlet\n * @return {?}\n */\n function (route, rawSegment, segments, outlet) {\n if (route.redirectTo)\n throw new NoMatch$1();\n if ((route.outlet || PRIMARY_OUTLET) !== outlet)\n throw new NoMatch$1();\n var /** @type {?} */ snapshot;\n var /** @type {?} */ consumedSegments = [];\n var /** @type {?} */ rawSlicedSegments = [];\n if (route.path === '**') {\n var /** @type {?} */ params = segments.length > 0 ? /** @type {?} */ ((last$1(segments))).parameters : {};\n snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));\n }\n else {\n var /** @type {?} */ result = match$1(rawSegment, route, segments);\n consumedSegments = result.consumedSegments;\n rawSlicedSegments = segments.slice(result.lastChild);\n snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(this.urlTree.queryParams), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));\n }\n var /** @type {?} */ childConfig = getChildConfig(route);\n var _a = split$1(rawSegment, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n var /** @type {?} */ children_1 = this.processChildren(childConfig, segmentGroup);\n return [new TreeNode(snapshot, children_1)];\n }\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return [new TreeNode(snapshot, [])];\n }\n var /** @type {?} */ children = this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);\n return [new TreeNode(snapshot, children)];\n };\n return Recognizer;\n}());\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction sortActivatedRouteSnapshots(nodes) {\n nodes.sort(function (a, b) {\n if (a.value.outlet === PRIMARY_OUTLET)\n return -1;\n if (b.value.outlet === PRIMARY_OUTLET)\n return 1;\n return a.value.outlet.localeCompare(b.value.outlet);\n });\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getChildConfig(route) {\n if (route.children) {\n return route.children;\n }\n if (route.loadChildren) {\n return /** @type {?} */ ((route._loadedConfig)).routes;\n }\n return [];\n}\n/**\n * @param {?} segmentGroup\n * @param {?} route\n * @param {?} segments\n * @return {?}\n */\nfunction match$1(segmentGroup, route, segments) {\n if (route.path === '') {\n if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n throw new NoMatch$1();\n }\n return { consumedSegments: [], lastChild: 0, parameters: {} };\n }\n var /** @type {?} */ matcher = route.matcher || defaultUrlMatcher;\n var /** @type {?} */ res = matcher(segments, segmentGroup, route);\n if (!res)\n throw new NoMatch$1();\n var /** @type {?} */ posParams = {};\n forEach(/** @type {?} */ ((res.posParams)), function (v, k) { posParams[k] = v.path; });\n var /** @type {?} */ parameters = res.consumed.length > 0 ? Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, posParams, res.consumed[res.consumed.length - 1].parameters) :\n posParams;\n return { consumedSegments: res.consumed, lastChild: res.consumed.length, parameters: parameters };\n}\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction checkOutletNameUniqueness(nodes) {\n var /** @type {?} */ names = {};\n nodes.forEach(function (n) {\n var /** @type {?} */ routeWithSameOutletName = names[n.value.outlet];\n if (routeWithSameOutletName) {\n var /** @type {?} */ p = routeWithSameOutletName.url.map(function (s) { return s.toString(); }).join('/');\n var /** @type {?} */ c = n.value.url.map(function (s) { return s.toString(); }).join('/');\n throw new Error(\"Two segments cannot have the same outlet name: '\" + p + \"' and '\" + c + \"'.\");\n }\n names[n.value.outlet] = n.value;\n });\n}\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction getSourceSegmentGroup(segmentGroup) {\n var /** @type {?} */ s = segmentGroup;\n while (s._sourceSegment) {\n s = s._sourceSegment;\n }\n return s;\n}\n/**\n * @param {?} segmentGroup\n * @return {?}\n */\nfunction getPathIndexShift(segmentGroup) {\n var /** @type {?} */ s = segmentGroup;\n var /** @type {?} */ res = (s._segmentIndexShift ? s._segmentIndexShift : 0);\n while (s._sourceSegment) {\n s = s._sourceSegment;\n res += (s._segmentIndexShift ? s._segmentIndexShift : 0);\n }\n return res - 1;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} slicedSegments\n * @param {?} config\n * @return {?}\n */\nfunction split$1(segmentGroup, consumedSegments, slicedSegments, config) {\n if (slicedSegments.length > 0 &&\n containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s_1 = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n s_1._sourceSegment = segmentGroup;\n s_1._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s_1, slicedSegments: [] };\n }\n if (slicedSegments.length === 0 &&\n containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {\n var /** @type {?} */ s_2 = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));\n s_2._sourceSegment = segmentGroup;\n s_2._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s_2, slicedSegments: slicedSegments };\n }\n var /** @type {?} */ s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n return { segmentGroup: s, slicedSegments: slicedSegments };\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @param {?} children\n * @return {?}\n */\nfunction addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {\n var /** @type {?} */ res = {};\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var r = routes_1[_i];\n if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet$1(r)]) {\n var /** @type {?} */ s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = segmentGroup.segments.length;\n res[getOutlet$1(r)] = s;\n }\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, children, res);\n}\n/**\n * @param {?} segmentGroup\n * @param {?} consumedSegments\n * @param {?} routes\n * @param {?} primarySegment\n * @return {?}\n */\nfunction createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {\n var /** @type {?} */ res = {};\n res[PRIMARY_OUTLET] = primarySegment;\n primarySegment._sourceSegment = segmentGroup;\n primarySegment._segmentIndexShift = consumedSegments.length;\n for (var _i = 0, routes_2 = routes; _i < routes_2.length; _i++) {\n var r = routes_2[_i];\n if (r.path === '' && getOutlet$1(r) !== PRIMARY_OUTLET) {\n var /** @type {?} */ s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n res[getOutlet$1(r)] = s;\n }\n }\n return res;\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) {\n return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet$1(r) !== PRIMARY_OUTLET; });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} routes\n * @return {?}\n */\nfunction containsEmptyPathMatches(segmentGroup, slicedSegments, routes) {\n return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r); });\n}\n/**\n * @param {?} segmentGroup\n * @param {?} slicedSegments\n * @param {?} r\n * @return {?}\n */\nfunction emptyPathMatch(segmentGroup, slicedSegments, r) {\n if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n return r.path === '' && r.redirectTo === undefined;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getOutlet$1(route) {\n return route.outlet || PRIMARY_OUTLET;\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getData(route) {\n return route.data || {};\n}\n/**\n * @param {?} route\n * @return {?}\n */\nfunction getResolve(route) {\n return route.resolve || {};\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Provides a way to customize when activated routes get reused.\n *\n * \\@experimental\n * @abstract\n */\nvar RouteReuseStrategy = /** @class */ (function () {\n function RouteReuseStrategy() {\n }\n return RouteReuseStrategy;\n}());\n/**\n * Does not detach any subtrees. Reuses routes as long as their route config is the same.\n */\nvar DefaultRouteReuseStrategy = /** @class */ (function () {\n function DefaultRouteReuseStrategy() {\n }\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldDetach = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return false; };\n /**\n * @param {?} route\n * @param {?} detachedTree\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.store = /**\n * @param {?} route\n * @param {?} detachedTree\n * @return {?}\n */\n function (route, detachedTree) { };\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldAttach = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return false; };\n /**\n * @param {?} route\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.retrieve = /**\n * @param {?} route\n * @return {?}\n */\n function (route) { return null; };\n /**\n * @param {?} future\n * @param {?} curr\n * @return {?}\n */\n DefaultRouteReuseStrategy.prototype.shouldReuseRoute = /**\n * @param {?} future\n * @param {?} curr\n * @return {?}\n */\n function (future, curr) {\n return future.routeConfig === curr.routeConfig;\n };\n return DefaultRouteReuseStrategy;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@docsNotRequired\n * \\@experimental\n */\nvar ROUTES = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTES');\nvar RouterConfigLoader = /** @class */ (function () {\n function RouterConfigLoader(loader, compiler, onLoadStartListener, onLoadEndListener) {\n this.loader = loader;\n this.compiler = compiler;\n this.onLoadStartListener = onLoadStartListener;\n this.onLoadEndListener = onLoadEndListener;\n }\n /**\n * @param {?} parentInjector\n * @param {?} route\n * @return {?}\n */\n RouterConfigLoader.prototype.load = /**\n * @param {?} parentInjector\n * @param {?} route\n * @return {?}\n */\n function (parentInjector, route) {\n var _this = this;\n if (this.onLoadStartListener) {\n this.onLoadStartListener(route);\n }\n var /** @type {?} */ moduleFactory$ = this.loadModuleFactory(/** @type {?} */ ((route.loadChildren)));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(moduleFactory$, function (factory) {\n if (_this.onLoadEndListener) {\n _this.onLoadEndListener(route);\n }\n var /** @type {?} */ module = factory.create(parentInjector);\n return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)), module);\n });\n };\n /**\n * @param {?} loadChildren\n * @return {?}\n */\n RouterConfigLoader.prototype.loadModuleFactory = /**\n * @param {?} loadChildren\n * @return {?}\n */\n function (loadChildren) {\n var _this = this;\n if (typeof loadChildren === 'string') {\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(this.loader.load(loadChildren));\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(wrapIntoObservable(loadChildren()), function (t) {\n if (t instanceof __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactory\"]) {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(t);\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_15_rxjs_observable_fromPromise__[\"fromPromise\"])(_this.compiler.compileModuleAsync(t));\n }\n });\n }\n };\n return RouterConfigLoader;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Provides a way to migrate AngularJS applications to Angular.\n *\n * \\@experimental\n * @abstract\n */\nvar UrlHandlingStrategy = /** @class */ (function () {\n function UrlHandlingStrategy() {\n }\n return UrlHandlingStrategy;\n}());\n/**\n * \\@experimental\n */\nvar DefaultUrlHandlingStrategy = /** @class */ (function () {\n function DefaultUrlHandlingStrategy() {\n }\n /**\n * @param {?} url\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.shouldProcessUrl = /**\n * @param {?} url\n * @return {?}\n */\n function (url) { return true; };\n /**\n * @param {?} url\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.extract = /**\n * @param {?} url\n * @return {?}\n */\n function (url) { return url; };\n /**\n * @param {?} newUrlPart\n * @param {?} wholeUrl\n * @return {?}\n */\n DefaultUrlHandlingStrategy.prototype.merge = /**\n * @param {?} newUrlPart\n * @param {?} wholeUrl\n * @return {?}\n */\n function (newUrlPart, wholeUrl) { return newUrlPart; };\n return DefaultUrlHandlingStrategy;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Represents the extra options used during navigation.\n *\n * \\@stable\n * @record\n */\n\n/**\n * @param {?} error\n * @return {?}\n */\nfunction defaultErrorHandler(error) {\n throw error;\n}\n/**\n * \\@internal\n * @param {?} snapshot\n * @return {?}\n */\nfunction defaultRouterHook(snapshot) {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n}\n/**\n * \\@whatItDoes Provides the navigation and url manipulation capabilities.\n *\n * See {\\@link Routes} for more details and examples.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar Router = /** @class */ (function () {\n /**\n * Creates the router service.\n */\n // TODO: vsavkin make internal after the final is out.\n function Router(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {\n var _this = this;\n this.rootComponentType = rootComponentType;\n this.urlSerializer = urlSerializer;\n this.rootContexts = rootContexts;\n this.location = location;\n this.config = config;\n this.navigations = new __WEBPACK_IMPORTED_MODULE_3_rxjs_BehaviorSubject__[\"BehaviorSubject\"](/** @type {?} */ ((null)));\n this.navigationId = 0;\n this.events = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n /**\n * Error handler that is invoked when a navigation errors.\n *\n * See {\\@link ErrorHandler} for more information.\n */\n this.errorHandler = defaultErrorHandler;\n /**\n * Indicates if at least one navigation happened.\n */\n this.navigated = false;\n /**\n * Used by RouterModule. This allows us to\n * pause the navigation either before preactivation or after it.\n * \\@internal\n */\n this.hooks = {\n beforePreactivation: defaultRouterHook,\n afterPreactivation: defaultRouterHook\n };\n /**\n * Extracts and merges URLs. Used for AngularJS to Angular migrations.\n */\n this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();\n this.routeReuseStrategy = new DefaultRouteReuseStrategy();\n /**\n * Define what the router should do if it receives a navigation request to the current URL.\n * By default, the router will ignore this navigation. However, this prevents features such\n * as a \"refresh\" button. Use this option to configure the behavior when navigating to the\n * current URL. Default is 'ignore'.\n */\n this.onSameUrlNavigation = 'ignore';\n /**\n * Defines how the router merges params, data and resolved data from parent to child\n * routes. Available options are:\n *\n * - `'emptyOnly'`, the default, only inherits parent params for path-less or component-less\n * routes.\n * - `'always'`, enables unconditional inheritance of parent params.\n */\n this.paramsInheritanceStrategy = 'emptyOnly';\n var /** @type {?} */ onLoadStart = function (r) { return _this.triggerEvent(new RouteConfigLoadStart(r)); };\n var /** @type {?} */ onLoadEnd = function (r) { return _this.triggerEvent(new RouteConfigLoadEnd(r)); };\n this.ngModule = injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n this.resetConfig(config);\n this.currentUrlTree = createEmptyUrlTree();\n this.rawUrlTree = this.currentUrlTree;\n this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);\n this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);\n this.processNavigations();\n }\n /**\n * @internal\n * TODO: this should be removed once the constructor of the router made internal\n */\n /**\n * \\@internal\n * TODO: this should be removed once the constructor of the router made internal\n * @param {?} rootComponentType\n * @return {?}\n */\n Router.prototype.resetRootComponentType = /**\n * \\@internal\n * TODO: this should be removed once the constructor of the router made internal\n * @param {?} rootComponentType\n * @return {?}\n */\n function (rootComponentType) {\n this.rootComponentType = rootComponentType;\n // TODO: vsavkin router 4.0 should make the root component set to null\n // this will simplify the lifecycle of the router.\n this.routerState.root.component = this.rootComponentType;\n };\n /**\n * Sets up the location change listener and performs the initial navigation.\n */\n /**\n * Sets up the location change listener and performs the initial navigation.\n * @return {?}\n */\n Router.prototype.initialNavigation = /**\n * Sets up the location change listener and performs the initial navigation.\n * @return {?}\n */\n function () {\n this.setUpLocationChangeListener();\n if (this.navigationId === 0) {\n this.navigateByUrl(this.location.path(true), { replaceUrl: true });\n }\n };\n /**\n * Sets up the location change listener.\n */\n /**\n * Sets up the location change listener.\n * @return {?}\n */\n Router.prototype.setUpLocationChangeListener = /**\n * Sets up the location change listener.\n * @return {?}\n */\n function () {\n var _this = this;\n // Zone.current.wrap is needed because of the issue with RxJS scheduler,\n // which does not work properly with zone.js in IE and Safari\n if (!this.locationSubscription) {\n this.locationSubscription = /** @type {?} */ (this.location.subscribe(Zone.current.wrap(function (change) {\n var /** @type {?} */ rawUrlTree = _this.urlSerializer.parse(change['url']);\n var /** @type {?} */ source = change['type'] === 'popstate' ? 'popstate' : 'hashchange';\n setTimeout(function () { _this.scheduleNavigation(rawUrlTree, source, { replaceUrl: true }); }, 0);\n })));\n }\n };\n Object.defineProperty(Router.prototype, \"url\", {\n /** The current url */\n get: /**\n * The current url\n * @return {?}\n */\n function () { return this.serializeUrl(this.currentUrlTree); },\n enumerable: true,\n configurable: true\n });\n /** @internal */\n /**\n * \\@internal\n * @param {?} e\n * @return {?}\n */\n Router.prototype.triggerEvent = /**\n * \\@internal\n * @param {?} e\n * @return {?}\n */\n function (e) { (/** @type {?} */ (this.events)).next(e); };\n /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n */\n /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n * @param {?} config\n * @return {?}\n */\n Router.prototype.resetConfig = /**\n * Resets the configuration used for navigation and generating links.\n *\n * ### Usage\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n * @param {?} config\n * @return {?}\n */\n function (config) {\n validateConfig(config);\n this.config = config;\n this.navigated = false;\n };\n /** @docsNotRequired */\n /**\n * \\@docsNotRequired\n * @return {?}\n */\n Router.prototype.ngOnDestroy = /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { this.dispose(); };\n /** Disposes of the router */\n /**\n * Disposes of the router\n * @return {?}\n */\n Router.prototype.dispose = /**\n * Disposes of the router\n * @return {?}\n */\n function () {\n if (this.locationSubscription) {\n this.locationSubscription.unsubscribe();\n this.locationSubscription = /** @type {?} */ ((null));\n }\n };\n /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n */\n /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n * @param {?} commands\n * @param {?=} navigationExtras\n * @return {?}\n */\n Router.prototype.createUrlTree = /**\n * Applies an array of commands to the current url tree and creates a new url tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * ### Usage\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it, you\n * // can do the following:\n *\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n * ```\n * @param {?} commands\n * @param {?=} navigationExtras\n * @return {?}\n */\n function (commands, navigationExtras) {\n if (navigationExtras === void 0) { navigationExtras = {}; }\n var relativeTo = navigationExtras.relativeTo, queryParams = navigationExtras.queryParams, fragment = navigationExtras.fragment, preserveQueryParams = navigationExtras.preserveQueryParams, queryParamsHandling = navigationExtras.queryParamsHandling, preserveFragment = navigationExtras.preserveFragment;\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && preserveQueryParams && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n var /** @type {?} */ a = relativeTo || this.routerState.root;\n var /** @type {?} */ f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n var /** @type {?} */ q = null;\n if (queryParamsHandling) {\n switch (queryParamsHandling) {\n case 'merge':\n q = Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"a\" /* __assign */])({}, this.currentUrlTree.queryParams, queryParams);\n break;\n case 'preserve':\n q = this.currentUrlTree.queryParams;\n break;\n default:\n q = queryParams || null;\n }\n }\n else {\n q = preserveQueryParams ? this.currentUrlTree.queryParams : queryParams || null;\n }\n if (q !== null) {\n q = this.removeEmptyProps(q);\n }\n return createUrlTree(a, this.currentUrlTree, commands, /** @type {?} */ ((q)), /** @type {?} */ ((f)));\n };\n /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n */\n /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n * @param {?} url\n * @param {?=} extras\n * @return {?}\n */\n Router.prototype.navigateByUrl = /**\n * Navigate based on the provided url. This navigation is always absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * In opposite to `navigate`, `navigateByUrl` takes a whole URL\n * and does not apply any delta to the current one.\n * @param {?} url\n * @param {?=} extras\n * @return {?}\n */\n function (url, extras) {\n if (extras === void 0) { extras = { skipLocationChange: false }; }\n var /** @type {?} */ urlTree = url instanceof UrlTree ? url : this.parseUrl(url);\n var /** @type {?} */ mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);\n return this.scheduleNavigation(mergedTree, 'imperative', extras);\n };\n /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n */\n /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n * @param {?} commands\n * @param {?=} extras\n * @return {?}\n */\n Router.prototype.navigate = /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * ### Usage\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current\n * URL.\n * @param {?} commands\n * @param {?=} extras\n * @return {?}\n */\n function (commands, extras) {\n if (extras === void 0) { extras = { skipLocationChange: false }; }\n validateCommands(commands);\n return this.navigateByUrl(this.createUrlTree(commands, extras), extras);\n };\n /** Serializes a {@link UrlTree} into a string */\n /**\n * Serializes a {\\@link UrlTree} into a string\n * @param {?} url\n * @return {?}\n */\n Router.prototype.serializeUrl = /**\n * Serializes a {\\@link UrlTree} into a string\n * @param {?} url\n * @return {?}\n */\n function (url) { return this.urlSerializer.serialize(url); };\n /** Parses a string into a {@link UrlTree} */\n /**\n * Parses a string into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n Router.prototype.parseUrl = /**\n * Parses a string into a {\\@link UrlTree}\n * @param {?} url\n * @return {?}\n */\n function (url) { return this.urlSerializer.parse(url); };\n /** Returns whether the url is activated */\n /**\n * Returns whether the url is activated\n * @param {?} url\n * @param {?} exact\n * @return {?}\n */\n Router.prototype.isActive = /**\n * Returns whether the url is activated\n * @param {?} url\n * @param {?} exact\n * @return {?}\n */\n function (url, exact) {\n if (url instanceof UrlTree) {\n return containsTree(this.currentUrlTree, url, exact);\n }\n var /** @type {?} */ urlTree = this.urlSerializer.parse(url);\n return containsTree(this.currentUrlTree, urlTree, exact);\n };\n /**\n * @param {?} params\n * @return {?}\n */\n Router.prototype.removeEmptyProps = /**\n * @param {?} params\n * @return {?}\n */\n function (params) {\n return Object.keys(params).reduce(function (result, key) {\n var /** @type {?} */ value = params[key];\n if (value !== null && value !== undefined) {\n result[key] = value;\n }\n return result;\n }, {});\n };\n /**\n * @return {?}\n */\n Router.prototype.processNavigations = /**\n * @return {?}\n */\n function () {\n var _this = this;\n __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"]\n .call(this.navigations, function (nav) {\n if (nav) {\n _this.executeScheduledNavigation(nav);\n // a failed navigation should not stop the router from processing\n // further navigations => the catch\n return nav.promise.catch(function () { });\n }\n else {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n }\n })\n .subscribe(function () { });\n };\n /**\n * @param {?} rawUrl\n * @param {?} source\n * @param {?} extras\n * @return {?}\n */\n Router.prototype.scheduleNavigation = /**\n * @param {?} rawUrl\n * @param {?} source\n * @param {?} extras\n * @return {?}\n */\n function (rawUrl, source, extras) {\n var /** @type {?} */ lastNavigation = this.navigations.value;\n // If the user triggers a navigation imperatively (e.g., by using navigateByUrl),\n // and that navigation results in 'replaceState' that leads to the same URL,\n // we should skip those.\n if (lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a popstate was emitted first.\n if (lastNavigation && source == 'hashchange' && lastNavigation.source === 'popstate' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a hashchange was emitted first.\n if (lastNavigation && source == 'popstate' && lastNavigation.source === 'hashchange' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n var /** @type {?} */ resolve = null;\n var /** @type {?} */ reject = null;\n var /** @type {?} */ promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n var /** @type {?} */ id = ++this.navigationId;\n this.navigations.next({ id: id, source: source, rawUrl: rawUrl, extras: extras, resolve: resolve, reject: reject, promise: promise });\n // Make sure that the error is propagated even though `processNavigations` catch\n // handler does not rethrow\n return promise.catch(function (e) { return Promise.reject(e); });\n };\n /**\n * @param {?} __0\n * @return {?}\n */\n Router.prototype.executeScheduledNavigation = /**\n * @param {?} __0\n * @return {?}\n */\n function (_a) {\n var _this = this;\n var id = _a.id, rawUrl = _a.rawUrl, extras = _a.extras, resolve = _a.resolve, reject = _a.reject;\n var /** @type {?} */ url = this.urlHandlingStrategy.extract(rawUrl);\n var /** @type {?} */ urlTransition = !this.navigated || url.toString() !== this.currentUrlTree.toString();\n if ((this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&\n this.urlHandlingStrategy.shouldProcessUrl(rawUrl)) {\n (/** @type {?} */ (this.events)).next(new NavigationStart(id, this.serializeUrl(url)));\n Promise.resolve()\n .then(function (_) {\n return _this.runNavigate(url, rawUrl, !!extras.skipLocationChange, !!extras.replaceUrl, id, null);\n })\n .then(resolve, reject);\n // we cannot process the current URL, but we could process the previous one =>\n // we need to do some cleanup\n }\n else if (urlTransition && this.rawUrlTree &&\n this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)) {\n (/** @type {?} */ (this.events)).next(new NavigationStart(id, this.serializeUrl(url)));\n Promise.resolve()\n .then(function (_) {\n return _this.runNavigate(url, rawUrl, false, false, id, createEmptyState(url, _this.rootComponentType).snapshot);\n })\n .then(resolve, reject);\n }\n else {\n this.rawUrlTree = rawUrl;\n resolve(null);\n }\n };\n /**\n * @param {?} url\n * @param {?} rawUrl\n * @param {?} skipLocationChange\n * @param {?} replaceUrl\n * @param {?} id\n * @param {?} precreatedState\n * @return {?}\n */\n Router.prototype.runNavigate = /**\n * @param {?} url\n * @param {?} rawUrl\n * @param {?} skipLocationChange\n * @param {?} replaceUrl\n * @param {?} id\n * @param {?} precreatedState\n * @return {?}\n */\n function (url, rawUrl, skipLocationChange, replaceUrl, id, precreatedState) {\n var _this = this;\n if (id !== this.navigationId) {\n (/** @type {?} */ (this.events))\n .next(new NavigationCancel(id, this.serializeUrl(url), \"Navigation ID \" + id + \" is not equal to the current navigation id \" + this.navigationId));\n return Promise.resolve(false);\n }\n return new Promise(function (resolvePromise, rejectPromise) {\n // create an observable of the url and route state snapshot\n // this operation do not result in any side effects\n var /** @type {?} */ urlAndSnapshot$;\n if (!precreatedState) {\n var /** @type {?} */ moduleInjector = _this.ngModule.injector;\n var /** @type {?} */ redirectsApplied$ = applyRedirects(moduleInjector, _this.configLoader, _this.urlSerializer, url, _this.config);\n urlAndSnapshot$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(redirectsApplied$, function (appliedUrl) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(recognize(_this.rootComponentType, _this.config, appliedUrl, _this.serializeUrl(appliedUrl), _this.paramsInheritanceStrategy), function (snapshot) {\n (/** @type {?} */ (_this.events))\n .next(new RoutesRecognized(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot));\n return { appliedUrl: appliedUrl, snapshot: snapshot };\n });\n });\n }\n else {\n urlAndSnapshot$ = Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])({ appliedUrl: url, snapshot: precreatedState });\n }\n var /** @type {?} */ beforePreactivationDone$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(urlAndSnapshot$, function (p) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.hooks.beforePreactivation(p.snapshot), function () { return p; });\n });\n // run preactivation: guards and data resolvers\n var /** @type {?} */ preActivation;\n var /** @type {?} */ preactivationSetup$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(beforePreactivationDone$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot;\n var /** @type {?} */ moduleInjector = _this.ngModule.injector;\n preActivation = new PreActivation(snapshot, _this.routerState.snapshot, moduleInjector, function (evt) { return _this.triggerEvent(evt); });\n preActivation.initialize(_this.rootContexts);\n return { appliedUrl: appliedUrl, snapshot: snapshot };\n });\n var /** @type {?} */ preactivationCheckGuards$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationSetup$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot;\n if (_this.navigationId !== id)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false);\n _this.triggerEvent(new GuardsCheckStart(id, _this.serializeUrl(url), appliedUrl, snapshot));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preActivation.checkGuards(), function (shouldActivate) {\n _this.triggerEvent(new GuardsCheckEnd(id, _this.serializeUrl(url), appliedUrl, snapshot, shouldActivate));\n return { appliedUrl: appliedUrl, snapshot: snapshot, shouldActivate: shouldActivate };\n });\n });\n var /** @type {?} */ preactivationResolveData$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationCheckGuards$, function (p) {\n if (_this.navigationId !== id)\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(false);\n if (p.shouldActivate && preActivation.isActivating()) {\n _this.triggerEvent(new ResolveStart(id, _this.serializeUrl(url), p.appliedUrl, p.snapshot));\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preActivation.resolveData(_this.paramsInheritanceStrategy), function () {\n _this.triggerEvent(new ResolveEnd(id, _this.serializeUrl(url), p.appliedUrl, p.snapshot));\n return p;\n });\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(p);\n }\n });\n var /** @type {?} */ preactivationDone$ = __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(preactivationResolveData$, function (p) {\n return __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(_this.hooks.afterPreactivation(p.snapshot), function () { return p; });\n });\n // create router state\n // this operation has side effects => route state is being affected\n var /** @type {?} */ routerState$ = __WEBPACK_IMPORTED_MODULE_7_rxjs_operator_map__[\"map\"].call(preactivationDone$, function (_a) {\n var appliedUrl = _a.appliedUrl, snapshot = _a.snapshot, shouldActivate = _a.shouldActivate;\n if (shouldActivate) {\n var /** @type {?} */ state = createRouterState(_this.routeReuseStrategy, snapshot, _this.routerState);\n return { appliedUrl: appliedUrl, state: state, shouldActivate: shouldActivate };\n }\n else {\n return { appliedUrl: appliedUrl, state: null, shouldActivate: shouldActivate };\n }\n });\n // applied the new router state\n // this operation has side effects\n var /** @type {?} */ navigationIsSuccessful;\n var /** @type {?} */ storedState = _this.routerState;\n var /** @type {?} */ storedUrl = _this.currentUrlTree;\n routerState$\n .forEach(function (_a) {\n var appliedUrl = _a.appliedUrl, state = _a.state, shouldActivate = _a.shouldActivate;\n if (!shouldActivate || id !== _this.navigationId) {\n navigationIsSuccessful = false;\n return;\n }\n _this.currentUrlTree = appliedUrl;\n _this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);\n (/** @type {?} */ (_this)).routerState = state;\n if (!skipLocationChange) {\n var /** @type {?} */ path = _this.urlSerializer.serialize(_this.rawUrlTree);\n if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {\n _this.location.replaceState(path);\n }\n else {\n _this.location.go(path);\n }\n }\n new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })\n .activate(_this.rootContexts);\n navigationIsSuccessful = true;\n })\n .then(function () {\n if (navigationIsSuccessful) {\n _this.navigated = true;\n (/** @type {?} */ (_this.events))\n .next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));\n resolvePromise(true);\n }\n else {\n _this.resetUrlToCurrentUrlTree();\n (/** @type {?} */ (_this.events))\n .next(new NavigationCancel(id, _this.serializeUrl(url), ''));\n resolvePromise(false);\n }\n }, function (e) {\n if (isNavigationCancelingError(e)) {\n _this.navigated = true;\n _this.resetStateAndUrl(storedState, storedUrl, rawUrl);\n (/** @type {?} */ (_this.events))\n .next(new NavigationCancel(id, _this.serializeUrl(url), e.message));\n resolvePromise(false);\n }\n else {\n _this.resetStateAndUrl(storedState, storedUrl, rawUrl);\n (/** @type {?} */ (_this.events))\n .next(new NavigationError(id, _this.serializeUrl(url), e));\n try {\n resolvePromise(_this.errorHandler(e));\n }\n catch (/** @type {?} */ ee) {\n rejectPromise(ee);\n }\n }\n });\n });\n };\n /**\n * @param {?} storedState\n * @param {?} storedUrl\n * @param {?} rawUrl\n * @return {?}\n */\n Router.prototype.resetStateAndUrl = /**\n * @param {?} storedState\n * @param {?} storedUrl\n * @param {?} rawUrl\n * @return {?}\n */\n function (storedState, storedUrl, rawUrl) {\n (/** @type {?} */ (this)).routerState = storedState;\n this.currentUrlTree = storedUrl;\n this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);\n this.resetUrlToCurrentUrlTree();\n };\n /**\n * @return {?}\n */\n Router.prototype.resetUrlToCurrentUrlTree = /**\n * @return {?}\n */\n function () {\n this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree));\n };\n return Router;\n}());\nvar ActivateRoutes = /** @class */ (function () {\n function ActivateRoutes(routeReuseStrategy, futureState, currState, forwardEvent) {\n this.routeReuseStrategy = routeReuseStrategy;\n this.futureState = futureState;\n this.currState = currState;\n this.forwardEvent = forwardEvent;\n }\n /**\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.activate = /**\n * @param {?} parentContexts\n * @return {?}\n */\n function (parentContexts) {\n var /** @type {?} */ futureRoot = this.futureState._root;\n var /** @type {?} */ currRoot = this.currState ? this.currState._root : null;\n this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);\n advanceActivatedRoute(this.futureState.root);\n this.activateChildRoutes(futureRoot, currRoot, parentContexts);\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateChildRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n function (futureNode, currNode, contexts) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(currNode);\n // Recurse on the routes active in the future state to de-activate deeper children\n futureNode.children.forEach(function (futureChild) {\n var /** @type {?} */ childOutletName = futureChild.value.outlet;\n _this.deactivateRoutes(futureChild, children[childOutletName], contexts);\n delete children[childOutletName];\n });\n // De-activate the routes that will not be re-used\n forEach(children, function (v, childName) {\n _this.deactivateRouteAndItsChildren(v, contexts);\n });\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContext\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContext\n * @return {?}\n */\n function (futureNode, currNode, parentContext) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n if (future === curr) {\n // Reusing the node, check to see if the children need to be de-activated\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n var /** @type {?} */ context = parentContext.getContext(future.outlet);\n if (context) {\n this.deactivateChildRoutes(futureNode, currNode, context.children);\n }\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.deactivateChildRoutes(futureNode, currNode, parentContext);\n }\n }\n else {\n if (curr) {\n // Deactivate the current route which will not be re-used\n this.deactivateRouteAndItsChildren(currNode, parentContext);\n }\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRouteAndItsChildren = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {\n this.detachAndStoreRouteSubtree(route, parentContexts);\n }\n else {\n this.deactivateRouteAndOutlet(route, parentContexts);\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.detachAndStoreRouteSubtree = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n var /** @type {?} */ context = parentContexts.getContext(route.value.outlet);\n if (context && context.outlet) {\n var /** @type {?} */ componentRef = context.outlet.detach();\n var /** @type {?} */ contexts = context.children.onOutletDeactivated();\n this.routeReuseStrategy.store(route.value.snapshot, { componentRef: componentRef, route: route, contexts: contexts });\n }\n };\n /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.deactivateRouteAndOutlet = /**\n * @param {?} route\n * @param {?} parentContexts\n * @return {?}\n */\n function (route, parentContexts) {\n var _this = this;\n var /** @type {?} */ context = parentContexts.getContext(route.value.outlet);\n if (context) {\n var /** @type {?} */ children = nodeChildrenAsMap(route);\n var /** @type {?} */ contexts_1 = route.value.component ? context.children : parentContexts;\n forEach(children, function (v, k) { return _this.deactivateRouteAndItsChildren(v, contexts_1); });\n if (context.outlet) {\n // Destroy the component\n context.outlet.deactivate();\n // Destroy the contexts for all the outlets that were in the component\n context.children.onOutletDeactivated();\n }\n }\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n ActivateRoutes.prototype.activateChildRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} contexts\n * @return {?}\n */\n function (futureNode, currNode, contexts) {\n var _this = this;\n var /** @type {?} */ children = nodeChildrenAsMap(currNode);\n futureNode.children.forEach(function (c) {\n _this.activateRoutes(c, children[c.value.outlet], contexts);\n _this.forwardEvent(new ActivationEnd(c.value.snapshot));\n });\n if (futureNode.children.length) {\n this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));\n }\n };\n /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @return {?}\n */\n ActivateRoutes.prototype.activateRoutes = /**\n * @param {?} futureNode\n * @param {?} currNode\n * @param {?} parentContexts\n * @return {?}\n */\n function (futureNode, currNode, parentContexts) {\n var /** @type {?} */ future = futureNode.value;\n var /** @type {?} */ curr = currNode ? currNode.value : null;\n advanceActivatedRoute(future);\n // reusing the node\n if (future === curr) {\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n var /** @type {?} */ context = parentContexts.getOrCreateContext(future.outlet);\n this.activateChildRoutes(futureNode, currNode, context.children);\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, currNode, parentContexts);\n }\n }\n else {\n if (future.component) {\n // if we have a normal route, we need to place the component into the outlet and recurse.\n var /** @type {?} */ context = parentContexts.getOrCreateContext(future.outlet);\n if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {\n var /** @type {?} */ stored = (/** @type {?} */ (this.routeReuseStrategy.retrieve(future.snapshot)));\n this.routeReuseStrategy.store(future.snapshot, null);\n context.children.onOutletReAttached(stored.contexts);\n context.attachRef = stored.componentRef;\n context.route = stored.route.value;\n if (context.outlet) {\n // Attach right away when the outlet has already been instantiated\n // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated\n context.outlet.attach(stored.componentRef, stored.route.value);\n }\n advanceActivatedRouteNodeAndItsChildren(stored.route);\n }\n else {\n var /** @type {?} */ config = parentLoadedConfig(future.snapshot);\n var /** @type {?} */ cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;\n context.route = future;\n context.resolver = cmpFactoryResolver;\n if (context.outlet) {\n // Activate the outlet when it has already been instantiated\n // Otherwise it will get activated from its `ngOnInit` when instantiated\n context.outlet.activateWith(future, cmpFactoryResolver);\n }\n this.activateChildRoutes(futureNode, null, context.children);\n }\n }\n else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, null, parentContexts);\n }\n }\n };\n return ActivateRoutes;\n}());\n/**\n * @param {?} node\n * @return {?}\n */\nfunction advanceActivatedRouteNodeAndItsChildren(node) {\n advanceActivatedRoute(node.value);\n node.children.forEach(advanceActivatedRouteNodeAndItsChildren);\n}\n/**\n * @param {?} snapshot\n * @return {?}\n */\nfunction parentLoadedConfig(snapshot) {\n for (var /** @type {?} */ s = snapshot.parent; s; s = s.parent) {\n var /** @type {?} */ route = s.routeConfig;\n if (route && route._loadedConfig)\n return route._loadedConfig;\n if (route && route.component)\n return null;\n }\n return null;\n}\n/**\n * @param {?} commands\n * @return {?}\n */\nfunction validateCommands(commands) {\n for (var /** @type {?} */ i = 0; i < commands.length; i++) {\n var /** @type {?} */ cmd = commands[i];\n if (cmd == null) {\n throw new Error(\"The requested path contains \" + cmd + \" segment at index \" + i);\n }\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Lets you link to specific parts of your app.\n *\n * \\@howToUse\n *\n * Consider the following route configuration:\n * `[{ path: 'user/:name', component: UserCmp }]`\n *\n * When linking to this `user/:name` route, you can write:\n * `<a routerLink='/user/bob'>link to user component</a>`\n *\n * \\@description\n *\n * The RouterLink directives let you link to specific parts of your app.\n *\n * When the link is static, you can use the directive as follows:\n * `<a routerLink=\"/user/bob\">link to user component</a>`\n *\n * If you use dynamic values to generate the link, you can pass an array of path\n * segments, followed by the params for each segment.\n *\n * For instance `['/team', teamId, 'user', userName, {details: true}]`\n * means that we want to generate a link to `/team/11/user/bob;details=true`.\n *\n * Multiple static segments can be merged into one\n * (e.g., `['/team/11/user', userName, {details: true}]`).\n *\n * The first segment name can be prepended with `/`, `./`, or `../`:\n * * If the first segment begins with `/`, the router will look up the route from the root of the\n * app.\n * * If the first segment begins with `./`, or doesn't begin with a slash, the router will\n * instead look in the children of the current activated route.\n * * And if the first segment begins with `../`, the router will go up one level.\n *\n * You can set query params and fragment as follows:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" fragment=\"education\">\n * link to user component\n * </a>\n * ```\n * RouterLink will use these to generate this link: `/user/bob#education?debug=true`.\n *\n * (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the\n * directive to preserve the current query params and fragment:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" preserveQueryParams preserveFragment>\n * link to user component\n * </a>\n * ```\n *\n * You can tell the directive to how to handle queryParams, available options are:\n * - `'merge'`: merge the queryParams into the current queryParams\n * - `'preserve'`: preserve the current queryParams\n * - default/`''`: use the queryParams only\n *\n * Same options for {\\@link NavigationExtras#queryParamsHandling\n * NavigationExtras#queryParamsHandling}.\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" queryParamsHandling=\"merge\">\n * link to user component\n * </a>\n * ```\n *\n * The router link directive always treats the provided input as a delta to the current url.\n *\n * For instance, if the current url is `/user/(box//aux:team)`.\n *\n * Then the following link `<a [routerLink]=\"['/user/jim']\">Jim</a>` will generate the link\n * `/user/(jim//aux:team)`.\n *\n * See {\\@link Router#createUrlTree createUrlTree} for more information.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLink = /** @class */ (function () {\n function RouterLink(router, route, tabIndex, renderer, el) {\n this.router = router;\n this.route = route;\n this.commands = [];\n if (tabIndex == null) {\n renderer.setAttribute(el.nativeElement, 'tabindex', '0');\n }\n }\n Object.defineProperty(RouterLink.prototype, \"routerLink\", {\n set: /**\n * @param {?} commands\n * @return {?}\n */\n function (commands) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n }\n else {\n this.commands = [];\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterLink.prototype, \"preserveQueryParams\", {\n set: /**\n * @deprecated 4.0.0 use `queryParamsHandling` instead.\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated!, use queryParamsHandling instead.');\n }\n this.preserve = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n RouterLink.prototype.onClick = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return true;\n };\n Object.defineProperty(RouterLink.prototype, \"urlTree\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.router.createUrlTree(this.commands, {\n relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n },\n enumerable: true,\n configurable: true\n });\n RouterLink.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: ':not(a)[routerLink]' },] },\n ];\n /** @nocollapse */\n RouterLink.ctorParameters = function () { return [\n { type: Router, },\n { type: ActivatedRoute, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Attribute\"], args: ['tabindex',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n ]; };\n RouterLink.propDecorators = {\n \"queryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"fragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParamsHandling\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveFragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"skipLocationChange\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"replaceUrl\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"routerLink\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveQueryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"onClick\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostListener\"], args: ['click',] },],\n };\n return RouterLink;\n}());\n/**\n * \\@whatItDoes Lets you link to specific parts of your app.\n *\n * See {\\@link RouterLink} for more information.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLinkWithHref = /** @class */ (function () {\n function RouterLinkWithHref(router, route, locationStrategy) {\n var _this = this;\n this.router = router;\n this.route = route;\n this.locationStrategy = locationStrategy;\n this.commands = [];\n this.subscription = router.events.subscribe(function (s) {\n if (s instanceof NavigationEnd) {\n _this.updateTargetUrlAndHref();\n }\n });\n }\n Object.defineProperty(RouterLinkWithHref.prototype, \"routerLink\", {\n set: /**\n * @param {?} commands\n * @return {?}\n */\n function (commands) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n }\n else {\n this.commands = [];\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterLinkWithHref.prototype, \"preserveQueryParams\", {\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n this.preserve = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n RouterLinkWithHref.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) { this.updateTargetUrlAndHref(); };\n /**\n * @return {?}\n */\n RouterLinkWithHref.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @param {?} button\n * @param {?} ctrlKey\n * @param {?} metaKey\n * @param {?} shiftKey\n * @return {?}\n */\n RouterLinkWithHref.prototype.onClick = /**\n * @param {?} button\n * @param {?} ctrlKey\n * @param {?} metaKey\n * @param {?} shiftKey\n * @return {?}\n */\n function (button, ctrlKey, metaKey, shiftKey) {\n if (button !== 0 || ctrlKey || metaKey || shiftKey) {\n return true;\n }\n if (typeof this.target === 'string' && this.target != '_self') {\n return true;\n }\n var /** @type {?} */ extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return false;\n };\n /**\n * @return {?}\n */\n RouterLinkWithHref.prototype.updateTargetUrlAndHref = /**\n * @return {?}\n */\n function () {\n this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));\n };\n Object.defineProperty(RouterLinkWithHref.prototype, \"urlTree\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.router.createUrlTree(this.commands, {\n relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n },\n enumerable: true,\n configurable: true\n });\n RouterLinkWithHref.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'a[routerLink]' },] },\n ];\n /** @nocollapse */\n RouterLinkWithHref.ctorParameters = function () { return [\n { type: Router, },\n { type: ActivatedRoute, },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LocationStrategy\"], },\n ]; };\n RouterLinkWithHref.propDecorators = {\n \"target\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostBinding\"], args: ['attr.target',] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"fragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"queryParamsHandling\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveFragment\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"skipLocationChange\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"replaceUrl\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"href\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostBinding\"] },],\n \"routerLink\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"preserveQueryParams\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"onClick\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"HostListener\"], args: ['click', ['$event.button', '$event.ctrlKey', '$event.metaKey', '$event.shiftKey'],] },],\n };\n return RouterLinkWithHref;\n}());\n/**\n * @param {?} s\n * @return {?}\n */\nfunction attrBoolValue(s) {\n return s === '' || !!s;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Lets you add a CSS class to an element when the link's route becomes active.\n *\n * \\@howToUse\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\">Bob</a>\n * ```\n *\n * \\@description\n *\n * The RouterLinkActive directive lets you add a CSS class to an element when the link's route\n * becomes active.\n *\n * Consider the following example:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\">Bob</a>\n * ```\n *\n * When the url is either '/user' or '/user/bob', the active-link class will\n * be added to the `a` tag. If the url changes, the class will be removed.\n *\n * You can set more than one class, as follows:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"class1 class2\">Bob</a>\n * <a routerLink=\"/user/bob\" [routerLinkActive]=\"['class1', 'class2']\">Bob</a>\n * ```\n *\n * You can configure RouterLinkActive by passing `exact: true`. This will add the classes\n * only when the url matches the link exactly.\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact:\n * true}\">Bob</a>\n * ```\n *\n * You can assign the RouterLinkActive instance to a template variable and directly check\n * the `isActive` status.\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive #rla=\"routerLinkActive\">\n * Bob {{ rla.isActive ? '(already open)' : ''}}\n * </a>\n * ```\n *\n * Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink.\n *\n * ```\n * <div routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact: true}\">\n * <a routerLink=\"/user/jim\">Jim</a>\n * <a routerLink=\"/user/bob\">Bob</a>\n * </div>\n * ```\n *\n * This will set the active-link class on the div tag if the url is either '/user/jim' or\n * '/user/bob'.\n *\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterLinkActive = /** @class */ (function () {\n function RouterLinkActive(router, element, renderer, cdr) {\n var _this = this;\n this.router = router;\n this.element = element;\n this.renderer = renderer;\n this.cdr = cdr;\n this.classes = [];\n this.isActive = false;\n this.routerLinkActiveOptions = { exact: false };\n this.subscription = router.events.subscribe(function (s) {\n if (s instanceof NavigationEnd) {\n _this.update();\n }\n });\n }\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.ngAfterContentInit = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.links.changes.subscribe(function (_) { return _this.update(); });\n this.linksWithHrefs.changes.subscribe(function (_) { return _this.update(); });\n this.update();\n };\n Object.defineProperty(RouterLinkActive.prototype, \"routerLinkActive\", {\n set: /**\n * @param {?} data\n * @return {?}\n */\n function (data) {\n var /** @type {?} */ classes = Array.isArray(data) ? data : data.split(' ');\n this.classes = classes.filter(function (c) { return !!c; });\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} changes\n * @return {?}\n */\n RouterLinkActive.prototype.ngOnChanges = /**\n * @param {?} changes\n * @return {?}\n */\n function (changes) { this.update(); };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.update = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!this.links || !this.linksWithHrefs || !this.router.navigated)\n return;\n Promise.resolve().then(function () {\n var /** @type {?} */ hasActiveLinks = _this.hasActiveLinks();\n if (_this.isActive !== hasActiveLinks) {\n (/** @type {?} */ (_this)).isActive = hasActiveLinks;\n _this.classes.forEach(function (c) {\n if (hasActiveLinks) {\n _this.renderer.addClass(_this.element.nativeElement, c);\n }\n else {\n _this.renderer.removeClass(_this.element.nativeElement, c);\n }\n });\n }\n });\n };\n /**\n * @param {?} router\n * @return {?}\n */\n RouterLinkActive.prototype.isLinkActive = /**\n * @param {?} router\n * @return {?}\n */\n function (router) {\n var _this = this;\n return function (link) {\n return router.isActive(link.urlTree, _this.routerLinkActiveOptions.exact);\n };\n };\n /**\n * @return {?}\n */\n RouterLinkActive.prototype.hasActiveLinks = /**\n * @return {?}\n */\n function () {\n return this.links.some(this.isLinkActive(this.router)) ||\n this.linksWithHrefs.some(this.isLinkActive(this.router));\n };\n RouterLinkActive.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{\n selector: '[routerLinkActive]',\n exportAs: 'routerLinkActive',\n },] },\n ];\n /** @nocollapse */\n RouterLinkActive.ctorParameters = function () { return [\n { type: Router, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n RouterLinkActive.propDecorators = {\n \"links\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ContentChildren\"], args: [RouterLink, { descendants: true },] },],\n \"linksWithHrefs\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ContentChildren\"], args: [RouterLinkWithHref, { descendants: true },] },],\n \"routerLinkActiveOptions\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n \"routerLinkActive\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Input\"] },],\n };\n return RouterLinkActive;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Store contextual information about a {\\@link RouterOutlet}\n *\n * \\@stable\n */\nvar OutletContext = /** @class */ (function () {\n function OutletContext() {\n this.outlet = null;\n this.route = null;\n this.resolver = null;\n this.children = new ChildrenOutletContexts();\n this.attachRef = null;\n }\n return OutletContext;\n}());\n/**\n * Store contextual information about the children (= nested) {\\@link RouterOutlet}\n *\n * \\@stable\n */\nvar ChildrenOutletContexts = /** @class */ (function () {\n function ChildrenOutletContexts() {\n this.contexts = new Map();\n }\n /** Called when a `RouterOutlet` directive is instantiated */\n /**\n * Called when a `RouterOutlet` directive is instantiated\n * @param {?} childName\n * @param {?} outlet\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onChildOutletCreated = /**\n * Called when a `RouterOutlet` directive is instantiated\n * @param {?} childName\n * @param {?} outlet\n * @return {?}\n */\n function (childName, outlet) {\n var /** @type {?} */ context = this.getOrCreateContext(childName);\n context.outlet = outlet;\n this.contexts.set(childName, context);\n };\n /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n */\n /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onChildOutletDestroyed = /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n * @param {?} childName\n * @return {?}\n */\n function (childName) {\n var /** @type {?} */ context = this.getContext(childName);\n if (context) {\n context.outlet = null;\n }\n };\n /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n */\n /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onOutletDeactivated = /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n * @return {?}\n */\n function () {\n var /** @type {?} */ contexts = this.contexts;\n this.contexts = new Map();\n return contexts;\n };\n /**\n * @param {?} contexts\n * @return {?}\n */\n ChildrenOutletContexts.prototype.onOutletReAttached = /**\n * @param {?} contexts\n * @return {?}\n */\n function (contexts) { this.contexts = contexts; };\n /**\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.getOrCreateContext = /**\n * @param {?} childName\n * @return {?}\n */\n function (childName) {\n var /** @type {?} */ context = this.getContext(childName);\n if (!context) {\n context = new OutletContext();\n this.contexts.set(childName, context);\n }\n return context;\n };\n /**\n * @param {?} childName\n * @return {?}\n */\n ChildrenOutletContexts.prototype.getContext = /**\n * @param {?} childName\n * @return {?}\n */\n function (childName) { return this.contexts.get(childName) || null; };\n return ChildrenOutletContexts;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Acts as a placeholder that Angular dynamically fills based on the current router\n * state.\n *\n * \\@howToUse\n *\n * ```\n * <router-outlet></router-outlet>\n * <router-outlet name='left'></router-outlet>\n * <router-outlet name='right'></router-outlet>\n * ```\n *\n * A router outlet will emit an activate event any time a new component is being instantiated,\n * and a deactivate event when it is being destroyed.\n *\n * ```\n * <router-outlet\n * (activate)='onActivate($event)'\n * (deactivate)='onDeactivate($event)'></router-outlet>\n * ```\n * \\@ngModule RouterModule\n *\n * \\@stable\n */\nvar RouterOutlet = /** @class */ (function () {\n function RouterOutlet(parentContexts, location, resolver, name, changeDetector) {\n this.parentContexts = parentContexts;\n this.location = location;\n this.resolver = resolver;\n this.changeDetector = changeDetector;\n this.activated = null;\n this._activatedRoute = null;\n this.activateEvents = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n this.deactivateEvents = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"EventEmitter\"]();\n this.name = name || PRIMARY_OUTLET;\n parentContexts.onChildOutletCreated(this.name, this);\n }\n /**\n * @return {?}\n */\n RouterOutlet.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.parentContexts.onChildOutletDestroyed(this.name); };\n /**\n * @return {?}\n */\n RouterOutlet.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n if (!this.activated) {\n // If the outlet was not instantiated at the time the route got activated we need to populate\n // the outlet when it is initialized (ie inside a NgIf)\n var /** @type {?} */ context = this.parentContexts.getContext(this.name);\n if (context && context.route) {\n if (context.attachRef) {\n // `attachRef` is populated when there is an existing component to mount\n this.attach(context.attachRef, context.route);\n }\n else {\n // otherwise the component defined in the configuration is created\n this.activateWith(context.route, context.resolver || null);\n }\n }\n }\n };\n Object.defineProperty(RouterOutlet.prototype, \"isActivated\", {\n get: /**\n * @return {?}\n */\n function () { return !!this.activated; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"component\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n return this.activated.instance;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"activatedRoute\", {\n get: /**\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n return /** @type {?} */ (this._activatedRoute);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RouterOutlet.prototype, \"activatedRouteData\", {\n get: /**\n * @return {?}\n */\n function () {\n if (this._activatedRoute) {\n return this._activatedRoute.snapshot.data;\n }\n return {};\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n */\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n * @return {?}\n */\n RouterOutlet.prototype.detach = /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n * @return {?}\n */\n function () {\n if (!this.activated)\n throw new Error('Outlet is not activated');\n this.location.detach();\n var /** @type {?} */ cmp = this.activated;\n this.activated = null;\n this._activatedRoute = null;\n return cmp;\n };\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n */\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n * @param {?} ref\n * @param {?} activatedRoute\n * @return {?}\n */\n RouterOutlet.prototype.attach = /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n * @param {?} ref\n * @param {?} activatedRoute\n * @return {?}\n */\n function (ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n };\n /**\n * @return {?}\n */\n RouterOutlet.prototype.deactivate = /**\n * @return {?}\n */\n function () {\n if (this.activated) {\n var /** @type {?} */ c = this.component;\n this.activated.destroy();\n this.activated = null;\n this._activatedRoute = null;\n this.deactivateEvents.emit(c);\n }\n };\n /**\n * @param {?} activatedRoute\n * @param {?} resolver\n * @return {?}\n */\n RouterOutlet.prototype.activateWith = /**\n * @param {?} activatedRoute\n * @param {?} resolver\n * @return {?}\n */\n function (activatedRoute, resolver) {\n if (this.isActivated) {\n throw new Error('Cannot activate an already activated outlet');\n }\n this._activatedRoute = activatedRoute;\n var /** @type {?} */ snapshot = activatedRoute._futureSnapshot;\n var /** @type {?} */ component = /** @type {?} */ (/** @type {?} */ ((snapshot.routeConfig)).component);\n resolver = resolver || this.resolver;\n var /** @type {?} */ factory = resolver.resolveComponentFactory(component);\n var /** @type {?} */ childContexts = this.parentContexts.getOrCreateContext(this.name).children;\n var /** @type {?} */ injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);\n this.activated = this.location.createComponent(factory, this.location.length, injector);\n // Calling `markForCheck` to make sure we will run the change detection when the\n // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.\n this.changeDetector.markForCheck();\n this.activateEvents.emit(this.activated.instance);\n };\n RouterOutlet.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Directive\"], args: [{ selector: 'router-outlet', exportAs: 'outlet' },] },\n ];\n /** @nocollapse */\n RouterOutlet.ctorParameters = function () { return [\n { type: ChildrenOutletContexts, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactoryResolver\"], },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Attribute\"], args: ['name',] },] },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n RouterOutlet.propDecorators = {\n \"activateEvents\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['activate',] },],\n \"deactivateEvents\": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Output\"], args: ['deactivate',] },],\n };\n return RouterOutlet;\n}());\nvar OutletInjector = /** @class */ (function () {\n function OutletInjector(route, childContexts, parent) {\n this.route = route;\n this.childContexts = childContexts;\n this.parent = parent;\n }\n /**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\n OutletInjector.prototype.get = /**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\n function (token, notFoundValue) {\n if (token === ActivatedRoute) {\n return this.route;\n }\n if (token === ChildrenOutletContexts) {\n return this.childContexts;\n }\n return this.parent.get(token, notFoundValue);\n };\n return OutletInjector;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n*@license\n*Copyright Google Inc. All Rights Reserved.\n*\n*Use of this source code is governed by an MIT-style license that can be\n*found in the LICENSE file at https://angular.io/license\n*/\n/**\n * \\@whatItDoes Provides a preloading strategy.\n *\n * \\@experimental\n * @abstract\n */\nvar PreloadingStrategy = /** @class */ (function () {\n function PreloadingStrategy() {\n }\n return PreloadingStrategy;\n}());\n/**\n * \\@whatItDoes Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * \\@howToUse\n *\n * ```\n * RouteModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * \\@experimental\n */\nvar PreloadAllModules = /** @class */ (function () {\n function PreloadAllModules() {\n }\n /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n PreloadAllModules.prototype.preload = /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n function (route, fn) {\n return __WEBPACK_IMPORTED_MODULE_11_rxjs_operator_catch__[\"_catch\"].call(fn(), function () { return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null); });\n };\n return PreloadAllModules;\n}());\n/**\n * \\@whatItDoes Provides a preloading strategy that does not preload any modules.\n *\n * \\@description\n *\n * This strategy is enabled by default.\n *\n * \\@experimental\n */\nvar NoPreloading = /** @class */ (function () {\n function NoPreloading() {\n }\n /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n NoPreloading.prototype.preload = /**\n * @param {?} route\n * @param {?} fn\n * @return {?}\n */\n function (route, fn) { return Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null); };\n return NoPreloading;\n}());\n/**\n * The preloader optimistically loads all router configurations to\n * make navigations into lazily-loaded sections of the application faster.\n *\n * The preloader runs in the background. When the router bootstraps, the preloader\n * starts listening to all navigation events. After every such event, the preloader\n * will check if any configurations can be loaded lazily.\n *\n * If a route is protected by `canLoad` guards, the preloaded will not load it.\n *\n * \\@stable\n */\nvar RouterPreloader = /** @class */ (function () {\n function RouterPreloader(router, moduleLoader, compiler, injector, preloadingStrategy) {\n this.router = router;\n this.injector = injector;\n this.preloadingStrategy = preloadingStrategy;\n var /** @type {?} */ onStartLoad = function (r) { return router.triggerEvent(new RouteConfigLoadStart(r)); };\n var /** @type {?} */ onEndLoad = function (r) { return router.triggerEvent(new RouteConfigLoadEnd(r)); };\n this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);\n }\n /**\n * @return {?}\n */\n RouterPreloader.prototype.setUpPreloading = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ navigations$ = __WEBPACK_IMPORTED_MODULE_21_rxjs_operator_filter__[\"filter\"].call(this.router.events, function (e) { return e instanceof NavigationEnd; });\n this.subscription = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_concatMap__[\"concatMap\"].call(navigations$, function () { return _this.preload(); }).subscribe(function () { });\n };\n /**\n * @return {?}\n */\n RouterPreloader.prototype.preload = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ ngModule = this.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n return this.processRoutes(ngModule, this.router.config);\n };\n // TODO(jasonaden): This class relies on code external to the class to call setUpPreloading. If\n // this hasn't been done, ngOnDestroy will fail as this.subscription will be undefined. This\n // should be refactored.\n /**\n * @return {?}\n */\n RouterPreloader.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () { this.subscription.unsubscribe(); };\n /**\n * @param {?} ngModule\n * @param {?} routes\n * @return {?}\n */\n RouterPreloader.prototype.processRoutes = /**\n * @param {?} ngModule\n * @param {?} routes\n * @return {?}\n */\n function (ngModule, routes) {\n var /** @type {?} */ res = [];\n for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {\n var route = routes_1[_i];\n // we already have the config loaded, just recurse\n if (route.loadChildren && !route.canLoad && route._loadedConfig) {\n var /** @type {?} */ childConfig = route._loadedConfig;\n res.push(this.processRoutes(childConfig.module, childConfig.routes));\n // no config loaded, fetch the config\n }\n else if (route.loadChildren && !route.canLoad) {\n res.push(this.preloadConfig(ngModule, route));\n // recurse into children\n }\n else if (route.children) {\n res.push(this.processRoutes(ngModule, route.children));\n }\n }\n return __WEBPACK_IMPORTED_MODULE_18_rxjs_operator_mergeAll__[\"mergeAll\"].call(Object(__WEBPACK_IMPORTED_MODULE_10_rxjs_observable_from__[\"from\"])(res));\n };\n /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n RouterPreloader.prototype.preloadConfig = /**\n * @param {?} ngModule\n * @param {?} route\n * @return {?}\n */\n function (ngModule, route) {\n var _this = this;\n return this.preloadingStrategy.preload(route, function () {\n var /** @type {?} */ loaded$ = _this.loader.load(ngModule.injector, route);\n return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_mergeMap__[\"mergeMap\"].call(loaded$, function (config) {\n route._loadedConfig = config;\n return _this.processRoutes(config.module, config.routes);\n });\n });\n };\n RouterPreloader.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RouterPreloader.ctorParameters = function () { return [\n { type: Router, },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], },\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n { type: PreloadingStrategy, },\n ]; };\n return RouterPreloader;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@whatItDoes Contains a list of directives\n * \\@stable\n */\nvar ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive];\n/**\n * \\@whatItDoes Is used in DI to configure the router.\n * \\@stable\n */\nvar ROUTER_CONFIGURATION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTER_CONFIGURATION');\n/**\n * \\@docsNotRequired\n */\nvar ROUTER_FORROOT_GUARD = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ROUTER_FORROOT_GUARD');\nvar ROUTER_PROVIDERS = [\n __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"Location\"],\n { provide: UrlSerializer, useClass: DefaultUrlSerializer },\n {\n provide: Router,\n useFactory: setupRouter,\n deps: [\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"], UrlSerializer, ChildrenOutletContexts, __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"Location\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"],\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], ROUTES, ROUTER_CONFIGURATION,\n [UrlHandlingStrategy, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()], [RouteReuseStrategy, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()]\n ]\n },\n ChildrenOutletContexts,\n { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactoryLoader\"], useClass: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SystemJsNgModuleLoader\"] },\n RouterPreloader,\n NoPreloading,\n PreloadAllModules,\n { provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },\n];\n/**\n * @return {?}\n */\nfunction routerNgProbeToken() {\n return new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"]('Router', Router);\n}\n/**\n * \\@whatItDoes Adds router directives and providers.\n *\n * \\@howToUse\n *\n * RouterModule can be imported multiple times: once per lazily-loaded bundle.\n * Since the router deals with a global shared resource--location, we cannot have\n * more than one router service active.\n *\n * That is why there are two ways to create the module: `RouterModule.forRoot` and\n * `RouterModule.forChild`.\n *\n * * `forRoot` creates a module that contains all the directives, the given routes, and the router\n * service itself.\n * * `forChild` creates a module that contains all the directives and the given routes, but does not\n * include the router service.\n *\n * When registered at the root, the module should be used as follows\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forRoot(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * For submodules and lazy loaded submodules the module should be used as follows:\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forChild(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * \\@description\n *\n * Managing state transitions is one of the hardest parts of building applications. This is\n * especially true on the web, where you also need to ensure that the state is reflected in the URL.\n * In addition, we often want to split applications into multiple bundles and load them on demand.\n * Doing this transparently is not trivial.\n *\n * The Angular router solves these problems. Using the router, you can declaratively specify\n * application states, manage state transitions while taking care of the URL, and load bundles on\n * demand.\n *\n * [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an\n * overview of how the router should be used.\n *\n * \\@stable\n */\nvar RouterModule = /** @class */ (function () {\n // Note: We are injecting the Router so it gets created eagerly...\n function RouterModule(guard, router) {\n }\n /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {@link ExtraOptions} for more details.\n */\n /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {\\@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {\\@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {\\@link ExtraOptions} for more details.\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n RouterModule.forRoot = /**\n * Creates a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Options (see {\\@link ExtraOptions}):\n * * `enableTracing` makes the router log all its internal events to the console.\n * * `useHash` enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` disables the initial navigation.\n * * `errorHandler` provides a custom error handler.\n * * `preloadingStrategy` configures a preloading strategy (see {\\@link PreloadAllModules}).\n * * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See\n * {\\@link ExtraOptions} for more details.\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n function (routes, config) {\n return {\n ngModule: RouterModule,\n providers: [\n ROUTER_PROVIDERS,\n provideRoutes(routes),\n {\n provide: ROUTER_FORROOT_GUARD,\n useFactory: provideForRootGuard,\n deps: [[Router, new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SkipSelf\"]()]]\n },\n { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LocationStrategy\"],\n useFactory: provideLocationStrategy,\n deps: [\n __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PlatformLocation\"], [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"APP_BASE_HREF\"]), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"]()], ROUTER_CONFIGURATION\n ]\n },\n {\n provide: PreloadingStrategy,\n useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :\n NoPreloading\n },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgProbeToken\"], multi: true, useFactory: routerNgProbeToken },\n provideRouterInitializer(),\n ],\n };\n };\n /**\n * Creates a module with all the router directives and a provider registering routes.\n */\n /**\n * Creates a module with all the router directives and a provider registering routes.\n * @param {?} routes\n * @return {?}\n */\n RouterModule.forChild = /**\n * Creates a module with all the router directives and a provider registering routes.\n * @param {?} routes\n * @return {?}\n */\n function (routes) {\n return { ngModule: RouterModule, providers: [provideRoutes(routes)] };\n };\n RouterModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModule\"], args: [{ declarations: ROUTER_DIRECTIVES, exports: ROUTER_DIRECTIVES },] },\n ];\n /** @nocollapse */\n RouterModule.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"], args: [ROUTER_FORROOT_GUARD,] },] },\n { type: Router, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"] },] },\n ]; };\n return RouterModule;\n}());\n/**\n * @param {?} platformLocationStrategy\n * @param {?} baseHref\n * @param {?=} options\n * @return {?}\n */\nfunction provideLocationStrategy(platformLocationStrategy, baseHref, options) {\n if (options === void 0) { options = {}; }\n return options.useHash ? new __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"HashLocationStrategy\"](platformLocationStrategy, baseHref) :\n new __WEBPACK_IMPORTED_MODULE_0__angular_common__[\"PathLocationStrategy\"](platformLocationStrategy, baseHref);\n}\n/**\n * @param {?} router\n * @return {?}\n */\nfunction provideForRootGuard(router) {\n if (router) {\n throw new Error(\"RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.\");\n }\n return 'guarded';\n}\n/**\n * \\@whatItDoes Registers routes.\n *\n * \\@howToUse\n *\n * ```\n * \\@NgModule({\n * imports: [RouterModule.forChild(ROUTES)],\n * providers: [provideRoutes(EXTRA_ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * \\@stable\n * @param {?} routes\n * @return {?}\n */\nfunction provideRoutes(routes) {\n return [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ANALYZE_FOR_ENTRY_COMPONENTS\"], multi: true, useValue: routes },\n { provide: ROUTES, multi: true, useValue: routes },\n ];\n}\n/**\n * \\@whatItDoes Represents options to configure the router.\n *\n * \\@stable\n * @record\n */\n\n/**\n * @param {?} ref\n * @param {?} urlSerializer\n * @param {?} contexts\n * @param {?} location\n * @param {?} injector\n * @param {?} loader\n * @param {?} compiler\n * @param {?} config\n * @param {?=} opts\n * @param {?=} urlHandlingStrategy\n * @param {?=} routeReuseStrategy\n * @return {?}\n */\nfunction setupRouter(ref, urlSerializer, contexts, location, injector, loader, compiler, config, opts, urlHandlingStrategy, routeReuseStrategy) {\n if (opts === void 0) { opts = {}; }\n var /** @type {?} */ router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n if (opts.errorHandler) {\n router.errorHandler = opts.errorHandler;\n }\n if (opts.enableTracing) {\n var /** @type {?} */ dom_1 = Object(__WEBPACK_IMPORTED_MODULE_20__angular_platform_browser__[\"ɵgetDOM\"])();\n router.events.subscribe(function (e) {\n dom_1.logGroup(\"Router Event: \" + ((/** @type {?} */ (e.constructor))).name);\n dom_1.log(e.toString());\n dom_1.log(e);\n dom_1.logGroupEnd();\n });\n }\n if (opts.onSameUrlNavigation) {\n router.onSameUrlNavigation = opts.onSameUrlNavigation;\n }\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n return router;\n}\n/**\n * @param {?} router\n * @return {?}\n */\nfunction rootRoute(router) {\n return router.routerState.root;\n}\n/**\n * To initialize the router properly we need to do in two steps:\n *\n * We need to start the navigation in a APP_INITIALIZER to block the bootstrap if\n * a resolver or a guards executes asynchronously. Second, we need to actually run\n * activation in a BOOTSTRAP_LISTENER. We utilize the afterPreactivation\n * hook provided by the router to do that.\n *\n * The router navigation starts, reaches the point when preactivation is done, and then\n * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.\n */\nvar RouterInitializer = /** @class */ (function () {\n function RouterInitializer(injector) {\n this.injector = injector;\n this.initNavigation = false;\n this.resultOfPreactivationDone = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n }\n /**\n * @return {?}\n */\n RouterInitializer.prototype.appInitializer = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ p = this.injector.get(__WEBPACK_IMPORTED_MODULE_0__angular_common__[\"LOCATION_INITIALIZED\"], Promise.resolve(null));\n return p.then(function () {\n var /** @type {?} */ resolve = /** @type {?} */ ((null));\n var /** @type {?} */ res = new Promise(function (r) { return resolve = r; });\n var /** @type {?} */ router = _this.injector.get(Router);\n var /** @type {?} */ opts = _this.injector.get(ROUTER_CONFIGURATION);\n if (_this.isLegacyDisabled(opts) || _this.isLegacyEnabled(opts)) {\n resolve(true);\n }\n else if (opts.initialNavigation === 'disabled') {\n router.setUpLocationChangeListener();\n resolve(true);\n }\n else if (opts.initialNavigation === 'enabled') {\n router.hooks.afterPreactivation = function () {\n // only the initial navigation should be delayed\n if (!_this.initNavigation) {\n _this.initNavigation = true;\n resolve(true);\n return _this.resultOfPreactivationDone;\n // subsequent navigations should not be delayed\n }\n else {\n return /** @type {?} */ (Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_of__[\"of\"])(null));\n }\n };\n router.initialNavigation();\n }\n else {\n throw new Error(\"Invalid initialNavigation options: '\" + opts.initialNavigation + \"'\");\n }\n return res;\n });\n };\n /**\n * @param {?} bootstrappedComponentRef\n * @return {?}\n */\n RouterInitializer.prototype.bootstrapListener = /**\n * @param {?} bootstrappedComponentRef\n * @return {?}\n */\n function (bootstrappedComponentRef) {\n var /** @type {?} */ opts = this.injector.get(ROUTER_CONFIGURATION);\n var /** @type {?} */ preloader = this.injector.get(RouterPreloader);\n var /** @type {?} */ router = this.injector.get(Router);\n var /** @type {?} */ ref = this.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ApplicationRef\"]);\n if (bootstrappedComponentRef !== ref.components[0]) {\n return;\n }\n if (this.isLegacyEnabled(opts)) {\n router.initialNavigation();\n }\n else if (this.isLegacyDisabled(opts)) {\n router.setUpLocationChangeListener();\n }\n preloader.setUpPreloading();\n router.resetRootComponentType(ref.componentTypes[0]);\n this.resultOfPreactivationDone.next(/** @type {?} */ ((null)));\n this.resultOfPreactivationDone.complete();\n };\n /**\n * @param {?} opts\n * @return {?}\n */\n RouterInitializer.prototype.isLegacyEnabled = /**\n * @param {?} opts\n * @return {?}\n */\n function (opts) {\n return opts.initialNavigation === 'legacy_enabled' || opts.initialNavigation === true ||\n opts.initialNavigation === undefined;\n };\n /**\n * @param {?} opts\n * @return {?}\n */\n RouterInitializer.prototype.isLegacyDisabled = /**\n * @param {?} opts\n * @return {?}\n */\n function (opts) {\n return opts.initialNavigation === 'legacy_disabled' || opts.initialNavigation === false;\n };\n RouterInitializer.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n RouterInitializer.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], },\n ]; };\n return RouterInitializer;\n}());\n/**\n * @param {?} r\n * @return {?}\n */\nfunction getAppInitializer(r) {\n return r.appInitializer.bind(r);\n}\n/**\n * @param {?} r\n * @return {?}\n */\nfunction getBootstrapListener(r) {\n return r.bootstrapListener.bind(r);\n}\n/**\n * A token for the router initializer that will be called after the app is bootstrapped.\n *\n * \\@experimental\n */\nvar ROUTER_INITIALIZER = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('Router Initializer');\n/**\n * @return {?}\n */\nfunction provideRouterInitializer() {\n return [\n RouterInitializer,\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_INITIALIZER\"],\n multi: true,\n useFactory: getAppInitializer,\n deps: [RouterInitializer]\n },\n { provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"APP_BOOTSTRAP_LISTENER\"], multi: true, useExisting: ROUTER_INITIALIZER },\n ];\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=router.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvcm91dGVyL2VzbTUvcm91dGVyLmpzPzZkZjMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZSBBbmd1bGFyIHY1LjIuMlxuICogKGMpIDIwMTAtMjAxOCBHb29nbGUsIEluYy4gaHR0cHM6Ly9hbmd1bGFyLmlvL1xuICogTGljZW5zZTogTUlUXG4gKi9cbmltcG9ydCB7IEFQUF9CQVNFX0hSRUYsIEhhc2hMb2NhdGlvblN0cmF0ZWd5LCBMT0NBVElPTl9JTklUSUFMSVpFRCwgTG9jYXRpb24sIExvY2F0aW9uU3RyYXRlZ3ksIFBhdGhMb2NhdGlvblN0cmF0ZWd5LCBQbGF0Zm9ybUxvY2F0aW9uIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IEFOQUxZWkVfRk9SX0VOVFJZX0NPTVBPTkVOVFMsIEFQUF9CT09UU1RSQVBfTElTVEVORVIsIEFQUF9JTklUSUFMSVpFUiwgQXBwbGljYXRpb25SZWYsIEF0dHJpYnV0ZSwgQ2hhbmdlRGV0ZWN0b3JSZWYsIENvbXBpbGVyLCBDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIsIENvbnRlbnRDaGlsZHJlbiwgRGlyZWN0aXZlLCBFbGVtZW50UmVmLCBFdmVudEVtaXR0ZXIsIEhvc3RCaW5kaW5nLCBIb3N0TGlzdGVuZXIsIEluamVjdCwgSW5qZWN0YWJsZSwgSW5qZWN0aW9uV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mFtcy5oYXNPd25Qcm9wZXJ0eShuYW1lKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFBhcmFtc0FzTWFwLnByb3RvdHlwZS5nZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgIGlmICh0aGlzLmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdiA9IHRoaXMucGFyYW1zW25hbWVdO1xuICAgICAgICAgICAgcmV0dXJuIEFycmF5LmlzQXJyYXkodikgPyB2WzBdIDogdjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUGFyYW1zQXNNYXAucHJvdG90eXBlLmdldEFsbCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgaWYgKHRoaXMuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2ID0gdGhpcy5wYXJhbXNbbmFtZV07XG4gICAgICAgICAgICByZXR1cm4gQXJyYXkuaXNBcnJheSh2KSA/IHYgOiBbdl07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFtdO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFBhcmFtc0FzTWFwLnByb3RvdHlwZSwgXCJrZXlzXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAg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NlO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG4gICAgZWxzZSBpZiAoY29udGFpbmVyLnNlZ21lbnRzLmxlbmd0aCA9PT0gY29udGFpbmVlUGF0aHMubGVuZ3RoKSB7XG4gICAgICAgIGlmICghZXF1YWxQYXRoKGNvbnRhaW5lci5zZWdtZW50cywgY29udGFpbmVlUGF0aHMpKVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICBmb3IgKHZhciAvKiogQHR5cGUgez99ICovIGMgaW4gY29udGFpbmVlLmNoaWxkcmVuKSB7XG4gICAgICAgICAgICBpZiAoIWNvbnRhaW5lci5jaGlsZHJlbltjXSlcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICBpZiAoIWNvbnRhaW5zU2VnbWVudEdyb3VwKGNvbnRhaW5lci5jaGlsZHJlbltjXSwgY29udGFpbmVlLmNoaWxkcmVuW2NdKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjdXJyZW50ID0gY29udGFpbmVlUGF0aHMuc2xpY2UoMCwgY29udGFpbmVyLnNlZ21lbnRzLmxlbmd0aCk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5leHQgPSBjb250YWluZWVQYXRocy5zbGljZShjb250YWluZXIuc2VnbWVudHMubGVuZ3RoKTtcbiAgICAgICAgaWYgKCFlcXVhbFBhdGgoY29udGFpbmVyLnNlZ21lbnRzLCBjdXJyZW50KSlcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgaWYgKCFjb250YWluZXIuY2hpbGRyZW5bUFJJTUFSWV9PVVRMRVRdKVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICByZXR1cm4gY29udGFpbnNTZW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sgcmV0dXJuIHYucGFyZW50ID0gX3RoaXM7IH0pO1xuICAgIH1cbiAgICAvKiogV2hldGhlciB0aGUgc2VnbWVudCBoYXMgY2hpbGQgc2VnbWVudHMgKi9cbiAgICAvKipcbiAgICAgKiBXaGV0aGVyIHRoZSBzZWdtZW50IGhhcyBjaGlsZCBzZWdtZW50c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsU2VnbWVudEdyb3VwLnByb3RvdHlwZS5oYXNDaGlsZHJlbiA9IC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHNlZ21lbnQgaGFzIGNoaWxkIHNlZ21lbnRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLm51bWJlck9mQ2hpbGRyZW4gPiAwOyB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShVcmxTZWdtZW50R3JvdXAucHJvdG90eXBlLCBcIm51bWJlck9mQ2hpbGRyZW5cIiwge1xuICAgICAgICAvKiogTnVtYmVyIG9mIGNoaWxkIHNlZ21lbnRzICovXG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIE51bWJlciBvZiBjaGlsZCBzZWdtZW50c1xuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkgeyByZXR1cm4gT2JqZWN0LmtleXModGhpcy5jaGlsZHJlbikubGVuZ3RoOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKiogQGRvY3NOb3RSZXF1aXJlZCAqL1xuICAgIC8qKlxuICAgICAqIFxcQGRvY3NOb3RSZXF1aXJlZFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsU2VnbWVudEdyb3VwLnByb3RvdHlwZS50b1N0cmluZyA9IC8qKlxuICAgICAqIFx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VudFxuICogQHJldHVybiB7P31cbiAqL1xuZnVuY3Rpb24gc2VyaWFsaXplUGF0aHMoc2VnbWVudCkge1xuICAgIHJldHVybiBzZWdtZW50LnNlZ21lbnRzLm1hcChmdW5jdGlvbiAocCkgeyByZXR1cm4gc2VyaWFsaXplUGF0aChwKTsgfSkuam9pbignLycpO1xufVxuLyoqXG4gKiBAcGFyYW0gez99IHNlZ21lbnRcbiAqIEBwYXJhbSB7P30gcm9vdFxuICogQHJldHVybiB7P31cbiAqL1xuZnVuY3Rpb24gc2VyaWFsaXplU2VnbWVudChzZWdtZW50LCByb290KSB7XG4gICAgaWYgKCFzZWdtZW50Lmhhc0NoaWxkcmVuKCkpIHtcbiAgICAgICAgcmV0dXJuIHNlcmlhbGl6ZVBhdGhzKHNlZ21lbnQpO1xuICAgIH1cbiAgICBpZiAocm9vdCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwcmltYXJ5ID0gc2VnbWVudC5jaGlsZHJlbltQUklNQVJZX09VVExFVF0gP1xuICAgICAgICAgICAgc2VyaWFsaXplU2VnbWVudChzZWdtZW50LmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXSwgZmFsc2UpIDpcbiAgICAgICAgICAgICcnO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjaGlsZHJlbl8xID0gW107XG4gICAgICAgIGZvckVhY2goc2VnbWVudC5jaGlsZHJlbiwgZnVuY3Rpb24gKHYsIGspIHtcbiAgICAgICAgICAgIGlmIChrICE9PSBQUklNQVJZX09VVExFVCkge1xuICAgICAgICAgICAgICAgIGNoaWxkcmVuXzEucHVzaChrICsgXCI6XCIgKyBzZXJpYWxpemVTZWdtZW50KHYsIGZhbHNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gY2hpbGRyZW5fMS5sZW5ndGggPiAwID8gcHJpbWFyeSArIFwiKFwiICsgY2hpbGRyZW5fMS5qb2luKCcvLycpICs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gICAgICAgICAgIHJldHVybiBuZXcgVXJsU2VnbWVudEdyb3VwKFtdLCB7fSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVGhlIHJvb3Qgc2VnbWVudCBncm91cCBuZXZlciBoYXMgc2VnbWVudHNcbiAgICAgICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIHRoaXMucGFyc2VDaGlsZHJlbigpKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVF1ZXJ5UGFyYW1zID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhcmFtcyA9IHt9O1xuICAgICAgICBpZiAodGhpcy5jb25zdW1lT3B0aW9uYWwoJz8nKSkge1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIHRoaXMucGFyc2VRdWVyeVBhcmFtKHBhcmFtcyk7XG4gICAgICAgICAgICB9IHdoaWxlICh0aGlzLmNvbnN1bWVPcHRpb25hbCgnJicpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFyYW1zO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBhcnNlRnJhZ21lbnQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZU9wdGlvbmFsKCcjJykgPyBkZWNvZGVVUkkodGhpcy5yZW1haW5pbmcpIDogbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZUNoaWxkcmVuID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJlbWFpbmluZyA9PT0gJycpIHtcbiAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmNvbnN1bWVPcHRpb25hbCgnLycpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzZWdtZW50cyA9IFtdO1xuICAgICAgICBpZiAoIXRoaXMucGVla1N0YXJ0c1dpdGgoJygnKSkge1xuICAgICAgICAgICAgc2VnbWVudHMucHVzaCh0aGlzLnBhcnNlU2VnbWVudCgpKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAodGhpcy5wZWVrU3RhcnRzV2l0aCgnLycpICYmICF0aGlzLnBlZWtTdGFydHNXaXRoKCcvLycpICYmICF0aGlzLnBlZWtTdGFydHNXaXRoKCcvKCcpKSB7XG4gICAgICAgICAgICB0aGlzLmNhcHR1cmUoJy8nKTtcbiAgICAgICAgICAgIHNlZ21lbnRzLnB1c2godGhpcy5wYXJzZVNlZ21lbnQoKSk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2hpbGRyZW4gPSB7fTtcbiAgICAgICAgaWYgKHRoaXMucGVla1N0YXJ0c1dpdGgoJy8oJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2FwdHVyZSgnLycpO1xuICAgICAgICAgICAgY2hpbGRyZW4gPSB0aGlzLnBhcnNlUGFyZW5zKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IHt9O1xuICAgICAgICBpZiAodGhpcy5wZWVrU3RhcnRzV2l0aCgnKCcpKSB7XG4gICAgICAgICAgICByZXMgPSB0aGlzLnBhcnNlUGFyZW5zKGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc2VnbWVudHMubGVuZ3RoID4gMCB8fCBPYmplY3Qua2V5cyhjaGlsZHJlbikubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgcmVzW1BSSU1BUllfT1VUTEVUXSA9IG5ldyBVcmxTZWdtZW50R3JvdXAoc2VnbWVudHMsIGNoaWxkcmVuKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXRoID0gbWF0Y2hTZWdtZW50cyh0aGlzLnJlbWFpbmluZyk7XG4gICAgICAgIGlmIChwYXRoID09PSAnJyAmJiB0aGlzLnBlZWtTdGFydHNXaXRoKCc7JykpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVtcHR5IHBhdGggdXJsIHNlZ21lbnQgY2Fubm90IGhhdmUgcGFyYW1ldGVyczogJ1wiICsgdGhpcy5yZW1haW5pbmcgKyBcIicuXCIpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY2FwdHVyZShwYXRoKTtcbiAgICAgICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50KGRlY29kZShwYXRoKSwgdGhpcy5wYXJzZU1hdHJpeFBhcmFtcygpKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZU1hdHJpeFBhcmFtcyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXJhbXMgPSB7fTtcbiAgICAgICAgd2hpbGUgKHRoaXMuY29uc3VtZU9wdGlvbmFsKCc7JykpIHtcbiAgICAgICAgICAgIHRoaXMucGFyc2VQYXJhbShwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwYXJhbXM7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVBhcmFtID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJhbXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChwYXJhbXMpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8ga2V5ID0gbWF0Y2hTZWdtZW50cyh0aGlzLnJlbWFpbmluZyk7XG4gICAgICAgIGlmICgha2V5KSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jYXB0dXJlKGtleSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbHVlID0gJyc7XG4gICAgICAgIGlmICh0aGlzLmNvbnN1bWVPcHRpb25hbCgnPScpKSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2YWx1ZU1hdGNoID0gbWF0Y2hTZWdtZW50cyh0aGlzLnJlbWFpbmluZyk7XG4gICAgICAgICAgICBpZiAodmFsdWVNYXRjaCkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWVNYXRjaDtcbiAgICAgICAgICAgICAgICB0aGlzLmNhcHR1cmUodmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHBhcmFtc1tkZWNvZGUoa2V5KV0gPSBkZWNvZGUodmFsdWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBwYXJhbXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIF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kZWRLZXldO1xuICAgICAgICAgICAgaWYgKCFBcnJheS5pc0FycmF5KGN1cnJlbnRWYWwpKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudFZhbCA9IFtjdXJyZW50VmFsXTtcbiAgICAgICAgICAgICAgICBwYXJhbXNbZGVjb2RlZEtleV0gPSBjdXJyZW50VmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudFZhbC5wdXNoKGRlY29kZWRWYWwpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IHZhbHVlXG4gICAgICAgICAgICBwYXJhbXNbZGVjb2RlZEtleV0gPSBkZWNvZGVkVmFsO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGFsbG93UHJpbWFyeVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5wYXJzZVBhcmVucyA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYWxsb3dQcmltYXJ5XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYWxsb3dQcmltYXJ5KSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHNlZ21lbnRzID0ge307XG4gICAgICAgIHRoaXMuY2FwdHVyZSgnKCcpO1xuICAgICAgICB3aGlsZSAoIXRoaXMuY29uc3VtZU9wdGlvbmFsKCcpJykgJiYgdGhpcy5yZW1haW5pbmcubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGF0aCA9IG1hdGNoU2VnbWVudHModGhpcy5yZW1haW5pbmcpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbmV4dCA9IHRoaXMucmVtYWluaW5nW3BhdGgubGVuZ3RoXTtcbiAgICAgICAgICAgIC8vIGlmIGlzIGlzIG5vdCBvbmUgb2YgdGhlc2UgY2hhcmFjdGVycywgdGhlbiB0aGUgc2VnbWVudCB3YXMgdW5lc2NhcGVkXG4gICAgICAgICAgICAvLyBvciB0aGUgZ3JvdXAgd2FzIG5vdCBjbG9zZWRcbiAgICAgICAgICAgIGlmIChuZXh0ICE9PSAnLycgJiYgbmV4dCAhPT0gJyknICYmIG5leHQgIT09ICc7Jykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkNhbm5vdCBwYXJzZSB1cmwgJ1wiICsgdGhpcy51cmwgKyBcIidcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvdXRsZXROYW1lID0gLyoqIEB0eXBlIHs/fSAqLyAoKHVuZGVmaW5lZCkpO1xuICAgICAgICAgICAgaWYgKHBhdGguaW5kZXhPZignOicpID4gLTEpIHtcbiAgICAgICAgICAgICAgICBvdXRsZXROYW1lID0gcGF0aC5zdWJzdHIoMCwgcGF0aC5pbmRleE9mKCc6JykpO1xuICAgICAgICAgICAgICAgIHRoaXMuY2FwdHVyZShvdXRsZXROYW1lKTtcbiAgICAgICAgICAgICAgICB0aGlzLmNhcHR1cmUoJzonKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGFsbG93UHJpbWFyeSkge1xuICAgICAgICAgICAgICAgIG91dGxldE5hbWUgPSBQUklNQVJZX09VVExFVDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNoaWxkcmVuID0gdGhpcy5wYXJzZUNoaWxkcmVuKCk7XG4gICAgICAgICAgICBzZWdtZW50c1tvdXRsZXROYW1lXSA9IE9iamVjdC5rZXlzKGNoaWxkcmVuKS5sZW5ndGggPT09IDEgPyBjaGlsZHJlbltQUklNQVJZX09VVExFVF0gOlxuICAgICAgICAgICAgICAgIG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIGNoaWxkcmVuKTtcbiAgICAgICAgICAgIHRoaXMuY29uc3VtZU9wdGlvbmFsKCcvLycpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzZWdtZW50cztcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLnBlZWtTdGFydHNXaXRoID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdHJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzdHIpIHsgcmV0dXJuIHRoaXMucmVtYWluaW5nLnN0YXJ0c1dpdGgoc3RyKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0clxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVXJsUGFyc2VyLnByb3RvdHlwZS5jb25zdW1lT3B0aW9uYWwgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0clxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0cikge1xuICAgICAgICBpZiAodGhpcy5wZWVrU3RhcnRzV2l0aChzdHIpKSB7XG4gICAgICAgICAgICB0aGlzLnJlbWFpbmluZyA9IHRoaXMucmVtYWluaW5nLnN1YnN0cmluZyhzdHIubGVuZ3RoKTtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBVcmxQYXJzZXIucHJvdG90eXBlLmNhcHR1cmUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0clxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0cikge1xuICAgICAgICBpZiAoIXRoaXMuY29uc3V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ICAgICAgIC8vIGFmdGVyIGFuIGFic29sdXRlIHJlZGlyZWN0IHdlIGRvIG5vdCBhcHBseSBhbnkgbW9yZSByZWRpcmVjdHMhXG4gICAgICAgICAgICAgICAgX3RoaXMuYWxsb3dSZWRpcmVjdHMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAvLyB3ZSBuZWVkIHRvIHJ1biBtYXRjaGluZywgc28gd2UgY2FuIGZldGNoIGFsbCBsYXp5LWxvYWRlZCBtb2R1bGVzXG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLm1hdGNoKGUudXJsVHJlZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIE5vTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBfdGhpcy5ub01hdGNoRXJyb3IoZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdHJlZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLm1hdGNoID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB0cmVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodHJlZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBleHBhbmRlZCQgPSB0aGlzLmV4cGFuZFNlZ21lbnRHcm91cCh0aGlzLm5nTW9kdWxlLCB0aGlzLmNvbmZpZywgdHJlZS5yb290LCBQUklNQVJZX09VVExFVCk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG1hcHBlZCQgPSBtYXAuY2FsbChleHBhbmRlZCQsIGZ1bmN0aW9uIChyb290U2VnbWVudEdyb3VwKSB7XG4gICAgICAgICAgICByZXR1cm4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zZWdtZW50cywgb3V0bGV0LCBhbGxvd1JlZGlyZWN0cyk7XG4gICAgICAgICAgICByZXR1cm4gX2NhdGNoLmNhbGwoZXhwYW5kZWQkLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgTm9NYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2YobnVsbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbmNhdHRlZFByb2Nlc3NlZFJvdXRlcyQgPSBjb25jYXRBbGwuY2FsbChwcm9jZXNzZWRSb3V0ZXMkKTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZmlyc3QkID0gZmlyc3QuY2FsbChjb25jYXR0ZWRQcm9jZXNzZWRSb3V0ZXMkLCBmdW5jdGlvbiAocykgeyByZXR1cm4gISFzOyB9KTtcbiAgICAgICAgcmV0dXJuIF9jYXRjaC5jYWxsKGZpcnN0JCwgZnVuY3Rpb24gKGUsIF8pIHtcbiAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgRW1wdHlFcnJvciB8fCBlLm5hbWUgPT09ICdFbXB0eUVycm9yJykge1xuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5ub0xlZnRvdmVyc0luVXJsKHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9mKG5ldyBVcmxTZWdtZW50R3JvdXAoW10sIHt9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBOb01hdGNoKHNlZ21lbnRHcm91cCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudEdyb3VwXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUubm9MZWZ0b3ZlcnNJblVybCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudEdyb3VwXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoc2VnbWVudEdyb3VwLCBzZWdtZW50cywgb3V0bGV0KSB7XG4gICAgICAgIHJldHVybiBzZWdtZW50cy5sZW5ndGggPT09IDAgJiYgIXNlZ21lbnRHcm91cC5jaGlsZHJlbltvdXRsZXRdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZ01vZHVsZVxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudEdyb3VwXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZXNcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSBwYXRoc1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHBhcmFtIHs/fSBhbGxvd1JlZGlyZWN0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQXBwbHlSZWRpcmVjdHMucHJvdG90eXBlLmV4cGFuZFNlZ21lbnRBZ2FpbnN0Um91dGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5nTW9kdWxlXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50R3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlc1xuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHBhdGhzXG4gICAgICogQH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tcbiAgICAgICAgfVxuICAgICAgICBpZiAocm91dGUubG9hZENoaWxkcmVuKSB7XG4gICAgICAgICAgICAvLyBsYXp5IGNoaWxkcmVuIGJlbG9uZyB0byB0aGUgbG9hZGVkIG1vZHVsZVxuICAgICAgICAgICAgaWYgKHJvdXRlLl9sb2FkZWRDb25maWcgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBvZihyb3V0ZS5fbG9hZGVkQ29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBtZXJnZU1hcC5jYWxsKHJ1bkNhbkxvYWRHdWFyZChuZ01vZHVsZS5pbmplY3Rvciwgcm91dGUpLCBmdW5jdGlvbiAoc2hvdWxkTG9hZCkge1xuICAgICAgICAgICAgICAgIGlmIChzaG91bGRMb2FkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChfdGhpcy5jb25maWdMb2FkZXIubG9hZChuZ01vZHVsZS5pbmplY3Rvciwgcm91dGUpLCBmdW5jdGlvbiAoY2ZnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByb3V0ZS5fbG9hZGVkQ29uZmlnID0gY2ZnO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNmZztcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjYW5Mb2FkRmFpbHMocm91dGUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9mKG5ldyBMb2FkZWRSb3V0ZXJDb25maWcoW10sIG5nTW9kdWxlKSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSB1cmxUcmVlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUubGluZXJhbGl6ZVNlZ21lbnRzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEBwYXJhbSB7P30gdXJsVHJlZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJvdXRlLCB1cmxUcmVlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlcyA9IFtdO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjID0gdXJsVHJlZS5yb290O1xuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgcmVzID0gcmVzLmNvbmNhdChjLnNlZ21lbnRzKTtcbiAgICAgICAgICAgIGlmIChjLm51bWJlck9mQ2hpbGRyZW4gPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2YocmVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjLm51bWJlck9mQ2hpbGRyZW4gPiAxIHx8ICFjLmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuYW1lZE91dGxldHNSZWRpcmVjdCgvKiogQHR5cGUgez99ICovICgocm91dGUucmVkaXJlY3RUbykpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGMgPSBjLmNoaWxkcmVuW1BSSU1BUllfT1VUTEVUXTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1xuICAgICAqIEBwYXJhbSB7P30gcG9zUGFyYW1zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBBcHBseVJlZGlyZWN0cy5wcm90b3R5cGUuYXBwbHlSZWRpcmVjdENvbW1hbmRzID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gcmVkaXJlY3RUb1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XJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgVHJlZS5wcm90b3R5cGUuY2hpbGRyZW4gPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbiA9IGZpbmROb2RlKHQsIHRoaXMuX3Jvb3QpO1xuICAgICAgICByZXR1cm4gbiA/IG4uY2hpbGRyZW4ubWFwKGZ1bmN0aW9uICh0KSB7IHJldHVybiB0LnZhbHVlOyB9KSA6IFtdO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFRyZWUucHJvdG90eXBlLmZpcnN0Q2hpbGQgPSAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbiA9IGZpbmROb2RlKHQsIHRoaXMuX3Jvb3QpO1xuICAgICAgICByZXR1cm4gbiAmJiBuLmNoaWxkcmVuLmxlbmd0aCA+IDAgPyBuLmNoaWxkcmVuWzBdLnZhbHVlIDogbnVsbDtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBUcmVlLnByb3RvdHlwZS5zaWJsaW5ncyA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwID0gZmluZFBhdGgodCwgdGhpcy5fcm9vdCk7XG4gICAgICAgIGlmIChwLmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGMgPSBwW3AubGVuZ3RoIC0gMl0uY2hpbGRyZW4ubWFwKGZ1bmN0aW9uIChjKSB7IHJldHVybiBjLnZhbHVlOyB9KTtcbiAgICAgICAgcmV0dXJuIGMuZmlsdGVyKGZ1bmN0aW9uIChjYykgeyByZXR1cm4gY2MgIT09IHQ7IH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IHRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFRyZWUucHJvdG90eXBlLnBhdGhGcm9tUm9vdCA9IC8qKlxuICAgICAqIFxcQGludGVybmFsXG4gICAgICogQHBhcmFtIHs/fSB0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodCkgeyByZXR1cm4gZmluZFBhdGgodCwgdGhpcy5fcm9vdCkubWFwKGZ1bmN0aW9uIChzKSB7IHJldHVybiBzLnZhbHVlOyB9KTsgfTtcbiAgICByZXR1cm4gVHJlZTtcbn0oKSk7XG4vKipcbiAqIEB0ZW1wbGF0ZSBUXG4gKiBAcGFyYW0gez99IHZhbHVlXG4gKiBAcGFyYW0gez99IG5vZGVcbiAqIEByZXR1cm4gez99XG4gKi9cbmZ1bmN0aW9uIGZpbmROb2RlKHZhbHVlLCBub2RlKSB7XG4gICAgaWYgKHZhbHVlID09PSBub2RlLnZhbHVlK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lwZSwgXCJwYXJhbU1hcFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX3BhcmFtTWFwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcGFyYW1NYXAgPSBjb252ZXJ0VG9QYXJhbU1hcCh0aGlzLnBhcmFtcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcGFyYW1NYXA7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBY3RpdmF0ZWRSb3V0ZVNuYXBzaG90LnByb3RvdHlwZSwgXCJxdWVyeVBhcmFtTWFwXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5fcXVlcnlQYXJhbU1hcCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3F1ZXJ5UGFyYW1NYXAgPSBjb252ZXJ0VG9QYXJhbU1hcCh0aGlzLnF1ZXJ5UGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9xdWVyeVBhcmFtTWFwO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFjdGl2YXRlZFJvdXRlU25hcHNob3QucHJvdG90eXBlLnRvU3RyaW5nID0gLyoqXG4gICAgICogQHJldHVybiB7P31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dXJuIG5ldyBOYXZpZ2F0aW9uKHRydWUsIDAsIGNvbW1hbmRzKTtcbiAgICB9XG4gICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gbnVtYmVyT2ZEb3VibGVEb3RzID0gMDtcbiAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpc0Fic29sdXRlID0gZmFsc2U7XG4gICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzID0gY29tbWFuZHMucmVkdWNlKGZ1bmN0aW9uIChyZXMsIGNtZCwgY21kSWR4KSB7XG4gICAgICAgIGlmICh0eXBlb2YgY21kID09PSAnb2JqZWN0JyAmJiBjbWQgIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKGNtZC5vdXRsZXRzKSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3V0bGV0c18xID0ge307XG4gICAgICAgICAgICAgICAgZm9yRWFjaChjbWQub3V0bGV0cywgZnVuY3Rpb24gKGNvbW1hbmRzLCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIG91dGxldHNfMVtuYW1lXSA9IHR5cGVvZiBjb21tYW5kcyA9PT0gJ3N0cmluZycgPyBjb21tYW5kcy5zcGxpdCgnLycpIDogY29tbWFuZHM7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5jb25jYXQoW3sgb3V0bGV0czogb3V0bGV0c18xIH1dKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjbWQuc2VnbWVudFBhdGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzLmNvbmNhdChbY21kLnNlZ21lbnRQYXRoXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCEodHlwZW9mIGNtZCA9PT0gJ3N0cmluZycpKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzLmNvbmNhdChbY21kXSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNtZElkeCA9PT0gMCkge1xuICAgICAgICAgICAgY21kLnNwbGl0KCcvJykuZm9yRWFjaChmdW5jdGlvbiAodXJsUGFydCwgcGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKHBhcnRJbmRleCA9PSAwICYmIHVybFBhcnQgPT09ICcuJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBza2lwICcuL2EnXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBhcnRJbmRleCA9PSAwICYmIHVybFBhcnQgPT09ICcnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vICAnL2EnXG4gICAgICAgICAgICAgICAgICAgIGlzQWJzb2x1dGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh1cmxQYXJ0ID09PSAnLi4nKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vICAnLi4vYSdcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVyT2ZEb3VibGVEb3RzKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHVybFBhcnQgIT0gJycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2godXJsUGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXMuY29uY2F0KFtjbWRdKTtcbiAgICB9LCBbXSk7XG4gICAgcmV0dXJuIG5ldyBOYXZpZ2F0aW9uKGlzQWJzb2x1dGUsIG51bWJlck9mRG91YmxlRG90cywgcmVzKTtcbn1cbnZhciBQb3NpdGlvbiA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBQb3NpdGlvbihzZWdtZW50R3JvdXAsIHByb2Nlc3NDaGlsZHJlbiwgaW5kZXgpIHtcbiAgICA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21tYW5kcyk7XG4gICAgfVxufVxuLyoqXG4gKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICogQHBhcmFtIHs/fSBzdGFydEluZGV4XG4gKiBAcGFyYW0gez99IGNvbW1hbmRzXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiB1cGRhdGVTZWdtZW50R3JvdXBDaGlsZHJlbihzZWdtZW50R3JvdXAsIHN0YXJ0SW5kZXgsIGNvbW1hbmRzKSB7XG4gICAgaWYgKGNvbW1hbmRzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICByZXR1cm4gbmV3IFVybFNlZ21lbnRHcm91cChzZWdtZW50R3JvdXAuc2VnbWVudHMsIHt9KTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG91dGxldHNfMiA9IGdldE91dGxldHMoY29tbWFuZHMpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjaGlsZHJlbl8xID0ge307XG4gICAgICAgIGZvckVhY2gob3V0bGV0c18yLCBmdW5jdGlvbiAoY29tbWFuZHMsIG91dGxldCkge1xuICAgICAgICAgICAgaWYgKGNvbW1hbmRzICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY2hpbGRyZW5fMVtvdXRsZXRdID0gdXBkYXRlU2VnbWVudEdyb3VwKHNlZ21lbnRHcm91cC5jaGlsZHJlbltvdXRsZXRdLCBzdGFydEluZGV4LCBjb21tYW5kcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBmb3JFYWNoKHNlZ21lbnRHcm91cC5jaGlsZHJlbiwgZnVuY3Rpb24gKGNoaWxkLCBjaGlsZE91dGxldCkge1xuICAgICAgICAgICAgaWYgKG91dGxldHNfMltjaGlsZE91dGxldF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGNoaWxkcmVuXzFbY2hpbGRPdXRsZXRdID0gY2hpbGQ7XG4gICAgICA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IC0gMSA/IGNvbW1hbmRzW2N1cnJlbnRDb21tYW5kSW5kZXggKyAxXSA6IG51bGw7XG4gICAgICAgIGlmIChjdXJyZW50UGF0aEluZGV4ID4gMCAmJiBjdXJyID09PSB1bmRlZmluZWQpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgaWYgKGN1cnIgJiYgbmV4dCAmJiAodHlwZW9mIG5leHQgPT09ICdvYmplY3QnKSAmJiBuZXh0Lm91dGxldHMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgaWYgKCFjb21wYXJlKGN1cnIsIG5leHQsIHBhdGgpKVxuICAgICAgICAgICAgICAgIHJldHVybiBub01hdGNoO1xuICAgICAgICAgICAgY3VycmVudENvbW1hbmRJbmRleCArPSAyO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFjb21wYXJlKGN1cnIsIHt9LCBwYXRoKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9NYXRjaDtcbiAgICAgICAgICAgIGN1cnJlbnRDb21tYW5kSW5kZXgrKztcbiAgICAgICAgfVxuICAgICAgICBjdXJyZW50UGF0aEluZGV4Kys7XG4gICAgfVxuICAgIHJldHVybiB7IG1hdGNoOiB0cnVlLCBwYXRoSW5kZXg6IGN1cnJlbnRQYXRoSW5kZXgsIGNvbW1hbmRJbmRleDogY3VycmVudENvbW1hbmRJbmRleCB9O1xufVxuLyoqXG4gKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICogQHBhcmFtIHs/fSBzdGFydEluZGV4XG4gKiBAcGFyYW0gez99IGNvbW1hbmRzXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBjcmVhdGVOZXdTZWdtZW50R3JvdXAoc2VnbWVudEdyb3VwLCBzdGFydEluZGV4LCBjb21tYW5kcykge1xuICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhdGhzID0gc2VnbWVudEdyb3VwLnNlZ21lbnRzLnNsaWNlKDAsIHN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NNYXRyaXhQYXJhbXMobmV4dCkpIHtcbiAgICAgICAgICAgIHBhdGhzLnB1c2gobmV3IFVybFNlZ21lbnQoY3Vyciwgc3RyaW5naWZ5KG5leHQpKSk7XG4gICAgICAgICAgICBpICs9IDI7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwYXRocy5wdXNoKG5ldyBVcmxTZWdtZW50KGN1cnIsIHt9KSk7XG4gICAgICAgICAgICBpKys7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG5ldyBVcmxTZWdtZW50R3JvdXAocGF0aHMsIHt9KTtcbn1cbi8qKlxuICogQHBhcmFtIHs/fSBvdXRsZXRzXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBjcmVhdGVOZXdTZWdtZW50Q2hpbGRyZW4ob3V0bGV0cykge1xuICAgIHZhciAvKiogQHR5cGUgez99ICovIGNoaWxkcmVuID0ge307XG4gICAgZm9yRWFjaChvdXRsZXRzLCBmdW5jdGlvbiAoY29tbWFuZHMsIG91dGxldCkge1xuICAgICAgICBpZiAoY29tbWFuZHMgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuW291dGxldF0gPSBjcmVhdGVOZXdTZWdtZW50R3JvdXAobmV3IFVybFNlZ21lbnRHcm91cChbXSwge30pLCAwLCBjb21tYW5kcyk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gY2hpbGRyZW47XG59XG4vKipcbiAqIEBwYXJhbSB7P30gcGFyYW1zXG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBzdHJpbmdpZnkocGFyYW1zKSB7XG4gICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzID0ge307XG4gICAgZm9yRWFjaChwYXJhbXMsIGZ1bmN0aW9uICh2LCBrKSB7IHJldHVybiByZXNba10gPSBcIlwiICsgdjsgfSk7XG4gICAgcmV0dXJuIHJlcztcbn1cbi8qKlxuICogQ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ICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gIWVxdWFsUGFyYW1zQW5kVXJsU2VnbWVudHMoY3VyciwgZnV0dXJlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEBwYXJhbSB7P30gY29udGV4dFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUHJlQWN0aXZhdGlvbi5wcm90b3R5cGUuZGVhY3RpdmF0ZVJvdXRlQW5kSXRzQ2hpbGRyZW4gPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHJvdXRlXG4gICAgICogQHBhcmFtIHs/fSBjb250ZXh0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGUsIGNvbnRleHQpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2hpbGRyZW4gPSBub2RlQ2hpbGRyZW5Bc01hcChyb3V0ZSk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHIgPSByb3V0ZS52YWx1ZTtcbiAgICAgICAgZm9yRWFjaChjaGlsZHJlbiwgZnVuY3Rpb24gKG5vZGUsIGNoaWxkTmFtZSkge1xuICAgICAgICAgICAgaWYgKCFyLmNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgIF90aGlzLmRlYWN0aXZhdGVSb3V0ZUFuZEl0c0NoaWxkcmVuKG5vZGUsIGNvbnRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY29udGV4dCkge1xuICAgICAgICAgICAgICAgIF90aGlzLmRlYWN0aXZhdGVSb3V0ZUFuZEl0c0NoaWxkcmVuKG5vZGUsIGNvbnRleHQuY2hpbGRyZW4uZ2V0Q29udGV4dChjaGlsZE5hbWUpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG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Z1dHVyZSwgcGFyYW1zSW5oZXJpdGFuY2VTdHJhdGVneSkucmVzb2x2ZSk7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHJlc29sdmVcbiAgICAgKiBAcGFyYW0gez99IGZ1dHVyZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUHJlQWN0aXZhdGlvbi5wcm90b3R5cGUucmVzb2x2ZU5vZGUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHJlc29sdmVcbiAgICAgKiBAcGFyYW0gez99IGZ1dHVyZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJlc29sdmUsIGZ1dHVyZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBrZXlzID0gT2JqZWN0LmtleXMocmVzb2x2ZSk7XG4gICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIG9mKHt9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoa2V5cy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleV8xID0ga2V5c1swXTtcbiAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbCh0aGlzLmdldFJlc29sdmVyKHJlc29sdmVba2V5XzFdLCBmdXR1cmUpLCBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX2EgPSB7fSwgX2Fba2V5XzFdID0gdmFsdWUsIF9hO1xuICAgICAgICAgICAgICAgIHZhciBfYTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRhdGEgPSB7fTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P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XIoZnV0dXJlLCB0aGlzLmZ1dHVyZSkpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB0b2tlblxuICAgICAqIEBwYXJhbSB7P30gc25hcHNob3RcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFByZUFjdGl2YXRpb24ucHJvdG90eXBlLmdldFRva2VuID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSB0b2tlblxuICAgICAqIEBwYXJhbSB7P30gc25hcHNob3RcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh0b2tlbiwgc25hcHNob3QpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29uZmlnID0gY2xvc2VzdExvYWRlZENvbmZpZyhzbmFwc2hvdCk7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGluamVjdG9yID0gY29uZmlnID8gY29uZmlnLm1vZHVsZS5pbmplY3RvciA6IHRoaXMubW9kdWxlSW5qZWN0b3I7XG4gICAgICAgIHJldHVybiBpbmplY3Rvci5nZXQodG9rZW4pO1xuICAgIH07XG4gICAgcmV0dXJuIFByZUFjdGl2YXRpb247XG59KCkpO1xuLyoqXG4gKiBAcGFyYW0gez99IHNuYXBzaG90XG4gKiBAcmV0dXJuIHs/fVxuICovXG5mdW5jdGlvbiBjbG9zZXN0TG9hZGVkQ29uZmlnKHNuYXBzaG90KSB7XG4gICAgaWYgKCFzbmFwc2hvdClcbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgZm9yICh2YXIgLyoqIEB0eXBlIHs/fSAqLyBzID0gc25hcHNob3QucGFyZW50OyBzOyBzID0gcy5wYXJlbnQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcm91dGUgPSBzLnJvdXRlQ29uZmlnO1xuICAgICAgICBpZiAocm91dGUgJiYgcm91dGUuX2xvYWRlZENvbmZpZylcbiAgICAgICAgICAgIHJldHVyb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lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGVOb2RlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJvdXRlID0gcm91dGVOb2RlLnZhbHVlO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpID0gaW5oZXJpdGVkUGFyYW1zRGF0YVJlc29sdmUocm91dGUsIHRoaXMucGFyYW1zSW5oZXJpdGFuY2VTdHJhdGVneSk7XG4gICAgICAgIHJvdXRlLnBhcmFtcyA9IE9iamVjdC5mcmVlemUoaS5wYXJhbXMpO1xuICAgICAgICByb3V0ZS5kYXRhID0gT2JqZWN0LmZyZWV6ZShpLmRhdGEpO1xuICAgICAgICByb3V0ZU5vZGUuY2hpbGRyZW4uZm9yRWFjaChmdW5jdGlvbiAobikgeyByZXR1cm4gX3RoaXMuaW5oZXJpdFBhcmFtc0FuZERhdGEobik7IH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSZWNvZ25pemVyLnByb3RvdHlwZS5wcm9jZXNzU2VnbWVudEdyb3VwID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb25maWdcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29uZmlnLCBzZWdtZW50R3JvdXAsIG91dGxldCkge1xuICAgICAgICBpZiAoc2VnbWVudEdyb3VwLnNlZ21lbnRzLmxlbmd0aCA9PT0gMCAmJiBzZWdtZW50R3JvdXAuaGFzQ2hpbGRyZW4o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wXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50c1xuICAgICAqIEBwYXJhbSB7P30gb3V0bGV0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSZWNvZ25pemVyLnByb3RvdHlwZS5wcm9jZXNzU2VnbWVudCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29uZmlnXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50R3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBvdXRsZXRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjb25maWcsIHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCkge1xuICAgICAgICBmb3IgKHZhciBfaSA9IDAsIGNvbmZpZ18xID0gY29uZmlnOyBfaSA8IGNvbmZpZ18xLmxlbmd0aDsgX2krKykge1xuICAgICAgICAgICAgdmFyIHIgPSBjb25maWdfMVtfaV07XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnByb2Nlc3NTZWdtZW50QWdhaW5zdFJvdXRlKHIsIHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoLyoqIEB0eXBlIHs/fSAqLyBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIE5vTWF0Y2gkMSkpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMubm9MZWZ0b3ZlcnNJblVybChzZWdtZW50R3JvdXAsIHNlZ21lbnRzLCBvdXRsZXQpKSB7XG4gICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IE5vTWF0Y2gkMSgpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzZWdtZW50R3JvdXBcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBvdXRsZXRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJlY29nbml6ZXIucHJvdG90eXBlLm5vTGVmdG92ZXJzSW5VcmwgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRHcm91cFxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IG91dGxldFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHNlZ21lbnRHcm91cCwgc2VnbWVudHMsIG91dGxldCkge1xuICAgICAgICByZXR1cm4gc2VnbWVudHMubGVuZ3RoID09PSAwICYmICFzZWdtZW50R3JvdXAuY2hpbGRyZW5bb3V0bGV0XTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHJhd1NlZ21lbnRcbiAgICAgKiBAcGFyYW0gez99IHNlZ21lbnRzXG4gICAgICogQHBhcmFtIHs/fSBvdXRsZXRcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJlY29nbml6ZXIucHJvdG90eXBlLnByb2Nlc3NTZWdtZW50QWdhaW5zdFJvdXRlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEBwYXJhbSB7P30gcmF3U2VnbWVudFxuICAgICAqIEBwYXJhbSB7P30gc2VnbWVudHNcbiAgICAgKiBAcGFyYW0gez99IG91dGxldFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJvdXRlLCByYXdTZWdtZW50LCBzZWdtZW50cywgb3V0bGV0KSB7XG4gICAgICAgIGlmIChyb3V0ZS5yZWRpcmVjdFRvKVxuICAgICAgICAgICAgdGhyb3cgbmV3IE5vTWF0Y2gkMSgpO1xuICAgICAgICBpZiAoKHJvdXRlLm91dGxldCB8fCBQUklNQVJZX09VVExFVCkgIT09IG91dGxldClcbiAgICAgICAgICAgIHRocm93IG5ldyBOb01hdGNoJDEoKTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gc25hcHNob3Q7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnN1bWVkU2VnbWVudHMgPSBbXTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmF3U2xpY2VkU2VnbWVudHMgPSBbXTtcbiAgICAgICAgaWYgKHJvdXRlLnBhdGggPT09ICcqKicpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhcmFtcyA9IHNlZ21lbnRzLmxlbmd0aCA+IDAgPyAvKiogQHR5cGUgez99ICovICgobGFzdCQxKHNlZ21lbnRzKSkpLnBhcmFtZXRlcnMgOiB7fTtcbiAgICAgICAgICAgIHNuYXBzaG90ID0gbmV3IEFjdGl2YXRlZFJvdXRlU25hcHNob3Qoc2VnbWVudHMsIHBhcmFtcywgT2JqZWN0LmZyZWV6ZSh0aGlzLnVybFRyZWUucXVlcnlQYXJhbXMpLCAvKiogQHR5cGUgez99ICovICgodGhpcy51cmxUcmVlLmZyYWdtZW50KSksIGdldERhdGEocm91dGUpLCBvdXRsZXQsIC8qKiBAdHlwZSB7P30gKi8gKChyb3V0ZS5jb21wb25lbnQpKSwgcm91dGUsIGdldFNvdXJjZVNlZ21lbnRHcm91cChyYXdTZWdtZW50KSwgZ2V0UGF0aEluZGV4U2hpZnQocmF3U2VnbWVudCkgKyBzZWdtZW50cy5sZW5ndGgsIGdldFJlc29sdmUocm91dGUpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlc3VsdCA9IG1hdGNoJDEocmF3U2VnbWVudCwgcm91d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RyYXMpLCBleHRyYXMpO1xuICAgIH07XG4gICAgLyoqIFNlcmlhbGl6ZXMgYSB7QGxpbmsgVXJsVHJlZX0gaW50byBhIHN0cmluZyAqL1xuICAgIC8qKlxuICAgICAqIFNlcmlhbGl6ZXMgYSB7XFxAbGluayBVcmxUcmVlfSBpbnRvIGEgc3RyaW5nXG4gICAgICogQHBhcmFtIHs/fSB1cmxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlci5wcm90b3R5cGUuc2VyaWFsaXplVXJsID0gLyoqXG4gICAgICogU2VyaWFsaXplcyBhIHtcXEBsaW5rIFVybFRyZWV9IGludG8gYSBzdHJpbmdcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkgeyByZXR1cm4gdGhpcy51cmxTZXJpYWxpemVyLnNlcmlhbGl6ZSh1cmwpOyB9O1xuICAgIC8qKiBQYXJzZXMgYSBzdHJpbmcgaW50byBhIHtAbGluayBVcmxUcmVlfSAqL1xuICAgIC8qKlxuICAgICAqIFBhcnNlcyBhIHN0cmluZyBpbnRvIGEge1xcQGxpbmsgVXJsVHJlZX1cbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyLnByb3RvdHlwZS5wYXJzZVVybCA9IC8qKlxuICAgICAqIFBhcnNlcyBhIHN0cmluZyBpbnRvIGEge1xcQGxpbmsgVXJsVHJlZX1cbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkgeyByZXR1cm4gdGhpcy51cmxTZXJpYWxpemVyLnBhcnNlKHVybCk7IH07XG4gICAgLyoqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZCAqL1xuICAgIC8qKlxuICAgICAqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZFxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHBhcmFtIHs/fSBleGFjdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyLnByb3RvdHlwZS5pc0FjdGl2ZSA9IC8qKlxuICAgICAqIFJldHVybnMgd2hldGhlciB0aGUgdXJsIGlzIGFjdGl2YXRlZFxuICAgICAqIEBwYXJhbSB7P30gdXJsXG4gICAgICogQHBhcmFtIHs/fSBleGFjdFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCwgZXhhY3QpIHtcbiAgICAgICAgaWYgKHVybCBpbnN0YW5jZW9mIFVybFRyZWUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb250YWluc1RyZWUodGhpcy5jdXJyZW50VXJsVHJlZSwgdXJsLCBleGFjdCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdXJsVHJlZSA9IHRoaXMudXJsU2VyaWFsaXplci5wYXJzZSh1cmwpO1xuICAgICAgICByZXR1cm4gY29udGFpbnNUcmVlKHRoaXMuY3VycmVudFVybFRyZWUsIHVybFRyZWUsIGV4YWN0KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gcGFyYW1zXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXIucHJvdG90eXBlLnJlbW92ZUVtcHR5UHJvcHMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHBhcmFtc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHBhcmFtcykge1xuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMocGFyYW1zKS5yZWR1Y2UoZnVuY3Rpb24gKHJlc3VsdCwga2V5KSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB2YWx1ZSA9IHBhcmFtc1trZXldO1xuICAgICAgICAgICAgaWYgKHZhbHVlICE9PSBudWxsICYmIHZhbHVlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfSwge30pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXIucHJvdG90eXBlLnByb2Nlc3NOYXZpZ2F0aW9ucyA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBjb25jYXRNYXBcbiAgICAgICAgICAgIC5jYWxsKHRoaXMubmF2aWdhdGlvbnMsIGZ1bmN0aW9uIChuYXYpIHtcbiAgICAgICAgICAgIGlmIChuYXYpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5leGVjdXRlU2NoZWR1bGVkTmF2aWdhdGlvbihuYXYpO1xuICAgICAgICAgICAgICAgIC8vIGEgZmFpbGVkIG5hdmlnYXRpb24gc2hvdWxkIG5vdCBzdG9wIHRoZSByb3V0ZXIgZnJvbSBwcm9jZXNzaW5nXG4gICAgICAgICAgICAgICAgLy8gZnVydGhlciBuYXZpZ2F0aW9ucyA9PiB0aGUgY2F0Y2hcbiAgICAgICAgICAgICAgICByZXR1cm4gbmF2LnByb21pc2UuY2F0Y2goZnVuY3Rpb24gKCkgeyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAvKiogQHR5cGUgez99ICovIChvZihudWxsKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICAgICAgICAuc3Vic2NyaWJlKGZ1bmN0aW9uICgpIHsgfSk7XG4gICAgfTtcbiAgICAvKipcbiA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nbml6ZShfdGhpcy5yb290Q29tcG9uZW50VHlwZSwgX3RoaXMuY29uZmlnLCBhcHBsaWVkVXJsLCBfdGhpcy5zZXJpYWxpemVVcmwoYXBwbGllZFVybCksIF90aGlzLnBhcmFtc0luaGVyaXRhbmNlU3RyYXRlZ3kpLCBmdW5jdGlvbiAoc25hcHNob3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChfdGhpcy5ldmVudHMpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5uZXh0KG5ldyBSb3V0ZXNSZWNvZ25pemVkKGlkLCBfdGhpcy5zZXJpYWxpemVVcmwodXJsKSwgX3RoaXMuc2VyaWFsaXplVXJsKGFwcGxpZWRVcmwpLCBzbmFwc2hvdCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgYXBwbGllZFVybDogYXBwbGllZFVybCwgc25hcHNob3Q6IHNuYXBzaG90IH07XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsQW5kU25hcHNob3QkID0gb2YoeyBhcHBsaWVkVXJsOiB1cmwsIHNuYXBzaG90OiBwcmVjcmVhdGVkU3RhdGUgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBiZWZvcmVQcmVhY3RpdmF0aW9uRG9uZSQgPSBtZXJnZU1hcC5jYWxsKHVybEFuZFNuYXBzaG90JCwgZnVuY3Rpb24gKHApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbWFwLmNhbGwoX3RoaXMuaG9va3MuYmVmb3JlUHJlYWN0aXZhdGlvbihwLnNuYXBzaG90KSwgZnVuY3Rpb24gKCkgeyByZXR1cm4gcDsgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIC8vIHJ1biBwcmVhY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aXZhdGluZygpKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnRyaWdnZXJFdmVudChuZXcgUmVzb2x2ZVN0YXJ0KGlkLCBfdGhpcy5zZXJpYWxpemVVcmwodXJsKSwgcC5hcHBsaWVkVXJsLCBwLnNuYXBzaG90KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChwcmVBY3RpdmF0aW9uLnJlc29sdmVEYXRhKF90aGlzLnBhcmFtc0luaGVyaXRhbmNlU3RyYXRlZ3kpLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy50cmlnZ2VyRXZlbnQobmV3IFJlc29sdmVFbmQoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBwLmFwcGxpZWRVcmwsIHAuc25hcHNob3QpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvZihwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByZWFjdGl2YXRpb25Eb25lJCA9IG1lcmdlTWFwLmNhbGwocHJlYWN0aXZhdGlvblJlc29sdmVEYXRhJCwgZnVuY3Rpb24gKHApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbWFwLmNhbGwoX3RoaXMuaG9va3MuYWZ0ZXJQcmVhY3RpdmF0aW9uKHAuc25hcHNob3QpLCBmdW5jdGlvbiAoKSB7IHJldHVybiBwOyB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgLy8gY3JlYXRlIHJvdXRlciBzdGF0ZVxuICAgICAgICAgICAgLy8gdGhpcyBvcGVyYXRpb24gaGFzIHNpZGUgZWZmZWN0cyA9PiByb3V0ZSB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HR5cGUgez99ICovIHN0b3JlZFN0YXRlID0gX3RoaXMucm91dGVyU3RhdGU7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzdG9yZWRVcmwgPSBfdGhpcy5jdXJyZW50VXJsVHJlZTtcbiAgICAgICAgICAgIHJvdXRlclN0YXRlJFxuICAgICAgICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgIHZhciBhcHBsaWVkVXJsID0gX2EuYXBwbGllZFVybCwgc3RhdGUgPSBfYS5zdGF0ZSwgc2hvdWxkQWN0aXZhdGUgPSBfYS5zaG91bGRBY3RpdmF0ZTtcbiAgICAgICAgICAgICAgICBpZiAoIXNob3VsZEFjdGl2YXRlIHx8IGlkICE9PSBfdGhpcy5uYXZpZ2F0aW9uSWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbmF2aWdhdGlvbklzU3VjY2Vzc2Z1bCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF90aGlzLmN1cnJlbnRVcmxUcmVlID0gYXBwbGllZFVybDtcbiAgICAgICAgICAgICAgICBfdGhpcy5yYXdVcmxUcmVlID0gX3RoaXMudXJsSGFuZGxpbmdTdHJhdGVneS5tZXJnZShfdGhpcy5jdXJyZW50VXJsVHJlZSwgcmF3VXJsKTtcbiAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMpKS5yb3V0ZXJTdGF0ZSA9IHN0YXRlO1xuICAgICAgICAgICAgICAgIGlmICghc2tpcExvY2F0aW9uQ2hhbmdlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHBhdGggPSBfdGhpcy51cmxTZXJpYWxpemVyLnNlcmlhbGl6ZShfdGhpcy5yYXdVcmxUcmVlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKF90aGlzLmxvY2F0aW9uLmlzQ3VycmVudFBhdGhFcXVhbFRvKHBhdGgpIHx8IHJlcGxhY2VVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmxvY2F0aW9uLnJlcGxhY2VTdGF0ZShwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmxvY2F0aW9uLmdvKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ldyBBY3RpdmF0ZVJvdXRlcyhfdGhpcy5yb3V0ZVJldXNlU3RyYXRlZ3ksIHN0YXRlLCBzdG9yZWRTdGF0ZSwgZnVuY3Rpb24gKGV2dCkgeyByZXR1cm4gX3RoaXMudHJpZ2dlckV2ZW50KGV2dCk7IH0pXG4gICAgICAgICAgICAgICAgICAgIC5hY3RpdmF0ZShfdGhpcy5yb290Q29udGV4dHMpO1xuICAgICAgICAgICAgICAgIG5hdmlnYXRpb25Jc1N1Y2Nlc3NmdWwgPSB0cnVlO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKG5hdmlnYXRpb25Jc1N1Y2Nlc3NmdWwpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMubmF2aWdhdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKF90aGlzLmV2ZW50cykpXG4gICAgICAgICAgICAgICAgICAgICAgICAubmV4dChuZXcgTmF2aWdhdGlvbkVuZChpZCwgX3RoaXMuc2VyaWFsaXplVXJsKHVybCksIF90aGlzLnNlcmlhbGl6ZVVybChfdGhpcy5jdXJyZW50VXJsVHJlZSkpKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZVByb21pc2UodHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXNldFVybFRvQ3VycmVudFVybFRyZWUoKTtcbiAgICAgICAgICAgICAgICAgICAgKC8qKiBAdHlwZSB7P30gKi8gKF90aGlzLmV2ZW50cykpXG4gICAgICAgICAgICAgICAgICAgICAgICAubmV4dChuZXcgTmF2aWdhdGlvbkNhbmNlbChpZCwgX3RoaXMuc2VyaWFsaXplVXJsKHVybCksICcnKSk7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVQcm9taXNlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIGlmIChpc05hdmlnYXRpb25DYW5jZWxpbmdFcnJvcihlKSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5uYXZpZ2F0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXNldFN0YXRlQW5kVXJsKHN0b3JlZFN0YXRlLCBzdG9yZWRVcmwsIHJhd1VybCk7XG4gICAgICAgICAgICAgICAgICAgICgvKiogQHR5cGUgez99ICovIChfdGhpcy5ldmVudHMpKVxuICAgICAgICAgICAgICAgICAgICAgICAgLm5leHQobmV3IE5hdmlnYXRpb25DYW5jZWwoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBlLm1lc3NhZ2UpKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZVByb21pc2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMucmVzZXRTdGF0ZUFuZFVybChzdG9yZWRTdGF0ZSwgc3RvcmVkVXJsLCByYXdVcmwpO1xuICAgICAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMuZXZlbnRzKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5uZXh0KG5ldyBOYXZpZ2F0aW9uRXJyb3IoaWQsIF90aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCBlKSk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlUHJvbWlzZShfdGhpcy5lcnJvckhhbmRsZXIoZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNhdGNoICgvKiogQHR5cGUgez99ICovIGVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3RQcm9taXNlKGVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RvcmVkU3RhdGVcbiAgICAgKiBAcGFyYW0gez99IHN0b3JlZFVybFxuICAgICAqIEBwYXJhbSB7P30gcmF3VXJsXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBSb3V0ZXIucHJvdG90eXBlLnJlc2V0U3RhdGVBbmRVcmwgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0b3JlZFN0YXRlXG4gICAgICogQHBhcmFtIHs/fSBzdG9yZWRVcmxcbiAgICAgKiBAcGFyYW0gez99IHJhd1VybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0b3JlZFN0YXRlLCBzdG9yZWRVcmwsIHJhd1VybCkge1xuICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAodGhpcykpLnJvdXRlclN0YXRlID0gc3RvcmVkU3RhdGU7XG4gICAgICAgIHRoaXMuY3VycmVudFVybFRyZWUgPSBzdG9yZWRVcmw7XG4gICAgICAgIHRoaXMucmF3VXJsVHJlZSA9IHRoaXMudXJsSGFuZGxpbmdTdHJhdGV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ez99IGZ1dHVyZU5vZGVcbiAgICAgKiBAcGFyYW0gez99IGN1cnJOb2RlXG4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRDb250ZXh0XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZnV0dXJlTm9kZSwgY3Vyck5vZGUsIHBhcmVudENvbnRleHQpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZnV0dXJlID0gZnV0dXJlTm9kZS52YWx1ZTtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY3VyciA9IGN1cnJOb2RlID8gY3Vyck5vZGUudmFsdWUgOiBudWxsO1xuICAgICAgICBpZiAoZnV0dXJlID09PSBjdXJyKSB7XG4gICAgICAgICAgICAvLyBSZXVzaW5nIHRoZSBub2RlLCBjaGVjayB0byBzZWUgaWYgdGhlIGNoaWxkcmVuIG5lZWQgdG8gYmUgZGUtYWN0aXZhdGVkXG4gICAgICAgICAgICBpZiAoZnV0dXJlLmNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgIC8vIElmIHdlIGhhdmUgYSBub3JtYWwgcm91dGUsIHdlIG5lZWQgdG8gZ28gdGhyb3VnaCBhbiBvdXRsZXQuXG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29udGV4dCA9IHBhcmVudENvbnRleHQuZ2V0Q29udGV4dChmdXR1cmUub3V0bGV0KTtcbiAgICAgICAgICAgICAgICBpZiAoY29udGV4dCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlYWN0aXZhdGVDaGlsZFJvdXRlcyhmdXR1cmVOb2RlLCBjdXJyTm9kZSwgY29udGV4dC5jaGlsZHJlbik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgd2UgaGF2ZSBhIGNvbXBvbmVudGxlc3Mgcm91dGUsIHdlIHJlY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G4gICAgICogQHBhcmFtIHs/fSBwYXJlbnRDb250ZXh0c1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQWN0aXZhdGVSb3V0ZXMucHJvdG90eXBlLmRlYWN0aXZhdGVSb3V0ZUFuZE91dGxldCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcGFyYW0gez99IHBhcmVudENvbnRleHRzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGUsIHBhcmVudENvbnRleHRzKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRleHQgPSBwYXJlbnRDb250ZXh0cy5nZXRDb250ZXh0KHJvdXRlLnZhbHVlLm91dGxldCk7XG4gICAgICAgIGlmIChjb250ZXh0KSB7XG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjaGlsZHJlbiA9IG5vZGVDaGlsZHJlbkFzTWFwKHJvdXRlKTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRleHRzXzEgPSByb3V0ZS52YWx1ZS5jb21wb25lbnQgPyBjb250ZXh0LmNoaWxkcmVuIDogcGFyZW50Q29udGV4dHM7XG4gICAgICAgICAgICBmb3JFYWNoKGNoaWxkcmVuLCBmdW5jdGlvbiAodiwgaykgeyByZXR1cm4gX3RoaXMuZGVhY3RpdmF0ZVJvdXRlQW5kSXRzQ2hpbGRyZW4odiwgY29udGV4dHNfMSk7IH0pO1xuICAgICAgICAgICAgaWYgKGNvbnRleHQub3V0bGV0KSB7XG4gICAgICAgICAgICAgICAgLy8gRGVzdHJveSB0aGUgY29tcG9uZW50XG4gICAgICAgICAgICAgICAgY29udGV4dC5vdXRsZXQuZGVhY3RpdmF0ZSgpO1xuICAgICAgICAgICAgICAgIC8vIERlc3Ryb3kgdGhlIGNvbnRleHRzIGZvciBhbGwg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S5zbmFwc2hvdCkpKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yb3V0ZVJldXNlU3RyYXRlZ3kuc3RvcmUoZnV0dXJlLnNuYXBzaG90LCBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5jaGlsZHJlbi5vbk91dGxldFJlQXR0YWNoZWQoc3RvcmVkLmNvbnRleHRzKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5hdHRhY2hSZWYgPSBzdG9yZWQuY29tcG9uZW50UmVmO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LnJvdXRlID0gc3RvcmVkLnJvdXRlLnZhbHVlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5vdXRsZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF0dGFjaCByaWdodCBhd2F5IHdoZW4gdGhlIG91dGxldCBoYXMgYWxyZWFkeSBiZWVuIGluc3RhbnRpYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlIGF0dGFjaCBmcm9tIGBSb3V0ZXJPdXRsZXQubmdPbkluaXRgIHdoZW4gaXQgaXMgaW5zdGFudGlhdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm91dGxldC5hdHRhY2goc3RvcmVkLmNvbXBvbmVudFJlZiwgc3RvcmVkLnJvdXRlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhZHZhbmNlQWN0aXZhdGVkUm91dGVOb2RlQW5kSXRzQ2hpbGRyZW4oc3RvcmVkLnJvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbmZpZyA9IHBhcmVudExvYWRlZENvbmZpZyhmdXR1cmUuc25hcHNob3QpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjbXBGYWN0b3J5UmVzb2x2ZXIgPSBjb25maWcgPyBjb25maWcubW9kdWxlLmNvbXBvbmVudEZhY3RvcnlSZXNvbHZlciA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucm91dGUgPSBmdXR1cmU7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucmVzb2x2ZXIgPSBjbXBGYWN0b3J5UmVzb2x2ZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250ZXh0Lm91dGxldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZhdGUgdGhlIG91dGxldCB3aGVuIGl0IGhhcyBhbHJlYWR5IGJlZW4gaW5zdGFudGlhdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UgaXQgd2lsbCBnZXQgYWN0aXZhdGVkIGZyb20gaXRzIGBuZ09uSW5pdGAgd2hlbiBpbnN0YW50aWF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQub3V0bGV0LmFjdGl2YXRlV2l0aChmdXR1cmUsIGNtcEZhY3RvcnlSZXNvbHZlcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3RpdmF0ZUNoaWxkUm91dGVzKGZ1dHVyZU5vZGUsIG51bGwsIGNvbnRleHQuY2hpbGRyZW4pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGlmIHdlIGhhdmUgYSBjb21wb25lbnRsZXNzIHJvdXRlLCB3ZSByZWN1cnNlIGJ1dCBrZWVwIHRoZSBzYW1lIG91dGxldCBtYXAuXG4gICAgICAgICAgICAgICAgdGhpcy5hY3RpdmF0ZUNoaWxkUm91dGVzKGZ1dHVyZU5vZGUsIG51bGwsIHBhcmVudENvbnRleHRzKTtcbiAgICAgICAg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hbmRzIDogW2NvbW1hbmRzXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuY29tbWFuZHMgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFJvdXRlckxpbmsucHJvdG90eXBlLCBcInByZXNlcnZlUXVlcnlQYXJhbXNcIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAZGVwcmVjYXRlZCA0LjAuMCB1c2UgYHF1ZXJ5UGFyYW1zSGFuZGxpbmdgIGluc3RlYWQuXG4gICAgICAgICAqIEBwYXJhbSB7P30gdmFsdWVcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGlzRGV2TW9kZSgpICYmIC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUpICYmIC8qKiBAdHlwZSB7P30gKi8gKGNvbnNvbGUud2FybikpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ3ByZXNlcnZlUXVlcnlQYXJhbXMgaXMgZGVwcmVjYXRlZCEsIHVzZSBxdWVyeVBhcmFtc0hhbmRsaW5nIGluc3RlYWQuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnByZXNlcnZlID0gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGluay5wcm90b3R5cGUub25DbGljayA9IC8qKlxuICAgICAqIEByZXR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XBkYXRlVGFyZ2V0VXJsQW5kSHJlZigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFJvdXRlckxpbmtXaXRoSHJlZi5wcm90b3R5cGUsIFwicm91dGVyTGlua1wiLCB7XG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gY29tbWFuZHNcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIChjb21tYW5kcykge1xuICAgICAgICAgICAgaWYgKGNvbW1hbmRzICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzID0gQXJyYXkuaXNBcnJheShjb21tYW5kcykgPyBjb21tYW5kcyA6IFtjb21tYW5kc107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShSb3V0ZXJMaW5rV2l0aEhyZWYucHJvdG90eXBlLCBcInByZXNlcnZlUXVlcnlQYXJhbXNcIiwge1xuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZhbHVlXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmIChpc0Rldk1vZGUoKSAmJiAvKiogQHR5cGUgez99ICovIChjb25zb2xlKSAmJiAvKiogQHR5cGUgez99ICovIChjb25zb2xlLndhcm4pKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCdwcmVzZXJ2ZVF1ZX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b3RvdHlwZS5uZ09uRGVzdHJveSA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkgeyB0aGlzLnN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpOyB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGlua0FjdGl2ZS5wcm90b3R5cGUudXBkYXRlID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmICghdGhpcy5saW5rcyB8fCAhdGhpcy5saW5rc1dpdGhIcmVmcyB8fCAhdGhpcy5yb3V0ZXIubmF2aWdhdGVkKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBQcm9taXNlLnJlc29sdmUoKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGhhc0FjdGl2ZUxpbmtzID0gX3RoaXMuaGFzQWN0aXZlTGlua3MoKTtcbiAgICAgICAgICAgIGlmIChfdGhpcy5pc0FjdGl2ZSAhPT0gaGFzQWN0aXZlTGlua3MpIHtcbiAgICAgICAgICAgICAgICAoLyoqIEB0eXBlIHs/fSAqLyAoX3RoaXMpKS5pc0FjdGl2ZSA9IGhhc0FjdGl2ZUxpbmtzO1xuICAgICAgICAgICAgICAgIF90aGlzLmNsYXNzZXMuZm9yRWFjaChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaGFzQWN0aXZlTGlua3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnJlbmRlcmVyLmFkZENsYXNzKF90aGlzLmVsZW1lbnQubmF0aXZlRWxlbWVudCwgYyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZW5kZXJlci5yZW1vdmVDbGFzcyhfdGhpcy5lbGVtZW50Lm5hdGl2ZUVsZW1lbnQsIGMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZXJcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlckxpbmtBY3RpdmUucHJvdG90eXBlLmlzTGlua0FjdGl2ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcm91dGVyXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocm91dGVyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAobGluaykge1xuICAgICAgICAgICAgcmV0dXJuIHJvdXRlci5pc0FjdGl2ZShsaW5rLnVybFRyZWUsIF90aGlzLnJvdXRlckxpbmtBY3RpdmVPcHRpb25zLmV4YWN0KTtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyTGlua0FjdGl2ZS5wcm90b3R5cGUuaGFzQWN0aXZlTGlua3MgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubGlua3Muc29tZSh0aGlzLmlzTGlua0FjdGl2ZSh0aGlzLnJvdXRlcikpIHx8XG4gICAgICAgICAgICB0aGlzLmxpbmtzV2l0aEhyZWZzLnNvbWUodGhpcy5pc0xpbmtBY3RpdmUodGhpcy5yb3V0ZXIpKTtcbiAgICB9O1xuICAgIFJvdXRlckxpbmtBY3RpdmUuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAg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V4dHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIENoaWxkcmVuT3V0bGV0Q29udGV4dHMucHJvdG90eXBlLm9uT3V0bGV0UmVBdHRhY2hlZCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29udGV4dHNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjb250ZXh0cykgeyB0aGlzLmNvbnRleHRzID0gY29udGV4dHM7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjaGlsZE5hbWVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIENoaWxkcmVuT3V0bGV0Q29udGV4dHMucHJvdG90eXBlLmdldE9yQ3JlYXRlQ29udGV4dCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hpbGROYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY2hpbGROYW1lKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvbnRleHQgPSB0aGlzLmdldENvbnRleHQoY2hpbGROYW1lKTtcbiAgICAgICAgaWYgKCFjb250ZXh0KSB7XG4gICAgICAgICAgICBjb250ZXh0ID0gbmV3IE91dGxldENvbnRleHQoKTtcbiAgICAgICAgICAgIHRoaXMuY29udGV4dHMuc2V0KGNoaWxkTmFtZSwgY29udGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNvbnRleHQ7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGNoaWxkTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQ2hpbGRyZW5PdXRsZXRDb250ZXh0cy5wcm90b3R5cGUuZ2V0Q29udGV4dCA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY2hpbGROYW1lXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiA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HRhY2hSZWYsIGNvbnRleHQucm91dGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHRoZSBjb21wb25lbnQgZGVmaW5lZCBpbiB0aGUgY29uZmlndXJhdGlvbiBpcyBjcmVhdGVkXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZhdGVXaXRoKGNvbnRleHQucm91dGUsIGNvbnRleHQucmVzb2x2ZXIgfHwgbnVsbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoUm91dGVyT3V0bGV0LnByb3RvdHlwZSwgXCJpc0FjdGl2YXRlZFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7IHJldHVybiAhIXRoaXMuYWN0aXZhdGVkOyB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoUm91dGVyT3V0bGV0LnByb3RvdHlwZSwgXCJjb21wb25lbnRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmFjdGl2YXRlZClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ091dGxldCBpcyBub3QgYWN0aXZhdGVkJyk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hY3RpdmF0ZWQuaW5zdGFuY2U7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAg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29uZmlnKSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY2hpbGRDb25maWcgPSByb3V0ZS5fbG9hZGVkQ29uZmlnO1xuICAgICAgICAgICAgICAgIHJlcy5wdXNoKHRoaXMucHJvY2Vzc1JvdXRlcyhjaGlsZENvbmZpZy5tb2R1bGUsIGNoaWxkQ29uZmlnLnJvdXRlcykpO1xuICAgICAgICAgICAgICAgIC8vIG5vIGNvbmZpZyBsb2FkZWQsIGZldGNoIHRoZSBjb25maWdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHJvdXRlLmxvYWRDaGlsZHJlbiAmJiAhcm91dGUuY2FuTG9hZCkge1xuICAgICAgICAgICAgICAgIHJlcy5wdXNoKHRoaXMucHJlbG9hZENvbmZpZyhuZ01vZHVsZSwgcm91dGUpKTtcbiAgICAgICAgICAgICAgICAvLyByZWN1cnNlIGludG8gY2hpbGRyZW5cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHJvdXRlLmNoaWxkcmVuKSB7XG4gICAgICAgICAgICAgICAgcmVzLnB1c2godGhpcy5wcm9jZXNzUm91dGVzKG5nTW9kdWxlLCByb3V0ZS5jaGlsZHJlbikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtZXJnZUFsbC5jYWxsKGZyb20ocmVzKSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5nTW9kdWxlXG4gICAgICogQHBhcmFtIHs/fSByb3V0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUm91dGVyUHJlbG9hZGVyLnByb3RvdHlwZS5wcmVsb2FkQ29uZmlnID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBuZ01vZHVsZVxuICAgICAqIEBwYXJhbSB7P30gcm91dGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW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Um91dGVyLCBuZXcgT3B0aW9uYWwoKSwgbmV3IFNraXBTZWxmKCldXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgeyBwcm92aWRlOiBST1VURVJfQ09ORklHVVJBVElPTiwgdXNlVmFsdWU6IGNvbmZpZyA/IGNvbmZpZyA6IHt9IH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBMb2NhdGlvblN0cmF0ZWd5LFxuICAgICAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBwcm92aWRlTG9jYXRpb25TdHJhdGVneSxcbiAgICAgICAgICAgICAgICAgICAgZGVwczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgUGxhdGZvcm1Mb2NhdGlvbiwgW25ldyBJbmplY3QoQVBQX0JBU0VfSFJFRiksIG5ldyBPcHRpb25hbCgpXSwgUk9VVEVSX0NPTkZJR1VSQVRJT05cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBQcmVsb2FkaW5nU3RyYXRlZ3ksXG4gICAgICAgICAgICAgICAgICAgIHVzZUV4aXN0aW5nOiBjb25maWcgJiYgY29uZmlnLnByZWxvYWRpbmdTdHJhdGVneSA/IGNvbmZpZy5wcmVsb2FkaW5nU3RyYXRlZ3kgOlxuICAgICAgICAgICAgICAgICAgICAgICAgTm9QcmVsb2FkaW5nXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7IHByb3ZpZGU6IE5nUHJvYmVUb2tlbiwgbXVsdGk6IHRydWUsIHVzZUZhY3Rvcnk6IHJvdXRlck5nUHJvYmVUb2tlbiB9LFxuICAgICAgICAgICAgICAgIHByb3ZpZGVSb3V0ZXJJbml0aWFsaXplcigpLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIENyZ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SVRJQUxJWkVELCBQcm9taXNlLnJlc29sdmUobnVsbCkpO1xuICAgICAgICByZXR1cm4gcC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlc29sdmUgPSAvKiogQHR5cGUgez99ICovICgobnVsbCkpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzID0gbmV3IFByb21pc2UoZnVuY3Rpb24gKHIpIHsgcmV0dXJuIHJlc29sdmUgPSByOyB9KTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJvdXRlciA9IF90aGlzLmluamVjdG9yLmdldChSb3V0ZXIpO1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb3B0cyA9IF90aGlzLmluamVjdG9yLmdldChST1VURVJfQ09ORklHVVJBVElPTik7XG4gICAgICAgICAgICBpZiAoX3RoaXMuaXNMZWdhY3lEaXNhYmxlZChvcHRzKSB8fCBfdGhpcy5pc0xlZ2FjeUVuYWJsZWQob3B0cykpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAob3B0cy5pbml0aWFsTmF2aWdhdGlvbiA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgICAgICAgICAgIHJvdXRlci5zZXRVcExvY2F0aW9uQ2hhbmdlTGlzdGVuZXIoKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAob3B0cy5pbml0aWFsTmF2aWdhdGlvbiA9PT0gJ2VuYWJsZWQnKSB7XG4gICAgICAgICAgICAgICAgcm91dGVyLmhvb2tzLmFmdGVyUHJlYWN0aXZhdGlvbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gb25seSB0aGUgaW5pdGlhbCBuYXZpZ2F0aW9uIHNob3VsZCBiZSBkZWxheWVkXG4gICAgICAgICAgICAgICAgICAgIGlmICghX3RoaXMuaW5pdE5hdmlnYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmluaXROYXZpZ2F0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUodHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMucmVzdWx0T2ZQcmVhY3RpdmF0aW9uRG9uZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1YnNlcXVlbnQgbmF2aWdhdGlvbnMgc2hvdWxkIG5vdCBiZSBkZWxheWVkXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAob2YobnVsbCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByb3V0ZXIuaW5pdGlhbE5hdmlnYXRpb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkludmFsaWQgaW5pdGlhbE5hdmlnYXRpb24gb3B0aW9uczogJ1wiICsgb3B0cy5pbml0aWFsTmF2aWdhdGlvbiArIFwiJ1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBib290c3RyYXBwZWRDb21wb25lbnRSZWZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFJvdXRlckluaXRpYWxpemVyLnByb3RvdHlwZS5ib290c3RyYXBMaXN0ZW5lciA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gYm9vdHN0cmFwcGVkQ29tcG9uZW50UmVmXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoYm9vdHN0cmFwcGVkQ29tcG9uZW50UmVmKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9wdHMgPSB0aGlzLmluamVjdG9yLmdldChST1VURVJfQ09ORklHVVJBVElPTik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByZWxvYWRlciA9IHRoaXMuaW5qZWN0b3IuZ2V0KFJvdXRlclByZWxvYWRlcik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJvdXRlciA9IHRoaXMuaW5qZWN0b3IuZ2V0KFJvdXRlcik7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlZiA9IHRoaXMuaW5qZWN0b3IuZ2V0KEFwcGxpY2F0aW9uUmVmKTtcbiAgICAgICAgaWYgKGJvb3RzdHJhcHBlZENvbXBvbmVudFJlZiAhPT0gcmVmLmNvbXBvbmVudHNbMF0pIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5pc0xlZ2FjeUVuYWJsZWQob3B0cykpIHtcbiAgICAgICAgICAgIHJvdXRlci5pbml0aWFsTmF2aWdhdGlvbigpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoaXMuaXNMZWdhY3lEaXNhYmxlZChvcHRzKSkge1xuICAgICAgICAgICAgcm91dGVyLnNldFVwTG9jYXRpb25DaGFuZ2VMaXN0ZW5lcigpO1xuICAgICAgICB9XG4gICAgICAgIHByZWxvYWRlci5zZXRVcFByZWxvYWRpbmcoKTtcbiAgICAgICAgcm91dGVyLnJlc2V0Um9vdENvbXBvbmVudFR5cGUocmVmLmNvbXBvbmVudFR5cGVzWzBdKTtcbiAgICAgICAgdGhpcy5yZXN1bHRPZlByZWFjdGl2YXRpb25Eb25lLm5leHQoLyoqIEB0eXBlIHs/fSAqLyAoKG51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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///66\n"); /***/ }), /* 67 */, @@ -209,7 +209,7 @@ eval("\nvar __extends = (this && this.__extends) || function (d, b) {\n for ( /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpBackend\", function() { return HttpBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHandler\", function() { return HttpHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClient\", function() { return HttpClient; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHeaders\", function() { return HttpHeaders; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HTTP_INTERCEPTORS\", function() { return HTTP_INTERCEPTORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonpClientBackend\", function() { return JsonpClientBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonpInterceptor\", function() { return JsonpInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientJsonpModule\", function() { return HttpClientJsonpModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientModule\", function() { return HttpClientModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientXsrfModule\", function() { return HttpClientXsrfModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵinterceptingHandler\", function() { return interceptingHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpParams\", function() { return HttpParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpUrlEncodingCodec\", function() { return HttpUrlEncodingCodec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpRequest\", function() { return HttpRequest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpErrorResponse\", function() { return HttpErrorResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpEventType\", function() { return HttpEventType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHeaderResponse\", function() { return HttpHeaderResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpResponse\", function() { return HttpResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpResponseBase\", function() { return HttpResponseBase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpXhrBackend\", function() { return HttpXhrBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"XhrFactory\", function() { return XhrFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpXsrfTokenExtractor\", function() { return HttpXsrfTokenExtractor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return NoopInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return JsonpCallbackContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return jsonpCallbackContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return BrowserXhr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return HttpXsrfCookieExtractor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return HttpXsrfInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return XSRF_COOKIE_NAME; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return XSRF_HEADER_NAME; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__ = __webpack_require__(118);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__ = __webpack_require__(243);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__ = __webpack_require__(10);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@stable\n * @abstract\n */\nvar HttpHandler = /** @class */ (function () {\n function HttpHandler() {\n }\n return HttpHandler;\n}());\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@stable\n * @abstract\n */\nvar HttpBackend = /** @class */ (function () {\n function HttpBackend() {\n }\n return HttpBackend;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @record\n */\n/**\n * Immutable set of Http headers, with lazy parsing.\n * \\@stable\n */\nvar HttpHeaders = /** @class */ (function () {\n function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var /** @type {?} */ index = line.indexOf(':');\n if (index > 0) {\n var /** @type {?} */ name_1 = line.slice(0, index);\n var /** @type {?} */ key = name_1.toLowerCase();\n var /** @type {?} */ value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name_1, key);\n if (_this.headers.has(key)) {\n /** @type {?} */ ((_this.headers.get(key))).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = headers[name];\n var /** @type {?} */ key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n /**\n * Checks for existence of header by given name.\n */\n /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.has = /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n };\n /**\n * Returns first header that matches given name.\n */\n /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.get = /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n var /** @type {?} */ values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n };\n /**\n * Returns the names of the headers\n */\n /**\n * Returns the names of the headers\n * @return {?}\n */\n HttpHeaders.prototype.keys = /**\n * Returns the names of the headers\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(this.normalizedNames.values());\n };\n /**\n * Returns list of header values for a given name.\n */\n /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.getAll = /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.get(name.toLowerCase()) || null;\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.append = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'a' });\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.set = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 's' });\n };\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n HttpHeaders.prototype.delete = /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'd' });\n };\n /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n HttpHeaders.prototype.maybeSetNormalizedName = /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n function (name, lcName) {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n };\n /**\n * @return {?}\n */\n HttpHeaders.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n }\n else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });\n this.lazyUpdate = null;\n }\n }\n };\n /**\n * @param {?} other\n * @return {?}\n */\n HttpHeaders.prototype.copyFrom = /**\n * @param {?} other\n * @return {?}\n */\n function (other) {\n var _this = this;\n other.init();\n Array.from(other.headers.keys()).forEach(function (key) {\n _this.headers.set(key, /** @type {?} */ ((other.headers.get(key))));\n _this.normalizedNames.set(key, /** @type {?} */ ((other.normalizedNames.get(key))));\n });\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.applyUpdate = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ value = /** @type {?} */ ((update.value));\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n var /** @type {?} */ base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push.apply(base, value);\n this.headers.set(key, base);\n break;\n case 'd':\n var /** @type {?} */ toDelete_1 = /** @type {?} */ (update.value);\n if (!toDelete_1) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n var /** @type {?} */ existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n HttpHeaders.prototype.forEach = /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(function (key) { return fn(/** @type {?} */ ((_this.normalizedNames.get(key))), /** @type {?} */ ((_this.headers.get(key)))); });\n };\n return HttpHeaders;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A codec for encoding and decoding parameters in URLs.\n *\n * Used by `HttpParams`.\n *\n * \\@stable\n *\n * @record\n */\n\n/**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@stable\n */\nvar HttpUrlEncodingCodec = /** @class */ (function () {\n function HttpUrlEncodingCodec() {\n }\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return standardEncoding(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return standardEncoding(v); };\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return decodeURIComponent(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return decodeURIComponent(v); };\n return HttpUrlEncodingCodec;\n}());\n/**\n * @param {?} rawParams\n * @param {?} codec\n * @return {?}\n */\nfunction paramParser(rawParams, codec) {\n var /** @type {?} */ map$$1 = new Map();\n if (rawParams.length > 0) {\n var /** @type {?} */ params = rawParams.split('&');\n params.forEach(function (param) {\n var /** @type {?} */ eqIdx = param.indexOf('=');\n var _a = eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], key = _a[0], val = _a[1];\n var /** @type {?} */ list = map$$1.get(key) || [];\n list.push(val);\n map$$1.set(key, list);\n });\n }\n return map$$1;\n}\n/**\n * @param {?} v\n * @return {?}\n */\nfunction standardEncoding(v) {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/gi, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%2B/gi, '+')\n .replace(/%3D/gi, '=')\n .replace(/%3F/gi, '?')\n .replace(/%2F/gi, '/');\n}\n/**\n * Options used to construct an `HttpParams` instance.\n * @record\n */\n\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable - all mutation operations return a new instance.\n *\n * \\@stable\n */\nvar HttpParams = /** @class */ (function () {\n function HttpParams(options) {\n if (options === void 0) { options = /** @type {?} */ ({}); }\n var _this = this;\n this.updates = null;\n this.cloneFrom = null;\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n if (!!options.fromString) {\n if (!!options.fromObject) {\n throw new Error(\"Cannot specify both fromString and fromObject.\");\n }\n this.map = paramParser(options.fromString, this.encoder);\n }\n else if (!!options.fromObject) {\n this.map = new Map();\n Object.keys(options.fromObject).forEach(function (key) {\n var /** @type {?} */ value = (/** @type {?} */ (options.fromObject))[key]; /** @type {?} */\n ((_this.map)).set(key, Array.isArray(value) ? value : [value]);\n });\n }\n else {\n this.map = null;\n }\n }\n /**\n * Check whether the body has one or more values for the given parameter name.\n */\n /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.has = /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).has(param);\n };\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.get = /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n var /** @type {?} */ res = /** @type {?} */ ((this.map)).get(param);\n return !!res ? res[0] : null;\n };\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.getAll = /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).get(param) || null;\n };\n /**\n * Get all the parameter names for this body.\n */\n /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n HttpParams.prototype.keys = /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(/** @type {?} */ ((this.map)).keys());\n };\n /**\n * Construct a new body with an appended value for the given parameter name.\n */\n /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.append = /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };\n /**\n * Construct a new body with a new value for the given parameter name.\n */\n /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.set = /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n */\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n HttpParams.prototype.delete = /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n */\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n HttpParams.prototype.toString = /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n function () {\n var _this = this;\n this.init();\n return this.keys()\n .map(function (key) {\n var /** @type {?} */ eKey = _this.encoder.encodeKey(key);\n return /** @type {?} */ ((/** @type {?} */ ((_this.map)).get(key))).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); }).join('&');\n })\n .join('&');\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpParams.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpParams(/** @type {?} */ ({ encoder: this.encoder }));\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat([update]);\n return clone;\n };\n /**\n * @return {?}\n */\n HttpParams.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (this.map === null) {\n this.map = new Map();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(function (key) { return ((_this.map)).set(key, /** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((_this.cloneFrom)).map)).get(key)))); }); /** @type {?} */\n ((this.updates)).forEach(function (update) {\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ base = (update.op === 'a' ? /** @type {?} */ ((_this.map)).get(update.param) : undefined) || [];\n base.push(/** @type {?} */ ((update.value))); /** @type {?} */\n ((_this.map)).set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n var /** @type {?} */ base_1 = /** @type {?} */ ((_this.map)).get(update.param) || [];\n var /** @type {?} */ idx = base_1.indexOf(update.value);\n if (idx !== -1) {\n base_1.splice(idx, 1);\n }\n if (base_1.length > 0) {\n /** @type {?} */ ((_this.map)).set(update.param, base_1);\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n }\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = null;\n }\n };\n return HttpParams;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Determine whether the given HTTP method may include a body.\n * @param {?} method\n * @return {?}\n */\nfunction mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@stable\n */\nvar HttpRequest = /** @class */ (function () {\n function HttpRequest(method, url, third, fourth) {\n this.url = url;\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n this.body = null;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n this.reportProgress = false;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n this.withCredentials = false;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n this.responseType = 'json';\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n var /** @type {?} */ options;\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = (third !== undefined) ? /** @type {?} */ (third) : null;\n options = fourth;\n }\n else {\n // No body required, options are the third argument. The body stays null.\n options = /** @type {?} */ (third);\n }\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n if (!!options.params) {\n this.params = options.params;\n }\n }\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n }\n else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n var /** @type {?} */ params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n }\n else {\n // Does the URL already have query parameters? Look for '?'.\n var /** @type {?} */ qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n var /** @type {?} */ sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n */\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n HttpRequest.prototype.serializeBody = /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n function () {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return (/** @type {?} */ (this.body)).toString();\n };\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n */\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n HttpRequest.prototype.detectContentTypeHeader = /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n function () {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n Array.isArray(this.body)) {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n };\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpRequest.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n var /** @type {?} */ method = update.method || this.method;\n var /** @type {?} */ url = update.url || this.url;\n var /** @type {?} */ responseType = update.responseType || this.responseType;\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n var /** @type {?} */ body = (update.body !== undefined) ? update.body : this.body;\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n var /** @type {?} */ withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n var /** @type {?} */ reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n var /** @type {?} */ headers = update.headers || this.headers;\n var /** @type {?} */ params = update.params || this.params;\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce(function (headers, name) { return headers.set(name, /** @type {?} */ ((update.setHeaders))[name]); }, headers);\n }\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce(function (params, param) { return params.set(param, /** @type {?} */ ((update.setParams))[param]); }, params);\n }\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,\n });\n };\n return HttpRequest;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar HttpEventType = {\n /**\n * The request was sent out over the wire.\n */\n Sent: 0,\n /**\n * An upload progress event was received.\n */\n UploadProgress: 1,\n /**\n * The response status code and headers were received.\n */\n ResponseHeader: 2,\n /**\n * A download progress event was received.\n */\n DownloadProgress: 3,\n /**\n * The full response including the body was received.\n */\n Response: 4,\n /**\n * A custom event from an interceptor or a backend.\n */\n User: 5,\n};\nHttpEventType[HttpEventType.Sent] = \"Sent\";\nHttpEventType[HttpEventType.UploadProgress] = \"UploadProgress\";\nHttpEventType[HttpEventType.ResponseHeader] = \"ResponseHeader\";\nHttpEventType[HttpEventType.DownloadProgress] = \"DownloadProgress\";\nHttpEventType[HttpEventType.Response] = \"Response\";\nHttpEventType[HttpEventType.User] = \"User\";\n/**\n * Base interface for progress events.\n *\n * \\@stable\n * @record\n */\n\n/**\n * A download progress event.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An upload progress event.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An event indicating that the request was sent to the server. Useful\n * when a request may be retried multiple times, to distinguish between\n * retries on the final event stream.\n *\n * \\@stable\n * @record\n */\n\n/**\n * A user-defined event.\n *\n * Grouping all custom events under this type ensures they will be handled\n * and forwarded by all implementations of interceptors.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An error that represents a failed attempt to JSON.parse text coming back\n * from the server.\n *\n * It bundles the Error object with the actual response body that failed to parse.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@stable\n * @abstract\n */\nvar HttpResponseBase = /** @class */ (function () {\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n */\n function HttpResponseBase(init, defaultStatus, defaultStatusText) {\n if (defaultStatus === void 0) { defaultStatus = 200; }\n if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n return HttpResponseBase;\n}());\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@stable\n */\nvar HttpHeaderResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpHeaderResponse, _super);\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n */\n function HttpHeaderResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.ResponseHeader;\n return _this;\n }\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n */\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n HttpHeaderResponse.prototype.clone = /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpHeaderResponse;\n}(HttpResponseBase));\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@stable\n */\nvar HttpResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpResponse, _super);\n /**\n * Construct a new `HttpResponse`.\n */\n function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpResponse.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n return new HttpResponse({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpResponse;\n}(HttpResponseBase));\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@stable\n */\nvar HttpErrorResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpErrorResponse, _super);\n function HttpErrorResponse(init) {\n var _this = \n // Initialize with a default status of 0 / Unknown Error.\n _super.call(this, init, 0, 'Unknown Error') || this;\n _this.name = 'HttpErrorResponse';\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n _this.ok = false;\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (_this.status >= 200 && _this.status < 300) {\n _this.message = \"Http failure during parsing for \" + (init.url || '(unknown url)');\n }\n else {\n _this.message =\n \"Http failure response for \" + (init.url || '(unknown url)') + \": \" + init.status + \" \" + init.statusText;\n }\n _this.error = init.error || null;\n return _this;\n }\n return HttpErrorResponse;\n}(HttpResponseBase));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Construct an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and\n * the given `body`. Basically, this clones the object and adds the body.\n * @template T\n * @param {?} options\n * @param {?} body\n * @return {?}\n */\nfunction addBody(options, body) {\n return {\n body: body,\n headers: options.headers,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n/**\n * Perform HTTP requests.\n *\n * `HttpClient` is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies according to which\n * signature is called (mainly the values of `observe` and `responseType`).\n *\n * \\@stable\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient(handler) {\n this.handler = handler;\n }\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n */\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.request = /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n function (first, url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var /** @type {?} */ req;\n // Firstly, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = /** @type {?} */ (first);\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming GET unless a method is\n // provided.\n // Figure out the headers.\n var /** @type {?} */ headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n var /** @type {?} */ params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams(/** @type {?} */ ({ fromObject: options.params }));\n }\n }\n // Construct the request.\n req = new HttpRequest(first, /** @type {?} */ ((url)), (options.body !== undefined ? options.body : null), {\n headers: headers,\n params: params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n var /** @type {?} */ events$ = __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__[\"concatMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__[\"of\"])(req), function (req) { return _this.handler.handle(req); });\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n var /** @type {?} */ res$ = __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__[\"filter\"].call(events$, function (event) { return event instanceof HttpResponse; });\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n });\n case 'blob':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n });\n case 'text':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n });\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) { return res.body; });\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(\"Unreachable: unhandled observe type \" + options.observe + \"}\");\n }\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.delete = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('DELETE', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.get = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('GET', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.head = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('HEAD', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n HttpClient.prototype.jsonp = /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n function (url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.options = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('OPTIONS', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.patch = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PATCH', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.post = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('POST', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.put = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PUT', url, addBody(options, body));\n };\n HttpClient.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpClient.ctorParameters = function () { return [\n { type: HttpHandler, },\n ]; };\n return HttpClient;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Intercepts `HttpRequest` and handles them.\n *\n * Most interceptors will transform the outgoing request before passing it to the\n * next interceptor in the chain, by calling `next.handle(transformedReq)`.\n *\n * In rare cases, interceptors may wish to completely handle a request themselves,\n * and not delegate to the remainder of the chain. This behavior is allowed.\n *\n * \\@stable\n * @record\n */\n\n/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@stable\n */\nvar HttpInterceptorHandler = /** @class */ (function () {\n function HttpInterceptorHandler(next, interceptor) {\n this.next = next;\n this.interceptor = interceptor;\n }\n /**\n * @param {?} req\n * @return {?}\n */\n HttpInterceptorHandler.prototype.handle = /**\n * @param {?} req\n * @return {?}\n */\n function (req) {\n return this.interceptor.intercept(req, this.next);\n };\n return HttpInterceptorHandler;\n}());\n/**\n * A multi-provider token which represents the array of `HttpInterceptor`s that\n * are registered.\n *\n * \\@stable\n */\nvar HTTP_INTERCEPTORS = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('HTTP_INTERCEPTORS');\nvar NoopInterceptor = /** @class */ (function () {\n function NoopInterceptor() {\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n NoopInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n return next.handle(req);\n };\n NoopInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NoopInterceptor.ctorParameters = function () { return []; };\n return NoopInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// Every request made through JSONP needs a callback name that's unique across the\n// whole page. Each request is assigned an id and the callback name is constructed\n// from that. The next id to be assigned is tracked in a global variable here that\n// is shared among all applications on the page.\nvar nextRequestId = 0;\n// Error text given when a JSONP script is injected, but doesn't invoke the callback\n// passed in its URL.\nvar JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';\n// Error text given when a request is passed to the JsonpClientBackend that doesn't\n// have a request method JSONP.\nvar JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';\nvar JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@stable\n * @abstract\n */\nvar JsonpCallbackContext = /** @class */ (function () {\n function JsonpCallbackContext() {\n }\n return JsonpCallbackContext;\n}());\n/**\n * `HttpBackend` that only processes `HttpRequest` with the JSONP method,\n * by performing JSONP style requests.\n *\n * \\@stable\n */\nvar JsonpClientBackend = /** @class */ (function () {\n function JsonpClientBackend(callbackMap, document) {\n this.callbackMap = callbackMap;\n this.document = document;\n }\n /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n JsonpClientBackend.prototype.nextCallback = /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n function () { return \"ng_jsonp_callback_\" + nextRequestId++; };\n /**\n * Process a JSONP request and return an event stream of the results.\n */\n /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n JsonpClientBackend.prototype.handle = /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n function (req) {\n var _this = this;\n // Firstly, check both the method and response type. If either doesn't match\n // then the request was improperly routed here and cannot be handled.\n if (req.method !== 'JSONP') {\n throw new Error(JSONP_ERR_WRONG_METHOD);\n }\n else if (req.responseType !== 'json') {\n throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);\n }\n // Everything else happens inside the Observable boundary.\n return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__[\"Observable\"](function (observer) {\n // The first step to make a request is to generate the callback name, and replace the\n // callback placeholder in the URL with the name. Care has to be taken here to ensure\n // a trailing &, if matched, gets inserted back into the URL in the correct place.\n var /** @type {?} */ callback = _this.nextCallback();\n var /** @type {?} */ url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, \"=\" + callback + \"$1\");\n // Construct the <script> tag and point it at the URL.\n var /** @type {?} */ node = _this.document.createElement('script');\n node.src = url;\n // A JSONP request requires waiting for multiple callbacks. These variables\n // are closed over and track state across those callbacks.\n // The response object, if one has been received, or null otherwise.\n var /** @type {?} */ body = null;\n // Whether the response callback has been called.\n var /** @type {?} */ finished = false;\n // Whether the request has been cancelled (and thus any other callbacks)\n // should be ignored.\n var /** @type {?} */ cancelled = false;\n // Set the response callback in this.callbackMap (which will be the window\n // object in the browser. The script being loaded via the <script> tag will\n // eventually call this callback.\n // Set the response callback in this.callbackMap (which will be the window\n // object in the browser. The script being loaded via the <script> tag will\n // eventually call this callback.\n _this.callbackMap[callback] = function (data) {\n // Data has been received from the JSONP script. Firstly, delete this callback.\n delete _this.callbackMap[callback];\n // Next, make sure the request wasn't cancelled in the meantime.\n if (cancelled) {\n return;\n }\n // Set state to indicate data was received.\n body = data;\n finished = true;\n };\n // cleanup() is a utility closure that removes the <script> from the page and\n // the response callback from the window. This logic is used in both the\n // success, error, and cancellation paths, so it's extracted out for convenience.\n var /** @type {?} */ cleanup = function () {\n // Remove the <script> tag if it's still on the page.\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n // Remove the response callback from the callbackMap (window object in the\n // browser).\n delete _this.callbackMap[callback];\n };\n // onLoad() is the success callback which runs after the response callback\n // if the JSONP script loads successfully. The event itself is unimportant.\n // If something went wrong, onLoad() may run without the response callback\n // having been invoked.\n var /** @type {?} */ onLoad = function (event) {\n // Do nothing if the request has been cancelled.\n if (cancelled) {\n return;\n }\n // Cleanup the page.\n cleanup();\n // Check whether the response callback has run.\n if (!finished) {\n // It hasn't, something went wrong with the request. Return an error via\n // the Observable error path. All JSONP errors have status 0.\n observer.error(new HttpErrorResponse({\n url: url,\n status: 0,\n statusText: 'JSONP Error',\n error: new Error(JSONP_ERR_NO_CALLBACK),\n }));\n return;\n }\n // Success. body either contains the response body or null if none was\n // returned.\n observer.next(new HttpResponse({\n body: body,\n status: 200,\n statusText: 'OK', url: url,\n }));\n // Complete the stream, the resposne is over.\n observer.complete();\n };\n // onError() is the error callback, which runs if the script returned generates\n // a Javascript error. It emits the error via the Observable error channel as\n // a HttpErrorResponse.\n var /** @type {?} */ onError = function (error) {\n // If the request was already cancelled, no need to emit anything.\n if (cancelled) {\n return;\n }\n cleanup();\n // Wrap the error in a HttpErrorResponse.\n observer.error(new HttpErrorResponse({\n error: error,\n status: 0,\n statusText: 'JSONP Error', url: url,\n }));\n };\n // Subscribe to both the success (load) and error events on the <script> tag,\n // and add it to the page.\n node.addEventListener('load', onLoad);\n node.addEventListener('error', onError);\n _this.document.body.appendChild(node);\n // The request has now been successfully sent.\n observer.next({ type: HttpEventType.Sent });\n // Cancellation handler.\n return function () {\n // Track the cancellation so event listeners won't do anything even if already scheduled.\n cancelled = true;\n // Remove the event listeners so they won't run if the events later fire.\n node.removeEventListener('load', onLoad);\n node.removeEventListener('error', onError);\n // And finally, clean up the page.\n cleanup();\n };\n });\n };\n JsonpClientBackend.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n JsonpClientBackend.ctorParameters = function () { return [\n { type: JsonpCallbackContext, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"DOCUMENT\"],] },] },\n ]; };\n return JsonpClientBackend;\n}());\n/**\n * An `HttpInterceptor` which identifies requests with the method JSONP and\n * shifts them to the `JsonpClientBackend`.\n *\n * \\@stable\n */\nvar JsonpInterceptor = /** @class */ (function () {\n function JsonpInterceptor(jsonp) {\n this.jsonp = jsonp;\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n JsonpInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(/** @type {?} */ (req));\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n };\n JsonpInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n JsonpInterceptor.ctorParameters = function () { return [\n { type: JsonpClientBackend, },\n ]; };\n return JsonpInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XSSI_PREFIX = /^\\)\\]\\}',?\\n/;\n/**\n * Determine an appropriate URL for the response, by checking either\n * XMLHttpRequest.responseURL or the X-Request-URL header.\n * @param {?} xhr\n * @return {?}\n */\nfunction getResponseUrl(xhr) {\n if ('responseURL' in xhr && xhr.responseURL) {\n return xhr.responseURL;\n }\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL');\n }\n return null;\n}\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * \\@stable\n * @abstract\n */\nvar XhrFactory = /** @class */ (function () {\n function XhrFactory() {\n }\n return XhrFactory;\n}());\n/**\n * A factory for \\@{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.\n *\n * \\@stable\n */\nvar BrowserXhr = /** @class */ (function () {\n function BrowserXhr() {\n }\n /**\n * @return {?}\n */\n BrowserXhr.prototype.build = /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((new XMLHttpRequest())); };\n BrowserXhr.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n BrowserXhr.ctorParameters = function () { return []; };\n return BrowserXhr;\n}());\n/**\n * An `HttpBackend` which uses the XMLHttpRequest API to send\n * requests to a backend server.\n *\n * \\@stable\n */\nvar HttpXhrBackend = /** @class */ (function () {\n function HttpXhrBackend(xhrFactory) {\n this.xhrFactory = xhrFactory;\n }\n /**\n * Process a request and return a stream of response events.\n */\n /**\n * Process a request and return a stream of response events.\n * @param {?} req\n * @return {?}\n */\n HttpXhrBackend.prototype.handle = /**\n * Process a request and return a stream of response events.\n * @param {?} req\n * @return {?}\n */\n function (req) {\n var _this = this;\n // Quick check to give a better error message when a user attempts to use\n // HttpClient.jsonp() without installing the JsonpClientModule\n if (req.method === 'JSONP') {\n throw new Error(\"Attempted to construct Jsonp request without JsonpClientModule installed.\");\n }\n // Everything happens on Observable subscription.\n return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__[\"Observable\"](function (observer) {\n // Start by setting up the XHR object with request method, URL, and withCredentials flag.\n var /** @type {?} */ xhr = _this.xhrFactory.build();\n xhr.open(req.method, req.urlWithParams);\n if (!!req.withCredentials) {\n xhr.withCredentials = true;\n }\n // Add all the requested headers.\n req.headers.forEach(function (name, values) { return xhr.setRequestHeader(name, values.join(',')); });\n // Add an Accept header if one isn't present already.\n if (!req.headers.has('Accept')) {\n xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');\n }\n // Auto-detect the Content-Type header if one isn't present already.\n if (!req.headers.has('Content-Type')) {\n var /** @type {?} */ detectedType = req.detectContentTypeHeader();\n // Sometimes Content-Type detection fails.\n if (detectedType !== null) {\n xhr.setRequestHeader('Content-Type', detectedType);\n }\n }\n // Set the responseType if one was requested.\n if (req.responseType) {\n var /** @type {?} */ responseType = req.responseType.toLowerCase();\n // JSON responses need to be processed as text. This is because if the server\n // returns an XSSI-prefixed JSON response, the browser will fail to parse it,\n // xhr.response will be null, and xhr.responseText cannot be accessed to\n // retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON\n // is parsed by first requesting text and then applying JSON.parse.\n xhr.responseType = /** @type {?} */ (((responseType !== 'json') ? responseType : 'text'));\n }\n // Serialize the request body if one is present. If not, this will be set to null.\n var /** @type {?} */ reqBody = req.serializeBody();\n // If progress events are enabled, response headers will be delivered\n // in two events - the HttpHeaderResponse event and the full HttpResponse\n // event. However, since response headers don't change in between these\n // two events, it doesn't make sense to parse them twice. So headerResponse\n // caches the data extracted from the response whenever it's first parsed,\n // to ensure parsing isn't duplicated.\n var /** @type {?} */ headerResponse = null;\n // partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest\n // state, and memoizes it into headerResponse.\n var /** @type {?} */ partialFromXhr = function () {\n if (headerResponse !== null) {\n return headerResponse;\n }\n // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).\n var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;\n var /** @type {?} */ statusText = xhr.statusText || 'OK';\n // Parse headers from XMLHttpRequest - this step is lazy.\n var /** @type {?} */ headers = new HttpHeaders(xhr.getAllResponseHeaders());\n // Read the response URL from the XMLHttpResponse instance and fall back on the\n // request URL.\n var /** @type {?} */ url = getResponseUrl(xhr) || req.url;\n // Construct the HttpHeaderResponse and memoize it.\n headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });\n return headerResponse;\n };\n // Next, a few closures are defined for the various events which XMLHttpRequest can\n // emit. This allows them to be unregistered as event listeners later.\n // First up is the load event, which represents a response being fully available.\n var /** @type {?} */ onLoad = function () {\n // Read response state from the memoized partial data.\n var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;\n // The body will be read out if present.\n var /** @type {?} */ body = null;\n if (status !== 204) {\n // Use XMLHttpRequest.response if set, responseText otherwise.\n body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;\n }\n // Normalize another potential bug (this one comes from CORS).\n if (status === 0) {\n status = !!body ? 200 : 0;\n }\n // ok determines whether the response will be transmitted on the event or\n // error channel. Unsuccessful status codes (not 2xx) will always be errors,\n // but a successful status code can still result in an error if the user\n // asked for JSON data and the body cannot be parsed as such.\n var /** @type {?} */ ok = status >= 200 && status < 300;\n // Check whether the body needs to be parsed as JSON (in many cases the browser\n // will have done that already).\n if (req.responseType === 'json' && typeof body === 'string') {\n // Save the original body, before attempting XSSI prefix stripping.\n var /** @type {?} */ originalBody = body;\n body = body.replace(XSSI_PREFIX, '');\n try {\n // Attempt the parse. If it fails, a parse error should be delivered to the user.\n body = body !== '' ? JSON.parse(body) : null;\n }\n catch (/** @type {?} */ error) {\n // Since the JSON.parse failed, it's reasonable to assume this might not have been a\n // JSON response. Restore the original body (including any XSSI prefix) to deliver\n // a better error response.\n body = originalBody;\n // If this was an error request to begin with, leave it as a string, it probably\n // just isn't JSON. Otherwise, deliver the parsing error to the user.\n if (ok) {\n // Even though the response status was 2xx, this is still an error.\n ok = false;\n // The parse error contains the text of the body that failed to parse.\n body = /** @type {?} */ ({ error: error, text: body });\n }\n }\n }\n if (ok) {\n // A successful response is delivered on the event stream.\n observer.next(new HttpResponse({\n body: body,\n headers: headers,\n status: status,\n statusText: statusText,\n url: url || undefined,\n }));\n // The full body has been received and delivered, no further events\n // are possible. This request is complete.\n observer.complete();\n }\n else {\n // An unsuccessful request is delivered on the error channel.\n observer.error(new HttpErrorResponse({\n // The error in this case is the response body (error from the server).\n error: body,\n headers: headers,\n status: status,\n statusText: statusText,\n url: url || undefined,\n }));\n }\n };\n // The onError callback is called when something goes wrong at the network level.\n // Connection timeout, DNS error, offline, etc. These are actual errors, and are\n // transmitted on the error channel.\n var /** @type {?} */ onError = function (error) {\n var /** @type {?} */ res = new HttpErrorResponse({\n error: error,\n status: xhr.status || 0,\n statusText: xhr.statusText || 'Unknown Error',\n });\n observer.error(res);\n };\n // The sentHeaders flag tracks whether the HttpResponseHeaders event\n // has been sent on the stream. This is necessary to track if progress\n // is enabled since the event will be sent on only the first download\n // progerss event.\n var /** @type {?} */ sentHeaders = false;\n // The download progress event handler, which is only registered if\n // progress events are enabled.\n var /** @type {?} */ onDownProgress = function (event) {\n // Send the HttpResponseHeaders event if it hasn't been sent already.\n if (!sentHeaders) {\n observer.next(partialFromXhr());\n sentHeaders = true;\n }\n // Start building the download progress event to deliver on the response\n // event stream.\n var /** @type {?} */ progressEvent = {\n type: HttpEventType.DownloadProgress,\n loaded: event.loaded,\n };\n // Set the total number of bytes in the event if it's available.\n if (event.lengthComputable) {\n progressEvent.total = event.total;\n }\n // If the request was for text content and a partial response is\n // available on XMLHttpRequest, include it in the progress event\n // to allow for streaming reads.\n if (req.responseType === 'text' && !!xhr.responseText) {\n progressEvent.partialText = xhr.responseText;\n }\n // Finally, fire the event.\n observer.next(progressEvent);\n };\n // The upload progress event handler, which is only registered if\n // progress events are enabled.\n var /** @type {?} */ onUpProgress = function (event) {\n // Upload progress events are simpler. Begin building the progress\n // event.\n var /** @type {?} */ progress = {\n type: HttpEventType.UploadProgress,\n loaded: event.loaded,\n };\n // If the total number of bytes being uploaded is available, include\n // it.\n if (event.lengthComputable) {\n progress.total = event.total;\n }\n // Send the event.\n observer.next(progress);\n };\n // By default, register for load and error events.\n xhr.addEventListener('load', onLoad);\n xhr.addEventListener('error', onError);\n // Progress events are only enabled if requested.\n if (req.reportProgress) {\n // Download progress is always enabled if requested.\n xhr.addEventListener('progress', onDownProgress);\n // Upload progress depends on whether there is a body to upload.\n if (reqBody !== null && xhr.upload) {\n xhr.upload.addEventListener('progress', onUpProgress);\n }\n }\n // Fire the request, and notify the event stream that it was fired.\n xhr.send(reqBody);\n observer.next({ type: HttpEventType.Sent });\n // This is the return from the Observable function, which is the\n // request cancellation handler.\n return function () {\n // On a cancellation, remove all registered event listeners.\n xhr.removeEventListener('error', onError);\n xhr.removeEventListener('load', onLoad);\n if (req.reportProgress) {\n xhr.removeEventListener('progress', onDownProgress);\n if (reqBody !== null && xhr.upload) {\n xhr.upload.removeEventListener('progress', onUpProgress);\n }\n }\n // Finally, abort the in-flight request.\n xhr.abort();\n };\n });\n };\n HttpXhrBackend.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXhrBackend.ctorParameters = function () { return [\n { type: XhrFactory, },\n ]; };\n return HttpXhrBackend;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XSRF_COOKIE_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('XSRF_COOKIE_NAME');\nvar XSRF_HEADER_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('XSRF_HEADER_NAME');\n/**\n * Retrieves the current XSRF token to use with the next outgoing request.\n *\n * \\@stable\n * @abstract\n */\nvar HttpXsrfTokenExtractor = /** @class */ (function () {\n function HttpXsrfTokenExtractor() {\n }\n return HttpXsrfTokenExtractor;\n}());\n/**\n * `HttpXsrfTokenExtractor` which retrieves the token from a cookie.\n */\nvar HttpXsrfCookieExtractor = /** @class */ (function () {\n function HttpXsrfCookieExtractor(doc, platform, cookieName) {\n this.doc = doc;\n this.platform = platform;\n this.cookieName = cookieName;\n this.lastCookieString = '';\n this.lastToken = null;\n /**\n * \\@internal for testing\n */\n this.parseCount = 0;\n }\n /**\n * @return {?}\n */\n HttpXsrfCookieExtractor.prototype.getToken = /**\n * @return {?}\n */\n function () {\n if (this.platform === 'server') {\n return null;\n }\n var /** @type {?} */ cookieString = this.doc.cookie || '';\n if (cookieString !== this.lastCookieString) {\n this.parseCount++;\n this.lastToken = Object(__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"ɵparseCookieValue\"])(cookieString, this.cookieName);\n this.lastCookieString = cookieString;\n }\n return this.lastToken;\n };\n HttpXsrfCookieExtractor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXsrfCookieExtractor.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"DOCUMENT\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"PLATFORM_ID\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [XSRF_COOKIE_NAME,] },] },\n ]; };\n return HttpXsrfCookieExtractor;\n}());\n/**\n * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.\n */\nvar HttpXsrfInterceptor = /** @class */ (function () {\n function HttpXsrfInterceptor(tokenService, headerName) {\n this.tokenService = tokenService;\n this.headerName = headerName;\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n HttpXsrfInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n var /** @type {?} */ lcUrl = req.url.toLowerCase();\n // Skip both non-mutating requests and absolute URLs.\n // Non-mutating requests don't require a token, and absolute URLs require special handling\n // anyway as the cookie set\n // on our origin is not the same as the token expected by another origin.\n if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||\n lcUrl.startsWith('https://')) {\n return next.handle(req);\n }\n var /** @type {?} */ token = this.tokenService.getToken();\n // Be careful not to overwrite an existing header of the same name.\n if (token !== null && !req.headers.has(this.headerName)) {\n req = req.clone({ headers: req.headers.set(this.headerName, token) });\n }\n return next.handle(req);\n };\n HttpXsrfInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXsrfInterceptor.ctorParameters = function () { return [\n { type: HttpXsrfTokenExtractor, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [XSRF_HEADER_NAME,] },] },\n ]; };\n return HttpXsrfInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Constructs an `HttpHandler` that applies a bunch of `HttpInterceptor`s\n * to a request before passing it to the given `HttpBackend`.\n *\n * Meant to be used as a factory function within `HttpClientModule`.\n *\n * \\@stable\n * @param {?} backend\n * @param {?=} interceptors\n * @return {?}\n */\nfunction interceptingHandler(backend, interceptors) {\n if (interceptors === void 0) { interceptors = []; }\n if (!interceptors) {\n return backend;\n }\n return interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, backend);\n}\n/**\n * Factory function that determines where to store JSONP callbacks.\n *\n * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist\n * in test environments. In that case, callbacks are stored on an anonymous object instead.\n *\n * \\@stable\n * @return {?}\n */\nfunction jsonpCallbackContext() {\n if (typeof window === 'object') {\n return window;\n }\n return {};\n}\n/**\n * `NgModule` which adds XSRF protection support to outgoing requests.\n *\n * Provided the server supports a cookie-based XSRF protection system, this\n * module can be used directly to configure XSRF protection with the correct\n * cookie and header names.\n *\n * If no such names are provided, the default is to use `X-XSRF-TOKEN` for\n * the header name and `XSRF-TOKEN` for the cookie name.\n *\n * \\@stable\n */\nvar HttpClientXsrfModule = /** @class */ (function () {\n function HttpClientXsrfModule() {\n }\n /**\n * Disable the default XSRF protection.\n */\n /**\n * Disable the default XSRF protection.\n * @return {?}\n */\n HttpClientXsrfModule.disable = /**\n * Disable the default XSRF protection.\n * @return {?}\n */\n function () {\n return {\n ngModule: HttpClientXsrfModule,\n providers: [\n { provide: HttpXsrfInterceptor, useClass: NoopInterceptor },\n ],\n };\n };\n /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n */\n /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n * @param {?=} options\n * @return {?}\n */\n HttpClientXsrfModule.withOptions = /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n * @param {?=} options\n * @return {?}\n */\n function (options) {\n if (options === void 0) { options = {}; }\n return {\n ngModule: HttpClientXsrfModule,\n providers: [\n options.cookieName ? { provide: XSRF_COOKIE_NAME, useValue: options.cookieName } : [],\n options.headerName ? { provide: XSRF_HEADER_NAME, useValue: options.headerName } : [],\n ],\n };\n };\n HttpClientXsrfModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n providers: [\n HttpXsrfInterceptor,\n { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },\n { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },\n { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },\n { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientXsrfModule.ctorParameters = function () { return []; };\n return HttpClientXsrfModule;\n}());\n/**\n * `NgModule` which provides the `HttpClient` and associated services.\n *\n * Interceptors can be added to the chain behind `HttpClient` by binding them\n * to the multiprovider for `HTTP_INTERCEPTORS`.\n *\n * \\@stable\n */\nvar HttpClientModule = /** @class */ (function () {\n function HttpClientModule() {\n }\n HttpClientModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n imports: [\n HttpClientXsrfModule.withOptions({\n cookieName: 'XSRF-TOKEN',\n headerName: 'X-XSRF-TOKEN',\n }),\n ],\n providers: [\n HttpClient,\n // HttpHandler is the backend + interceptors and is constructed\n // using the interceptingHandler factory function.\n {\n provide: HttpHandler,\n useFactory: interceptingHandler,\n deps: [HttpBackend, [new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"](HTTP_INTERCEPTORS)]],\n },\n HttpXhrBackend,\n { provide: HttpBackend, useExisting: HttpXhrBackend },\n BrowserXhr,\n { provide: XhrFactory, useExisting: BrowserXhr },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientModule.ctorParameters = function () { return []; };\n return HttpClientModule;\n}());\n/**\n * `NgModule` which enables JSONP support in `HttpClient`.\n *\n * Without this module, Jsonp requests will reach the backend\n * with method JSONP, where they'll be rejected.\n *\n * \\@stable\n */\nvar HttpClientJsonpModule = /** @class */ (function () {\n function HttpClientJsonpModule() {\n }\n HttpClientJsonpModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n providers: [\n JsonpClientBackend,\n { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },\n { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientJsonpModule.ctorParameters = function () { return []; };\n return HttpClientJsonpModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=http.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvY29tbW9uL2VzbTUvaHR0cC5qcz8yMmQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBJbmplY3QsIEluamVjdGFibGUsIEluamVjdGlvblRva2VuLCBOZ01vZHVsZSwgT3B0aW9uYWwsIFBMQVRGT1JNX0lEIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBvZiB9IGZyb20gJ3J4anMvb2JzZXJ2YWJsZS9vZic7XG5pbXBvcnQgeyBjb25jYXRNYXAgfSBmcm9tICdyeGpzL29wZXJhdG9yL2NvbmNhdE1hcCc7XG5pbXBvcnQgeyBmaWx0ZXIgfSBmcm9tICdyeGpzL29wZXJhdG9yL2ZpbHRlcic7XG5pbXBvcnQgeyBtYXAgfSBmcm9tICdyeGpzL29wZXJhdG9yL21hcCc7XG5pbXBvcnQgeyBfX2V4dGVuZHMgfSBmcm9tICd0c2xpYic7XG5pbXBvcnQgeyBET0NVTUVOVCwgybVwYXJzZUNvb2tpZVZhbHVlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzL09ic2VydmFibGUnO1xuXG4vKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogQHN1cHByZXNzIHtjaGVja1R5cGVzfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbi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icpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBuYW1lXzEgPSBsaW5lLnNsaWNlKDAsIGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleSA9IG5hbWVfMS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWUgPSBsaW5lLnNsaWNlKGluZGV4ICsgMSkudHJpbSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZShuYW1lXzEsIGtleSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX3RoaXMuaGVhZGVycy5oYXMoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5oZWFkZXJzLmdldChrZXkpKSkucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5oZWFkZXJzLnNldChrZXksIFt2YWx1ZV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5sYXp5SW5pdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5oZWFkZXJzID0gbmV3IE1hcCgpO1xuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKGhlYWRlcnMpLmZvckVhY2goZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWVzID0gaGVhZGVyc1tuYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8ga2V5ID0gbmFtZS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcyA9IFt2YWx1ZXNdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuaGVhZGVycy5zZXQoa2V5LCB2YWx1ZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZShuYW1lLCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfVxuICAgIC8qKlxuICAgICAqIENoZWNrcyBmb3IgZXhpc3RlbmNlIG9mIGhlYWRlciBieSBnaXZlbiBuYW1lLlxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIENoZWNrcyBmb3IgZXhpc3RlbmNlIG9mIGhlYWRlciBieSBnaXZlbiBuYW1lLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cEhlYWRlcnMucHJvdG90eXBlLmhhcyA9IC8qKlxuICAgICAqIENoZWNrcyBmb3IgZXhpc3RlbmNlIG9mIGhlYWRlciBieSBnaXZlbiBuYW1lLlxuICAgICAqIEBwYXJhbSB7P30gbmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgdGhpcy5pbml0KC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bWVcbiAgICAgKiBAcGFyYW0gez99IGxjTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIGxjTmFtZSkge1xuICAgICAgICBpZiAoIXRoaXMubm9ybWFsaXplZE5hbWVzLmhhcyhsY05hbWUpKSB7XG4gICAgICAgICAgICB0aGlzLm5vcm1hbGl6ZWROYW1lcy5zZXQobGNOYW1lLCBuYW1lKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBIdHRwSGVhZGVycy5wcm90b3R5cGUuaW5pdCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAoISF0aGlzLmxhenlJbml0KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXp5SW5pdCBpbnN0YW5jZW9mIEh0dHBIZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb3B5RnJvbSh0aGlzLmxhenlJbml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMubGF6eUluaXQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubGF6eUluaXQgPSBudWxsO1xuICAgICAgICAgICAgaWYgKCEhdGhpcy5sYXp5VXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sYXp5VXBkYXRlLmZvckVhY2goZnVuY3Rpb24gKHVwZGF0ZSkgeyByZXR1cm4gX3RoaXMuYXBwbHlVcGRhdGUodXBkYXRlKTsgfSk7XG4gICAgICAgICAgICAgICAgdGhpcy5sYXp5VXBkYXRlID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBvdGhlclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cEhlYWRlcnMucHJvdG90eXBlLmNvcHlGcm9tID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBvdGhlclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG90aGVyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIG90aGVyLmluaXQoKTtcbiAgICAgICAgQXJyYXkuZnJvbShvdGhlci5oZWFkZXJzLmtleXMoKSkuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBfdGhpcy5oZWFkZXJzLnNldChrZXksIC8qKiBAdHlwZSB7P30gKi8gKChvdGhlci5oZWFkZXJzLmdldChrZXkpKSkpO1xuICAgICAgICAgICAgX3RoaXMubm9ybWFsaXplZE5hbWVzLnNldChrZXksIC8qKiBAdHlwZSB7P30gKi8gKChvdGhlci5ub3JtYWxpemVkTmFtZXMuZ2V0KGtleSkpKSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB1cGRhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBIZWFkZXJzLnByb3RvdHlwZS5jbG9uZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdXBkYXRlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodXBkYXRlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNsb25lID0gbmV3IEh0dHBIZWFkZXJzKCk7XG4gICAgICAgIGNsb25lLmxhenlJbml0ID1cbiAgICAgICAgICAgICghIXRoaXMubGF6eUluaXQgJiYgdGhpcy5sYXp5SW5pdCBpbnN0YW5jZW9mIEh0dHBIZWFkZXJzKSA/IHRoaXMubGF6eUluaXQgOiB0aGlzO1xuICAgICAgICBjbG9uZS5sYXp5VXBkYXRlID0gKHRoaXMubGF6eVVwZGF0ZSB8fCBbXSkuY29uY2F0KFt1cGRhdGVdKTtcbiAgICAgICAgcmV0dXJuIGNsb25lO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB1cGRhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBIZWFkZXJzLnByb3RvdHlwZS5hcHBseVVwZGF0ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdXBkYXRlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAodXBkYXRlKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleSA9IHVwZGF0ZS5uYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgIHN3aXRjaCAodXBkYXRlLm9wKSB7XG4gICAgICAgICAgICBjYXNlICdhJzpcbiAgICAgICAgICAgIGNhc2UgJ3MnOlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHZhbHVlID0gLyoqIEB0eXBlIHs/fSAqLyAoKHVwZGF0ZS52YWx1ZSkpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gW3ZhbHVlXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZSh1cGRhdGUubmFtZSwga2V5KTtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBiYXNlID0gKHVwZGF0ZS5vcCA9PT0gJ2EnID8gdGhpcy5oZWFkZXJzLmdldChrZXkpIDogdW5kZWZpbmVkKSB8fCBbXTtcbiAgICAgICAgICAgICAgICBiYXNlLnB1c2guYXBwbHkoYmFzZSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoa2V5LCBiYXNlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHRvRGVsZXRlXzEgPSAvKiogQHR5cGUgez99ICovICh1cGRhdGUudmFsdWUpO1xuICAgICAgICAgICAgICAgIGlmICghdG9EZWxldGVfMSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuZGVsZXRlKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubm9ybWFsaXplZE5hbWVzLmRlbGV0ZShrZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZXhpc3RpbmcgPSB0aGlzLmhlYWRlcnMuZ2V0KGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBleGlzdGluZyA9IGV4aXN0aW5nLmZpbHRlcihmdW5jdGlvbiAodmFsdWUpIHsgcmV0dXJuIHRvRGVsZXRlXzEuaW5kZXhPZih2YWx1ZSkgPT09IC0xOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGV4aXN0aW5nLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLmRlbGV0ZShrZXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3JtYWxpemVkTmFtZXMuZGVsZXRlKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuc2V0KGtleSwgZXhpc3RpbmcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gZm5cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBIZWFkZXJzLnByb3RvdHlwZS5mb3JFYWNoID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdGhpcy5pbml0KCk7XG4gICAgICAgIEFycmF5LmZyb20odGhpcy5ub3JtYWxpemVkTmFtZXMua2V5cygpKVxuICAgICAgICAgICAgLmZvckVhY2goZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gZm4oLyoqIEB0eXBlIHs/fSAqLyAoKF90aGlzLm5vcm1hbGl6ZWROYW1lcy5nZXQoa2V5KSkpLCAvKiogQHR5cGUgez99ICovICgoX3RoaXMuaGVhZGVycy5nZXQoa2V5KSkpKTsgfSk7XG4gICAgfTtcbiAgICByZXR1cm4gSHR0cEhlYWRlcnM7XG59KCkpO1xuXG4vKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogQHN1cHByZXNzIHtjaGVja1R5cGVzfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ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AcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBQYXJhbXMucHJvdG90eXBlLnRvU3RyaW5nID0gLyoqXG4gICAgICogU2VyaWFsaXplIHRoZSBib2R5IHRvIGFuIGVuY29kZWQgc3RyaW5nLCB3aGVyZSBrZXktdmFsdWUgcGFpcnMgKHNlcGFyYXRlZCBieSBgPWApIGFyZVxuICAgICAqIHNlcGFyYXRlZCBieSBgJmBzLlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLmluaXQoKTtcbiAgICAgICAgcmV0dXJuIHRoaXMua2V5cygpXG4gICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGVLZXkgPSBfdGhpcy5lbmNvZGVyLmVuY29kZUtleShrZXkpO1xuICAgICAgICAgICAgcmV0dXJuIC8qKiBAdHlwZSB7P30gKi8gKCgvKiogQHR5cGUgez99ICovICgoX3RoaXMubWFwKSkuZ2V0KGtleSkpKS5tYXAoZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBlS2V5ICsgJz0nICsgX3RoaXMuZW5jb2Rlci5lbmNvZGVWYWx1ZSh2YWx1ZSk7IH0pLmpvaW4oJyYnKTtcbiAgICAgICAgfSlcbiAgICAgICAgICAgIC5qb2luKCcmJyk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHVwZGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cFBhcmFtcy5wcm90b3R5cGUuY2xvbmUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHVwZGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVwZGF0ZSkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBjbG9uZSA9IG5ldyBIdHRwUGFyYW1zKC8qKiBAdHlwZSB7P30gKi8gKHsgZW5jb2RlcjogdGhpcy5lbmNvZGVyIH0pKTtcbiAgICAgICAgY2xvbmUuY2xvbmVGcm9tID0gdGhpcy5jbG9uZUZyb20gfHwgdGhpcztcbiAgICAgICAgY2xvbmUudXBkYXRlcyA9ICh0aGlzLnVwZGF0ZXMgfHwgW10pLmNvbmNhdChbdXBkYXRlXSk7XG4gICAgICAgIHJldHVybiBjbG9uZTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cFBhcmFtcy5wcm90b3R5cGUuaW5pdCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAodGhpcy5tYXAgPT09IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMubWFwID0gbmV3IE1hcCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmNsb25lRnJvbSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgdGhpcy5jbG9uZUZyb20uaW5pdCgpO1xuICAgICAgICAgICAgdGhpcy5jbG9uZUZyb20ua2V5cygpLmZvckVhY2goZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gKChfdGhpcy5tYXApKS5zZXQoa2V5LCAvKiogQHR5cGUgez99ICovICgoLyoqIEB0eXBlIHs/fSAqLyAoKC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5jbG9uZUZyb20pKS5tYXApKS5nZXQoa2V5KSkpKTsgfSk7IC8qKiBAdHlwZSB7P30gKi9cbiAgICAgICAgICAgICgodGhpcy51cGRhdGVzKSkuZm9yRWFjaChmdW5jdGlvbiAodXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh1cGRhdGUub3ApIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYSc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYmFzZSA9ICh1cGRhdGUub3AgPT09ICdhJyA/IC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5nZXQodXBkYXRlLnBhcmFtKSA6IHVuZGVmaW5lZCkgfHwgW107XG4gICAgICAgICAgICAgICAgICAgICAgICBiYXNlLnB1c2goLyoqIEB0eXBlIHs/fSAqLyAoKHVwZGF0ZS52YWx1ZSkpKTsgLyoqIEB0eXBlIHs/fSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgKChfdGhpcy5tYXApKS5zZXQodXBkYXRlLnBhcmFtLCBiYXNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cGRhdGUudmFsdWUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGJhc2VfMSA9IC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5nZXQodXBkYXRlLnBhcmFtKSB8fCBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpZHggPSBiYXNlXzEuaW5kZXhPZih1cGRhdGUudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZHggIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VfMS5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJhc2VfMS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5zZXQodXBkYXRlLnBhcmFtLCBiYXNlXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqIEB0eXBlIHs/fSAqLyAoKF90aGlzLm1hcCkpLmRlbGV0ZSh1cGRhdGUucGFyYW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5kZWxldGUodXBkYXRlLnBhcmFtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMuY2xvbmVGcm9tID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgcmV0dXJuIEh0dHBQYXJhbXM7XG59KCkpO1xuXG4vKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogQHN1cHByZXNzIHtjaGVja1R5cGVzfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICov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AgICAgICAgICBvcHRpb25zID0gZm91cnRoO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gTm8gYm9keSByZXF1aXJlZCwgb3B0aW9ucyBhcmUgdGhlIHRoaXJkIGFyZ3VtZW50LiBUaGUgYm9keSBzdGF5cyBudWxsLlxuICAgICAgICAgICAgb3B0aW9ucyA9IC8qKiBAdHlwZSB7P30gKi8gKHRoaXJkKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBJZiBvcHRpb25zIGhhdmUgYmVlbiBwYXNzZWQsIGludGVycHJldCB0aGVtLlxuICAgICAgICBpZiAob3B0aW9ucykge1xuICAgICAgICAgICAgLy8gTm9ybWFsaXplIHJlcG9ydFByb2dyZXNzIGFuZCB3aXRoQ3JlZGVudGlhbHMuXG4gICAgICAgICAgICB0aGlzLnJlcG9ydFByb2dyZXNzID0gISFvcHRpb25zLnJlcG9ydFByb2dyZXNzO1xuICAgICAgICAgICAgdGhpcy53aXRoQ3JlZGVudGlhbHMgPSAhIW9wdGlvbnMud2l0aENyZWRlbnRpYWxzO1xuICAgICAgICAgICAgLy8gT3ZlcnJpZGUgZGVmYXVsdCByZXNwb25zZSB0eXBlIG9mICdqc29uJyBpZiBvbmUgaXMgcHJvdmlkZWQuXG4gICAgICAgICAgICBpZiAoISFvcHRpb25zLnJlc3BvbnNlVHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVzcG9uc2VUeXBlID0gb3B0aW9ucy5yZXNwb25zZVR5cGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBPdmVycmlkZSBoZWFkZXJzIGlmIHRoZXkncmUgcHJvdmlkZWQuXG4gICAgICAgICAgICBpZiAoISFvcHRpb25zLmhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBvcHRpb25zLmhlYWRlcnM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoISFvcHRpb25zLnBhcmFtcykge1xu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Hs/fSAqLyBoZWFkZXJzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuaGVhZGVycyBpbnN0YW5jZW9mIEh0dHBIZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IG9wdGlvbnMuaGVhZGVycztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBuZXcgSHR0cEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFNvcnQgb3V0IHBhcmFtZXRlcnMuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXJhbXMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoISFvcHRpb25zLnBhcmFtcykge1xuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnBhcmFtcyBpbnN0YW5jZW9mIEh0dHBQYXJhbXMpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zID0gb3B0aW9ucy5wYXJhbXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMgPSBuZXcgSHR0cFBhcmFtcygvKiogQHR5cGUgez99ICovICh7IGZyb21PYmplY3Q6IG9wdGlvbnMucGFyYW1zIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBDb25zdHJ1Y3QgdGhlIHJlcXVlc3QuXG4gICAgICAgICAgICByZXEgPSBuZXcgSHR0cFJlcXVlc3QoZmlyc3QsIC8qKiBAdHlwZSB7P30gKi8gKCh1cmwpKSwgKG9wdGlvbnMuYm9keSAhPT0gdW5kZWZpbmVkID8gb3B0aW9ucy5ib2R5IDogbnVsbCksIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxuICAg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YXAgdGhlIHJlc3BvbnNlIHN0cmVhbSB0byB0aGUgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICAvLyBib2R5LiBUaGlzIGNvdWxkIGJlIGRvbmUgbW9yZSBzaW1wbHksIGJ1dCBhIG1pc2JlaGF2aW5nIGludGVyY2VwdG9yIG1pZ2h0XG4gICAgICAgICAgICAgICAgLy8gdHJhbnNmb3JtIHRoZSByZXNwb25zZSBib2R5IGludG8gYSBkaWZmZXJlbnQgZm9ybWF0IGFuZCBpZ25vcmUgdGhlIHJlcXVlc3RlZFxuICAgICAgICAgICAgICAgIC8vIHJlc3BvbnNlVHlwZS4gR3VhcmQgYWdhaW5zdCB0aGlzIGJ5IHZhbGlkYXRpbmcgdGhhdCB0aGUgcmVzcG9uc2UgaXMgb2YgdGhlXG4gICAgICAgICAgICAgICAgLy8gcmVxdWVzdGVkIHR5cGUuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChyZXEucmVzcG9uc2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2FycmF5YnVmZmVyJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuY2FsbChyZXMkLCBmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVmFsaWRhdGUgdGhhdCB0aGUgYm9keSBpcyBhbiBBcnJheUJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLmJvZHkgIT09IG51bGwgJiYgIShyZXMuYm9keSBpbnN0YW5jZW9mIEFycmF5QnVmZmVyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1Jlc3BvbnNlIGlzIG5vdCBhbiBBcnJheUJ1ZmZlci4nKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5ib2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Jsb2InOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlcyQsIGZ1bmN0aW9uIChyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBWYWxpZGF0ZSB0aGF0IHRoZSBib2R5IGlzIGEgQmxvYi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLmJvZHkgIT09IG51bGwgJiYgIShyZXMuYm9keSBpbnN0YW5jZW9mIEJsb2IpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUmVzcG9uc2UgaXMgbm90IGEgQmxvYi4nKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5ib2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RleHQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlcyQsIGZ1bmN0aW9uIChyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBWYWxpZGF0ZSB0aGF0IHRoZSBib2R5IGlzIGEgc3RyaW5nLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMuYm9keSAhPT0gbnVsbCAmJiB0eXBlb2YgcmVzLmJvZHkgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUmVzcG9uc2UgaXMgbm90IGEgc3RyaW5nLicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzLmJvZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTt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ICAgICAgICAgICAgLy8gaGF2aW5nIGJlZW4gaW52b2tlZC5cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9uTG9hZCA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIC8vIERvIG5vdGhpbmcgaWYgdGhlIHJlcXVlc3QgaGFzIGJlZW4gY2FuY2VsbGVkLlxuICAgICAgICAgICAgICAgIGlmIChjYW5jZWxsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDbGVhbnVwIHRoZSBwYWdlLlxuICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAvLyBDaGVjayB3aGV0aGVyIHRoZSByZXNwb25zZSBjYWxsYmFjayBoYXMgcnVuLlxuICAgICAgICAgICAgICAgIGlmICghZmluaXNoZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSXQgaGFzbid0LCBzb21ldGhpbmcgd2VudCB3cm9uZyB3aXRoIHRoZSByZXF1ZXN0LiBSZXR1cm4gYW4gZXJyb3IgdmlhXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBPYnNlcnZhYmxlIGVycm9yIHBhdGguIEFsbCBKU09OUCBlcnJvcnMgaGF2ZSBzdGF0dXMgMC5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IobmV3IEh0dHBFcnJvclJlc3BvbnNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogJ0pTT05QIEVycm9yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiBuZXcgRXJyb3IoSlNPTlBfRVJSX05PX0NBTExCQUNLKSxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFN1Y2Nlc3MuIGJvZHkgZWl0aGVyIGNvbnRhaW5zIHRoZSByZXNwb25zZSBib2R5IG9yIG51bGwgaWYgbm9uZSB3YXNcbiAgICAgICAgICAgICAgICAvLyByZXR1cm5lZC5cbiAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KG5ldyBIdHRwUmVzcG9uc2Uoe1xuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IDIwMCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogJ09LJywgdXJsOiB1cmwsXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIC8vIENvbXBsZXRlIHRoZSBzdHJlYW0sIHRoZSByZXNwb3NuZSBpcyBvdmVyLlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gb25FcnJvcigpIGlzIHRoZSBlcnJvciBjYWxsYmFjaywgd2hpY2ggcnVucyBpZiB0aGUgc2NyaXB0IHJldHVybmVkIGdlbmVyYXRlc1xuICAgICAgICAgICAgLy8gYSBKYXZhc2NyaXB0IGVycm9yLiBJdCBlbWl0cyB0aGUgZXJyb3IgdmlhIHRoZSBPYnNlcnZhYmxlIGVycm9yIGNoYW5uZWwgYXNcbiAgICAgICAgICAgIC8vIGEgSHR0cEVycm9yUmVzcG9uc2UuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvbkVycm9yID0gZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJlcXVlc3Qgd2FzIGFscmVhZHkgY2FuY2VsbGVkLCBubyBuZWVkIHRvIGVtaXQgYW55dGhpbmcuXG4gICAgICAgICAgICAgICAgaWYgKGNhbmNlbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAvLyBXcmFwIHRoZSBlcnJvciBpbiBhIEh0dHBFcnJvclJlc3BvbnNlLlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmVycm9yKG5ldyBIdHRwRXJyb3JSZXNwb25zZSh7XG4gICAgICAgICAgICAgICAgICAgIGVycm9yOiBlcnJvcixcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiAwLFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNUZXh0OiAnSlNPTlAgRXJyb3InLCB1cmw6IHVybCxcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gU3Vic2NyaWJlIHRvIGJvdGggdGhlIHN1Y2Nlc3MgKGxvYWQpIGFuZCBlcnJvciBldmVudHMgb24gdGhlIDxzY3JpcHQ+IHRhZyxcbiAgICAgICAgICAgIC8vIGFuZCBhZGQgaXQgdG8gdGhlIHBhZ2UuXG4gICAgICAgICAgICBub2RlLmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBvbkxvYWQpO1xuICAgICAgICAgICAgbm9kZS5hZGRFdmVudExpc3RlbmVyKCdlcnJvcicsIG9uRXJyb3IpO1xuICAgICAgICAgICAgX3RoaXMuZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChub2RlKTtcbiAgICAgICAgICAgIC8vIFRoZSByZXF1ZXN0IGhhcyBub3cgYmVlbiBzdWNjZXNzZnVsbHkgc2VudC5cbiAgICAgICAgICAgIG9ic2VydmVyLm5leHQoeyB0eXBlOiBIdHRwRXZlbnRUeXBlLlNlbnQgfSk7XG4gICAgICAgICAgICAvLyBDYW5jZWxsYXRpb24gaGFuZGxlci5cbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgIC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IEFkZCBhbiBBY2NlcHQgaGVhZGVyIGlmIG9uZSBpc24ndCBwcmVzZW50IGFscmVhZHkuXG4gICAgICAgICAgICBpZiAoIXJlcS5oZWFkZXJzLmhhcygnQWNjZXB0JykpIHtcbiAgICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcignQWNjZXB0JywgJ2FwcGxpY2F0aW9uL2pzb24sIHRleHQvcGxhaW4sICovKicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQXV0by1kZXRlY3QgdGhlIENvbnRlbnQtVHlwZSBoZWFkZXIgaWYgb25lIGlzbid0IHByZXNlbnQgYWxyZWFkeS5cbiAgICAgICAgICAgIGlmICghcmVxLmhlYWRlcnMuaGFzKCdDb250ZW50LVR5cGUnKSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRldGVjdGVkVHlwZSA9IHJlcS5kZXRlY3RDb250ZW50VHlwZUhlYWRlcigpO1xuICAgICAgICAgICAgICAgIC8vIFNvbWV0aW1lcyBDb250ZW50LVR5cGUgZGV0ZWN0aW9uIGZhaWxzLlxuICAgICAgICAgICAgICAgIGlmIChkZXRlY3RlZFR5cGUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgeGhyLnNldFJlcXVlc3RIZWFkZXIoJ0NvbnRlbnQtVHlwZScsIGRldGVjdGVkVHlwZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gU2V0IHRoZSByZXNwb25zZVR5cGUgaWYgb25lIHdhcyByZXF1ZXN0ZWQuXG4gICAgICAgICAgICBpZiAocmVxLnJlc3BvbnNlVHlwZSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHJlc3BvbnNlVHlwZSA9IHJlcS5yZXNwb25zZVR5cGUudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICAvLyBKU09OIHJlc3BvbnNlcyBuZWVkIHRvI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GVvZiBib2R5ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBTYXZlIHRoZSBvcmlnaW5hbCBib2R5LCBiZWZvcmUgYXR0ZW1wdGluZyBYU1NJIHByZWZpeCBzdHJpcHBpbmcuXG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9yaWdpbmFsQm9keSA9IGJvZHk7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBib2R5LnJlcGxhY2UoWFNTSV9QUkVGSVgsICcnKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF0dGVtcHQgdGhlIHBhcnNlLiBJZiBpdCBmYWlscywgYSBwYXJzZSBlcnJvciBzaG91bGQgYmUgZGVsaXZlcmVkIHRvIHRoZSB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IGJvZHkgIT09ICcnID8gSlNPTi5wYXJzZShib2R5KSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKC8qKiBAdHlwZSB7P30gKi8gZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbmNlIHRoZSBKU09OLnBhcnNlIGZhaWxlZCwgaXQncyByZWFzb25hYmxlIHRvIGFzc3VtZSB0aGlzIG1pZ2h0IG5vdCBoYXZlIGJlZW4gYVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSlNPTiByZXNwb25zZS4gUmVzdG9yZSB0aGUgb3JpZ2luYWwgYm9keSAoaW5jbHVkaW5nIGFueSBYU1NJIHByZWZpeCkgdG8gZGVsaXZlclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYSBiZXR0ZXIgZXJyb3IgcmVzcG9uc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gb3JpZ2luYWxCb2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyB3YXMgYW4gZXJyb3IgcmVxdWVzdCB0byBiZWdpbiB3aXRoLCBsZWF2ZSBpdCBhcyBhIHN0cmluZywgaXQgcHJvYmFibHlcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgaXNuJ3QgSlNPTi4gT3RoZXJ3aXNlLCBkZWxpdmVyIHRoZSBwYXJzaW5nIGVycm9yIHRvIHRoZSB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRXZlbiB0aG91Z2ggdGhlIHJlc3BvbnNlIHN0YXR1cyB3YXMgMnh4LCB0aGlzIGlzIHN0aWxsIGFuIGVycm9yLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHBhcnNlIGVycm9yIGNvbnRhaW5zIHRoZSB0ZXh0IG9mIHRoZSBib2R5IHRoYXQgZmFpbGVkIHRvIHBhcnNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAvKiogQHR5cGUgez99ICovICh7IGVycm9yOiBlcnJvciwgdGV4dDogYm9keSB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAob2spIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQSBzdWNjZXNzZnVsIHJlc3BvbnNlIGlzIGRlbGl2ZXJlZCBvbiB0aGUgZXZlbnQgc3RyZWFtLlxuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KG5ldyBIdHRwUmVzcG9uc2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHN0YXR1c1RleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGZ1bGwgYm9keSBoYXMgYmVlbiByZWNlaXZlZCBhbmQgZGVsaXZlcmVkLCBubyBmdXJ0aGVyIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICAvLyBhcmUgcG9zc2libGUuIFRoaXMgcmVxdWVzdCBpcyBjb21wbGV0ZS5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEFuIHVuc3VjY2Vzc2Z1bCByZXF1ZXN0IGlzIGRlbGl2ZXJlZCBvbiB0aGUgZXJyb3IgY2hhbm5lbC5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IobmV3IEh0dHBFcnJvclJlc3BvbnNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBlcnJvciBpbiB0aGlzIGNhc2UgaXMgdGhlIHJlc3BvbnNlIGJvZHkgKGVycm9yIGZyb20gdGhlIHNlcnZlcikuXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogYm9keSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHN0YXR1c1RleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgI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udC5sb2FkZWQsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIHRvdGFsIG51bWJlciBvZiBieXRlcyBpbiB0aGUgZXZlbnQgaWYgaXQncyBhdmFpbGFibGUuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50Lmxlbmd0aENvbXB1dGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NFdmVudC50b3RhbCA9IGV2ZW50LnRvdGFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcmVxdWVzdCB3YXMgZm9yIHRleHQgY29udGVudCBhbmQgYSBwYXJ0aWFsIHJlc3BvbnNlIGlzXG4gICAgICAgICAgICAgICAgLy8gYXZhaWxhYmxlIG9uIFhNTEh0dHBSZXF1ZXN0LCBpbmNsdWRlIGl0IGluIHRoZSBwcm9ncmVzcyBldmVudFxuICAgICAgICAgICAgICAgIC8vIHRvIGFsbG93IGZvciBzdHJlYW1pbmcgcmVhZHMuXG4gICAgICAgICAgICAgICAgaWYgKHJlcS5yZXNwb25zZVR5cGUgPT09ICd0ZXh0JyAmJiAhIXhoci5yZXNwb25zZVRleHQpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NFdmVudC5wYXJ0aWFsVGV4dCA9IHhoci5yZXNwb25zZVRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIEZpbmFsbHksIGZpcmUgdGhlIGV2ZW50LlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLm5leHQocHJvZ3Jlc3NFdmVudCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gVGhlIHVwbG9hZCBwcm9ncmVzcyBldmVudCBoYW5kbGVyLCB3aGljaCBpcyBvbmx5IHJlZ2lzdGVyZWQgaWZcbiAgICAgICAgICAgIC8vIHByb2dyZXNzIGV2ZW50cyBhcmUgZW5hYmxlZC5cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9uVXBQcm9ncmVzcyA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIC8vIFVwbG9hZCBwcm9ncmVzcyBldmVudHMgYXJlIHNpbXBsZXIuIEJlZ2luIGJ1aWxkaW5nIHRoZSBwcm9ncmVzc1xuICAgICAgICAgICAgICAgIC8vIGV2ZW50LlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByb2dyZXNzID0ge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiBIdHRwRXZlbnRUeXBlLlVwbG9hZFByb2dyZXNzLFxuICAgICAgICAgICAgICAgICAgICBsb2FkZWQ6IGV2ZW50LmxvYWRlZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIElmIHRoZSB0b3RhbCBudW1iZXIgb2YgYnl0ZXMgYmVpbmcgdXBsb2FkZWQgaXMgYXZhaWxhYmxlLCBpbmNsdWRlXG4gICAgICAgICAgICAgICAgLy8gaXQuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50Lmxlbmd0aENvbXB1dGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3MudG90YWwgPSBldmVudC50b3RhbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gU2VuZCB0aGUgZXZlbnQuXG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dChwcm9ncmVzcyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gQnkgZGVmYXVsdCwgcmVnaXN0ZXIgZm9yIGxvYWQgYW5kIGVycm9yIGV2ZW50cy5cbiAgICAgICAgICAgIHhoci5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgb25Mb2FkKTtcbiAgICAgICAgICAgIHhoci5hZGRFdmVudExpc3RlbmVyKCdlcnJvcicsIG9uRXJyb3IpO1xuICAgICAgICAgICAgLy8gUHJvZ3J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uICAgIGZ1bmN0aW9uIEh0dHBYc3JmQ29va2llRXh0cmFjdG9yKGRvYywgcGxhdGZvcm0sIGNvb2tpZU5hbWUpIHtcbiAgICAgICAgdGhpcy5kb2MgPSBkb2M7XG4gICAgICAgIHRoaXMucGxhdGZvcm0gPSBwbGF0Zm9ybTtcbiAgICAgICAgdGhpcy5jb29raWVOYW1lID0gY29va2llTmFtZTtcbiAgICAgICAgdGhpcy5sYXN0Q29va2llU3RyaW5nID0gJyc7XG4gICAgICAgIHRoaXMubGFzdFRva2VuID0gbnVsbDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFxcQGludGVybmFsIGZvciB0ZXN0aW5nXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnBhcnNlQ291bnQgPSAwO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBYc3JmQ29va2llRXh0cmFjdG9yLnByb3RvdHlwZS5nZXRUb2tlbiA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5wbGF0Zm9ybSA9PT0gJ3NlcnZlcicpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGNvb2tpZVN0cmluZyA9IHRoaXMuZG9jLmNvb2tpZSB8fCAnJztcbiAgICAgICAgaWYgKGNvb2tpZVN0cmluZyAhPT0gdGhpcy5sYXN0Q29va2llU3RyaW5nKSB7XG4gICAgICAgICAgICB0aGlzLnBhcnNlQ291bnQrKztcbiAgICAgICAgICAgIHRoaXMubGFzdFRva2VuID0gybVwYXJzZUNvb2tpZVZhbHVlKGNvb2tpZVN0cmluZywgdGhpcy5jb29raWVOYW1lKTtcbiAgICAgICAgICAgIHRoaXMubGFzdENvb2tpZVN0cmluZyA9IGNvb2tpZVN0cmluZztcbiAgICAgICAgfVxu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52YXIgSHR0cENsaWVudFhzcmZNb2R1bGUgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gSHR0cENsaWVudFhzcmZNb2R1bGUoKSB7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIERpc2FibGUgdGhlIGRlZmF1bHQgWFNSRiBwcm90ZWN0aW9uLlxuICAgICAqL1xuICAgIC8qKlxuICAgICAqIERpc2FibGUgdGhlIGRlZmF1bHQgWFNSRiBwcm90ZWN0aW9uLlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cENsaWVudFhzcmZNb2R1bGUuZGlzYWJsZSA9IC8qKlxuICAgICAqIERpc2FibGUgdGhlIGRlZmF1bHQgWFNSRiBwcm90ZWN0aW9uLlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbmdNb2R1bGU6IEh0dHBDbGllbnRYc3JmTW9kdWxlLFxuICAgICAgICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIdHRwWHNyZkludGVyY2VwdG9yLCB1c2VDbGFzczogTm9vcEludGVyY2VwdG9yIH0sXG4gICAgICAgICAgICBdLFxuICAgICAgICB9O1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQ29uZmlndXJlIFhTUkYgcHJvdGVjdGlvbiB0byB1c2UgdGhlIGdpdmVuIGNvb2tpZSBuYW1lIG9yIGhlYWRlciBuYW1lLFxuICAgICAqIG9yIHRoZSBkZWZhdWx0IG5hbWVzIChhcyBkZXNjcmliZWQgYWJvdmUpIGlmIG5vdCBwcm92aWRlZC5cbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBDb25maWd1cmUgWFNSRiBwcm90ZWN0aW9uIHRvIHVzZSB0aGUgZ2l2ZW4gY29va2llIG5hbWUgb3IgaGVhZGVyIG5hbWUsXG4gICAgICogb3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FBfSU5URVJDRVBUT1JTYC5cbiAqXG4gKiBcXEBzdGFibGVcbiAqL1xudmFyIEh0dHBDbGllbnRNb2R1bGUgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gSHR0cENsaWVudE1vZHVsZSgpIHtcbiAgICB9XG4gICAgSHR0cENsaWVudE1vZHVsZS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IE5nTW9kdWxlLCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBpbXBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50WHNyZk1vZHVsZS53aXRoT3B0aW9ucyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llTmFtZTogJ1hTUkYtVE9LRU4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlck5hbWU6ICdYLVhTUkYtVE9LRU4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEh0dHBIYW5kbGVyIGlzIHRoZSBiYWNrZW5kICsgaW50ZXJjZXB0b3JzIGFuZCBpcyBjb25zdHJ1Y3RlZFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNpbmcgdGhlIGludGVyY2VwdGluZ0hhbmRsZXIgZmFjdG9yeSBmdW5jdGlvbi5cbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBIdHRwSGFuZGxlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBpbnRlcmNlcHRpbmdIYW5kbGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHM6IFtIdHRwQmFja2VuZCwgW25ldyBPcHRpb25hbCgpLCBuZXcgSW5qZWN0KEhUVFBfSU5URVJDRVBUT1JTKV1dLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBYaHJCYWNrZW5kLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIdHRwQmFja2VuZCwgdXNlRXhpc3Rpbmc6IEh0dHBYaHJCYWNrZW5kIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyWGhyLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBYaHJGYWN0b3J5LCB1c2VFeGlzdGluZzogQnJvd3NlclhociB9LFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgSHR0cENsaWVudE1vZHVsZS5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtdOyB9O1xuICAgIHJldHVybiBIdHRwQ2xpZW50TW9kdWxlO1xufSgpKTtcbi8qKlxuICogYE5nTW9kdWxlYCB3aGljaCBlbmFibGVzIEpTT05QIHN1cHBvcnQgaW4gYEh0dHBDbGllbnRgLlxuICpcbiAqIFdpdGhvdXQgdGhpcyBtb2R1bGUsIEpzb25wIHJlcXVlc3RzIHdpbGwgcmVhY2ggdGhlIGJhY2tlbmRcbiAqIHdpdGggbWV0aG9kIEpTT05QLCB3aGVyZSB0aGV5J2xsIGJlIHJlamVjdGVkLlxuICpcbiAqIFxcQHN0YWJsZVxuICovXG52YXIgSHR0cENsaWVudEpzb25wTW9kdWxlID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIEh0dHBDbGllbnRKc29ucE1vZHVsZSgpIHtcbiAgICB9XG4gICAgSHR0cENsaWVudEpzb25wTW9kdWxl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NBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpBackend\", function() { return HttpBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHandler\", function() { return HttpHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClient\", function() { return HttpClient; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHeaders\", function() { return HttpHeaders; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HTTP_INTERCEPTORS\", function() { return HTTP_INTERCEPTORS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonpClientBackend\", function() { return JsonpClientBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JsonpInterceptor\", function() { return JsonpInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientJsonpModule\", function() { return HttpClientJsonpModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientModule\", function() { return HttpClientModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpClientXsrfModule\", function() { return HttpClientXsrfModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵinterceptingHandler\", function() { return interceptingHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpParams\", function() { return HttpParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpUrlEncodingCodec\", function() { return HttpUrlEncodingCodec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpRequest\", function() { return HttpRequest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpErrorResponse\", function() { return HttpErrorResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpEventType\", function() { return HttpEventType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpHeaderResponse\", function() { return HttpHeaderResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpResponse\", function() { return HttpResponse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpResponseBase\", function() { return HttpResponseBase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpXhrBackend\", function() { return HttpXhrBackend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"XhrFactory\", function() { return XhrFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HttpXsrfTokenExtractor\", function() { return HttpXsrfTokenExtractor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return NoopInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵb\", function() { return JsonpCallbackContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵc\", function() { return jsonpCallbackContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵd\", function() { return BrowserXhr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵg\", function() { return HttpXsrfCookieExtractor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵh\", function() { return HttpXsrfInterceptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵe\", function() { return XSRF_COOKIE_NAME; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵf\", function() { return XSRF_HEADER_NAME; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__ = __webpack_require__(118);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__ = __webpack_require__(243);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(120);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_tslib__ = __webpack_require__(63);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__ = __webpack_require__(10);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@stable\n * @abstract\n */\nvar HttpHandler = /** @class */ (function () {\n function HttpHandler() {\n }\n return HttpHandler;\n}());\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@stable\n * @abstract\n */\nvar HttpBackend = /** @class */ (function () {\n function HttpBackend() {\n }\n return HttpBackend;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @record\n */\n/**\n * Immutable set of Http headers, with lazy parsing.\n * \\@stable\n */\nvar HttpHeaders = /** @class */ (function () {\n function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var /** @type {?} */ index = line.indexOf(':');\n if (index > 0) {\n var /** @type {?} */ name_1 = line.slice(0, index);\n var /** @type {?} */ key = name_1.toLowerCase();\n var /** @type {?} */ value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name_1, key);\n if (_this.headers.has(key)) {\n /** @type {?} */ ((_this.headers.get(key))).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = headers[name];\n var /** @type {?} */ key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n /**\n * Checks for existence of header by given name.\n */\n /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.has = /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n };\n /**\n * Returns first header that matches given name.\n */\n /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.get = /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n var /** @type {?} */ values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n };\n /**\n * Returns the names of the headers\n */\n /**\n * Returns the names of the headers\n * @return {?}\n */\n HttpHeaders.prototype.keys = /**\n * Returns the names of the headers\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(this.normalizedNames.values());\n };\n /**\n * Returns list of header values for a given name.\n */\n /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.getAll = /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.get(name.toLowerCase()) || null;\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.append = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'a' });\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.set = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 's' });\n };\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n HttpHeaders.prototype.delete = /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'd' });\n };\n /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n HttpHeaders.prototype.maybeSetNormalizedName = /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n function (name, lcName) {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n };\n /**\n * @return {?}\n */\n HttpHeaders.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n }\n else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });\n this.lazyUpdate = null;\n }\n }\n };\n /**\n * @param {?} other\n * @return {?}\n */\n HttpHeaders.prototype.copyFrom = /**\n * @param {?} other\n * @return {?}\n */\n function (other) {\n var _this = this;\n other.init();\n Array.from(other.headers.keys()).forEach(function (key) {\n _this.headers.set(key, /** @type {?} */ ((other.headers.get(key))));\n _this.normalizedNames.set(key, /** @type {?} */ ((other.normalizedNames.get(key))));\n });\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.applyUpdate = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ value = /** @type {?} */ ((update.value));\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n var /** @type {?} */ base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push.apply(base, value);\n this.headers.set(key, base);\n break;\n case 'd':\n var /** @type {?} */ toDelete_1 = /** @type {?} */ (update.value);\n if (!toDelete_1) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n var /** @type {?} */ existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n HttpHeaders.prototype.forEach = /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(function (key) { return fn(/** @type {?} */ ((_this.normalizedNames.get(key))), /** @type {?} */ ((_this.headers.get(key)))); });\n };\n return HttpHeaders;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A codec for encoding and decoding parameters in URLs.\n *\n * Used by `HttpParams`.\n *\n * \\@stable\n *\n * @record\n */\n\n/**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@stable\n */\nvar HttpUrlEncodingCodec = /** @class */ (function () {\n function HttpUrlEncodingCodec() {\n }\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return standardEncoding(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return standardEncoding(v); };\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return decodeURIComponent(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return decodeURIComponent(v); };\n return HttpUrlEncodingCodec;\n}());\n/**\n * @param {?} rawParams\n * @param {?} codec\n * @return {?}\n */\nfunction paramParser(rawParams, codec) {\n var /** @type {?} */ map$$1 = new Map();\n if (rawParams.length > 0) {\n var /** @type {?} */ params = rawParams.split('&');\n params.forEach(function (param) {\n var /** @type {?} */ eqIdx = param.indexOf('=');\n var _a = eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], key = _a[0], val = _a[1];\n var /** @type {?} */ list = map$$1.get(key) || [];\n list.push(val);\n map$$1.set(key, list);\n });\n }\n return map$$1;\n}\n/**\n * @param {?} v\n * @return {?}\n */\nfunction standardEncoding(v) {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/gi, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%2B/gi, '+')\n .replace(/%3D/gi, '=')\n .replace(/%3F/gi, '?')\n .replace(/%2F/gi, '/');\n}\n/**\n * Options used to construct an `HttpParams` instance.\n * @record\n */\n\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable - all mutation operations return a new instance.\n *\n * \\@stable\n */\nvar HttpParams = /** @class */ (function () {\n function HttpParams(options) {\n if (options === void 0) { options = /** @type {?} */ ({}); }\n var _this = this;\n this.updates = null;\n this.cloneFrom = null;\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n if (!!options.fromString) {\n if (!!options.fromObject) {\n throw new Error(\"Cannot specify both fromString and fromObject.\");\n }\n this.map = paramParser(options.fromString, this.encoder);\n }\n else if (!!options.fromObject) {\n this.map = new Map();\n Object.keys(options.fromObject).forEach(function (key) {\n var /** @type {?} */ value = (/** @type {?} */ (options.fromObject))[key]; /** @type {?} */\n ((_this.map)).set(key, Array.isArray(value) ? value : [value]);\n });\n }\n else {\n this.map = null;\n }\n }\n /**\n * Check whether the body has one or more values for the given parameter name.\n */\n /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.has = /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).has(param);\n };\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.get = /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n var /** @type {?} */ res = /** @type {?} */ ((this.map)).get(param);\n return !!res ? res[0] : null;\n };\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.getAll = /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).get(param) || null;\n };\n /**\n * Get all the parameter names for this body.\n */\n /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n HttpParams.prototype.keys = /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(/** @type {?} */ ((this.map)).keys());\n };\n /**\n * Construct a new body with an appended value for the given parameter name.\n */\n /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.append = /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };\n /**\n * Construct a new body with a new value for the given parameter name.\n */\n /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.set = /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n */\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n HttpParams.prototype.delete = /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n */\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n HttpParams.prototype.toString = /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n function () {\n var _this = this;\n this.init();\n return this.keys()\n .map(function (key) {\n var /** @type {?} */ eKey = _this.encoder.encodeKey(key);\n return /** @type {?} */ ((/** @type {?} */ ((_this.map)).get(key))).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); }).join('&');\n })\n .join('&');\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpParams.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpParams(/** @type {?} */ ({ encoder: this.encoder }));\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat([update]);\n return clone;\n };\n /**\n * @return {?}\n */\n HttpParams.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (this.map === null) {\n this.map = new Map();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(function (key) { return ((_this.map)).set(key, /** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((_this.cloneFrom)).map)).get(key)))); }); /** @type {?} */\n ((this.updates)).forEach(function (update) {\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ base = (update.op === 'a' ? /** @type {?} */ ((_this.map)).get(update.param) : undefined) || [];\n base.push(/** @type {?} */ ((update.value))); /** @type {?} */\n ((_this.map)).set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n var /** @type {?} */ base_1 = /** @type {?} */ ((_this.map)).get(update.param) || [];\n var /** @type {?} */ idx = base_1.indexOf(update.value);\n if (idx !== -1) {\n base_1.splice(idx, 1);\n }\n if (base_1.length > 0) {\n /** @type {?} */ ((_this.map)).set(update.param, base_1);\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n }\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = null;\n }\n };\n return HttpParams;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Determine whether the given HTTP method may include a body.\n * @param {?} method\n * @return {?}\n */\nfunction mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@stable\n */\nvar HttpRequest = /** @class */ (function () {\n function HttpRequest(method, url, third, fourth) {\n this.url = url;\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n this.body = null;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n this.reportProgress = false;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n this.withCredentials = false;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n this.responseType = 'json';\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n var /** @type {?} */ options;\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = (third !== undefined) ? /** @type {?} */ (third) : null;\n options = fourth;\n }\n else {\n // No body required, options are the third argument. The body stays null.\n options = /** @type {?} */ (third);\n }\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n if (!!options.params) {\n this.params = options.params;\n }\n }\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n }\n else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n var /** @type {?} */ params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n }\n else {\n // Does the URL already have query parameters? Look for '?'.\n var /** @type {?} */ qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n var /** @type {?} */ sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n */\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n HttpRequest.prototype.serializeBody = /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n function () {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return (/** @type {?} */ (this.body)).toString();\n };\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n */\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n HttpRequest.prototype.detectContentTypeHeader = /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n function () {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n Array.isArray(this.body)) {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n };\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpRequest.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n var /** @type {?} */ method = update.method || this.method;\n var /** @type {?} */ url = update.url || this.url;\n var /** @type {?} */ responseType = update.responseType || this.responseType;\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n var /** @type {?} */ body = (update.body !== undefined) ? update.body : this.body;\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n var /** @type {?} */ withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n var /** @type {?} */ reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n var /** @type {?} */ headers = update.headers || this.headers;\n var /** @type {?} */ params = update.params || this.params;\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce(function (headers, name) { return headers.set(name, /** @type {?} */ ((update.setHeaders))[name]); }, headers);\n }\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce(function (params, param) { return params.set(param, /** @type {?} */ ((update.setParams))[param]); }, params);\n }\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,\n });\n };\n return HttpRequest;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar HttpEventType = {\n /**\n * The request was sent out over the wire.\n */\n Sent: 0,\n /**\n * An upload progress event was received.\n */\n UploadProgress: 1,\n /**\n * The response status code and headers were received.\n */\n ResponseHeader: 2,\n /**\n * A download progress event was received.\n */\n DownloadProgress: 3,\n /**\n * The full response including the body was received.\n */\n Response: 4,\n /**\n * A custom event from an interceptor or a backend.\n */\n User: 5,\n};\nHttpEventType[HttpEventType.Sent] = \"Sent\";\nHttpEventType[HttpEventType.UploadProgress] = \"UploadProgress\";\nHttpEventType[HttpEventType.ResponseHeader] = \"ResponseHeader\";\nHttpEventType[HttpEventType.DownloadProgress] = \"DownloadProgress\";\nHttpEventType[HttpEventType.Response] = \"Response\";\nHttpEventType[HttpEventType.User] = \"User\";\n/**\n * Base interface for progress events.\n *\n * \\@stable\n * @record\n */\n\n/**\n * A download progress event.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An upload progress event.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An event indicating that the request was sent to the server. Useful\n * when a request may be retried multiple times, to distinguish between\n * retries on the final event stream.\n *\n * \\@stable\n * @record\n */\n\n/**\n * A user-defined event.\n *\n * Grouping all custom events under this type ensures they will be handled\n * and forwarded by all implementations of interceptors.\n *\n * \\@stable\n * @record\n */\n\n/**\n * An error that represents a failed attempt to JSON.parse text coming back\n * from the server.\n *\n * It bundles the Error object with the actual response body that failed to parse.\n *\n * \\@stable\n * @record\n */\n\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@stable\n * @abstract\n */\nvar HttpResponseBase = /** @class */ (function () {\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n */\n function HttpResponseBase(init, defaultStatus, defaultStatusText) {\n if (defaultStatus === void 0) { defaultStatus = 200; }\n if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n return HttpResponseBase;\n}());\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@stable\n */\nvar HttpHeaderResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpHeaderResponse, _super);\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n */\n function HttpHeaderResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.ResponseHeader;\n return _this;\n }\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n */\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n HttpHeaderResponse.prototype.clone = /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpHeaderResponse;\n}(HttpResponseBase));\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@stable\n */\nvar HttpResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpResponse, _super);\n /**\n * Construct a new `HttpResponse`.\n */\n function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpResponse.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n return new HttpResponse({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpResponse;\n}(HttpResponseBase));\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@stable\n */\nvar HttpErrorResponse = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_5_tslib__[\"b\" /* __extends */])(HttpErrorResponse, _super);\n function HttpErrorResponse(init) {\n var _this = \n // Initialize with a default status of 0 / Unknown Error.\n _super.call(this, init, 0, 'Unknown Error') || this;\n _this.name = 'HttpErrorResponse';\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n _this.ok = false;\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (_this.status >= 200 && _this.status < 300) {\n _this.message = \"Http failure during parsing for \" + (init.url || '(unknown url)');\n }\n else {\n _this.message =\n \"Http failure response for \" + (init.url || '(unknown url)') + \": \" + init.status + \" \" + init.statusText;\n }\n _this.error = init.error || null;\n return _this;\n }\n return HttpErrorResponse;\n}(HttpResponseBase));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Construct an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and\n * the given `body`. Basically, this clones the object and adds the body.\n * @template T\n * @param {?} options\n * @param {?} body\n * @return {?}\n */\nfunction addBody(options, body) {\n return {\n body: body,\n headers: options.headers,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n/**\n * Perform HTTP requests.\n *\n * `HttpClient` is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies according to which\n * signature is called (mainly the values of `observe` and `responseType`).\n *\n * \\@stable\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient(handler) {\n this.handler = handler;\n }\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n */\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.request = /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable<T>` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n function (first, url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var /** @type {?} */ req;\n // Firstly, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = /** @type {?} */ (first);\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming GET unless a method is\n // provided.\n // Figure out the headers.\n var /** @type {?} */ headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n var /** @type {?} */ params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams(/** @type {?} */ ({ fromObject: options.params }));\n }\n }\n // Construct the request.\n req = new HttpRequest(first, /** @type {?} */ ((url)), (options.body !== undefined ? options.body : null), {\n headers: headers,\n params: params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n var /** @type {?} */ events$ = __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__[\"concatMap\"].call(Object(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__[\"of\"])(req), function (req) { return _this.handler.handle(req); });\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n var /** @type {?} */ res$ = __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__[\"filter\"].call(events$, function (event) { return event instanceof HttpResponse; });\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n });\n case 'blob':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n });\n case 'text':\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n });\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__[\"map\"].call(res$, function (res) { return res.body; });\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(\"Unreachable: unhandled observe type \" + options.observe + \"}\");\n }\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.delete = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('DELETE', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.get = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('GET', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.head = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('HEAD', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n HttpClient.prototype.jsonp = /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n function (url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.options = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('OPTIONS', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.patch = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PATCH', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.post = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('POST', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.put = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PUT', url, addBody(options, body));\n };\n HttpClient.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpClient.ctorParameters = function () { return [\n { type: HttpHandler, },\n ]; };\n return HttpClient;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Intercepts `HttpRequest` and handles them.\n *\n * Most interceptors will transform the outgoing request before passing it to the\n * next interceptor in the chain, by calling `next.handle(transformedReq)`.\n *\n * In rare cases, interceptors may wish to completely handle a request themselves,\n * and not delegate to the remainder of the chain. This behavior is allowed.\n *\n * \\@stable\n * @record\n */\n\n/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@stable\n */\nvar HttpInterceptorHandler = /** @class */ (function () {\n function HttpInterceptorHandler(next, interceptor) {\n this.next = next;\n this.interceptor = interceptor;\n }\n /**\n * @param {?} req\n * @return {?}\n */\n HttpInterceptorHandler.prototype.handle = /**\n * @param {?} req\n * @return {?}\n */\n function (req) {\n return this.interceptor.intercept(req, this.next);\n };\n return HttpInterceptorHandler;\n}());\n/**\n * A multi-provider token which represents the array of `HttpInterceptor`s that\n * are registered.\n *\n * \\@stable\n */\nvar HTTP_INTERCEPTORS = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('HTTP_INTERCEPTORS');\nvar NoopInterceptor = /** @class */ (function () {\n function NoopInterceptor() {\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n NoopInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n return next.handle(req);\n };\n NoopInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NoopInterceptor.ctorParameters = function () { return []; };\n return NoopInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// Every request made through JSONP needs a callback name that's unique across the\n// whole page. Each request is assigned an id and the callback name is constructed\n// from that. The next id to be assigned is tracked in a global variable here that\n// is shared among all applications on the page.\nvar nextRequestId = 0;\n// Error text given when a JSONP script is injected, but doesn't invoke the callback\n// passed in its URL.\nvar JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';\n// Error text given when a request is passed to the JsonpClientBackend that doesn't\n// have a request method JSONP.\nvar JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';\nvar JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@stable\n * @abstract\n */\nvar JsonpCallbackContext = /** @class */ (function () {\n function JsonpCallbackContext() {\n }\n return JsonpCallbackContext;\n}());\n/**\n * `HttpBackend` that only processes `HttpRequest` with the JSONP method,\n * by performing JSONP style requests.\n *\n * \\@stable\n */\nvar JsonpClientBackend = /** @class */ (function () {\n function JsonpClientBackend(callbackMap, document) {\n this.callbackMap = callbackMap;\n this.document = document;\n }\n /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n JsonpClientBackend.prototype.nextCallback = /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n function () { return \"ng_jsonp_callback_\" + nextRequestId++; };\n /**\n * Process a JSONP request and return an event stream of the results.\n */\n /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n JsonpClientBackend.prototype.handle = /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n function (req) {\n var _this = this;\n // Firstly, check both the method and response type. If either doesn't match\n // then the request was improperly routed here and cannot be handled.\n if (req.method !== 'JSONP') {\n throw new Error(JSONP_ERR_WRONG_METHOD);\n }\n else if (req.responseType !== 'json') {\n throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);\n }\n // Everything else happens inside the Observable boundary.\n return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__[\"Observable\"](function (observer) {\n // The first step to make a request is to generate the callback name, and replace the\n // callback placeholder in the URL with the name. Care has to be taken here to ensure\n // a trailing &, if matched, gets inserted back into the URL in the correct place.\n var /** @type {?} */ callback = _this.nextCallback();\n var /** @type {?} */ url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, \"=\" + callback + \"$1\");\n // Construct the <script> tag and point it at the URL.\n var /** @type {?} */ node = _this.document.createElement('script');\n node.src = url;\n // A JSONP request requires waiting for multiple callbacks. These variables\n // are closed over and track state across those callbacks.\n // The response object, if one has been received, or null otherwise.\n var /** @type {?} */ body = null;\n // Whether the response callback has been called.\n var /** @type {?} */ finished = false;\n // Whether the request has been cancelled (and thus any other callbacks)\n // should be ignored.\n var /** @type {?} */ cancelled = false;\n // Set the response callback in this.callbackMap (which will be the window\n // object in the browser. The script being loaded via the <script> tag will\n // eventually call this callback.\n // Set the response callback in this.callbackMap (which will be the window\n // object in the browser. The script being loaded via the <script> tag will\n // eventually call this callback.\n _this.callbackMap[callback] = function (data) {\n // Data has been received from the JSONP script. Firstly, delete this callback.\n delete _this.callbackMap[callback];\n // Next, make sure the request wasn't cancelled in the meantime.\n if (cancelled) {\n return;\n }\n // Set state to indicate data was received.\n body = data;\n finished = true;\n };\n // cleanup() is a utility closure that removes the <script> from the page and\n // the response callback from the window. This logic is used in both the\n // success, error, and cancellation paths, so it's extracted out for convenience.\n var /** @type {?} */ cleanup = function () {\n // Remove the <script> tag if it's still on the page.\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n // Remove the response callback from the callbackMap (window object in the\n // browser).\n delete _this.callbackMap[callback];\n };\n // onLoad() is the success callback which runs after the response callback\n // if the JSONP script loads successfully. The event itself is unimportant.\n // If something went wrong, onLoad() may run without the response callback\n // having been invoked.\n var /** @type {?} */ onLoad = function (event) {\n // Do nothing if the request has been cancelled.\n if (cancelled) {\n return;\n }\n // Cleanup the page.\n cleanup();\n // Check whether the response callback has run.\n if (!finished) {\n // It hasn't, something went wrong with the request. Return an error via\n // the Observable error path. All JSONP errors have status 0.\n observer.error(new HttpErrorResponse({\n url: url,\n status: 0,\n statusText: 'JSONP Error',\n error: new Error(JSONP_ERR_NO_CALLBACK),\n }));\n return;\n }\n // Success. body either contains the response body or null if none was\n // returned.\n observer.next(new HttpResponse({\n body: body,\n status: 200,\n statusText: 'OK', url: url,\n }));\n // Complete the stream, the resposne is over.\n observer.complete();\n };\n // onError() is the error callback, which runs if the script returned generates\n // a Javascript error. It emits the error via the Observable error channel as\n // a HttpErrorResponse.\n var /** @type {?} */ onError = function (error) {\n // If the request was already cancelled, no need to emit anything.\n if (cancelled) {\n return;\n }\n cleanup();\n // Wrap the error in a HttpErrorResponse.\n observer.error(new HttpErrorResponse({\n error: error,\n status: 0,\n statusText: 'JSONP Error', url: url,\n }));\n };\n // Subscribe to both the success (load) and error events on the <script> tag,\n // and add it to the page.\n node.addEventListener('load', onLoad);\n node.addEventListener('error', onError);\n _this.document.body.appendChild(node);\n // The request has now been successfully sent.\n observer.next({ type: HttpEventType.Sent });\n // Cancellation handler.\n return function () {\n // Track the cancellation so event listeners won't do anything even if already scheduled.\n cancelled = true;\n // Remove the event listeners so they won't run if the events later fire.\n node.removeEventListener('load', onLoad);\n node.removeEventListener('error', onError);\n // And finally, clean up the page.\n cleanup();\n };\n });\n };\n JsonpClientBackend.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n JsonpClientBackend.ctorParameters = function () { return [\n { type: JsonpCallbackContext, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"DOCUMENT\"],] },] },\n ]; };\n return JsonpClientBackend;\n}());\n/**\n * An `HttpInterceptor` which identifies requests with the method JSONP and\n * shifts them to the `JsonpClientBackend`.\n *\n * \\@stable\n */\nvar JsonpInterceptor = /** @class */ (function () {\n function JsonpInterceptor(jsonp) {\n this.jsonp = jsonp;\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n JsonpInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(/** @type {?} */ (req));\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n };\n JsonpInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n JsonpInterceptor.ctorParameters = function () { return [\n { type: JsonpClientBackend, },\n ]; };\n return JsonpInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XSSI_PREFIX = /^\\)\\]\\}',?\\n/;\n/**\n * Determine an appropriate URL for the response, by checking either\n * XMLHttpRequest.responseURL or the X-Request-URL header.\n * @param {?} xhr\n * @return {?}\n */\nfunction getResponseUrl(xhr) {\n if ('responseURL' in xhr && xhr.responseURL) {\n return xhr.responseURL;\n }\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL');\n }\n return null;\n}\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * \\@stable\n * @abstract\n */\nvar XhrFactory = /** @class */ (function () {\n function XhrFactory() {\n }\n return XhrFactory;\n}());\n/**\n * A factory for \\@{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.\n *\n * \\@stable\n */\nvar BrowserXhr = /** @class */ (function () {\n function BrowserXhr() {\n }\n /**\n * @return {?}\n */\n BrowserXhr.prototype.build = /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((new XMLHttpRequest())); };\n BrowserXhr.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n BrowserXhr.ctorParameters = function () { return []; };\n return BrowserXhr;\n}());\n/**\n * An `HttpBackend` which uses the XMLHttpRequest API to send\n * requests to a backend server.\n *\n * \\@stable\n */\nvar HttpXhrBackend = /** @class */ (function () {\n function HttpXhrBackend(xhrFactory) {\n this.xhrFactory = xhrFactory;\n }\n /**\n * Process a request and return a stream of response events.\n */\n /**\n * Process a request and return a stream of response events.\n * @param {?} req\n * @return {?}\n */\n HttpXhrBackend.prototype.handle = /**\n * Process a request and return a stream of response events.\n * @param {?} req\n * @return {?}\n */\n function (req) {\n var _this = this;\n // Quick check to give a better error message when a user attempts to use\n // HttpClient.jsonp() without installing the JsonpClientModule\n if (req.method === 'JSONP') {\n throw new Error(\"Attempted to construct Jsonp request without JsonpClientModule installed.\");\n }\n // Everything happens on Observable subscription.\n return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__[\"Observable\"](function (observer) {\n // Start by setting up the XHR object with request method, URL, and withCredentials flag.\n var /** @type {?} */ xhr = _this.xhrFactory.build();\n xhr.open(req.method, req.urlWithParams);\n if (!!req.withCredentials) {\n xhr.withCredentials = true;\n }\n // Add all the requested headers.\n req.headers.forEach(function (name, values) { return xhr.setRequestHeader(name, values.join(',')); });\n // Add an Accept header if one isn't present already.\n if (!req.headers.has('Accept')) {\n xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');\n }\n // Auto-detect the Content-Type header if one isn't present already.\n if (!req.headers.has('Content-Type')) {\n var /** @type {?} */ detectedType = req.detectContentTypeHeader();\n // Sometimes Content-Type detection fails.\n if (detectedType !== null) {\n xhr.setRequestHeader('Content-Type', detectedType);\n }\n }\n // Set the responseType if one was requested.\n if (req.responseType) {\n var /** @type {?} */ responseType = req.responseType.toLowerCase();\n // JSON responses need to be processed as text. This is because if the server\n // returns an XSSI-prefixed JSON response, the browser will fail to parse it,\n // xhr.response will be null, and xhr.responseText cannot be accessed to\n // retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON\n // is parsed by first requesting text and then applying JSON.parse.\n xhr.responseType = /** @type {?} */ (((responseType !== 'json') ? responseType : 'text'));\n }\n // Serialize the request body if one is present. If not, this will be set to null.\n var /** @type {?} */ reqBody = req.serializeBody();\n // If progress events are enabled, response headers will be delivered\n // in two events - the HttpHeaderResponse event and the full HttpResponse\n // event. However, since response headers don't change in between these\n // two events, it doesn't make sense to parse them twice. So headerResponse\n // caches the data extracted from the response whenever it's first parsed,\n // to ensure parsing isn't duplicated.\n var /** @type {?} */ headerResponse = null;\n // partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest\n // state, and memoizes it into headerResponse.\n var /** @type {?} */ partialFromXhr = function () {\n if (headerResponse !== null) {\n return headerResponse;\n }\n // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).\n var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;\n var /** @type {?} */ statusText = xhr.statusText || 'OK';\n // Parse headers from XMLHttpRequest - this step is lazy.\n var /** @type {?} */ headers = new HttpHeaders(xhr.getAllResponseHeaders());\n // Read the response URL from the XMLHttpResponse instance and fall back on the\n // request URL.\n var /** @type {?} */ url = getResponseUrl(xhr) || req.url;\n // Construct the HttpHeaderResponse and memoize it.\n headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });\n return headerResponse;\n };\n // Next, a few closures are defined for the various events which XMLHttpRequest can\n // emit. This allows them to be unregistered as event listeners later.\n // First up is the load event, which represents a response being fully available.\n var /** @type {?} */ onLoad = function () {\n // Read response state from the memoized partial data.\n var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;\n // The body will be read out if present.\n var /** @type {?} */ body = null;\n if (status !== 204) {\n // Use XMLHttpRequest.response if set, responseText otherwise.\n body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;\n }\n // Normalize another potential bug (this one comes from CORS).\n if (status === 0) {\n status = !!body ? 200 : 0;\n }\n // ok determines whether the response will be transmitted on the event or\n // error channel. Unsuccessful status codes (not 2xx) will always be errors,\n // but a successful status code can still result in an error if the user\n // asked for JSON data and the body cannot be parsed as such.\n var /** @type {?} */ ok = status >= 200 && status < 300;\n // Check whether the body needs to be parsed as JSON (in many cases the browser\n // will have done that already).\n if (req.responseType === 'json' && typeof body === 'string') {\n // Save the original body, before attempting XSSI prefix stripping.\n var /** @type {?} */ originalBody = body;\n body = body.replace(XSSI_PREFIX, '');\n try {\n // Attempt the parse. If it fails, a parse error should be delivered to the user.\n body = body !== '' ? JSON.parse(body) : null;\n }\n catch (/** @type {?} */ error) {\n // Since the JSON.parse failed, it's reasonable to assume this might not have been a\n // JSON response. Restore the original body (including any XSSI prefix) to deliver\n // a better error response.\n body = originalBody;\n // If this was an error request to begin with, leave it as a string, it probably\n // just isn't JSON. Otherwise, deliver the parsing error to the user.\n if (ok) {\n // Even though the response status was 2xx, this is still an error.\n ok = false;\n // The parse error contains the text of the body that failed to parse.\n body = /** @type {?} */ ({ error: error, text: body });\n }\n }\n }\n if (ok) {\n // A successful response is delivered on the event stream.\n observer.next(new HttpResponse({\n body: body,\n headers: headers,\n status: status,\n statusText: statusText,\n url: url || undefined,\n }));\n // The full body has been received and delivered, no further events\n // are possible. This request is complete.\n observer.complete();\n }\n else {\n // An unsuccessful request is delivered on the error channel.\n observer.error(new HttpErrorResponse({\n // The error in this case is the response body (error from the server).\n error: body,\n headers: headers,\n status: status,\n statusText: statusText,\n url: url || undefined,\n }));\n }\n };\n // The onError callback is called when something goes wrong at the network level.\n // Connection timeout, DNS error, offline, etc. These are actual errors, and are\n // transmitted on the error channel.\n var /** @type {?} */ onError = function (error) {\n var /** @type {?} */ res = new HttpErrorResponse({\n error: error,\n status: xhr.status || 0,\n statusText: xhr.statusText || 'Unknown Error',\n });\n observer.error(res);\n };\n // The sentHeaders flag tracks whether the HttpResponseHeaders event\n // has been sent on the stream. This is necessary to track if progress\n // is enabled since the event will be sent on only the first download\n // progerss event.\n var /** @type {?} */ sentHeaders = false;\n // The download progress event handler, which is only registered if\n // progress events are enabled.\n var /** @type {?} */ onDownProgress = function (event) {\n // Send the HttpResponseHeaders event if it hasn't been sent already.\n if (!sentHeaders) {\n observer.next(partialFromXhr());\n sentHeaders = true;\n }\n // Start building the download progress event to deliver on the response\n // event stream.\n var /** @type {?} */ progressEvent = {\n type: HttpEventType.DownloadProgress,\n loaded: event.loaded,\n };\n // Set the total number of bytes in the event if it's available.\n if (event.lengthComputable) {\n progressEvent.total = event.total;\n }\n // If the request was for text content and a partial response is\n // available on XMLHttpRequest, include it in the progress event\n // to allow for streaming reads.\n if (req.responseType === 'text' && !!xhr.responseText) {\n progressEvent.partialText = xhr.responseText;\n }\n // Finally, fire the event.\n observer.next(progressEvent);\n };\n // The upload progress event handler, which is only registered if\n // progress events are enabled.\n var /** @type {?} */ onUpProgress = function (event) {\n // Upload progress events are simpler. Begin building the progress\n // event.\n var /** @type {?} */ progress = {\n type: HttpEventType.UploadProgress,\n loaded: event.loaded,\n };\n // If the total number of bytes being uploaded is available, include\n // it.\n if (event.lengthComputable) {\n progress.total = event.total;\n }\n // Send the event.\n observer.next(progress);\n };\n // By default, register for load and error events.\n xhr.addEventListener('load', onLoad);\n xhr.addEventListener('error', onError);\n // Progress events are only enabled if requested.\n if (req.reportProgress) {\n // Download progress is always enabled if requested.\n xhr.addEventListener('progress', onDownProgress);\n // Upload progress depends on whether there is a body to upload.\n if (reqBody !== null && xhr.upload) {\n xhr.upload.addEventListener('progress', onUpProgress);\n }\n }\n // Fire the request, and notify the event stream that it was fired.\n xhr.send(reqBody);\n observer.next({ type: HttpEventType.Sent });\n // This is the return from the Observable function, which is the\n // request cancellation handler.\n return function () {\n // On a cancellation, remove all registered event listeners.\n xhr.removeEventListener('error', onError);\n xhr.removeEventListener('load', onLoad);\n if (req.reportProgress) {\n xhr.removeEventListener('progress', onDownProgress);\n if (reqBody !== null && xhr.upload) {\n xhr.upload.removeEventListener('progress', onUpProgress);\n }\n }\n // Finally, abort the in-flight request.\n xhr.abort();\n };\n });\n };\n HttpXhrBackend.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXhrBackend.ctorParameters = function () { return [\n { type: XhrFactory, },\n ]; };\n return HttpXhrBackend;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XSRF_COOKIE_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('XSRF_COOKIE_NAME');\nvar XSRF_HEADER_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"InjectionToken\"]('XSRF_HEADER_NAME');\n/**\n * Retrieves the current XSRF token to use with the next outgoing request.\n *\n * \\@stable\n * @abstract\n */\nvar HttpXsrfTokenExtractor = /** @class */ (function () {\n function HttpXsrfTokenExtractor() {\n }\n return HttpXsrfTokenExtractor;\n}());\n/**\n * `HttpXsrfTokenExtractor` which retrieves the token from a cookie.\n */\nvar HttpXsrfCookieExtractor = /** @class */ (function () {\n function HttpXsrfCookieExtractor(doc, platform, cookieName) {\n this.doc = doc;\n this.platform = platform;\n this.cookieName = cookieName;\n this.lastCookieString = '';\n this.lastToken = null;\n /**\n * \\@internal for testing\n */\n this.parseCount = 0;\n }\n /**\n * @return {?}\n */\n HttpXsrfCookieExtractor.prototype.getToken = /**\n * @return {?}\n */\n function () {\n if (this.platform === 'server') {\n return null;\n }\n var /** @type {?} */ cookieString = this.doc.cookie || '';\n if (cookieString !== this.lastCookieString) {\n this.parseCount++;\n this.lastToken = Object(__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"ɵparseCookieValue\"])(cookieString, this.cookieName);\n this.lastCookieString = cookieString;\n }\n return this.lastToken;\n };\n HttpXsrfCookieExtractor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXsrfCookieExtractor.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__[\"DOCUMENT\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"PLATFORM_ID\"],] },] },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [XSRF_COOKIE_NAME,] },] },\n ]; };\n return HttpXsrfCookieExtractor;\n}());\n/**\n * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.\n */\nvar HttpXsrfInterceptor = /** @class */ (function () {\n function HttpXsrfInterceptor(tokenService, headerName) {\n this.tokenService = tokenService;\n this.headerName = headerName;\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n HttpXsrfInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n var /** @type {?} */ lcUrl = req.url.toLowerCase();\n // Skip both non-mutating requests and absolute URLs.\n // Non-mutating requests don't require a token, and absolute URLs require special handling\n // anyway as the cookie set\n // on our origin is not the same as the token expected by another origin.\n if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||\n lcUrl.startsWith('https://')) {\n return next.handle(req);\n }\n var /** @type {?} */ token = this.tokenService.getToken();\n // Be careful not to overwrite an existing header of the same name.\n if (token !== null && !req.headers.has(this.headerName)) {\n req = req.clone({ headers: req.headers.set(this.headerName, token) });\n }\n return next.handle(req);\n };\n HttpXsrfInterceptor.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n HttpXsrfInterceptor.ctorParameters = function () { return [\n { type: HttpXsrfTokenExtractor, },\n { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"], args: [XSRF_HEADER_NAME,] },] },\n ]; };\n return HttpXsrfInterceptor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Constructs an `HttpHandler` that applies a bunch of `HttpInterceptor`s\n * to a request before passing it to the given `HttpBackend`.\n *\n * Meant to be used as a factory function within `HttpClientModule`.\n *\n * \\@stable\n * @param {?} backend\n * @param {?=} interceptors\n * @return {?}\n */\nfunction interceptingHandler(backend, interceptors) {\n if (interceptors === void 0) { interceptors = []; }\n if (!interceptors) {\n return backend;\n }\n return interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, backend);\n}\n/**\n * Factory function that determines where to store JSONP callbacks.\n *\n * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist\n * in test environments. In that case, callbacks are stored on an anonymous object instead.\n *\n * \\@stable\n * @return {?}\n */\nfunction jsonpCallbackContext() {\n if (typeof window === 'object') {\n return window;\n }\n return {};\n}\n/**\n * `NgModule` which adds XSRF protection support to outgoing requests.\n *\n * Provided the server supports a cookie-based XSRF protection system, this\n * module can be used directly to configure XSRF protection with the correct\n * cookie and header names.\n *\n * If no such names are provided, the default is to use `X-XSRF-TOKEN` for\n * the header name and `XSRF-TOKEN` for the cookie name.\n *\n * \\@stable\n */\nvar HttpClientXsrfModule = /** @class */ (function () {\n function HttpClientXsrfModule() {\n }\n /**\n * Disable the default XSRF protection.\n */\n /**\n * Disable the default XSRF protection.\n * @return {?}\n */\n HttpClientXsrfModule.disable = /**\n * Disable the default XSRF protection.\n * @return {?}\n */\n function () {\n return {\n ngModule: HttpClientXsrfModule,\n providers: [\n { provide: HttpXsrfInterceptor, useClass: NoopInterceptor },\n ],\n };\n };\n /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n */\n /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n * @param {?=} options\n * @return {?}\n */\n HttpClientXsrfModule.withOptions = /**\n * Configure XSRF protection to use the given cookie name or header name,\n * or the default names (as described above) if not provided.\n * @param {?=} options\n * @return {?}\n */\n function (options) {\n if (options === void 0) { options = {}; }\n return {\n ngModule: HttpClientXsrfModule,\n providers: [\n options.cookieName ? { provide: XSRF_COOKIE_NAME, useValue: options.cookieName } : [],\n options.headerName ? { provide: XSRF_HEADER_NAME, useValue: options.headerName } : [],\n ],\n };\n };\n HttpClientXsrfModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n providers: [\n HttpXsrfInterceptor,\n { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },\n { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },\n { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },\n { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientXsrfModule.ctorParameters = function () { return []; };\n return HttpClientXsrfModule;\n}());\n/**\n * `NgModule` which provides the `HttpClient` and associated services.\n *\n * Interceptors can be added to the chain behind `HttpClient` by binding them\n * to the multiprovider for `HTTP_INTERCEPTORS`.\n *\n * \\@stable\n */\nvar HttpClientModule = /** @class */ (function () {\n function HttpClientModule() {\n }\n HttpClientModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n imports: [\n HttpClientXsrfModule.withOptions({\n cookieName: 'XSRF-TOKEN',\n headerName: 'X-XSRF-TOKEN',\n }),\n ],\n providers: [\n HttpClient,\n // HttpHandler is the backend + interceptors and is constructed\n // using the interceptingHandler factory function.\n {\n provide: HttpHandler,\n useFactory: interceptingHandler,\n deps: [HttpBackend, [new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Inject\"](HTTP_INTERCEPTORS)]],\n },\n HttpXhrBackend,\n { provide: HttpBackend, useExisting: HttpXhrBackend },\n BrowserXhr,\n { provide: XhrFactory, useExisting: BrowserXhr },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientModule.ctorParameters = function () { return []; };\n return HttpClientModule;\n}());\n/**\n * `NgModule` which enables JSONP support in `HttpClient`.\n *\n * Without this module, Jsonp requests will reach the backend\n * with method JSONP, where they'll be rejected.\n *\n * \\@stable\n */\nvar HttpClientJsonpModule = /** @class */ (function () {\n function HttpClientJsonpModule() {\n }\n HttpClientJsonpModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n providers: [\n JsonpClientBackend,\n { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },\n { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },\n ],\n },] },\n ];\n /** @nocollapse */\n HttpClientJsonpModule.ctorParameters = function () { return []; };\n return HttpClientJsonpModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=http.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGFuZ3VsYXIvY29tbW9uL2VzbTUvaHR0cC5qcz8yMmQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBJbmplY3QsIEluamVjdGFibGUsIEluamVjdGlvblRva2VuLCBOZ01vZHVsZSwgT3B0aW9uYWwsIFBMQVRGT1JNX0lEIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBvZiB9IGZyb20gJ3J4anMvb2JzZXJ2YWJsZS9vZic7XG5pbXBvcnQgeyBjb25jYXRNYXAgfSBmcm9tICdyeGpzL29wZXJhdG9yL2NvbmNhdE1hcCc7XG5pbXBvcnQgeyBmaWx0ZXIgfSBmcm9tICdyeGpzL29wZXJhdG9yL2ZpbHRl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B0aGlzLmhlYWRlcnMgPSBuZXcgTWFwKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIGhlYWRlcnMgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICB0aGlzLmxhenlJbml0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLmhlYWRlcnMgPSBuZXcgTWFwKCk7XG4gICAgICAgICAgICAgICAgaGVhZGVycy5zcGxpdCgnXFxuJykuZm9yRWFjaChmdW5jdGlvbiAobGluZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpbmRleCA9IGxpbmUuaW5kZXhPZignOicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBuYW1lXzEgPSBsaW5lLnNsaWNlKDAsIGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGtleSA9IG5hbWVfMS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWUgPSBsaW5lLnNsaWNlKGluZGV4ICsgMSkudHJpbSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZShuYW1lXzEsIGtleSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX3RoaXMuaGVhZGVycy5oYXMoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5oZWFkZXJzLmdldChrZXkpKSkucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5oZWFkZXJzLnNldChrZXksIFt2YWx1ZV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5sYXp5SW5pdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5oZWFkZXJzID0gbmV3IE1hcCgpO1xuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKGhlYWRlcnMpLmZvckVhY2goZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gdmFsdWVzID0gaGVhZGVyc1tuYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8ga2V5ID0gbmFtZS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcyA9IFt2YWx1ZXNdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuaGVhZGVycy5zZXQoa2V5LCB2YWx1ZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZShuYW1lLCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfVxuICAgIC8qKlxuICAgICAqIENoZWNrcyBmb3IgZXhpc3RlbmNlIG9mIGhlYWRlciBieSBnaXZlbiBuYW1lLlxuICAgICAqL1x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G4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAobmFtZSwgdmFsdWUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmUoeyBuYW1lOiBuYW1lLCB2YWx1ZTogdmFsdWUsIG9wOiAnZCcgfSk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IGxjTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cEhlYWRlcnMucHJvdG90eXBlLm1heWJlU2V0Tm9ybWFsaXplZE5hbWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IG5hbWVcbiAgICAgKiBAcGFyYW0gez99IGxjTmFtZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG5hbWUsIGxjTmFtZSkge1xuICAgICAgICBpZiAoIXRoaXMubm9ybWFsaXplZE5hbWVzLmhhcyhsY05hbWUpKSB7XG4gICAgICAgICAgICB0aGlzLm5vcm1hbGl6ZWROYW1lcy5zZXQobGNOYW1lLCBuYW1lKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBIdHRwSGVhZGVycy5wcm90b3R5cGUuaW5pdCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAoISF0aGlzLmxhenlJbml0KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXp5SW5pdCBpbnN0YW5jZW9mIEh0dHBIZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb3B5RnJvbSh0aGlzLmxhenlJbml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMubGF6eUluaXQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubGF6eUluaXQgPSBudWxsO1xuICAgICAgICAgICAgaWYgKCEhdGhpcy5sYXp5VXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sYXp5VXBkYXRlLmZvckVhY2goZnVuY3Rpb24gKHVwZGF0ZSkgeyByZXR1cm4gX3RoaXMuYXBwbHlVcGRhdGUodXBkYXRlKTsgfSk7XG4gICAgICAgICAgICAgICAgdGhpcy5sYXp5VXBkYXRlID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBvdGhlclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cEhlYWRlcnMucHJvdG90eXBlLmNvcHlGcm9tID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBvdGhlclxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG90aGVyKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIG90aGVyLmluaXQoKTtcbiAgICAgICAgQXJyYXkuZnJvbShvdGhlci5oZWFkZXJzLmtleXMoKSkuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBfdGhpcy5oZWFkZXJzLnNldChrZXksIC8qKiBAdHlwZSB7P30gKi8gKChvdGhlci5oZWFkZXJzLmdldChrZXkpKSkpO1xuICAgICAgICAgICAgX3RoaXMubm9ybWFsaXplZE5hbWVzLnNldChrZXksIC8qKiBAdHlwZSB7P30gKi8gKChvdGhlci5ub3JtYWxpemVkTmFtZXMuZ2V0KGtleSkpKSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB1cGRhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBIZWFkZXJzLnBy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AgICAgICAgICAgICAgIHZhbHVlID0gW3ZhbHVlXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMubWF5YmVTZXROb3JtYWxpemVkTmFtZSh1cGRhdGUubmFtZSwga2V5KTtcbiAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBiYXNlID0gKHVwZGF0ZS5vcCA9PT0gJ2EnID8gdGhpcy5oZWFkZXJzLmdldChrZXkpIDogdW5kZWZpbmVkKSB8fCBbXTtcbiAgICAgICAgICAgICAgICBiYXNlLnB1c2guYXBwbHkoYmFzZSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoa2V5LCBiYXNlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHRvRGVsZXRlXzEgPSAvKiogQHR5cGUgez99ICovICh1cGRhdGUudmFsdWUpO1xuICAgICAgICAgICAgICAgIGlmICghdG9EZWxldGVfMSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuZGVsZXRlKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubm9ybWFsaXplZE5hbWVzLmRlbGV0ZShrZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZXhpc3RpbmcgPSB0aGlzLmhlYWRlcnMuZ2V0KGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBleGlzdGluZyA9IGV4aXN0aW5nLmZpbHRlcihmdW5jdGlvbiAodmFsdWUpIHsgcmV0dXJuIHRvRGVsZXRlXzEuaW5kZXhPZih2YWx1ZSkgPT09IC0xOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGV4aXN0aW5nLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLmRlbGV0ZShrZXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3JtYWxpemVkTmFtZXMuZGVsZXRlKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuc2V0KGtleSwgZXhpc3RpbmcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICAvKipcbiAgICAgKiBcXEBpbnRlcm5hbFxuICAgICAqIEBwYXJhbSB7P30gZm5cbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBIZWFkZXJzLnByb3RvdHlwZS5mb3JFYWNoID0gLyoqXG4gICAgICogXFxAaW50ZXJuYWxcbiAgICAgKiBAcGFyYW0gez99IGZuXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoZm4pIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdGhpcy5pbml0KCk7XG4gICAgICAgIEFycmF5LmZyb20odGhpcy5ub3JtYWxpemVkTmFtZXMua2V5cygpKVxuICAgICAgICAgICAgLmZvckVhY2goZnVuY3Rpb24gKGtleSkgeyByZXR1cm4g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3Rpb24gSHR0cFVybEVuY29kaW5nQ29kZWMoKSB7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30ga1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cFVybEVuY29kaW5nQ29kZWMucHJvdG90eXBlLmVuY29kZUtleSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30ga1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGspIHsgcmV0dXJuIHN0YW5kYXJkRW5jb2Rpbmcoayk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB2XG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBIdHRwVXJsRW5jb2RpbmdDb2RlYy5wcm90b3R5cGUuZW5jb2RlVmFsdWUgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICh2KSB7IHJldHVybiBzdGFuZGFyZEVuY29kaW5nKHYpOyB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30ga1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgSHR0cFVybEVuY29kaW5nQ29kZWMucHJvdG90eXBlLmRlY29kZUtleSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30ga1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGspIHsgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChrKTsgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEh0dHBVcmxFbmNvZGluZ0NvZGVjLnByb3RvdHlwZS5kZWNvZGVWYWx1ZSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gK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ua2V5cygpLmZvckVhY2goZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gKChfdGhpcy5tYXApKS5zZXQoa2V5LCAvKiogQHR5cGUgez99ICovICgoLyoqIEB0eXBlIHs/fSAqLyAoKC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5jbG9uZUZyb20pKS5tYXApKS5nZXQoa2V5KSkpKTsgfSk7IC8qKiBAdHlwZSB7P30gKi9cbiAgICAgICAgICAgICgodGhpcy51cGRhdGVzKSkuZm9yRWFjaChmdW5jdGlvbiAodXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh1cGRhdGUub3ApIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYSc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYmFzZSA9ICh1cGRhdGUub3AgPT09ICdhJyA/IC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5nZXQodXBkYXRlLnBhcmFtKSA6IHVuZGVmaW5lZCkgfHwgW107XG4gICAgICAgICAgICAgICAgICAgICAgICBiYXNlLnB1c2goLyoqIEB0eXBlIHs/fSAqLyAoKHVwZGF0ZS52YWx1ZSkpKTsgLyoqIEB0eXBlIHs/fSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgKChfdGhpcy5tYXApKS5zZXQodXBkYXRlLnBhcmFtLCBiYXNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cGRhdGUudmFsdWUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGJhc2VfMSA9IC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5nZXQodXBkYXRlLnBhcmFtKSB8fCBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpZHggPSBiYXNlXzEuaW5kZXhPZih1cGRhdGUudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZHggIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VfMS5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJhc2VfMS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5zZXQodXBkYXRlLnBhcmFtLCBiYXNlXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqIEB0eXBlIHs/fSAqLyAoKF90aGlzLm1hcCkpLmRlbGV0ZSh1cGRhdGUucGFyYW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7P30gKi8gKChfdGhpcy5tYXApKS5kZWxldGUodXBkYXRlLnBhcmFtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMuY2xvbmVGcm9tID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgcmV0dXJuIEh0dHBQYXJhbXM7XG59KCkpO1xuXG4vKipcbiAqIEBmaW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iAgICAgICAgaWYgKHRoaXMuYm9keSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgLy8gRm9ybURhdGEgYm9kaWVzIHJlbHkgb24gdGhlIGJyb3dzZXIncyBjb250ZW50IHR5cGUgYXNzaWdubWVudC5cbiAgICAgICAgaWYgKGlzRm9ybURhdGEodGhpcy5ib2R5KSkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgLy8gQmxvYnMgdXN1YWxseSBoYXZlIHRoZWlyIG93biBjb250ZW50IHR5cGUuIElmIGl0IGRvZXNuJ3QsIHRoZW5cbiAgICAgICAgLy8gbm8gdHlwZSBjYW4gYmUgaW5mZXJyZWQuXG4gICAgICAgIGlmIChpc0Jsb2IodGhpcy5ib2R5KSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYm9keS50eXBlIHx8IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgLy8gQXJyYXkgYnVmZmVycyBoYXZlIHVua25vd24gY29udGVudHMgYW5kIHRodXMgbm8gdHlwZSBjYW4gYmUgaW5mZXJyZWQuXG4gICAgICAgIGlmIChpc0FycmF5QnVmZmVyKHRoaXMuYm9keSkpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIC8vIFRlY2huaWNhbGx5LCBzdHJpbmdzIGNvdWxkIGJlIGEgZm9ybSBvZiBKU09OIGRhdGEsIGJ1dCBpdCdzIHNhZmUgZW5vdWdoXG4gICAgICAgIC8vIHRvIGFzc3VtZSB0aGV5J3JlIHBsYWluIHN0cmluZ3MuXG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5ib2R5ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICd0ZXh0L3BsYWluJztcbiAgICAgICAgfVxuICAgICAgICAvLyBgSHR0cFVybEVuY29kZWRQYXJhbXNgIGhhcyBpdHMg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gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLyBJdCdzIGEgc3RyaW5nLCBzbyBpdCByZXByZXNlbnRzIGEgVVJMLiBDb25zdHJ1Y3QgYSByZXF1ZXN0IGJhc2VkIG9uIGl0LFxuICAgICAgICAgICAgLy8gYW5kIGluY29ycG9yYXRlIHRoZSByZW1haW5pbmcgYXJndW1lbnRzIChhc3N1bWluZyBHRVQgdW5sZXNzIGEgbWV0aG9kIGlzXG4gICAgICAgICAgICAvLyBwcm92aWRlZC5cbiAgICAgICAgICAgIC8vIEZpZ3VyZSBvdXQgdGhlIGhlYWRlcnMuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBoZWFkZXJzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuaGVhZGVycyBpbnN0YW5jZW9mIEh0dHBIZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IG9wdGlvbnMuaGVhZGVycztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBuZXcgSHR0cEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFNvcnQgb3V0IHBhcmFtZXRlcnMuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBwYXJhbXMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoISFvcHRpb25zLnBhcmFtcykge1xuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnBhcmFtcyBpbnN0YW5jZW9mIEh0dHBQYXJhbXMpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zID0gb3B0aW9ucy5wYXJhbXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMgPSBuZ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y8gVmFsaWRhdGUgdGhhdCB0aGUgYm9keSBpcyBhbiBBcnJheUJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLmJvZHkgIT09IG51bGwgJiYgIShyZXMuYm9keSBpbnN0YW5jZW9mIEFycmF5QnVmZmVyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1Jlc3BvbnNlIGlzIG5vdCBhbiBBcnJheUJ1ZmZlci4nKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5ib2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Jsb2InOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlcyQsIGZ1bmN0aW9uIChyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBWYWxpZGF0ZSB0aGF0IHRoZSBib2R5IGlzIGEgQmxvYi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLmJvZHkgIT09IG51bGwgJiYgIShyZXMuYm9keSBpbnN0YW5jZW9mIEJsb2IpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUmVzcG9uc2UgaXMgbm90IGEgQmxvYi4nKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5ib2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RleHQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlcyQsIGZ1bmN0aW9uIChyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBWYWxpZGF0ZSB0aGF0IHRoZSBib2R5IGlzIGEgc3RyaW5nLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMuYm9keSAhPT0gbnVsbCAmJiB0eXBlb2YgcmVzLmJvZHkgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUmVzcG9uc2UgaXMgbm90IGEgc3RyaW5nLicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzLmJvZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnanNvbic6XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBObyB2YWxpZGF0aW9uIG5lZWRlZCBmb3IgSlNPTiByZXNwb25zZXMsIGFzIHRoZXkgY2FuIGJlIG9mIGFueSB0eXBlLlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5jYWxsKHJlcyQsIGZ1bmN0aW9uIChyZXMpIHsgcmV0dXJuIHJlcy5ib2R5OyB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdyZXNwb25zZSc6XG4gICAgICAgICAgICAgICAgLy8gVGhlIHJlc3BvbnNlIHN0cmVhbSB3YXMgcmVxdWVzdGVkIGRpcmVjdGx5LCBzbyByZXR1cm4gaXQuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcyQ7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIC8vIEd1YXJkIGFnYWluc3QgbmV3IGZ1dHVyZSBvYnNlcnZlIHR5cGVzIGJlaW5nIGFkZGVkLlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlVucmVhY2hhYmxlOiB1bmhh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WFwW2NhbGxiYWNrXTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvLyBvbkxvYWQoKSBpcyB0aGUgc3VjY2VzcyBjYWxsYmFjayB3aGljaCBydW5zIGFmdGVyIHRoZSByZXNwb25zZSBjYWxsYmFja1xuICAgICAgICAgICAgLy8gaWYgdGhlIEpTT05QIHNjcmlwdCBsb2FkcyBzdWNjZXNzZnVsbHkuIFRoZSBldmVudCBpdHNlbGYgaXMgdW5pbXBvcnRhbnQuXG4gICAgICAgICAgICAvLyBJZiBzb21ldGhpbmcgd2VudCB3cm9uZywgb25Mb2FkKCkgbWF5IHJ1biB3aXRob3V0IHRoZSByZXNwb25zZSBjYWxsYmFja1xuICAgICAgICAgICAgLy8gaGF2aW5nIGJlZW4gaW52b2tlZC5cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9uTG9hZCA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIC8vIERvIG5vdGhpbmcgaWYgdGhlIHJlcXVlc3QgaGFzIGJlZW4gY2FuY2VsbGVkLlxuICAgICAgICAgICAgICAgIGlmIChjYW5jZWxsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDbGVhbnVwIHRoZSBwYWdlLlxuICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAvLyBDaGVjayB3aGV0aGVyIHRoZSByZXNwb25zZSBjYWxsYmFjayBoYXMgcnVuLlxuICAgICAgICAgICAgICAgIGlmICghZmluaXNoZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSXQgaGFzbid0LCBzb21ldGhpbmcgd2VudCB3cm9uZyB3aXRoIHRoZSByZXF1ZXN0LiBSZXR1cm4gYW4gZXJyb3IgdmlhXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBPYnNlcnZhYmxlIGVycm9yIHBhdGguIEFsbCBKU09OUCBlcnJvcnMgaGF2ZSBzdGF0dXMgMC5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IobmV3IEh0dHBFcnJvclJlc3BvbnNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogJ0pTT05QIEVycm9yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiBuZXcgRXJyb3IoSlNPTlBfRVJSX05PX0NBTExCQUNLKSxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFN1Y2Nlc3MuIGJvZHkgZWl0aGVyIGNvbnRhaW5zIHRoZSByZXNwb25zZSBib2R5IG9yIG51bGwgaWYgbm9uZSB3YXNcbiAgICAgICAgICAgICAgICAvLyByZXR1cm5lZC5cbiAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KG5ldyBIdHRwUmVzcG9uc2Uoe1xuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IDIwMCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogJ09LJywgdXJsOiB1cmwsXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIC8vIENvbXBsZXRlIHRoZSBzdHJlYW0sIHRoZSByZXNwb3NuZSBpcyBvdmVyLlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gb25FcnJvcigpIGlzIHRoZSBlcnJvciBjYWxsYmFjaywgd2hpY2ggcnVucyBpZiB0aGUgc2NyaXB0IHJldHVybmVkIGdlbmVyYXRlc1xuICAgICAgICAgICAgLy8gYSBKYXZhc2NyaXB0IGVycm9yLiBJdCBlbWl0cyB0aGUgZXJyb3IgdmlhIHRoZSBPYnNlcnZhYmxlIGVycm9yIGNoYW5uZWwgYXNcbiAgICAgICAgICAgIC8vIGEgSHR0cEVycm9yUmVzcG9uc2UuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvbkVycm9yID0gZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJlcXVlc3Qgd2FzIGFscmVhZHkgY2FuY2VsbGVkLCBubyBuZWVkIHRvIGVtaXQgYW55dGhpbmcuXG4gICAgICAgICAgICAgICAgaWYgKGNhbmNlbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAvLyBXcmFwIHRoZSBlcnJvciBpbiBhIEh0dHBFcnJvclJlc3BvbnNlLlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmVycm9yKG5ldyBIdHRwRXJyb3JSZXNwb25zZSh7XG4gICAgICAgICAgICAgICAgICAgIGVycm9yOiBlcnJvcixcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiAwLFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNUZXh0OiAnSlNPTlAgRXJyb3InLCB1cmw6IHVybCxcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gU3Vic2NyaWJlIHRvIGJvdGggdGhlIHN1Y2Nlc3MgKGxvYWQpIGFuZCBlcnJvciBldmVudHMgb24gdGhlIDxzY3JpcHQ+IHRhZyxcbiAgICAgICAgICAgIC8vIGFuZCBhZGQgaXQgdG8gdGhlIHBhZ2UuXG4gICAgICAgICAgICBub2RlLmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBvbkxvYWQpO1xuICAgICAgICA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VxLnVybFdpdGhQYXJhbXMpO1xuICAgICAgICAgICAgaWYgKCEhcmVxLndpdGhDcmVkZW50aWFscykge1xuICAgICAgICAgICAgICAgIHhoci53aXRoQ3JlZGVudGlhbHMgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQWRkIGFsbCB0aGUgcmVxdWVzdGVkIGhlYWRlcnMuXG4gICAgICAgICAgICByZXEuaGVhZGVycy5mb3JFYWNoKGZ1bmN0aW9uIChuYW1lLCB2YWx1ZXMpIHsgcmV0dXJuIHhoci5zZXRSZXF1ZXN0SGVhZGVyKG5hbWUsIHZhbHVlcy5qb2luKCcsJykpOyB9KTtcbiAgICAgICAgICAgIC8vIEFkZCBhbiBBY2NlcHQgaGVhZGVyIGlmIG9uZSBpc24ndCBwcmVzZW50IGFscmVhZHkuXG4gICAgICAgICAgICBpZiAoIXJlcS5oZWFkZXJzLmhhcygnQWNjZXB0JykpIHtcbiAgICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcignQWNjZXB0JywgJ2FwcGxpY2F0aW9uL2pzb24sIHRleHQvcGxhaW4sICovKicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQXV0by1kZXRlY3QgdGhlIENvbnRlbnQtVHlwZSBoZWFkZXIgaWYgb25lIGlzbid0IHByZXNlbnQgYWxyZWFkeS5cbiAgICAgICAgICAgIGlmICghcmVxLmhlYWRlcnMuaGFzKCdDb250ZW50LVR5cGUnKSkge1xuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGRldGVjdGVkVHlwZSA9IHJlcS5kZXRlY3RDb250ZW50VHlwZUhlYWRlcigpO1xuICAgICAgICAgICAgICAgIC8vIFNvbWV0aW1lcyBDb250ZW50LVR5cGUgZGV0ZWN0aW9uIGZhaWxzLlxuICAgICAgICAgICAgICAgIGlmIChkZXRlY3RlZFR5cGUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgeGhyLnNldF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gYmUgcGFyc2VkIGFzIHN1Y2guXG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gb2sgPSBzdGF0dXMgPj0gMjAwICYmIHN0YXR1cyA8IDMwMDtcbiAgICAgICAgICAgICAgICAvLyBDaGVjayB3aGV0aGVyIHRoZSBib2R5IG5lZWRzIHRvIGJlIHBhcnNlZCBhcyBKU09OIChpbiBtYW55IGNhc2VzIHRoZSBicm93c2VyXG4gICAgICAgICAgICAgICAgLy8gd2lsbCBoYXZlIGRvbmUgdGhhdCBhbHJlYWR5KS5cbiAgICAgICAgICAgICAgICBpZiAocmVxLnJlc3BvbnNlVHlwZSA9PT0gJ2pzb24nICYmIHR5cGVvZiBib2R5ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBTYXZlIHRoZSBvcmlnaW5hbCBib2R5LCBiZWZvcmUgYXR0ZW1wdGluZyBYU1NJIHByZWZpeCBzdHJpcHBpbmcuXG4gICAgICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9yaWdpbmFsQm9keSA9IGJvZHk7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBib2R5LnJlcGxhY2UoWFNTSV9QUkVGSVgsICcnKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF0dGVtcHQgdGhlIHBhcnNlLiBJZiBpdCBmYWlscywgYSBwYXJzZSBlcnJvciBzaG91bGQgYmUgZGVsaXZlcmVkIHRvIHRoZSB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IGJvZHkgIT09ICcnID8gSlNPTi5wYXJzZShib2R5KSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKC8qKiBAdHlwZSB7P30gKi8gZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbmNlIHRoZSBKU09OLnBhcnNlIGZhaWxlZCwgaXQncyByZWFzb25hYmxlIHRvIGFzc3VtZSB0aGlzIG1pZ2h0IG5vdCBoYXZlIGJlZW4gYVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSlNPTiByZXNwb25zZS4gUmVzdG9yZSB0aGUgb3JpZ2luYWwgYm9keSAoaW5jbHVkaW5nIGFueSBYU1NJIHByZWZpeCkgdG8gZGVsaXZlclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYSBiZXR0ZXIgZXJyb3IgcmVzcG9uc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gb3JpZ2luYWxCb2R5O1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyB3YXMgYW4gZXJyb3IgcmVxdWVzdCB0byBiZWdpbiB3aXRoLCBsZWF2ZSBpdCBhcyBhIHN0cmluZywgaXQgcHJvYmFibHlcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgaXNuJ3QgSlNPTi4gT3RoZXJ3aXNlLCBkZWxpdmVyIHRoZSBwYXJzaW5nIGVycm9yIHRvIHRoZSB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRXZlbiB0aG91Z2ggdGhlIHJlc3BvbnNlIHN0YXR1cyB3YXMgMnh4LCB0aGlzIGlzIHN0aWxsIGFuIGVycm9yLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHBhcnNlIGVycm9yIGNvbnRhaW5zIHRoZSB0ZXh0IG9mIHRoZSBib2R5IHRoYXQgZmFpbGVkIHRvIHBhcnNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAvKiogQHR5cGUgez99ICovICh7IGVycm9yOiBlcnJvciwgdGV4dDogYm9keSB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAob2spIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQSBzdWNjZXNzZnVsIHJlc3BvbnNlIGlzIGRlbGl2ZXJlZCBvbiB0aGUgZXZlbnQgc3RyZWFtLlxuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KG5ldyBIdHRwUmVzcG9uc2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHN0YXR1c1RleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGZ1bGwgYm9keSBoYXMgYmVlbiByZWNlaXZlZCBhbmQgZGVsaXZlcmVkLCBubyBmdXJ0aGVyIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICAvLyBhcmUgcG9zc2libGUuIFRoaXMgcmVxdWVzdCBpcyBjb21wbGV0ZS5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEFuIHVuc3VjY2Vzc2Z1bCByZXF1ZXN0IGlzIGRlbGl2ZXJlZCBvbiB0aGUgZXJyb3IgY2hhbm5lbC5cbiAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IobmV3IEh0dHBFcnJvclJlc3BvbnNlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBlcnJvciBpbiB0aGlzIGNhc2UgaXMgdGhlIHJlc3BvbnNlIGJvZHkgKGVycm9yIGZyb20gdGhlIHNlcnZlcikuXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogYm9keSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHN0YXR1c1RleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gVGhlIG9uRXJyb3IgY2FsbGJhY2sgaXMgY2FsbGVkIHdoZW4gc29tZXRoaW5nIGdvZXMgd3JvbmcgYXQgdGhlIG5ldHdvcmsgbGV2ZWwuXG4gICAgICAgICAgICAvLyBDb25uZWN0aW9uIHRpbWVvdXQsIEROUyBlcnJvciwgb2ZmbGluZSwgZXRjLiBUaGVzZSBhcmUgYWN0dWFsIGVycm9ycywgYW5kIGFyZVxuICAgICAgICAgICAgLy8gdHJhbnNtaXR0ZWQgb24gdGhlIGVycm9yIGNoYW5uZWwuXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvbkVycm9yID0gZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcmVzID0gbmV3IEh0dHBFcnJvclJlc3BvbnNlKHtcbiAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGVycm9yLFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHhoci5zdGF0dXMgfHwgMCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogeGhyLnN0YXR1c1RleHQgfHwgJ1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FkZXJzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gU3RhcnQgYnVpbGRpbmcgdGhlIGRvd25sb2FkIHByb2dyZXNzIGV2ZW50IHRvIGRlbGl2ZXIgb24gdGhlIHJlc3BvbnNlXG4gICAgICAgICAgICAgICAgLy8gZXZlbnQgc3RyZWFtLlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByb2dyZXNzRXZlbnQgPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IEh0dHBFdmVudFR5cGUuRG93bmxvYWRQcm9ncmVzcyxcbiAgICAgICAgICAgICAgICAgICAgbG9hZGVkOiBldmVudC5sb2FkZWQsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIHRvdGFsIG51bWJlciBvZiBieXRlcyBpbiB0aGUgZXZlbnQgaWYgaXQncyBhdmFpbGFibGUuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50Lmxlbmd0aENvbXB1dGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NFdmVudC50b3RhbCA9IGV2ZW50LnRvdGFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcmVxdWVzdCB3YXMgZm9yIHRleHQgY29udGVudCBhbmQgYSBwYXJ0aWFsIHJlc3BvbnNlIGlzXG4gICAgICAgICAgICAgICAgLy8gYXZhaWxhYmxlIG9uIFhNTEh0dHBSZXF1ZXN0LCBpbmNsdWRlIGl0IGluIHRoZSBwcm9ncmVzcyBldmVudFxuICAgICAgICAgICAgICAgIC8vIHRvIGFsbG93IGZvciBzdHJlYW1pbmcgcmVhZHMuXG4gICAgICAgICAgICAgICAgaWYgKHJlcS5yZXNwb25zZVR5cGUgPT09ICd0ZXh0JyAmJiAhIXhoci5yZXNwb25zZVRleHQpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NFdmVudC5wYXJ0aWFsVGV4dCA9IHhoci5yZXNwb25zZVRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIEZpbmFsbHksIGZpcmUgdGhlIGV2ZW50LlxuICAgICAgICAgICAgICAgIG9ic2VydmVyLm5leHQocHJvZ3Jlc3NFdmVudCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy8gVGhlIHVwbG9hZCBwcm9ncmVzcyBldmVudCBoYW5kbGVyLCB3aGljaCBpcyBvbmx5IHJlZ2lzdGVyZWQgaWZcbiAgICAgICAgICAgIC8vIHByb2dyZXNzIGV2ZW50cyBhcmUgZW5hYmxlZC5cbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG9uVXBQcm9ncmVzcyA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIC8vIFVwbG9hZCBwcm9ncmVzcyBldmVudHMgYXJlIHNpbXBsZXIuIEJlZ2luIGJ1aWxkaW5nIHRoZSBwcm9ncmVzc1xuICAgICAgICAgICAgICAgIC8vIGV2ZW50LlxuICAgICAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByb2dyZXNzID0ge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiBIdHRwRXZlbnRUeXBlLlVwbG9hZFByb2dyZXNzLFxuICAgICAgICAgICAgICAgICAgICBsb2FkZWQ6IGV2ZW50LmxvYWRlZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIElmIHRoZSB0b3RhbCBudW1iZXIgb2YgYnl0ZXMgYmVpbmcgdXBsb2FkZWQgaXMgYXZhaWxhYmxlLCBpbmNsdWRlXG4gICAgICAgICAgICAgICAgLy8gaXQuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50Lmxlbmd0aENvbXB1dGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3MudG90YWwgPSBldmVudC50b3RhbDtcb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cmVkLlxuICAgICAgICAgICAgeGhyLnNlbmQocmVxQm9keSk7XG4gICAgICAgICAgICBvYnNlcnZlci5uZXh0KHsgdHlwZTogSHR0cEV2ZW50VHlwZS5TZW50IH0pO1xuICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgcmV0dXJuIGZyb20gdGhlIE9ic2VydmFibGUgZnVuY3Rpb24sIHdoaWNoIGlzIHRoZVxuICAgICAgICAgICAgLy8gcmVxdWVzdCBjYW5jZWxsYXRpb24gaGFuZGxlci5cbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgLy8gT24gYSBjYW5jZWxsYXRpb24sIHJlbW92ZSBhbGwgcmVnaXN0ZXJlZCBldmVudCBsaXN0ZW5lcnMuXG4gICAgICAgICAgICAgICAgeGhyLnJlbW92ZUV2ZW50TGlzdGVuZXIoJ2Vycm9yJywgb25FcnJvcik7XG4gICAgICAgICAgICAgICAgeGhyLnJlbW92ZUV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBvbkxvYWQpO1xuICAgICAgICAgICAgICAgIGlmIChyZXEucmVwb3J0UHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgeGhyLnJlbW92ZUV2ZW50TGlzdGVuZXIoJ3Byb2dyZXNzJywgb25Eb3duUHJvZ3Jlc3MpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVxQm9keSAhPT0gbnVsbCAmJiB4aHIudXBsb2FkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB4aHIudXBsb2FkLnJlbW92ZUV2ZW50TGlzdGVuZXIoJ3Byb2dyZXNzJywgb25VcFByb2dyZXNzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBGaW5hbGx5LCBhYm9ydCB0aGUgaW4tZmxpZ2h0IHJlcXVlc3QuXG4gICAgICAgICAgICAgICAgeGhyLmFib3J0KCk7XG4gICAgICA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ICAgICAgb3B0aW9ucy5jb29raWVOYW1lID8geyBwcm92aWRlOiBYU1JGX0NPT0tJRV9OQU1FLCB1c2VWYWx1ZTogb3B0aW9ucy5jb29raWVOYW1lIH0gOiBbXSxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlck5hbWUgPyB7IHByb3ZpZGU6IFhTUkZfSEVBREVSX05BTUUsIHVzZVZhbHVlOiBvcHRpb25zLmhlYWRlck5hbWUgfSA6IFtdLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIEh0dHBDbGllbnRYc3JmTW9kdWxlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogTmdNb2R1bGUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgSHR0cFhzcmZJbnRlcmNlcHRvcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogSFRUUF9JTlRFUkNFUFRPUlMsIHVzZUV4aXN0aW5nOiBIdHRwWHNyZkludGVyY2VwdG9yLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIdHRwWHNyZlRva2VuRXh0cmFjdG9yLCB1c2VDbGFzczogSHR0cFhzcmZDb29raWVFeHRyYWN0b3IgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogWFNSRl9DT09LSUVfTkFNRSwgdXNlVmFsdWU6ICdYU1JGLVRPS0VOJyB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBYU1JGX0hFQURFUl9OQU1FLCB1c2VWYWx1ZTogJ1gtWFNSRi1UT0tFTicgfSxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LF0gfSxcbiAgICBdO1xuICAgIC8qKiBAbm9jb2xsYXBzZSAqL1xuICAgIEh0dHBDbGllbnRYc3JmTW9kdWxlLmN0b3JQYXJhbWV0ZXJzID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gW107IH07XG4gICAgcmV0dXJuIEh0dHBDbGllbnRYc3JmTW9kdWxlO1xufSgpKTtcbi8qKlxuICogYE5nTW9kdWxlYCB3aGljaCBwcm92aWRlcyB0aGUgYEh0dHBDbGllbnRgIGFuZCBhc3NvY2lhdGVkIHNlcnZpY2VzLlxuICpcbiAqIEludGVyY2VwdG9ycyBjYW4gYmUgYWRkZWQgdG8gdGhlIGNoYWluIGJlaGluZCBgSHR0cENsaWVudGAgYnkgYmluZGluZyB0aGVtXG4gKiB0byB0aGUgbXVsdGlwcm92aWRlciBmb3IgYEhUVFBfSU5URVJDRVBUT1JTYC5cbiAqXG4gKiBcXEBzdGFibGVcbiAqL1xudmFyIEh0dHBDbGllbnRNb2R1bGUgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gSHR0cENsaWVudE1vZHVsZSgpIHtcbiAgICB9XG4gICAgSHR0cENsaWVudE1vZHVsZS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IE5nTW9kdWxlLCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBpbXBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50WHNyZk1vZHVsZS53aXRoT3B0aW9ucyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llTmFtZTogJ1hTUkYtVE9LRU4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlck5hbWU6ICdYLVhTUkYtVE9LRU4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEh0dHBIYW5kbGVyIGlzIHRoZSBiYWNrZW5kICsgaW50ZXJjZXB0b3JzIGFuZCBpcyBjb25zdHJ1Y3RlZFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNpbmcgdGhlIGludGVyY2VwdGluZ0hhbmRsZXIgZmFjdG9yeSBmdW5jdGlvbi5cbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBIdHRwSGFuZGxlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBpbnRlcmNlcHRpbmdIYW5kbGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHM6IFtIdHRwQmFja2VuZCwgW25ldyBPcHRpb25hbCgpLCBuZXcgSW5qZWN0KEhUVFBfSU5URVJDRVBUT1JTKV1dLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBYaHJCYWNrZW5kLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBIdHRwQmFja2VuZCwgdXNlRXhpc3Rpbmc6IEh0dHBYaHJCYWNrZW5kIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyWGhyLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBYaHJGYWN0b3J5LCB1c2VFeGlzdGluZzogQnJvd3NlclhociB9LFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgSHR0cENsaWVudE1vZHVsZS5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtdOyB9O1xuICAgIHJldHVybiBIdHRwQ2xpZW50TW9kdWxlO1xufSgpKTtcbi8qKlxuICogYE5nTW9kdWxlYCB3aGljaCBlbmFibGVzIEpTT05QIHN1cHBvcnQgaW4gYEh0dHBDbGllbnRgLlxuICpcbiAqIFdpdGhvdXQgdGhpcyBtb2R1bGUsIEpzb25wIHJlcXVlc3RzIHdpbGwgcmVhY2ggdGhlIGJhY2tlbmRcbiAqIHdpdGggbWV0aG9kIEpTT05QLCB3aGVyZSB0aGV5J2xsIGJlIHJlamVjdGVkLlxuICpcbiAqIFxcQHN0YWJsZVxuICovXG52YXIgSHR0cENsaWVudEpzb25wTW9kdWxlID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIEh0dHBDbGllbnRKc29ucE1vZHVsZSgpIHtcbiAgICB9XG4gICAgSHR0cENsaWVudEpzb25wTW9kdWxlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogTmdNb2R1bGUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgSnNvbnBDbGllbnRCYWNrZW5kLFxuICAgICAgICAgICAgICAgICAgICAgICAgeyBwcm92aWRlOiBKc29ucENhbGxiYWNrQ29udGV4dCwgdXNlRmFjdG9yeToganNvbnBDYWxsYmFja0NvbnRleHQgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJvdmlkZTogSFRUUF9JTlRFUkNFUFRPUlMsIHVzZUNsYXNzOiBKc29ucEludGVyY2VwdG9yLCBtdWx0aTogdHJ1ZSB9LFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgSHR0cENsaWVudEpzb25wTW9kdWxlLmN0b3JQYXJhbWV0ZXJzID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gW107IH07XG4gICAgcmV0dXJuIEh0dHBDbGllbnRKc29ucE1vZHVsZTtcbn0oKSk7XG5cbi8qKlxuICogQGZpbGVvdmVydmlldyBhZGRlZCBieSB0c2lja2x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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n"); /***/ }), /* 99 */ @@ -449,14 +449,14 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__datepicker_service__ = __webpack_require__(171);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__ = __webpack_require__(538);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__ = __webpack_require__(265);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_config__ = __webpack_require__(172);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__datepicker_tools__ = __webpack_require__(264);\n\n\n\n\n\n\n\n\n\n\n\n\nvar NGB_DATEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbDatepicker; }),\n multi: true\n};\n/**\n * A lightweight and highly configurable datepicker directive\n */\nvar NgbDatepicker = (function () {\n function NgbDatepicker(_keyMapService, _service, _calendar, i18n, config, _cd, _elementRef, _ngbDateAdapter) {\n var _this = this;\n this._keyMapService = _keyMapService;\n this._service = _service;\n this._calendar = _calendar;\n this.i18n = i18n;\n this._cd = _cd;\n this._elementRef = _elementRef;\n this._ngbDateAdapter = _ngbDateAdapter;\n /**\n * An event fired when navigation happens and currently displayed month changes.\n * See NgbDatepickerNavigateEvent for the payload info.\n */\n this.navigate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when user selects a date using keyboard or mouse.\n * The payload of the event is currently selected NgbDateStruct.\n */\n this.select = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.dayTemplate = config.dayTemplate;\n this.displayMonths = config.displayMonths;\n this.firstDayOfWeek = config.firstDayOfWeek;\n this.markDisabled = config.markDisabled;\n this.minDate = config.minDate;\n this.maxDate = config.maxDate;\n this.navigation = config.navigation;\n this.outsideDays = config.outsideDays;\n this.showWeekdays = config.showWeekdays;\n this.showWeekNumbers = config.showWeekNumbers;\n this.startDate = config.startDate;\n this._selectSubscription = _service.select$.subscribe(function (date) { _this.select.emit(date.toStruct()); });\n this._subscription = _service.model$.subscribe(function (model) {\n var newDate = model.firstDate;\n var oldDate = _this.model ? _this.model.firstDate : null;\n var newSelectedDate = model.selectedDate;\n var oldSelectedDate = _this.model ? _this.model.selectedDate : null;\n _this.model = model;\n // handling selection change\n if (Object(__WEBPACK_IMPORTED_MODULE_11__datepicker_tools__[\"d\" /* isChangedDate */])(newSelectedDate, oldSelectedDate)) {\n _this.onTouched();\n _this.onChange(_this._ngbDateAdapter.toModel(newSelectedDate));\n }\n // emitting navigation event if the first month changes\n if (!newDate.equals(oldDate)) {\n _this.navigate.emit({\n current: oldDate ? { year: oldDate.year, month: oldDate.month } : null,\n next: { year: newDate.year, month: newDate.month }\n });\n }\n _cd.markForCheck();\n });\n }\n /**\n * Manually focus the datepicker\n */\n /**\n * Manually focus the datepicker\n */\n NgbDatepicker.prototype.focus = /**\n * Manually focus the datepicker\n */\n function () { this._elementRef.nativeElement.focus(); };\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n NgbDatepicker.prototype.navigateTo = /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n function (date) {\n this._service.open(date ? new __WEBPACK_IMPORTED_MODULE_3__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, 1) : this._calendar.getToday());\n };\n NgbDatepicker.prototype.ngOnDestroy = function () {\n this._subscription.unsubscribe();\n this._selectSubscription.unsubscribe();\n };\n NgbDatepicker.prototype.ngOnInit = function () {\n if (this.model === undefined) {\n this._service.displayMonths = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__[\"h\" /* toInteger */])(this.displayMonths);\n this._service.markDisabled = this.markDisabled;\n this._service.firstDayOfWeek = this.firstDayOfWeek;\n this._service.navigation = this.navigation;\n this._setDates();\n }\n };\n NgbDatepicker.prototype.ngOnChanges = function (changes) {\n if (changes['displayMonths']) {\n this._service.displayMonths = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__[\"h\" /* toInteger */])(this.displayMonths);\n }\n if (changes['markDisabled']) {\n this._service.markDisabled = this.markDisabled;\n }\n if (changes['firstDayOfWeek']) {\n this._service.firstDayOfWeek = this.firstDayOfWeek;\n }\n if (changes['navigation']) {\n this._service.navigation = this.navigation;\n }\n this._setDates();\n };\n NgbDatepicker.prototype.onDateSelect = function (date) {\n this._service.focus(date);\n this._service.select(date, { emitEvent: true });\n };\n NgbDatepicker.prototype.onKeyDown = function (event) { this._keyMapService.processKey(event); };\n NgbDatepicker.prototype.onNavigateDateSelect = function (date) { this._service.open(date); };\n NgbDatepicker.prototype.onNavigateEvent = function (event) {\n switch (event) {\n case __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__[\"a\" /* NavigationEvent */].PREV:\n this._service.open(this._calendar.getPrev(this.model.firstDate, 'm', 1));\n break;\n case __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__[\"a\" /* NavigationEvent */].NEXT:\n this._service.open(this._calendar.getNext(this.model.firstDate, 'm', 1));\n break;\n }\n };\n NgbDatepicker.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbDatepicker.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbDatepicker.prototype.setDisabledState = function (isDisabled) { this._service.disabled = isDisabled; };\n NgbDatepicker.prototype.showFocus = function (focusVisible) { this._service.focusVisible = focusVisible; };\n NgbDatepicker.prototype.writeValue = function (value) { this._service.select(__WEBPACK_IMPORTED_MODULE_3__ngb_date__[\"a\" /* NgbDate */].from(this._ngbDateAdapter.fromModel(value))); };\n NgbDatepicker.prototype._setDates = function () {\n var startDate = this._service.toValidDate(this.startDate, this._calendar.getToday());\n var minDate = this._service.toValidDate(this.minDate, this._calendar.getPrev(startDate, 'y', 10));\n var maxDate = this._service.toValidDate(this.maxDate, this._calendar.getPrev(this._calendar.getNext(startDate, 'y', 11)));\n this.minDate = { year: minDate.year, month: minDate.month, day: minDate.day };\n this.maxDate = { year: maxDate.year, month: maxDate.month, day: maxDate.day };\n this._service.minDate = minDate;\n this._service.maxDate = maxDate;\n this.navigateTo(startDate);\n };\n NgbDatepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n exportAs: 'ngbDatepicker',\n selector: 'ngb-datepicker',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: {\n 'tabindex': '0',\n '[attr.tabindex]': 'model.disabled ? undefined : \"0\"',\n '(blur)': 'showFocus(false)',\n '(focus)': 'showFocus(true)',\n '(keydown)': 'onKeyDown($event)'\n },\n styles: [\"\\n :host {\\n border: 1px solid rgba(0, 0, 0, 0.125);\\n border-radius: 0.25rem;\\n display: inline-block;\\n }\\n .ngb-dp-month {\\n pointer-events: none;\\n }\\n .ngb-dp-header {\\n border-bottom: 0px;\\n border-radius: .25rem 0.25rem 0rem 0rem;\\n padding-top: 0.25rem;\\n }\\n ngb-datepicker-month-view {\\n pointer-events: auto;\\n }\\n .ngb-dp-month-name {\\n font-size: larger;\\n height: 2rem;\\n line-height: 2rem;\\n text-align: center;\\n }\\n /deep/ .ngb-dp-month + .ngb-dp-month > ngb-datepicker-month-view > .ngb-dp-week {\\n padding-left: 1rem;\\n }\\n /deep/ .ngb-dp-month + .ngb-dp-month > .ngb-dp-month-name {\\n padding-left: 1rem;\\n }\\n /deep/ .ngb-dp-month:last-child .ngb-dp-week {\\n padding-right: .25rem;\\n }\\n /deep/ .ngb-dp-month:first-child .ngb-dp-week {\\n padding-left: .25rem;\\n }\\n /deep/ .ngb-dp-month > ngb-datepicker-month-view > .ngb-dp-week:last-child {\\n padding-bottom: .25rem;\\n }\\n .ngb-dp-months {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n }\\n \"],\n template: \"\\n <ng-template #dt let-date=\\\"date\\\" let-currentMonth=\\\"currentMonth\\\" let-selected=\\\"selected\\\" let-disabled=\\\"disabled\\\" let-focused=\\\"focused\\\">\\n <div ngbDatepickerDayView\\n [date]=\\\"date\\\"\\n [currentMonth]=\\\"currentMonth\\\"\\n [selected]=\\\"selected\\\"\\n [disabled]=\\\"disabled\\\"\\n [focused]=\\\"focused\\\">\\n </div>\\n </ng-template>\\n\\n <div class=\\\"ngb-dp-header bg-light\\\">\\n <ngb-datepicker-navigation *ngIf=\\\"navigation !== 'none'\\\"\\n [date]=\\\"model.firstDate\\\"\\n [minDate]=\\\"model.minDate\\\"\\n [maxDate]=\\\"model.maxDate\\\"\\n [months]=\\\"model.months\\\"\\n [disabled]=\\\"model.disabled\\\"\\n [showWeekNumbers]=\\\"showWeekNumbers\\\"\\n [showSelect]=\\\"model.navigation === 'select'\\\"\\n (navigate)=\\\"onNavigateEvent($event)\\\"\\n (select)=\\\"onNavigateDateSelect($event)\\\">\\n </ngb-datepicker-navigation>\\n </div>\\n\\n <div class=\\\"ngb-dp-months\\\">\\n <ng-template ngFor let-month [ngForOf]=\\\"model.months\\\" let-i=\\\"index\\\">\\n <div class=\\\"ngb-dp-month d-block\\\">\\n <div *ngIf=\\\"navigation === 'none' || (displayMonths > 1 && navigation === 'select')\\\"\\n class=\\\"ngb-dp-month-name bg-light\\\">\\n {{ i18n.getMonthFullName(month.number) }} {{ month.year }}\\n </div>\\n <ngb-datepicker-month-view\\n [month]=\\\"month\\\"\\n [dayTemplate]=\\\"dayTemplate || dt\\\"\\n [showWeekdays]=\\\"showWeekdays\\\"\\n [showWeekNumbers]=\\\"showWeekNumbers\\\"\\n [outsideDays]=\\\"(displayMonths === 1 ? outsideDays : 'hidden')\\\"\\n (select)=\\\"onDateSelect($event)\\\">\\n </ngb-datepicker-month-view>\\n </div>\\n </ng-template>\\n </div>\\n \",\n providers: [NGB_DATEPICKER_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_4__datepicker_service__[\"a\" /* NgbDatepickerService */], __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__[\"a\" /* NgbDatepickerKeyMapService */]]\n },] },\n ];\n /** @nocollapse */\n NgbDatepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__[\"a\" /* NgbDatepickerKeyMapService */], },\n { type: __WEBPACK_IMPORTED_MODULE_4__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__[\"a\" /* NgbCalendar */], },\n { type: __WEBPACK_IMPORTED_MODULE_10__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], },\n { type: __WEBPACK_IMPORTED_MODULE_8__datepicker_config__[\"a\" /* NgbDatepickerConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_9__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], },\n ]; };\n NgbDatepicker.propDecorators = {\n \"dayTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"displayMonths\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"firstDayOfWeek\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"markDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigation\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"outsideDays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekdays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekNumbers\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"startDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"select\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbDatepicker;\n}());\n\n//# sourceMappingURL=datepicker.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5qcz9mY2ExIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENoYW5nZURldGVjdGlvblN0cmF0ZWd5LCBDaGFuZ2VEZXRlY3RvclJlZiwgQ29tcG9uZW50LCBJbnB1dCwgVGVtcGxhdGVSZWYsIGZvcndhcmRSZWYsIEV2ZW50RW1pdHRlciwgT3V0cHV0LCBFbGVtZW50UmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBOR19WQUxVRV9BQ0NFU1NPUiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IE5nYkNhbGVuZGFyIH0gZnJvbSAnLi9uZ2ItY2FsZW5kYXInO1xuaW1wb3J0IHsgTmdiRGF0ZSB9IGZyb20gJy4vbmdiLWRhdGUnO1xuaW1wb3J0IHsgTmdiRGF0ZXBpY2tlclNlcnZpY2UgfSBm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vZGVsID8gX3RoaXMubW9kZWwuZmlyc3REYXRlIDogbnVsbDtcbiAgICAgICAgICAgIHZhciBuZXdTZWxlY3RlZERhdGUgPSBtb2RlbC5zZWxlY3RlZERhdGU7XG4gICAgICAgICAgICB2YXIgb2xkU2VsZWN0ZWREYXRlID0gX3RoaXMubW9kZWwgPyBfdGhpcy5tb2RlbC5zZWxlY3RlZERhdGUgOiBudWxsO1xuICAgICAgICAgICAgX3RoaXMubW9kZWwgPSBtb2RlbDtcbiAgICAgICAgICAgIC8vIGhhbmRsaW5nIHNlbGVjdGlvbiBjaGFuZ2VcbiAgICAgICAgICAgIGlmIChpc0NoYW5nZWREYXRlKG5ld1NlbGVjdGVkRGF0ZSwgb2xkU2VsZWN0ZWREYXRlKSkge1xuICAgICAgICAgICAgICAgIF90aGlzLm9uVG91Y2hlZCgpO1xuICAgICAgICAgICAgICAgIF90aGlzLm9uQ2hhbmdlKF90aGlzLl9uZ2JEYXRlQWRhcHRlci50b01vZGVsKG5ld1NlbGVjdGVkRGF0ZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gZW1pdHRpbmcgbmF2aWdhdGlvbiBldmVudCBpZiB0aGUgZmlyc3QgbW9udGggY2hhbmdlc1xuICAgICAgICAgICAgaWYgKCFuZXdEYXRlLmVxdWFscyhvbGREYXRlKSkge1xuICAgICAgICAgICAgICAgIF90aGlzLm5hdmlnYXRlLmVtaXQoe1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50OiBvbGREYXRlID8geyB5ZWFyOiBvbGREYXRlLnllYXIsIG1vbnRoOiBvbGREYXRlLm1vbnRoIH0gOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBuZXh0OiB7IHllYXI6IG5ld0RhdGUueWVhciwgbW9udGg6IG5ld0RhdGUubW9udGggfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX2NkLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICB9KTtcbiAg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dGUsICd5JywgMTEpKSk7XG4gICAgICAgIHRoaXMubWluRGF0ZSA9IHsgeWVhcjogbWluRGF0ZS55ZWFyLCBtb250aDogbWluRGF0ZS5tb250aCwgZGF5OiBtaW5EYXRlLmRheSB9O1xuICAgICAgICB0aGlzLm1heERhdGUgPSB7IHllYXI6IG1heERhdGUueWVhciwgbW9udGg6IG1heERhdGUubW9udGgsIGRheTogbWF4RGF0ZS5kYXkgfTtcbiAgICAgICAgdGhpcy5fc2VydmljZS5taW5EYXRlID0gbWluRGF0ZTtcbiAgICAgICAgdGhpcy5fc2VydmljZS5tYXhEYXRlID0gbWF4RGF0ZTtcbiAgICAgICAgdGhpcy5uYXZpZ2F0ZVRvKHN0YXJ0RGF0ZSk7XG4gICAgfTtcbiAgICBOZ2JEYXRlcGlja2VyLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogQ29tcG9uZW50LCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBleHBvcnRBczogJ25nYkRhdGVwaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcjogJ25nYi1kYXRlcGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXG4gICAgICAgICAgICAgICAgICAgIGhvc3Q6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWJpbmRleCc6ICcwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdbYXR0ci50YWJpbmRleF0nOiAnbW9kZWwuZGlzYWJsZWQgPyB1bmRlZmluZWQgOiBcIjBcIicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGJsdXIpJzogJ3Nob3dGb2N1cyhmYWxzZSknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJyhmb2N1cyknOiAnc2hvd0ZvY3VzKHRydWUpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoa2V5ZG93biknOiA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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///170\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__datepicker_service__ = __webpack_require__(171);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__ = __webpack_require__(538);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__ = __webpack_require__(265);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_config__ = __webpack_require__(172);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__datepicker_tools__ = __webpack_require__(264);\n\n\n\n\n\n\n\n\n\n\n\n\nvar NGB_DATEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbDatepicker; }),\n multi: true\n};\n/**\n * A lightweight and highly configurable datepicker directive\n */\nvar NgbDatepicker = (function () {\n function NgbDatepicker(_keyMapService, _service, _calendar, i18n, config, _cd, _elementRef, _ngbDateAdapter) {\n var _this = this;\n this._keyMapService = _keyMapService;\n this._service = _service;\n this._calendar = _calendar;\n this.i18n = i18n;\n this._cd = _cd;\n this._elementRef = _elementRef;\n this._ngbDateAdapter = _ngbDateAdapter;\n /**\n * An event fired when navigation happens and currently displayed month changes.\n * See NgbDatepickerNavigateEvent for the payload info.\n */\n this.navigate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when user selects a date using keyboard or mouse.\n * The payload of the event is currently selected NgbDateStruct.\n */\n this.select = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.dayTemplate = config.dayTemplate;\n this.displayMonths = config.displayMonths;\n this.firstDayOfWeek = config.firstDayOfWeek;\n this.markDisabled = config.markDisabled;\n this.minDate = config.minDate;\n this.maxDate = config.maxDate;\n this.navigation = config.navigation;\n this.outsideDays = config.outsideDays;\n this.showWeekdays = config.showWeekdays;\n this.showWeekNumbers = config.showWeekNumbers;\n this.startDate = config.startDate;\n this._selectSubscription = _service.select$.subscribe(function (date) { _this.select.emit(date.toStruct()); });\n this._subscription = _service.model$.subscribe(function (model) {\n var newDate = model.firstDate;\n var oldDate = _this.model ? _this.model.firstDate : null;\n var newSelectedDate = model.selectedDate;\n var oldSelectedDate = _this.model ? _this.model.selectedDate : null;\n _this.model = model;\n // handling selection change\n if (Object(__WEBPACK_IMPORTED_MODULE_11__datepicker_tools__[\"d\" /* isChangedDate */])(newSelectedDate, oldSelectedDate)) {\n _this.onTouched();\n _this.onChange(_this._ngbDateAdapter.toModel(newSelectedDate));\n }\n // emitting navigation event if the first month changes\n if (!newDate.equals(oldDate)) {\n _this.navigate.emit({\n current: oldDate ? { year: oldDate.year, month: oldDate.month } : null,\n next: { year: newDate.year, month: newDate.month }\n });\n }\n _cd.markForCheck();\n });\n }\n /**\n * Manually focus the datepicker\n */\n /**\n * Manually focus the datepicker\n */\n NgbDatepicker.prototype.focus = /**\n * Manually focus the datepicker\n */\n function () { this._elementRef.nativeElement.focus(); };\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n NgbDatepicker.prototype.navigateTo = /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n function (date) {\n this._service.open(date ? new __WEBPACK_IMPORTED_MODULE_3__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, 1) : this._calendar.getToday());\n };\n NgbDatepicker.prototype.ngOnDestroy = function () {\n this._subscription.unsubscribe();\n this._selectSubscription.unsubscribe();\n };\n NgbDatepicker.prototype.ngOnInit = function () {\n if (this.model === undefined) {\n this._service.displayMonths = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__[\"h\" /* toInteger */])(this.displayMonths);\n this._service.markDisabled = this.markDisabled;\n this._service.firstDayOfWeek = this.firstDayOfWeek;\n this._service.navigation = this.navigation;\n this._setDates();\n }\n };\n NgbDatepicker.prototype.ngOnChanges = function (changes) {\n if (changes['displayMonths']) {\n this._service.displayMonths = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__[\"h\" /* toInteger */])(this.displayMonths);\n }\n if (changes['markDisabled']) {\n this._service.markDisabled = this.markDisabled;\n }\n if (changes['firstDayOfWeek']) {\n this._service.firstDayOfWeek = this.firstDayOfWeek;\n }\n if (changes['navigation']) {\n this._service.navigation = this.navigation;\n }\n this._setDates();\n };\n NgbDatepicker.prototype.onDateSelect = function (date) {\n this._service.focus(date);\n this._service.select(date, { emitEvent: true });\n };\n NgbDatepicker.prototype.onKeyDown = function (event) { this._keyMapService.processKey(event); };\n NgbDatepicker.prototype.onNavigateDateSelect = function (date) { this._service.open(date); };\n NgbDatepicker.prototype.onNavigateEvent = function (event) {\n switch (event) {\n case __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__[\"a\" /* NavigationEvent */].PREV:\n this._service.open(this._calendar.getPrev(this.model.firstDate, 'm', 1));\n break;\n case __WEBPACK_IMPORTED_MODULE_6__datepicker_view_model__[\"a\" /* NavigationEvent */].NEXT:\n this._service.open(this._calendar.getNext(this.model.firstDate, 'm', 1));\n break;\n }\n };\n NgbDatepicker.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbDatepicker.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbDatepicker.prototype.setDisabledState = function (isDisabled) { this._service.disabled = isDisabled; };\n NgbDatepicker.prototype.showFocus = function (focusVisible) { this._service.focusVisible = focusVisible; };\n NgbDatepicker.prototype.writeValue = function (value) { this._service.select(__WEBPACK_IMPORTED_MODULE_3__ngb_date__[\"a\" /* NgbDate */].from(this._ngbDateAdapter.fromModel(value))); };\n NgbDatepicker.prototype._setDates = function () {\n var startDate = this._service.toValidDate(this.startDate, this._calendar.getToday());\n var minDate = this._service.toValidDate(this.minDate, this._calendar.getPrev(startDate, 'y', 10));\n var maxDate = this._service.toValidDate(this.maxDate, this._calendar.getPrev(this._calendar.getNext(startDate, 'y', 11)));\n this.minDate = { year: minDate.year, month: minDate.month, day: minDate.day };\n this.maxDate = { year: maxDate.year, month: maxDate.month, day: maxDate.day };\n this._service.minDate = minDate;\n this._service.maxDate = maxDate;\n this.navigateTo(startDate);\n };\n NgbDatepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n exportAs: 'ngbDatepicker',\n selector: 'ngb-datepicker',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: {\n 'tabindex': '0',\n '[attr.tabindex]': 'model.disabled ? undefined : \"0\"',\n '(blur)': 'showFocus(false)',\n '(focus)': 'showFocus(true)',\n '(keydown)': 'onKeyDown($event)'\n },\n styles: [\"\\n :host {\\n border: 1px solid rgba(0, 0, 0, 0.125);\\n border-radius: 0.25rem;\\n display: inline-block;\\n }\\n .ngb-dp-month {\\n pointer-events: none;\\n }\\n .ngb-dp-header {\\n border-bottom: 0px;\\n border-radius: .25rem 0.25rem 0rem 0rem;\\n padding-top: 0.25rem;\\n }\\n ngb-datepicker-month-view {\\n pointer-events: auto;\\n }\\n .ngb-dp-month-name {\\n font-size: larger;\\n height: 2rem;\\n line-height: 2rem;\\n text-align: center;\\n }\\n /deep/ .ngb-dp-month + .ngb-dp-month > ngb-datepicker-month-view > .ngb-dp-week {\\n padding-left: 1rem;\\n }\\n /deep/ .ngb-dp-month + .ngb-dp-month > .ngb-dp-month-name {\\n padding-left: 1rem;\\n }\\n /deep/ .ngb-dp-month:last-child .ngb-dp-week {\\n padding-right: .25rem;\\n }\\n /deep/ .ngb-dp-month:first-child .ngb-dp-week {\\n padding-left: .25rem;\\n }\\n /deep/ .ngb-dp-month > ngb-datepicker-month-view > .ngb-dp-week:last-child {\\n padding-bottom: .25rem;\\n }\\n .ngb-dp-months {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n }\\n \"],\n template: \"\\n <ng-template #dt let-date=\\\"date\\\" let-currentMonth=\\\"currentMonth\\\" let-selected=\\\"selected\\\" let-disabled=\\\"disabled\\\" let-focused=\\\"focused\\\">\\n <div ngbDatepickerDayView\\n [date]=\\\"date\\\"\\n [currentMonth]=\\\"currentMonth\\\"\\n [selected]=\\\"selected\\\"\\n [disabled]=\\\"disabled\\\"\\n [focused]=\\\"focused\\\">\\n </div>\\n </ng-template>\\n\\n <div class=\\\"ngb-dp-header bg-light\\\">\\n <ngb-datepicker-navigation *ngIf=\\\"navigation !== 'none'\\\"\\n [date]=\\\"model.firstDate\\\"\\n [minDate]=\\\"model.minDate\\\"\\n [maxDate]=\\\"model.maxDate\\\"\\n [months]=\\\"model.months\\\"\\n [disabled]=\\\"model.disabled\\\"\\n [showWeekNumbers]=\\\"showWeekNumbers\\\"\\n [showSelect]=\\\"model.navigation === 'select'\\\"\\n (navigate)=\\\"onNavigateEvent($event)\\\"\\n (select)=\\\"onNavigateDateSelect($event)\\\">\\n </ngb-datepicker-navigation>\\n </div>\\n\\n <div class=\\\"ngb-dp-months\\\">\\n <ng-template ngFor let-month [ngForOf]=\\\"model.months\\\" let-i=\\\"index\\\">\\n <div class=\\\"ngb-dp-month d-block\\\">\\n <div *ngIf=\\\"navigation === 'none' || (displayMonths > 1 && navigation === 'select')\\\"\\n class=\\\"ngb-dp-month-name bg-light\\\">\\n {{ i18n.getMonthFullName(month.number) }} {{ month.year }}\\n </div>\\n <ngb-datepicker-month-view\\n [month]=\\\"month\\\"\\n [dayTemplate]=\\\"dayTemplate || dt\\\"\\n [showWeekdays]=\\\"showWeekdays\\\"\\n [showWeekNumbers]=\\\"showWeekNumbers\\\"\\n [outsideDays]=\\\"(displayMonths === 1 ? outsideDays : 'hidden')\\\"\\n (select)=\\\"onDateSelect($event)\\\">\\n </ngb-datepicker-month-view>\\n </div>\\n </ng-template>\\n </div>\\n \",\n providers: [NGB_DATEPICKER_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_4__datepicker_service__[\"a\" /* NgbDatepickerService */], __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__[\"a\" /* NgbDatepickerKeyMapService */]]\n },] },\n ];\n /** @nocollapse */\n NgbDatepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_5__datepicker_keymap_service__[\"a\" /* NgbDatepickerKeyMapService */], },\n { type: __WEBPACK_IMPORTED_MODULE_4__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__[\"a\" /* NgbCalendar */], },\n { type: __WEBPACK_IMPORTED_MODULE_10__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], },\n { type: __WEBPACK_IMPORTED_MODULE_8__datepicker_config__[\"a\" /* NgbDatepickerConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_9__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], },\n ]; };\n NgbDatepicker.propDecorators = {\n \"dayTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"displayMonths\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"firstDayOfWeek\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"markDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigation\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"outsideDays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekdays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekNumbers\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"startDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"select\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbDatepicker;\n}());\n\n//# sourceMappingURL=datepicker.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5qcz9mY2ExIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENoYW5nZURldGVjdGlvblN0cmF0ZWd5LCBDaGFuZ2VEZXRlY3RvclJlZiwgQ29tcG9uZW50LCBJbnB1dCwgVGVtcGxhdGVSZWYsIGZvcndhcmRSZWYsIEV2ZW50RW1pdHRlciwgT3V0cHV0LCBFbGVtZW50UmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBOR19WQUxVRV9BQ0NFU1NPUiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IE5nYkNhbGVuZGFyIH0gZnJvbSAnLi9uZ2ItY2FsZW5kYXInO1xuaW1wb3J0IHsgTmdiRGF0ZSB9IGZyb20gJy4vbmdiLWRhdGUnO1xuaW1wb3J0IHsgTmdiRGF0ZXBpY2tlclNlcnZpY2UgfSBmcm9tICcuL2RhdGVwaWNrZXItc2VydmljZSc7XG5pbXBvcnQgeyBOZ2JEYXRlcGlja2VyS2V5TWFwU2VydmljZSB9IGZyb20gJy4vZGF0ZXBpY2tlci1rZXltYXAtc2VydmljZSc7XG5pbXBvcnQgeyBOYXZpZ2F0aW9uRXZlbnQgfSBmcm9tICcuL2RhdGVwaWNrZXItdmlldy1tb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ZERhdGUgOiBudWxsO1xuICAgICAgICAgICAgX3RoaXMubW9kZWwgPSBtb2RlbDtcbiAgICAgICAgICAgIC8vIGhhbmRsaW5nIHNlbGVjdGlvbiBjaGFuZ2VcbiAgICAgICAgICAgIGlmIChpc0NoYW5nZWREYXRlKG5ld1NlbGVjdGVkRGF0ZSwgb2xkU2VsZWN0ZWREYXRlKSkge1xuICAgICAgICAgICAgICAgIF90aGlzLm9uVG91Y2hlZCgpO1xuICAgICAgICAgICAgICAgIF90aGlzLm9uQ2hhbmdlKF90aGlzLl9uZ2JEYXRlQWRhcHRlci50b01vZGVsKG5ld1NlbGVjdGVkRGF0ZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gZW1pdHRpbmcgbmF2aWdhdGlvbiBldmVudCBpZiB0aGUgZmlyc3QgbW9udGggY2hhbmdlc1xuICAgICAgICAgICAgaWYgKCFuZXdEYXRlLmVxdWFscyhvbGREYXRlKSkge1xuICAgICAgICAgICAgICAgIF90aGlzLm5hdmlnYXRlLmVtaXQoe1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50OiBvbGREYXRlID8geyB5ZWFyOiBvbGREYXRlLnllYXIsIG1vbnRoOiBvbGREYXRlLm1vbnRoIH0gOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBuZXh0OiB7IHllYXI6IG5ld0RhdGUueWVhciwgbW9udGg6IG5ld0RhdGUubW9udGggfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX2NkLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogTWFudWFsbHkgZm9jdXMgdGhlIGRhdGVwaWNrZXJcbiAgICAgKi9cbiAgICAvKipcbiAgICAgICAqIE1hbnVhbGx5IGZvY3VzIHRoZSBkYXRlcGlja2VyXG4gICAgICAgKi9cbiAgICBOZ2JEYXRlcGlja2VyLnByb3RvdHlwZS5mb2N1cyA9IC8qK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udGgsIGRheTogbWF4RGF0ZS5kYXkgfTtcbiAgICAgICAgdGhpcy5fc2VydmljZS5taW5EYXRlID0gbWluRGF0ZTtcbiAgICAgICAgdGhpcy5fc2VydmljZS5tYXhEYXRlID0gbWF4RGF0ZTtcbiAgICAgICAgdGhpcy5uYXZpZ2F0ZVRvKHN0YXJ0RGF0ZSk7XG4gICAgfTtcbiAgICBOZ2JEYXRlcGlja2VyLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogQ29tcG9uZW50LCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBleHBvcnRBczogJ25nYkRhdGVwaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcjogJ25nYi1kYXRlcGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXG4gICAgICAgICAgICAgICAgICAgIGhvc3Q6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWJpbmRleCc6ICcwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdbYXR0ci50YWJpbmRleF0nOiAnbW9kZWwuZGlzYWJsZWQgPyB1bmRlZmluZWQgOiBcIjBcIicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGJsdXIpJzogJ3Nob3dGb2N1cyhmYWxzZSknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJyhmb2N1cyknOiAnc2hvd0ZvY3VzKHRydWUpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoa2V5ZG93biknOiAnb25LZXlEb3duKCRldmVudCknXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlczogW1wiXFxuICAgIDpob3N0IHtcXG4gICAgICBib3JkZXI6IDFweCBzb2xpZCByZ2JhKDAsIDAsIDAsIDAuMTI1KTtcXG4gICAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///170\n"); /***/ }), /* 171 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerService; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_tools__ = __webpack_require__(264);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__);\n\n\n\n\n\n\n\nvar NgbDatepickerService = (function () {\n function NgbDatepickerService(_calendar) {\n this._calendar = _calendar;\n this._model$ = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n this._select$ = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n this._state = {\n disabled: false,\n displayMonths: 1,\n firstDayOfWeek: 1,\n focusVisible: false,\n months: [],\n navigation: 'select',\n selectedDate: null\n };\n }\n Object.defineProperty(NgbDatepickerService.prototype, \"model$\", {\n get: function () {\n return __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__[\"filter\"].call(this._model$.asObservable(), function (model) { return model.months.length > 0; });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"select$\", {\n get: function () { return __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__[\"filter\"].call(this._select$.asObservable(), function (date) { return date !== null; }); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"disabled\", {\n set: function (disabled) {\n if (this._state.disabled !== disabled) {\n this._nextState({ disabled: disabled });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"displayMonths\", {\n set: function (months) {\n if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"c\" /* isInteger */])(months) && months > 0 && this._state.displayMonths !== months) {\n this._nextState({ displayMonths: months });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"firstDayOfWeek\", {\n set: function (firstDayOfWeek) {\n if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"c\" /* isInteger */])(firstDayOfWeek) && firstDayOfWeek >= 0 && this._state.firstDayOfWeek !== firstDayOfWeek) {\n this._nextState({ firstDayOfWeek: firstDayOfWeek });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"focusVisible\", {\n set: function (focusVisible) {\n if (this._state.focusVisible !== focusVisible && !this._state.disabled) {\n this._nextState({ focusVisible: focusVisible });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"maxDate\", {\n set: function (date) {\n if (date === undefined || this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.maxDate, date)) {\n this._nextState({ maxDate: date });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"markDisabled\", {\n set: function (markDisabled) {\n if (this._state.markDisabled !== markDisabled) {\n this._nextState({ markDisabled: markDisabled });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"minDate\", {\n set: function (date) {\n if (date === undefined || this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.minDate, date)) {\n this._nextState({ minDate: date });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"navigation\", {\n set: function (navigation) {\n if (this._state.navigation !== navigation) {\n this._nextState({ navigation: navigation });\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbDatepickerService.prototype.focus = function (date) {\n if (!this._state.disabled && this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.focusDate, date)) {\n this._nextState({ focusDate: date });\n }\n };\n NgbDatepickerService.prototype.focusMove = function (period, number) {\n this.focus(this._calendar.getNext(this._state.focusDate, period, number));\n };\n NgbDatepickerService.prototype.focusSelect = function () {\n if (Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(this._state.focusDate, this._state.minDate, this._state.maxDate, this._state.disabled, this._state.markDisabled)) {\n this.select(this._state.focusDate, { emitEvent: true });\n }\n };\n NgbDatepickerService.prototype.open = function (date) {\n if (!this._state.disabled && this._calendar.isValid(date)) {\n this._nextState({ firstDate: date });\n }\n };\n NgbDatepickerService.prototype.select = function (date, options) {\n if (options === void 0) { options = {}; }\n var validDate = this.toValidDate(date, null);\n if (!this._state.disabled) {\n if (Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.selectedDate, validDate)) {\n this._nextState({ selectedDate: validDate });\n }\n if (options.emitEvent &&\n Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(validDate, this._state.minDate, this._state.maxDate, this._state.disabled, this._state.markDisabled)) {\n this._select$.next(validDate);\n }\n }\n };\n NgbDatepickerService.prototype.toValidDate = function (date, defaultValue) {\n var ngbDate = __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */].from(date);\n if (defaultValue === undefined) {\n defaultValue = this._calendar.getToday();\n }\n return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;\n };\n NgbDatepickerService.prototype._nextState = function (patch) {\n var newState = this._updateState(patch);\n this._patchContexts(newState);\n this._state = newState;\n this._model$.next(this._state);\n };\n NgbDatepickerService.prototype._patchContexts = function (state) {\n state.months.forEach(function (month) {\n month.weeks.forEach(function (week) {\n week.days.forEach(function (day) {\n // patch focus flag\n if (state.focusDate) {\n day.context.focused = state.focusDate.equals(day.date) && state.focusVisible;\n }\n // override context disabled\n if (state.disabled === true) {\n day.context.disabled = true;\n }\n // patch selection flag\n if (state.selectedDate !== undefined) {\n day.context.selected = state.selectedDate !== null && state.selectedDate.equals(day.date);\n }\n });\n });\n });\n };\n NgbDatepickerService.prototype._updateState = function (patch) {\n // patching fields\n var state = Object.assign({}, this._state, patch);\n var startDate = state.firstDate;\n // min/max dates changed\n if ('minDate' in patch || 'maxDate' in patch) {\n Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"c\" /* checkMinBeforeMax */])(state.minDate, state.maxDate);\n state.focusDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.focusDate, state.minDate, state.maxDate);\n state.firstDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.firstDate, state.minDate, state.maxDate);\n startDate = state.focusDate;\n }\n // disabled\n if ('disabled' in patch) {\n state.focusVisible = false;\n }\n // initial rebuild via 'select()'\n if ('selectedDate' in patch && this._state.months.length === 0) {\n startDate = state.selectedDate;\n }\n // focus date changed\n if ('focusDate' in patch) {\n state.focusDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.focusDate, state.minDate, state.maxDate);\n startDate = state.focusDate;\n // nothing to rebuild if only focus changed and it is still visible\n if (state.months.length !== 0 && !state.focusDate.before(state.firstDate) &&\n !state.focusDate.after(state.lastDate)) {\n return state;\n }\n }\n // first date changed\n if ('firstDate' in patch) {\n state.firstDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.firstDate, state.minDate, state.maxDate);\n startDate = state.firstDate;\n }\n // rebuilding months\n if (startDate) {\n var forceRebuild = 'firstDayOfWeek' in patch || 'markDisabled' in patch || 'minDate' in patch ||\n 'maxDate' in patch || 'disabled' in patch;\n var months = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"a\" /* buildMonths */])(this._calendar, state.months, startDate, state.minDate, state.maxDate, state.displayMonths, state.firstDayOfWeek, state.markDisabled, forceRebuild);\n // updating months and boundary dates\n state.months = months;\n state.firstDate = months.length > 0 ? months[0].firstDate : undefined;\n state.lastDate = months.length > 0 ? months[months.length - 1].lastDate : undefined;\n // reset selected date if 'markDisabled' returns true\n if ('selectedDate' in patch && state.selectedDate !== null) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(state.selectedDate, state.minDate, state.maxDate, state.disabled, state.markDisabled)) {\n state.selectedDate = null;\n }\n }\n // adjusting focus after months were built\n if ('firstDate' in patch) {\n if (state.focusDate === undefined || state.focusDate.before(state.firstDate) ||\n state.focusDate.after(state.lastDate)) {\n state.focusDate = startDate;\n }\n }\n }\n return state;\n };\n NgbDatepickerService.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbDatepickerService.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n return NgbDatepickerService;\n}());\n\n//# sourceMappingURL=datepicker-service.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1zZXJ2aWNlLmpzPzdjMDEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdiQ2FsZW5kYXIgfSBmcm9tICcuL25nYi1jYWxlbmRhcic7XG5pbXBvcnQgeyBOZ2JEYXRlIH0gZnJvbSAnLi9uZ2ItZGF0ZSc7XG5pbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBpc0ludGVnZXIgfSBmcm9tICcuLi91dGlsL3V0aWwnO1xuaW1wb3J0IHsgU3ViamVjdCB9IGZyb20gJ3J4anMvU3ViamVjdCc7XG5pbXBvcnQgeyBidWlsZE1vbnRocywgY2hlY2tEYXRlSW5SYW5nZSwgY2hlY2tNaW5CZWZvcmVNYXgsIGlzQ2hhbmdlZERhdGUsIGlzRGF0ZVNlbGVjdGFibGUgfSBmcm9tICcuL2RhdGVwaWNrZXItdG9vbHMnO1xuaW1wb3J0IHsgZmlsdGVyIH0gZnJvbSAncnhqcy9vcGVyYXRvci9maWx0ZXInO1xudmFyIE5nYkRhdGVwaWNrZXJTZXJ2aWNlID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JEYXRlcGlja2VyU2VydmljZShfY2FsZW5kYXIpIHtcbiAgICAgICAgdGhpcy5fY2FsZW5kYXIgPSBfY2FsZW5kYXI7XG4gICAgICAgIHRoaXMuX21vZGVsJCA9IG5ldyBTdWJqZWN0KCk7XG4gICAgICAgIHRoaXMuX3NlbGVjdCQgPSBuZXcgU3ViamVjdCg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eXBlLl9wYXRjaENvbnRleHRzID0gZnVuY3Rpb24gKHN0YXRlKSB7XG4gICAgICAgIHN0YXRlLm1vbnRocy5mb3JFYWNoKGZ1bmN0aW9uIChtb250aCkge1xuICAgICAgICAgICAgbW9udGgud2Vla3MuZm9yRWFjaChmdW5jdGlvbiAod2Vlaykge1xuICAgICAgICAgICAgICAgIHdlZWsuZGF5cy5mb3JFYWNoKGZ1bmN0aW9uIChkYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcGF0Y2ggZm9jdXMgZmxhZ1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUuZm9jdXNEYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5mb2N1c2VkID0gc3RhdGUuZm9jdXNEYXRlLmVxdWFscyhkYXkuZGF0ZSkgJiYgc3RhdGUuZm9jdXNWaXNpYmxlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG92ZXJyaWRlIGNvbnRleHQgZGlzYWJsZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLmRpc2FibGVkID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5kaXNhYmxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gcGF0Y2ggc2VsZWN0aW9uIGZsYWdcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNlbGVjdGVkRGF0ZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5zZWxlY3RlZCA9IHN0YXRlLnNlbGVjdGVkRGF0ZSAhPT0gbnVsbCAmJiBzdGF0ZS5zZWxlY3RlZERhdGUuZXF1YWxzKGRheS5kYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICA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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///171\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerService; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_tools__ = __webpack_require__(264);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__ = __webpack_require__(119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__);\n\n\n\n\n\n\n\nvar NgbDatepickerService = (function () {\n function NgbDatepickerService(_calendar) {\n this._calendar = _calendar;\n this._model$ = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n this._select$ = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__[\"Subject\"]();\n this._state = {\n disabled: false,\n displayMonths: 1,\n firstDayOfWeek: 1,\n focusVisible: false,\n months: [],\n navigation: 'select',\n selectedDate: null\n };\n }\n Object.defineProperty(NgbDatepickerService.prototype, \"model$\", {\n get: function () {\n return __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__[\"filter\"].call(this._model$.asObservable(), function (model) { return model.months.length > 0; });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"select$\", {\n get: function () { return __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_filter__[\"filter\"].call(this._select$.asObservable(), function (date) { return date !== null; }); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"disabled\", {\n set: function (disabled) {\n if (this._state.disabled !== disabled) {\n this._nextState({ disabled: disabled });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"displayMonths\", {\n set: function (months) {\n if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"c\" /* isInteger */])(months) && months > 0 && this._state.displayMonths !== months) {\n this._nextState({ displayMonths: months });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"firstDayOfWeek\", {\n set: function (firstDayOfWeek) {\n if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"c\" /* isInteger */])(firstDayOfWeek) && firstDayOfWeek >= 0 && this._state.firstDayOfWeek !== firstDayOfWeek) {\n this._nextState({ firstDayOfWeek: firstDayOfWeek });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"focusVisible\", {\n set: function (focusVisible) {\n if (this._state.focusVisible !== focusVisible && !this._state.disabled) {\n this._nextState({ focusVisible: focusVisible });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"maxDate\", {\n set: function (date) {\n if (date === undefined || this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.maxDate, date)) {\n this._nextState({ maxDate: date });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"markDisabled\", {\n set: function (markDisabled) {\n if (this._state.markDisabled !== markDisabled) {\n this._nextState({ markDisabled: markDisabled });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"minDate\", {\n set: function (date) {\n if (date === undefined || this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.minDate, date)) {\n this._nextState({ minDate: date });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbDatepickerService.prototype, \"navigation\", {\n set: function (navigation) {\n if (this._state.navigation !== navigation) {\n this._nextState({ navigation: navigation });\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbDatepickerService.prototype.focus = function (date) {\n if (!this._state.disabled && this._calendar.isValid(date) && Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.focusDate, date)) {\n this._nextState({ focusDate: date });\n }\n };\n NgbDatepickerService.prototype.focusMove = function (period, number) {\n this.focus(this._calendar.getNext(this._state.focusDate, period, number));\n };\n NgbDatepickerService.prototype.focusSelect = function () {\n if (Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(this._state.focusDate, this._state.minDate, this._state.maxDate, this._state.disabled, this._state.markDisabled)) {\n this.select(this._state.focusDate, { emitEvent: true });\n }\n };\n NgbDatepickerService.prototype.open = function (date) {\n if (!this._state.disabled && this._calendar.isValid(date)) {\n this._nextState({ firstDate: date });\n }\n };\n NgbDatepickerService.prototype.select = function (date, options) {\n if (options === void 0) { options = {}; }\n var validDate = this.toValidDate(date, null);\n if (!this._state.disabled) {\n if (Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"d\" /* isChangedDate */])(this._state.selectedDate, validDate)) {\n this._nextState({ selectedDate: validDate });\n }\n if (options.emitEvent &&\n Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(validDate, this._state.minDate, this._state.maxDate, this._state.disabled, this._state.markDisabled)) {\n this._select$.next(validDate);\n }\n }\n };\n NgbDatepickerService.prototype.toValidDate = function (date, defaultValue) {\n var ngbDate = __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */].from(date);\n if (defaultValue === undefined) {\n defaultValue = this._calendar.getToday();\n }\n return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;\n };\n NgbDatepickerService.prototype._nextState = function (patch) {\n var newState = this._updateState(patch);\n this._patchContexts(newState);\n this._state = newState;\n this._model$.next(this._state);\n };\n NgbDatepickerService.prototype._patchContexts = function (state) {\n state.months.forEach(function (month) {\n month.weeks.forEach(function (week) {\n week.days.forEach(function (day) {\n // patch focus flag\n if (state.focusDate) {\n day.context.focused = state.focusDate.equals(day.date) && state.focusVisible;\n }\n // override context disabled\n if (state.disabled === true) {\n day.context.disabled = true;\n }\n // patch selection flag\n if (state.selectedDate !== undefined) {\n day.context.selected = state.selectedDate !== null && state.selectedDate.equals(day.date);\n }\n });\n });\n });\n };\n NgbDatepickerService.prototype._updateState = function (patch) {\n // patching fields\n var state = Object.assign({}, this._state, patch);\n var startDate = state.firstDate;\n // min/max dates changed\n if ('minDate' in patch || 'maxDate' in patch) {\n Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"c\" /* checkMinBeforeMax */])(state.minDate, state.maxDate);\n state.focusDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.focusDate, state.minDate, state.maxDate);\n state.firstDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.firstDate, state.minDate, state.maxDate);\n startDate = state.focusDate;\n }\n // disabled\n if ('disabled' in patch) {\n state.focusVisible = false;\n }\n // initial rebuild via 'select()'\n if ('selectedDate' in patch && this._state.months.length === 0) {\n startDate = state.selectedDate;\n }\n // focus date changed\n if ('focusDate' in patch) {\n state.focusDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.focusDate, state.minDate, state.maxDate);\n startDate = state.focusDate;\n // nothing to rebuild if only focus changed and it is still visible\n if (state.months.length !== 0 && !state.focusDate.before(state.firstDate) &&\n !state.focusDate.after(state.lastDate)) {\n return state;\n }\n }\n // first date changed\n if ('firstDate' in patch) {\n state.firstDate = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"b\" /* checkDateInRange */])(state.firstDate, state.minDate, state.maxDate);\n startDate = state.firstDate;\n }\n // rebuilding months\n if (startDate) {\n var forceRebuild = 'firstDayOfWeek' in patch || 'markDisabled' in patch || 'minDate' in patch ||\n 'maxDate' in patch || 'disabled' in patch;\n var months = Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"a\" /* buildMonths */])(this._calendar, state.months, startDate, state.minDate, state.maxDate, state.displayMonths, state.firstDayOfWeek, state.markDisabled, forceRebuild);\n // updating months and boundary dates\n state.months = months;\n state.firstDate = months.length > 0 ? months[0].firstDate : undefined;\n state.lastDate = months.length > 0 ? months[months.length - 1].lastDate : undefined;\n // reset selected date if 'markDisabled' returns true\n if ('selectedDate' in patch && state.selectedDate !== null) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_5__datepicker_tools__[\"e\" /* isDateSelectable */])(state.selectedDate, state.minDate, state.maxDate, state.disabled, state.markDisabled)) {\n state.selectedDate = null;\n }\n }\n // adjusting focus after months were built\n if ('firstDate' in patch) {\n if (state.focusDate === undefined || state.focusDate.before(state.firstDate) ||\n state.focusDate.after(state.lastDate)) {\n state.focusDate = startDate;\n }\n }\n }\n return state;\n };\n NgbDatepickerService.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbDatepickerService.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n return NgbDatepickerService;\n}());\n\n//# sourceMappingURL=datepicker-service.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=ut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0YXRlLm1vbnRocy5mb3JFYWNoKGZ1bmN0aW9uIChtb250aCkge1xuICAgICAgICAgICAgbW9udGgud2Vla3MuZm9yRWFjaChmdW5jdGlvbiAod2Vlaykge1xuICAgICAgICAgICAgICAgIHdlZWsuZGF5cy5mb3JFYWNoKGZ1bmN0aW9uIChkYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcGF0Y2ggZm9jdXMgZmxhZ1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUuZm9jdXNEYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5mb2N1c2VkID0gc3RhdGUuZm9jdXNEYXRlLmVxdWFscyhkYXkuZGF0ZSkgJiYgc3RhdGUuZm9jdXNWaXNpYmxlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG92ZXJyaWRlIGNvbnRleHQgZGlzYWJsZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLmRpc2FibGVkID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5kaXNhYmxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gcGF0Y2ggc2VsZWN0aW9uIGZsYWdcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNlbGVjdGVkRGF0ZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkuY29udGV4dC5zZWxlY3RlZCA9IHN0YXRlLnNlbGVjdGVkRGF0ZSAhPT0gbnVsbCAmJiBzdGF0ZS5zZWxlY3RlZERhdGUuZXF1YWxzKGRheS5kYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgTmdiRGF0ZXBpY2tlclNlcnZ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yY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///171\n"); /***/ }), /* 172 */ @@ -470,7 +470,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbDateParserFormatter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDateISOParserFormatter; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(18);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n/**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\nvar /**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\nNgbDateParserFormatter = (function () {\n function NgbDateParserFormatter() {\n }\n return NgbDateParserFormatter;\n}());\n/**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\n\nvar NgbDateISOParserFormatter = (function (_super) {\n __extends(NgbDateISOParserFormatter, _super);\n function NgbDateISOParserFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbDateISOParserFormatter.prototype.parse = function (value) {\n if (value) {\n var dateParts = value.trim().split('-');\n if (dateParts.length === 1 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: null, day: null };\n }\n else if (dateParts.length === 2 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[1])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[1]), day: null };\n }\n else if (dateParts.length === 3 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[1]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[2])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[1]), day: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[2]) };\n }\n }\n return null;\n };\n NgbDateISOParserFormatter.prototype.format = function (date) {\n return date ?\n date.year + \"-\" + (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(date.month) ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"f\" /* padNumber */])(date.month) : '') + \"-\" + (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(date.day) ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"f\" /* padNumber */])(date.day) : '') :\n '';\n };\n return NgbDateISOParserFormatter;\n}(NgbDateParserFormatter));\n\n//# sourceMappingURL=ngb-date-parser-formatter.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvbmdiLWRhdGUtcGFyc2VyLWZvcm1hdHRlci5qcz9lYzMxIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBfX2V4dGVuZHMgPSAodGhpcyAmJiB0aGlzLl9fZXh0ZW5kcykgfHwgKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgZXh0ZW5kU3RhdGljcyA9IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fFxuICAgICAgICAoeyBfX3Byb3RvX186IFtdIH0gaW5zdGFuY2VvZiBBcnJheSAmJiBmdW5jdGlvbiAoZCwgYikgeyBkLl9fcHJvdG9fXyA9IGI7IH0pIHx8XG4gICAgICAgIGZ1bmN0aW9uIChkLCBiKSB7IGZvciAodmFyIHAgaW4gYikgaWYgKGIuaGFzT3duUHJvcGVydHkocCkpIGRbcF0gPSBiW3BdOyB9O1xuICAgIHJldHVybiBmdW5jdGlvbiAoZCwgYikge1xuICAgICAgICBleHRlbmRTdGF0aWNzKGQsIGIpO1xuICAgICAgICBmdW5jdGlvbiBfXygpIHsgdGhpcy5jb25zdHJ1Y3RvciA9IGQ7IH1cbiAgICAgICAgZC5wcm90b3R5cGUgPSBiID09PSBudWxsID8gT2JqZWN0LmNyZWF0ZShiKSA6IChfXy5wcm90b3R5cGUgPSBiLnByb3RvdHlwZSwgbmV3IF9fKCkpO1xuICAgIH07XG59KSgpO1xuaW1wb3J0IHsgcGFkTnVtYmVyLCB0b0ludGVnZXIsIGlzTnVtYmVyIH0gZnJvbSAnLi4vdXRpbC91dGlsJztcbi8qKlxuICogQWJzdHJhY3QgdHlwZSBzZXJ2aW5nIGFzIGEgREkgdG9rZW4gZm9yIHRoZSBzZX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y5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9kYXRlcGlja2VyL25nYi1kYXRlLXBhcnNlci1mb3JtYXR0ZXIuanNcbi8vIG1vZHVsZSBpZCA9IDE3M1xuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///173\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbDateParserFormatter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDateISOParserFormatter; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(19);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n/**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\nvar /**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\nNgbDateParserFormatter = (function () {\n function NgbDateParserFormatter() {\n }\n return NgbDateParserFormatter;\n}());\n/**\n * Abstract type serving as a DI token for the service parsing and formatting dates for the NgbInputDatepicker\n * directive. A default implementation using the ISO 8601 format is provided, but you can provide another implementation\n * to use an alternative format.\n */\n\nvar NgbDateISOParserFormatter = (function (_super) {\n __extends(NgbDateISOParserFormatter, _super);\n function NgbDateISOParserFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbDateISOParserFormatter.prototype.parse = function (value) {\n if (value) {\n var dateParts = value.trim().split('-');\n if (dateParts.length === 1 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: null, day: null };\n }\n else if (dateParts.length === 2 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[1])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[1]), day: null };\n }\n else if (dateParts.length === 3 && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[0]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[1]) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(dateParts[2])) {\n return { year: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[0]), month: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[1]), day: Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(dateParts[2]) };\n }\n }\n return null;\n };\n NgbDateISOParserFormatter.prototype.format = function (date) {\n return date ?\n date.year + \"-\" + (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(date.month) ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"f\" /* padNumber */])(date.month) : '') + \"-\" + (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(date.day) ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"f\" /* padNumber */])(date.day) : '') :\n '';\n };\n return NgbDateISOParserFormatter;\n}(NgbDateParserFormatter));\n\n//# sourceMappingURL=ngb-date-parser-formatter.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvbmdiLWRhdGUtcGFyc2VyLWZvcm1hdHRlci5qcz9lYzMxIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBfX2V4dGVuZHMgPSAodGhpcyAmJiB0aGlzLl9fZXh0ZW5kcykgfHwgKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgZXh0ZW5kU3RhdGljcyA9IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fFxuICAgICAgICAoeyBfX3Byb3RvX186IFtdIH0gaW5z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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///173\n"); /***/ }), /* 174 */ @@ -533,7 +533,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTypeaheadWindow; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n\n\nvar NgbTypeaheadWindow = (function () {\n function NgbTypeaheadWindow() {\n this.activeIdx = 0;\n /**\n * Flag indicating if the first row should be active initially\n */\n this.focusFirst = true;\n /**\n * A function used to format a given result before display. This function should return a formatted string without any\n * HTML markup\n */\n this.formatter = __WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */];\n /**\n * Event raised when user selects a particular result row\n */\n this.selectEvent = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.activeChangeEvent = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n }\n NgbTypeaheadWindow.prototype.getActive = function () { return this.results[this.activeIdx]; };\n NgbTypeaheadWindow.prototype.markActive = function (activeIdx) {\n this.activeIdx = activeIdx;\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.next = function () {\n if (this.activeIdx === this.results.length - 1) {\n this.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;\n }\n else {\n this.activeIdx++;\n }\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.prev = function () {\n if (this.activeIdx < 0) {\n this.activeIdx = this.results.length - 1;\n }\n else if (this.activeIdx === 0) {\n this.activeIdx = this.focusFirst ? this.results.length - 1 : -1;\n }\n else {\n this.activeIdx--;\n }\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.select = function (item) { this.selectEvent.emit(item); };\n NgbTypeaheadWindow.prototype.ngOnInit = function () {\n this.activeIdx = this.focusFirst ? 0 : -1;\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype._activeChanged = function () {\n this.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);\n };\n NgbTypeaheadWindow.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-typeahead-window',\n exportAs: 'ngbTypeaheadWindow',\n host: { 'class': 'dropdown-menu', 'style': 'display: block', 'role': 'listbox', '[id]': 'id' },\n template: \"\\n <ng-template #rt let-result=\\\"result\\\" let-term=\\\"term\\\" let-formatter=\\\"formatter\\\">\\n <ngb-highlight [result]=\\\"formatter(result)\\\" [term]=\\\"term\\\"></ngb-highlight>\\n </ng-template>\\n <ng-template ngFor [ngForOf]=\\\"results\\\" let-result let-idx=\\\"index\\\">\\n <button type=\\\"button\\\" class=\\\"dropdown-item\\\" role=\\\"option\\\"\\n [id]=\\\"id + '-' + idx\\\"\\n [class.active]=\\\"idx === activeIdx\\\"\\n (mouseenter)=\\\"markActive(idx)\\\"\\n (click)=\\\"select(result)\\\">\\n <ng-template [ngTemplateOutlet]=\\\"resultTemplate || rt\\\"\\n [ngTemplateOutletContext]=\\\"{result: result, term: term, formatter: formatter}\\\"></ng-template>\\n </button>\\n </ng-template>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbTypeaheadWindow.ctorParameters = function () { return []; };\n NgbTypeaheadWindow.propDecorators = {\n \"id\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"focusFirst\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"results\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"term\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"formatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"selectEvent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"], args: ['select',] },],\n \"activeChangeEvent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"], args: ['activeChange',] },],\n };\n return NgbTypeaheadWindow;\n}());\n\n//# sourceMappingURL=typeahead-window.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC90eXBlYWhlYWQtd2luZG93LmpzP2Q4MTUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50LCBJbnB1dCwgT3V0cHV0LCBFdmVudEVtaXR0ZXIsIFRlbXBsYXRlUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyB0b1N0cmluZyB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG52YXIgTmdiVHlwZWFoZWFkV2luZG93ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JUeXBlYWhlYWRXaW5kb3coKSB7XG4gICAgICAgIHRoaXMuYWN0aXZlSWR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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///182\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTypeaheadWindow; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n\n\nvar NgbTypeaheadWindow = (function () {\n function NgbTypeaheadWindow() {\n this.activeIdx = 0;\n /**\n * Flag indicating if the first row should be active initially\n */\n this.focusFirst = true;\n /**\n * A function used to format a given result before display. This function should return a formatted string without any\n * HTML markup\n */\n this.formatter = __WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */];\n /**\n * Event raised when user selects a particular result row\n */\n this.selectEvent = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.activeChangeEvent = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n }\n NgbTypeaheadWindow.prototype.getActive = function () { return this.results[this.activeIdx]; };\n NgbTypeaheadWindow.prototype.markActive = function (activeIdx) {\n this.activeIdx = activeIdx;\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.next = function () {\n if (this.activeIdx === this.results.length - 1) {\n this.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;\n }\n else {\n this.activeIdx++;\n }\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.prev = function () {\n if (this.activeIdx < 0) {\n this.activeIdx = this.results.length - 1;\n }\n else if (this.activeIdx === 0) {\n this.activeIdx = this.focusFirst ? this.results.length - 1 : -1;\n }\n else {\n this.activeIdx--;\n }\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype.select = function (item) { this.selectEvent.emit(item); };\n NgbTypeaheadWindow.prototype.ngOnInit = function () {\n this.activeIdx = this.focusFirst ? 0 : -1;\n this._activeChanged();\n };\n NgbTypeaheadWindow.prototype._activeChanged = function () {\n this.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);\n };\n NgbTypeaheadWindow.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-typeahead-window',\n exportAs: 'ngbTypeaheadWindow',\n host: { 'class': 'dropdown-menu', 'style': 'display: block', 'role': 'listbox', '[id]': 'id' },\n template: \"\\n <ng-template #rt let-result=\\\"result\\\" let-term=\\\"term\\\" let-formatter=\\\"formatter\\\">\\n <ngb-highlight [result]=\\\"formatter(result)\\\" [term]=\\\"term\\\"></ngb-highlight>\\n </ng-template>\\n <ng-template ngFor [ngForOf]=\\\"results\\\" let-result let-idx=\\\"index\\\">\\n <button type=\\\"button\\\" class=\\\"dropdown-item\\\" role=\\\"option\\\"\\n [id]=\\\"id + '-' + idx\\\"\\n [class.active]=\\\"idx === activeIdx\\\"\\n (mouseenter)=\\\"markActive(idx)\\\"\\n (click)=\\\"select(result)\\\">\\n <ng-template [ngTemplateOutlet]=\\\"resultTemplate || rt\\\"\\n [ngTemplateOutletContext]=\\\"{result: result, term: term, formatter: formatter}\\\"></ng-template>\\n </button>\\n </ng-template>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbTypeaheadWindow.ctorParameters = function () { return []; };\n NgbTypeaheadWindow.propDecorators = {\n \"id\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"focusFirst\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"results\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"term\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"formatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"selectEvent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"], args: ['select',] },],\n \"activeChangeEvent\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"], args: ['activeChange',] },],\n };\n return NgbTypeaheadWindow;\n}());\n\n//# sourceMappingURL=typeahead-window.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC90eXBlYWhlYWQtd2luZG93LmpzP2Q4MTUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50LCBJbnB1dCwgT3V0cHV0LCBFdmVudEVtaXR0ZXIsIFRlbXBsYXRlUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyB0b1N0cmluZyB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG52YXIgTmdiVHlwZWFoZWFkV2luZG93ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JUeXBlYWhlYWRXaW5kb3coKSB7XG4gICAgICAgIH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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///182\n"); /***/ }), /* 183 */ @@ -547,7 +547,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AngularSplitModule\", function() { return AngularSplitModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SplitComponent\", function() { return SplitComponent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SplitAreaDirective\", function() { return SplitAreaDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return SplitGutterDirective; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__ = __webpack_require__(302);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__);\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * angular-split\n *\n * Areas size are set in percentage of the split container.\n * Gutters size are set in pixels.\n *\n * So we set css 'flex-basis' property like this (where 0 <= area.size <= 1):\n * calc( { area.size * 100 }% - { area.size * nbGutter * gutterSize }px );\n *\n * Examples with 3 visible areas and 2 gutters:\n *\n * | 10px 10px |\n * |---------------------[]---------------------[]------------------------------------|\n * | calc(20% - 4px) calc(20% - 4px) calc(60% - 12px) |\n *\n *\n * | 10px 10px |\n * |--------------------------[]--------------------------[]--------------------------|\n * | calc(33.33% - 6.667px) calc(33.33% - 6.667px) calc(33.33% - 6.667px) |\n *\n *\n * |10px 10px |\n * |[]----------------------------------------------------[]--------------------------|\n * |0 calc(66.66% - 13.333px) calc(33%% - 6.667px) |\n *\n *\n * 10px 10px |\n * |[][]------------------------------------------------------------------------------|\n * |0 0 calc(100% - 20px) |\n *\n */\nvar SplitComponent = (function () {\n function SplitComponent(ngZone, elRef, cdRef, renderer) {\n this.ngZone = ngZone;\n this.elRef = elRef;\n this.cdRef = cdRef;\n this.renderer = renderer;\n this._direction = 'horizontal';\n this._useTransition = false;\n this._disabled = false;\n this._width = null;\n this._height = null;\n this._gutterSize = 11;\n this._gutterColor = '';\n this._gutterImageH = '';\n this._gutterImageV = '';\n this._dir = 'ltr';\n this.dragStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.dragProgress = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.dragEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.gutterClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.transitionEndInternal = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__[\"Subject\"]();\n this.transitionEnd = (/** @type {?} */ (this.transitionEndInternal.asObservable())).debounceTime(20);\n this.isViewInitialized = false;\n this.isDragging = false;\n this.draggingWithoutMove = false;\n this.currentGutterNum = 0;\n this.displayedAreas = [];\n this.hidedAreas = [];\n this.dragListeners = [];\n this.dragStartValues = {\n sizePixelContainer: 0,\n sizePixelA: 0,\n sizePixelB: 0,\n sizePercentA: 0,\n sizePercentB: 0,\n };\n }\n Object.defineProperty(SplitComponent.prototype, \"direction\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._direction;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n var _this = this;\n v = (v === 'vertical') ? 'vertical' : 'horizontal';\n this._direction = v;\n this.displayedAreas.concat(this.hidedAreas).forEach(function (area) {\n area.comp.setStyleVisibleAndDir(area.comp.visible, _this.isDragging, _this.direction);\n });\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"useTransition\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._useTransition;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._useTransition = v;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"disabled\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._disabled;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._disabled = v;\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"width\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._width;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._width = (!isNaN(v) && v > 0) ? v : null;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"height\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._height;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._height = (!isNaN(v) && v > 0) ? v : null;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterSize\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterSize;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._gutterSize = (!isNaN(v) && v > 0) ? v : 11;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterColor\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterColor;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterColor = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterImageH\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterImageH;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterImageH = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterImageV\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterImageV;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterImageV = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"dir\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._dir;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (v === 'rtl') ? 'rtl' : 'ltr';\n this._dir = v;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssFlexdirection\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'horizontal') ? 'row' : 'column';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssWidth\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.width ? this.width + \"px\" : '100%';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssHeight\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.height ? this.height + \"px\" : '100%';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssMinwidth\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'horizontal') ? this.getNbGutters() * this.gutterSize + \"px\" : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssMinheight\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'vertical') ? this.getNbGutters() * this.gutterSize + \"px\" : null;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitComponent.prototype.ngAfterViewInit = /**\n * @return {?}\n */\n function () {\n this.isViewInitialized = true;\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.getNbGutters = /**\n * @return {?}\n */\n function () {\n return this.displayedAreas.length - 1;\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.addArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ newArea = {\n comp: comp,\n order: 0,\n size: 0,\n };\n if (comp.visible === true) {\n this.displayedAreas.push(newArea);\n }\n else {\n this.hidedAreas.push(newArea);\n }\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n this.build(true, true);\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.removeArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n if (this.displayedAreas.some(function (a) { return a.comp === comp; })) {\n var /** @type {?} */ area = /** @type {?} */ (this.displayedAreas.find(function (a) { return a.comp === comp; }));\n this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);\n this.build(true, true);\n }\n else if (this.hidedAreas.some(function (a) { return a.comp === comp; })) {\n var /** @type {?} */ area = /** @type {?} */ (this.hidedAreas.find(function (a) { return a.comp === comp; }));\n this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);\n }\n };\n /**\n * @param {?} comp\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n SplitComponent.prototype.updateArea = /**\n * @param {?} comp\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n function (comp, resetOrders, resetSizes) {\n // Only refresh if area is displayed (No need to check inside 'hidedAreas')\n var /** @type {?} */ item = this.displayedAreas.find(function (a) { return a.comp === comp; });\n if (item) {\n this.build(resetOrders, resetSizes);\n }\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.showArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ area = this.hidedAreas.find(function (a) { return a.comp === comp; });\n if (area) {\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n var /** @type {?} */ areas = this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);\n (_a = this.displayedAreas).push.apply(_a, areas);\n this.build(true, true);\n }\n var _a;\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.hideArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ area = this.displayedAreas.find(function (a) { return a.comp === comp; });\n if (area) {\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n var /** @type {?} */ areas = this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);\n areas.forEach(function (area) {\n area.order = 0;\n area.size = 0;\n });\n (_a = this.hidedAreas).push.apply(_a, areas);\n this.build(true, true);\n }\n var _a;\n };\n /**\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n SplitComponent.prototype.build = /**\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n function (resetOrders, resetSizes) {\n var _this = this;\n this.stopDragging();\n // ¤ AREAS ORDER\n if (resetOrders === true) {\n // If user provided 'order' for each area, use it to sort them.\n if (this.displayedAreas.every(function (a) { return a.comp.order !== null; })) {\n this.displayedAreas.sort(function (a, b) { return (/** @type {?} */ (a.comp.order)) - (/** @type {?} */ (b.comp.order)); });\n }\n // Then set real order with multiples of 2, numbers between will be used by gutters.\n this.displayedAreas.forEach(function (area, i) {\n area.order = i * 2;\n area.comp.setStyleOrder(area.order);\n });\n }\n // ¤ AREAS SIZE PERCENT\n if (resetSizes === true) {\n var /** @type {?} */ totalUserSize = /** @type {?} */ (this.displayedAreas.reduce(function (total, s) { return s.comp.size ? total + s.comp.size : total; }, 0));\n // If user provided 'size' for each area and total == 1, use it.\n if (this.displayedAreas.every(function (a) { return a.comp.size !== null; }) && totalUserSize > .999 && totalUserSize < 1.001) {\n this.displayedAreas.forEach(function (area) {\n area.size = /** @type {?} */ (area.comp.size);\n });\n }\n else {\n var /** @type {?} */ size_1 = 1 / this.displayedAreas.length;\n this.displayedAreas.forEach(function (area) {\n area.size = size_1;\n });\n }\n }\n // ¤\n // If some real area sizes are less than gutterSize,\n // set them to zero and dispatch size to others.\n var /** @type {?} */ percentToDispatch = 0;\n // Get container pixel size\n var /** @type {?} */ containerSizePixel = this.getNbGutters() * this.gutterSize;\n if (this.direction === 'horizontal') {\n containerSizePixel = this.width ? this.width : this.elRef.nativeElement['offsetWidth'];\n }\n else {\n containerSizePixel = this.height ? this.height : this.elRef.nativeElement['offsetHeight'];\n }\n this.displayedAreas.forEach(function (area) {\n if (area.size * containerSizePixel < _this.gutterSize) {\n percentToDispatch += area.size;\n area.size = 0;\n }\n });\n if (percentToDispatch > 0 && this.displayedAreas.length > 0) {\n var /** @type {?} */ nbAreasNotZero = this.displayedAreas.filter(function (a) { return a.size !== 0; }).length;\n if (nbAreasNotZero > 0) {\n var /** @type {?} */ percentToAdd_1 = percentToDispatch / nbAreasNotZero;\n this.displayedAreas.filter(function (a) { return a.size !== 0; }).forEach(function (area) {\n area.size += percentToAdd_1;\n });\n }\n else {\n this.displayedAreas[this.displayedAreas.length - 1].size = 1;\n }\n }\n this.refreshStyleSizes();\n this.cdRef.markForCheck();\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.refreshStyleSizes = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ sumGutterSize = this.getNbGutters() * this.gutterSize;\n this.displayedAreas.forEach(function (area) {\n area.comp.setStyleFlexbasis(\"calc( \" + area.size * 100 + \"% - \" + area.size * sumGutterSize + \"px )\", _this.isDragging);\n });\n };\n /**\n * @param {?} startEvent\n * @param {?} gutterOrder\n * @param {?} gutterNum\n * @return {?}\n */\n SplitComponent.prototype.startDragging = /**\n * @param {?} startEvent\n * @param {?} gutterOrder\n * @param {?} gutterNum\n * @return {?}\n */\n function (startEvent, gutterOrder, gutterNum) {\n var _this = this;\n startEvent.preventDefault();\n // Place code here to allow '(gutterClick)' event even if '[disabled]=\"true\"'.\n this.currentGutterNum = gutterNum;\n this.draggingWithoutMove = true;\n this.ngZone.runOutsideAngular(function () {\n _this.dragListeners.push(_this.renderer.listen('document', 'mouseup', function (e) { return _this.stopDragging(); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchend', function (e) { return _this.stopDragging(); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchcancel', function (e) { return _this.stopDragging(); }));\n });\n if (this.disabled) {\n return;\n }\n var /** @type {?} */ areaA = this.displayedAreas.find(function (a) { return a.order === gutterOrder - 1; });\n var /** @type {?} */ areaB = this.displayedAreas.find(function (a) { return a.order === gutterOrder + 1; });\n if (!areaA || !areaB) {\n return;\n }\n var /** @type {?} */ prop = (this.direction === 'horizontal') ? 'offsetWidth' : 'offsetHeight';\n this.dragStartValues.sizePixelContainer = this.elRef.nativeElement[prop];\n this.dragStartValues.sizePixelA = areaA.comp.getSizePixel(prop);\n this.dragStartValues.sizePixelB = areaB.comp.getSizePixel(prop);\n this.dragStartValues.sizePercentA = areaA.size;\n this.dragStartValues.sizePercentB = areaB.size;\n var /** @type {?} */ start;\n if (startEvent instanceof MouseEvent) {\n start = {\n x: startEvent.screenX,\n y: startEvent.screenY,\n };\n }\n else if (startEvent instanceof TouchEvent) {\n start = {\n x: startEvent.touches[0].screenX,\n y: startEvent.touches[0].screenY,\n };\n }\n else {\n return;\n }\n this.ngZone.runOutsideAngular(function () {\n _this.dragListeners.push(_this.renderer.listen('document', 'mousemove', function (e) { return _this.dragEvent(e, start, areaA, areaB); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchmove', function (e) { return _this.dragEvent(e, start, areaA, areaB); }));\n });\n areaA.comp.lockEvents();\n areaB.comp.lockEvents();\n this.isDragging = true;\n this.notify('start');\n };\n /**\n * @param {?} event\n * @param {?} start\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n SplitComponent.prototype.dragEvent = /**\n * @param {?} event\n * @param {?} start\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n function (event, start, areaA, areaB) {\n if (!this.isDragging) {\n return;\n }\n var /** @type {?} */ end;\n if (event instanceof MouseEvent) {\n end = {\n x: event.screenX,\n y: event.screenY,\n };\n }\n else if (event instanceof TouchEvent) {\n end = {\n x: event.touches[0].screenX,\n y: event.touches[0].screenY,\n };\n }\n else {\n return;\n }\n this.draggingWithoutMove = false;\n this.drag(start, end, areaA, areaB);\n };\n /**\n * @param {?} start\n * @param {?} end\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n SplitComponent.prototype.drag = /**\n * @param {?} start\n * @param {?} end\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n function (start, end, areaA, areaB) {\n // ¤ AREAS SIZE PIXEL\n var /** @type {?} */ offsetPixel = (this.direction === 'horizontal') ? (start.x - end.x) : (start.y - end.y);\n if (this.dir === 'rtl') {\n offsetPixel = -offsetPixel;\n }\n var /** @type {?} */ newSizePixelA = this.dragStartValues.sizePixelA - offsetPixel;\n var /** @type {?} */ newSizePixelB = this.dragStartValues.sizePixelB + offsetPixel;\n if (newSizePixelA < this.gutterSize && newSizePixelB < this.gutterSize) {\n // WTF.. get out of here!\n return;\n }\n else if (newSizePixelA < this.gutterSize) {\n newSizePixelB += newSizePixelA;\n newSizePixelA = 0;\n }\n else if (newSizePixelB < this.gutterSize) {\n newSizePixelA += newSizePixelB;\n newSizePixelB = 0;\n }\n // ¤ AREAS SIZE PERCENT\n if (newSizePixelA === 0) {\n areaB.size += areaA.size;\n areaA.size = 0;\n }\n else if (newSizePixelB === 0) {\n areaA.size += areaB.size;\n areaB.size = 0;\n }\n else {\n // NEW_PERCENT = START_PERCENT / START_PIXEL * NEW_PIXEL;\n if (this.dragStartValues.sizePercentA === 0) {\n areaB.size = this.dragStartValues.sizePercentB / this.dragStartValues.sizePixelB * newSizePixelB;\n areaA.size = this.dragStartValues.sizePercentB - areaB.size;\n }\n else if (this.dragStartValues.sizePercentB === 0) {\n areaA.size = this.dragStartValues.sizePercentA / this.dragStartValues.sizePixelA * newSizePixelA;\n areaB.size = this.dragStartValues.sizePercentA - areaA.size;\n }\n else {\n areaA.size = this.dragStartValues.sizePercentA / this.dragStartValues.sizePixelA * newSizePixelA;\n areaB.size = (this.dragStartValues.sizePercentA + this.dragStartValues.sizePercentB) - areaA.size;\n }\n }\n this.refreshStyleSizes();\n this.notify('progress');\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.stopDragging = /**\n * @return {?}\n */\n function () {\n if (this.isDragging === false && this.draggingWithoutMove === false) {\n return;\n }\n this.displayedAreas.forEach(function (area) {\n area.comp.unlockEvents();\n });\n while (this.dragListeners.length > 0) {\n var /** @type {?} */ fct = this.dragListeners.pop();\n if (fct) {\n fct();\n }\n }\n if (this.draggingWithoutMove === true) {\n this.notify('click');\n }\n else {\n this.notify('end');\n }\n this.isDragging = false;\n this.draggingWithoutMove = false;\n };\n /**\n * @param {?} type\n * @return {?}\n */\n SplitComponent.prototype.notify = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n var /** @type {?} */ areasSize = this.displayedAreas.map(function (a) { return a.size * 100; });\n switch (type) {\n case 'start':\n return this.dragStart.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'progress':\n return this.dragProgress.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'end':\n return this.dragEnd.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'click':\n return this.gutterClick.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'transitionEnd':\n return this.transitionEndInternal.next(areasSize);\n }\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.stopDragging();\n };\n SplitComponent.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'split',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n styles: [\"\\n :host {\\n display: flex;\\n flex-wrap: nowrap;\\n justify-content: flex-start;\\n align-items: stretch;\\n overflow: hidden;\\n /* \\n Important to keep following rules even if overrided later by 'HostBinding' \\n because if [width] & [height] not provided, when build() is executed,\\n 'HostBinding' hasn't been applied yet so code:\\n this.elRef.nativeElement[\\\"offsetHeight\\\"] gives wrong value! \\n */\\n width: 100%;\\n height: 100%; \\n }\\n\\n split-gutter {\\n flex-grow: 0;\\n flex-shrink: 0;\\n background-position: center center;\\n background-repeat: no-repeat;\\n }\\n \"],\n template: \"\\n <ng-content></ng-content>\\n <ng-template ngFor let-area [ngForOf]=\\\"displayedAreas\\\" let-index=\\\"index\\\" let-last=\\\"last\\\">\\n <split-gutter *ngIf=\\\"last === false\\\" \\n [order]=\\\"index*2+1\\\"\\n [direction]=\\\"direction\\\"\\n [useTransition]=\\\"useTransition\\\"\\n [size]=\\\"gutterSize\\\"\\n [color]=\\\"gutterColor\\\"\\n [imageH]=\\\"gutterImageH\\\"\\n [imageV]=\\\"gutterImageV\\\"\\n [disabled]=\\\"disabled\\\"\\n (mousedown)=\\\"startDragging($event, index*2+1, index+1)\\\"\\n (touchstart)=\\\"startDragging($event, index*2+1, index+1)\\\"></split-gutter>\\n </ng-template>\",\n },] },\n ];\n /** @nocollapse */\n SplitComponent.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n SplitComponent.propDecorators = {\n \"direction\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"useTransition\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"width\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"height\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterColor\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterImageH\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterImageV\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"dir\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"dragStart\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"dragProgress\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"dragEnd\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"gutterClick\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"transitionEnd\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"cssFlexdirection\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.flex-direction',] },],\n \"cssWidth\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.width',] },],\n \"cssHeight\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.height',] },],\n \"cssMinwidth\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.min-width',] },],\n \"cssMinheight\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.min-height',] },],\n };\n return SplitComponent;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar SplitAreaDirective = (function () {\n function SplitAreaDirective(ngZone, elRef, renderer, split) {\n this.ngZone = ngZone;\n this.elRef = elRef;\n this.renderer = renderer;\n this.split = split;\n this._order = null;\n this._size = null;\n this._minSize = 0;\n this._visible = true;\n this.lockListeners = [];\n }\n Object.defineProperty(SplitAreaDirective.prototype, \"order\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._order;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._order = !isNaN(v) ? v : null;\n this.split.updateArea(this, true, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"size\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._size;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._size = (!isNaN(v) && v >= 0 && v <= 100) ? (v / 100) : null;\n this.split.updateArea(this, false, true);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"minSize\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._minSize;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._minSize = (!isNaN(v) && v > 0 && v < 100) ? v / 100 : 0;\n this.split.updateArea(this, false, true);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"visible\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._visible;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._visible = v;\n if (this.visible) {\n this.split.showArea(this);\n }\n else {\n this.split.hideArea(this);\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.split.addArea(this);\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-grow', '0');\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-shrink', '0');\n this.ngZone.runOutsideAngular(function () {\n _this.transitionListener = _this.renderer.listen(_this.elRef.nativeElement, 'transitionend', function (e) { return _this.onTransitionEnd(e); });\n });\n };\n /**\n * @param {?} prop\n * @return {?}\n */\n SplitAreaDirective.prototype.getSizePixel = /**\n * @param {?} prop\n * @return {?}\n */\n function (prop) {\n return this.elRef.nativeElement[prop];\n };\n /**\n * @param {?} isVisible\n * @param {?} isDragging\n * @param {?} direction\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleVisibleAndDir = /**\n * @param {?} isVisible\n * @param {?} isDragging\n * @param {?} direction\n * @return {?}\n */\n function (isVisible, isDragging, direction) {\n if (isVisible === false) {\n this.setStyleFlexbasis('0', isDragging);\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-x', 'hidden');\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-y', 'hidden');\n if (direction === 'vertical') {\n this.renderer.setStyle(this.elRef.nativeElement, 'max-width', '0');\n }\n }\n else {\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-x', 'hidden');\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-y', 'auto');\n this.renderer.removeStyle(this.elRef.nativeElement, 'max-width');\n }\n if (direction === 'horizontal') {\n this.renderer.setStyle(this.elRef.nativeElement, 'height', '100%');\n this.renderer.removeStyle(this.elRef.nativeElement, 'width');\n }\n else {\n this.renderer.setStyle(this.elRef.nativeElement, 'width', '100%');\n this.renderer.removeStyle(this.elRef.nativeElement, 'height');\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleOrder = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this.renderer.setStyle(this.elRef.nativeElement, 'order', value);\n };\n /**\n * @param {?} value\n * @param {?} isDragging\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleFlexbasis = /**\n * @param {?} value\n * @param {?} isDragging\n * @return {?}\n */\n function (value, isDragging) {\n // If component not yet initialized or gutter being dragged, disable transition\n if (this.split.isViewInitialized === false || isDragging === true) {\n this.setStyleTransition(false);\n }\n else {\n this.setStyleTransition(this.split.useTransition);\n }\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-basis', value);\n };\n /**\n * @param {?} useTransition\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleTransition = /**\n * @param {?} useTransition\n * @return {?}\n */\n function (useTransition) {\n if (useTransition) {\n this.renderer.setStyle(this.elRef.nativeElement, 'transition', \"flex-basis 0.3s\");\n }\n else {\n this.renderer.removeStyle(this.elRef.nativeElement, 'transition');\n }\n };\n /**\n * @param {?} event\n * @return {?}\n */\n SplitAreaDirective.prototype.onTransitionEnd = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n // Limit only flex-basis transition to trigger the event\n if (event.propertyName === 'flex-basis') {\n this.split.notify('transitionEnd');\n }\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.lockEvents = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n _this.lockListeners.push(_this.renderer.listen(_this.elRef.nativeElement, 'selectstart', function (e) { return false; }));\n _this.lockListeners.push(_this.renderer.listen(_this.elRef.nativeElement, 'dragstart', function (e) { return false; }));\n });\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.unlockEvents = /**\n * @return {?}\n */\n function () {\n while (this.lockListeners.length > 0) {\n var /** @type {?} */ fct = this.lockListeners.pop();\n if (fct) {\n fct();\n }\n }\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.unlockEvents();\n if (this.transitionListener) {\n this.transitionListener();\n }\n this.split.removeArea(this);\n };\n SplitAreaDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'split-area'\n },] },\n ];\n /** @nocollapse */\n SplitAreaDirective.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: SplitComponent, },\n ]; };\n SplitAreaDirective.propDecorators = {\n \"order\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"visible\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return SplitAreaDirective;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar SplitGutterDirective = (function () {\n ////\n function SplitGutterDirective(elRef, renderer) {\n this.elRef = elRef;\n this.renderer = renderer;\n this._disabled = false;\n }\n Object.defineProperty(SplitGutterDirective.prototype, \"order\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this.renderer.setStyle(this.elRef.nativeElement, 'order', v);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"direction\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._direction;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._direction = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"useTransition\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n if (v) {\n this.renderer.setStyle(this.elRef.nativeElement, 'transition', \"flex-basis 0.3s\");\n }\n else {\n this.renderer.removeStyle(this.elRef.nativeElement, 'transition');\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"size\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._size;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._size = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"color\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._color;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._color = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"imageH\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._imageH;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._imageH = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"imageV\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._imageV;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._imageV = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"disabled\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._disabled;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._disabled = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitGutterDirective.prototype.refreshStyle = /**\n * @return {?}\n */\n function () {\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-basis', this.size + \"px\");\n // fix safari bug about gutter height when direction is horizontal\n this.renderer.setStyle(this.elRef.nativeElement, 'height', (this.direction === 'vertical') ? this.size + \"px\" : \"100%\");\n this.renderer.setStyle(this.elRef.nativeElement, 'background-color', (this.color !== '') ? this.color : \"#eeeeee\");\n var /** @type {?} */ state = (this.disabled === true) ? 'disabled' : this.direction;\n this.renderer.setStyle(this.elRef.nativeElement, 'background-image', this.getImage(state));\n this.renderer.setStyle(this.elRef.nativeElement, 'cursor', this.getCursor(state));\n };\n /**\n * @param {?} state\n * @return {?}\n */\n SplitGutterDirective.prototype.getCursor = /**\n * @param {?} state\n * @return {?}\n */\n function (state) {\n switch (state) {\n case 'horizontal':\n return 'col-resize';\n case 'vertical':\n return 'row-resize';\n case 'disabled':\n return 'default';\n }\n };\n /**\n * @param {?} state\n * @return {?}\n */\n SplitGutterDirective.prototype.getImage = /**\n * @param {?} state\n * @return {?}\n */\n function (state) {\n switch (state) {\n case 'horizontal':\n return (this.imageH !== '') ? this.imageH : defaultImageH;\n case 'vertical':\n return (this.imageV !== '') ? this.imageV : defaultImageV;\n case 'disabled':\n return '';\n }\n };\n SplitGutterDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'split-gutter'\n },] },\n ];\n /** @nocollapse */\n SplitGutterDirective.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n SplitGutterDirective.propDecorators = {\n \"order\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"direction\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"useTransition\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"color\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"imageH\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"imageV\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return SplitGutterDirective;\n}());\nvar defaultImageH = 'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==\")';\nvar defaultImageV = 'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFCAMAAABl/6zIAAAABlBMVEUAAADMzMzIT8AyAAAAAXRSTlMAQObYZgAAABRJREFUeAFjYGRkwIMJSeMHlBkOABP7AEGzSuPKAAAAAElFTkSuQmCC\")';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar AngularSplitModule = (function () {\n function AngularSplitModule() {\n }\n /**\n * @return {?}\n */\n AngularSplitModule.forRoot = /**\n * @return {?}\n */\n function () {\n return {\n ngModule: AngularSplitModule,\n providers: []\n };\n };\n /**\n * @return {?}\n */\n AngularSplitModule.forChild = /**\n * @return {?}\n */\n function () {\n return {\n ngModule: AngularSplitModule,\n providers: []\n };\n };\n AngularSplitModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n imports: [\n __WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]\n ],\n declarations: [\n SplitComponent,\n SplitAreaDirective,\n SplitGutterDirective,\n ],\n exports: [\n SplitComponent,\n SplitAreaDirective,\n ]\n },] },\n ];\n /** @nocollapse */\n AngularSplitModule.ctorParameters = function () { return []; };\n return AngularSplitModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n// Public classes.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Entry point for all public APIs of the package.\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=angular-split.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2FuZ3VsYXItc3BsaXQvZXNtNS9hbmd1bGFyLXNwbGl0LmpzP2EwNDEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3ksIENoYW5nZURldGVjdG9yUmVmLCBDb21wb25lbnQsIERpcmVjdGl2ZSwgRWxlbWVudFJlZiwgRXZlbnRFbWl0dGVyLCBIb3N0QmluZGluZywgSW5wdXQsIE5nTW9kdWxlLCBOZ1pvbmUsIE91dHB1dCwgUmVuZGVyZXIyIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb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AgICAgIHxcbiAqXG4gKlxuICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgMTBweCAgICAgICAgICAgICAgICAgICAgICAgIDEwcHggICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1bXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tW10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXxcbiAqIHwgIGNhbGMoMzMuMzMlIC0gNi42NjdweCkgICAgICBjYWxjKDMzLjMzJSAtIDYuNjY3cHgpICAgICAgY2FsYygzMy4zMyUgLSA2LjY2N3B4KSAgfFxuICpcbiAqXG4gKiB8MTBweCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTBweCAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqIHxbXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1bXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuICogfDAgICAgICAgICAgICAgICAgIGNhbGMoNjYuNjYlIC0gMTMuMzMzcHgpICAgICAgICAgICAgICAgICAgY2FsYygzMyUlIC0gNi42NjdweCkgICB8XG4gKlxuICpcbiAqICAxMHB4IDEwcHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfFtdW10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG4gKiB8MCAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGMoMTAwJSAtIDIwcHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqXG4gKi9cbnZhciBTcGxpdENvbXBvbmVudCA9IChmdW5j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eXBlIHs/fSAqLyAodGhpcy50cmFuc2l0aW9uRW5kSW50ZXJuYWwuYXNPYnNlcnZhYmxlKCkpKS5kZWJvdW5jZVRpbWUoMjApO1xuICAgICAgICB0aGlzLmlzVmlld0luaXRpYWxpemVkID0gZmFsc2U7XG4gICAgICAgIHRoaXMuaXNEcmFnZ2luZyA9IGZhbHNlO1xuICAgICAgICB0aGlzLmRyYWdnaW5nV2l0aG91dE1vdmUgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5jdXJyZW50R3V0dGVyTnVtID0gMDtcbiAgICAgICAgdGhpcy5kaXNwbGF5ZWRBcmVhcyA9IFtdO1xuICAgICAgICB0aGlzLmhpZGVkQXJlYXMgPSBbXTtcbiAgICAgICAgdGhpcy5kcmFnTGlzdGVuZXJzID0gW107XG4gICAgICAgIHRoaXMuZHJhZ1N0YXJ0VmFsdWVzID0ge1xuICAgICAgICAgICAgc2l6ZVBpeGVsQ29udGFpbmVyOiAwLFxuICAgICAgICAgICAgc2l6ZVBpeGVsQTogMCxcbiAgICAgICAgICAgIHNpemVQaXhlbEI6IDAsXG4gICAgICAgICAgICBzaXplUGVyY2VudEE6IDAsXG4gICAgICAgICAgICBzaXplUGVyY2VudEI6IDAsXG4gICAgICAgIH07XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwiZGlyZWN0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9kaXJlY3Rpb247XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2ID0gKHYgPT09ICd2ZXJ0aWNhbCcpID8gJ3ZlcnRpY2FsJyA6ICdob3Jpem9udGFsJztcbiAgICAgICAgICAgIHRoaXMuX2RpcmVjdGlvbiA9IHY7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLmNvbmNhdCh0aGlzLmhpZGVkQXJlYXMpLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgICAgICBhcmVhLmNvbXAuc2V0U3R5bGVWaXNpYmxlQW5kRGlyKGFyZWEuY29tcC52aXNpYmxlLCBfdGhpcy5pc0RyYWdnaW5nLCBfdGhpcy5kaXJlY3Rpb24pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkKGZhbHNlLCBmYWxzZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwidXNlVHJhbnNpdGlvblwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdXNlVHJhbnNpdGlvbjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh0eXBlb2YgKHYpID09PSAnYm9vbGVhbicpID8gdiA6ICh2ID09PSAnZmFsc2UnID8gZmFsc2UgOiB0cnVlKTtcbiAgICAgICAgICAgIHRoaXMuX3VzZVRyYW5zaXRpb24gPSB2O1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcImRpc2FibGVkXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9kaXNhYmxlZDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh0eXBlb2YgKHYpID09PSAnYm9vbGVhbicpID8gdiA6ICh2ID09PSAnZmFsc2UnID8gZmFsc2UgOiB0cnVlKTtcbiAgICAgICAgICAgIHRoaXMuX2Rpc2FibGVkID0gdjtcbiAgICAgICAgICAgIC8vIEZvcmNlIHJlcGFpbnQgaWYgbW9kaWZpZWQgZnJvbSBUUyBjbGFzcyAoaW5zdGVhZCBvZiB0aGUgdGVtcGxhdGUpXG4gICAgICAgICAgICB0aGlzLmNkUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcIndpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl93aWR0aDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX3dpZHRoID0gKCFpc05hTih2KSAmJiB2ID4gMCkgPyB2IDogbnVsbDtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQoZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJoZWlnaHRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2hlaWdodDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX2hlaWdodCA9ICghaXNOYU4odikgJiYgdiA+IDApID8gdiA6IG51bGw7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkKGZhbHNlLCBmYWxzZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwiZ3V0dGVyU2l6ZVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZ3V0dGVyU2l6ZTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX2d1dHRlclNpemUgPSAoIWlzTmFOKHYpICYmIHYgPiAwKSA/IHYgOiAxMTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQoZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJndXR0ZXJDb2xvclwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZ3V0dGVyQ29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2d1dHRlckNvbG9yID0gKHR5cGVvZiB2ID09PSAnc3RyaW5nJyAmJiB2ICE9PSAnJykg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wgXCJndXR0ZXJJbWFnZVZcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2d1dHRlckltYWdlVjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdGhpcy5fZ3V0dGVySW1hZ2VWID0gKHR5cGVvZiB2ID09PSAnc3RyaW5nJyAmJiB2ICE9PSAnJykgPyB2IDogJyc7XG4gICAgICAgICAgICAvLyBGb3JjZSByZXBhaW50IGlmIG1vZGlmaWVkIGZyb20gVFMgY2xhc3MgKGluc3RlYWQgb2YgdGhlIHRlbXBsYXRlKVxuICAgICAgICAgICAgdGhpcy5jZFJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJkaXJcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2RpcjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh2ID09PSAncnRsJykgPyAncnRsJyA6ICdsdHInO1xuICAgICAgICAgICAgdGhpcy5fZGlyID0gdjtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJjc3NGbGV4ZGlyZWN0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiAodGhpcy5kaXJlY3Rpb24gPT09ICdob3Jpem9udGFsJykgPyAncm93JyA6ICdjb2x1bW4nO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcImNzc1dpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndpZHRoID8gdGhpcy53aWR0aCArIFwicHhcIiA6ICcxMDAlJztcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJjc3NIZWlnaHRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaGVpZ2h0ID8gdGhpcy5oZWlnaHQgKyBcInB4XCIgOiAnMTAwJSc7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwiY3NzTWlud2lkdGhcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuICh0aGlzLmRpcmVjdGlvbiA9PT0gJ2hvcml6b250YWwnKSA/IHRoaXMuZ2V0TmJHdXR0ZXJzKCkgKiB0aGlzLmd1dHRlclNpemUgKyBcInB4XCIgOiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcImNzc01pbmhlaWdodFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gKHRoaXMuZGlyZWN0aW9uID09PSAndmVydGljYWwnKSA/IHRoaXMuZ2V0TmJHdXR0ZXJzKCkgKiB0aGlzLmd1dHRlclNpemUgKyBcInB4XCIgOiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZS5uZ0FmdGVyVmlld0luaXQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5pc1ZpZXdJbml0aWFsaXplZCA9IHRydWU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZS5nZXROYkd1dHRlcnMgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGlzcGxheWVkQXJlYXMubGVuZ3RoIC0gMTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLmFkZEFyZWEgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGNvbXBcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjb21wKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5ld0FyZWEgPSB7XG4gICAgICAgICAgICBjb21wOiBjb21wLFxuICAgICAgICAgICAgb3JkZXI6IDAsXG4gICAgICAgICAgICBzaXplOiAwLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY29tcC52aXNpYmxlID09PSB0cnVlKSB7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLnB1c2gobmV3QXJlYSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmhpZGVkQXJlYXMucHVzaChuZXdBcmVhKTtcbiAgICAgICAgfVxuICAgICAgICBjb21wLnNldFN0eWxlVmlzaWJsZUFuZERpcihjb21wLnZpc2libGUsIHRoaXMuaXNEcmFnZ2luZywgdGhpcy5kaXJlY3Rpb24pO1xuICAgICAgICB0aGlzLmJ1aWxkKHRydWUsIHRydWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb21wXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUucmVtb3ZlQXJlYSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbXApIHtcbiAgICAgICAgaWYgKHRoaXMuZGlzcGxheWVkQXJlYXMuc29tZShmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXJlYSA9IC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuZGlzcGxheWVkQXJlYXMuZmluZChmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSk7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLnNwbGljZSh0aGlzLmRpc3BsYXllZEFyZWFzLmluZGV4T2YoYXJlYSksIDEpO1xuICAgICAgICAgICAgdGhpcy5idWlsZCh0cnVlLCB0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLmhpZGVkQXJlYXMuc29tZShmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXJlYSA9IC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuaGlkZWRBcmVhcy5maW5kKGZ1bmN0aW9uIChhKSB7IHJldHVybiBhLmNvbXAgPT09IGNvbXA7IH0pKTtcbiAgICAgICAgICAgIHRoaXMuaGlkZWRBcmVhcy5zcGxpY2UodG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TtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGFyZWFzID0gdGhpcy5kaXNwbGF5ZWRBcmVhcy5zcGxpY2UodGhpcy5kaXNwbGF5ZWRBcmVhcy5pbmRleE9mKGFyZWEpLCAxKTtcbiAgICAgICAgICAgIGFyZWFzLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgICAgICBhcmVhLm9yZGVyID0gMDtcbiAgICAgICAgICAgICAgICBhcmVhLnNpemUgPSAwO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAoX2EgPSB0aGlzLmhpZGVkQXJlYXMpLnB1c2guYXBwbHkoX2EsIGFyZWFzKTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQodHJ1ZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIF9hO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByZXNldE9yZGVyc1xuICAgICAqIEBwYXJhbSB7P30gcmVzZXRTaXplc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLmJ1aWxkID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSByZXNldE9yZGVyc1xuICAgICAqIEBwYXJhbSB7P30gcmVzZXRTaXplc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHJlc2V0T3JkZXJzLCByZXNldFNpemVzKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMuc3RvcERyYWdnaW5nKCk7XG4gICAgICAgIC8vIMKkIEFSRUFTIE9SREVSXG4gICAgICAgIGlmIChyZXNldE9yZGVycyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgLy8gSWYgdXNlciBwcm92aWRlZCAnb3JkZXInIGZvciBlYWNoIGFyZWEsIHVzZSBpdCB0byBzb3J0IHRoZW0uXG4gICAgICAgICA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WwgPT0gMSwgdXNlIGl0LlxuICAgICAgICAgICAgaWYgKHRoaXMuZGlzcGxheWVkQXJlYXMuZXZlcnkoZnVuY3Rpb24gKGEpIHsgcmV0dXJuIGEuY29tcC5zaXplICE9PSBudWxsOyB9KSAmJiB0b3RhbFVzZXJTaXplID4gLjk5OSAmJiB0b3RhbFVzZXJTaXplIDwgMS4wMDEpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJlYS5zaXplID0gLyoqIEB0eXBlIHs/fSAqLyAoYXJlYS5jb21wLnNpemUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gc2l6ZV8xID0gMSAvIHRoaXMuZGlzcGxheWVkQXJlYXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgIHRoaXMuZGlzcGxheWVkQXJlYXMuZm9yRWFjaChmdW5jdGlvbiAoYXJlYSkge1xuICAgICAgICAgICAgICAgICAgICBhcmVhLnNpemUgPSBzaXplXzE7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gwqRcbiAgICAgICAgLy8gSWYgc29tZSByZWFsIGFyZWEgc2l6ZXMgYXJlIGxlc3MgdGhhbiBndXR0ZXJTaXplLFxuICAgICAgICAvLyBzZXQgdGhlbSB0byB6ZXJvIGFuZCBkaXNwYXRjaCBzaXplIHRvIG90aGVycy5cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gcGVyY2VudFRvRGlzcGF0Y2ggPSAwO1xuICAgICAgICAvLyBHZXQgY29udGFpbmVyIHBpeGVsIHNpemVcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gY29udGFpbmVyU2l6ZVBp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cy5zaXplUGl4ZWxDb250YWluZXIgPSB0aGlzLmVsUmVmLm5hdGl2ZUVsZW1lbnRbcHJvcF07XG4gICAgICAgIHRoaXMuZHJhZ1N0YXJ0VmFsdWVzLnNpemVQaXhlbEEgPSBhcmVhQS5jb21wLmdldFNpemVQaXhlbChwcm9wKTtcbiAgICAgICAgdGhpcy5kcmFnU3RhcnRWYWx1ZXMuc2l6ZVBpeGVsQiA9IGFyZWFCLmNvbXAuZ2V0U2l6ZVBpeGVsKHByb3ApO1xuICAgICAgICB0aGlzLmRyYWdTdGFydFZhbHVlcy5zaXplUGVyY2VudEEgPSBhcmVhQS5zaXplO1xuICAgICAgICB0aGlzLmRyYWdTdGFydFZhbHVlcy5zaXplUGVyY2VudEIgPSBhcmVhQi5zaXplO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBzdGFydDtcbiAgICAgICAgaWYgKHN0YXJ0RXZlbnQgaW5zdGFuY2VvZiBNb3VzZUV2ZW50KSB7XG4gICAgICAgICAgICBzdGFydCA9IHtcbiAgICAgICAgICAgICAgICB4OiBzdGFydEV2ZW50LnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogc3RhcnRFdmVudC5zY3JlZW5ZLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdGFydEV2ZW50IGluc3RhbmNlb2YgVG91Y2hFdmVudCkge1xuICAgICAgICAgICAgc3RhcnQgPSB7XG4gICAgICAgICAgICAgICAgeDogc3RhcnRFdmVudC50b3VjaGVzWzBdLnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogc3RhcnRFdmVudC50b3VjaGVzWzBdLnNjcmVlblksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubmdab25lLnJ1bk91dHNpZGVBbmd1bGFyKGZ1bmN0aW9uICgpIHtcbiAgICA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0RyYWdnaW5nKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZW5kO1xuICAgICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBNb3VzZUV2ZW50KSB7XG4gICAgICAgICAgICBlbmQgPSB7XG4gICAgICAgICAgICAgICAgeDogZXZlbnQuc2NyZWVuWCxcbiAgICAgICAgICAgICAgICB5OiBldmVudC5zY3JlZW5ZLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChldmVudCBpbnN0YW5jZW9mIFRvdWNoRXZlbnQpIHtcbiAgICAgICAgICAgIGVuZCA9IHtcbiAgICAgICAgICAgICAgICB4OiBldmVudC50b3VjaGVzWzBdLnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogZXZlbnQudG91Y2hlc1swXS5zY3JlZW5ZLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmRyYWdnaW5nV2l0aG91dE1vdmUgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5kcmFnKHN0YXJ0LCBlbmQsIGFyZWFBLCBhcmVhQik7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0YXJ0XG4gICAgICogQHBhcmFtIHs/fSBlbmRcbiAgICAgKiBAcGFyYW0gez99IGFyZWFBXG4gICAgICogQHBhcmFtIHs/fSBhcmVhQlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLmRyYWcgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN0YXJ0XG4gICAgICogQHBhcmFtIHs/fSBlbmRcbiAgICAgKiBAcGFyYW0gez99IGFyZWFBXG4gICAgICogQHBhcmFtIHs/fSBhcmVhQlxuICAgICAqIEByZX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AgICAgICAgIGFyZWEuY29tcC51bmxvY2tFdmVudHMoKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHdoaWxlICh0aGlzLmRyYWdMaXN0ZW5lcnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZmN0ID0gdGhpcy5kcmFnTGlzdGVuZXJzLnBvcCgpO1xuICAgICAgICAgICAgaWYgKGZjdCkge1xuICAgICAgICAgICAgICAgIGZjdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmRyYWdnaW5nV2l0aG91dE1vdmUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIHRoaXMubm90aWZ5KCdjbGljaycpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5ub3RpZnkoJ2VuZCcpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuaXNEcmFnZ2luZyA9IGZhbHNlO1xuICAgICAgICB0aGlzLmRyYWdnaW5nV2l0aG91dE1vdmUgPSBmYWxzZTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gdHlwZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLm5vdGlmeSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gdHlwZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHR5cGUpIHtcbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXJlYXNTaXplID0gdGhpcy5kaXNwbGF5ZWRBcmVhcy5tYXAoZnVuY3Rpb24gKGEpIHsgcmV0dXJuIGEuc2l6ZSAqIDEwMDsgfSk7XG4gICAgICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgICAgICAgY2FzZSAnc3RhcnQnOlxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmRyYWdT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ocmluazogMDtcXG4gICAgICAgICAgICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiBjZW50ZXIgY2VudGVyO1xcbiAgICAgICAgICAgIGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7XFxuICAgICAgICB9XFxuICAgIFwiXSxcbiAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGU6IFwiXFxuICAgICAgICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XFxuICAgICAgICA8bmctdGVtcGxhdGUgbmdGb3IgbGV0LWFyZWEgW25nRm9yT2ZdPVxcXCJkaXNwbGF5ZWRBcmVhc1xcXCIgbGV0LWluZGV4PVxcXCJpbmRleFxcXCIgbGV0LWxhc3Q9XFxcImxhc3RcXFwiPlxcbiAgICAgICAgICAgIDxzcGxpdC1ndXR0ZXIgKm5nSWY9XFxcImxhc3QgPT09IGZhbHNlXFxcIiBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtvcmRlcl09XFxcImluZGV4KjIrMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtkaXJlY3Rpb25dPVxcXCJkaXJlY3Rpb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbdXNlVHJhbnNpdGlvbl09XFxcInVzZVRyYW5zaXRpb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbc2l6ZV09XFxcImd1dHRlclNpemVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbY29sb3JdPVxcXCJndXR0ZXJDb2xvclxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtpbWFnZUhdPVxcXCJndXR0ZXJJbWFnZUhcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbaW1hZ2VWXT1cXFwiZ3V0dGVySW1hZ2VWXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgW2Rpc2FibGVkXT1cXFwiZGlzYWJsZWRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAobW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FyZWEodGhpcywgdHJ1ZSwgZmFsc2UpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRBcmVhRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJzaXplXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9zaXplO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB2ID0gTnVtYmVyKHYpO1xuICAgICAgICAgICAgdGhpcy5fc2l6ZSA9ICghaXNOYU4odikgJiYgdiA+PSAwICYmIHYgPD0gMTAwKSA/ICh2IC8gMTAwKSA6IG51bGw7XG4gICAgICAgICAgICB0aGlzLnNwbGl0LnVwZGF0ZUFyZWEodGhpcywgZmFsc2UsIHRydWUpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRBcmVhRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJtaW5TaXplXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9taW5TaXplO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB2ID0gTnVtYmVyKHYpO1xuICAgICAgICAgICAgdGhpcy5fbWluU2l6ZSA9ICghaXNOYU4odikgJiYgdiA+IDAgJiYgdiA8IDEwMCkgPyB2IC8gMTAwIDogMDtcbiAgICAgICAgICAgIHRoaXMuc3BsaXQudXBkYXRlQXJlYSh0aGlzLCBmYWxzZSwgdHJ1ZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdEFyZWFEaXJlY3RpdmUucHJvdG90eXBlLCBcInZpc2libGVcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3Zpc2libGU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHYgPSAodHlwZW9mICh2KSA9PT0gJ2Jvb2xlYW4nKSA/IHYgOiAodiA9PT0gJ2ZhbHNlJyA/IGZhbHNlIDogdHJ1ZSk7XG4gICAgICAgICAgICB0aGlzLl92aXNpYmxlID0gdjtcbiAgICAgICAgICAgIGlmICh0aGlzLnZpc2libGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNwbGl0LnNob3dBcmVhKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGh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saXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcImRpcmVjdGlvblwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZGlyZWN0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB0aGlzLl9kaXJlY3Rpb24gPSB2O1xuICAgICAgICAgICAgdGhpcy5yZWZyZXNoU3R5bGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0R3V0dGVyRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ1c2VUcmFuc2l0aW9uXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnNldFN0eWxlKHRoaXMuZWxSZWYubmF0aXZlRWxlbWVudCwgJ3RyYW5zaXRpb24nLCBcImZsZXgtYmFzaXMgMC4zc1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIucmVtb3ZlU3R5bGUodGhpcy5lbFJlZi5uYXRpdmVFbGVtZW50LCAndHJhbnNpdGlvbicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcInNpemVcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3NpemU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX3NpemUgPSB2O1xuICAgICAgICAgICAgdGhpcy5yZWZyZXNoU3R5bGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0R3V0dGVyRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJjb2xvclwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fY29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2NvbG9yID0gdjtcbiAgICAgICAgICAgIHRoaXMucmVmcmVzaFN0eWxlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdEd1dHRlckRpcmVjdGl2ZS5wcm90b3R5cGUsIFwiaW1hZ2VIXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9pbWFnZUg7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2ltYWdlSCA9IHY7XG4gICAgICAgICAgICB0aGlzLnJlZnJlc2hTdHlsZSgpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcImltYWdlVlwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faW1hZ2VWO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB0aGlzLl9pbWFnZ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ICBjYXNlICdob3Jpem9udGFsJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2NvbC1yZXNpemUnO1xuICAgICAgICAgICAgY2FzZSAndmVydGljYWwnOlxuICAgICAgICAgICAgICAgIHJldHVybiAncm93LXJlc2l6ZSc7XG4gICAgICAgICAgICBjYXNlICdkaXNhYmxlZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZWZhdWx0JztcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLmdldEltYWdlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0YXRlKSB7XG4gICAgICAgIHN3aXRjaCAoc3RhdGUpIHtcbiAgICAgICAgICAgIGNhc2UgJ2hvcml6b250YWwnOlxuICAgICAgICAgICAgICAgIHJldHVybiAodGhpcy5pbWFnZUggIT09ICcnKSA/IHRoaXMuaW1hZ2VIIDogZGVmYXVsdEltYWdlSDtcbiAgICAgICAgICAgIGNhc2UgJ3ZlcnRpY2FsJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gKHRoaXMuaW1hZ2VWICE9PSAnJykgPyB0aGlzLmltYWdlViA6IGRlZmF1bHRJbWFnZVY7XG4gICAgICAgICAgICBjYXNlICdkaXNhYmxlZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBTcGxpdEd1dHRlckRpcmVjdGl2ZS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdzcGxpdC1ndXR0ZXInXG4gICAgICAgICAgICAgICAgfSxdI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VsZS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IE5nTW9kdWxlLCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBpbXBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBDb21tb25Nb2R1bGVcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgZGVjbGFyYXRpb25zOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBTcGxpdENvbXBvbmVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIFNwbGl0QXJlYURpcmVjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFNwbGl0R3V0dGVyRGlyZWN0aXZlLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICBleHBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBTcGxpdENvbXBvbmVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIFNwbGl0QXJlYURpcmVjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgQW5ndWxhclNwbGl0TW9kdWxlLmN0b3JQYXJhbWV0ZXJzID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gW107IH07XG4gICAgcmV0dXJuIEFuZ3VsYXJTcGxpdE1vZHVsZTtcbn0oKSk7XG5cbi8qKlxuICogQGZpbGVvdmVydmlldyBhZGRlZCBieSB0c2lja2xlXG4gKiBAc3VwcHJlc3Mge2NoZWNrVHlwZXN9IGNoZWNrZWQgYnkgdHNjXG4gKi9cbi8vIFB1YmxpYyBjbGFzc2VzLlxuXG4vKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogQHN1cHByZXNzIHtjaGVja1R5cGVzfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbiAqIEVudHJ5IHB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BQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///184\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AngularSplitModule\", function() { return AngularSplitModule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SplitComponent\", function() { return SplitComponent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SplitAreaDirective\", function() { return SplitAreaDirective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return SplitGutterDirective; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__ = __webpack_require__(65);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__ = __webpack_require__(302);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__);\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * angular-split\n *\n * Areas size are set in percentage of the split container.\n * Gutters size are set in pixels.\n *\n * So we set css 'flex-basis' property like this (where 0 <= area.size <= 1):\n * calc( { area.size * 100 }% - { area.size * nbGutter * gutterSize }px );\n *\n * Examples with 3 visible areas and 2 gutters:\n *\n * | 10px 10px |\n * |---------------------[]---------------------[]------------------------------------|\n * | calc(20% - 4px) calc(20% - 4px) calc(60% - 12px) |\n *\n *\n * | 10px 10px |\n * |--------------------------[]--------------------------[]--------------------------|\n * | calc(33.33% - 6.667px) calc(33.33% - 6.667px) calc(33.33% - 6.667px) |\n *\n *\n * |10px 10px |\n * |[]----------------------------------------------------[]--------------------------|\n * |0 calc(66.66% - 13.333px) calc(33%% - 6.667px) |\n *\n *\n * 10px 10px |\n * |[][]------------------------------------------------------------------------------|\n * |0 0 calc(100% - 20px) |\n *\n */\nvar SplitComponent = (function () {\n function SplitComponent(ngZone, elRef, cdRef, renderer) {\n this.ngZone = ngZone;\n this.elRef = elRef;\n this.cdRef = cdRef;\n this.renderer = renderer;\n this._direction = 'horizontal';\n this._useTransition = false;\n this._disabled = false;\n this._width = null;\n this._height = null;\n this._gutterSize = 11;\n this._gutterColor = '';\n this._gutterImageH = '';\n this._gutterImageV = '';\n this._dir = 'ltr';\n this.dragStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.dragProgress = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.dragEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.gutterClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](false);\n this.transitionEndInternal = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__[\"Subject\"]();\n this.transitionEnd = (/** @type {?} */ (this.transitionEndInternal.asObservable())).debounceTime(20);\n this.isViewInitialized = false;\n this.isDragging = false;\n this.draggingWithoutMove = false;\n this.currentGutterNum = 0;\n this.displayedAreas = [];\n this.hidedAreas = [];\n this.dragListeners = [];\n this.dragStartValues = {\n sizePixelContainer: 0,\n sizePixelA: 0,\n sizePixelB: 0,\n sizePercentA: 0,\n sizePercentB: 0,\n };\n }\n Object.defineProperty(SplitComponent.prototype, \"direction\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._direction;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n var _this = this;\n v = (v === 'vertical') ? 'vertical' : 'horizontal';\n this._direction = v;\n this.displayedAreas.concat(this.hidedAreas).forEach(function (area) {\n area.comp.setStyleVisibleAndDir(area.comp.visible, _this.isDragging, _this.direction);\n });\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"useTransition\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._useTransition;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._useTransition = v;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"disabled\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._disabled;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._disabled = v;\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"width\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._width;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._width = (!isNaN(v) && v > 0) ? v : null;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"height\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._height;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._height = (!isNaN(v) && v > 0) ? v : null;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterSize\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterSize;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._gutterSize = (!isNaN(v) && v > 0) ? v : 11;\n this.build(false, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterColor\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterColor;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterColor = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterImageH\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterImageH;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterImageH = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"gutterImageV\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._gutterImageV;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._gutterImageV = (typeof v === 'string' && v !== '') ? v : '';\n // Force repaint if modified from TS class (instead of the template)\n this.cdRef.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"dir\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._dir;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (v === 'rtl') ? 'rtl' : 'ltr';\n this._dir = v;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssFlexdirection\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'horizontal') ? 'row' : 'column';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssWidth\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.width ? this.width + \"px\" : '100%';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssHeight\", {\n get: /**\n * @return {?}\n */\n function () {\n return this.height ? this.height + \"px\" : '100%';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssMinwidth\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'horizontal') ? this.getNbGutters() * this.gutterSize + \"px\" : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitComponent.prototype, \"cssMinheight\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this.direction === 'vertical') ? this.getNbGutters() * this.gutterSize + \"px\" : null;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitComponent.prototype.ngAfterViewInit = /**\n * @return {?}\n */\n function () {\n this.isViewInitialized = true;\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.getNbGutters = /**\n * @return {?}\n */\n function () {\n return this.displayedAreas.length - 1;\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.addArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ newArea = {\n comp: comp,\n order: 0,\n size: 0,\n };\n if (comp.visible === true) {\n this.displayedAreas.push(newArea);\n }\n else {\n this.hidedAreas.push(newArea);\n }\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n this.build(true, true);\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.removeArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n if (this.displayedAreas.some(function (a) { return a.comp === comp; })) {\n var /** @type {?} */ area = /** @type {?} */ (this.displayedAreas.find(function (a) { return a.comp === comp; }));\n this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);\n this.build(true, true);\n }\n else if (this.hidedAreas.some(function (a) { return a.comp === comp; })) {\n var /** @type {?} */ area = /** @type {?} */ (this.hidedAreas.find(function (a) { return a.comp === comp; }));\n this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);\n }\n };\n /**\n * @param {?} comp\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n SplitComponent.prototype.updateArea = /**\n * @param {?} comp\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n function (comp, resetOrders, resetSizes) {\n // Only refresh if area is displayed (No need to check inside 'hidedAreas')\n var /** @type {?} */ item = this.displayedAreas.find(function (a) { return a.comp === comp; });\n if (item) {\n this.build(resetOrders, resetSizes);\n }\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.showArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ area = this.hidedAreas.find(function (a) { return a.comp === comp; });\n if (area) {\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n var /** @type {?} */ areas = this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);\n (_a = this.displayedAreas).push.apply(_a, areas);\n this.build(true, true);\n }\n var _a;\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n SplitComponent.prototype.hideArea = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n var /** @type {?} */ area = this.displayedAreas.find(function (a) { return a.comp === comp; });\n if (area) {\n comp.setStyleVisibleAndDir(comp.visible, this.isDragging, this.direction);\n var /** @type {?} */ areas = this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);\n areas.forEach(function (area) {\n area.order = 0;\n area.size = 0;\n });\n (_a = this.hidedAreas).push.apply(_a, areas);\n this.build(true, true);\n }\n var _a;\n };\n /**\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n SplitComponent.prototype.build = /**\n * @param {?} resetOrders\n * @param {?} resetSizes\n * @return {?}\n */\n function (resetOrders, resetSizes) {\n var _this = this;\n this.stopDragging();\n // ¤ AREAS ORDER\n if (resetOrders === true) {\n // If user provided 'order' for each area, use it to sort them.\n if (this.displayedAreas.every(function (a) { return a.comp.order !== null; })) {\n this.displayedAreas.sort(function (a, b) { return (/** @type {?} */ (a.comp.order)) - (/** @type {?} */ (b.comp.order)); });\n }\n // Then set real order with multiples of 2, numbers between will be used by gutters.\n this.displayedAreas.forEach(function (area, i) {\n area.order = i * 2;\n area.comp.setStyleOrder(area.order);\n });\n }\n // ¤ AREAS SIZE PERCENT\n if (resetSizes === true) {\n var /** @type {?} */ totalUserSize = /** @type {?} */ (this.displayedAreas.reduce(function (total, s) { return s.comp.size ? total + s.comp.size : total; }, 0));\n // If user provided 'size' for each area and total == 1, use it.\n if (this.displayedAreas.every(function (a) { return a.comp.size !== null; }) && totalUserSize > .999 && totalUserSize < 1.001) {\n this.displayedAreas.forEach(function (area) {\n area.size = /** @type {?} */ (area.comp.size);\n });\n }\n else {\n var /** @type {?} */ size_1 = 1 / this.displayedAreas.length;\n this.displayedAreas.forEach(function (area) {\n area.size = size_1;\n });\n }\n }\n // ¤\n // If some real area sizes are less than gutterSize,\n // set them to zero and dispatch size to others.\n var /** @type {?} */ percentToDispatch = 0;\n // Get container pixel size\n var /** @type {?} */ containerSizePixel = this.getNbGutters() * this.gutterSize;\n if (this.direction === 'horizontal') {\n containerSizePixel = this.width ? this.width : this.elRef.nativeElement['offsetWidth'];\n }\n else {\n containerSizePixel = this.height ? this.height : this.elRef.nativeElement['offsetHeight'];\n }\n this.displayedAreas.forEach(function (area) {\n if (area.size * containerSizePixel < _this.gutterSize) {\n percentToDispatch += area.size;\n area.size = 0;\n }\n });\n if (percentToDispatch > 0 && this.displayedAreas.length > 0) {\n var /** @type {?} */ nbAreasNotZero = this.displayedAreas.filter(function (a) { return a.size !== 0; }).length;\n if (nbAreasNotZero > 0) {\n var /** @type {?} */ percentToAdd_1 = percentToDispatch / nbAreasNotZero;\n this.displayedAreas.filter(function (a) { return a.size !== 0; }).forEach(function (area) {\n area.size += percentToAdd_1;\n });\n }\n else {\n this.displayedAreas[this.displayedAreas.length - 1].size = 1;\n }\n }\n this.refreshStyleSizes();\n this.cdRef.markForCheck();\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.refreshStyleSizes = /**\n * @return {?}\n */\n function () {\n var _this = this;\n var /** @type {?} */ sumGutterSize = this.getNbGutters() * this.gutterSize;\n this.displayedAreas.forEach(function (area) {\n area.comp.setStyleFlexbasis(\"calc( \" + area.size * 100 + \"% - \" + area.size * sumGutterSize + \"px )\", _this.isDragging);\n });\n };\n /**\n * @param {?} startEvent\n * @param {?} gutterOrder\n * @param {?} gutterNum\n * @return {?}\n */\n SplitComponent.prototype.startDragging = /**\n * @param {?} startEvent\n * @param {?} gutterOrder\n * @param {?} gutterNum\n * @return {?}\n */\n function (startEvent, gutterOrder, gutterNum) {\n var _this = this;\n startEvent.preventDefault();\n // Place code here to allow '(gutterClick)' event even if '[disabled]=\"true\"'.\n this.currentGutterNum = gutterNum;\n this.draggingWithoutMove = true;\n this.ngZone.runOutsideAngular(function () {\n _this.dragListeners.push(_this.renderer.listen('document', 'mouseup', function (e) { return _this.stopDragging(); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchend', function (e) { return _this.stopDragging(); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchcancel', function (e) { return _this.stopDragging(); }));\n });\n if (this.disabled) {\n return;\n }\n var /** @type {?} */ areaA = this.displayedAreas.find(function (a) { return a.order === gutterOrder - 1; });\n var /** @type {?} */ areaB = this.displayedAreas.find(function (a) { return a.order === gutterOrder + 1; });\n if (!areaA || !areaB) {\n return;\n }\n var /** @type {?} */ prop = (this.direction === 'horizontal') ? 'offsetWidth' : 'offsetHeight';\n this.dragStartValues.sizePixelContainer = this.elRef.nativeElement[prop];\n this.dragStartValues.sizePixelA = areaA.comp.getSizePixel(prop);\n this.dragStartValues.sizePixelB = areaB.comp.getSizePixel(prop);\n this.dragStartValues.sizePercentA = areaA.size;\n this.dragStartValues.sizePercentB = areaB.size;\n var /** @type {?} */ start;\n if (startEvent instanceof MouseEvent) {\n start = {\n x: startEvent.screenX,\n y: startEvent.screenY,\n };\n }\n else if (startEvent instanceof TouchEvent) {\n start = {\n x: startEvent.touches[0].screenX,\n y: startEvent.touches[0].screenY,\n };\n }\n else {\n return;\n }\n this.ngZone.runOutsideAngular(function () {\n _this.dragListeners.push(_this.renderer.listen('document', 'mousemove', function (e) { return _this.dragEvent(e, start, areaA, areaB); }));\n _this.dragListeners.push(_this.renderer.listen('document', 'touchmove', function (e) { return _this.dragEvent(e, start, areaA, areaB); }));\n });\n areaA.comp.lockEvents();\n areaB.comp.lockEvents();\n this.isDragging = true;\n this.notify('start');\n };\n /**\n * @param {?} event\n * @param {?} start\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n SplitComponent.prototype.dragEvent = /**\n * @param {?} event\n * @param {?} start\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n function (event, start, areaA, areaB) {\n if (!this.isDragging) {\n return;\n }\n var /** @type {?} */ end;\n if (event instanceof MouseEvent) {\n end = {\n x: event.screenX,\n y: event.screenY,\n };\n }\n else if (event instanceof TouchEvent) {\n end = {\n x: event.touches[0].screenX,\n y: event.touches[0].screenY,\n };\n }\n else {\n return;\n }\n this.draggingWithoutMove = false;\n this.drag(start, end, areaA, areaB);\n };\n /**\n * @param {?} start\n * @param {?} end\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n SplitComponent.prototype.drag = /**\n * @param {?} start\n * @param {?} end\n * @param {?} areaA\n * @param {?} areaB\n * @return {?}\n */\n function (start, end, areaA, areaB) {\n // ¤ AREAS SIZE PIXEL\n var /** @type {?} */ offsetPixel = (this.direction === 'horizontal') ? (start.x - end.x) : (start.y - end.y);\n if (this.dir === 'rtl') {\n offsetPixel = -offsetPixel;\n }\n var /** @type {?} */ newSizePixelA = this.dragStartValues.sizePixelA - offsetPixel;\n var /** @type {?} */ newSizePixelB = this.dragStartValues.sizePixelB + offsetPixel;\n if (newSizePixelA < this.gutterSize && newSizePixelB < this.gutterSize) {\n // WTF.. get out of here!\n return;\n }\n else if (newSizePixelA < this.gutterSize) {\n newSizePixelB += newSizePixelA;\n newSizePixelA = 0;\n }\n else if (newSizePixelB < this.gutterSize) {\n newSizePixelA += newSizePixelB;\n newSizePixelB = 0;\n }\n // ¤ AREAS SIZE PERCENT\n if (newSizePixelA === 0) {\n areaB.size += areaA.size;\n areaA.size = 0;\n }\n else if (newSizePixelB === 0) {\n areaA.size += areaB.size;\n areaB.size = 0;\n }\n else {\n // NEW_PERCENT = START_PERCENT / START_PIXEL * NEW_PIXEL;\n if (this.dragStartValues.sizePercentA === 0) {\n areaB.size = this.dragStartValues.sizePercentB / this.dragStartValues.sizePixelB * newSizePixelB;\n areaA.size = this.dragStartValues.sizePercentB - areaB.size;\n }\n else if (this.dragStartValues.sizePercentB === 0) {\n areaA.size = this.dragStartValues.sizePercentA / this.dragStartValues.sizePixelA * newSizePixelA;\n areaB.size = this.dragStartValues.sizePercentA - areaA.size;\n }\n else {\n areaA.size = this.dragStartValues.sizePercentA / this.dragStartValues.sizePixelA * newSizePixelA;\n areaB.size = (this.dragStartValues.sizePercentA + this.dragStartValues.sizePercentB) - areaA.size;\n }\n }\n this.refreshStyleSizes();\n this.notify('progress');\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.stopDragging = /**\n * @return {?}\n */\n function () {\n if (this.isDragging === false && this.draggingWithoutMove === false) {\n return;\n }\n this.displayedAreas.forEach(function (area) {\n area.comp.unlockEvents();\n });\n while (this.dragListeners.length > 0) {\n var /** @type {?} */ fct = this.dragListeners.pop();\n if (fct) {\n fct();\n }\n }\n if (this.draggingWithoutMove === true) {\n this.notify('click');\n }\n else {\n this.notify('end');\n }\n this.isDragging = false;\n this.draggingWithoutMove = false;\n };\n /**\n * @param {?} type\n * @return {?}\n */\n SplitComponent.prototype.notify = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n var /** @type {?} */ areasSize = this.displayedAreas.map(function (a) { return a.size * 100; });\n switch (type) {\n case 'start':\n return this.dragStart.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'progress':\n return this.dragProgress.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'end':\n return this.dragEnd.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'click':\n return this.gutterClick.emit({ gutterNum: this.currentGutterNum, sizes: areasSize });\n case 'transitionEnd':\n return this.transitionEndInternal.next(areasSize);\n }\n };\n /**\n * @return {?}\n */\n SplitComponent.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.stopDragging();\n };\n SplitComponent.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'split',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n styles: [\"\\n :host {\\n display: flex;\\n flex-wrap: nowrap;\\n justify-content: flex-start;\\n align-items: stretch;\\n overflow: hidden;\\n /* \\n Important to keep following rules even if overrided later by 'HostBinding' \\n because if [width] & [height] not provided, when build() is executed,\\n 'HostBinding' hasn't been applied yet so code:\\n this.elRef.nativeElement[\\\"offsetHeight\\\"] gives wrong value! \\n */\\n width: 100%;\\n height: 100%; \\n }\\n\\n split-gutter {\\n flex-grow: 0;\\n flex-shrink: 0;\\n background-position: center center;\\n background-repeat: no-repeat;\\n }\\n \"],\n template: \"\\n <ng-content></ng-content>\\n <ng-template ngFor let-area [ngForOf]=\\\"displayedAreas\\\" let-index=\\\"index\\\" let-last=\\\"last\\\">\\n <split-gutter *ngIf=\\\"last === false\\\" \\n [order]=\\\"index*2+1\\\"\\n [direction]=\\\"direction\\\"\\n [useTransition]=\\\"useTransition\\\"\\n [size]=\\\"gutterSize\\\"\\n [color]=\\\"gutterColor\\\"\\n [imageH]=\\\"gutterImageH\\\"\\n [imageV]=\\\"gutterImageV\\\"\\n [disabled]=\\\"disabled\\\"\\n (mousedown)=\\\"startDragging($event, index*2+1, index+1)\\\"\\n (touchstart)=\\\"startDragging($event, index*2+1, index+1)\\\"></split-gutter>\\n </ng-template>\",\n },] },\n ];\n /** @nocollapse */\n SplitComponent.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n SplitComponent.propDecorators = {\n \"direction\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"useTransition\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"width\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"height\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterColor\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterImageH\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"gutterImageV\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"dir\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"dragStart\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"dragProgress\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"dragEnd\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"gutterClick\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"transitionEnd\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"cssFlexdirection\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.flex-direction',] },],\n \"cssWidth\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.width',] },],\n \"cssHeight\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.height',] },],\n \"cssMinwidth\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.min-width',] },],\n \"cssMinheight\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"HostBinding\"], args: ['style.min-height',] },],\n };\n return SplitComponent;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar SplitAreaDirective = (function () {\n function SplitAreaDirective(ngZone, elRef, renderer, split) {\n this.ngZone = ngZone;\n this.elRef = elRef;\n this.renderer = renderer;\n this.split = split;\n this._order = null;\n this._size = null;\n this._minSize = 0;\n this._visible = true;\n this.lockListeners = [];\n }\n Object.defineProperty(SplitAreaDirective.prototype, \"order\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._order;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._order = !isNaN(v) ? v : null;\n this.split.updateArea(this, true, false);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"size\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._size;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._size = (!isNaN(v) && v >= 0 && v <= 100) ? (v / 100) : null;\n this.split.updateArea(this, false, true);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"minSize\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._minSize;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = Number(v);\n this._minSize = (!isNaN(v) && v > 0 && v < 100) ? v / 100 : 0;\n this.split.updateArea(this, false, true);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitAreaDirective.prototype, \"visible\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._visible;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n v = (typeof (v) === 'boolean') ? v : (v === 'false' ? false : true);\n this._visible = v;\n if (this.visible) {\n this.split.showArea(this);\n }\n else {\n this.split.hideArea(this);\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.split.addArea(this);\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-grow', '0');\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-shrink', '0');\n this.ngZone.runOutsideAngular(function () {\n _this.transitionListener = _this.renderer.listen(_this.elRef.nativeElement, 'transitionend', function (e) { return _this.onTransitionEnd(e); });\n });\n };\n /**\n * @param {?} prop\n * @return {?}\n */\n SplitAreaDirective.prototype.getSizePixel = /**\n * @param {?} prop\n * @return {?}\n */\n function (prop) {\n return this.elRef.nativeElement[prop];\n };\n /**\n * @param {?} isVisible\n * @param {?} isDragging\n * @param {?} direction\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleVisibleAndDir = /**\n * @param {?} isVisible\n * @param {?} isDragging\n * @param {?} direction\n * @return {?}\n */\n function (isVisible, isDragging, direction) {\n if (isVisible === false) {\n this.setStyleFlexbasis('0', isDragging);\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-x', 'hidden');\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-y', 'hidden');\n if (direction === 'vertical') {\n this.renderer.setStyle(this.elRef.nativeElement, 'max-width', '0');\n }\n }\n else {\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-x', 'hidden');\n this.renderer.setStyle(this.elRef.nativeElement, 'overflow-y', 'auto');\n this.renderer.removeStyle(this.elRef.nativeElement, 'max-width');\n }\n if (direction === 'horizontal') {\n this.renderer.setStyle(this.elRef.nativeElement, 'height', '100%');\n this.renderer.removeStyle(this.elRef.nativeElement, 'width');\n }\n else {\n this.renderer.setStyle(this.elRef.nativeElement, 'width', '100%');\n this.renderer.removeStyle(this.elRef.nativeElement, 'height');\n }\n };\n /**\n * @param {?} value\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleOrder = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n this.renderer.setStyle(this.elRef.nativeElement, 'order', value);\n };\n /**\n * @param {?} value\n * @param {?} isDragging\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleFlexbasis = /**\n * @param {?} value\n * @param {?} isDragging\n * @return {?}\n */\n function (value, isDragging) {\n // If component not yet initialized or gutter being dragged, disable transition\n if (this.split.isViewInitialized === false || isDragging === true) {\n this.setStyleTransition(false);\n }\n else {\n this.setStyleTransition(this.split.useTransition);\n }\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-basis', value);\n };\n /**\n * @param {?} useTransition\n * @return {?}\n */\n SplitAreaDirective.prototype.setStyleTransition = /**\n * @param {?} useTransition\n * @return {?}\n */\n function (useTransition) {\n if (useTransition) {\n this.renderer.setStyle(this.elRef.nativeElement, 'transition', \"flex-basis 0.3s\");\n }\n else {\n this.renderer.removeStyle(this.elRef.nativeElement, 'transition');\n }\n };\n /**\n * @param {?} event\n * @return {?}\n */\n SplitAreaDirective.prototype.onTransitionEnd = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n // Limit only flex-basis transition to trigger the event\n if (event.propertyName === 'flex-basis') {\n this.split.notify('transitionEnd');\n }\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.lockEvents = /**\n * @return {?}\n */\n function () {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n _this.lockListeners.push(_this.renderer.listen(_this.elRef.nativeElement, 'selectstart', function (e) { return false; }));\n _this.lockListeners.push(_this.renderer.listen(_this.elRef.nativeElement, 'dragstart', function (e) { return false; }));\n });\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.unlockEvents = /**\n * @return {?}\n */\n function () {\n while (this.lockListeners.length > 0) {\n var /** @type {?} */ fct = this.lockListeners.pop();\n if (fct) {\n fct();\n }\n }\n };\n /**\n * @return {?}\n */\n SplitAreaDirective.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.unlockEvents();\n if (this.transitionListener) {\n this.transitionListener();\n }\n this.split.removeArea(this);\n };\n SplitAreaDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'split-area'\n },] },\n ];\n /** @nocollapse */\n SplitAreaDirective.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: SplitComponent, },\n ]; };\n SplitAreaDirective.propDecorators = {\n \"order\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"visible\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return SplitAreaDirective;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar SplitGutterDirective = (function () {\n ////\n function SplitGutterDirective(elRef, renderer) {\n this.elRef = elRef;\n this.renderer = renderer;\n this._disabled = false;\n }\n Object.defineProperty(SplitGutterDirective.prototype, \"order\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this.renderer.setStyle(this.elRef.nativeElement, 'order', v);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"direction\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._direction;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._direction = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"useTransition\", {\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n if (v) {\n this.renderer.setStyle(this.elRef.nativeElement, 'transition', \"flex-basis 0.3s\");\n }\n else {\n this.renderer.removeStyle(this.elRef.nativeElement, 'transition');\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"size\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._size;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._size = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"color\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._color;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._color = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"imageH\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._imageH;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._imageH = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"imageV\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._imageV;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._imageV = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SplitGutterDirective.prototype, \"disabled\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._disabled;\n },\n set: /**\n * @param {?} v\n * @return {?}\n */\n function (v) {\n this._disabled = v;\n this.refreshStyle();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SplitGutterDirective.prototype.refreshStyle = /**\n * @return {?}\n */\n function () {\n this.renderer.setStyle(this.elRef.nativeElement, 'flex-basis', this.size + \"px\");\n // fix safari bug about gutter height when direction is horizontal\n this.renderer.setStyle(this.elRef.nativeElement, 'height', (this.direction === 'vertical') ? this.size + \"px\" : \"100%\");\n this.renderer.setStyle(this.elRef.nativeElement, 'background-color', (this.color !== '') ? this.color : \"#eeeeee\");\n var /** @type {?} */ state = (this.disabled === true) ? 'disabled' : this.direction;\n this.renderer.setStyle(this.elRef.nativeElement, 'background-image', this.getImage(state));\n this.renderer.setStyle(this.elRef.nativeElement, 'cursor', this.getCursor(state));\n };\n /**\n * @param {?} state\n * @return {?}\n */\n SplitGutterDirective.prototype.getCursor = /**\n * @param {?} state\n * @return {?}\n */\n function (state) {\n switch (state) {\n case 'horizontal':\n return 'col-resize';\n case 'vertical':\n return 'row-resize';\n case 'disabled':\n return 'default';\n }\n };\n /**\n * @param {?} state\n * @return {?}\n */\n SplitGutterDirective.prototype.getImage = /**\n * @param {?} state\n * @return {?}\n */\n function (state) {\n switch (state) {\n case 'horizontal':\n return (this.imageH !== '') ? this.imageH : defaultImageH;\n case 'vertical':\n return (this.imageV !== '') ? this.imageV : defaultImageV;\n case 'disabled':\n return '';\n }\n };\n SplitGutterDirective.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'split-gutter'\n },] },\n ];\n /** @nocollapse */\n SplitGutterDirective.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n ]; };\n SplitGutterDirective.propDecorators = {\n \"order\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"direction\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"useTransition\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"color\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"imageH\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"imageV\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return SplitGutterDirective;\n}());\nvar defaultImageH = 'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==\")';\nvar defaultImageV = 'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFCAMAAABl/6zIAAAABlBMVEUAAADMzMzIT8AyAAAAAXRSTlMAQObYZgAAABRJREFUeAFjYGRkwIMJSeMHlBkOABP7AEGzSuPKAAAAAElFTkSuQmCC\")';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar AngularSplitModule = (function () {\n function AngularSplitModule() {\n }\n /**\n * @return {?}\n */\n AngularSplitModule.forRoot = /**\n * @return {?}\n */\n function () {\n return {\n ngModule: AngularSplitModule,\n providers: []\n };\n };\n /**\n * @return {?}\n */\n AngularSplitModule.forChild = /**\n * @return {?}\n */\n function () {\n return {\n ngModule: AngularSplitModule,\n providers: []\n };\n };\n AngularSplitModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n imports: [\n __WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]\n ],\n declarations: [\n SplitComponent,\n SplitAreaDirective,\n SplitGutterDirective,\n ],\n exports: [\n SplitComponent,\n SplitAreaDirective,\n ]\n },] },\n ];\n /** @nocollapse */\n AngularSplitModule.ctorParameters = function () { return []; };\n return AngularSplitModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n// Public classes.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Entry point for all public APIs of the package.\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=angular-split.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2FuZ3VsYXItc3BsaXQvZXNtNS9hbmd1bGFyLXNwbGl0LmpzP2EwNDEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3ksIENoYW5nZURldGVjdG9yUmVmLCBDb21wb25lbnQsIERpcmVjdGl2ZSwgRWxlbWVudFJlZiwgRXZlbnRFbWl0dGVyLCBIb3N0QmluZGluZywgSW5wdXQsIE5nTW9kdWxlLCBOZ1pvbmUsIE91dHB1dCwgUmVuZGVyZXIyIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgU3ViamVjdCBhcyBTdWJqZWN0JDEgfSBmcm9tICdyeGpzL1N1YmplY3QnO1xuaW1wb3J0ICdyeGpzL2FkZC9vcGVyYXRvci9kZWJvdW5jZVRpbWUnO1xuXG4vKipcbiAqIEBmaWxlb3ZlcnZpZXcgYWRkZWQgYnkgdHNpY2tsZVxuICogQHN1cHByZXNzIHtjaGVja1R5cGVzfSBjaGVja2VkIGJ5IHRzY1xuICovXG4vKipcbiAqIGFuZ3VsYXItc3BsaXRcbiAqXG4gKiBBcmVhcyBzaXplIGFyZSBzZXQgaW4gcGVyY2VudGFnZSBvZiB0aGUgc3BsaXQgY29udGFpbmVyLlxuICogR3V0dGVycyBzaXplIGFyZSBzZXQgaW4gcGl4ZWxzLlxuICpcbiAqIFNvIHdlIHNldCBjc3MgJ2ZsZXgtYmFzaXMnIHByb3BlcnR5IGxpa2UgdGhpcyAod2hlcmUgMCA8PSBhcmVhLnNpemUgPD0gMSk6XG4gKiAgY2FsYyggeyBhcmVhLnNpemUgKiAxMDAgfSUgLSB7IGFyZWEuc2l6ZSAqIG5iR3V0dGVyICogZ3V0dGVyU2l6ZSB9cHggKTtcbiAqXG4gKiBFeGFtcGxlcyB3aXRoIDMgdmlzaWJsZSBhcmVhcyBhbmQgMiBndXR0ZXJzOlxuICpcbiAqIHwgICAgICAgICAgICAgICAgICAgICAxMHB4ICAgICAgICAgICAgICAgICAgIDEwcHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfC0tLS0tLS0tLS0tLS0tLS0tLS0tLVtdLS0tLS0tLS0tLS0tLS0tLS0tLS0tW10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG4gKiB8ICBjYWxjKDIwJSAtIDRweCkgICAgICAgICAgY2FsYygyMCUgLSA0cHgpICAgICAgICAgICAgICBjYWxjKDYwJSAtIDEycHgpICAgICAgICAgIHxcbiAqXG4gKlxuICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgMTBweCAgICAgICAgICAgICAgICAgICAgICAgIDEwcHggICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1bXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tW10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXxcbiAqIHwgIGNhbGMoMzMuMzMlIC0gNi42NjdweCkgICAgICBjYWxjKDMzLjMzJSAtIDYuNjY3cHgpICAgICAgY2FsYygzMy4zMyUgLSA2LjY2N3B4KSAgfFxuICpcbiAqXG4gKiB8MTBweCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTBweCAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqIHxbXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1bXS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuICogfDAgICAgICAgICAgICAgICAgIGNhbGMoNjYuNjYlIC0gMTMuMzMzcHgpICAgICAgICAgICAgICAgICAgY2FsYygzMyUlIC0gNi42NjdweCkgICB8XG4gKlxuICpcbiAqICAxMHB4IDEwcHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfFtdW10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG4gKiB8MCAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGMoMTAwJSAtIDIwcHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqXG4gKi9cbnZhciBTcGxpdENvbXBvbmVudCA9IChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gU3BsaXRDb21wb25lbnQobmdab25lLCBlbFJlZiwgY2RSZWYsIHJlbmRlcmVyKSB7XG4gICAgICAgIHRoaXMubmdab25lID0gbmdab25lO1xuICAgICAgICB0aGlzLmVsUmVmID0gZWxSZWY7XG4gICAgICAgIHRoaXMuY2RSZWYgPSBjZFJlZjtcbiAgICAgICAgdGhpcy5yZW5kZXJlciA9IHJlbmRlcmVyO1xuICAgICAgICB0aGlzLl9kaXJlY3Rpb24gPSAnaG9yaXpvbnRhbCc7XG4gICAgICAgIHRoaXMuX3VzZVRyYW5zaXRpb24gPSBmYWxzZTtcbiAgICAgICAgdGhpcy5fZGlzYWJsZWQgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5fd2lkdGggPSBudWxsO1xuICAgICAgICB0aGlzLl9oZWlnaHQgPSBudWxsO1xuICAgICAgICB0aGlzLl9ndXR0ZXJTaX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29udGFpbmVyOiAwLFxuICAgICAgICAgICAgc2l6ZVBpeGVsQTogMCxcbiAgICAgICAgICAgIHNpemVQaXhlbEI6IDAsXG4gICAgICAgICAgICBzaXplUGVyY2VudEE6IDAsXG4gICAgICAgICAgICBzaXplUGVyY2VudEI6IDAsXG4gICAgICAgIH07XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwiZGlyZWN0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9kaXJlY3Rpb247XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2ID0gKHYgPT09ICd2ZXJ0aWNhbCcpID8gJ3ZlcnRpY2FsJyA6ICdob3Jpem9udGFsJztcbiAgICAgICAgICAgIHRoaXMuX2RpcmVjdGlvbiA9IHY7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLmNvbmNhdCh0aGlzLmhpZGVkQXJlYXMpLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgICAgICBhcmVhLmNvbXAuc2V0U3R5bGVWaXNpYmxlQW5kRGlyKGFyZWEuY29tcC52aXNpYmxlLCBfdGhpcy5pc0RyYWdnaW5nLCBfdGhpcy5kaXJlY3Rpb24pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkKGZhbHNlLCBmYWxzZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwidXNlVHJhbnNpdGlvblwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdXNlVHJhbnNpdGlvbjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh0eXBlb2YgKHYpID09PSAnYm9vbGVhbicpID8gdiA6ICh2ID09PSAnZmFsc2UnID8gZmFsc2UgOiB0cnVlKTtcbiAgICAgICAgICAgIHRoaXMuX3VzZVRyYW5zaXRpb24gPSB2O1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcImRpc2FibGVkXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9kaXNhYmxlZDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh0eXBlb2YgKHYpID09PSAnYm9vbGVhbicpID8gdiA6ICh2ID09PSAnZmFsc2UnID8gZmFsc2UgOiB0cnVlKTtcbiAgICAgICAgICAgIHRoaXMuX2Rpc2FibGVkID0gdjtcbiAgICAgICAgICAgIC8vIEZvcmNlIHJlcGFpbnQgaWYgbW9kaWZpZWQgZnJvbSBUUyBjbGFzcyAoaW5zdGVhZCBvZiB0aGUgdGVtcGxhdGUpXG4gICAgICAgICAgICB0aGlzLmNkUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcIndpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl93aWR0aDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX3dpZHRoID0gKCFpc05hTih2KSAmJiB2ID4gMCkgPyB2IDogbnVsbDtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQoZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJoZWlnaHRcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2hlaWdodDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX2hlaWdodCA9ICghaXNOYU4odikgJiYgdiA+IDApID8gdiA6IG51bGw7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkKGZhbHNlLCBmYWxzZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdENvbXBvbmVudC5wcm90b3R5cGUsIFwiZ3V0dGVyU2l6ZVwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZ3V0dGVyU2l6ZTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX2d1dHRlclNpemUgPSAoIWlzTmFOKHYpICYmIHYgPiAwKSA/IHYgOiAxMTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQoZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJndXR0ZXJDb2xvclwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZ3V0dGVyQ29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2d1dHRlckNvbG9yID0gKHR5cGVvZiB2ID09PSAnc3RyaW5nJyAmJiB2ICE9PSAnJykgPyB2IDogJyc7XG4gICAgICAgICAgICAvLyBGb3JjZSByZXBhaW50IGlmIG1vZGlmaWVkIGZyb20gVFMgY2xhc3MgKGluc3RlYWQgb2YgdGhlIHRlbXBsYXRlKVxuICAgICAgICAgICAgdGhpcy5jZFJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJndXR0ZXJJbWFnZUhcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2d1dHRlckltYWdlSDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdGhpcy5fZ3V0dGVySW1hZ2VIID0gKHR5cGVvZiB2ID09PSAnc3RyaW5nJyAmJiB2ICE9PSAnJykgPyB2IDogJyc7XG4gICAgICAgICAgICAvLyBGb3JjZSByZXBhaW50IGlmIG1vZGlmaWVkIGZyb20gVFMgY2xhc3MgKGluc3RlYWQgb2YgdGhlIHRlbXBsYXRlKVxuICAgICAgICAgICAgdGhpcy5jZFJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJndXR0ZXJJbWFnZVZcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2d1dHRlckltYWdlVjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdGhpcy5fZ3V0dGVySW1hZ2VWID0gKHR5cGVvZiB2ID09PSAnc3RyaW5nJyAmJiB2ICE9PSAnJykgPyB2IDogJyc7XG4gICAgICAgICAgICAvLyBGb3JjZSByZXBhaW50IGlmIG1vZGlmaWVkIGZyb20gVFMgY2xhc3MgKGluc3RlYWQgb2YgdGhlIHRlbXBsYXRlKVxuICAgICAgICAgICAgdGhpcy5jZFJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJkaXJcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2RpcjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9ICh2ID09PSAncnRsJykgPyAncnRsJyA6ICdsdHInO1xuICAgICAgICAgICAgdGhpcy5fZGlyID0gdjtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZSwgXCJjc3NGbGV4ZGlyZWN0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiAodGhpcy5kaXJlY3Rpb24gPT09ICdob3Jpem9udGFsJykgPyAncm93JyA6ICdjb2x1bW4nO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6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OiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRDb21wb25lbnQucHJvdG90eXBlLCBcImNzc01pbmhlaWdodFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gKHRoaXMuZGlyZWN0aW9uID09PSAndmVydGljYWwnKSA/IHRoaXMuZ2V0TmJHdXR0ZXJzKCkgKiB0aGlzLmd1dHRlclNpemUgKyBcInB4XCIgOiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZS5uZ0FmdGVyVmlld0luaXQgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5pc1ZpZXdJbml0aWFsaXplZCA9IHRydWU7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIFNwbGl0Q29tcG9uZW50LnByb3RvdHlwZS5nZXROYkd1dHRlcnMgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGlzcGxheWVkQXJlYXMubGVuZ3RoIC0gMTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLmFkZEFyZWEgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IGNvbXBcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjb21wKSB7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIG5ld0FyZWEgPSB7XG4gICAgICAgICAgICBjb21wOiBjb21wLFxuICAgICAgICAgICAgb3JkZXI6IDAsXG4gICAgICAgICAgICBzaXplOiAwLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY29tcC52aXNpYmxlID09PSB0cnVlKSB7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLnB1c2gobmV3QXJlYSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmhpZGVkQXJlYXMucHVzaChuZXdBcmVhKTtcbiAgICAgICAgfVxuICAgICAgICBjb21wLnNldFN0eWxlVmlzaWJsZUFuZERpcihjb21wLnZpc2libGUsIHRoaXMuaXNEcmFnZ2luZywgdGhpcy5kaXJlY3Rpb24pO1xuICAgICAgICB0aGlzLmJ1aWxkKHRydWUsIHRydWUpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb21wXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUucmVtb3ZlQXJlYSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbXApIHtcbiAgICAgICAgaWYgKHRoaXMuZGlzcGxheWVkQXJlYXMuc29tZShmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXJlYSA9IC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuZGlzcGxheWVkQXJlYXMuZmluZChmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSk7XG4gICAgICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLnNwbGljZSh0aGlzLmRpc3BsYXllZEFyZWFzLmluZGV4T2YoYXJlYSksIDEpO1xuICAgICAgICAgICAgdGhpcy5idWlsZCh0cnVlLCB0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLmhpZGVkQXJlYXMuc29tZShmdW5jdGlvbiAoYSkgeyByZXR1cm4gYS5jb21wID09PSBjb21wOyB9KSkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gYXJlYSA9IC8qKiBAdHlwZSB7P30gKi8gKHRoaXMuaGlkZWRBcmVhcy5maW5kKGZ1bmN0aW9uIChhKSB7IHJldHVybiBhLmNvbXAgPT09IGNvbXA7IH0pKTtcbiAgICAgICAgICAgIHRoaXMuaGlkZWRBcmVhcy5zcGxpY2UodGhpcy5oaWRlZEFyZWFzLmluZGV4T2YoYXJlYSksIDEpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGNvbXBcbiAgICAgKiBAcGFyYW0gez99IHJlc2V0T3JkZXJzXG4gICAgICogQHBhcmFtIHs/fSByZXNldFNpemVzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUudXBkYXRlQXJlYSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEBwYXJhbSB7P30gcmVzZXRPcmRlcnNcbiAgICAgKiBAcGFyYW0gez99IHJlc2V0U2l6ZXNcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChjb21wLCByZXNldE9yZGVycywgcmVzZXRTaXplcykge1xuICAgICAgICAvLyBPbmx5IHJ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GlzLmJ1aWxkKHRydWUsIHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBfYTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gY29tcFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRDb21wb25lbnQucHJvdG90eXBlLmhpZGVBcmVhID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBjb21wXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoY29tcCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBhcmVhID0gdGhpcy5kaXNwbGF5ZWRBcmVhcy5maW5kKGZ1bmN0aW9uIChhKSB7IHJldHVybiBhLmNvbXAgPT09IGNvbXA7IH0pO1xuICAgICAgICBpZiAoYXJlYSkge1xuICAgICAgICAgICAgY29tcC5zZXRTdHlsZVZpc2libGVBbmREaXIoY29tcC52aXNpYmxlLCB0aGlzLmlzRHJhZ2dpbmcsIHRoaXMuZGlyZWN0aW9uKTtcbiAgICAgICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIGFyZWFzID0gdGhpcy5kaXNwbGF5ZWRBcmVhcy5zcGxpY2UodGhpcy5kaXNwbGF5ZWRBcmVhcy5pbmRleE9mKGFyZWEpLCAxKTtcbiAgICAgICAgICAgIGFyZWFzLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgICAgICBhcmVhLm9yZGVyID0gMDtcbiAgICAgICAgICAgICAgICBhcmVhLnNpemUgPSAwO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAoX2EgPSB0aGlzLmhpZGVkQXJlYXMpLnB1c2guYXBwbHkoX2EsIGFyZWFzKTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGQodHJ1ZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIF9hO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs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zdGFuY2VvZiBNb3VzZUV2ZW50KSB7XG4gICAgICAgICAgICBzdGFydCA9IHtcbiAgICAgICAgICAgICAgICB4OiBzdGFydEV2ZW50LnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogc3RhcnRFdmVudC5zY3JlZW5ZLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdGFydEV2ZW50IGluc3RhbmNlb2YgVG91Y2hFdmVudCkge1xuICAgICAgICAgICAgc3RhcnQgPSB7XG4gICAgICAgICAgICAgICAgeDogc3RhcnRFdmVudC50b3VjaGVzWzBdLnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogc3RhcnRFdmVudC50b3VjaGVzWzBdLnNjcmVlblksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubmdab25lLnJ1bk91dHNpZGVBbmd1bGFyKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIF90aGlzLmRyYWdMaXN0ZW5lcnMucHVzaChfdGhpcy5yZW5kZXJlci5saXN0ZW4oJ2RvY3VtZW50JywgJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlKSB7IHJldHVybiBfdGhpcy5kcmFnRXZlbnQoZSwgc3RhcnQsIGFyZWFBLCBhcmVhQik7IH0pKTtcbiAgICAgICAgICAgIF90aGlzLmRyYWdMaXN0ZW5lcnMucHVzaChfdGhpcy5yZW5kZXJlci5saXN0ZW4oJ2RvY3VtZW50JywgJ3RvdWNobW92ZScsIGZ1bmN0aW9uIChlKSB7IHJldHVybiBfdGhpcy5kcmFnRXZlbnQoZSwgc3RhcnQsIGFyZWFBLCBhcmVhQik7IH0pKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGFyZWFBLmNvbXAubG9ja0V2ZW50cygpO1xuICAgICAgICBhcmVhQi5jb21wLmxvY2tFdmVudHMoKTtcbiAgICAgICAgdGhpcy5pc0RyYWdnaW5nID0gdHJ1ZTtcbiAgICAgICAgdGhpcy5ub3RpZnkoJ3N0YXJ0Jyk7XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IGV2ZW50XG4gICAgICogQHBhcmFtIHs/fSBzdGFydFxuICAgICAqIEBwYXJhbSB7P30gYXJlYUFcbiAgICAgKiBAcGFyYW0gez99IGFyZWFCXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUuZHJhZ0V2ZW50ID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBldmVudFxuICAgICAqIEBwYXJhbSB7P30gc3RhcnRcbiAgICAgKiBAcGFyYW0gez99IGFyZWFBXG4gICAgICogQHBhcmFtIHs/fSBhcmVhQlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGV2ZW50LCBzdGFydCwgYXJlYUEsIGFyZWFCKSB7XG4gICAgICAgIGlmICghdGhpcy5pc0RyYWdnaW5nKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZW5kO1xuICAgICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBNb3VzZUV2ZW50KSB7XG4gICAgICAgICAgICBlbmQgPSB7XG4gICAgICAgICAgICAgICAgeDogZXZlbnQuc2NyZWVuWCxcbiAgICAgICAgICAgICAgICB5OiBldmVudC5zY3JlZW5ZLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChldmVudCBpbnN0YW5jZW9mIFRvdWNoRXZlbnQpIHtcbiAgICAgICAgICAgIGVuZCA9IHtcbiAgICAgICAgICAgICAgICB4OiBldmVudC50b3VjaGVzWzBdLnNjcmVlblgsXG4gICAgICAgICAgICAgICAgeTogZXZlbnQudG91Y2hlc1swXS5zY3JlZW5ZLFxuICAg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dTdGFydFZhbHVlcy5zaXplUGVyY2VudEIpIC0gYXJlYUEuc2l6ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLnJlZnJlc2hTdHlsZVNpemVzKCk7XG4gICAgICAgIHRoaXMubm90aWZ5KCdwcm9ncmVzcycpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUuc3RvcERyYWdnaW5nID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLmlzRHJhZ2dpbmcgPT09IGZhbHNlICYmIHRoaXMuZHJhZ2dpbmdXaXRob3V0TW92ZSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmRpc3BsYXllZEFyZWFzLmZvckVhY2goZnVuY3Rpb24gKGFyZWEpIHtcbiAgICAgICAgICAgIGFyZWEuY29tcC51bmxvY2tFdmVudHMoKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHdoaWxlICh0aGlzLmRyYWdMaXN0ZW5lcnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdmFyIC8qKiBAdHlwZSB7P30gKi8gZmN0ID0gdGhpcy5kcmFnTGlzdGVuZXJzLnBvcCgpO1xuICAgICAgICAgICAgaWYgKGZjdCkge1xuICAgICAgICAgICAgICAgIGZjdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmRyYWdnaW5nV2l0aG91dE1vdmUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIHRoaXMubm90aWZ5KCdjbGljaycpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5ub3RpZnkoJ2VuZCcpO1xuICAgICAgICB9XG4gICAgICAgIHRoa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0dGVyQ2xpY2suZW1pdCh7IGd1dHRlck51bTogdGhpcy5jdXJyZW50R3V0dGVyTnVtLCBzaXplczogYXJlYXNTaXplIH0pO1xuICAgICAgICAgICAgY2FzZSAndHJhbnNpdGlvbkVuZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudHJhbnNpdGlvbkVuZEludGVybmFsLm5leHQoYXJlYXNTaXplKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdENvbXBvbmVudC5wcm90b3R5cGUubmdPbkRlc3Ryb3kgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5zdG9wRHJhZ2dpbmcoKTtcbiAgICB9O1xuICAgIFNwbGl0Q29tcG9uZW50LmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogQ29tcG9uZW50LCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcjogJ3NwbGl0JyxcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlczogW1wiXFxuICAgICAgICA6aG9zdCB7XFxuICAgICAgICAgICAgZGlzcGxheTogZmxleDtcXG4gICAgICAgICAgICBmbGV4LXdyYXA6IG5vd3JhcDtcXG4gICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7XFxuICAgICAgICAgICAgYWxpZ24taXRlbXM6IHN0cmV0Y2g7XFxuICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjtcXG4gICAgICAgICAgICAvKiBcXG4gICAgICAgICAgICAgICAgSW1wb3J0YW50IHRvIGtlZXAgZm9sbG93aW5nIHJ1bGVzIGV2ZW4ga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gICAgIFtvcmRlcl09XFxcImluZGV4KjIrMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtkaXJlY3Rpb25dPVxcXCJkaXJlY3Rpb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbdXNlVHJhbnNpdGlvbl09XFxcInVzZVRyYW5zaXRpb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbc2l6ZV09XFxcImd1dHRlclNpemVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbY29sb3JdPVxcXCJndXR0ZXJDb2xvclxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtpbWFnZUhdPVxcXCJndXR0ZXJJbWFnZUhcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICBbaW1hZ2VWXT1cXFwiZ3V0dGVySW1hZ2VWXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgW2Rpc2FibGVkXT1cXFwiZGlzYWJsZWRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAobW91c2Vkb3duKT1cXFwic3RhcnREcmFnZ2luZygkZXZlbnQsIGluZGV4KjIrMSwgaW5kZXgrMSlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAodG91Y2hzdGFydCk9XFxcInN0YXJ0RHJhZ2dpbmcoJGV2ZW50LCBpbmRleCoyKzEsIGluZGV4KzEpXFxcIj48L3NwbGl0LWd1dHRlcj5cXG4gICAgICAgIDwvbmctdGVtcGxhdGU+XCIsXG4gICAgICAgICAgICAgICAgfSxdIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBTcGxpdENvbXBvbmVudC5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtcbiAgICAgICAgeyB0eXBlOiBOZ1pvbmUsIH0sXG4gICAgICAgIHsgdHlwZTogRWxlbWVudFJlZiwgfSxcbiAgICAgICAgeyB0eXBlOiBDaGFu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NpYmxlID0gdHJ1ZTtcbiAgICAgICAgdGhpcy5sb2NrTGlzdGVuZXJzID0gW107XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdEFyZWFEaXJlY3RpdmUucHJvdG90eXBlLCBcIm9yZGVyXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9vcmRlcjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdiA9IE51bWJlcih2KTtcbiAgICAgICAgICAgIHRoaXMuX29yZGVyID0gIWlzTmFOKHYpID8gdiA6IG51bGw7XG4gICAgICAgICAgICB0aGlzLnNwbGl0LnVwZGF0ZUFyZWEodGhpcywgdHJ1ZSwgZmFsc2UpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRBcmVhRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJzaXplXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9zaXplO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB2ID0gTnVtYmVyKHYpO1xuICAgICAgICAgICAgdGhpcy5fc2l6ZSA9ICghaXNOYU4odikgJiYgdiA+PSAwICYmIHYgPD0gMTAwKSA/ICh2IC8gMTAwKSA6IG51bGw7XG4gICAgICAgICAgICB0aGlzLnNwbGl0LnVwZGF0ZUFyZWEodGhpcywgZmFsc2UsIHRydWUpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRBcmVhRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJtaW5TaXplXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9taW5TaXplO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB2ID0gTnVtYmVyKHYpO1xuICAgICAgICAgICAgdGhpcy5fbWluU2l6ZSA9ICghaXNOYU4odikgJiYgdiA+IDAgJiYgdiA8IDEwMCkgPyB2IC8gMTAwIDogMDtcbiAgICAgICAgICAgIHRoaXMuc3BsaXQudXBkYXRlQXJlYSh0aGlzLCBmYWxzZSwgdHJ1ZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdEFyZWFEaXJlY3RpdmUucHJvdG90eXBlLCBcInZpc2libGVcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3Zpc2libGU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHYgPSAodHlwZW9mICh2KSA9PT0gJ2Jvb2xlYW4nKSA/IHYgOiAodiA9PT0gJ2ZhbHNlJyA/IGZhbHNlIDogdHJ1ZSk7XG4gICAgICAgICAgICB0aGlzLl92aXNpYmxlID0gdjtcbiAgICAgICAgICAgIGlmICh0aGlzLnZpc2libGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNwbGl0LnNob3dBcmVhKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zcGxpdC5oaWRlQXJlYSh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBTcGxpdEFyZWFEaXJlY3RpdmUucHJvdG90eXBlLm5nT25Jbml0ID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMuc3BsaXQuYWRkQXJlYSh0aGlzKTtcbiAgICAgICAgdGhpcy5yZW5kZXJlci5zZXRTdHlsZSh0aGlzLmVsUmVmLm5hdGl2ZUVsZW1lbnQsICdmbGV4LWdyb3cnLCAnMCcpO1xu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aXMuZWxSZWYgPSBlbFJlZjtcbiAgICAgICAgdGhpcy5yZW5kZXJlciA9IHJlbmRlcmVyO1xuICAgICAgICB0aGlzLl9kaXNhYmxlZCA9IGZhbHNlO1xuICAgIH1cbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcIm9yZGVyXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5zZXRTdHlsZSh0aGlzLmVsUmVmLm5hdGl2ZUVsZW1lbnQsICdvcmRlcicsIHYpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcImRpcmVjdGlvblwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZGlyZWN0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB0aGlzLl9kaXJlY3Rpb24gPSB2O1xuICAgICAgICAgICAgdGhpcy5yZWZyZXNoU3R5bGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0R3V0dGVyRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJ1c2VUcmFuc2l0aW9uXCIsIHtcbiAgICAgICAgc2V0OiAvKipcbiAgICAgICAgICogQHBhcmFtIHs/fSB2XG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnNldFN0eWxlKHRoaXMuZWxSZWYubmF0aXZlRWxlbWVudCwgJ3RyYW5zaXRpb24nLCBcImZsZXgtYmFzaXMgMC4zc1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIucmVtb3ZlU3R5bGUodGhpcy5lbFJlZi5uYXRpdmVFbGVtZW50LCAndHJhbnNpdGlvbicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcInNpemVcIiwge1xuICAgICAgICBnZXQ6IC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3NpemU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX3NpemUgPSB2O1xuICAgICAgICAgICAgdGhpcy5yZWZyZXNoU3R5bGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0R3V0dGVyRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJjb2xvclwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fY29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2NvbG9yID0gdjtcbiAgICAgICAgICAgIHRoaXMucmVmcmVzaFN0eWxlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTcGxpdEd1dHRlckRpcmVjdGl2ZS5wcm90b3R5cGUsIFwiaW1hZ2VIXCIsIHtcbiAgICAgICAgZ2V0OiAvKipcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9pbWFnZUg7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHRoaXMuX2ltYWdlSCA9IHY7XG4gICAgICAgICAgICB0aGlzLnJlZnJlc2hTdHlsZSgpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLCBcImltYWdlVlwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faW1hZ2VWO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IC8qKlxuICAgICAgICAgKiBAcGFyYW0gez99IHZcbiAgICAgICAgICogQHJldHVybiB7P31cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICB0aGlzLl9pbWFnZVYgPSB2O1xuICAgICAgICAgICAgdGhpcy5yZWZyZXNoU3R5bGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFNwbGl0R3V0dGVyRGlyZWN0aXZlLnByb3RvdHlwZSwgXCJkaXNhYmxlZFwiLCB7XG4gICAgICAgIGdldDogLyoqXG4gICAgICAgICAqIEByZXR1cm4gez99XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZGlzYWJsZWQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogLyoqXG4gICAgICAgICAqIEBwYXJhbSB7P30gdlxuICAgICAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAgICAgKi9cbiA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Rpb247XG4gICAgICAgIHRoaXMucmVuZGVyZXIuc2V0U3R5bGUodGhpcy5lbFJlZi5uYXRpdmVFbGVtZW50LCAnYmFja2dyb3VuZC1pbWFnZScsIHRoaXMuZ2V0SW1hZ2Uoc3RhdGUpKTtcbiAgICAgICAgdGhpcy5yZW5kZXJlci5zZXRTdHlsZSh0aGlzLmVsUmVmLm5hdGl2ZUVsZW1lbnQsICdjdXJzb3InLCB0aGlzLmdldEN1cnNvcihzdGF0ZSkpO1xuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLmdldEN1cnNvciA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3RhdGVcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIChzdGF0ZSkge1xuICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7XG4gICAgICAgICAgICBjYXNlICdob3Jpem9udGFsJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2NvbC1yZXNpemUnO1xuICAgICAgICAgICAgY2FzZSAndmVydGljYWwnOlxuICAgICAgICAgICAgICAgIHJldHVybiAncm93LXJlc2l6ZSc7XG4gICAgICAgICAgICBjYXNlICdkaXNhYmxlZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZWZhdWx0JztcbiAgICAgICAgfVxuICAgIH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgU3BsaXRHdXR0ZXJEaXJlY3RpdmUucHJvdG90eXBlLmdldEltYWdlID0gLyoqXG4gICAgICogQHBhcmFtIHs/fSBzdGF0ZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN0YXRlKSB7XG4gICAgICAgIHN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4gICAgQW5ndWxhclNwbGl0TW9kdWxlLmZvclJvb3QgPSAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIG5nTW9kdWxlOiBBbmd1bGFyU3BsaXRNb2R1bGUsXG4gICAgICAgICAgICBwcm92aWRlcnM6IFtdXG4gICAgICAgIH07XG4gICAgfTtcbiAgICAvKipcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIEFuZ3VsYXJTcGxpdE1vZHVsZS5mb3JDaGlsZCA9IC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbmdNb2R1bGU6IEFuZ3VsYXJTcGxpdE1vZHVsZSxcbiAgICAgICAgICAgIHByb3ZpZGVyczogW11cbiAgICAgICAgfTtcbiAgICB9O1xuICAgIEFuZ3VsYXJTcGxpdE1vZHVsZS5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IE5nTW9kdWxlLCBhcmdzOiBbe1xuICAgICAgICAgICAgICAgICAgICBpbXBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBDb21tb25Nb2R1bGVcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgZGVjbGFyYXRpb25zOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBTcGxpdENvbXBvbmVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIFNwbGl0QXJlYURpcmVjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFNwbGl0R3V0dGVyRGlyZWN0aXZlLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICBleHBvcnRzOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICBTcGxpdENvbXBvbmVudCxcbiAgICAgICA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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///184\n"); /***/ }), /* 185 */ @@ -688,7 +688,7 @@ eval("function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JitCompilerFactory\", function() { return JitCompilerFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RESOURCE_CACHE_PROVIDER\", function() { return RESOURCE_CACHE_PROVIDER; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"platformBrowserDynamic\", function() { return platformBrowserDynamic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵCompilerImpl\", function() { return CompilerImpl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵplatformCoreDynamic\", function() { return platformCoreDynamic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS\", function() { return INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵResourceLoaderImpl\", function() { return ResourceLoaderImpl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return CachedResourceLoader; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_compiler__ = __webpack_require__(507);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar MODULE_SUFFIX = '';\nvar builtinExternalReferences = createBuiltinExternalReferencesMap();\nvar JitReflector = /** @class */ (function () {\n function JitReflector() {\n this.builtinExternalReferences = new Map();\n this.reflectionCapabilities = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵReflectionCapabilities\"]();\n }\n /**\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n JitReflector.prototype.componentModuleUrl = /**\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n function (type, cmpMetadata) {\n var /** @type {?} */ moduleId = cmpMetadata.moduleId;\n if (typeof moduleId === 'string') {\n var /** @type {?} */ scheme = Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"z\" /* getUrlScheme */])(moduleId);\n return scheme ? moduleId : \"package:\" + moduleId + MODULE_SUFFIX;\n }\n else if (moduleId !== null && moduleId !== void 0) {\n throw Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"A\" /* syntaxError */])(\"moduleId should be a string in \\\"\" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵstringify\"])(type) + \"\\\". See https://goo.gl/wIDDiL for more information.\\n\" +\n \"If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.\");\n }\n return \"./\" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵstringify\"])(type);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.parameters = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.parameters(typeOrFunc);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.annotations = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.annotations(typeOrFunc);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.propMetadata = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.propMetadata(typeOrFunc);\n };\n /**\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n JitReflector.prototype.hasLifecycleHook = /**\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n function (type, lcProperty) {\n return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n };\n /**\n * @param {?} type\n * @return {?}\n */\n JitReflector.prototype.guards = /**\n * @param {?} type\n * @return {?}\n */\n function (type) { return this.reflectionCapabilities.guards(type); };\n /**\n * @param {?} ref\n * @return {?}\n */\n JitReflector.prototype.resolveExternalReference = /**\n * @param {?} ref\n * @return {?}\n */\n function (ref) {\n return builtinExternalReferences.get(ref) || ref.runtime;\n };\n return JitReflector;\n}());\n/**\n * @return {?}\n */\nfunction createBuiltinExternalReferencesMap() {\n var /** @type {?} */ map = new Map();\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ANALYZE_FOR_ENTRY_COMPONENTS, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ANALYZE_FOR_ENTRY_COMPONENTS\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ElementRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].NgModuleRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ViewContainerRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewContainerRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ChangeDetectorRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].QueryList, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"QueryList\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].TemplateRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TemplateRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].CodegenComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵCodegenComponentFactoryResolver\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactoryResolver\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].NgModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵcmf\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].moduleDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵmod\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].moduleProviderDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵmpd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].RegisterModuleFactoryFn, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵregisterModuleFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].Injector, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ViewEncapsulation, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ChangeDetectionStrategy, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectionStrategy\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].SecurityContext, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].LOCALE_ID, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"LOCALE_ID\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].TRANSLATIONS_FORMAT, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS_FORMAT\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].inlineInterpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵinlineInterpolate\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].interpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵinterpolate\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].EMPTY_ARRAY, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵEMPTY_ARRAY\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].EMPTY_MAP, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵEMPTY_MAP\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].Renderer, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].viewDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵvid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].elementDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵeld\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].anchorDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵand\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].textDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵted\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].directiveDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵdid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].providerDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵprd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].queryDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵqud\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pureArrayDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpad\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pureObjectDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpod\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].purePipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵppd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].nodeValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵnov\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ngContentDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵncd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].unwrapValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵunv\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createRendererType2, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵcrt\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵccf\"]);\n return map;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ERROR_COLLECTOR_TOKEN = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ErrorCollector');\n/**\n * A default provider for {\\@link PACKAGE_ROOT_URL} that maps to '/'.\n */\nvar DEFAULT_PACKAGE_URL_PROVIDER = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PACKAGE_ROOT_URL\"],\n useValue: '/'\n};\nvar _NO_RESOURCE_LOADER = {\n get: /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n throw new Error(\"No ResourceLoader implementation has been provided. Can't read the url \\\"\" + url + \"\\\"\");\n }\n};\nvar baseHtmlParser = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('HtmlParser');\nvar CompilerImpl = /** @class */ (function () {\n function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console) {\n this._metadataResolver = _metadataResolver;\n this._delegate = new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"k\" /* JitCompiler */](_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));\n this.injector = injector;\n }\n /**\n * @return {?}\n */\n CompilerImpl.prototype.getExtraNgModuleProviders = /**\n * @return {?}\n */\n function () {\n return [this._metadataResolver.getProviderMetadata(new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"r\" /* ProviderMeta */](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], { useValue: this }))];\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleSync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return /** @type {?} */ (this._delegate.compileModuleSync(moduleType));\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAsync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return /** @type {?} */ (this._delegate.compileModuleAsync(moduleType));\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAndAllComponentsSync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n var /** @type {?} */ result = this._delegate.compileModuleAndAllComponentsSync(moduleType);\n return {\n ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),\n componentFactories: /** @type {?} */ (result.componentFactories),\n };\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAndAllComponentsAsync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return this._delegate.compileModuleAndAllComponentsAsync(moduleType)\n .then(function (result) {\n return ({\n ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),\n componentFactories: /** @type {?} */ (result.componentFactories),\n });\n });\n };\n /**\n * @param {?} summaries\n * @return {?}\n */\n CompilerImpl.prototype.loadAotSummaries = /**\n * @param {?} summaries\n * @return {?}\n */\n function (summaries) { this._delegate.loadAotSummaries(summaries); };\n /**\n * @param {?} ref\n * @return {?}\n */\n CompilerImpl.prototype.hasAotSummary = /**\n * @param {?} ref\n * @return {?}\n */\n function (ref) { return this._delegate.hasAotSummary(ref); };\n /**\n * @template T\n * @param {?} component\n * @return {?}\n */\n CompilerImpl.prototype.getComponentFactory = /**\n * @template T\n * @param {?} component\n * @return {?}\n */\n function (component) {\n return /** @type {?} */ (this._delegate.getComponentFactory(component));\n };\n /**\n * @return {?}\n */\n CompilerImpl.prototype.clearCache = /**\n * @return {?}\n */\n function () { this._delegate.clearCache(); };\n /**\n * @param {?} type\n * @return {?}\n */\n CompilerImpl.prototype.clearCacheFor = /**\n * @param {?} type\n * @return {?}\n */\n function (type) { this._delegate.clearCacheFor(type); };\n return CompilerImpl;\n}());\n/**\n * A set of providers that provide `JitCompiler` and its dependencies to use for\n * template compilation.\n */\nvar COMPILER_PROVIDERS = /** @type {?} */ ([\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */], useValue: new JitReflector() },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useValue: _NO_RESOURCE_LOADER },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"l\" /* JitSummaryResolver */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"l\" /* JitSummaryResolver */] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"m\" /* Lexer */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"p\" /* Parser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"m\" /* Lexer */]] },\n {\n provide: baseHtmlParser,\n useClass: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */],\n deps: [],\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */],\n useFactory: function (parser, translations, format, config, console) {\n translations = translations || '';\n var /** @type {?} */ missingTranslation = translations ? /** @type {?} */ ((config.missingTranslation)) : __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"MissingTranslationStrategy\"].Ignore;\n return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */](parser, translations, format, missingTranslation, console);\n },\n deps: [\n baseHtmlParser,\n [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS\"])],\n [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS_FORMAT\"])],\n [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]],\n ]\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */],\n useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */],\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"w\" /* TemplateParser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"p\" /* Parser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]]\n },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"d\" /* DirectiveNormalizer */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"a\" /* CompileMetadataResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"o\" /* NgModuleResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"e\" /* DirectiveResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"q\" /* PipeResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"d\" /* DirectiveNormalizer */], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"t\" /* StaticSymbolCache */]],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"], ERROR_COLLECTOR_TOKEN]] },\n DEFAULT_PACKAGE_URL_PROVIDER,\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"u\" /* StyleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"y\" /* ViewCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"n\" /* NgModuleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], useValue: new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]() },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], useClass: CompilerImpl, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"a\" /* CompileMetadataResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"w\" /* TemplateParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"u\" /* StyleCompiler */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"y\" /* ViewCompiler */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"n\" /* NgModuleCompiler */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */],\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"f\" /* DomElementSchemaRegistry */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"f\" /* DomElementSchemaRegistry */] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */], deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PACKAGE_ROOT_URL\"]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"e\" /* DirectiveResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"q\" /* PipeResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"o\" /* NgModuleResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n]);\n/**\n * \\@experimental\n */\nvar JitCompilerFactory = /** @class */ (function () {\n /* @internal */\n function JitCompilerFactory(defaultOptions) {\n var /** @type {?} */ compilerOptions = {\n useJit: true,\n defaultEncapsulation: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Emulated,\n missingTranslation: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"MissingTranslationStrategy\"].Warning,\n enableLegacyTemplate: false,\n };\n this._defaultOptions = [compilerOptions].concat(defaultOptions);\n }\n /**\n * @param {?=} options\n * @return {?}\n */\n JitCompilerFactory.prototype.createCompiler = /**\n * @param {?=} options\n * @return {?}\n */\n function (options) {\n if (options === void 0) { options = []; }\n var /** @type {?} */ opts = _mergeOptions(this._defaultOptions.concat(options));\n var /** @type {?} */ injector = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"].create([\n COMPILER_PROVIDERS, {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */],\n useFactory: function () {\n return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]({\n // let explicit values from the compiler options overwrite options\n // from the app providers\n useJit: opts.useJit,\n jitDevMode: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])(),\n // let explicit values from the compiler options overwrite options\n // from the app providers\n defaultEncapsulation: opts.defaultEncapsulation,\n missingTranslation: opts.missingTranslation,\n enableLegacyTemplate: opts.enableLegacyTemplate,\n preserveWhitespaces: opts.preserveWhitespaces,\n });\n },\n deps: []\n },\n /** @type {?} */ ((opts.providers))\n ]);\n return injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"]);\n };\n return JitCompilerFactory;\n}());\n/**\n * @param {?} optionsArr\n * @return {?}\n */\nfunction _mergeOptions(optionsArr) {\n return {\n useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),\n defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),\n providers: _mergeArrays(optionsArr.map(function (options) { return ((options.providers)); })),\n missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),\n enableLegacyTemplate: _lastDefined(optionsArr.map(function (options) { return options.enableLegacyTemplate; })),\n preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),\n };\n}\n/**\n * @template T\n * @param {?} args\n * @return {?}\n */\nfunction _lastDefined(args) {\n for (var /** @type {?} */ i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n/**\n * @param {?} parts\n * @return {?}\n */\nfunction _mergeArrays(parts) {\n var /** @type {?} */ result = [];\n parts.forEach(function (part) { return part && result.push.apply(result, part); });\n return result;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A platform that included corePlatform and the compiler.\n *\n * \\@experimental\n */\nvar platformCoreDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"platformCore\"], 'coreDynamic', [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"], useValue: {}, multi: true },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"CompilerFactory\"], useClass: JitCompilerFactory, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"]] },\n]);\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar ResourceLoaderImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_4_tslib__[\"b\" /* __extends */])(ResourceLoaderImpl, _super);\n function ResourceLoaderImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} url\n * @return {?}\n */\n ResourceLoaderImpl.prototype.get = /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ resolve;\n var /** @type {?} */ reject;\n var /** @type {?} */ promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n var /** @type {?} */ xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'text';\n xhr.onload = function () {\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in ResourceLoader Level2 spec (supported\n // by IE10)\n var /** @type {?} */ response = xhr.response || xhr.responseText;\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : 0;\n }\n if (200 <= status && status <= 300) {\n resolve(response);\n }\n else {\n reject(\"Failed to load \" + url);\n }\n };\n xhr.onerror = function () { reject(\"Failed to load \" + url); };\n xhr.send();\n return promise;\n };\n ResourceLoaderImpl.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n ResourceLoaderImpl.ctorParameters = function () { return []; };\n return ResourceLoaderImpl;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [\n __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__[\"ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS\"],\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"],\n useValue: { providers: [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useClass: ResourceLoaderImpl, deps: [] }] },\n multi: true\n },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_ID\"], useValue: __WEBPACK_IMPORTED_MODULE_2__angular_common__[\"ɵPLATFORM_BROWSER_ID\"] },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An implementation of ResourceLoader that uses a template cache to avoid doing an actual\n * ResourceLoader.\n *\n * The template cache needs to be built and loaded into window.$templateCache\n * via a separate mechanism.\n */\nvar CachedResourceLoader = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_4_tslib__[\"b\" /* __extends */])(CachedResourceLoader, _super);\n function CachedResourceLoader() {\n var _this = _super.call(this) || this;\n _this._cache = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"])).$templateCache;\n if (_this._cache == null) {\n throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');\n }\n return _this;\n }\n /**\n * @param {?} url\n * @return {?}\n */\n CachedResourceLoader.prototype.get = /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n if (this._cache.hasOwnProperty(url)) {\n return Promise.resolve(this._cache[url]);\n }\n else {\n return /** @type {?} */ (Promise.reject('CachedResourceLoader: Did not find cached template for ' + url));\n }\n };\n return CachedResourceLoader;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental\n */\nvar RESOURCE_CACHE_PROVIDER = [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useClass: CachedResourceLoader, deps: [] }];\n/**\n * \\@stable\n */\nvar platformBrowserDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=platform-browser-dynamic.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0Bhbmd1bGFyL3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYy9lc201L3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYy5qcz9lMGY1Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBDb21waWxlTWV0YWRhdGFSZXNvbHZlciwgQ29tcGlsZVJlZmxlY3RvciwgQ29tcGlsZXJDb25maWcsIERpcmVjdGl2ZU5vcm1hbGl6ZXIsIERpcmVjdGl2ZVJlc29sdmVyLCBEb21FbGVtZW50U2NoZW1hUmVnaXN0cnksIEVsZW1lbnRTY2hlbWFSZWdpc3RyeSwgSHRtbFBhcnNlciwgSTE4Tkh0bWxQYXJzZXIsIElkZW50aWZpZXJzLCBKaXRDb21waWx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gKi8gKHJlc3VsdC5uZ01vZHVsZUZhY3RvcnkpLFxuICAgICAgICAgICAgY29tcG9uZW50RmFjdG9yaWVzOiAvKiogQHR5cGUgez99ICovIChyZXN1bHQuY29tcG9uZW50RmFjdG9yaWVzKSxcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEB0ZW1wbGF0ZSBUXG4gICAgICogQHBhcmFtIHs/fSBtb2R1bGVUeXBlXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBDb21waWxlckltcGwucHJvdG90eXBlLmNvbXBpbGVNb2R1bGVBbmRBbGxDb21wb25lbnRzQXN5bmMgPSAvKipcbiAgICAgKiBAdGVtcGxhdGUgVFxuICAgICAqIEBwYXJhbSB7P30gbW9kdWxlVHlwZVxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKG1vZHVsZVR5cGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2RlbGVnYXRlLmNvbXBpbGVNb2R1bGVBbmRBbGxDb21wb25lbnRzQXN5bmMobW9kdWxlVHlwZSlcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIHJldHVybiAoe1xuICAgICAgICAgICAgICAgIG5nTW9kdWxlRmFjdG9yeTogLyoqIEB0eXBlIHs/fSAqLyAocmVzdWx0Lm5nTW9kdWxlRmFjdG9yeSksXG4gICAgICAgICAgICAgICAgY29tcG9uZW50RmFjdG9yaWVzOiAvKiogQHR5cGUgez99ICovIChyZXN1bHQuY29tcG9uZW50RmFjdG9yaWVzKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3VtbWFyaWVzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBDb21waWxlckltcGwucHJvdG90eXBlLmxvYWRBb3RTdW1tYXJpZXMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN1bW1hcmllc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN1bW1hcmllcykgeyB0aGlzLl9kZWxlZ2F0ZS5sb2FkQW90U3VtbWFyaWVzKHN1bW1hcmllcyk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByZWZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIENvbXBpbGVySW1wbC5wcm90b3R5cGUuaGFzQW90U3VtbWFyeSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocmVmKSB7IHJldHVybiB0aGlzLl9kZWxlZ2F0ZS5oYXNBb3RTdW1tYXJ5KHJlZik7IH07XG4gICAgLyoqXG4gICAgICogQHRlbXBsYXRlIFRcbiAgICAgKiBAcGFyYW0gez99IGNvbXBvbmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQ29tcGlsZXJJbXBsLnByb3RvdHlwZS5nZXRDb21wb25lbnRGYWN0b3J5ID0gLyoqXG4gICAgICogQHRlbXBsYXRlIFRcbiAgICAgKiBAcGFyYW0gez99IGNvbXBvbmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbXBvbmVudCkge1xuICAgICAgICByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5fZGVsZWdhdGUuZ2V0Q29tcG9uZW50RmFjdG9yeShjb21wb25lbnQpKTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQ29tcGlsZXJJbXBsLnByb3RvdHlwZS5jbGVhckNhY2hlID0gLyoqXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAoKSB7IHRoaXMuX2RlbGVnYXRlLmNsZWFyQ2F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dG9yLmNyZWF0ZShbXG4gICAgICAgICAgICBDT01QSUxFUl9QUk9WSURFUlMsIHtcbiAgICAgICAgICAgICAgICBwcm92aWRlOiBDb21waWxlckNvbmZpZyxcbiAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQ29tcGlsZXJDb25maWcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGV4cGxpY2l0IHZhbHVlcyBmcm9tIHRoZSBjb21waWxlciBvcHRpb25zIG92ZXJ3cml0ZSBvcHRpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBhcHAgcHJvdmlkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICB1c2VKaXQ6IG9wdHMudXNlSml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgaml0RGV2TW9kZTogaXNEZXZNb2RlKCksXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgZXhwbGljaXQgdmFsdWVzIGZyb20gdGhlIGNvbXBpbGVyIG9wdGlvbnMgb3ZlcndyaXRlIG9wdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZyb20gdGhlIGFwcCBwcm92aWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRFbmNhcHN1bGF0aW9uOiBvcHRzLmRlZmF1bHRFbmNhcHN1bGF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWlzc2luZ1RyYW5zbGF0aW9uOiBvcHRzLm1pc3NpbmdUcmFuc2xhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZUxlZ2FjeVRlbXBsYXRlOiBvcHRzLmVuYWJsZUxlZ2FjeVRlbXBsYXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlc2VydmVXaGl0ZXNwYWNlczogb3B0cy5wcmVzZXJ2ZVdoaXRlc3BhY2VzLFxuICA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ywgYXJndW1lbnRzKSB8fCB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUmVzb3VyY2VMb2FkZXJJbXBsLnByb3RvdHlwZS5nZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXNvbHZlO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZWplY3Q7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByb21pc2UgPSBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzLCByZWopIHtcbiAgICAgICAgICAgIHJlc29sdmUgPSByZXM7XG4gICAgICAgICAgICByZWplY3QgPSByZWo7XG4gICAgICAgIH0pO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgeGhyLm9wZW4oJ0dFVCcsIHVybCwgdHJ1ZSk7XG4gICAgICAgIHhoci5yZXNwb25zZVR5cGUgPSAndGV4dCc7XG4gICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAvLyByZXNwb25zZVRleHQgaXMgdGhlIG9sZC1zY2hvb2wgd2F5IG9mIHJldHJpZXZpbmcgcmVzcG9uc2UgKHN1cHBvcnRlZCBieSBJRTggJiA5KVxuICAgICAgICAgICAgLy8gcmVzcG9uc2UvcmVzcG9uc2VUeXBlIHByb3BlcnRpZXMgd2VyZSBpbnRyb2R1Y2VkIGluIFJlc291cmNlTG9hZGVyIExldmVsMiBzcGVjIChzdXBwb3J0ZWRcbiAgICAgICAgICAgIC8vIGJ5IElFMTApXG4gICAgICAgICAgICB2YXIgLyoqIEB0eXBlI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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///242\n"); +eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VERSION\", function() { return VERSION; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"JitCompilerFactory\", function() { return JitCompilerFactory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RESOURCE_CACHE_PROVIDER\", function() { return RESOURCE_CACHE_PROVIDER; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"platformBrowserDynamic\", function() { return platformBrowserDynamic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵCompilerImpl\", function() { return CompilerImpl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵplatformCoreDynamic\", function() { return platformCoreDynamic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS\", function() { return INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵResourceLoaderImpl\", function() { return ResourceLoaderImpl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ɵa\", function() { return CachedResourceLoader; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_compiler__ = __webpack_require__(507);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tslib__ = __webpack_require__(63);\n/**\n * @license Angular v5.2.2\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n\n\n\n\n\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar MODULE_SUFFIX = '';\nvar builtinExternalReferences = createBuiltinExternalReferencesMap();\nvar JitReflector = /** @class */ (function () {\n function JitReflector() {\n this.builtinExternalReferences = new Map();\n this.reflectionCapabilities = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵReflectionCapabilities\"]();\n }\n /**\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n JitReflector.prototype.componentModuleUrl = /**\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n function (type, cmpMetadata) {\n var /** @type {?} */ moduleId = cmpMetadata.moduleId;\n if (typeof moduleId === 'string') {\n var /** @type {?} */ scheme = Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"z\" /* getUrlScheme */])(moduleId);\n return scheme ? moduleId : \"package:\" + moduleId + MODULE_SUFFIX;\n }\n else if (moduleId !== null && moduleId !== void 0) {\n throw Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"A\" /* syntaxError */])(\"moduleId should be a string in \\\"\" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵstringify\"])(type) + \"\\\". See https://goo.gl/wIDDiL for more information.\\n\" +\n \"If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.\");\n }\n return \"./\" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵstringify\"])(type);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.parameters = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.parameters(typeOrFunc);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.annotations = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.annotations(typeOrFunc);\n };\n /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n JitReflector.prototype.propMetadata = /**\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (typeOrFunc) {\n return this.reflectionCapabilities.propMetadata(typeOrFunc);\n };\n /**\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n JitReflector.prototype.hasLifecycleHook = /**\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n function (type, lcProperty) {\n return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n };\n /**\n * @param {?} type\n * @return {?}\n */\n JitReflector.prototype.guards = /**\n * @param {?} type\n * @return {?}\n */\n function (type) { return this.reflectionCapabilities.guards(type); };\n /**\n * @param {?} ref\n * @return {?}\n */\n JitReflector.prototype.resolveExternalReference = /**\n * @param {?} ref\n * @return {?}\n */\n function (ref) {\n return builtinExternalReferences.get(ref) || ref.runtime;\n };\n return JitReflector;\n}());\n/**\n * @return {?}\n */\nfunction createBuiltinExternalReferencesMap() {\n var /** @type {?} */ map = new Map();\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ANALYZE_FOR_ENTRY_COMPONENTS, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ANALYZE_FOR_ENTRY_COMPONENTS\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ElementRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ElementRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].NgModuleRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ViewContainerRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewContainerRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ChangeDetectorRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectorRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].QueryList, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"QueryList\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].TemplateRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TemplateRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].CodegenComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵCodegenComponentFactoryResolver\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactoryResolver\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ComponentRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ComponentRef\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].NgModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"NgModuleFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵcmf\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].moduleDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵmod\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].moduleProviderDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵmpd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].RegisterModuleFactoryFn, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵregisterModuleFactory\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].Injector, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ViewEncapsulation, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ChangeDetectionStrategy, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ChangeDetectionStrategy\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].SecurityContext, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"SecurityContext\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].LOCALE_ID, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"LOCALE_ID\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].TRANSLATIONS_FORMAT, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS_FORMAT\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].inlineInterpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵinlineInterpolate\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].interpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵinterpolate\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].EMPTY_ARRAY, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵEMPTY_ARRAY\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].EMPTY_MAP, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵEMPTY_MAP\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].Renderer, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Renderer\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].viewDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵvid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].elementDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵeld\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].anchorDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵand\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].textDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵted\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].directiveDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵdid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].providerDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵprd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].queryDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵqud\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pureArrayDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpad\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pureObjectDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpod\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].purePipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵppd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].pipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵpid\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].nodeValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵnov\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].ngContentDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵncd\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].unwrapValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵunv\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createRendererType2, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵcrt\"]);\n map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"j\" /* Identifiers */].createComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵccf\"]);\n return map;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ERROR_COLLECTOR_TOKEN = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('ErrorCollector');\n/**\n * A default provider for {\\@link PACKAGE_ROOT_URL} that maps to '/'.\n */\nvar DEFAULT_PACKAGE_URL_PROVIDER = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PACKAGE_ROOT_URL\"],\n useValue: '/'\n};\nvar _NO_RESOURCE_LOADER = {\n get: /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n throw new Error(\"No ResourceLoader implementation has been provided. Can't read the url \\\"\" + url + \"\\\"\");\n }\n};\nvar baseHtmlParser = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"InjectionToken\"]('HtmlParser');\nvar CompilerImpl = /** @class */ (function () {\n function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console) {\n this._metadataResolver = _metadataResolver;\n this._delegate = new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"k\" /* JitCompiler */](_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));\n this.injector = injector;\n }\n /**\n * @return {?}\n */\n CompilerImpl.prototype.getExtraNgModuleProviders = /**\n * @return {?}\n */\n function () {\n return [this._metadataResolver.getProviderMetadata(new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"r\" /* ProviderMeta */](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], { useValue: this }))];\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleSync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return /** @type {?} */ (this._delegate.compileModuleSync(moduleType));\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAsync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return /** @type {?} */ (this._delegate.compileModuleAsync(moduleType));\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAndAllComponentsSync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n var /** @type {?} */ result = this._delegate.compileModuleAndAllComponentsSync(moduleType);\n return {\n ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),\n componentFactories: /** @type {?} */ (result.componentFactories),\n };\n };\n /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n CompilerImpl.prototype.compileModuleAndAllComponentsAsync = /**\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\n function (moduleType) {\n return this._delegate.compileModuleAndAllComponentsAsync(moduleType)\n .then(function (result) {\n return ({\n ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),\n componentFactories: /** @type {?} */ (result.componentFactories),\n });\n });\n };\n /**\n * @param {?} summaries\n * @return {?}\n */\n CompilerImpl.prototype.loadAotSummaries = /**\n * @param {?} summaries\n * @return {?}\n */\n function (summaries) { this._delegate.loadAotSummaries(summaries); };\n /**\n * @param {?} ref\n * @return {?}\n */\n CompilerImpl.prototype.hasAotSummary = /**\n * @param {?} ref\n * @return {?}\n */\n function (ref) { return this._delegate.hasAotSummary(ref); };\n /**\n * @template T\n * @param {?} component\n * @return {?}\n */\n CompilerImpl.prototype.getComponentFactory = /**\n * @template T\n * @param {?} component\n * @return {?}\n */\n function (component) {\n return /** @type {?} */ (this._delegate.getComponentFactory(component));\n };\n /**\n * @return {?}\n */\n CompilerImpl.prototype.clearCache = /**\n * @return {?}\n */\n function () { this._delegate.clearCache(); };\n /**\n * @param {?} type\n * @return {?}\n */\n CompilerImpl.prototype.clearCacheFor = /**\n * @param {?} type\n * @return {?}\n */\n function (type) { this._delegate.clearCacheFor(type); };\n return CompilerImpl;\n}());\n/**\n * A set of providers that provide `JitCompiler` and its dependencies to use for\n * template compilation.\n */\nvar COMPILER_PROVIDERS = /** @type {?} */ ([\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */], useValue: new JitReflector() },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useValue: _NO_RESOURCE_LOADER },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"l\" /* JitSummaryResolver */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"l\" /* JitSummaryResolver */] },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"m\" /* Lexer */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"p\" /* Parser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"m\" /* Lexer */]] },\n {\n provide: baseHtmlParser,\n useClass: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */],\n deps: [],\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */],\n useFactory: function (parser, translations, format, config, console) {\n translations = translations || '';\n var /** @type {?} */ missingTranslation = translations ? /** @type {?} */ ((config.missingTranslation)) : __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"MissingTranslationStrategy\"].Ignore;\n return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */](parser, translations, format, missingTranslation, console);\n },\n deps: [\n baseHtmlParser,\n [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS\"])],\n [new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Inject\"](__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"TRANSLATIONS_FORMAT\"])],\n [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]],\n ]\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */],\n useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */],\n },\n {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"w\" /* TemplateParser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"p\" /* Parser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"i\" /* I18NHtmlParser */], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]]\n },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"d\" /* DirectiveNormalizer */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"a\" /* CompileMetadataResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"h\" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"o\" /* NgModuleResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"e\" /* DirectiveResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"q\" /* PipeResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"d\" /* DirectiveNormalizer */], __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"t\" /* StaticSymbolCache */]],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */],\n [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Optional\"], ERROR_COLLECTOR_TOKEN]] },\n DEFAULT_PACKAGE_URL_PROVIDER,\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"u\" /* StyleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"y\" /* ViewCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"n\" /* NgModuleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */], useValue: new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]() },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"], useClass: CompilerImpl, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"a\" /* CompileMetadataResolver */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"w\" /* TemplateParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"u\" /* StyleCompiler */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"y\" /* ViewCompiler */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"n\" /* NgModuleCompiler */],\n __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"v\" /* SummaryResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */],\n __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵConsole\"]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"f\" /* DomElementSchemaRegistry */], deps: [] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"g\" /* ElementSchemaRegistry */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"f\" /* DomElementSchemaRegistry */] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"x\" /* UrlResolver */], deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PACKAGE_ROOT_URL\"]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"e\" /* DirectiveResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"q\" /* PipeResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"o\" /* NgModuleResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"b\" /* CompileReflector */]] },\n]);\n/**\n * \\@experimental\n */\nvar JitCompilerFactory = /** @class */ (function () {\n /* @internal */\n function JitCompilerFactory(defaultOptions) {\n var /** @type {?} */ compilerOptions = {\n useJit: true,\n defaultEncapsulation: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ViewEncapsulation\"].Emulated,\n missingTranslation: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"MissingTranslationStrategy\"].Warning,\n enableLegacyTemplate: false,\n };\n this._defaultOptions = [compilerOptions].concat(defaultOptions);\n }\n /**\n * @param {?=} options\n * @return {?}\n */\n JitCompilerFactory.prototype.createCompiler = /**\n * @param {?=} options\n * @return {?}\n */\n function (options) {\n if (options === void 0) { options = []; }\n var /** @type {?} */ opts = _mergeOptions(this._defaultOptions.concat(options));\n var /** @type {?} */ injector = __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injector\"].create([\n COMPILER_PROVIDERS, {\n provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */],\n useFactory: function () {\n return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"c\" /* CompilerConfig */]({\n // let explicit values from the compiler options overwrite options\n // from the app providers\n useJit: opts.useJit,\n jitDevMode: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"isDevMode\"])(),\n // let explicit values from the compiler options overwrite options\n // from the app providers\n defaultEncapsulation: opts.defaultEncapsulation,\n missingTranslation: opts.missingTranslation,\n enableLegacyTemplate: opts.enableLegacyTemplate,\n preserveWhitespaces: opts.preserveWhitespaces,\n });\n },\n deps: []\n },\n /** @type {?} */ ((opts.providers))\n ]);\n return injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Compiler\"]);\n };\n return JitCompilerFactory;\n}());\n/**\n * @param {?} optionsArr\n * @return {?}\n */\nfunction _mergeOptions(optionsArr) {\n return {\n useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),\n defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),\n providers: _mergeArrays(optionsArr.map(function (options) { return ((options.providers)); })),\n missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),\n enableLegacyTemplate: _lastDefined(optionsArr.map(function (options) { return options.enableLegacyTemplate; })),\n preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),\n };\n}\n/**\n * @template T\n * @param {?} args\n * @return {?}\n */\nfunction _lastDefined(args) {\n for (var /** @type {?} */ i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n/**\n * @param {?} parts\n * @return {?}\n */\nfunction _mergeArrays(parts) {\n var /** @type {?} */ result = [];\n parts.forEach(function (part) { return part && result.push.apply(result, part); });\n return result;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A platform that included corePlatform and the compiler.\n *\n * \\@experimental\n */\nvar platformCoreDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"platformCore\"], 'coreDynamic', [\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"], useValue: {}, multi: true },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"CompilerFactory\"], useClass: JitCompilerFactory, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"]] },\n]);\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar ResourceLoaderImpl = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_4_tslib__[\"b\" /* __extends */])(ResourceLoaderImpl, _super);\n function ResourceLoaderImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} url\n * @return {?}\n */\n ResourceLoaderImpl.prototype.get = /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n var /** @type {?} */ resolve;\n var /** @type {?} */ reject;\n var /** @type {?} */ promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n var /** @type {?} */ xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'text';\n xhr.onload = function () {\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in ResourceLoader Level2 spec (supported\n // by IE10)\n var /** @type {?} */ response = xhr.response || xhr.responseText;\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : 0;\n }\n if (200 <= status && status <= 300) {\n resolve(response);\n }\n else {\n reject(\"Failed to load \" + url);\n }\n };\n xhr.onerror = function () { reject(\"Failed to load \" + url); };\n xhr.send();\n return promise;\n };\n ResourceLoaderImpl.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n ResourceLoaderImpl.ctorParameters = function () { return []; };\n return ResourceLoaderImpl;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [\n __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__[\"ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS\"],\n {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"COMPILER_OPTIONS\"],\n useValue: { providers: [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useClass: ResourceLoaderImpl, deps: [] }] },\n multi: true\n },\n { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"PLATFORM_ID\"], useValue: __WEBPACK_IMPORTED_MODULE_2__angular_common__[\"ɵPLATFORM_BROWSER_ID\"] },\n];\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * An implementation of ResourceLoader that uses a template cache to avoid doing an actual\n * ResourceLoader.\n *\n * The template cache needs to be built and loaded into window.$templateCache\n * via a separate mechanism.\n */\nvar CachedResourceLoader = /** @class */ (function (_super) {\n Object(__WEBPACK_IMPORTED_MODULE_4_tslib__[\"b\" /* __extends */])(CachedResourceLoader, _super);\n function CachedResourceLoader() {\n var _this = _super.call(this) || this;\n _this._cache = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"ɵglobal\"])).$templateCache;\n if (_this._cache == null) {\n throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');\n }\n return _this;\n }\n /**\n * @param {?} url\n * @return {?}\n */\n CachedResourceLoader.prototype.get = /**\n * @param {?} url\n * @return {?}\n */\n function (url) {\n if (this._cache.hasOwnProperty(url)) {\n return Promise.resolve(this._cache[url]);\n }\n else {\n return /** @type {?} */ (Promise.reject('CachedResourceLoader: Did not find cached template for ' + url));\n }\n };\n return CachedResourceLoader;\n}(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */]));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@stable\n */\nvar VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Version\"]('5.2.2');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * \\@experimental\n */\nvar RESOURCE_CACHE_PROVIDER = [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__[\"s\" /* ResourceLoader */], useClass: CachedResourceLoader, deps: [] }];\n/**\n * \\@stable\n */\nvar platformBrowserDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__[\"createPlatformFactory\"])(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\n\n\n//# sourceMappingURL=platform-browser-dynamic.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0Bhbmd1bGFyL3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYy9lc201L3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYy5qcz9lMGY1Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgQW5ndWxhciB2NS4yLjJcbiAqIChjKSAyMDEwLTIwMTggR29vZ2xlLCBJbmMuIGh0dHBzOi8vYW5ndWxhci5pby9cbiAqIExpY2Vuc2U6IE1JVFxuICovXG5pbXBvcnQgeyBDb21waWxlTWV0YWRhdGFSZXNvbHZlciwgQ29tcGlsZVJlZmxlY3RvciwgQ29tcGlsZXJDb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cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7P30gc3VtbWFyaWVzXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBDb21waWxlckltcGwucHJvdG90eXBlLmxvYWRBb3RTdW1tYXJpZXMgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHN1bW1hcmllc1xuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHN1bW1hcmllcykgeyB0aGlzLl9kZWxlZ2F0ZS5sb2FkQW90U3VtbWFyaWVzKHN1bW1hcmllcyk7IH07XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSByZWZcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIENvbXBpbGVySW1wbC5wcm90b3R5cGUuaGFzQW90U3VtbWFyeSA9IC8qKlxuICAgICAqIEBwYXJhbSB7P30gcmVmXG4gICAgICogQHJldHVybiB7P31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiAocmVmKSB7IHJldHVybiB0aGlzLl9kZWxlZ2F0ZS5oYXNBb3RTdW1tYXJ5KHJlZik7IH07XG4gICAgLyoqXG4gICAgICogQHRlbXBsYXRlIFRcbiAgICAgKiBAcGFyYW0gez99IGNvbXBvbmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgQ29tcGlsZXJJbXBsLnByb3RvdHlwZS5nZXRDb21wb25lbnRGYWN0b3J5ID0gLyoqXG4gICAgICogQHRlbXBsYXRlIFRcbiAgICAgKiBAcGFyYW0gez99IGNvbXBvbmVudFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKGNvbXBvbmVudCkge1xuICAgICAgICByZXR1cm4gLyoqIEB0eXBlIHs/fSAqLyAodGhpcy5fZGVsZWdhdGUuZ2V0Q29tcG9uZW50RmFjdG9yeShjb21wb25lbnQpKTtcbiAgICB9O1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dGlvbnMgPSBbXTsgfVxuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBvcHRzID0gX21lcmdlT3B0aW9ucyh0aGlzLl9kZWZhdWx0T3B0aW9ucy5jb25jYXQob3B0aW9ucykpO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyBpbmplY3RvciA9IEluamVjdG9yLmNyZWF0ZShbXG4gICAgICAgICAgICBDT01QSUxFUl9QUk9WSURFUlMsIHtcbiAgICAgICAgICAgICAgICBwcm92aWRlOiBDb21waWxlckNvbmZpZyxcbiAgICAgICAgICAgICAgICB1c2VGYWN0b3J5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQ29tcGlsZXJDb25maWcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGV4cGxpY2l0IHZhbHVlcyBmcm9tIHRoZSBjb21waWxlciBvcHRpb25zIG92ZXJ3cml0ZSBvcHRpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBhcHAgcHJvdmlkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICB1c2VKaXQ6IG9wdHMudXNlSml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgaml0RGV2TW9kZTogaXNEZXZNb2RlKCksXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgZXhwbGljaXQgdmFsdWVzIGZyb20gdGhlIGNvbXBpbGVyIG9wdGlvbnMgb3ZlcndyaXRlIG9wdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZyb20gdGhlIGFwcCBwcm92aWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRFbmNhcHN1bGF0aW9uOiBvcHRzLmRlZmF1bHRFbmNhcHN1bGF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWlzc2luZ1RyYW5zbGF0aW9uOiBvcHRzLm1pc3NpbmdUcmFuc2xhdGlvbixc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uIChfc3VwZXIpIHtcbiAgICBfX2V4dGVuZHMoUmVzb3VyY2VMb2FkZXJJbXBsLCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIFJlc291cmNlTG9hZGVySW1wbCgpIHtcbiAgICAgICAgcmV0dXJuIF9zdXBlciAhPT0gbnVsbCAmJiBfc3VwZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKSB8fCB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgUmVzb3VyY2VMb2FkZXJJbXBsLnByb3RvdHlwZS5nZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkge1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZXNvbHZlO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyByZWplY3Q7XG4gICAgICAgIHZhciAvKiogQHR5cGUgez99ICovIHByb21pc2UgPSBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzLCByZWopIHtcbiAgICAgICAgICAgIHJlc29sdmUgPSByZXM7XG4gICAgICAgICAgICByZWplY3QgPSByZWo7XG4gICAgICAgIH0pO1xuICAgICAgICB2YXIgLyoqIEB0eXBlIHs/fSAqLyB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgeGhyLm9wZW4oJ0dFVCcsIHVybCwgdHJ1ZSk7XG4gICAgICAgIHhoci5yZXNwb25zZVR5cGUgPSAndGV4dCc7XG4gICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAvLyByZXNwb25zZVRleHQgaXMgdGhlIG9sZC1zY2hvb2wgd2F5IG9mIHJldHJpZXZpbmcgcmVzcG9uc2UgKHN1cHBvcnRlZCBieSBJRTggJiA5KVxuICAgICAgIC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G4gICAgX19leHRlbmRzKENhY2hlZFJlc291cmNlTG9hZGVyLCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIENhY2hlZFJlc291cmNlTG9hZGVyKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzKSB8fCB0aGlzO1xuICAgICAgICBfdGhpcy5fY2FjaGUgPSAoLyoqIEB0eXBlIHs/fSAqLyAoybVnbG9iYWwpKS4kdGVtcGxhdGVDYWNoZTtcbiAgICAgICAgaWYgKF90aGlzLl9jYWNoZSA9PSBudWxsKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0NhY2hlZFJlc291cmNlTG9hZGVyOiBUZW1wbGF0ZSBjYWNoZSB3YXMgbm90IGZvdW5kIGluICR0ZW1wbGF0ZUNhY2hlLicpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHs/fSB1cmxcbiAgICAgKiBAcmV0dXJuIHs/fVxuICAgICAqL1xuICAgIENhY2hlZFJlc291cmNlTG9hZGVyLnByb3RvdHlwZS5nZXQgPSAvKipcbiAgICAgKiBAcGFyYW0gez99IHVybFxuICAgICAqIEByZXR1cm4gez99XG4gICAgICovXG4gICAgZnVuY3Rpb24gKHVybCkge1xuICAgICAgICBpZiAodGhpcy5fY2FjaGUuaGFzT3duUHJvcGVydHkodXJsKSkge1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aGlzLl9jYWNoZVt1cmxdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAvKiogQHR5cGUgez99ICovIChQcm9taXNlLnJlamVjdCgnQ2FjaGVkUmVzb3VyY2VMb2FkZXI6IERpZCBub3QgZmluZCBjYWNoZWQgdGVtcGxhdGUgZm9yICcgKyB1cmwpKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgcmV0dXJu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IsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///242\n"); /***/ }), /* 243 */ @@ -758,21 +758,21 @@ eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true } /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbAccordionModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accordion__ = __webpack_require__(253);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__accordion_config__ = __webpack_require__(167);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"d\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__accordion_config__[\"a\"]; });\n\n\n\n\n\n\nvar NGB_ACCORDION_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_2__accordion__[\"a\" /* NgbAccordion */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"b\" /* NgbPanel */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"d\" /* NgbPanelTitle */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"c\" /* NgbPanelContent */]];\nvar NgbAccordionModule = (function () {\n function NgbAccordionModule() {\n }\n NgbAccordionModule.forRoot = function () { return { ngModule: NgbAccordionModule, providers: [__WEBPACK_IMPORTED_MODULE_3__accordion_config__[\"a\" /* NgbAccordionConfig */]] }; };\n NgbAccordionModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbAccordionModule.ctorParameters = function () { return []; };\n return NgbAccordionModule;\n}());\n\n//# sourceMappingURL=accordion.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FjY29yZGlvbi9hY2NvcmRpb24ubW9kdWxlLmpzPzc4MjIiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBOZ2JBY2NvcmRpb24sIE5nYlBhbmVsLCBOZ2JQYW5lbFRpdGxlLCBOZ2JQYW5lbENvbnRlbnQgfSBmcm9tICcuL2FjY29yZGlvbic7XG5pbXBvcnQgeyBOZ2JBY2NvcmRpb25Db25maWcgfSBmcm9tICcuL2FjY29yZGlvbi1jb25maWcnO1xuZXhwb3J0IHsgTmdiQWNjb3JkaW9uLCBOZ2JQYW5lbCwgTmdiUGFuZWxUaXRsZSwgTmdiUGFuZWxDb250ZW50IH0gZnJvbSAnLi9hY2NvcmRpb24nO1xuZXhwb3J0IHsgTmdiQWNjb3Jk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cy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9hY2NvcmRpb24vYWNjb3JkaW9uLm1vZHVsZS5qc1xuLy8gbW9kdWxlIGlkID0gMjUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///252\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbAccordionModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accordion__ = __webpack_require__(253);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__accordion_config__ = __webpack_require__(167);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"d\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_2__accordion__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__accordion_config__[\"a\"]; });\n\n\n\n\n\n\nvar NGB_ACCORDION_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_2__accordion__[\"a\" /* NgbAccordion */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"b\" /* NgbPanel */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"d\" /* NgbPanelTitle */], __WEBPACK_IMPORTED_MODULE_2__accordion__[\"c\" /* NgbPanelContent */]];\nvar NgbAccordionModule = (function () {\n function NgbAccordionModule() {\n }\n NgbAccordionModule.forRoot = function () { return { ngModule: NgbAccordionModule, providers: [__WEBPACK_IMPORTED_MODULE_3__accordion_config__[\"a\" /* NgbAccordionConfig */]] }; };\n NgbAccordionModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbAccordionModule.ctorParameters = function () { return []; };\n return NgbAccordionModule;\n}());\n\n//# sourceMappingURL=accordion.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FjY29yZGlvbi9hY2NvcmRpb24ubW9kdWxlLmpzPzc4MjIiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBOZ2JBY2NvcmRpb24sIE5nYlBhbmVsLCBOZ2JQYW5lbFRpdGxlLCBOZ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AoKSB7IHJldHVybiBbXTsgfTtcbiAgICByZXR1cm4gTmdiQWNjb3JkaW9uTW9kdWxlO1xufSgpKTtcbmV4cG9ydCB7IE5nYkFjY29yZGlvbk1vZHVsZSB9O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YWNjb3JkaW9uLm1vZHVsZS5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9hY2NvcmRpb24vYWNjb3JkaW9uLm1vZHVsZS5qc1xuLy8gbW9kdWxlIGlkID0gMjUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///252\n"); /***/ }), /* 253 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return NgbPanelTitle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbPanelContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbPanel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbAccordion; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accordion_config__ = __webpack_require__(167);\n\n\n\nvar nextId = 0;\n/**\n * This directive should be used to wrap accordion panel titles that need to contain HTML markup or other directives.\n */\nvar NgbPanelTitle = (function () {\n function NgbPanelTitle(templateRef) {\n this.templateRef = templateRef;\n }\n NgbPanelTitle.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ng-template[ngbPanelTitle]' },] },\n ];\n /** @nocollapse */\n NgbPanelTitle.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n return NgbPanelTitle;\n}());\n\n/**\n * This directive must be used to wrap accordion panel content.\n */\nvar NgbPanelContent = (function () {\n function NgbPanelContent(templateRef) {\n this.templateRef = templateRef;\n }\n NgbPanelContent.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ng-template[ngbPanelContent]' },] },\n ];\n /** @nocollapse */\n NgbPanelContent.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n return NgbPanelContent;\n}());\n\n/**\n * The NgbPanel directive represents an individual panel with the title and collapsible\n * content\n */\nvar NgbPanel = (function () {\n function NgbPanel() {\n /**\n * A flag determining whether the panel is disabled or not.\n * When disabled, the panel cannot be toggled.\n */\n this.disabled = false;\n /**\n * An optional id for the panel. The id should be unique.\n * If not provided, it will be auto-generated.\n */\n this.id = \"ngb-panel-\" + nextId++;\n /**\n * A flag telling if the panel is currently open\n */\n this.isOpen = false;\n }\n NgbPanel.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ngb-panel' },] },\n ];\n /** @nocollapse */\n NgbPanel.ctorParameters = function () { return []; };\n NgbPanel.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"id\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"title\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"contentTpl\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [NgbPanelContent,] },],\n \"titleTpl\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [NgbPanelTitle,] },],\n };\n return NgbPanel;\n}());\n\n/**\n * The NgbAccordion directive is a collection of panels.\n * It can assure that only one panel can be opened at a time.\n */\nvar NgbAccordion = (function () {\n function NgbAccordion(config) {\n /**\n * An array or comma separated strings of panel identifiers that should be opened\n */\n this.activeIds = [];\n /**\n * Whether the closed panels should be hidden without destroying them\n */\n this.destroyOnHide = true;\n /**\n * A panel change event fired right before the panel toggle happens. See NgbPanelChangeEvent for payload details\n */\n this.panelChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.type = config.type;\n this.closeOtherPanels = config.closeOthers;\n }\n /**\n * Programmatically toggle a panel with a given id.\n */\n /**\n * Programmatically toggle a panel with a given id.\n */\n NgbAccordion.prototype.toggle = /**\n * Programmatically toggle a panel with a given id.\n */\n function (panelId) {\n var panel = this.panels.find(function (p) { return p.id === panelId; });\n if (panel && !panel.disabled) {\n var defaultPrevented_1 = false;\n this.panelChange.emit({ panelId: panelId, nextState: !panel.isOpen, preventDefault: function () { defaultPrevented_1 = true; } });\n if (!defaultPrevented_1) {\n panel.isOpen = !panel.isOpen;\n if (this.closeOtherPanels) {\n this._closeOthers(panelId);\n }\n this._updateActiveIds();\n }\n }\n };\n NgbAccordion.prototype.ngAfterContentChecked = function () {\n var _this = this;\n // active id updates\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"e\" /* isString */])(this.activeIds)) {\n this.activeIds = this.activeIds.split(/\\s*,\\s*/);\n }\n // update panels open states\n this.panels.forEach(function (panel) { return panel.isOpen = !panel.disabled && _this.activeIds.indexOf(panel.id) > -1; });\n // closeOthers updates\n if (this.activeIds.length > 1 && this.closeOtherPanels) {\n this._closeOthers(this.activeIds[0]);\n this._updateActiveIds();\n }\n };\n NgbAccordion.prototype._closeOthers = function (panelId) {\n this.panels.forEach(function (panel) {\n if (panel.id !== panelId) {\n panel.isOpen = false;\n }\n });\n };\n NgbAccordion.prototype._updateActiveIds = function () {\n this.activeIds = this.panels.filter(function (panel) { return panel.isOpen && !panel.disabled; }).map(function (panel) { return panel.id; });\n };\n NgbAccordion.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-accordion',\n exportAs: 'ngbAccordion',\n host: { 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels' },\n template: \"\\n <ng-template ngFor let-panel [ngForOf]=\\\"panels\\\">\\n <div class=\\\"card\\\">\\n <div role=\\\"tab\\\" id=\\\"{{panel.id}}-header\\\"\\n [class]=\\\"'card-header ' + (panel.type ? 'card-'+panel.type: type ? 'card-'+type : '')\\\" [class.active]=\\\"panel.isOpen\\\">\\n <a href (click)=\\\"!!toggle(panel.id)\\\" [class.text-muted]=\\\"panel.disabled\\\" [attr.tabindex]=\\\"(panel.disabled ? '-1' : null)\\\"\\n [attr.aria-expanded]=\\\"panel.isOpen\\\" [attr.aria-controls]=\\\"(panel.isOpen ? panel.id : null)\\\"\\n [attr.aria-disabled]=\\\"panel.disabled\\\">\\n {{panel.title}}<ng-template [ngTemplateOutlet]=\\\"panel.titleTpl?.templateRef\\\"></ng-template>\\n </a>\\n </div>\\n <div id=\\\"{{panel.id}}\\\" role=\\\"tabpanel\\\" [attr.aria-labelledby]=\\\"panel.id + '-header'\\\"\\n class=\\\"card-body collapse {{panel.isOpen ? 'show' : null}}\\\" *ngIf=\\\"!destroyOnHide || panel.isOpen\\\">\\n <ng-template [ngTemplateOutlet]=\\\"panel.contentTpl.templateRef\\\"></ng-template>\\n </div>\\n </div>\\n </ng-template>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbAccordion.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__accordion_config__[\"a\" /* NgbAccordionConfig */], },\n ]; };\n NgbAccordion.propDecorators = {\n \"panels\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChildren\"], args: [NgbPanel,] },],\n \"activeIds\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"closeOtherPanels\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['closeOthers',] },],\n \"destroyOnHide\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"panelChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbAccordion;\n}());\n\n//# sourceMappingURL=accordion.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FjY29yZGlvbi9hY2NvcmRpb24uanM/ODQwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIENvbnRlbnRDaGlsZCwgQ29udGVudENoaWxkcmVuLCBEaXJlY3RpdmUsIEV2ZW50RW1pdHRlciwgSW5wdXQsIE91dHB1dCwgUXVlcnlMaXN0LCBUZW1wbGF0ZVJlZiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgaXNTdHJpbmcgfSBmcm9tICcuLi91dGlsL3V0aWwnO1xuaW1wb3J0IHsgTmdiQWNj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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///253\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return NgbPanelTitle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbPanelContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbPanel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbAccordion; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accordion_config__ = __webpack_require__(167);\n\n\n\nvar nextId = 0;\n/**\n * This directive should be used to wrap accordion panel titles that need to contain HTML markup or other directives.\n */\nvar NgbPanelTitle = (function () {\n function NgbPanelTitle(templateRef) {\n this.templateRef = templateRef;\n }\n NgbPanelTitle.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ng-template[ngbPanelTitle]' },] },\n ];\n /** @nocollapse */\n NgbPanelTitle.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n return NgbPanelTitle;\n}());\n\n/**\n * This directive must be used to wrap accordion panel content.\n */\nvar NgbPanelContent = (function () {\n function NgbPanelContent(templateRef) {\n this.templateRef = templateRef;\n }\n NgbPanelContent.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ng-template[ngbPanelContent]' },] },\n ];\n /** @nocollapse */\n NgbPanelContent.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"], },\n ]; };\n return NgbPanelContent;\n}());\n\n/**\n * The NgbPanel directive represents an individual panel with the title and collapsible\n * content\n */\nvar NgbPanel = (function () {\n function NgbPanel() {\n /**\n * A flag determining whether the panel is disabled or not.\n * When disabled, the panel cannot be toggled.\n */\n this.disabled = false;\n /**\n * An optional id for the panel. The id should be unique.\n * If not provided, it will be auto-generated.\n */\n this.id = \"ngb-panel-\" + nextId++;\n /**\n * A flag telling if the panel is currently open\n */\n this.isOpen = false;\n }\n NgbPanel.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: 'ngb-panel' },] },\n ];\n /** @nocollapse */\n NgbPanel.ctorParameters = function () { return []; };\n NgbPanel.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"id\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"title\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"contentTpl\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [NgbPanelContent,] },],\n \"titleTpl\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [NgbPanelTitle,] },],\n };\n return NgbPanel;\n}());\n\n/**\n * The NgbAccordion directive is a collection of panels.\n * It can assure that only one panel can be opened at a time.\n */\nvar NgbAccordion = (function () {\n function NgbAccordion(config) {\n /**\n * An array or comma separated strings of panel identifiers that should be opened\n */\n this.activeIds = [];\n /**\n * Whether the closed panels should be hidden without destroying them\n */\n this.destroyOnHide = true;\n /**\n * A panel change event fired right before the panel toggle happens. See NgbPanelChangeEvent for payload details\n */\n this.panelChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.type = config.type;\n this.closeOtherPanels = config.closeOthers;\n }\n /**\n * Programmatically toggle a panel with a given id.\n */\n /**\n * Programmatically toggle a panel with a given id.\n */\n NgbAccordion.prototype.toggle = /**\n * Programmatically toggle a panel with a given id.\n */\n function (panelId) {\n var panel = this.panels.find(function (p) { return p.id === panelId; });\n if (panel && !panel.disabled) {\n var defaultPrevented_1 = false;\n this.panelChange.emit({ panelId: panelId, nextState: !panel.isOpen, preventDefault: function () { defaultPrevented_1 = true; } });\n if (!defaultPrevented_1) {\n panel.isOpen = !panel.isOpen;\n if (this.closeOtherPanels) {\n this._closeOthers(panelId);\n }\n this._updateActiveIds();\n }\n }\n };\n NgbAccordion.prototype.ngAfterContentChecked = function () {\n var _this = this;\n // active id updates\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"e\" /* isString */])(this.activeIds)) {\n this.activeIds = this.activeIds.split(/\\s*,\\s*/);\n }\n // update panels open states\n this.panels.forEach(function (panel) { return panel.isOpen = !panel.disabled && _this.activeIds.indexOf(panel.id) > -1; });\n // closeOthers updates\n if (this.activeIds.length > 1 && this.closeOtherPanels) {\n this._closeOthers(this.activeIds[0]);\n this._updateActiveIds();\n }\n };\n NgbAccordion.prototype._closeOthers = function (panelId) {\n this.panels.forEach(function (panel) {\n if (panel.id !== panelId) {\n panel.isOpen = false;\n }\n });\n };\n NgbAccordion.prototype._updateActiveIds = function () {\n this.activeIds = this.panels.filter(function (panel) { return panel.isOpen && !panel.disabled; }).map(function (panel) { return panel.id; });\n };\n NgbAccordion.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-accordion',\n exportAs: 'ngbAccordion',\n host: { 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels' },\n template: \"\\n <ng-template ngFor let-panel [ngForOf]=\\\"panels\\\">\\n <div class=\\\"card\\\">\\n <div role=\\\"tab\\\" id=\\\"{{panel.id}}-header\\\"\\n [class]=\\\"'card-header ' + (panel.type ? 'card-'+panel.type: type ? 'card-'+type : '')\\\" [class.active]=\\\"panel.isOpen\\\">\\n <a href (click)=\\\"!!toggle(panel.id)\\\" [class.text-muted]=\\\"panel.disabled\\\" [attr.tabindex]=\\\"(panel.disabled ? '-1' : null)\\\"\\n [attr.aria-expanded]=\\\"panel.isOpen\\\" [attr.aria-controls]=\\\"(panel.isOpen ? panel.id : null)\\\"\\n [attr.aria-disabled]=\\\"panel.disabled\\\">\\n {{panel.title}}<ng-template [ngTemplateOutlet]=\\\"panel.titleTpl?.templateRef\\\"></ng-template>\\n </a>\\n </div>\\n <div id=\\\"{{panel.id}}\\\" role=\\\"tabpanel\\\" [attr.aria-labelledby]=\\\"panel.id + '-header'\\\"\\n class=\\\"card-body collapse {{panel.isOpen ? 'show' : null}}\\\" *ngIf=\\\"!destroyOnHide || panel.isOpen\\\">\\n <ng-template [ngTemplateOutlet]=\\\"panel.contentTpl.templateRef\\\"></ng-template>\\n </div>\\n </div>\\n </ng-template>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbAccordion.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__accordion_config__[\"a\" /* NgbAccordionConfig */], },\n ]; };\n NgbAccordion.propDecorators = {\n \"panels\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChildren\"], args: [NgbPanel,] },],\n \"activeIds\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"closeOtherPanels\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['closeOthers',] },],\n \"destroyOnHide\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"panelChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbAccordion;\n}());\n\n//# sourceMappingURL=accordion.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FjY29yZGlvbi9hY2NvcmRpb24uanM/ODQwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIENvbnRlbnRDaGlsZCwgQ29udGVudENoaWxkcmVuLCBEaXJlY3RpdmUsIEV2ZW50RW1pdHRlciwgSW5wdXQsIE91dHB1dCwgUXVlcnlMaXN0LCBUZW1wbGF0ZVJlZiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgaXNTdHJpbmcgfSBmcm9tICcuLi91dGlsL3V0aWwnO1xuaW1wb3J0IHsgTmdiQWNjb3JkaW9uQ29uZmlnIH0gZnJvbSAnLi9hY2NvcmRpb24tY29uZmlnJztcbnZhciBuZXh0SWQgPSAwO1xuLyoqXG4gKiBUaGlzIGRpcmVjdGl2ZSBzaG91bGQgYmUgdXNlZCB0byB3cmFwIGFjY29yZGlvbiBwYW5lbCB0aXRsZXMgdGhhdCBuZWVkIHRvIGNvbnRhaW4gSFRNTCBtYXJrdXAgb3Igb3RoZXIgZGlyZWN0aXZlcy5cbiAqL1xudmFyIE5nYlBhbmVsVGl0bGUgPSAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE5nYlBhbmVsVGl0bGUodGVtcGxhdGVSZWYpIHtcbiAgICAgICAgdGhpcy50ZW1w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{ "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbAlertModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__alert__ = __webpack_require__(255);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__alert_config__ = __webpack_require__(168);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__alert__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__alert_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbAlertModule = (function () {\n function NgbAlertModule() {\n }\n NgbAlertModule.forRoot = function () { return { ngModule: NgbAlertModule, providers: [__WEBPACK_IMPORTED_MODULE_3__alert_config__[\"a\" /* NgbAlertConfig */]] }; };\n NgbAlertModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]], exports: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]], entryComponents: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]] },] },\n ];\n /** @nocollapse */\n NgbAlertModule.ctorParameters = function () { return []; };\n return NgbAlertModule;\n}());\n\n//# sourceMappingURL=alert.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3Ry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uICAgIHJldHVybiBOZ2JBbGVydE1vZHVsZTtcbn0oKSk7XG5leHBvcnQgeyBOZ2JBbGVydE1vZHVsZSB9O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YWxlcnQubW9kdWxlLmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FsZXJ0L2FsZXJ0Lm1vZHVsZS5qc1xuLy8gbW9kdWxlIGlkID0gMjU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///254\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbAlertModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__alert__ = __webpack_require__(255);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__alert_config__ = __webpack_require__(168);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__alert__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__alert_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbAlertModule = (function () {\n function NgbAlertModule() {\n }\n NgbAlertModule.forRoot = function () { return { ngModule: NgbAlertModule, providers: [__WEBPACK_IMPORTED_MODULE_3__alert_config__[\"a\" /* NgbAlertConfig */]] }; };\n NgbAlertModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]], exports: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]], entryComponents: [__WEBPACK_IMPORTED_MODULE_2__alert__[\"a\" /* NgbAlert */]] },] },\n ];\n /** @nocollapse */\n NgbAlertModule.ctorParameters = function () { return []; };\n return NgbAlertModule;\n}());\n\n//# sourceMappingURL=alert.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2FsZXJ0L2FsZXJ0Lm1vZHVsZS5qcz80NTdkIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgTmdiQWxlcnQgfSBmcm9tICcuL2FsZXJ0JztcbmltcG9ydCB7IE5nYkFsZXJ0Q29uZmlnIH0gZnJvbSAnLi9hbGVydC1jb25maWcnO1xuZXhwb3J0IHsgTmdiQWxlcnQgfSBmcm9tICcuL2FsZXJ0JztcbmV4cG9ydCB7IE5nYkFsZXJ0Q29uZmlnIH0gZnJvbSAnLi9hbGVydC1jb25maWcnO1xudmFyIE5nYkFsZXJ0TW9kdWxlID0gK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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///254\n"); /***/ }), /* 255 */ @@ -793,21 +793,21 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCheckBox; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__label__ = __webpack_require__(121);\n\n\n\nvar NGB_CHECKBOX_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbCheckBox; }),\n multi: true\n};\n/**\n * Easily create Bootstrap-style checkbox buttons. A value of a checked button is bound to a variable\n * specified via ngModel.\n */\nvar NgbCheckBox = (function () {\n function NgbCheckBox(_label) {\n this._label = _label;\n /**\n * A flag indicating if a given checkbox button is disabled.\n */\n this.disabled = false;\n /**\n * Value to be propagated as model when the checkbox is checked.\n */\n this.valueChecked = true;\n /**\n * Value to be propagated as model when the checkbox is unchecked.\n */\n this.valueUnChecked = false;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n Object.defineProperty(NgbCheckBox.prototype, \"focused\", {\n set: function (isFocused) {\n this._label.focused = isFocused;\n if (!isFocused) {\n this.onTouched();\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbCheckBox.prototype.onInputChange = function ($event) {\n var modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;\n this.onChange(modelToPropagate);\n this.onTouched();\n this.writeValue(modelToPropagate);\n };\n NgbCheckBox.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbCheckBox.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbCheckBox.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this._label.disabled = isDisabled;\n };\n NgbCheckBox.prototype.writeValue = function (value) {\n this.checked = value === this.valueChecked;\n this._label.active = this.checked;\n };\n NgbCheckBox.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: '[ngbButton][type=checkbox]',\n host: {\n 'autocomplete': 'off',\n '[checked]': 'checked',\n '[disabled]': 'disabled',\n '(change)': 'onInputChange($event)',\n '(focus)': 'focused = true',\n '(blur)': 'focused = false'\n },\n providers: [NGB_CHECKBOX_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbCheckBox.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__label__[\"a\" /* NgbButtonLabel */], },\n ]; };\n NgbCheckBox.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"valueChecked\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"valueUnChecked\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbCheckBox;\n}());\n\n//# sourceMappingURL=checkbox.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2J1dHRvbnMvY2hlY2tib3guanM/MjhjOCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEaXJlY3RpdmUsIGZvcndhcmRSZWYsIElucHV0IH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7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///257\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCheckBox; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__label__ = __webpack_require__(121);\n\n\n\nvar NGB_CHECKBOX_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbCheckBox; }),\n multi: true\n};\n/**\n * Easily create Bootstrap-style checkbox buttons. A value of a checked button is bound to a variable\n * specified via ngModel.\n */\nvar NgbCheckBox = (function () {\n function NgbCheckBox(_label) {\n this._label = _label;\n /**\n * A flag indicating if a given checkbox button is disabled.\n */\n this.disabled = false;\n /**\n * Value to be propagated as model when the checkbox is checked.\n */\n this.valueChecked = true;\n /**\n * Value to be propagated as model when the checkbox is unchecked.\n */\n this.valueUnChecked = false;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n Object.defineProperty(NgbCheckBox.prototype, \"focused\", {\n set: function (isFocused) {\n this._label.focused = isFocused;\n if (!isFocused) {\n this.onTouched();\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbCheckBox.prototype.onInputChange = function ($event) {\n var modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;\n this.onChange(modelToPropagate);\n this.onTouched();\n this.writeValue(modelToPropagate);\n };\n NgbCheckBox.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbCheckBox.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbCheckBox.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this._label.disabled = isDisabled;\n };\n NgbCheckBox.prototype.writeValue = function (value) {\n this.checked = value === this.valueChecked;\n this._label.active = this.checked;\n };\n NgbCheckBox.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: '[ngbButton][type=checkbox]',\n host: {\n 'autocomplete': 'off',\n '[checked]': 'checked',\n '[disabled]': 'disabled',\n '(change)': 'onInputChange($event)',\n '(focus)': 'focused = true',\n '(blur)': 'focused = false'\n },\n providers: [NGB_CHECKBOX_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbCheckBox.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__label__[\"a\" /* NgbButtonLabel */], },\n ]; };\n NgbCheckBox.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"valueChecked\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"valueUnChecked\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbCheckBox;\n}());\n\n//# sourceMappingURL=checkbox.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2J1dHRvbnMvY2hlY2tib3guanM/MjhjOCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEaXJlY3RpdmUsIGZvcndhcmRSZWYsIElucHV0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBOR19WQUxVRV9BQ0NFU1NPUiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IE5nYkJ1dHRvbkxhYmVsIH0gZnJvbSAnLi9sYWJlbCc7XG52YXIgTkdCX0NIRUNLQk9YX1ZBTFVFX0FDQ0VTU09SID0ge1xuICAgIHByb3ZpZGU6IE5HX1ZBTFVFX0FDQ0VTU09SLFxuICAgIHVzZUV4aXN0aW5nOiBmb3J3YXJkUmVmKGZ1bmN0aW9uICgpIHsgcmV0dXJuIE5nYkNoZWNrQm94OyB9KSxcbiAgICBtdWx0aTogdHJ1ZVxufTtcbi8qKlxuICogRWFzaWx5IGNyZWF0ZSBCb290c3RyYXAtc3R5bGUgY2hlY2tib3ggYnV0dG9ucy4gQSB2YWx1ZSBvZiBhIGNoZWNrZWQgYnV0dG9uIGlzIGJvdW5kIHRvIGEgdmFyaWFibGVcbiAqIHNwZWNpZmllZCB2aWEgbmdNb2RlbC5cbiAqL1xudmFyIE5nYkNoZWNrQm94ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JDaGVja0J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ja0JveC5kZWNvcmF0b3JzID0gW1xuICAgICAgICB7IHR5cGU6IERpcmVjdGl2ZSwgYXJnczogW3tcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICdbbmdiQnV0dG9uXVt0eXBlPWNoZWNrYm94XScsXG4gICAgICAgICAgICAgICAgICAgIGhvc3Q6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRvY29tcGxldGUnOiAnb2ZmJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdbY2hlY2tlZF0nOiAnY2hlY2tlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnW2Rpc2FibGVkXSc6ICdkaXNhYmxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGNoYW5nZSknOiAnb25JbnB1dENoYW5nZSgkZXZlbnQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoZm9jdXMpJzogJ2ZvY3VzZWQgPSB0cnVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoYmx1ciknOiAnZm9jdXNlZCA9IGZhbHNlJ1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBwcm92aWRlcnM6IFtOR0JfQ0hFQ0tCT1hfVkFMVUVfQUNDRVNTT1JdXG4gICAgICAgICAgICAgICAgfSxdIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBOZ2JDaGVja0JveC5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtcbiAgICAgICAgeyB0eXBlOiBOZ2JCdXR0b25MYWJlbCwgfSxcbiAgICBdOyB9O1xuICAgIE5nYkNoZWNrQm94LnByb3BEZWNvcmF0b3JzID0ge1xuICAgICAgICBcImRpc2FibGVkXCI6IFt7IHR5cGU6IElucHV0IH0sXSxcbiAgICAgICAgXCJ2YWx1ZUNoZWNrZWRcIjogW3sgdHlwZTogSW5wdXQgfSxdLFxuICAgICAgICBcInZhbHVlVW5D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n"); /***/ }), /* 258 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbRadioGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbRadio; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__label__ = __webpack_require__(121);\n\n\n\nvar NGB_RADIO_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbRadioGroup; }),\n multi: true\n};\nvar nextId = 0;\n/**\n * Easily create Bootstrap-style radio buttons. A value of a selected button is bound to a variable\n * specified via ngModel.\n */\nvar NgbRadioGroup = (function () {\n function NgbRadioGroup() {\n this._radios = new Set();\n this._value = null;\n /**\n * The name of the group. Unless enclosed inputs specify a name, this name is used as the name of the\n * enclosed inputs. If not specified, a name is generated automatically.\n */\n this.name = \"ngb-radio-\" + nextId++;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n Object.defineProperty(NgbRadioGroup.prototype, \"disabled\", {\n get: function () { return this._disabled; },\n set: function (isDisabled) { this.setDisabledState(isDisabled); },\n enumerable: true,\n configurable: true\n });\n NgbRadioGroup.prototype.onRadioChange = function (radio) {\n this.writeValue(radio.value);\n this.onChange(radio.value);\n };\n NgbRadioGroup.prototype.onRadioValueUpdate = function () { this._updateRadiosValue(); };\n NgbRadioGroup.prototype.register = function (radio) { this._radios.add(radio); };\n NgbRadioGroup.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbRadioGroup.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbRadioGroup.prototype.setDisabledState = function (isDisabled) {\n this._disabled = isDisabled;\n this._updateRadiosDisabled();\n };\n NgbRadioGroup.prototype.unregister = function (radio) { this._radios.delete(radio); };\n NgbRadioGroup.prototype.writeValue = function (value) {\n this._value = value;\n this._updateRadiosValue();\n };\n NgbRadioGroup.prototype._updateRadiosValue = function () {\n var _this = this;\n this._radios.forEach(function (radio) { return radio.updateValue(_this._value); });\n };\n NgbRadioGroup.prototype._updateRadiosDisabled = function () { this._radios.forEach(function (radio) { return radio.updateDisabled(); }); };\n NgbRadioGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngbRadioGroup]', host: { 'role': 'group' }, providers: [NGB_RADIO_VALUE_ACCESSOR] },] },\n ];\n /** @nocollapse */\n NgbRadioGroup.ctorParameters = function () { return []; };\n NgbRadioGroup.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbRadioGroup;\n}());\n\n/**\n * Marks an input of type \"radio\" as part of the NgbRadioGroup.\n */\nvar NgbRadio = (function () {\n function NgbRadio(_group, _label, _renderer, _element) {\n this._group = _group;\n this._label = _label;\n this._renderer = _renderer;\n this._element = _element;\n this._value = null;\n this._group.register(this);\n }\n Object.defineProperty(NgbRadio.prototype, \"value\", {\n get: function () { return this._value; },\n set: /**\n * You can specify model value of a given radio by binding to the value property.\n */\n function (value) {\n this._value = value;\n var stringValue = value ? value.toString() : '';\n this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);\n this._group.onRadioValueUpdate();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"disabled\", {\n get: function () { return this._group.disabled || this._disabled; },\n set: /**\n * A flag indicating if a given radio button is disabled.\n */\n function (isDisabled) {\n this._disabled = isDisabled !== false;\n this.updateDisabled();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"focused\", {\n set: function (isFocused) {\n if (this._label) {\n this._label.focused = isFocused;\n }\n if (!isFocused) {\n this._group.onTouched();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"checked\", {\n get: function () { return this._checked; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"nameAttr\", {\n get: function () { return this.name || this._group.name; },\n enumerable: true,\n configurable: true\n });\n NgbRadio.prototype.ngOnDestroy = function () { this._group.unregister(this); };\n NgbRadio.prototype.onChange = function () { this._group.onRadioChange(this); };\n NgbRadio.prototype.updateValue = function (value) {\n this._checked = this.value === value;\n this._label.active = this._checked;\n };\n NgbRadio.prototype.updateDisabled = function () { this._label.disabled = this.disabled; };\n NgbRadio.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: '[ngbButton][type=radio]',\n host: {\n '[checked]': 'checked',\n '[disabled]': 'disabled',\n '[name]': 'nameAttr',\n '(change)': 'onChange()',\n '(focus)': 'focused = true',\n '(blur)': 'focused = false'\n }\n },] },\n ];\n /** @nocollapse */\n NgbRadio.ctorParameters = function () { return [\n { type: NgbRadioGroup, },\n { type: __WEBPACK_IMPORTED_MODULE_2__label__[\"a\" /* NgbButtonLabel */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n ]; };\n NgbRadio.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['value',] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return NgbRadio;\n}());\n\n//# sourceMappingURL=radio.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMj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1yYWRpb10nLFxuICAgICAgICAgICAgICAgICAgICBob3N0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnW2NoZWNrZWRdJzogJ2NoZWNrZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tkaXNhYmxlZF0nOiAnZGlzYWJsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tuYW1lXSc6ICduYW1lQXR0cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGNoYW5nZSknOiAnb25DaGFuZ2UoKScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGZvY3VzKSc6ICdmb2N1c2VkID0gdHJ1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGJsdXIpJzogJ2ZvY3VzZWQgPSBmYWxzZSdcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdiUmFkaW8uY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXG4gICAgICAgIHsgdHlwZTogTmdiUmFkaW9Hcm91cCwgfSxcbiAgICAgICAgeyB0eXBlOiBOZ2JCdXR0b25MYWJlbCwgfSxcbiAgICAgICAgeyB0eXBlOiBSZW5kZXJlcjIsIH0sXG4gICAgICAgIHsgdHlwZTogRWxlbWVudFJlZiwgfSxcbiAgICBdOyB9O1xuICAgIE5nYlJhZGlvLnByb3BEZWNvcmF0b3JzID0ge1xuICAgICAgICBcIm5hbWVcIjogW3sgdHlwZTogSW5wdXQgfSxdLFxuICAgICAgICBcInZhbHVlXCI6IFt7IHR5cGU6IElucHV0LCBhcmdzOiBbJ3ZhbHVlJyxdIH0sXSxcbiAgICAgICAgXCJkaXNhYmxlZFwiOiBbeyB0eXBlOiBJbnB1dCwgYXJnczogWydkaXNhYmxlZCcsXSB9LF0sXG4gICAgfTtcbiAgICByZXR1cm4gTmdiUmFkaW87XG59KCkpO1x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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///258\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return NgbRadioGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbRadio; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__label__ = __webpack_require__(121);\n\n\n\nvar NGB_RADIO_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbRadioGroup; }),\n multi: true\n};\nvar nextId = 0;\n/**\n * Easily create Bootstrap-style radio buttons. A value of a selected button is bound to a variable\n * specified via ngModel.\n */\nvar NgbRadioGroup = (function () {\n function NgbRadioGroup() {\n this._radios = new Set();\n this._value = null;\n /**\n * The name of the group. Unless enclosed inputs specify a name, this name is used as the name of the\n * enclosed inputs. If not specified, a name is generated automatically.\n */\n this.name = \"ngb-radio-\" + nextId++;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n Object.defineProperty(NgbRadioGroup.prototype, \"disabled\", {\n get: function () { return this._disabled; },\n set: function (isDisabled) { this.setDisabledState(isDisabled); },\n enumerable: true,\n configurable: true\n });\n NgbRadioGroup.prototype.onRadioChange = function (radio) {\n this.writeValue(radio.value);\n this.onChange(radio.value);\n };\n NgbRadioGroup.prototype.onRadioValueUpdate = function () { this._updateRadiosValue(); };\n NgbRadioGroup.prototype.register = function (radio) { this._radios.add(radio); };\n NgbRadioGroup.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbRadioGroup.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbRadioGroup.prototype.setDisabledState = function (isDisabled) {\n this._disabled = isDisabled;\n this._updateRadiosDisabled();\n };\n NgbRadioGroup.prototype.unregister = function (radio) { this._radios.delete(radio); };\n NgbRadioGroup.prototype.writeValue = function (value) {\n this._value = value;\n this._updateRadiosValue();\n };\n NgbRadioGroup.prototype._updateRadiosValue = function () {\n var _this = this;\n this._radios.forEach(function (radio) { return radio.updateValue(_this._value); });\n };\n NgbRadioGroup.prototype._updateRadiosDisabled = function () { this._radios.forEach(function (radio) { return radio.updateDisabled(); }); };\n NgbRadioGroup.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{ selector: '[ngbRadioGroup]', host: { 'role': 'group' }, providers: [NGB_RADIO_VALUE_ACCESSOR] },] },\n ];\n /** @nocollapse */\n NgbRadioGroup.ctorParameters = function () { return []; };\n NgbRadioGroup.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbRadioGroup;\n}());\n\n/**\n * Marks an input of type \"radio\" as part of the NgbRadioGroup.\n */\nvar NgbRadio = (function () {\n function NgbRadio(_group, _label, _renderer, _element) {\n this._group = _group;\n this._label = _label;\n this._renderer = _renderer;\n this._element = _element;\n this._value = null;\n this._group.register(this);\n }\n Object.defineProperty(NgbRadio.prototype, \"value\", {\n get: function () { return this._value; },\n set: /**\n * You can specify model value of a given radio by binding to the value property.\n */\n function (value) {\n this._value = value;\n var stringValue = value ? value.toString() : '';\n this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);\n this._group.onRadioValueUpdate();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"disabled\", {\n get: function () { return this._group.disabled || this._disabled; },\n set: /**\n * A flag indicating if a given radio button is disabled.\n */\n function (isDisabled) {\n this._disabled = isDisabled !== false;\n this.updateDisabled();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"focused\", {\n set: function (isFocused) {\n if (this._label) {\n this._label.focused = isFocused;\n }\n if (!isFocused) {\n this._group.onTouched();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"checked\", {\n get: function () { return this._checked; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgbRadio.prototype, \"nameAttr\", {\n get: function () { return this.name || this._group.name; },\n enumerable: true,\n configurable: true\n });\n NgbRadio.prototype.ngOnDestroy = function () { this._group.unregister(this); };\n NgbRadio.prototype.onChange = function () { this._group.onRadioChange(this); };\n NgbRadio.prototype.updateValue = function (value) {\n this._checked = this.value === value;\n this._label.active = this._checked;\n };\n NgbRadio.prototype.updateDisabled = function () { this._label.disabled = this.disabled; };\n NgbRadio.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: '[ngbButton][type=radio]',\n host: {\n '[checked]': 'checked',\n '[disabled]': 'disabled',\n '[name]': 'nameAttr',\n '(change)': 'onChange()',\n '(focus)': 'focused = true',\n '(blur)': 'focused = false'\n }\n },] },\n ];\n /** @nocollapse */\n NgbRadio.ctorParameters = function () { return [\n { type: NgbRadioGroup, },\n { type: __WEBPACK_IMPORTED_MODULE_2__label__[\"a\" /* NgbButtonLabel */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n ]; };\n NgbRadio.propDecorators = {\n \"name\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['value',] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"], args: ['disabled',] },],\n };\n return NgbRadio;\n}());\n\n//# sourceMappingURL=radio.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2J1dHRvbnMvcmFkaW8uanM/ZjlkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEaXJlY3RpdmUsIGZvcndhcmRSZWYsIElucHV0LCBSZW5kZXJlcjIsIEVsZW1lbnRSZWYgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE5HX1ZBTFVFX0FDQ0VTU09SIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xuaW1wb3J0IHsgTmdiQnV0dG9uTGFiZWwgfSBmcm9tICcuL2xhYmVsJztcbnZhciBOR0JfUkFESU9fVkFMVUVfQUNDRVNTT1IgPSB7XG4gICAgcHJvdmlkZTogTkdfVkFMVUVfQUNDRVNTT1IsXG4gICAgdXNlRXhpc3Rpbmc6IGZvcndhcmRSZWYoZnVuY3Rpb24gKCkgeyByZXR1cm4gTmdiUmFkaW9Hcm91cDsgfSksXG4gICAgbXVsdGk6IHRydWVcbn07XG52YXIgbmV4dElkID0gMDtcbi8qKlxuICogRWFz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GlvbiAodmFsdWUpIHtcbiAgICAgICAgdGhpcy5fY2hlY2tlZCA9IHRoaXMudmFsdWUgPT09IHZhbHVlO1xuICAgICAgICB0aGlzLl9sYWJlbC5hY3RpdmUgPSB0aGlzLl9jaGVja2VkO1xuICAgIH07XG4gICAgTmdiUmFkaW8ucHJvdG90eXBlLnVwZGF0ZURpc2FibGVkID0gZnVuY3Rpb24gKCkgeyB0aGlzLl9sYWJlbC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWQ7IH07XG4gICAgTmdiUmFkaW8uZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBEaXJlY3RpdmUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdG9yOiAnW25nYkJ1dHRvbl1bdHlwZT1yYWRpb10nLFxuICAgICAgICAgICAgICAgICAgICBob3N0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnW2NoZWNrZWRdJzogJ2NoZWNrZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tkaXNhYmxlZF0nOiAnZGlzYWJsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tuYW1lXSc6ICduYW1lQXR0cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGNoYW5nZSknOiAnb25DaGFuZ2UoKScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGZvY3VzKSc6ICdmb2N1c2VkID0gdHJ1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnKGJsdXIpJzogJ2ZvY3VzZWQgPSBmYWxzZSdcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdiUmFkaW8uY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXG4gICAgICAgIHsgdHlwZTogTmdiUmFkaW9Hcm91cCwgfSxcbiAgICAgICAgeyB0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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///258\n"); /***/ }), /* 259 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbCarouselModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__carousel__ = __webpack_require__(260);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__carousel_config__ = __webpack_require__(169);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__carousel__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__carousel__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__carousel_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbCarouselModule = (function () {\n function NgbCarouselModule() {\n }\n NgbCarouselModule.forRoot = function () { return { ngModule: NgbCarouselModule, providers: [__WEBPACK_IMPORTED_MODULE_3__carousel_config__[\"a\" /* NgbCarouselConfig */]] }; };\n NgbCarouselModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: __WEBPACK_IMPORTED_MODULE_2__carousel__[\"a\" /* NGB_CAROUSEL_DIRECTIVES */], exports: __WEBPACK_IMPORTED_MODULE_2__carousel__[\"a\" /* NGB_CAROUSEL_DIRECTIVES */], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbCarouselModule.ctorParameters = function () { return []; };\n return NgbCarouselModule;\n}());\n\n//# sourceMappingURL=carousel.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2Nhcm91c2VsL2Nhcm91c2VsLm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SBmdW5jdGlvbiAoKSB7IHJldHVybiBbXTsgfTtcbiAgICByZXR1cm4gTmdiQ2Fyb3VzZWxNb2R1bGU7XG59KCkpO1xuZXhwb3J0IHsgTmdiQ2Fyb3VzZWxNb2R1bGUgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNhcm91c2VsLm1vZHVsZS5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9jYXJvdXNlbC9jYXJvdXNlbC5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///259\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbCarouselModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__carousel__ = __webpack_require__(260);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__carousel_config__ = __webpack_require__(169);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__carousel__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__carousel__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__carousel_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbCarouselModule = (function () {\n function NgbCarouselModule() {\n }\n NgbCarouselModule.forRoot = function () { return { ngModule: NgbCarouselModule, providers: [__WEBPACK_IMPORTED_MODULE_3__carousel_config__[\"a\" /* NgbCarouselConfig */]] }; };\n NgbCarouselModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: __WEBPACK_IMPORTED_MODULE_2__carousel__[\"a\" /* NGB_CAROUSEL_DIRECTIVES */], exports: __WEBPACK_IMPORTED_MODULE_2__carousel__[\"a\" /* NGB_CAROUSEL_DIRECTIVES */], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbCarouselModule.ctorParameters = function () { return []; };\n return NgbCarouselModule;\n}());\n\n//# sourceMappingURL=carousel.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2Nhcm91c2VsL2Nhcm91c2VsLm1vZHVsZS5qcz9mYzhmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgTkdCX0NBUk9VU0VMX0RJUkVDVElWRVMgfSBmcm9tICcuL2Nhcm91c2VsJztcbmltcG9ydCB7IE5nYkNhcm91c2VsQ29uZmlnIH0gZn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y9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9jYXJvdXNlbC9jYXJvdXNlbC5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///259\n"); /***/ }), /* 260 */ @@ -835,14 +835,14 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return NgbDatepickerModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__datepicker__ = __webpack_require__(170);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker_month_view__ = __webpack_require__(266);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__datepicker_navigation__ = __webpack_require__(267);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_input__ = __webpack_require__(268);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__datepicker_day_view__ = __webpack_require__(269);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__ = __webpack_require__(173);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__datepicker_navigation_select__ = __webpack_require__(270);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__datepicker_config__ = __webpack_require__(172);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return __WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hijri_ngb_calendar_islamic_civil__ = __webpack_require__(271);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_14__hijri_ngb_calendar_islamic_civil__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__hijri_ngb_calendar_islamic_umalqura__ = __webpack_require__(539);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_15__hijri_ngb_calendar_islamic_umalqura__[\"a\"]; });\n/* unused harmony reexport NgbDatepickerMonthView */\n/* unused harmony reexport NgbDatepickerDayView */\n/* unused harmony reexport NgbDatepickerNavigation */\n/* unused harmony reexport NgbDatepickerNavigationSelect */\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return __WEBPACK_IMPORTED_MODULE_13__datepicker_config__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"b\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar NgbDatepickerModule = (function () {\n function NgbDatepickerModule() {\n }\n NgbDatepickerModule.forRoot = function () {\n return {\n ngModule: NgbDatepickerModule,\n providers: [\n { provide: __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"a\" /* NgbCalendar */], useClass: __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"b\" /* NgbCalendarGregorian */] },\n { provide: __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], useClass: __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"b\" /* NgbDatepickerI18nDefault */] },\n { provide: __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"b\" /* NgbDateParserFormatter */], useClass: __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"a\" /* NgbDateISOParserFormatter */] },\n { provide: __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], useClass: __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"b\" /* NgbDateStructAdapter */] }, __WEBPACK_IMPORTED_MODULE_13__datepicker_config__[\"a\" /* NgbDatepickerConfig */]\n ]\n };\n };\n NgbDatepickerModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [\n __WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */], __WEBPACK_IMPORTED_MODULE_3__datepicker_month_view__[\"a\" /* NgbDatepickerMonthView */], __WEBPACK_IMPORTED_MODULE_4__datepicker_navigation__[\"a\" /* NgbDatepickerNavigation */], __WEBPACK_IMPORTED_MODULE_12__datepicker_navigation_select__[\"a\" /* NgbDatepickerNavigationSelect */], __WEBPACK_IMPORTED_MODULE_7__datepicker_day_view__[\"a\" /* NgbDatepickerDayView */],\n __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\" /* NgbInputDatepicker */]\n ],\n exports: [__WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */], __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\" /* NgbInputDatepicker */]],\n imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"], __WEBPACK_IMPORTED_MODULE_6__angular_forms__[\"FormsModule\"]],\n entryComponents: [__WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */]]\n },] },\n ];\n /** @nocollapse */\n NgbDatepickerModule.ctorParameters = function () { return []; };\n return NgbDatepickerModule;\n}());\n\n//# sourceMappingURL=datepicker.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5tb2R1bGUuanM/YWFjMiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IE5nYkRhdGVwaWNrZXIgfSBmcm9tICcuL2RhdGVwaWNrZXInO1xuaW1wb3J0IHs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UFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///263\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return NgbDatepickerModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__datepicker__ = __webpack_require__(170);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker_month_view__ = __webpack_require__(266);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__datepicker_navigation__ = __webpack_require__(267);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__datepicker_input__ = __webpack_require__(268);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__datepicker_day_view__ = __webpack_require__(269);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__ = __webpack_require__(173);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__datepicker_navigation_select__ = __webpack_require__(270);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__datepicker_config__ = __webpack_require__(172);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return __WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hijri_ngb_calendar_islamic_civil__ = __webpack_require__(271);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_14__hijri_ngb_calendar_islamic_civil__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__hijri_ngb_calendar_islamic_umalqura__ = __webpack_require__(539);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_15__hijri_ngb_calendar_islamic_umalqura__[\"a\"]; });\n/* unused harmony reexport NgbDatepickerMonthView */\n/* unused harmony reexport NgbDatepickerDayView */\n/* unused harmony reexport NgbDatepickerNavigation */\n/* unused harmony reexport NgbDatepickerNavigationSelect */\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return __WEBPACK_IMPORTED_MODULE_13__datepicker_config__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"b\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar NgbDatepickerModule = (function () {\n function NgbDatepickerModule() {\n }\n NgbDatepickerModule.forRoot = function () {\n return {\n ngModule: NgbDatepickerModule,\n providers: [\n { provide: __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"a\" /* NgbCalendar */], useClass: __WEBPACK_IMPORTED_MODULE_9__ngb_calendar__[\"b\" /* NgbCalendarGregorian */] },\n { provide: __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], useClass: __WEBPACK_IMPORTED_MODULE_8__datepicker_i18n__[\"b\" /* NgbDatepickerI18nDefault */] },\n { provide: __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"b\" /* NgbDateParserFormatter */], useClass: __WEBPACK_IMPORTED_MODULE_10__ngb_date_parser_formatter__[\"a\" /* NgbDateISOParserFormatter */] },\n { provide: __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], useClass: __WEBPACK_IMPORTED_MODULE_11__ngb_date_adapter__[\"b\" /* NgbDateStructAdapter */] }, __WEBPACK_IMPORTED_MODULE_13__datepicker_config__[\"a\" /* NgbDatepickerConfig */]\n ]\n };\n };\n NgbDatepickerModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [\n __WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */], __WEBPACK_IMPORTED_MODULE_3__datepicker_month_view__[\"a\" /* NgbDatepickerMonthView */], __WEBPACK_IMPORTED_MODULE_4__datepicker_navigation__[\"a\" /* NgbDatepickerNavigation */], __WEBPACK_IMPORTED_MODULE_12__datepicker_navigation_select__[\"a\" /* NgbDatepickerNavigationSelect */], __WEBPACK_IMPORTED_MODULE_7__datepicker_day_view__[\"a\" /* NgbDatepickerDayView */],\n __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\" /* NgbInputDatepicker */]\n ],\n exports: [__WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */], __WEBPACK_IMPORTED_MODULE_5__datepicker_input__[\"a\" /* NgbInputDatepicker */]],\n imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"], __WEBPACK_IMPORTED_MODULE_6__angular_forms__[\"FormsModule\"]],\n entryComponents: [__WEBPACK_IMPORTED_MODULE_2__datepicker__[\"a\" /* NgbDatepicker */]]\n },] },\n ];\n /** @nocollapse */\n NgbDatepickerModule.ctorParameters = function () { return []; };\n return NgbDatepickerModule;\n}());\n\n//# sourceMappingURL=datepicker.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5tb2R1bGUuanM/YWFjMiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IE5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BQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///263\n"); /***/ }), /* 264 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (immutable) */ __webpack_exports__[\"d\"] = isChangedDate;\n/* unused harmony export dateComparator */\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = checkMinBeforeMax;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = checkDateInRange;\n/* harmony export (immutable) */ __webpack_exports__[\"e\"] = isDateSelectable;\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = buildMonths;\n/* unused harmony export buildMonth */\n/* unused harmony export getFirstViewDate */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n\n\nfunction isChangedDate(prev, next) {\n return !dateComparator(prev, next);\n}\nfunction dateComparator(prev, next) {\n return (!prev && !next) || (!!prev && !!next && prev.equals(next));\n}\nfunction checkMinBeforeMax(minDate, maxDate) {\n if (maxDate && minDate && maxDate.before(minDate)) {\n throw new Error(\"'maxDate' \" + maxDate + \" should be greater than 'minDate' \" + minDate);\n }\n}\nfunction checkDateInRange(date, minDate, maxDate) {\n if (date && minDate && date.before(minDate)) {\n return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(minDate);\n }\n if (date && maxDate && date.after(maxDate)) {\n return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(maxDate);\n }\n return date;\n}\nfunction isDateSelectable(date, minDate, maxDate, isDisabled, markDisabled) {\n // clang-format off\n return !(!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"b\" /* isDefined */])(date) ||\n isDisabled ||\n (markDisabled && markDisabled(date, { year: date.year, month: date.month })) ||\n (minDate && date.before(minDate)) ||\n (maxDate && date.after(maxDate)));\n // clang-format on\n}\nfunction buildMonths(calendar, months, date, minDate, maxDate, displayMonths, firstDayOfWeek, markDisabled, force) {\n var newMonths = [];\n var _loop_1 = function (i) {\n var newDate = calendar.getNext(date, 'm', i);\n var index = months.findIndex(function (month) { return month.firstDate.equals(newDate); });\n if (force || index === -1) {\n newMonths.push(buildMonth(calendar, newDate, minDate, maxDate, firstDayOfWeek, markDisabled));\n }\n else {\n newMonths.push(months[index]);\n }\n };\n for (var i = 0; i < displayMonths; i++) {\n _loop_1(i);\n }\n return newMonths;\n}\nfunction buildMonth(calendar, date, minDate, maxDate, firstDayOfWeek, markDisabled) {\n var month = { firstDate: null, lastDate: null, number: date.month, year: date.year, weeks: [], weekdays: [] };\n date = getFirstViewDate(calendar, date, firstDayOfWeek);\n // month has weeks\n for (var week = 0; week < calendar.getWeeksPerMonth(); week++) {\n var days = [];\n // week has days\n for (var day = 0; day < calendar.getDaysPerWeek(); day++) {\n if (week === 0) {\n month.weekdays.push(calendar.getWeekday(date));\n }\n var newDate = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day);\n var nextDate = calendar.getNext(newDate);\n // marking date as disabled\n var disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));\n if (!disabled && markDisabled) {\n disabled = markDisabled(newDate, { month: month.number, year: month.year });\n }\n // saving first date of the month\n if (month.firstDate === null && newDate.month === month.number) {\n month.firstDate = newDate;\n }\n // saving last date of the month\n if (newDate.month === month.number && nextDate.month !== month.number) {\n month.lastDate = newDate;\n }\n days.push({\n date: newDate,\n context: {\n date: { year: newDate.year, month: newDate.month, day: newDate.day },\n currentMonth: month.number,\n disabled: disabled,\n focused: false,\n selected: false\n }\n });\n date = nextDate;\n }\n month.weeks.push({ number: calendar.getWeekNumber(days.map(function (day) { return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(day.date); }), firstDayOfWeek), days: days });\n }\n return month;\n}\nfunction getFirstViewDate(calendar, date, firstDayOfWeek) {\n var currentMonth = date.month;\n var today = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day);\n var yesterday = calendar.getPrev(today);\n var firstDayOfCurrentMonthIsAlsoFirstDayOfWeek = function () { return today.month !== yesterday.month && firstDayOfWeek === calendar.getWeekday(today); };\n var reachedTheFirstDayOfTheLastWeekOfPreviousMonth = function () { return today.month !== currentMonth && firstDayOfWeek === calendar.getWeekday(today); };\n // going back in time\n while (!reachedTheFirstDayOfTheLastWeekOfPreviousMonth() && !firstDayOfCurrentMonthIsAlsoFirstDayOfWeek()) {\n today = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](yesterday.year, yesterday.month, yesterday.day);\n yesterday = calendar.getPrev(yesterday);\n }\n return today;\n}\n//# sourceMappingURL=datepicker-tools.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJza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soKTsgZGF5KyspIHtcbiAgICAgICAgICAgIGlmICh3ZWVrID09PSAwKSB7XG4gICAgICAgICAgICAgICAgbW9udGgud2Vla2RheXMucHVzaChjYWxlbmRhci5nZXRXZWVrZGF5KGRhdGUpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBuZXdEYXRlID0gbmV3IE5nYkRhdGUoZGF0ZS55ZWFyLCBkYXRlLm1vbnRoLCBkYXRlLmRheSk7XG4gICAgICAgICAgICB2YXIgbmV4dERhdGUgPSBjYWxlbmRhci5nZXROZXh0KG5ld0RhdGUpO1xuICAgICAgICAgICAgLy8gbWFya2luZyBkYXRlIGFzIGRpc2FibGVkXG4gICAgICAgICAgICB2YXIgZGlzYWJsZWQgPSAhISgobWluRGF0ZSAmJiBuZXdEYXRlLmJlZm9yZShtaW5EYXRlKSkgfHwgKG1heERhdGUgJiYgbmV3RGF0ZS5hZnRlcihtYXhEYXRlKSkpO1xuICAgICAgICAgICAgaWYgKCFkaXNhYmxlZCAmJiBtYXJrRGlzYWJsZWQpIHtcbiAgICAgICAgICAgICAgICBkaXNhYmxlZCA9IG1hcmtEaXNhYmxlZChuZXdEYXRlLCB7IG1vbnRoOiBtb250aC5udW1iZXIsIHllYXI6IG1vbnRoLnllYXIgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBzYXZpbmcgZmlyc3QgZGF0ZSBvZiB0aGUgbW9udGhcbiAgICAgICAgICAgIGlmIChtb250aC5maXJzdERhdGUgPT09IG51bGwgJiYgbmV3RGF0ZS5tb250aCA9PT0gbW9udGgubnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgbW9udGguZmlyc3REYXRlID0gbmV3RGF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHNhdmluZyBsYXN0IGRhdGUgb2YgdGhlIG1vbnRoXG4gICAgICAgICAgICBpZiAobmV3RGF0ZS5tb250aCA9PT0gbW9udGgubnVtYmVyICYmIG5leHREYXRlLm1vbnRoICE9PSBtb250aC5udW1iZXIpIHtcbiAgICAgICAgICAgICAgICBtb250aC5sYXN0RGF0ZSA9IG5ld0RhdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkYXlzLnB1c2goe1xuICAgICAgICAgICAgICAgIGRhdGU6IG5ld0RhdGUsXG4gICAgICAgICAgICAgICAgY29udGV4dDoge1xuICAgICAgICAgICAgICAgICAgICBkYXRlOiB7IHllYXI6IG5ld0RhdGUueWVhciwgbW9udGg6IG5ld0RhdGUubW9udGgsIGRheTogbmV3RGF0ZS5kYXkgfSxcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudE1vbnRoOiBtb250aC5udW1iZXIsXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiBkaXNhYmxlZCxcbiAgICAgICAgICAgICAgICAgICAgZm9jdXNlZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBmYWxzZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0ZSA9IG5leHREYXRlO1xuICAgICAgICB9XG4gICAgICAgIG1vbnRoLndlZWtzLnB1c2goeyBudW1iZXI6IGNhbGVuZGFyLmdldFdlZWtOdW1iZXIoZGF5cy5tYXAoZnVuY3Rpb24gKGRheSkgeyByZXR1cm4gTmdiRGF0ZS5mcm9tKGRheS5kYXRlKTsgfSksIGZpcnN0RGF5T2ZXZWVrKSwgZGF5czogZGF5cyB9KTtcbiAgICB9XG4gICAgcmV0dXJuIG1vbnRoO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGdldEZpcnN0Vmlld0RhdGUoY2FsZW5kYXIsIGRhdGUsIGZpcnN0RGF5T2ZXZWVrKSB7XG4gICAgdmFyIGN1cnJlbnRNb250aCA9IGRhdGUubW9udGg7XG4gICAgdmFyIHRvZGF5ID0gbmV3IE5nYkRhdGUoZGF0ZS55ZWFyLCBkYXRlLm1vbnRoLCBkYXRlLmRheSk7XG4gICAg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LmpzXG4vLyBtb2R1bGUgaWQgPSAyNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///264\n"); +eval("/* harmony export (immutable) */ __webpack_exports__[\"d\"] = isChangedDate;\n/* unused harmony export dateComparator */\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = checkMinBeforeMax;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = checkDateInRange;\n/* harmony export (immutable) */ __webpack_exports__[\"e\"] = isDateSelectable;\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = buildMonths;\n/* unused harmony export buildMonth */\n/* unused harmony export getFirstViewDate */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n\n\nfunction isChangedDate(prev, next) {\n return !dateComparator(prev, next);\n}\nfunction dateComparator(prev, next) {\n return (!prev && !next) || (!!prev && !!next && prev.equals(next));\n}\nfunction checkMinBeforeMax(minDate, maxDate) {\n if (maxDate && minDate && maxDate.before(minDate)) {\n throw new Error(\"'maxDate' \" + maxDate + \" should be greater than 'minDate' \" + minDate);\n }\n}\nfunction checkDateInRange(date, minDate, maxDate) {\n if (date && minDate && date.before(minDate)) {\n return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(minDate);\n }\n if (date && maxDate && date.after(maxDate)) {\n return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(maxDate);\n }\n return date;\n}\nfunction isDateSelectable(date, minDate, maxDate, isDisabled, markDisabled) {\n // clang-format off\n return !(!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"b\" /* isDefined */])(date) ||\n isDisabled ||\n (markDisabled && markDisabled(date, { year: date.year, month: date.month })) ||\n (minDate && date.before(minDate)) ||\n (maxDate && date.after(maxDate)));\n // clang-format on\n}\nfunction buildMonths(calendar, months, date, minDate, maxDate, displayMonths, firstDayOfWeek, markDisabled, force) {\n var newMonths = [];\n var _loop_1 = function (i) {\n var newDate = calendar.getNext(date, 'm', i);\n var index = months.findIndex(function (month) { return month.firstDate.equals(newDate); });\n if (force || index === -1) {\n newMonths.push(buildMonth(calendar, newDate, minDate, maxDate, firstDayOfWeek, markDisabled));\n }\n else {\n newMonths.push(months[index]);\n }\n };\n for (var i = 0; i < displayMonths; i++) {\n _loop_1(i);\n }\n return newMonths;\n}\nfunction buildMonth(calendar, date, minDate, maxDate, firstDayOfWeek, markDisabled) {\n var month = { firstDate: null, lastDate: null, number: date.month, year: date.year, weeks: [], weekdays: [] };\n date = getFirstViewDate(calendar, date, firstDayOfWeek);\n // month has weeks\n for (var week = 0; week < calendar.getWeeksPerMonth(); week++) {\n var days = [];\n // week has days\n for (var day = 0; day < calendar.getDaysPerWeek(); day++) {\n if (week === 0) {\n month.weekdays.push(calendar.getWeekday(date));\n }\n var newDate = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day);\n var nextDate = calendar.getNext(newDate);\n // marking date as disabled\n var disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));\n if (!disabled && markDisabled) {\n disabled = markDisabled(newDate, { month: month.number, year: month.year });\n }\n // saving first date of the month\n if (month.firstDate === null && newDate.month === month.number) {\n month.firstDate = newDate;\n }\n // saving last date of the month\n if (newDate.month === month.number && nextDate.month !== month.number) {\n month.lastDate = newDate;\n }\n days.push({\n date: newDate,\n context: {\n date: { year: newDate.year, month: newDate.month, day: newDate.day },\n currentMonth: month.number,\n disabled: disabled,\n focused: false,\n selected: false\n }\n });\n date = nextDate;\n }\n month.weeks.push({ number: calendar.getWeekNumber(days.map(function (day) { return __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */].from(day.date); }), firstDayOfWeek), days: days });\n }\n return month;\n}\nfunction getFirstViewDate(calendar, date, firstDayOfWeek) {\n var currentMonth = date.month;\n var today = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day);\n var yesterday = calendar.getPrev(today);\n var firstDayOfCurrentMonthIsAlsoFirstDayOfWeek = function () { return today.month !== yesterday.month && firstDayOfWeek === calendar.getWeekday(today); };\n var reachedTheFirstDayOfTheLastWeekOfPreviousMonth = function () { return today.month !== currentMonth && firstDayOfWeek === calendar.getWeekday(today); };\n // going back in time\n while (!reachedTheFirstDayOfTheLastWeekOfPreviousMonth() && !firstDayOfCurrentMonthIsAlsoFirstDayOfWeek()) {\n today = new __WEBPACK_IMPORTED_MODULE_0__ngb_date__[\"a\" /* NgbDate */](yesterday.year, yesterday.month, yesterday.day);\n yesterday = calendar.getPrev(yesterday);\n }\n return today;\n}\n//# sourceMappingURL=datepicker-tools.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci10b29scy5qcz80NTM3Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nYkRhdGUgfSBmcm9tICcuL25nYi1kYXRlJztcbmltcG9ydCB7IGlzRGVmaW5lZCB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5leHBvcnQgZnVuY3Rpb24gaXNDaGFuZ2VkRGF0ZShwcmV2LCBuZXh0KSB7XG4gICAgcmV0dXJuICFkYXRlQ29tcGFyYXRvcihwcmV2LCBuZXh0KTtcbn1cbmV4cG9ydCBmdW5jdGlvbiBkYXRlQ29tcGFyYXRvcihwcmV2LCBuZXh0KSB7XG4gICAgcmV0dXJuICghcHJldiAmJiAhbmV4dCkgfHwgKCEhcHJldiAmJiAhIW5leHQgJiYgcHJldi5lcXVhbHMobmV4dCkpO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGNoZWNrTWluQmVmb3JlTWF4KG1pbkRhdGUsIG1heERhdGUpIHtcbiAgICBpZiAobWF4RGF0ZSAmJiBtaW5EYXRlICYmIG1heERhdGUuYmVmb3JlKG1pbkRhdGUpKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIidtYXhEYXRlJyBcI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AgICAgICAgIGlmIChtb250aC5maXJzdERhdGUgPT09IG51bGwgJiYgbmV3RGF0ZS5tb250aCA9PT0gbW9udGgubnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgbW9udGguZmlyc3REYXRlID0gbmV3RGF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHNhdmluZyBsYXN0IGRhdGUgb2YgdGhlIG1vbnRoXG4gICAgICAgICAgICBpZiAobmV3RGF0ZS5tb250aCA9PT0gbW9udGgubnVtYmVyICYmIG5leHREYXRlLm1vbnRoICE9PSBtb250aC5udW1iZXIpIHtcbiAgICAgICAgICAgICAgICBtb250aC5sYXN0RGF0ZSA9IG5ld0RhdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkYXlzLnB1c2goe1xuICAgICAgICAgICAgICAgIGRhdGU6IG5ld0RhdGUsXG4gICAgICAgICAgICAgICAgY29udGV4dDoge1xuICAgICAgICAgICAgICAgICAgICBkYXRlOiB7IHllYXI6IG5ld0RhdGUueWVhciwgbW9udGg6IG5ld0RhdGUubW9udGgsIGRheTogbmV3RGF0ZS5kYXkgfSxcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudE1vbnRoOiBtb250aC5udW1iZXIsXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiBkaXNhYmxlZCxcbiAgICAgICAgICAgICAgICAgICAgZm9jdXNlZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBmYWxzZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0ZSA9IG5leHREYXRlO1xuICAgICAgICB9XG4gICAgICAgIG1vbnRoLndlZWtzLnB1c2goeyBudW1iZXI6IGNhbGVuZGFyLmdldFdlZWtOdW1iZXIoZGF5cy5tYXAoZnVuY3Rpb24gKGRheSkgeyByZXR1cm4gTmdiRGF0ZS5mcm9tKGRheS5kYXRlKTsgfSksIGZpcnN0RGF5T2ZXZ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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///264\n"); /***/ }), /* 265 */ @@ -870,7 +870,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbInputDatepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker__ = __webpack_require__(170);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngb_date_parser_formatter__ = __webpack_require__(173);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_positioning__ = __webpack_require__(99);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_service__ = __webpack_require__(171);\n\n\n\n\n\n\n\n\n\nvar NGB_DATEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbInputDatepicker; }),\n multi: true\n};\nvar NGB_DATEPICKER_VALIDATOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALIDATORS\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbInputDatepicker; }),\n multi: true\n};\n/**\n * A directive that makes it possible to have datepickers on input fields.\n * Manages integration with the input field itself (data entry) and ngModel (validation etc.).\n */\nvar NgbInputDatepicker = (function () {\n function NgbInputDatepicker(_parserFormatter, _elRef, _vcRef, _renderer, _cfr, ngZone, _service, _calendar, _ngbDateAdapter) {\n var _this = this;\n this._parserFormatter = _parserFormatter;\n this._elRef = _elRef;\n this._vcRef = _vcRef;\n this._renderer = _renderer;\n this._cfr = _cfr;\n this._service = _service;\n this._calendar = _calendar;\n this._ngbDateAdapter = _ngbDateAdapter;\n this._cRef = null;\n this._disabled = false;\n /**\n * Placement of a datepicker popup accepts:\n * \"top\", \"top-left\", \"top-right\", \"bottom\", \"bottom-left\", \"bottom-right\",\n * \"left\", \"left-top\", \"left-bottom\", \"right\", \"right-top\", \"right-bottom\"\n * and array of above values.\n */\n this.placement = 'bottom-left';\n /**\n * An event fired when navigation happens and currently displayed month changes.\n * See NgbDatepickerNavigateEvent for the payload info.\n */\n this.navigate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this._onChange = function (_) { };\n this._onTouched = function () { };\n this._validatorChange = function () { };\n this._zoneSubscription = ngZone.onStable.subscribe(function () {\n if (_this._cRef) {\n Object(__WEBPACK_IMPORTED_MODULE_5__util_positioning__[\"a\" /* positionElements */])(_this._elRef.nativeElement, _this._cRef.location.nativeElement, _this.placement, _this.container === 'body');\n }\n });\n }\n Object.defineProperty(NgbInputDatepicker.prototype, \"disabled\", {\n get: function () {\n return this._disabled;\n },\n set: function (value) {\n this._disabled = value === '' || (value && value !== 'false');\n if (this.isOpen()) {\n this._cRef.instance.setDisabledState(this._disabled);\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbInputDatepicker.prototype.registerOnChange = function (fn) { this._onChange = fn; };\n NgbInputDatepicker.prototype.registerOnTouched = function (fn) { this._onTouched = fn; };\n NgbInputDatepicker.prototype.registerOnValidatorChange = function (fn) { this._validatorChange = fn; };\n ;\n NgbInputDatepicker.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbInputDatepicker.prototype.validate = function (c) {\n var value = c.value;\n if (value === null || value === undefined) {\n return null;\n }\n var ngbDate = this._fromDateStruct(this._ngbDateAdapter.fromModel(value));\n if (!this._calendar.isValid(ngbDate)) {\n return { 'ngbDate': { invalid: c.value } };\n }\n if (this.minDate && ngbDate.before(__WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */].from(this.minDate))) {\n return { 'ngbDate': { requiredBefore: this.minDate } };\n }\n if (this.maxDate && ngbDate.after(__WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */].from(this.maxDate))) {\n return { 'ngbDate': { requiredAfter: this.maxDate } };\n }\n };\n NgbInputDatepicker.prototype.writeValue = function (value) {\n this._model = this._fromDateStruct(this._ngbDateAdapter.fromModel(value));\n this._writeModelValue(this._model);\n };\n NgbInputDatepicker.prototype.manualDateChange = function (value, updateView) {\n if (updateView === void 0) { updateView = false; }\n this._model = this._fromDateStruct(this._parserFormatter.parse(value));\n this._onChange(this._model ? this._ngbDateAdapter.toModel(this._model) : (value === '' ? null : value));\n if (updateView && this._model) {\n this._writeModelValue(this._model);\n }\n };\n NgbInputDatepicker.prototype.isOpen = function () { return !!this._cRef; };\n /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n NgbInputDatepicker.prototype.open = /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n function () {\n var _this = this;\n if (!this.isOpen()) {\n var cf = this._cfr.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_3__datepicker__[\"a\" /* NgbDatepicker */]);\n this._cRef = this._vcRef.createComponent(cf);\n this._applyPopupStyling(this._cRef.location.nativeElement);\n this._applyDatepickerInputs(this._cRef.instance);\n this._subscribeForDatepickerOutputs(this._cRef.instance);\n this._cRef.instance.ngOnInit();\n this._cRef.instance.writeValue(this._ngbDateAdapter.toModel(this._model));\n // date selection event handling\n this._cRef.instance.registerOnChange(function (selectedDate) {\n _this.writeValue(selectedDate);\n _this._onChange(selectedDate);\n _this.close();\n });\n // focus handling\n this._cRef.instance.focus();\n this._cRef.instance.setDisabledState(this.disabled);\n if (this.container === 'body') {\n window.document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);\n }\n }\n };\n /**\n * Closes the datepicker popup.\n */\n /**\n * Closes the datepicker popup.\n */\n NgbInputDatepicker.prototype.close = /**\n * Closes the datepicker popup.\n */\n function () {\n if (this.isOpen()) {\n this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));\n this._cRef = null;\n }\n };\n /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n NgbInputDatepicker.prototype.toggle = /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n function () {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n };\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n NgbInputDatepicker.prototype.navigateTo = /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n function (date) {\n if (this.isOpen()) {\n this._cRef.instance.navigateTo(date);\n }\n };\n NgbInputDatepicker.prototype.onBlur = function () { this._onTouched(); };\n NgbInputDatepicker.prototype.ngOnChanges = function (changes) {\n if (changes['minDate'] || changes['maxDate']) {\n this._validatorChange();\n }\n };\n NgbInputDatepicker.prototype.ngOnDestroy = function () {\n this.close();\n this._zoneSubscription.unsubscribe();\n };\n NgbInputDatepicker.prototype._applyDatepickerInputs = function (datepickerInstance) {\n var _this = this;\n ['dayTemplate', 'displayMonths', 'firstDayOfWeek', 'markDisabled', 'minDate', 'maxDate', 'navigation',\n 'outsideDays', 'showNavigation', 'showWeekdays', 'showWeekNumbers']\n .forEach(function (optionName) {\n if (_this[optionName] !== undefined) {\n datepickerInstance[optionName] = _this[optionName];\n }\n });\n datepickerInstance.startDate = this.startDate || this._model;\n };\n NgbInputDatepicker.prototype._applyPopupStyling = function (nativeElement) {\n this._renderer.addClass(nativeElement, 'dropdown-menu');\n this._renderer.setStyle(nativeElement, 'padding', '0');\n };\n NgbInputDatepicker.prototype._subscribeForDatepickerOutputs = function (datepickerInstance) {\n var _this = this;\n datepickerInstance.navigate.subscribe(function (date) { return _this.navigate.emit(date); });\n datepickerInstance.select.subscribe(function () { _this.close(); });\n };\n NgbInputDatepicker.prototype._writeModelValue = function (model) {\n this._renderer.setProperty(this._elRef.nativeElement, 'value', this._parserFormatter.format(model));\n if (this.isOpen()) {\n this._cRef.instance.writeValue(this._ngbDateAdapter.toModel(model));\n this._onTouched();\n }\n };\n NgbInputDatepicker.prototype._fromDateStruct = function (date) {\n var ngbDate = date ? new __WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day) : null;\n return this._calendar.isValid(ngbDate) ? ngbDate : null;\n };\n NgbInputDatepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'input[ngbDatepicker]',\n exportAs: 'ngbDatepicker',\n host: {\n '(input)': 'manualDateChange($event.target.value)',\n '(change)': 'manualDateChange($event.target.value, true)',\n '(keyup.esc)': 'close()',\n '(blur)': 'onBlur()',\n '[disabled]': 'disabled'\n },\n providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NGB_DATEPICKER_VALIDATOR, __WEBPACK_IMPORTED_MODULE_8__datepicker_service__[\"a\" /* NgbDatepickerService */]]\n },] },\n ];\n /** @nocollapse */\n NgbInputDatepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_4__ngb_date_parser_formatter__[\"b\" /* NgbDateParserFormatter */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_8__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_7__ngb_calendar__[\"a\" /* NgbCalendar */], },\n { type: __WEBPACK_IMPORTED_MODULE_6__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], },\n ]; };\n NgbInputDatepicker.propDecorators = {\n \"dayTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"displayMonths\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"firstDayOfWeek\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"markDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigation\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"outsideDays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"placement\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekdays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekNumbers\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"startDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"container\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbInputDatepicker;\n}());\n\n//# sourceMappingURL=datepicker-input.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1pbnB1dC5qcz84NThlIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSwgSW5wdXQsIEVsZW1lbnRSZWYsIFZpZXdDb250YWluZXJSZWYsIFJlbmRlcmVyMiwgQ29tcG9uZW50RmFjdG9yeVJlc29sdmVyLCBOZ1pvbmUsIFRlbXBsYXRlUmVmLCBmb3J3YXJkUmVmLCBFdmVudEVtaXR0ZXIsIE91dHB1dCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTkdfVkFMVUVfQUNDRVNTT1IsIE5HX1ZBTElEQVRPUlMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBOZ2JEYXRlIH0gZnJvbSAnLi9uZ2ItZGF0ZSc7XG5pbXBvcnQgeyBO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al:///268\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbInputDatepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker__ = __webpack_require__(170);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngb_date_parser_formatter__ = __webpack_require__(173);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_positioning__ = __webpack_require__(99);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ngb_date_adapter__ = __webpack_require__(122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__datepicker_service__ = __webpack_require__(171);\n\n\n\n\n\n\n\n\n\nvar NGB_DATEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbInputDatepicker; }),\n multi: true\n};\nvar NGB_DATEPICKER_VALIDATOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALIDATORS\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbInputDatepicker; }),\n multi: true\n};\n/**\n * A directive that makes it possible to have datepickers on input fields.\n * Manages integration with the input field itself (data entry) and ngModel (validation etc.).\n */\nvar NgbInputDatepicker = (function () {\n function NgbInputDatepicker(_parserFormatter, _elRef, _vcRef, _renderer, _cfr, ngZone, _service, _calendar, _ngbDateAdapter) {\n var _this = this;\n this._parserFormatter = _parserFormatter;\n this._elRef = _elRef;\n this._vcRef = _vcRef;\n this._renderer = _renderer;\n this._cfr = _cfr;\n this._service = _service;\n this._calendar = _calendar;\n this._ngbDateAdapter = _ngbDateAdapter;\n this._cRef = null;\n this._disabled = false;\n /**\n * Placement of a datepicker popup accepts:\n * \"top\", \"top-left\", \"top-right\", \"bottom\", \"bottom-left\", \"bottom-right\",\n * \"left\", \"left-top\", \"left-bottom\", \"right\", \"right-top\", \"right-bottom\"\n * and array of above values.\n */\n this.placement = 'bottom-left';\n /**\n * An event fired when navigation happens and currently displayed month changes.\n * See NgbDatepickerNavigateEvent for the payload info.\n */\n this.navigate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this._onChange = function (_) { };\n this._onTouched = function () { };\n this._validatorChange = function () { };\n this._zoneSubscription = ngZone.onStable.subscribe(function () {\n if (_this._cRef) {\n Object(__WEBPACK_IMPORTED_MODULE_5__util_positioning__[\"a\" /* positionElements */])(_this._elRef.nativeElement, _this._cRef.location.nativeElement, _this.placement, _this.container === 'body');\n }\n });\n }\n Object.defineProperty(NgbInputDatepicker.prototype, \"disabled\", {\n get: function () {\n return this._disabled;\n },\n set: function (value) {\n this._disabled = value === '' || (value && value !== 'false');\n if (this.isOpen()) {\n this._cRef.instance.setDisabledState(this._disabled);\n }\n },\n enumerable: true,\n configurable: true\n });\n NgbInputDatepicker.prototype.registerOnChange = function (fn) { this._onChange = fn; };\n NgbInputDatepicker.prototype.registerOnTouched = function (fn) { this._onTouched = fn; };\n NgbInputDatepicker.prototype.registerOnValidatorChange = function (fn) { this._validatorChange = fn; };\n ;\n NgbInputDatepicker.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbInputDatepicker.prototype.validate = function (c) {\n var value = c.value;\n if (value === null || value === undefined) {\n return null;\n }\n var ngbDate = this._fromDateStruct(this._ngbDateAdapter.fromModel(value));\n if (!this._calendar.isValid(ngbDate)) {\n return { 'ngbDate': { invalid: c.value } };\n }\n if (this.minDate && ngbDate.before(__WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */].from(this.minDate))) {\n return { 'ngbDate': { requiredBefore: this.minDate } };\n }\n if (this.maxDate && ngbDate.after(__WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */].from(this.maxDate))) {\n return { 'ngbDate': { requiredAfter: this.maxDate } };\n }\n };\n NgbInputDatepicker.prototype.writeValue = function (value) {\n this._model = this._fromDateStruct(this._ngbDateAdapter.fromModel(value));\n this._writeModelValue(this._model);\n };\n NgbInputDatepicker.prototype.manualDateChange = function (value, updateView) {\n if (updateView === void 0) { updateView = false; }\n this._model = this._fromDateStruct(this._parserFormatter.parse(value));\n this._onChange(this._model ? this._ngbDateAdapter.toModel(this._model) : (value === '' ? null : value));\n if (updateView && this._model) {\n this._writeModelValue(this._model);\n }\n };\n NgbInputDatepicker.prototype.isOpen = function () { return !!this._cRef; };\n /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n NgbInputDatepicker.prototype.open = /**\n * Opens the datepicker with the selected date indicated by the ngModel value.\n */\n function () {\n var _this = this;\n if (!this.isOpen()) {\n var cf = this._cfr.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_3__datepicker__[\"a\" /* NgbDatepicker */]);\n this._cRef = this._vcRef.createComponent(cf);\n this._applyPopupStyling(this._cRef.location.nativeElement);\n this._applyDatepickerInputs(this._cRef.instance);\n this._subscribeForDatepickerOutputs(this._cRef.instance);\n this._cRef.instance.ngOnInit();\n this._cRef.instance.writeValue(this._ngbDateAdapter.toModel(this._model));\n // date selection event handling\n this._cRef.instance.registerOnChange(function (selectedDate) {\n _this.writeValue(selectedDate);\n _this._onChange(selectedDate);\n _this.close();\n });\n // focus handling\n this._cRef.instance.focus();\n this._cRef.instance.setDisabledState(this.disabled);\n if (this.container === 'body') {\n window.document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);\n }\n }\n };\n /**\n * Closes the datepicker popup.\n */\n /**\n * Closes the datepicker popup.\n */\n NgbInputDatepicker.prototype.close = /**\n * Closes the datepicker popup.\n */\n function () {\n if (this.isOpen()) {\n this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));\n this._cRef = null;\n }\n };\n /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n NgbInputDatepicker.prototype.toggle = /**\n * Toggles the datepicker popup (opens when closed and closes when opened).\n */\n function () {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n };\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n NgbInputDatepicker.prototype.navigateTo = /**\n * Navigates current view to provided date.\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\n * If nothing or invalid date provided calendar will open current month.\n * Use 'startDate' input as an alternative\n */\n function (date) {\n if (this.isOpen()) {\n this._cRef.instance.navigateTo(date);\n }\n };\n NgbInputDatepicker.prototype.onBlur = function () { this._onTouched(); };\n NgbInputDatepicker.prototype.ngOnChanges = function (changes) {\n if (changes['minDate'] || changes['maxDate']) {\n this._validatorChange();\n }\n };\n NgbInputDatepicker.prototype.ngOnDestroy = function () {\n this.close();\n this._zoneSubscription.unsubscribe();\n };\n NgbInputDatepicker.prototype._applyDatepickerInputs = function (datepickerInstance) {\n var _this = this;\n ['dayTemplate', 'displayMonths', 'firstDayOfWeek', 'markDisabled', 'minDate', 'maxDate', 'navigation',\n 'outsideDays', 'showNavigation', 'showWeekdays', 'showWeekNumbers']\n .forEach(function (optionName) {\n if (_this[optionName] !== undefined) {\n datepickerInstance[optionName] = _this[optionName];\n }\n });\n datepickerInstance.startDate = this.startDate || this._model;\n };\n NgbInputDatepicker.prototype._applyPopupStyling = function (nativeElement) {\n this._renderer.addClass(nativeElement, 'dropdown-menu');\n this._renderer.setStyle(nativeElement, 'padding', '0');\n };\n NgbInputDatepicker.prototype._subscribeForDatepickerOutputs = function (datepickerInstance) {\n var _this = this;\n datepickerInstance.navigate.subscribe(function (date) { return _this.navigate.emit(date); });\n datepickerInstance.select.subscribe(function () { _this.close(); });\n };\n NgbInputDatepicker.prototype._writeModelValue = function (model) {\n this._renderer.setProperty(this._elRef.nativeElement, 'value', this._parserFormatter.format(model));\n if (this.isOpen()) {\n this._cRef.instance.writeValue(this._ngbDateAdapter.toModel(model));\n this._onTouched();\n }\n };\n NgbInputDatepicker.prototype._fromDateStruct = function (date) {\n var ngbDate = date ? new __WEBPACK_IMPORTED_MODULE_2__ngb_date__[\"a\" /* NgbDate */](date.year, date.month, date.day) : null;\n return this._calendar.isValid(ngbDate) ? ngbDate : null;\n };\n NgbInputDatepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'input[ngbDatepicker]',\n exportAs: 'ngbDatepicker',\n host: {\n '(input)': 'manualDateChange($event.target.value)',\n '(change)': 'manualDateChange($event.target.value, true)',\n '(keyup.esc)': 'close()',\n '(blur)': 'onBlur()',\n '[disabled]': 'disabled'\n },\n providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NGB_DATEPICKER_VALIDATOR, __WEBPACK_IMPORTED_MODULE_8__datepicker_service__[\"a\" /* NgbDatepickerService */]]\n },] },\n ];\n /** @nocollapse */\n NgbInputDatepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_4__ngb_date_parser_formatter__[\"b\" /* NgbDateParserFormatter */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n { type: __WEBPACK_IMPORTED_MODULE_8__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_7__ngb_calendar__[\"a\" /* NgbCalendar */], },\n { type: __WEBPACK_IMPORTED_MODULE_6__ngb_date_adapter__[\"a\" /* NgbDateAdapter */], },\n ]; };\n NgbInputDatepicker.propDecorators = {\n \"dayTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"displayMonths\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"firstDayOfWeek\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"markDisabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigation\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"outsideDays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"placement\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekdays\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showWeekNumbers\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"startDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"container\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"navigate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbInputDatepicker;\n}());\n\n//# sourceMappingURL=datepicker-input.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1pbnB1dC5qcz84NThlIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSwgSW5wdXQsIEVsZW1lbnRSZWYsIFZpZXdDb250YWluZXJSZWYsIFJlbmRlcmVyMiwgQ29tcG9uZW50RmFjdG9yeVJlc29sdmVyLCBOZ1pvbmUsIFRlbXBsYXRlUmVmLCBmb3J3YXJkUmVmLCBFdmVudEVtaXR0ZXIsIE91dHB1dCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTkdfVkFMVUVfQUNDRVNTT1IsIE5HX1ZBTElEQVRPUlMgfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQgeyBOZ2JEYXRlIH0gZnJvbSAnLi9uZ2ItZGF0ZSc7XG5pbXBvcnQgeyBOZ2JEYXRlcGlja2VyIH0gZnJvbSAnLi9kYXRlcGlja2VyJztcbmltcG9ydCB7IE5nYkRhdGVQYXJzZXJGb3JtYXR0ZXIgfSBmcm9tICcuL25nYi1kYXRlLXBhcnNlci1mb3JtYXR0ZXInO1xuaW1wb3J0IHsgcG9zaXRpb25FbGVtZW50cyB9IGZyb20gJy4uL3V0aWwvcG9zaXRpb25pbmcnO1xuaW1wb3J0IHsgTmdiRGF0ZUFkYXB0ZXIgfSBmcm9tICcuL25nYi1kYXRl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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///268\n"); /***/ }), /* 269 */ @@ -884,7 +884,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerNavigationSelect; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngb_calendar__ = __webpack_require__(54);\n\n\n\n\n\nvar NgbDatepickerNavigationSelect = (function () {\n function NgbDatepickerNavigationSelect(i18n, calendar) {\n this.i18n = i18n;\n this.calendar = calendar;\n this.years = [];\n this.select = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.months = calendar.getMonths();\n }\n NgbDatepickerNavigationSelect.prototype.ngOnChanges = function (changes) {\n if (changes['maxDate'] || changes['minDate'] || changes['date']) {\n this._generateYears();\n this._generateMonths();\n }\n };\n NgbDatepickerNavigationSelect.prototype.changeMonth = function (month) { this.select.emit(new __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */](this.date.year, Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(month), 1)); };\n NgbDatepickerNavigationSelect.prototype.changeYear = function (year) { this.select.emit(new __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */](Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(year), this.date.month, 1)); };\n NgbDatepickerNavigationSelect.prototype._generateMonths = function () {\n var _this = this;\n this.months = this.calendar.getMonths();\n if (this.date && this.date.year === this.minDate.year) {\n var index = this.months.findIndex(function (month) { return month === _this.minDate.month; });\n this.months = this.months.slice(index);\n }\n if (this.date && this.date.year === this.maxDate.year) {\n var index = this.months.findIndex(function (month) { return month === _this.maxDate.month; });\n this.months = this.months.slice(0, index + 1);\n }\n };\n NgbDatepickerNavigationSelect.prototype._generateYears = function () {\n var _this = this;\n this.years = Array.from({ length: this.maxDate.year - this.minDate.year + 1 }, function (e, i) { return _this.minDate.year + i; });\n };\n NgbDatepickerNavigationSelect.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-datepicker-navigation-select',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n styles: [\"\\n :host>select {\\n /* to align with btn-sm */\\n padding: 0.25rem 0.5rem;\\n font-size: 0.875rem;\\n line-height: 1.25;\\n /* to cancel the custom height set by custom-select */\\n height: inherit;\\n width: 50%;\\n display: inline-block;\\n }\\n \"],\n template: \"\\n <select\\n [disabled]=\\\"disabled\\\"\\n class=\\\"custom-select\\\"\\n [value]=\\\"date?.month\\\"\\n (change)=\\\"changeMonth($event.target.value)\\\"\\n tabindex=\\\"-1\\\">\\n <option *ngFor=\\\"let m of months\\\" [value]=\\\"m\\\">{{ i18n.getMonthShortName(m) }}</option>\\n </select><select\\n [disabled]=\\\"disabled\\\"\\n class=\\\"custom-select\\\"\\n [value]=\\\"date?.year\\\"\\n (change)=\\\"changeYear($event.target.value)\\\"\\n tabindex=\\\"-1\\\">\\n <option *ngFor=\\\"let y of years\\\" [value]=\\\"y\\\">{{ y }}</option>\\n </select>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbDatepickerNavigationSelect.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_3__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], },\n { type: __WEBPACK_IMPORTED_MODULE_4__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n NgbDatepickerNavigationSelect.propDecorators = {\n \"date\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"select\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbDatepickerNavigationSelect;\n}());\n\n//# sourceMappingURL=datepicker-navigation-select.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1uYXZpZ2F0aW9uLXNlbGVjdC5qcz9hODE1Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgSW5wdXQsIE91dHB1dCwgRXZlbnRFbWl0dGVyLCBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTmdiRGF0ZSB9IGZyb20gJy4vbmdiLWRhdGUnO1xuaW1wb3J0IHsgdG9JbnRlZ2VyIH0gZnJvbSAnLi4vdXRpbC91dGlsJztcbmltcG9ydCB7IE5nYkRhdGVwaWNrZXJJMThuIH0gZnJvbSAnLi9kYXRlcGlja2VyLWkxOG4nO1xuaW1wb3J0IHsgTmdiQ2FsZW5kYXIgfSBmcm9tICcuL25nYi1jYWxlbmRhcic7XG52YXIgTmdiRGF0ZXBpY2tlck5hdmlnYXRpb25TZWxlY3QgPSAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE5nYkRhdGVwaWNrZXJOYXZpZ2F0aW9uU2VsZWN0KGkxOG4sIGNhbGVuZGFyKSB7XG4gICAgICAgIHRoaXMuaTE4biA9IGkxOG47XG4gICAgICAgIHRoaXMuY2FsZW5kYXIgPSBjYWxlbmRhcjtcbiAgICAgICAgdGhpcy55ZWFycyA9IFtdO1xuICAgICAgICB0aGlzLnNlbGVjdCA9IG5ldyBFdmVudEVtaXR0ZXIoKTtcbiAgICAgICAgdGhpcy5tb250aHMgPSBjYWxlbm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cGluZ1VSTD1kYXRlcGlja2VyLW5hdmlnYXRpb24tc2VsZWN0LmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1uYXZpZ2F0aW9uLXNlbGVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjcwXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///270\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerNavigationSelect; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngb_date__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker_i18n__ = __webpack_require__(86);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngb_calendar__ = __webpack_require__(54);\n\n\n\n\n\nvar NgbDatepickerNavigationSelect = (function () {\n function NgbDatepickerNavigationSelect(i18n, calendar) {\n this.i18n = i18n;\n this.calendar = calendar;\n this.years = [];\n this.select = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.months = calendar.getMonths();\n }\n NgbDatepickerNavigationSelect.prototype.ngOnChanges = function (changes) {\n if (changes['maxDate'] || changes['minDate'] || changes['date']) {\n this._generateYears();\n this._generateMonths();\n }\n };\n NgbDatepickerNavigationSelect.prototype.changeMonth = function (month) { this.select.emit(new __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */](this.date.year, Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(month), 1)); };\n NgbDatepickerNavigationSelect.prototype.changeYear = function (year) { this.select.emit(new __WEBPACK_IMPORTED_MODULE_1__ngb_date__[\"a\" /* NgbDate */](Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(year), this.date.month, 1)); };\n NgbDatepickerNavigationSelect.prototype._generateMonths = function () {\n var _this = this;\n this.months = this.calendar.getMonths();\n if (this.date && this.date.year === this.minDate.year) {\n var index = this.months.findIndex(function (month) { return month === _this.minDate.month; });\n this.months = this.months.slice(index);\n }\n if (this.date && this.date.year === this.maxDate.year) {\n var index = this.months.findIndex(function (month) { return month === _this.maxDate.month; });\n this.months = this.months.slice(0, index + 1);\n }\n };\n NgbDatepickerNavigationSelect.prototype._generateYears = function () {\n var _this = this;\n this.years = Array.from({ length: this.maxDate.year - this.minDate.year + 1 }, function (e, i) { return _this.minDate.year + i; });\n };\n NgbDatepickerNavigationSelect.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-datepicker-navigation-select',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n styles: [\"\\n :host>select {\\n /* to align with btn-sm */\\n padding: 0.25rem 0.5rem;\\n font-size: 0.875rem;\\n line-height: 1.25;\\n /* to cancel the custom height set by custom-select */\\n height: inherit;\\n width: 50%;\\n display: inline-block;\\n }\\n \"],\n template: \"\\n <select\\n [disabled]=\\\"disabled\\\"\\n class=\\\"custom-select\\\"\\n [value]=\\\"date?.month\\\"\\n (change)=\\\"changeMonth($event.target.value)\\\"\\n tabindex=\\\"-1\\\">\\n <option *ngFor=\\\"let m of months\\\" [value]=\\\"m\\\">{{ i18n.getMonthShortName(m) }}</option>\\n </select><select\\n [disabled]=\\\"disabled\\\"\\n class=\\\"custom-select\\\"\\n [value]=\\\"date?.year\\\"\\n (change)=\\\"changeYear($event.target.value)\\\"\\n tabindex=\\\"-1\\\">\\n <option *ngFor=\\\"let y of years\\\" [value]=\\\"y\\\">{{ y }}</option>\\n </select>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbDatepickerNavigationSelect.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_3__datepicker_i18n__[\"a\" /* NgbDatepickerI18n */], },\n { type: __WEBPACK_IMPORTED_MODULE_4__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n NgbDatepickerNavigationSelect.propDecorators = {\n \"date\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minDate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"select\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbDatepickerNavigationSelect;\n}());\n\n//# sourceMappingURL=datepic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pzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1uYXZpZ2F0aW9uLXNlbGVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjcwXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///270\n"); /***/ }), /* 271 */ @@ -898,7 +898,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCalendarHijri; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar NgbCalendarHijri = (function (_super) {\n __extends(NgbCalendarHijri, _super);\n function NgbCalendarHijri() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbCalendarHijri.prototype.getDaysPerWeek = function () { return 7; };\n NgbCalendarHijri.prototype.getMonths = function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };\n NgbCalendarHijri.prototype.getWeeksPerMonth = function () { return 6; };\n NgbCalendarHijri.prototype.isValid = function (date) {\n return date && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.year) && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.month) && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.day) &&\n !isNaN(this.toGregorian(date).getTime());\n };\n NgbCalendarHijri.prototype.setDay = function (date, day) {\n day = +day;\n var mDays = this.getDaysInIslamicMonth(date.month, date.year);\n if (day <= 0) {\n while (day <= 0) {\n date = this.setMonth(date, date.month - 1);\n mDays = this.getDaysInIslamicMonth(date.month, date.year);\n day += mDays;\n }\n }\n else if (day > mDays) {\n while (day > mDays) {\n day -= mDays;\n date = this.setMonth(date, date.month + 1);\n mDays = this.getDaysInIslamicMonth(date.month, date.year);\n }\n }\n date.day = day;\n return date;\n };\n NgbCalendarHijri.prototype.setMonth = function (date, month) {\n month = +month;\n date.year = date.year + Math.floor((month - 1) / 12);\n date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;\n return date;\n };\n NgbCalendarHijri.prototype.setYear = function (date, yearValue) {\n date.year = +yearValue;\n return date;\n };\n NgbCalendarHijri.prototype._isIslamicLeapYear = function (year) { return (14 + 11 * year) % 30 < 11; };\n /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n NgbCalendarHijri.prototype._getMonthStart = /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n function (year, month) {\n return Math.ceil(29.5 * month) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);\n };\n /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n NgbCalendarHijri.prototype._getYearStart = /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n function (year) { return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0); };\n NgbCalendarHijri.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendarHijri.ctorParameters = function () { return []; };\n return NgbCalendarHijri;\n}(__WEBPACK_IMPORTED_MODULE_0__ngb_calendar__[\"a\" /* NgbCalendar */]));\n\n//# sourceMappingURL=ngb-calendar-hijri.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvaGlqcmkvbmdiLWNhbGVuZGFyLWhpanJpLmpzPzA4ZWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF9fZXh0Z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LCBkYXRlLnllYXIpO1xuICAgICAgICAgICAgICAgIGRheSArPSBtRGF5cztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkYXkgPiBtRGF5cykge1xuICAgICAgICAgICAgd2hpbGUgKGRheSA+IG1EYXlzKSB7XG4gICAgICAgICAgICAgICAgZGF5IC09IG1EYXlzO1xuICAgICAgICAgICAgICAgIGRhdGUgPSB0aGlzLnNldE1vbnRoKGRhdGUsIGRhdGUubW9udGggKyAxKTtcbiAgICAgICAgICAgICAgICBtRGF5cyA9IHRoaXMuZ2V0RGF5c0luSXNsYW1pY01vbnRoKGRhdGUubW9udGgsIGRhdGUueWVhcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZGF0ZS5kYXkgPSBkYXk7XG4gICAgICAgIHJldHVybiBkYXRlO1xuICAgIH07XG4gICAgTmdiQ2FsZW5kYXJIaWpyaS5wcm90b3R5cGUuc2V0TW9udGggPSBmdW5jdGlvbiAoZGF0ZSwgbW9udGgpIHtcbiAgICAgICAgbW9udGggPSArbW9udGg7XG4gICAgICAgIGRhdGUueWVhciA9IGRhdGUueWVhciArIE1hdGguZmxvb3IoKG1vbnRoIC0gMSkgLyAxMik7XG4gICAgICAgIGRhdGUubW9udGggPSBNYXRoLmZsb29yKCgobW9udGggLSAxKSAlIDEyICsgMTIpICUgMTIpICsgMTtcbiAgICAgICAgcmV0dXJuIGRhdGU7XG4gICAgfTtcbiAgICBOZ2JDYWxlbmRhckhpanJpLnByb3RvdHlwZS5zZXRZZWFyID0gZnVuY3Rpb24gKGRhdGUsIHllYXJWYWx1ZSkge1xuICAgICAgICBkYXRlLnllYXIgPSAreWVhclZhbHVlO1xuICAgICAgICByZXR1cm4gZGF0ZTtcbiAgICB9O1xuICAgIE5nYkNhbGVuZGFySGlqcmkucHJvdG90eXBlLl9pc0lzbGFtaWNMZWFwWWVhciA9IGZ1bmN0aW9uICh5ZWFyKSB7IHJldHVybiAoM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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///272\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbCalendarHijri; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar NgbCalendarHijri = (function (_super) {\n __extends(NgbCalendarHijri, _super);\n function NgbCalendarHijri() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NgbCalendarHijri.prototype.getDaysPerWeek = function () { return 7; };\n NgbCalendarHijri.prototype.getMonths = function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };\n NgbCalendarHijri.prototype.getWeeksPerMonth = function () { return 6; };\n NgbCalendarHijri.prototype.isValid = function (date) {\n return date && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.year) && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.month) && Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(date.day) &&\n !isNaN(this.toGregorian(date).getTime());\n };\n NgbCalendarHijri.prototype.setDay = function (date, day) {\n day = +day;\n var mDays = this.getDaysInIslamicMonth(date.month, date.year);\n if (day <= 0) {\n while (day <= 0) {\n date = this.setMonth(date, date.month - 1);\n mDays = this.getDaysInIslamicMonth(date.month, date.year);\n day += mDays;\n }\n }\n else if (day > mDays) {\n while (day > mDays) {\n day -= mDays;\n date = this.setMonth(date, date.month + 1);\n mDays = this.getDaysInIslamicMonth(date.month, date.year);\n }\n }\n date.day = day;\n return date;\n };\n NgbCalendarHijri.prototype.setMonth = function (date, month) {\n month = +month;\n date.year = date.year + Math.floor((month - 1) / 12);\n date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;\n return date;\n };\n NgbCalendarHijri.prototype.setYear = function (date, yearValue) {\n date.year = +yearValue;\n return date;\n };\n NgbCalendarHijri.prototype._isIslamicLeapYear = function (year) { return (14 + 11 * year) % 30 < 11; };\n /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n NgbCalendarHijri.prototype._getMonthStart = /**\n * Returns the start of Hijri Month.\n * `month` is 0 for Muharram, 1 for Safar, etc.\n * `year` is any Hijri year.\n */\n function (year, month) {\n return Math.ceil(29.5 * month) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);\n };\n /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n NgbCalendarHijri.prototype._getYearStart = /**\n * Returns the start of Hijri year.\n * `year` is any Hijri year.\n */\n function (year) { return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0); };\n NgbCalendarHijri.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbCalendarHijri.ctorParameters = function () { return []; };\n return NgbCalendarHijri;\n}(__WEBPACK_IMPORTED_MODULE_0__ngb_calendar__[\"a\" /* NgbCalendar */]));\n\n//# sourceMappingURL=ngb-calendar-hijri.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvaGlqcmkvbmdiLWNhbGVuZGFyLWhpanJpLmpzPzA4ZWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF9fZXh0ZW5kcyA9ICh0aGlzICYmIHRoaXMuX19leHRlbmRzKSB8fCAoZnVuY3Rpb24gKCkge1xuICAgIHZhciBleHRlbmRTdGF0aWNzID0gT2JqZWN0LnNldFByb3RvdHlwZU9mIHx8XG4gICAgICAgICh7IF9fcHJvdG9fXzogW10gfSBpbnN0YW5jZW9mIEFycmF5ICYmIGZ1bmN0aW9uIChkLCBiKSB7IGQuX19wcm90b19fID0g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sIDYsIDcsIDgsIDksIDEwLCAxMSwgMTJdOyB9O1xuICAgIE5nYkNhbGVuZGFySGlqcmkucHJvdG90eXBlLmdldFdlZWtzUGVyTW9udGggPSBmdW5jdGlvbiAoKSB7IHJldHVybiA2OyB9O1xuICAgIE5nYkNhbGVuZGFySGlqcmkucHJvdG90eXBlLmlzVmFsaWQgPSBmdW5jdGlvbiAoZGF0ZSkge1xuICAgICAgICByZXR1cm4gZGF0ZSAmJiBpc051bWJlcihkYXRlLnllYXIpICYmIGlzTnVtYmVyKGRhdGUubW9udGgpICYmIGlzTnVtYmVyKGRhdGUuZGF5KSAmJlxuICAgICAgICAgICAgIWlzTmFOKHRoaXMudG9HcmVnb3JpYW4oZGF0ZSkuZ2V0VGltZSgpKTtcbiAgICB9O1xuICAgIE5nYkNhbGVuZGFySGlqcmkucHJvdG90eXBlLnNldERheSA9IGZ1bmN0aW9uIChkYXRlLCBkYXkpIHtcbiAgICAgICAgZGF5ID0gK2RheTtcbiAgICAgICAgdmFyIG1EYXlzID0gdGhpcy5nZXREYXlzSW5Jc2xhbWljTW9udGgoZGF0ZS5tb250aCwgZGF0ZS55ZWFyKTtcbiAgICAgICAgaWYgKGRheSA8PSAwKSB7XG4gICAgICAgICAgICB3aGlsZSAoZGF5IDw9IDApIHtcbiAgICAgICAgICAgICAgICBkYXRlID0gdGhpcy5zZXRNb250aChkYXRlLCBkYXRlLm1vbnRoIC0gMSk7XG4gICAgICAgICAgICAgICAgbURheXMgPSB0aGlzLmdldERheXNJbklzbGFtaWNNb250aChkYXRlLm1vbnRoLCBkYXRlLnllYXIpO1xuICAgICAgICAgICAgICAgIGRheSArPSBtRGF5cztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkYXkgPiBtRGF5cykge1xuICAgICAgICAgICAgd2hpbGUgKGRheSA+IG1EYXlzKSB7XG4gICAgICAgICAgICAgICAgZGF5IC09IG1EYXlzO1xuICAgICAgICAgICAgICAgIGRhdGU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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///272\n"); /***/ }), /* 273 */ @@ -947,7 +947,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbModalStack; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_popup__ = __webpack_require__(123);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_backdrop__ = __webpack_require__(276);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_window__ = __webpack_require__(277);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modal_ref__ = __webpack_require__(280);\n\n\n\n\n\n\nvar NgbModalStack = (function () {\n function NgbModalStack(_applicationRef, _injector, _componentFactoryResolver) {\n this._applicationRef = _applicationRef;\n this._injector = _injector;\n this._componentFactoryResolver = _componentFactoryResolver;\n this._backdropFactory = _componentFactoryResolver.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_3__modal_backdrop__[\"a\" /* NgbModalBackdrop */]);\n this._windowFactory = _componentFactoryResolver.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_4__modal_window__[\"a\" /* NgbModalWindow */]);\n }\n NgbModalStack.prototype.open = function (moduleCFR, contentInjector, content, options) {\n var containerSelector = options.container || 'body';\n var containerEl = document.querySelector(containerSelector);\n if (!containerEl) {\n throw new Error(\"The specified modal container \\\"\" + containerSelector + \"\\\" was not found in the DOM.\");\n }\n var activeModal = new __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"a\" /* NgbActiveModal */]();\n var contentRef = this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal);\n var windowCmptRef;\n var backdropCmptRef;\n var ngbModalRef;\n if (options.backdrop !== false) {\n backdropCmptRef = this._backdropFactory.create(this._injector);\n this._applicationRef.attachView(backdropCmptRef.hostView);\n containerEl.appendChild(backdropCmptRef.location.nativeElement);\n }\n windowCmptRef = this._windowFactory.create(this._injector, contentRef.nodes);\n this._applicationRef.attachView(windowCmptRef.hostView);\n containerEl.appendChild(windowCmptRef.location.nativeElement);\n ngbModalRef = new __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"b\" /* NgbModalRef */](windowCmptRef, contentRef, backdropCmptRef, options.beforeDismiss);\n activeModal.close = function (result) { ngbModalRef.close(result); };\n activeModal.dismiss = function (reason) { ngbModalRef.dismiss(reason); };\n this._applyWindowOptions(windowCmptRef.instance, options);\n return ngbModalRef;\n };\n NgbModalStack.prototype._applyWindowOptions = function (windowInstance, options) {\n ['backdrop', 'keyboard', 'size', 'windowClass'].forEach(function (optionName) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"b\" /* isDefined */])(options[optionName])) {\n windowInstance[optionName] = options[optionName];\n }\n });\n };\n NgbModalStack.prototype._getContentRef = function (moduleCFR, contentInjector, content, context) {\n if (!content) {\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([]);\n }\n else if (content instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"]) {\n var viewRef = content.createEmbeddedView(context);\n this._applicationRef.attachView(viewRef);\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([viewRef.rootNodes], viewRef);\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"e\" /* isString */])(content)) {\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([[document.createTextNode(\"\" + content)]]);\n }\n else {\n var contentCmptFactory = moduleCFR.resolveComponentFactory(content);\n var modalContentInjector = __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ReflectiveInjector\"].resolveAndCreate([{ provide: __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"a\" /* NgbActiveModal */], useValue: context }], contentInjector);\n var componentRef = contentCmptFactory.create(modalContentInjector);\n this._applicationRef.attachView(componentRef.hostView);\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([[componentRef.location.nativeElement]], componentRef.hostView, componentRef);\n }\n };\n NgbModalStack.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbModalStack.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ApplicationRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injector\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n ]; };\n return NgbModalStack;\n}());\n\n//# sourceMappingURL=modal-stack.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL21vZGFsL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, \"a\", function() { return NgbModalStack; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_popup__ = __webpack_require__(123);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_backdrop__ = __webpack_require__(276);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_window__ = __webpack_require__(277);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modal_ref__ = __webpack_require__(280);\n\n\n\n\n\n\nvar NgbModalStack = (function () {\n function NgbModalStack(_applicationRef, _injector, _componentFactoryResolver) {\n this._applicationRef = _applicationRef;\n this._injector = _injector;\n this._componentFactoryResolver = _componentFactoryResolver;\n this._backdropFactory = _componentFactoryResolver.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_3__modal_backdrop__[\"a\" /* NgbModalBackdrop */]);\n this._windowFactory = _componentFactoryResolver.resolveComponentFactory(__WEBPACK_IMPORTED_MODULE_4__modal_window__[\"a\" /* NgbModalWindow */]);\n }\n NgbModalStack.prototype.open = function (moduleCFR, contentInjector, content, options) {\n var containerSelector = options.container || 'body';\n var containerEl = document.querySelector(containerSelector);\n if (!containerEl) {\n throw new Error(\"The specified modal container \\\"\" + containerSelector + \"\\\" was not found in the DOM.\");\n }\n var activeModal = new __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"a\" /* NgbActiveModal */]();\n var contentRef = this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal);\n var windowCmptRef;\n var backdropCmptRef;\n var ngbModalRef;\n if (options.backdrop !== false) {\n backdropCmptRef = this._backdropFactory.create(this._injector);\n this._applicationRef.attachView(backdropCmptRef.hostView);\n containerEl.appendChild(backdropCmptRef.location.nativeElement);\n }\n windowCmptRef = this._windowFactory.create(this._injector, contentRef.nodes);\n this._applicationRef.attachView(windowCmptRef.hostView);\n containerEl.appendChild(windowCmptRef.location.nativeElement);\n ngbModalRef = new __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"b\" /* NgbModalRef */](windowCmptRef, contentRef, backdropCmptRef, options.beforeDismiss);\n activeModal.close = function (result) { ngbModalRef.close(result); };\n activeModal.dismiss = function (reason) { ngbModalRef.dismiss(reason); };\n this._applyWindowOptions(windowCmptRef.instance, options);\n return ngbModalRef;\n };\n NgbModalStack.prototype._applyWindowOptions = function (windowInstance, options) {\n ['backdrop', 'keyboard', 'size', 'windowClass'].forEach(function (optionName) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"b\" /* isDefined */])(options[optionName])) {\n windowInstance[optionName] = options[optionName];\n }\n });\n };\n NgbModalStack.prototype._getContentRef = function (moduleCFR, contentInjector, content, context) {\n if (!content) {\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([]);\n }\n else if (content instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"]) {\n var viewRef = content.createEmbeddedView(context);\n this._applicationRef.attachView(viewRef);\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([viewRef.rootNodes], viewRef);\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"e\" /* isString */])(content)) {\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([[document.createTextNode(\"\" + content)]]);\n }\n else {\n var contentCmptFactory = moduleCFR.resolveComponentFactory(content);\n var modalContentInjector = __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ReflectiveInjector\"].resolveAndCreate([{ provide: __WEBPACK_IMPORTED_MODULE_5__modal_ref__[\"a\" /* NgbActiveModal */], useValue: context }], contentInjector);\n var componentRef = contentCmptFactory.create(modalContentInjector);\n this._applicationRef.attachView(componentRef.hostView);\n return new __WEBPACK_IMPORTED_MODULE_1__util_popup__[\"a\" /* ContentRef */]([[componentRef.location.nativeElement]], componentRef.hostView, componentRef);\n }\n };\n NgbModalStack.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbModalStack.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ApplicationRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injector\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n ]; };\n return NgbModalStack;\n}());\n\n//# sourceMappingURL=modal-stack.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL21vZGFsL21vZGFsLXN0YWNrLmpzPzA5NzEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQXBwbGljYXRpb25SZWYsIEluamVjdGFibGUsIEluamVjdG9yLCBSZWZsZWN0aXZlSW5qZWN0b3IsIENvbXBvbmVudEZhY3RvcnlSZXNvbHZlciwgVGVtcGxhdGVSZWYgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbnRlbnRSZWYgfSBmcm9tICcuLi91dGlsL3BvcHVwJztcbmltcG9ydCB7IGlzRGVmaW5lZCwgaXNTdHJpbmcgfSBmcm9tICcuLi91dGlsL3V0aWwnO1xuaW1wb3J0IHsgTmdiTW9kYWxCYWNrZHJvcCB9IGZyb20gJy4vbW9kYWwtYmFja2Ryb3AnO1xuaW1wb3J0IHsgTmdiTW9kYWxXaW5kb3cgfSBmcm9tICcuL21vZGFsLXdpbmRvdyc7XG5pbXBvcnQgeyBOZ2JBY3RpdmVNb2RhbCwgTmdiTW9kYWxSZWYgfSBmcm9tICcuL21vZGFsLXJlZic7XG52YXIgT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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///279\n"); /***/ }), /* 280 */ @@ -968,14 +968,14 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbPaginationModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pagination__ = __webpack_require__(283);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pagination_config__ = __webpack_require__(175);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__pagination_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbPaginationModule = (function () {\n function NgbPaginationModule() {\n }\n NgbPaginationModule.forRoot = function () { return { ngModule: NgbPaginationModule, providers: [__WEBPACK_IMPORTED_MODULE_3__pagination_config__[\"a\" /* NgbPaginationConfig */]] }; };\n NgbPaginationModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\" /* NgbPagination */]], exports: [__WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\" /* NgbPagination */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbPaginationModule.ctorParameters = function () { return []; };\n return NgbPaginationModule;\n}());\n\n//# sourceMappingURL=pagination.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3BhZ2luYXRpb24vcGFnaW5hdGlvbi5tb2R1bGUuanM/MTI5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IE5nYlBhZ2luYXRpb24gfSBmcm9tICcuL3BhZ2luYXRpb24nO1xuaW1wb3J0IHsgTmdiUGFnaW5hdGlvbkNvbmZpZyB9IGZyb20gJy4vcGFnaW5hdGlvbi1jb25maWcnO1xuZXhwb3J0IHsgTmdiUGFnaW5hdGlvbiB9IGZyb20gJy4vcGFnaW5hdGlvbic7XG5leHBvcnQgeyBOZ2JQYWdpbmF0aW9uQ29uZmlnIH0gZnJvbSAnLi9wYWdpbmF0aW9uLWNvbmZpZyc7XG52YXIgTmdiUGFnaW5hdGlvbk1vZHVsZSA9IChmd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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///282\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbPaginationModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pagination__ = __webpack_require__(283);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pagination_config__ = __webpack_require__(175);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__pagination_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbPaginationModule = (function () {\n function NgbPaginationModule() {\n }\n NgbPaginationModule.forRoot = function () { return { ngModule: NgbPaginationModule, providers: [__WEBPACK_IMPORTED_MODULE_3__pagination_config__[\"a\" /* NgbPaginationConfig */]] }; };\n NgbPaginationModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\" /* NgbPagination */]], exports: [__WEBPACK_IMPORTED_MODULE_2__pagination__[\"a\" /* NgbPagination */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbPaginationModule.ctorParameters = function () { return []; };\n return NgbPaginationModule;\n}());\n\n//# sourceMappingURL=pagination.module.js.map//# sourceURL=[module]\n//# sourceMappingURL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BleHBvcnRzOiBbTmdiUGFnaW5hdGlvbl0sIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdiUGFnaW5hdGlvbk1vZHVsZS5jdG9yUGFyYW1ldGVycyA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIFtdOyB9O1xuICAgIHJldHVybiBOZ2JQYWdpbmF0aW9uTW9kdWxlO1xufSgpKTtcbmV4cG9ydCB7IE5nYlBhZ2luYXRpb25Nb2R1bGUgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXBhZ2luYXRpb24ubW9kdWxlLmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3BhZ2luYXRpb24vcGFnaW5hdGlvbi5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///282\n"); /***/ }), /* 283 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbPagination; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pagination_config__ = __webpack_require__(175);\n\n\n\n/**\n * A directive that will take care of visualising a pagination bar and enable / disable buttons correctly!\n */\nvar NgbPagination = (function () {\n function NgbPagination(config) {\n this.pageCount = 0;\n this.pages = [];\n /**\n * Current page.\n */\n this.page = 0;\n /**\n * An event fired when the page is changed.\n * Event's payload equals to the newly selected page.\n */\n this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](true);\n this.disabled = config.disabled;\n this.boundaryLinks = config.boundaryLinks;\n this.directionLinks = config.directionLinks;\n this.ellipses = config.ellipses;\n this.maxSize = config.maxSize;\n this.pageSize = config.pageSize;\n this.rotate = config.rotate;\n this.size = config.size;\n }\n NgbPagination.prototype.hasPrevious = function () { return this.page > 1; };\n NgbPagination.prototype.hasNext = function () { return this.page < this.pageCount; };\n NgbPagination.prototype.selectPage = function (pageNumber) { this._updatePages(pageNumber); };\n NgbPagination.prototype.ngOnChanges = function (changes) { this._updatePages(this.page); };\n NgbPagination.prototype.isEllipsis = function (pageNumber) { return pageNumber === -1; };\n /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n NgbPagination.prototype._applyEllipses = /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n function (start, end) {\n if (this.ellipses) {\n if (start > 0) {\n if (start > 1) {\n this.pages.unshift(-1);\n }\n this.pages.unshift(1);\n }\n if (end < this.pageCount) {\n if (end < (this.pageCount - 1)) {\n this.pages.push(-1);\n }\n this.pages.push(this.pageCount);\n }\n }\n };\n /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n NgbPagination.prototype._applyRotation = /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n function () {\n var start = 0;\n var end = this.pageCount;\n var leftOffset = Math.floor(this.maxSize / 2);\n var rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n };\n /**\n * Paginates page numbers based on maxSize items per page\n */\n /**\n * Paginates page numbers based on maxSize items per page\n */\n NgbPagination.prototype._applyPagination = /**\n * Paginates page numbers based on maxSize items per page\n */\n function () {\n var page = Math.ceil(this.page / this.maxSize) - 1;\n var start = page * this.maxSize;\n var end = start + this.maxSize;\n return [start, end];\n };\n NgbPagination.prototype._setPageInRange = function (newPageNo) {\n var prevPageNo = this.page;\n this.page = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"a\" /* getValueInRange */])(newPageNo, this.pageCount, 1);\n if (this.page !== prevPageNo) {\n this.pageChange.emit(this.page);\n }\n };\n NgbPagination.prototype._updatePages = function (newPage) {\n this.pageCount = Math.ceil(this.collectionSize / this.pageSize);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"d\" /* isNumber */])(this.pageCount)) {\n this.pageCount = 0;\n }\n // fill-in model needed to render pages\n this.pages.length = 0;\n for (var i = 1; i <= this.pageCount; i++) {\n this.pages.push(i);\n }\n // set page within 1..max range\n this._setPageInRange(newPage);\n // apply maxSize if necessary\n if (this.maxSize > 0 && this.pageCount > this.maxSize) {\n var start = 0;\n var end = this.pageCount;\n // either paginating or rotating page numbers\n if (this.rotate) {\n _a = this._applyRotation(), start = _a[0], end = _a[1];\n }\n else {\n _b = this._applyPagination(), start = _b[0], end = _b[1];\n }\n this.pages = this.pages.slice(start, end);\n // adding ellipses\n this._applyEllipses(start, end);\n }\n var _a, _b;\n };\n NgbPagination.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-pagination',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: { 'role': 'navigation' },\n template: \"\\n <ul [class]=\\\"'pagination' + (size ? ' pagination-' + size : '')\\\">\\n <li *ngIf=\\\"boundaryLinks\\\" class=\\\"page-item\\\"\\n [class.disabled]=\\\"!hasPrevious() || disabled\\\">\\n <a aria-label=\\\"First\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(1)\\\" [attr.tabindex]=\\\"(hasPrevious() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">««</span>\\n </a>\\n </li>\\n\\n <li *ngIf=\\\"directionLinks\\\" class=\\\"page-item\\\"\\n [class.disabled]=\\\"!hasPrevious() || disabled\\\">\\n <a aria-label=\\\"Previous\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(page-1)\\\" [attr.tabindex]=\\\"(hasPrevious() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">«</span>\\n </a>\\n </li>\\n <li *ngFor=\\\"let pageNumber of pages\\\" class=\\\"page-item\\\" [class.active]=\\\"pageNumber === page\\\"\\n [class.disabled]=\\\"isEllipsis(pageNumber) || disabled\\\">\\n <a *ngIf=\\\"isEllipsis(pageNumber)\\\" class=\\\"page-link\\\">...</a>\\n <a *ngIf=\\\"!isEllipsis(pageNumber)\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(pageNumber)\\\">\\n {{pageNumber}}\\n <span *ngIf=\\\"pageNumber === page\\\" class=\\\"sr-only\\\">(current)</span>\\n </a>\\n </li>\\n <li *ngIf=\\\"directionLinks\\\" class=\\\"page-item\\\" [class.disabled]=\\\"!hasNext() || disabled\\\">\\n <a aria-label=\\\"Next\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(page+1)\\\" [attr.tabindex]=\\\"(hasNext() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">»</span>\\n </a>\\n </li>\\n\\n <li *ngIf=\\\"boundaryLinks\\\" class=\\\"page-item\\\" [class.disabled]=\\\"!hasNext() || disabled\\\">\\n <a aria-label=\\\"Last\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(pageCount)\\\" [attr.tabindex]=\\\"(hasNext() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">»»</span>\\n </a>\\n </li>\\n </ul>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbPagination.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__pagination_config__[\"a\" /* NgbPaginationConfig */], },\n ]; };\n NgbPagination.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"boundaryLinks\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"directionLinks\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ellipses\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"rotate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"collectionSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"page\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"pageSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"pageChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbPagination;\n}());\n\n//# sourceMappingURL=pagination.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3BhZ2luYXRpb24vcGFnaW5hdGlvbi5qcz9mZTJmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgRXZlbnRFbWl0dGVyLCBJbnB1dCwgT3V0cHV0LCBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgZ2V0VmFsdWVJblJhbmdlLCBpc051bWJlciB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5pbXBvcnQgeyBOZ2JQYWdpbmF0aW9uQ29uZmlnIH0gZnJvbSAnLi9wYWdpbmF0aW9uLWNvbmZpZyc7XG4vKipcbiAqIEEgZGlyZWN0aXZlIHRoYXQgd2lsbCB0YWtlIGNhcmUgb2YgdmlzdWFsaXNpbmcgYSBwYWdpbmF0aW9uIGJhciBhbmQgZW5hYmxlIC8gZGlzYWJsZSBidXR0b25zIGNvcnJlY3RseSFcbiAqL1xudmFyIE5nYlBhZ2luYXRpb24gPSAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE5nYlBhZ2luYXRpb24oY29uZmlnKSB7XG4gICAgICAgIHRoaXMucGFnZUNvdW50ID0gMDtcbiAgICAgICAgdGhpcy5wYWdlcyA9IFtdO1xuICAgICAgICAvKipcbiAgICAgICAgICAgKiAgQ3VycmVudCBwYWdlLlxuICAgICAgICAgICAqL1xuICAgICAgICB0aGlzLnBhZ2UgPSAwO1xuICAgICAgICAvKipcbiAgICAgICAgICAgKiAgQW4gZXZlbnQgZmlyZWQ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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///283\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbPagination; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pagination_config__ = __webpack_require__(175);\n\n\n\n/**\n * A directive that will take care of visualising a pagination bar and enable / disable buttons correctly!\n */\nvar NgbPagination = (function () {\n function NgbPagination(config) {\n this.pageCount = 0;\n this.pages = [];\n /**\n * Current page.\n */\n this.page = 0;\n /**\n * An event fired when the page is changed.\n * Event's payload equals to the newly selected page.\n */\n this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](true);\n this.disabled = config.disabled;\n this.boundaryLinks = config.boundaryLinks;\n this.directionLinks = config.directionLinks;\n this.ellipses = config.ellipses;\n this.maxSize = config.maxSize;\n this.pageSize = config.pageSize;\n this.rotate = config.rotate;\n this.size = config.size;\n }\n NgbPagination.prototype.hasPrevious = function () { return this.page > 1; };\n NgbPagination.prototype.hasNext = function () { return this.page < this.pageCount; };\n NgbPagination.prototype.selectPage = function (pageNumber) { this._updatePages(pageNumber); };\n NgbPagination.prototype.ngOnChanges = function (changes) { this._updatePages(this.page); };\n NgbPagination.prototype.isEllipsis = function (pageNumber) { return pageNumber === -1; };\n /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n NgbPagination.prototype._applyEllipses = /**\n * Appends ellipses and first/last page number to the displayed pages\n */\n function (start, end) {\n if (this.ellipses) {\n if (start > 0) {\n if (start > 1) {\n this.pages.unshift(-1);\n }\n this.pages.unshift(1);\n }\n if (end < this.pageCount) {\n if (end < (this.pageCount - 1)) {\n this.pages.push(-1);\n }\n this.pages.push(this.pageCount);\n }\n }\n };\n /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n NgbPagination.prototype._applyRotation = /**\n * Rotates page numbers based on maxSize items visible.\n * Currently selected page stays in the middle:\n *\n * Ex. for selected page = 6:\n * [5,*6*,7] for maxSize = 3\n * [4,5,*6*,7] for maxSize = 4\n */\n function () {\n var start = 0;\n var end = this.pageCount;\n var leftOffset = Math.floor(this.maxSize / 2);\n var rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n };\n /**\n * Paginates page numbers based on maxSize items per page\n */\n /**\n * Paginates page numbers based on maxSize items per page\n */\n NgbPagination.prototype._applyPagination = /**\n * Paginates page numbers based on maxSize items per page\n */\n function () {\n var page = Math.ceil(this.page / this.maxSize) - 1;\n var start = page * this.maxSize;\n var end = start + this.maxSize;\n return [start, end];\n };\n NgbPagination.prototype._setPageInRange = function (newPageNo) {\n var prevPageNo = this.page;\n this.page = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"a\" /* getValueInRange */])(newPageNo, this.pageCount, 1);\n if (this.page !== prevPageNo) {\n this.pageChange.emit(this.page);\n }\n };\n NgbPagination.prototype._updatePages = function (newPage) {\n this.pageCount = Math.ceil(this.collectionSize / this.pageSize);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"d\" /* isNumber */])(this.pageCount)) {\n this.pageCount = 0;\n }\n // fill-in model needed to render pages\n this.pages.length = 0;\n for (var i = 1; i <= this.pageCount; i++) {\n this.pages.push(i);\n }\n // set page within 1..max range\n this._setPageInRange(newPage);\n // apply maxSize if necessary\n if (this.maxSize > 0 && this.pageCount > this.maxSize) {\n var start = 0;\n var end = this.pageCount;\n // either paginating or rotating page numbers\n if (this.rotate) {\n _a = this._applyRotation(), start = _a[0], end = _a[1];\n }\n else {\n _b = this._applyPagination(), start = _b[0], end = _b[1];\n }\n this.pages = this.pages.slice(start, end);\n // adding ellipses\n this._applyEllipses(start, end);\n }\n var _a, _b;\n };\n NgbPagination.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-pagination',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: { 'role': 'navigation' },\n template: \"\\n <ul [class]=\\\"'pagination' + (size ? ' pagination-' + size : '')\\\">\\n <li *ngIf=\\\"boundaryLinks\\\" class=\\\"page-item\\\"\\n [class.disabled]=\\\"!hasPrevious() || disabled\\\">\\n <a aria-label=\\\"First\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(1)\\\" [attr.tabindex]=\\\"(hasPrevious() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">««</span>\\n </a>\\n </li>\\n\\n <li *ngIf=\\\"directionLinks\\\" class=\\\"page-item\\\"\\n [class.disabled]=\\\"!hasPrevious() || disabled\\\">\\n <a aria-label=\\\"Previous\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(page-1)\\\" [attr.tabindex]=\\\"(hasPrevious() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">«</span>\\n </a>\\n </li>\\n <li *ngFor=\\\"let pageNumber of pages\\\" class=\\\"page-item\\\" [class.active]=\\\"pageNumber === page\\\"\\n [class.disabled]=\\\"isEllipsis(pageNumber) || disabled\\\">\\n <a *ngIf=\\\"isEllipsis(pageNumber)\\\" class=\\\"page-link\\\">...</a>\\n <a *ngIf=\\\"!isEllipsis(pageNumber)\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(pageNumber)\\\">\\n {{pageNumber}}\\n <span *ngIf=\\\"pageNumber === page\\\" class=\\\"sr-only\\\">(current)</span>\\n </a>\\n </li>\\n <li *ngIf=\\\"directionLinks\\\" class=\\\"page-item\\\" [class.disabled]=\\\"!hasNext() || disabled\\\">\\n <a aria-label=\\\"Next\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(page+1)\\\" [attr.tabindex]=\\\"(hasNext() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">»</span>\\n </a>\\n </li>\\n\\n <li *ngIf=\\\"boundaryLinks\\\" class=\\\"page-item\\\" [class.disabled]=\\\"!hasNext() || disabled\\\">\\n <a aria-label=\\\"Last\\\" class=\\\"page-link\\\" href (click)=\\\"!!selectPage(pageCount)\\\" [attr.tabindex]=\\\"(hasNext() ? null : '-1')\\\">\\n <span aria-hidden=\\\"true\\\">»»</span>\\n </a>\\n </li>\\n </ul>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbPagination.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__pagination_config__[\"a\" /* NgbPaginationConfig */], },\n ]; };\n NgbPagination.propDecorators = {\n \"disabled\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"boundaryLinks\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"directionLinks\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ellipses\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"rotate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"collectionSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"maxSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"page\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"pageSize\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"pageChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbPagination;\n}());\n\n//# sourceMappingURL=pagination.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///283\n"); /***/ }), /* 284 */ @@ -1003,35 +1003,35 @@ eval("/* unused harmony export Trigger */\n/* unused harmony export parseTrigger /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbProgressbarModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progressbar__ = __webpack_require__(288);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progressbar_config__ = __webpack_require__(177);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__progressbar_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbProgressbarModule = (function () {\n function NgbProgressbarModule() {\n }\n NgbProgressbarModule.forRoot = function () { return { ngModule: NgbProgressbarModule, providers: [__WEBPACK_IMPORTED_MODULE_3__progressbar_config__[\"a\" /* NgbProgressbarConfig */]] }; };\n NgbProgressbarModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\" /* NgbProgressbar */]], exports: [__WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\" /* NgbProgressbar */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbProgressbarModule.ctorParameters = function () { return []; };\n return NgbProgressbarModule;\n}());\n\n//# sourceMappingURL=progressbar.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3Byb2dyZXNzYmFyL3Byb2dyZXNzYmFyLm1vZHVsZS5qcz9kNTlkIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgTmdiUHJvZ3Jlc3NiYXIgfSBmcm9tICcuL3Byb2dyZXNzYmFyJztcbmltcG9ydCB7IE5nYlByb2dyZXNzYmFyQ29uZmlnIH0gZn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BQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC9wcm9ncmVzc2Jhci9wcm9ncmVzc2Jhci5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI4N1xuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///287\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbProgressbarModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progressbar__ = __webpack_require__(288);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progressbar_config__ = __webpack_require__(177);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__progressbar_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbProgressbarModule = (function () {\n function NgbProgressbarModule() {\n }\n NgbProgressbarModule.forRoot = function () { return { ngModule: NgbProgressbarModule, providers: [__WEBPACK_IMPORTED_MODULE_3__progressbar_config__[\"a\" /* NgbProgressbarConfig */]] }; };\n NgbProgressbarModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\" /* NgbProgressbar */]], exports: [__WEBPACK_IMPORTED_MODULE_2__progressbar__[\"a\" /* NgbProgressbar */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbProgressbarModule.ctorParameters = function () { return []; };\n return NgbProgressbarModule;\n}());\n\n//# sourceMappingURL=progressbar.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3Byb2dyZXNzYmFyL3Byb2dyZXNzYmFyLm1vZHVsZS5qcz9kNTlkIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgTmdiUHJvZ3Jlc3NiYXIgfSBmcm9tICcuL3Byb2dyZXNzYmFyJztcbmltcG9ydCB7IE5nYlByb2dyZXNzYmFyQ29uZmlnIH0gZnJvbSAnLi9wcm9ncmVzc2Jhci1jb25maWcnO1xuZXhwb3J0IHsgTmdiUHJvZ3Jlc3NiYXIgfSBmcm9tICcuL3Byb2dyZXNzYmFyJztcbmV4cG9ydCB7IE5nYlByb2dyZXNzYmFyQ29uZmlnIH0gZnJvbSAnLi9wcm9ncmVzc2Jhci1jb25maWcnO1xudmFyIE5nYlByb2dyZXNzYmFyTW9kdWxlID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JQcm9ncmVzc2Jhck1vZHVsZSgpIHtcbiAgICB9XG4gICAgTmdiUH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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///287\n"); /***/ }), /* 288 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbProgressbar; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progressbar_config__ = __webpack_require__(177);\n\n\n\n/**\n * Directive that can be used to provide feedback on the progress of a workflow or an action.\n */\nvar NgbProgressbar = (function () {\n function NgbProgressbar(config) {\n /**\n * Current value to be displayed in the progressbar. Should be smaller or equal to \"max\" value.\n */\n this.value = 0;\n this.max = config.max;\n this.animated = config.animated;\n this.striped = config.striped;\n this.type = config.type;\n this.showValue = config.showValue;\n this.height = config.height;\n }\n NgbProgressbar.prototype.getValue = function () { return Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"a\" /* getValueInRange */])(this.value, this.max); };\n NgbProgressbar.prototype.getPercentValue = function () { return 100 * this.getValue() / this.max; };\n NgbProgressbar.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-progressbar',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n template: \"\\n <div class=\\\"progress\\\" [style.height]=\\\"height\\\">\\n <div class=\\\"progress-bar{{type ? ' bg-' + type : ''}}{{animated ? ' progress-bar-animated' : ''}}{{striped ?\\n ' progress-bar-striped' : ''}}\\\" role=\\\"progressbar\\\" [style.width.%]=\\\"getPercentValue()\\\"\\n [attr.aria-valuenow]=\\\"getValue()\\\" aria-valuemin=\\\"0\\\" [attr.aria-valuemax]=\\\"max\\\">\\n <span *ngIf=\\\"showValue\\\">{{getPercentValue()}}%</span><ng-content></ng-content>\\n </div>\\n </div>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbProgressbar.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__progressbar_config__[\"a\" /* NgbProgressbarConfig */], },\n ]; };\n NgbProgressbar.propDecorators = {\n \"max\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"animated\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"striped\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showValue\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"height\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbProgressbar;\n}());\n\n//# sourceMappingURL=progressbar.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3Byb2dyZXNzYmFyL3Byb2dyZXNzYmFyLmpzPzViOTgiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50LCBJbnB1dCwgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IGdldFZhbHVlSW5SYW5nZSB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5pbXBvcnQgeyBOZ2JQcm9ncmVzc2JhckNvbmZpZyB9I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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///288\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbProgressbar; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progressbar_config__ = __webpack_require__(177);\n\n\n\n/**\n * Directive that can be used to provide feedback on the progress of a workflow or an action.\n */\nvar NgbProgressbar = (function () {\n function NgbProgressbar(config) {\n /**\n * Current value to be displayed in the progressbar. Should be smaller or equal to \"max\" value.\n */\n this.value = 0;\n this.max = config.max;\n this.animated = config.animated;\n this.striped = config.striped;\n this.type = config.type;\n this.showValue = config.showValue;\n this.height = config.height;\n }\n NgbProgressbar.prototype.getValue = function () { return Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"a\" /* getValueInRange */])(this.value, this.max); };\n NgbProgressbar.prototype.getPercentValue = function () { return 100 * this.getValue() / this.max; };\n NgbProgressbar.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-progressbar',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n template: \"\\n <div class=\\\"progress\\\" [style.height]=\\\"height\\\">\\n <div class=\\\"progress-bar{{type ? ' bg-' + type : ''}}{{animated ? ' progress-bar-animated' : ''}}{{striped ?\\n ' progress-bar-striped' : ''}}\\\" role=\\\"progressbar\\\" [style.width.%]=\\\"getPercentValue()\\\"\\n [attr.aria-valuenow]=\\\"getValue()\\\" aria-valuemin=\\\"0\\\" [attr.aria-valuemax]=\\\"max\\\">\\n <span *ngIf=\\\"showValue\\\">{{getPercentValue()}}%</span><ng-content></ng-content>\\n </div>\\n </div>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgbProgressbar.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_2__progressbar_config__[\"a\" /* NgbProgressbarConfig */], },\n ]; };\n NgbProgressbar.propDecorators = {\n \"max\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"animated\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"striped\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showValue\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"type\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"value\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"height\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbProgressbar;\n}());\n\n//# sourceMappingURL=progressbar.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3Byb2dyZXNzYmFyL3Byb2dyZXNzYmFyLmpzPzViOTgiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50LCBJbnB1dCwgQ2hhbmdlRGV0ZWN0aW9uU3R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WQgPSAyODhcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///288\n"); /***/ }), /* 289 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbRatingModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rating_config__ = __webpack_require__(178);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rating__ = __webpack_require__(290);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_3__rating__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_2__rating_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbRatingModule = (function () {\n function NgbRatingModule() {\n }\n NgbRatingModule.forRoot = function () { return { ngModule: NgbRatingModule, providers: [__WEBPACK_IMPORTED_MODULE_2__rating_config__[\"a\" /* NgbRatingConfig */]] }; };\n NgbRatingModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_3__rating__[\"a\" /* NgbRating */]], exports: [__WEBPACK_IMPORTED_MODULE_3__rating__[\"a\" /* NgbRating */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbRatingModule.ctorParameters = function () { return []; };\n return NgbRatingModule;\n}());\n\n//# sourceMappingURL=rating.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3JhdGluZy9yYXRpbmcubW9kdWxlLmpzPzAzYzYiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBOZ2JSYXRpbmdDb25maWcgfSBmcm9tICcuL3JhdGluZy1jb25maWcnO1xuaW1wb3J0IHsgTmdiUmF0aW5nIH0gZnJvbSAnLi9yYXRpbmcnO1xuZXhwb3J0IHsgTmdiUmF0aW5nIH0gZnJvbSAnLi9yYXRpbmcnO1xuZXhwb3J0IHsgTmdiUmF0aW5nQ29uZmlnIH0gZnJvbSAnLi9yYXRpbmctY29uZmlnJztcbnZhciBOZ2JSYXRpbmdNb2R1bGUgPSAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIE5nYlJhdGluZ01vZHVsZSgpIHtcbiAgICB9XG4gICAgTmdiUmF0aW5nTW9kdWxlLmZvclJvb3QgPSBmdW5jdGlvbiAoKSB7IHJldHVybiB7IG5nTW9kdWxlOiBOZ2JSYXRpbmdNb2R1bGUsIHByb3ZpZGVyczogW05nYlJhdGluZ0NvbmZpZ10gfTsgfTtcbiAgICBOZ2JSYXRpbmdNb2R1bGUuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBOZ01vZHVsZSwgYXJnczogW3sgZGVjbGFyYXRpb25zOiBbTmdiUmF0aW5nXSwgZXhwb3J0czogW05nYlJhdGluZ10sIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdIH0sXSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdiUmF0aW5nTW9kdWxlLmN0b3JQYXJhbWV0ZXJzID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gW107IH07XG4gICAgcmV0dXJuIE5nYlJhdGluZ01vZHVsZTtcbn0oKSk7XG5leHBvcnQgeyBOZ2JSYXRpbmdNb2R1bGUgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXJhdGluZy5tb2R1bGUuanMubWFwXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvcmF0aW5nL3JhdGluZy5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI4OVxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///289\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbRatingModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rating_config__ = __webpack_require__(178);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rating__ = __webpack_require__(290);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_3__rating__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_2__rating_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbRatingModule = (function () {\n function NgbRatingModule() {\n }\n NgbRatingModule.forRoot = function () { return { ngModule: NgbRatingModule, providers: [__WEBPACK_IMPORTED_MODULE_2__rating_config__[\"a\" /* NgbRatingConfig */]] }; };\n NgbRatingModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_3__rating__[\"a\" /* NgbRating */]], exports: [__WEBPACK_IMPORTED_MODULE_3__rating__[\"a\" /* NgbRating */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbRatingModule.ctorParameters = function () { return []; };\n return NgbRatingModule;\n}());\n\n//# sourceMappingURL=rating.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3JhdGluZy9yYXRpbmcubW9kdWxlLmpzPzAzYzYiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmd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R1bGUuanMubWFwXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvcmF0aW5nL3JhdGluZy5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI4OVxuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///289\n"); /***/ }), /* 290 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbRating; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rating_config__ = __webpack_require__(178);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(19);\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"End\"] = 35] = \"End\";\n Key[Key[\"Home\"] = 36] = \"Home\";\n Key[Key[\"ArrowLeft\"] = 37] = \"ArrowLeft\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowRight\"] = 39] = \"ArrowRight\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NGB_RATING_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_3__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbRating; }),\n multi: true\n};\n/**\n * Rating directive that will take care of visualising a star rating bar.\n */\nvar NgbRating = (function () {\n function NgbRating(config, _changeDetectorRef) {\n this._changeDetectorRef = _changeDetectorRef;\n this.contexts = [];\n this.disabled = false;\n /**\n * An event fired when a user is hovering over a given rating.\n * Event's payload equals to the rating being hovered over.\n */\n this.hover = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when a user stops hovering over a given rating.\n * Event's payload equals to the rating of the last item being hovered over.\n */\n this.leave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when a user selects a new rating.\n * Event's payload equals to the newly selected rating.\n */\n this.rateChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](true);\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.max = config.max;\n this.readonly = config.readonly;\n }\n NgbRating.prototype.ariaValueText = function () { return this.nextRate + \" out of \" + this.max; };\n NgbRating.prototype.enter = function (value) {\n if (!this.readonly && !this.disabled) {\n this._updateState(value);\n }\n this.hover.emit(value);\n };\n NgbRating.prototype.handleBlur = function () { this.onTouched(); };\n NgbRating.prototype.handleClick = function (value) { this.update(this.resettable && this.rate === value ? 0 : value); };\n NgbRating.prototype.handleKeyDown = function (event) {\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"i\" /* toString */])(event.which)]) {\n event.preventDefault();\n switch (event.which) {\n case Key.ArrowDown:\n case Key.ArrowLeft:\n this.update(this.rate - 1);\n break;\n case Key.ArrowUp:\n case Key.ArrowRight:\n this.update(this.rate + 1);\n break;\n case Key.Home:\n this.update(0);\n break;\n case Key.End:\n this.update(this.max);\n break;\n }\n }\n };\n NgbRating.prototype.ngOnChanges = function (changes) {\n if (changes['rate']) {\n this.update(this.rate);\n }\n };\n NgbRating.prototype.ngOnInit = function () {\n this.contexts = Array.from({ length: this.max }, function (v, k) { return ({ fill: 0, index: k }); });\n this._updateState(this.rate);\n };\n NgbRating.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbRating.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbRating.prototype.reset = function () {\n this.leave.emit(this.nextRate);\n this._updateState(this.rate);\n };\n NgbRating.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbRating.prototype.update = function (value, internalChange) {\n if (internalChange === void 0) { internalChange = true; }\n var newRate = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"a\" /* getValueInRange */])(value, this.max, 0);\n if (!this.readonly && !this.disabled && this.rate !== newRate) {\n this.rate = newRate;\n this.rateChange.emit(this.rate);\n }\n if (internalChange) {\n this.onChange(this.rate);\n this.onTouched();\n }\n this._updateState(this.rate);\n };\n NgbRating.prototype.writeValue = function (value) {\n this.update(value, false);\n this._changeDetectorRef.markForCheck();\n };\n NgbRating.prototype._getFillValue = function (index) {\n var diff = this.nextRate - index;\n if (diff >= 1) {\n return 100;\n }\n if (diff < 1 && diff > 0) {\n return Number.parseInt((diff * 100).toFixed(2));\n }\n return 0;\n };\n NgbRating.prototype._updateState = function (nextValue) {\n var _this = this;\n this.nextRate = nextValue;\n this.contexts.forEach(function (context, index) { return context.fill = _this._getFillValue(index); });\n };\n NgbRating.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-rating',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: {\n 'class': 'd-inline-flex',\n 'tabindex': '0',\n 'role': 'slider',\n 'aria-valuemin': '0',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuenow]': 'nextRate',\n '[attr.aria-valuetext]': 'ariaValueText()',\n '[attr.aria-disabled]': 'readonly ? true : null',\n '(blur)': 'handleBlur()',\n '(keydown)': 'handleKeyDown($event)',\n '(mouseleave)': 'reset()'\n },\n template: \"\\n <ng-template #t let-fill=\\\"fill\\\">{{ fill === 100 ? '★' : '☆' }}</ng-template>\\n <ng-template ngFor [ngForOf]=\\\"contexts\\\" let-index=\\\"index\\\">\\n <span class=\\\"sr-only\\\">({{ index < nextRate ? '*' : ' ' }})</span>\\n <span (mouseenter)=\\\"enter(index + 1)\\\" (click)=\\\"handleClick(index + 1)\\\" [style.cursor]=\\\"readonly || disabled ? 'default' : 'pointer'\\\">\\n <ng-template [ngTemplateOutlet]=\\\"starTemplate || t\\\" [ngTemplateOutletContext]=\\\"contexts[index]\\\"></ng-template>\\n </span>\\n </ng-template>\\n \",\n providers: [NGB_RATING_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbRating.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__rating_config__[\"a\" /* NgbRatingConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n NgbRating.propDecorators = {\n \"max\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"rate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"readonly\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resettable\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"starTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"],] },],\n \"hover\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"leave\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"rateChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbRating;\n}());\n\n//# sourceMappingURL=rating.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3JhdGluZy9yYXRpbmcuanM/YTkwZiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIENoYW5nZURldGVjdGlvblN0cmF0ZWd5LCBJbnB1dCwgT3V0cHV0LCBFdmVudEVtaXR0ZXIsIFRlbXBsYXRlUmVmLCBDb250ZW50Q2hpbGQsIGZvcndhcmRSZWYsIENoYW5nZURldGVjdG9yUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBOZ2JSYXRpbmdDb25maWcgfSBmcm9tICcuL3JhdGluZy1jb25maWcnO1xuaW1wb3J0IHsgdG9TdHJpbmcsIGdldFZhbHVlSW5SYW5nZSB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5pbXBvcnQgeyBOR19WQUxVRV9BQ0NFU1NPUiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbnZhciBLZXk7XG4oZnVuY3Rpb24gKEtleSkge1xuICAgIEtleVtLZXlbXCJFbmRcIl0gPSAzNV0gPSBcIkVuZFwiO1xuICAgIEtleVtLZXlbXCJIb21lXCJdID0gMzZdID0gXCJIb21lXCI7XG4gICAgS2V5W0tleVtcIkFycm93TGVmdFwiXSA9IDM3XSA9IFwiQXJyb3dMZWZ0XCI7XG4gICAgS2V5W0tleVtcIkFycm93VXBcIl0gPSAzOF0gPSBcIkFycm93VXBcIjtcbiAgICBLZXlbS2V5W1wiQXJyb3dSaWdodFwiXSA9IDM5XSA9IFwiQXJyb3dSaWdodFwiO1xuICAgIEt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diUmF0aW5nLnByb3RvdHlwZS5oYW5kbGVCbHVyID0gZnVuY3Rpb24gKCkgeyB0aGlzLm9uVG91Y2hlZCgpOyB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuaGFuZGxlQ2xpY2sgPSBmdW5jdGlvbiAodmFsdWUpIHsgdGhpcy51cGRhdGUodGhpcy5yZXNldHRhYmxlICYmIHRoaXMucmF0ZSA9PT0gdmFsdWUgPyAwIDogdmFsdWUpOyB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuaGFuZGxlS2V5RG93biA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICBpZiAoS2V5W3RvU3RyaW5nKGV2ZW50LndoaWNoKV0pIHtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBzd2l0Y2ggKGV2ZW50LndoaWNoKSB7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dEb3duOlxuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93TGVmdDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUodGhpcy5yYXRlIC0gMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93VXA6XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dSaWdodDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUodGhpcy5yYXRlICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkhvbWU6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKDApO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5FbmQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKHRoaXMubWF4KTtcbiAgICAgICAgICAgICAgICAgICAgY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AgaWYgKGRpZmYgPCAxICYmIGRpZmYgPiAwKSB7XG4gICAgICAgICAgICByZXR1cm4gTnVtYmVyLnBhcnNlSW50KChkaWZmICogMTAwKS50b0ZpeGVkKDIpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gMDtcbiAgICB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuX3VwZGF0ZVN0YXRlID0gZnVuY3Rpb24gKG5leHRWYWx1ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLm5leHRSYXRlID0gbmV4dFZhbHVlO1xuICAgICAgICB0aGlzLmNvbnRleHRzLmZvckVhY2goZnVuY3Rpb24gKGNvbnRleHQsIGluZGV4KSB7IHJldHVybiBjb250ZXh0LmZpbGwgPSBfdGhpcy5fZ2V0RmlsbFZhbHVlKGluZGV4KTsgfSk7XG4gICAgfTtcbiAgICBOZ2JSYXRpbmcuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBDb21wb25lbnQsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdG9yOiAnbmdiLXJhdGluZycsXG4gICAgICAgICAgICAgICAgICAgIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoLFxuICAgICAgICAgICAgICAgICAgICBob3N0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnOiAnZC1pbmxpbmUtZmxleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGFiaW5kZXgnOiAnMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncm9sZSc6ICdzbGlkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyaWEtdmFsdWVtaW4nOiAnMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnW2F0dHIuYXJpYS12YWx1ZW1heF0nOiAnbWF4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdbYXR0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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///290\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbRating; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rating_config__ = __webpack_require__(178);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(20);\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"End\"] = 35] = \"End\";\n Key[Key[\"Home\"] = 36] = \"Home\";\n Key[Key[\"ArrowLeft\"] = 37] = \"ArrowLeft\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowRight\"] = 39] = \"ArrowRight\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NGB_RATING_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_3__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbRating; }),\n multi: true\n};\n/**\n * Rating directive that will take care of visualising a star rating bar.\n */\nvar NgbRating = (function () {\n function NgbRating(config, _changeDetectorRef) {\n this._changeDetectorRef = _changeDetectorRef;\n this.contexts = [];\n this.disabled = false;\n /**\n * An event fired when a user is hovering over a given rating.\n * Event's payload equals to the rating being hovered over.\n */\n this.hover = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when a user stops hovering over a given rating.\n * Event's payload equals to the rating of the last item being hovered over.\n */\n this.leave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n /**\n * An event fired when a user selects a new rating.\n * Event's payload equals to the newly selected rating.\n */\n this.rateChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"](true);\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.max = config.max;\n this.readonly = config.readonly;\n }\n NgbRating.prototype.ariaValueText = function () { return this.nextRate + \" out of \" + this.max; };\n NgbRating.prototype.enter = function (value) {\n if (!this.readonly && !this.disabled) {\n this._updateState(value);\n }\n this.hover.emit(value);\n };\n NgbRating.prototype.handleBlur = function () { this.onTouched(); };\n NgbRating.prototype.handleClick = function (value) { this.update(this.resettable && this.rate === value ? 0 : value); };\n NgbRating.prototype.handleKeyDown = function (event) {\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"i\" /* toString */])(event.which)]) {\n event.preventDefault();\n switch (event.which) {\n case Key.ArrowDown:\n case Key.ArrowLeft:\n this.update(this.rate - 1);\n break;\n case Key.ArrowUp:\n case Key.ArrowRight:\n this.update(this.rate + 1);\n break;\n case Key.Home:\n this.update(0);\n break;\n case Key.End:\n this.update(this.max);\n break;\n }\n }\n };\n NgbRating.prototype.ngOnChanges = function (changes) {\n if (changes['rate']) {\n this.update(this.rate);\n }\n };\n NgbRating.prototype.ngOnInit = function () {\n this.contexts = Array.from({ length: this.max }, function (v, k) { return ({ fill: 0, index: k }); });\n this._updateState(this.rate);\n };\n NgbRating.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbRating.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbRating.prototype.reset = function () {\n this.leave.emit(this.nextRate);\n this._updateState(this.rate);\n };\n NgbRating.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbRating.prototype.update = function (value, internalChange) {\n if (internalChange === void 0) { internalChange = true; }\n var newRate = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"a\" /* getValueInRange */])(value, this.max, 0);\n if (!this.readonly && !this.disabled && this.rate !== newRate) {\n this.rate = newRate;\n this.rateChange.emit(this.rate);\n }\n if (internalChange) {\n this.onChange(this.rate);\n this.onTouched();\n }\n this._updateState(this.rate);\n };\n NgbRating.prototype.writeValue = function (value) {\n this.update(value, false);\n this._changeDetectorRef.markForCheck();\n };\n NgbRating.prototype._getFillValue = function (index) {\n var diff = this.nextRate - index;\n if (diff >= 1) {\n return 100;\n }\n if (diff < 1 && diff > 0) {\n return Number.parseInt((diff * 100).toFixed(2));\n }\n return 0;\n };\n NgbRating.prototype._updateState = function (nextValue) {\n var _this = this;\n this.nextRate = nextValue;\n this.contexts.forEach(function (context, index) { return context.fill = _this._getFillValue(index); });\n };\n NgbRating.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-rating',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n host: {\n 'class': 'd-inline-flex',\n 'tabindex': '0',\n 'role': 'slider',\n 'aria-valuemin': '0',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuenow]': 'nextRate',\n '[attr.aria-valuetext]': 'ariaValueText()',\n '[attr.aria-disabled]': 'readonly ? true : null',\n '(blur)': 'handleBlur()',\n '(keydown)': 'handleKeyDown($event)',\n '(mouseleave)': 'reset()'\n },\n template: \"\\n <ng-template #t let-fill=\\\"fill\\\">{{ fill === 100 ? '★' : '☆' }}</ng-template>\\n <ng-template ngFor [ngForOf]=\\\"contexts\\\" let-index=\\\"index\\\">\\n <span class=\\\"sr-only\\\">({{ index < nextRate ? '*' : ' ' }})</span>\\n <span (mouseenter)=\\\"enter(index + 1)\\\" (click)=\\\"handleClick(index + 1)\\\" [style.cursor]=\\\"readonly || disabled ? 'default' : 'pointer'\\\">\\n <ng-template [ngTemplateOutlet]=\\\"starTemplate || t\\\" [ngTemplateOutletContext]=\\\"contexts[index]\\\"></ng-template>\\n </span>\\n </ng-template>\\n \",\n providers: [NGB_RATING_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbRating.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__rating_config__[\"a\" /* NgbRatingConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectorRef\"], },\n ]; };\n NgbRating.propDecorators = {\n \"max\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"rate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"readonly\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resettable\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"starTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ContentChild\"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"TemplateRef\"],] },],\n \"hover\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"leave\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n \"rateChange\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbRating;\n}());\n\n//# sourceMappingURL=rating.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3JhdGluZy9yYXRpbmcuanM/YTkwZiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIENoYW5nZURldGVjdGlvblN0cmF0ZWd5LCBJbnB1dCwgT3V0cHV0LCBFdmVudEVtaXR0ZXIsIFRlbXBsYXRlUmVmLCBDb250ZW50Q2hpbGQsIGZvcndhcmRSZWYsIENoYW5nZURldGVjdG9yUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBOZ2JSYXRpbmdDb25maWcgfSBmcm9tICcuL3JhdGluZy1jb25maWcnO1xuaW1wb3J0IHsgdG9TdHJpbmcsIGdldFZhbHVlSW5SYW5nZSB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5pbXBvcnQgeyBOR19WQUxVRV9BQ0NFU1NPUiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbnZhciBLZXk7XG4oZnVuY3Rpb24gKEtleSkge1xuICAgIEtleVtLZXlbXCJFbmRcIl0gPSAzNV0gPSBcIkVuZFwiO1xuICAgIEtleVtLZXlbXCJIb21lXCJdID0gMzZdID0gXCJIb21lXCI7XG4gICAgS2V5W0tleVtcIkFycm93TGVmdFwiXSA9IDM3XSA9IFwiQXJyb3dMZWZ0XCI7XG4gICAgS2V5W0tleVtcIkFycm93VXBcIl0gPSAzOF0gPSBcIkFycm93VXBcIjtcbiAgICBLZXlbS2V5W1wiQXJyb3dSaWdodFwiXSA9I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VyLmVtaXQodmFsdWUpO1xuICAgIH07XG4gICAgTmdiUmF0aW5nLnByb3RvdHlwZS5oYW5kbGVCbHVyID0gZnVuY3Rpb24gKCkgeyB0aGlzLm9uVG91Y2hlZCgpOyB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuaGFuZGxlQ2xpY2sgPSBmdW5jdGlvbiAodmFsdWUpIHsgdGhpcy51cGRhdGUodGhpcy5yZXNldHRhYmxlICYmIHRoaXMucmF0ZSA9PT0gdmFsdWUgPyAwIDogdmFsdWUpOyB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuaGFuZGxlS2V5RG93biA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICBpZiAoS2V5W3RvU3RyaW5nKGV2ZW50LndoaWNoKV0pIHtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBzd2l0Y2ggKGV2ZW50LndoaWNoKSB7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dEb3duOlxuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93TGVmdDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUodGhpcy5yYXRlIC0gMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93VXA6XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dSaWdodDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUodGhpcy5yYXRlICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkhvbWU6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKDApO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5FbmQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKH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IHJldHVybiAxMDA7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRpZmYgPCAxICYmIGRpZmYgPiAwKSB7XG4gICAgICAgICAgICByZXR1cm4gTnVtYmVyLnBhcnNlSW50KChkaWZmICogMTAwKS50b0ZpeGVkKDIpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gMDtcbiAgICB9O1xuICAgIE5nYlJhdGluZy5wcm90b3R5cGUuX3VwZGF0ZVN0YXRlID0gZnVuY3Rpb24gKG5leHRWYWx1ZSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLm5leHRSYXRlID0gbmV4dFZhbHVlO1xuICAgICAgICB0aGlzLmNvbnRleHRzLmZvckVhY2goZnVuY3Rpb24gKGNvbnRleHQsIGluZGV4KSB7IHJldHVybiBjb250ZXh0LmZpbGwgPSBfdGhpcy5fZ2V0RmlsbFZhbHVlKGluZGV4KTsgfSk7XG4gICAgfTtcbiAgICBOZ2JSYXRpbmcuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBDb21wb25lbnQsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdG9yOiAnbmdiLXJhdGluZycsXG4gICAgICAgICAgICAgICAgICAgIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoLFxuICAgICAgICAgICAgICAgICAgICBob3N0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnOiAnZC1pbmxpbmUtZmxleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGFiaW5kZXgnOiAnMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncm9sZSc6ICdzbGlkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyaWEtdmFsdWVtaW4nOiAnMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnW2F0dHIuYXJpYS12YWx1ZW1heF0nOiAnbWF4J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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///290\n"); /***/ }), /* 291 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return NgbTabsetModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tabset__ = __webpack_require__(292);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__tabset_config__ = __webpack_require__(179);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"d\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_3__tabset_config__[\"a\"]; });\n\n\n\n\n\n\nvar NGB_TABSET_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_2__tabset__[\"d\" /* NgbTabset */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"a\" /* NgbTab */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"b\" /* NgbTabContent */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"c\" /* NgbTabTitle */]];\nvar NgbTabsetModule = (function () {\n function NgbTabsetModule() {\n }\n NgbTabsetModule.forRoot = function () { return { ngModule: NgbTabsetModule, providers: [__WEBPACK_IMPORTED_MODULE_3__tabset_config__[\"a\" /* NgbTabsetConfig */]] }; };\n NgbTabsetModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: NGB_TABSET_DIRECTIVES, exports: NGB_TABSET_DIRECTIVES, imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbTabsetModule.ctorParameters = function () { return []; };\n return NgbTabsetModule;\n}());\n\n//# sourceMappingURL=tabset.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RhYnNldC90YWJzZXQubW9kdWxlLmpzPzZhY2YiXSwic291cmNl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0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBOZ2JUYWJzZXRNb2R1bGUuY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXTsgfTtcbiAgICByZXR1cm4gTmdiVGFic2V0TW9kdWxlO1xufSgpKTtcbmV4cG9ydCB7IE5nYlRhYnNldE1vZHVsZSB9O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGFic2V0Lm1vZHVsZS5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC90YWJzZXQvdGFic2V0Lm1vZHVsZS5qc1xuLy8gbW9kdWxlIGlkID0gMjkxXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///291\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return NgbTabsetModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tabset__ = __webpack_require__(292);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__tabset_config__ = __webpack_require__(179);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"d\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_2__tabset__[\"c\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return __WEBPACK_IMPORTED_MODULE_3__tabset_config__[\"a\"]; });\n\n\n\n\n\n\nvar NGB_TABSET_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_2__tabset__[\"d\" /* NgbTabset */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"a\" /* NgbTab */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"b\" /* NgbTabContent */], __WEBPACK_IMPORTED_MODULE_2__tabset__[\"c\" /* NgbTabTitle */]];\nvar NgbTabsetModule = (function () {\n function NgbTabsetModule() {\n }\n NgbTabsetModule.forRoot = function () { return { ngModule: NgbTabsetModule, providers: [__WEBPACK_IMPORTED_MODULE_3__tabset_config__[\"a\" /* NgbTabsetConfig */]] }; };\n NgbTabsetModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: NGB_TABSET_DIRECTIVES, exports: NGB_TABSET_DIRECTIVES, imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbTabsetModule.ctorParameters = function () { return []; };\n return NgbTabsetModule;\n}());\n\n//# sourceMappingURL=tabset.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkxLmpzIiwic291cmNlcyI6W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YXRpb25zOiBOR0JfVEFCU0VUX0RJUkVDVElWRVMsIGV4cG9ydHM6IE5HQl9UQUJTRVRfRElSRUNUSVZFUywgaW1wb3J0czogW0NvbW1vbk1vZHVsZV0gfSxdIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBOZ2JUYWJzZXRNb2R1bGUuY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXTsgfTtcbiAgICByZXR1cm4gTmdiVGFic2V0TW9kdWxlO1xufSgpKTtcbmV4cG9ydCB7IE5nYlRhYnNldE1vZHVsZSB9O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGFic2V0Lm1vZHVsZS5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC90YWJzZXQvdGFic2V0Lm1vZHVsZS5qc1xuLy8gbW9kdWxlIGlkID0gMjkxXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///291\n"); /***/ }), /* 292 */ @@ -1045,14 +1045,14 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbTimepickerModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__timepicker__ = __webpack_require__(294);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__timepicker_config__ = __webpack_require__(180);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__timepicker_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbTimepickerModule = (function () {\n function NgbTimepickerModule() {\n }\n NgbTimepickerModule.forRoot = function () { return { ngModule: NgbTimepickerModule, providers: [__WEBPACK_IMPORTED_MODULE_3__timepicker_config__[\"a\" /* NgbTimepickerConfig */]] }; };\n NgbTimepickerModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\" /* NgbTimepicker */]], exports: [__WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\" /* NgbTimepicker */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbTimepickerModule.ctorParameters = function () { return []; };\n return NgbTimepickerModule;\n}());\n\n//# sourceMappingURL=timepicker.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvdGltZXBpY2tlci5tb2R1bGUuanM/ZWI2OSJdLCJzb3VyY2VzQ29udGVudCI6Wy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dWxlO1xufSgpKTtcbmV4cG9ydCB7IE5nYlRpbWVwaWNrZXJNb2R1bGUgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRpbWVwaWNrZXIubW9kdWxlLmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvdGltZXBpY2tlci5tb2R1bGUuanNcbi8vIG1vZHVsZSBpZCA9IDI5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDIiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///293\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return NgbTimepickerModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__timepicker__ = __webpack_require__(294);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__timepicker_config__ = __webpack_require__(180);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_3__timepicker_config__[\"a\"]; });\n\n\n\n\n\n\nvar NgbTimepickerModule = (function () {\n function NgbTimepickerModule() {\n }\n NgbTimepickerModule.forRoot = function () { return { ngModule: NgbTimepickerModule, providers: [__WEBPACK_IMPORTED_MODULE_3__timepicker_config__[\"a\" /* NgbTimepickerConfig */]] }; };\n NgbTimepickerModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{ declarations: [__WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\" /* NgbTimepicker */]], exports: [__WEBPACK_IMPORTED_MODULE_2__timepicker__[\"a\" /* NgbTimepicker */]], imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]] },] },\n ];\n /** @nocollapse */\n NgbTimepickerModule.ctorParameters = function () { return []; };\n return NgbTimepickerModule;\n}());\n\n//# sourceMappingURL=timepicker.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvdGltZXBpY2tlci5tb2R1bGUuanM/ZWI2OSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IE5nYlRpbWVwaWNrZXIgfSBmcm9tICcuL3RpbWVwaWNrZXInO1xuaW1wb3J0IHsgTmdiVGltZXBpY2tlckNvbmZpZyB9IGZyb20gJy4vdGltZXBpY2tlci1jb25maWcnO1xuZXhwb3J0IHsgTmdiVGltZXBpY2tlciB9IGZyb20gJy4vdGltZXBpY2tlcic7XG5leHBvcnQgeyBOZ2JUaW1lcGlja2VyQ29uZmlnIH0gZnJvbSAnLi90aW1lcGlja2VyLW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E7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///293\n"); /***/ }), /* 294 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTimepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngb_time__ = __webpack_require__(540);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__timepicker_config__ = __webpack_require__(180);\n\n\n\n\n\nvar NGB_TIMEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbTimepicker; }),\n multi: true\n};\n/**\n * A lightweight & configurable timepicker directive.\n */\nvar NgbTimepicker = (function () {\n function NgbTimepicker(config) {\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.meridian = config.meridian;\n this.spinners = config.spinners;\n this.seconds = config.seconds;\n this.hourStep = config.hourStep;\n this.minuteStep = config.minuteStep;\n this.secondStep = config.secondStep;\n this.disabled = config.disabled;\n this.readonlyInputs = config.readonlyInputs;\n this.size = config.size;\n }\n NgbTimepicker.prototype.writeValue = function (value) {\n this.model = value ? new __WEBPACK_IMPORTED_MODULE_3__ngb_time__[\"a\" /* NgbTime */](value.hour, value.minute, value.second) : new __WEBPACK_IMPORTED_MODULE_3__ngb_time__[\"a\" /* NgbTime */]();\n if (!this.seconds && (!value || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(value.second))) {\n this.model.second = 0;\n }\n };\n NgbTimepicker.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbTimepicker.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbTimepicker.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbTimepicker.prototype.changeHour = function (step) {\n this.model.changeHour(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.changeMinute = function (step) {\n this.model.changeMinute(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.changeSecond = function (step) {\n this.model.changeSecond(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateHour = function (newVal) {\n var isPM = this.model.hour >= 12;\n var enteredHour = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal);\n if (this.meridian && (isPM && enteredHour < 12 || !isPM && enteredHour === 12)) {\n this.model.updateHour(enteredHour + 12);\n }\n else {\n this.model.updateHour(enteredHour);\n }\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateMinute = function (newVal) {\n this.model.updateMinute(Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal));\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateSecond = function (newVal) {\n this.model.updateSecond(Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal));\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.toggleMeridian = function () {\n if (this.meridian) {\n this.changeHour(12);\n }\n };\n NgbTimepicker.prototype.formatHour = function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(value)) {\n if (this.meridian) {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value % 12 === 0 ? 12 : value % 12);\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value % 24);\n }\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(NaN);\n }\n };\n NgbTimepicker.prototype.formatMinSec = function (value) { return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value); };\n NgbTimepicker.prototype.setFormControlSize = function () { return { 'form-control-sm': this.size === 'small', 'form-control-lg': this.size === 'large' }; };\n NgbTimepicker.prototype.setButtonSize = function () { return { 'btn-sm': this.size === 'small', 'btn-lg': this.size === 'large' }; };\n NgbTimepicker.prototype.ngOnChanges = function (changes) {\n if (changes['seconds'] && !this.seconds && this.model && !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(this.model.second)) {\n this.model.second = 0;\n this.propagateModelChange(false);\n }\n };\n NgbTimepicker.prototype.propagateModelChange = function (touched) {\n if (touched === void 0) { touched = true; }\n if (touched) {\n this.onTouched();\n }\n if (this.model.isValid(this.seconds)) {\n this.onChange({ hour: this.model.hour, minute: this.model.minute, second: this.model.second });\n }\n else {\n this.onChange(null);\n }\n };\n NgbTimepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-timepicker',\n styles: [\"\\n .ngb-tp {\\n display: flex;\\n align-items: center;\\n }\\n\\n .ngb-tp-hour, .ngb-tp-minute, .ngb-tp-second, .ngb-tp-meridian {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: space-around;\\n }\\n\\n .ngb-tp-spacer {\\n width: 1em;\\n text-align: center;\\n }\\n\\n .chevron::before {\\n border-style: solid;\\n border-width: 0.29em 0.29em 0 0;\\n content: '';\\n display: inline-block;\\n height: 0.69em;\\n left: 0.05em;\\n position: relative;\\n top: 0.15em;\\n transform: rotate(-45deg);\\n -webkit-transform: rotate(-45deg);\\n -ms-transform: rotate(-45deg);\\n vertical-align: middle;\\n width: 0.71em;\\n }\\n\\n .chevron.bottom:before {\\n top: -.3em;\\n -webkit-transform: rotate(135deg);\\n -ms-transform: rotate(135deg);\\n transform: rotate(135deg);\\n }\\n\\n input {\\n text-align: center;\\n display: inline-block;\\n width: auto;\\n }\\n \"],\n template: \"\\n <fieldset [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <div class=\\\"ngb-tp\\\">\\n <div class=\\\"ngb-tp-hour\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeHour(hourStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment hours</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"HH\\\"\\n [value]=\\\"formatHour(model?.hour)\\\" (change)=\\\"updateHour($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Hours\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeHour(-hourStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement hours</span>\\n </button>\\n </div>\\n <div class=\\\"ngb-tp-spacer\\\">:</div>\\n <div class=\\\"ngb-tp-minute\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeMinute(minuteStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment minutes</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"MM\\\"\\n [value]=\\\"formatMinSec(model?.minute)\\\" (change)=\\\"updateMinute($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Minutes\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeMinute(-minuteStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement minutes</span>\\n </button>\\n </div>\\n <div *ngIf=\\\"seconds\\\" class=\\\"ngb-tp-spacer\\\">:</div>\\n <div *ngIf=\\\"seconds\\\" class=\\\"ngb-tp-second\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeSecond(secondStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment seconds</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"SS\\\"\\n [value]=\\\"formatMinSec(model?.second)\\\" (change)=\\\"updateSecond($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Seconds\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeSecond(-secondStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement seconds</span>\\n </button>\\n </div>\\n <div *ngIf=\\\"meridian\\\" class=\\\"ngb-tp-spacer\\\"></div>\\n <div *ngIf=\\\"meridian\\\" class=\\\"ngb-tp-meridian\\\">\\n <button type=\\\"button\\\" class=\\\"btn btn-outline-primary\\\" [ngClass]=\\\"setButtonSize()\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\"\\n (click)=\\\"toggleMeridian()\\\">{{model?.hour >= 12 ? 'PM' : 'AM'}}</button>\\n </div>\\n </div>\\n </fieldset>\\n \",\n providers: [NGB_TIMEPICKER_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbTimepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_4__timepicker_config__[\"a\" /* NgbTimepickerConfig */], },\n ]; };\n NgbTimepicker.propDecorators = {\n \"meridian\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"spinners\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"seconds\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"hourStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minuteStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"secondStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"readonlyInputs\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbTimepicker;\n}());\n\n//# sourceMappingURL=timepicker.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///294\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTimepicker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngb_time__ = __webpack_require__(540);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__timepicker_config__ = __webpack_require__(180);\n\n\n\n\n\nvar NGB_TIMEPICKER_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbTimepicker; }),\n multi: true\n};\n/**\n * A lightweight & configurable timepicker directive.\n */\nvar NgbTimepicker = (function () {\n function NgbTimepicker(config) {\n this.onChange = function (_) { };\n this.onTouched = function () { };\n this.meridian = config.meridian;\n this.spinners = config.spinners;\n this.seconds = config.seconds;\n this.hourStep = config.hourStep;\n this.minuteStep = config.minuteStep;\n this.secondStep = config.secondStep;\n this.disabled = config.disabled;\n this.readonlyInputs = config.readonlyInputs;\n this.size = config.size;\n }\n NgbTimepicker.prototype.writeValue = function (value) {\n this.model = value ? new __WEBPACK_IMPORTED_MODULE_3__ngb_time__[\"a\" /* NgbTime */](value.hour, value.minute, value.second) : new __WEBPACK_IMPORTED_MODULE_3__ngb_time__[\"a\" /* NgbTime */]();\n if (!this.seconds && (!value || !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(value.second))) {\n this.model.second = 0;\n }\n };\n NgbTimepicker.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n NgbTimepicker.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n NgbTimepicker.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; };\n NgbTimepicker.prototype.changeHour = function (step) {\n this.model.changeHour(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.changeMinute = function (step) {\n this.model.changeMinute(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.changeSecond = function (step) {\n this.model.changeSecond(step);\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateHour = function (newVal) {\n var isPM = this.model.hour >= 12;\n var enteredHour = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal);\n if (this.meridian && (isPM && enteredHour < 12 || !isPM && enteredHour === 12)) {\n this.model.updateHour(enteredHour + 12);\n }\n else {\n this.model.updateHour(enteredHour);\n }\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateMinute = function (newVal) {\n this.model.updateMinute(Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal));\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.updateSecond = function (newVal) {\n this.model.updateSecond(Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"h\" /* toInteger */])(newVal));\n this.propagateModelChange();\n };\n NgbTimepicker.prototype.toggleMeridian = function () {\n if (this.meridian) {\n this.changeHour(12);\n }\n };\n NgbTimepicker.prototype.formatHour = function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(value)) {\n if (this.meridian) {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value % 12 === 0 ? 12 : value % 12);\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value % 24);\n }\n }\n else {\n return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(NaN);\n }\n };\n NgbTimepicker.prototype.formatMinSec = function (value) { return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"f\" /* padNumber */])(value); };\n NgbTimepicker.prototype.setFormControlSize = function () { return { 'form-control-sm': this.size === 'small', 'form-control-lg': this.size === 'large' }; };\n NgbTimepicker.prototype.setButtonSize = function () { return { 'btn-sm': this.size === 'small', 'btn-lg': this.size === 'large' }; };\n NgbTimepicker.prototype.ngOnChanges = function (changes) {\n if (changes['seconds'] && !this.seconds && this.model && !Object(__WEBPACK_IMPORTED_MODULE_2__util_util__[\"d\" /* isNumber */])(this.model.second)) {\n this.model.second = 0;\n this.propagateModelChange(false);\n }\n };\n NgbTimepicker.prototype.propagateModelChange = function (touched) {\n if (touched === void 0) { touched = true; }\n if (touched) {\n this.onTouched();\n }\n if (this.model.isValid(this.seconds)) {\n this.onChange({ hour: this.model.hour, minute: this.model.minute, second: this.model.second });\n }\n else {\n this.onChange(null);\n }\n };\n NgbTimepicker.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-timepicker',\n styles: [\"\\n .ngb-tp {\\n display: flex;\\n align-items: center;\\n }\\n\\n .ngb-tp-hour, .ngb-tp-minute, .ngb-tp-second, .ngb-tp-meridian {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: space-around;\\n }\\n\\n .ngb-tp-spacer {\\n width: 1em;\\n text-align: center;\\n }\\n\\n .chevron::before {\\n border-style: solid;\\n border-width: 0.29em 0.29em 0 0;\\n content: '';\\n display: inline-block;\\n height: 0.69em;\\n left: 0.05em;\\n position: relative;\\n top: 0.15em;\\n transform: rotate(-45deg);\\n -webkit-transform: rotate(-45deg);\\n -ms-transform: rotate(-45deg);\\n vertical-align: middle;\\n width: 0.71em;\\n }\\n\\n .chevron.bottom:before {\\n top: -.3em;\\n -webkit-transform: rotate(135deg);\\n -ms-transform: rotate(135deg);\\n transform: rotate(135deg);\\n }\\n\\n input {\\n text-align: center;\\n display: inline-block;\\n width: auto;\\n }\\n \"],\n template: \"\\n <fieldset [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <div class=\\\"ngb-tp\\\">\\n <div class=\\\"ngb-tp-hour\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeHour(hourStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment hours</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"HH\\\"\\n [value]=\\\"formatHour(model?.hour)\\\" (change)=\\\"updateHour($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Hours\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeHour(-hourStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement hours</span>\\n </button>\\n </div>\\n <div class=\\\"ngb-tp-spacer\\\">:</div>\\n <div class=\\\"ngb-tp-minute\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeMinute(minuteStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment minutes</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"MM\\\"\\n [value]=\\\"formatMinSec(model?.minute)\\\" (change)=\\\"updateMinute($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Minutes\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeMinute(-minuteStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement minutes</span>\\n </button>\\n </div>\\n <div *ngIf=\\\"seconds\\\" class=\\\"ngb-tp-spacer\\\">:</div>\\n <div *ngIf=\\\"seconds\\\" class=\\\"ngb-tp-second\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeSecond(secondStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron\\\"></span>\\n <span class=\\\"sr-only\\\">Increment seconds</span>\\n </button>\\n <input type=\\\"text\\\" class=\\\"form-control\\\" [ngClass]=\\\"setFormControlSize()\\\" maxlength=\\\"2\\\" size=\\\"2\\\" placeholder=\\\"SS\\\"\\n [value]=\\\"formatMinSec(model?.second)\\\" (change)=\\\"updateSecond($event.target.value)\\\"\\n [readonly]=\\\"readonlyInputs\\\" [disabled]=\\\"disabled\\\" aria-label=\\\"Seconds\\\">\\n <button *ngIf=\\\"spinners\\\" type=\\\"button\\\" class=\\\"btn btn-link\\\" [ngClass]=\\\"setButtonSize()\\\" (click)=\\\"changeSecond(-secondStep)\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\">\\n <span class=\\\"chevron bottom\\\"></span>\\n <span class=\\\"sr-only\\\">Decrement seconds</span>\\n </button>\\n </div>\\n <div *ngIf=\\\"meridian\\\" class=\\\"ngb-tp-spacer\\\"></div>\\n <div *ngIf=\\\"meridian\\\" class=\\\"ngb-tp-meridian\\\">\\n <button type=\\\"button\\\" class=\\\"btn btn-outline-primary\\\" [ngClass]=\\\"setButtonSize()\\\"\\n [disabled]=\\\"disabled\\\" [class.disabled]=\\\"disabled\\\"\\n (click)=\\\"toggleMeridian()\\\">{{model?.hour >= 12 ? 'PM' : 'AM'}}</button>\\n </div>\\n </div>\\n </fieldset>\\n \",\n providers: [NGB_TIMEPICKER_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbTimepicker.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_4__timepicker_config__[\"a\" /* NgbTimepickerConfig */], },\n ]; };\n NgbTimepicker.propDecorators = {\n \"meridian\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"spinners\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"seconds\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"hourStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"minuteStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"secondStep\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"readonlyInputs\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"size\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbTimepicker;\n}());\n\n//# sourceMappingURL=timepicker.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvdGltZXBpY2tlci5qcz8zODQ3Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgSW5wdXQsIGZvcndhcmRSZWYgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE5HX1ZBTFVFX0FDQ0VTU09SIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xuaW1wb3J0IHsgaXNOdW1iZXIsIHBhZE51bWJlciwgdG9JbnRlZ2VyIH0gZnJvbSAnLi4vdXRpbC91dGlsJztcbmltcG9ydCB7IE5nYlRpbWUgfSBmcm9tICcuL25nYi10aW1lJztcbmltcG9ydCB7IE5nYlRpbWVwaWNrZXJDb25maWcgfSBmcm9tICcuL3RpbWVwaWNrZXItY29uZmlnJztcbnZhciBOR0JfVElNRVBJQ0tFUl9WQUxVRV9BQ0NFU1NPUiA9IHtcbiAgICBwcm92aWRlOiBOR19WQUxVRV9BQ0NFU1NPUixcbiAgICB1c2VFeGlzdGluZzogZm9yd2FyZFJlZihmdW5jdGlvbiAoKSB7IHJldHVybiBOZ2JUaW1lcGlja2VyOyB9KSxcbiAgICBtdWx0aTogdHJ1ZVxufTtcbi8qKlxuICogQSBsaWdodHdlaWdodCAmIGNvbmZpZ3V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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///294\n"); /***/ }), /* 295 */ @@ -1073,21 +1073,21 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return NgbTypeaheadModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__highlight__ = __webpack_require__(298);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__typeahead_window__ = __webpack_require__(182);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__typeahead__ = __webpack_require__(299);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__typeahead_config__ = __webpack_require__(183);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\"]; });\n/* unused harmony reexport NgbTypeaheadWindow */\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_5__typeahead_config__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\"]; });\n\n\n\n\n\n\n\n\n\n\nvar NgbTypeaheadModule = (function () {\n function NgbTypeaheadModule() {\n }\n NgbTypeaheadModule.forRoot = function () { return { ngModule: NgbTypeaheadModule, providers: [__WEBPACK_IMPORTED_MODULE_5__typeahead_config__[\"a\" /* NgbTypeaheadConfig */]] }; };\n NgbTypeaheadModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [__WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\" /* NgbTypeahead */], __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\" /* NgbHighlight */], __WEBPACK_IMPORTED_MODULE_3__typeahead_window__[\"a\" /* NgbTypeaheadWindow */]],\n exports: [__WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\" /* NgbTypeahead */], __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\" /* NgbHighlight */]],\n imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]],\n entryComponents: [__WEBPACK_IMPORTED_MODULE_3__typeahead_window__[\"a\" /* NgbTypeaheadWindow */]]\n },] },\n ];\n /** @nocollapse */\n NgbTypeaheadModule.ctorParameters = function () { return []; };\n return NgbTypeaheadModule;\n}());\n\n//# sourceMappingURL=typeahead.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC90eXBlYWhlYWQubW9kdWxlLmpzPzJiZmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBOZ2JIaWdobGlnaHQgfSBmcm9tICcuL2hpZ2hsaWdodCc7XG5pbXBvcnQgeyBOZ2JUeXBlYWhlYWRXaW5kb3cgfSBmcm9tICcuL3R5cGVhaGVhZC13aW5kb3cnO1xuaW1wb3J0IHsgTmdiVHlwZWFoZWFkIH0gZnJvbSAnLi90eXBlYWhlYWQnO1xuaW1wb3J0IHsgTmdiVHlwZWFoZWFkQ29uZmlnIH0gZnJvbSAnLi90eXBlYWhlYWQtY29uZmlnJztcbmV4cG9ydCB7IE5nYkhpZ2hsaWdodCB9IGZyb20gJy4vaGlnaGxpZ2h0JztcbmV4cG9ydCB7IE5nYlR5cGVhaGVhZFdpbmRvdyB9IGZyb20gJy4vdHlwZWFoZWFkLXdpbmRvdyc7XG5leHBvcnQgeyBOZ2JUeXBlYWhlYWRDb25maWcgfSBmcm9tICcuL3R5cGVhaGVhZC1jb25maWcnO1xuZXhwb3J0IHsgTmdiVHlwZWFoZWFkIH0gZnJvbSAnLi90eXBlYWhlYWQnO1xudmFyIE5nYlR5cGVhaGVhZE1vZHVsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgZnVuY3Rpb24gTmdiVHlwZW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lYWhlYWQubW9kdWxlLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTdcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///297\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return NgbTypeaheadModule; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__highlight__ = __webpack_require__(298);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__typeahead_window__ = __webpack_require__(182);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__typeahead__ = __webpack_require__(299);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__typeahead_config__ = __webpack_require__(183);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\"]; });\n/* unused harmony reexport NgbTypeaheadWindow */\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return __WEBPACK_IMPORTED_MODULE_5__typeahead_config__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return __WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\"]; });\n\n\n\n\n\n\n\n\n\n\nvar NgbTypeaheadModule = (function () {\n function NgbTypeaheadModule() {\n }\n NgbTypeaheadModule.forRoot = function () { return { ngModule: NgbTypeaheadModule, providers: [__WEBPACK_IMPORTED_MODULE_5__typeahead_config__[\"a\" /* NgbTypeaheadConfig */]] }; };\n NgbTypeaheadModule.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgModule\"], args: [{\n declarations: [__WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\" /* NgbTypeahead */], __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\" /* NgbHighlight */], __WEBPACK_IMPORTED_MODULE_3__typeahead_window__[\"a\" /* NgbTypeaheadWindow */]],\n exports: [__WEBPACK_IMPORTED_MODULE_4__typeahead__[\"a\" /* NgbTypeahead */], __WEBPACK_IMPORTED_MODULE_2__highlight__[\"a\" /* NgbHighlight */]],\n imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__[\"CommonModule\"]],\n entryComponents: [__WEBPACK_IMPORTED_MODULE_3__typeahead_window__[\"a\" /* NgbTypeaheadWindow */]]\n },] },\n ];\n /** @nocollapse */\n NgbTypeaheadModule.ctorParameters = function () { return []; };\n return NgbTypeaheadModule;\n}());\n\n//# sourceMappingURL=typeahead.module.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC90eXBlYWhlYWQubW9kdWxlLmpzPzJiZmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7X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); /***/ }), /* 298 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbHighlight; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(18);\n\n\nvar NgbHighlight = (function () {\n function NgbHighlight() {\n this.highlightClass = 'ngb-highlight';\n }\n NgbHighlight.prototype.ngOnChanges = function (changes) {\n var resultStr = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */])(this.result);\n var resultLC = resultStr.toLowerCase();\n var termLC = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */])(this.term).toLowerCase();\n var currentIdx = 0;\n if (termLC.length > 0) {\n this.parts = resultLC.split(new RegExp(\"(\" + Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"g\" /* regExpEscape */])(termLC) + \")\")).map(function (part) {\n var originalPart = resultStr.substr(currentIdx, part.length);\n currentIdx += part.length;\n return originalPart;\n });\n }\n else {\n this.parts = [resultStr];\n }\n };\n NgbHighlight.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-highlight',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n template: \"<ng-template ngFor [ngForOf]=\\\"parts\\\" let-part let-isOdd=\\\"odd\\\">\" +\n \"<span *ngIf=\\\"isOdd\\\" class=\\\"{{highlightClass}}\\\">{{part}}</span><ng-template [ngIf]=\\\"!isOdd\\\">{{part}}</ng-template>\" +\n \"</ng-template>\",\n // template needs to be formatted in a certain way so we don't add empty text nodes\n styles: [\"\\n .ngb-highlight {\\n font-weight: bold;\\n }\\n \"]\n },] },\n ];\n /** @nocollapse */\n NgbHighlight.ctorParameters = function () { return []; };\n NgbHighlight.propDecorators = {\n \"highlightClass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"result\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"term\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbHighlight;\n}());\n\n//# sourceMappingURL=highlight.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC9oaWdobGlnaHQuanM/MTMzYyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIElucHV0LCBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgcmVnRXhwRXNjYXBlLCB0b1N0cmluZyB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG52YXIgTmdiSGlnaGxpZ2h0ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JIaWdobGlnaHQoKSB7XG4gICAgICAgIHRoaXMuaGlnaGxpZ2h0Q2xhc3MgPSAnbmdiLWhpZ2hsaWdodCc7XG4gICAgfVxuICAgIE5nYkhpZ2hsaWdodC5wcm90b3R5cGUubmdPbkNoYW5nZXMgPSBmdW5jdGlvbiAoY2hhbmdlcykge1xuICAgICAgICB2YXIgcmVzdWx0U3RyID0gdG9TdHJpbmcodGhpcy5yZXN1bHQpO1xuICAgICAgICB2YXIgcmVzdWx0TEMgPSByZXN1bHRTdHIudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgdmFyIHRlcm1MQyA9IHRvU3RyaW5nKHRoaXMudGVybSkudG9Mb3dlckNhc2UoKTtcbiAgICAgICAg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cbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///298\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbHighlight; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(19);\n\n\nvar NgbHighlight = (function () {\n function NgbHighlight() {\n this.highlightClass = 'ngb-highlight';\n }\n NgbHighlight.prototype.ngOnChanges = function (changes) {\n var resultStr = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */])(this.result);\n var resultLC = resultStr.toLowerCase();\n var termLC = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"i\" /* toString */])(this.term).toLowerCase();\n var currentIdx = 0;\n if (termLC.length > 0) {\n this.parts = resultLC.split(new RegExp(\"(\" + Object(__WEBPACK_IMPORTED_MODULE_1__util_util__[\"g\" /* regExpEscape */])(termLC) + \")\")).map(function (part) {\n var originalPart = resultStr.substr(currentIdx, part.length);\n currentIdx += part.length;\n return originalPart;\n });\n }\n else {\n this.parts = [resultStr];\n }\n };\n NgbHighlight.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Component\"], args: [{\n selector: 'ngb-highlight',\n changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ChangeDetectionStrategy\"].OnPush,\n template: \"<ng-template ngFor [ngForOf]=\\\"parts\\\" let-part let-isOdd=\\\"odd\\\">\" +\n \"<span *ngIf=\\\"isOdd\\\" class=\\\"{{highlightClass}}\\\">{{part}}</span><ng-template [ngIf]=\\\"!isOdd\\\">{{part}}</ng-template>\" +\n \"</ng-template>\",\n // template needs to be formatted in a certain way so we don't add empty text nodes\n styles: [\"\\n .ngb-highlight {\\n font-weight: bold;\\n }\\n \"]\n },] },\n ];\n /** @nocollapse */\n NgbHighlight.ctorParameters = function () { return []; };\n NgbHighlight.propDecorators = {\n \"highlightClass\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"result\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"term\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n };\n return NgbHighlight;\n}());\n\n//# sourceMappingURL=highlight.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC9oaWdobGlnaHQuanM/MTMzYyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnQsIElucHV0LCBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgcmVnRXhwRXNjYXBlLCB0b1N0cmluZyB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG52YXIgTmdiSGlnaGxpZ2h0ID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ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ZTogSW5wdXQgfSxdLFxuICAgICAgICBcInRlcm1cIjogW3sgdHlwZTogSW5wdXQgfSxdLFxuICAgIH07XG4gICAgcmV0dXJuIE5nYkhpZ2hsaWdodDtcbn0oKSk7XG5leHBvcnQgeyBOZ2JIaWdobGlnaHQgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWhpZ2hsaWdodC5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC90eXBlYWhlYWQvaGlnaGxpZ2h0LmpzXG4vLyBtb2R1bGUgaWQgPSAyOThcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///298\n"); /***/ }), /* 299 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTypeahead; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__ = __webpack_require__(165);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__ = __webpack_require__(541);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__ = __webpack_require__(542);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__ = __webpack_require__(300);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__ = __webpack_require__(544);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_positioning__ = __webpack_require__(99);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__typeahead_window__ = __webpack_require__(182);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_popup__ = __webpack_require__(123);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_util__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__typeahead_config__ = __webpack_require__(183);\n\n\n\n\n\n\n\n\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"Tab\"] = 9] = \"Tab\";\n Key[Key[\"Enter\"] = 13] = \"Enter\";\n Key[Key[\"Escape\"] = 27] = \"Escape\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NGB_TYPEAHEAD_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbTypeahead; }),\n multi: true\n};\nvar nextWindowId = 0;\n/**\n * NgbTypeahead directive provides a simple way of creating powerful typeaheads from any text input\n */\nvar NgbTypeahead = (function () {\n function NgbTypeahead(_elementRef, _viewContainerRef, _renderer, _injector, componentFactoryResolver, config, ngZone) {\n var _this = this;\n this._elementRef = _elementRef;\n this._viewContainerRef = _viewContainerRef;\n this._renderer = _renderer;\n this._injector = _injector;\n /** Placement of a typeahead accepts:\n * \"top\", \"top-left\", \"top-right\", \"bottom\", \"bottom-left\", \"bottom-right\",\n * \"left\", \"left-top\", \"left-bottom\", \"right\", \"right-top\", \"right-bottom\"\n * and array of above values.\n */\n this.placement = 'bottom-left';\n /**\n * An event emitted when a match is selected. Event payload is of type NgbTypeaheadSelectItemEvent.\n */\n this.selectItem = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.popupId = \"ngb-typeahead-\" + nextWindowId++;\n this._onTouched = function () { };\n this._onChange = function (_) { };\n this.container = config.container;\n this.editable = config.editable;\n this.focusFirst = config.focusFirst;\n this.showHint = config.showHint;\n this.placement = config.placement;\n this._valueChanges = Object(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__[\"fromEvent\"])(_elementRef.nativeElement, 'input', function ($event) { return $event.target.value; });\n this._resubscribeTypeahead = new __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__[\"BehaviorSubject\"](null);\n this._popupService = new __WEBPACK_IMPORTED_MODULE_9__util_popup__[\"b\" /* PopupService */](__WEBPACK_IMPORTED_MODULE_8__typeahead_window__[\"a\" /* NgbTypeaheadWindow */], _injector, _viewContainerRef, _renderer, componentFactoryResolver);\n this._zoneSubscription = ngZone.onStable.subscribe(function () {\n if (_this.isPopupOpen()) {\n Object(__WEBPACK_IMPORTED_MODULE_7__util_positioning__[\"a\" /* positionElements */])(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body');\n }\n });\n }\n NgbTypeahead.prototype.ngOnInit = function () {\n var _this = this;\n var inputValues$ = __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__[\"_do\"].call(this._valueChanges, function (value) {\n _this._inputValueBackup = value;\n if (_this.editable) {\n _this._onChange(value);\n }\n });\n var results$ = __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__[\"letProto\"].call(inputValues$, this.ngbTypeahead);\n var processedResults$ = __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__[\"_do\"].call(results$, function () {\n if (!_this.editable) {\n _this._onChange(undefined);\n }\n });\n var userInput$ = __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__[\"switchMap\"].call(this._resubscribeTypeahead, function () { return processedResults$; });\n this._subscription = this._subscribeToUserInput(userInput$);\n };\n NgbTypeahead.prototype.ngOnDestroy = function () {\n this._closePopup();\n this._unsubscribeFromUserInput();\n this._zoneSubscription.unsubscribe();\n };\n NgbTypeahead.prototype.registerOnChange = function (fn) { this._onChange = fn; };\n NgbTypeahead.prototype.registerOnTouched = function (fn) { this._onTouched = fn; };\n NgbTypeahead.prototype.writeValue = function (value) { this._writeInputValue(this._formatItemForInput(value)); };\n NgbTypeahead.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n NgbTypeahead.prototype.onDocumentClick = function (event) {\n if (event.target !== this._elementRef.nativeElement) {\n this.dismissPopup();\n }\n };\n /**\n * Dismisses typeahead popup window\n */\n /**\n * Dismisses typeahead popup window\n */\n NgbTypeahead.prototype.dismissPopup = /**\n * Dismisses typeahead popup window\n */\n function () {\n if (this.isPopupOpen()) {\n this._closePopup();\n this._writeInputValue(this._inputValueBackup);\n }\n };\n /**\n * Returns true if the typeahead popup window is displayed\n */\n /**\n * Returns true if the typeahead popup window is displayed\n */\n NgbTypeahead.prototype.isPopupOpen = /**\n * Returns true if the typeahead popup window is displayed\n */\n function () { return this._windowRef != null; };\n NgbTypeahead.prototype.handleBlur = function () {\n this._resubscribeTypeahead.next(null);\n this._onTouched();\n };\n NgbTypeahead.prototype.handleKeyDown = function (event) {\n if (!this.isPopupOpen()) {\n return;\n }\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(event.which)]) {\n switch (event.which) {\n case Key.ArrowDown:\n event.preventDefault();\n this._windowRef.instance.next();\n this._showHint();\n break;\n case Key.ArrowUp:\n event.preventDefault();\n this._windowRef.instance.prev();\n this._showHint();\n break;\n case Key.Enter:\n case Key.Tab:\n var result = this._windowRef.instance.getActive();\n if (Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"b\" /* isDefined */])(result)) {\n event.preventDefault();\n event.stopPropagation();\n this._selectResult(result);\n }\n this._closePopup();\n break;\n case Key.Escape:\n event.preventDefault();\n this._resubscribeTypeahead.next(null);\n this.dismissPopup();\n break;\n }\n }\n };\n NgbTypeahead.prototype._openPopup = function () {\n var _this = this;\n if (!this.isPopupOpen()) {\n this._inputValueBackup = this._elementRef.nativeElement.value;\n this._windowRef = this._popupService.open();\n this._windowRef.instance.id = this.popupId;\n this._windowRef.instance.selectEvent.subscribe(function (result) { return _this._selectResultClosePopup(result); });\n this._windowRef.instance.activeChangeEvent.subscribe(function (activeId) { return _this.activeDescendant = activeId; });\n if (this.container === 'body') {\n window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);\n }\n }\n };\n NgbTypeahead.prototype._closePopup = function () {\n this._popupService.close();\n this._windowRef = null;\n this.activeDescendant = undefined;\n };\n NgbTypeahead.prototype._selectResult = function (result) {\n var defaultPrevented = false;\n this.selectItem.emit({ item: result, preventDefault: function () { defaultPrevented = true; } });\n this._resubscribeTypeahead.next(null);\n if (!defaultPrevented) {\n this.writeValue(result);\n this._onChange(result);\n }\n };\n NgbTypeahead.prototype._selectResultClosePopup = function (result) {\n this._selectResult(result);\n this._closePopup();\n };\n NgbTypeahead.prototype._showHint = function () {\n if (this.showHint && this._inputValueBackup != null) {\n var userInputLowerCase = this._inputValueBackup.toLowerCase();\n var formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());\n if (userInputLowerCase === formattedVal.substr(0, this._inputValueBackup.length).toLowerCase()) {\n this._writeInputValue(this._inputValueBackup + formattedVal.substr(this._inputValueBackup.length));\n this._elementRef.nativeElement['setSelectionRange'].apply(this._elementRef.nativeElement, [this._inputValueBackup.length, formattedVal.length]);\n }\n else {\n this.writeValue(this._windowRef.instance.getActive());\n }\n }\n };\n NgbTypeahead.prototype._formatItemForInput = function (item) {\n return item && this.inputFormatter ? this.inputFormatter(item) : Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(item);\n };\n NgbTypeahead.prototype._writeInputValue = function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(value));\n };\n NgbTypeahead.prototype._subscribeToUserInput = function (userInput$) {\n var _this = this;\n return userInput$.subscribe(function (results) {\n if (!results || results.length === 0) {\n _this._closePopup();\n }\n else {\n _this._openPopup();\n _this._windowRef.instance.focusFirst = _this.focusFirst;\n _this._windowRef.instance.results = results;\n _this._windowRef.instance.term = _this._elementRef.nativeElement.value;\n if (_this.resultFormatter) {\n _this._windowRef.instance.formatter = _this.resultFormatter;\n }\n if (_this.resultTemplate) {\n _this._windowRef.instance.resultTemplate = _this.resultTemplate;\n }\n _this._showHint();\n // The observable stream we are subscribing to might have async steps\n // and if a component containing typeahead is using the OnPush strategy\n // the change detection turn wouldn't be invoked automatically.\n // The observable stream we are subscribing to might have async steps\n // and if a component containing typeahead is using the OnPush strategy\n // the change detection turn wouldn't be invoked automatically.\n _this._windowRef.changeDetectorRef.detectChanges();\n }\n });\n };\n NgbTypeahead.prototype._unsubscribeFromUserInput = function () {\n if (this._subscription) {\n this._subscription.unsubscribe();\n }\n this._subscription = null;\n };\n NgbTypeahead.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'input[ngbTypeahead]',\n exportAs: 'ngbTypeahead',\n host: {\n '(blur)': 'handleBlur()',\n '[class.open]': 'isPopupOpen()',\n '(document:click)': 'onDocumentClick($event)',\n '(keydown)': 'handleKeyDown($event)',\n 'autocomplete': 'off',\n 'autocapitalize': 'off',\n 'autocorrect': 'off',\n 'role': 'combobox',\n 'aria-multiline': 'false',\n '[attr.aria-autocomplete]': 'showHint ? \"both\" : \"list\"',\n '[attr.aria-activedescendant]': 'activeDescendant',\n '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',\n '[attr.aria-expanded]': 'isPopupOpen()'\n },\n providers: [NGB_TYPEAHEAD_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbTypeahead.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injector\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n { type: __WEBPACK_IMPORTED_MODULE_11__typeahead_config__[\"a\" /* NgbTypeaheadConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n ]; };\n NgbTypeahead.propDecorators = {\n \"container\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"editable\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"focusFirst\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"inputFormatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngbTypeahead\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultFormatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showHint\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"placement\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"selectItem\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbTypeahead;\n}());\n\n//# sourceMappingURL=typeahead.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3R5cGVhaGVhZC90eXBlYWhlYWQuanM/YWE4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIsIERpcmVjdGl2ZSwgRWxlbWVudFJlZiwgRXZlbnRFbWl0dGVyLCBmb3J3YXJkUmVmLCBJbmplY3RvciwgSW5wdXQsIE5nWm9uZSwgT3V0cHV0LCBSZW5kZXJlcjIsIFRlbXBsYXRlUmVmLCBWaWV3Q29udGFpbmVyUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5p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EtleS5BcnJvd0Rvd246XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5uZXh0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Nob3dIaW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93VXA6XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5wcmV2KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Nob3dIaW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVudGVyOlxuICAgICAgICAgICAgICAgIGNhc2UgS2V5LlRhYjpcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5nZXRBY3RpdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHQocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jbG9zZVBvcHVwKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVzY2FwZTpcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZ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ICAvLyB0aGUgY2hhbmdlIGRldGVjdGlvbiB0dXJuIHdvdWxkbid0IGJlIGludm9rZWQgYXV0b21hdGljYWxseS5cbiAgICAgICAgICAgICAgICBfdGhpcy5fd2luZG93UmVmLmNoYW5nZURldGVjdG9yUmVmLmRldGVjdENoYW5nZXMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBOZ2JUeXBlYWhlYWQucHJvdG90eXBlLl91bnN1YnNjcmliZUZyb21Vc2VySW5wdXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLl9zdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuX3N1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuX3N1YnNjcmlwdGlvbiA9IG51bGw7XG4gICAgfTtcbiAgICBOZ2JUeXBlYWhlYWQuZGVjb3JhdG9ycyA9IFtcbiAgICAgICAgeyB0eXBlOiBEaXJlY3RpdmUsIGFyZ3M6IFt7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdG9yOiAnaW5wdXRbbmdiVHlwZWFoZWFkXScsXG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydEFzOiAnbmdiVHlwZWFoZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgaG9zdDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJyhibHVyKSc6ICdoYW5kbGVCbHVyKCknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tjbGFzcy5vcGVuXSc6ICdpc1BvcHVwT3BlbigpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoZG9jdW1lbnQ6Y2xpY2spJzogJ29uRG9jdW1lbnRDbGljaygkZXZlbnQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoa2V5ZG93biknOiAnaGFuZGxlS2V5RG93bigkZXZlbnQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRvY29tcGxldGUnOiAnb2ZmJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRvY2FwaXRhbGl6ZSc6ICdvZmYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dG9jb3JyZWN0JzogJ29mZicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncm9sZSc6ICdjb21ib2JveCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXJpYS1tdWx0aWxpbmUnOiAnZmFsc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtYXV0b2NvbXBsZXRlXSc6ICdzaG93SGludCA/IFwiYm90aFwiIDogXCJsaXN0XCInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtYWN0aXZlZGVzY2VuZGFudF0nOiAnYWN0aXZlRGVzY2VuZGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnW2F0dHIuYXJpYS1vd25zXSc6ICdpc1BvcHVwT3BlbigpID8gcG9wdXBJZCA6IG51bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtZXhwYW5kZWRdJzogJ2lzUG9wdXBPcGVuKCknXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyczogW05HQl9UWVBFQUhFQURfVkFMVUVfQUNDRVNTT1JdXG4gICAgICAgICAgICAgICAgfSxdIH0sXG4gICAgXTtcbiAgICAvKiogQG5vY29sbGFwc2UgKi9cbiAgICBOZ2JUeXBlYWhlYWQuY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXG4gICAgICAgIHsgdHlwZTogRWxlbWVudFJlZiwgfSxcbiAgICAgICAgeyB0eXBlOiBWaWV3Q29udGFpbmVyUmVmLCB9LFxuICAgICAgICB7IHR5cGU6IFJlbmRlcmVyMiwgfSxcbiAgICAgICAgeyB0eXBlOiBJbmplY3RvciwgfSxcbiAgICAgICAgeyB0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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///299\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTypeahead; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__ = __webpack_require__(165);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__ = __webpack_require__(541);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__ = __webpack_require__(542);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__ = __webpack_require__(300);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__ = __webpack_require__(544);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_positioning__ = __webpack_require__(99);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__typeahead_window__ = __webpack_require__(182);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_popup__ = __webpack_require__(123);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_util__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__typeahead_config__ = __webpack_require__(183);\n\n\n\n\n\n\n\n\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"Tab\"] = 9] = \"Tab\";\n Key[Key[\"Enter\"] = 13] = \"Enter\";\n Key[Key[\"Escape\"] = 27] = \"Escape\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NGB_TYPEAHEAD_VALUE_ACCESSOR = {\n provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"NG_VALUE_ACCESSOR\"],\n useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"forwardRef\"])(function () { return NgbTypeahead; }),\n multi: true\n};\nvar nextWindowId = 0;\n/**\n * NgbTypeahead directive provides a simple way of creating powerful typeaheads from any text input\n */\nvar NgbTypeahead = (function () {\n function NgbTypeahead(_elementRef, _viewContainerRef, _renderer, _injector, componentFactoryResolver, config, ngZone) {\n var _this = this;\n this._elementRef = _elementRef;\n this._viewContainerRef = _viewContainerRef;\n this._renderer = _renderer;\n this._injector = _injector;\n /** Placement of a typeahead accepts:\n * \"top\", \"top-left\", \"top-right\", \"bottom\", \"bottom-left\", \"bottom-right\",\n * \"left\", \"left-top\", \"left-bottom\", \"right\", \"right-top\", \"right-bottom\"\n * and array of above values.\n */\n this.placement = 'bottom-left';\n /**\n * An event emitted when a match is selected. Event payload is of type NgbTypeaheadSelectItemEvent.\n */\n this.selectItem = new __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"EventEmitter\"]();\n this.popupId = \"ngb-typeahead-\" + nextWindowId++;\n this._onTouched = function () { };\n this._onChange = function (_) { };\n this.container = config.container;\n this.editable = config.editable;\n this.focusFirst = config.focusFirst;\n this.showHint = config.showHint;\n this.placement = config.placement;\n this._valueChanges = Object(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_fromEvent__[\"fromEvent\"])(_elementRef.nativeElement, 'input', function ($event) { return $event.target.value; });\n this._resubscribeTypeahead = new __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__[\"BehaviorSubject\"](null);\n this._popupService = new __WEBPACK_IMPORTED_MODULE_9__util_popup__[\"b\" /* PopupService */](__WEBPACK_IMPORTED_MODULE_8__typeahead_window__[\"a\" /* NgbTypeaheadWindow */], _injector, _viewContainerRef, _renderer, componentFactoryResolver);\n this._zoneSubscription = ngZone.onStable.subscribe(function () {\n if (_this.isPopupOpen()) {\n Object(__WEBPACK_IMPORTED_MODULE_7__util_positioning__[\"a\" /* positionElements */])(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body');\n }\n });\n }\n NgbTypeahead.prototype.ngOnInit = function () {\n var _this = this;\n var inputValues$ = __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__[\"_do\"].call(this._valueChanges, function (value) {\n _this._inputValueBackup = value;\n if (_this.editable) {\n _this._onChange(value);\n }\n });\n var results$ = __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_let__[\"letProto\"].call(inputValues$, this.ngbTypeahead);\n var processedResults$ = __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_do__[\"_do\"].call(results$, function () {\n if (!_this.editable) {\n _this._onChange(undefined);\n }\n });\n var userInput$ = __WEBPACK_IMPORTED_MODULE_5_rxjs_operator_switchMap__[\"switchMap\"].call(this._resubscribeTypeahead, function () { return processedResults$; });\n this._subscription = this._subscribeToUserInput(userInput$);\n };\n NgbTypeahead.prototype.ngOnDestroy = function () {\n this._closePopup();\n this._unsubscribeFromUserInput();\n this._zoneSubscription.unsubscribe();\n };\n NgbTypeahead.prototype.registerOnChange = function (fn) { this._onChange = fn; };\n NgbTypeahead.prototype.registerOnTouched = function (fn) { this._onTouched = fn; };\n NgbTypeahead.prototype.writeValue = function (value) { this._writeInputValue(this._formatItemForInput(value)); };\n NgbTypeahead.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n NgbTypeahead.prototype.onDocumentClick = function (event) {\n if (event.target !== this._elementRef.nativeElement) {\n this.dismissPopup();\n }\n };\n /**\n * Dismisses typeahead popup window\n */\n /**\n * Dismisses typeahead popup window\n */\n NgbTypeahead.prototype.dismissPopup = /**\n * Dismisses typeahead popup window\n */\n function () {\n if (this.isPopupOpen()) {\n this._closePopup();\n this._writeInputValue(this._inputValueBackup);\n }\n };\n /**\n * Returns true if the typeahead popup window is displayed\n */\n /**\n * Returns true if the typeahead popup window is displayed\n */\n NgbTypeahead.prototype.isPopupOpen = /**\n * Returns true if the typeahead popup window is displayed\n */\n function () { return this._windowRef != null; };\n NgbTypeahead.prototype.handleBlur = function () {\n this._resubscribeTypeahead.next(null);\n this._onTouched();\n };\n NgbTypeahead.prototype.handleKeyDown = function (event) {\n if (!this.isPopupOpen()) {\n return;\n }\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(event.which)]) {\n switch (event.which) {\n case Key.ArrowDown:\n event.preventDefault();\n this._windowRef.instance.next();\n this._showHint();\n break;\n case Key.ArrowUp:\n event.preventDefault();\n this._windowRef.instance.prev();\n this._showHint();\n break;\n case Key.Enter:\n case Key.Tab:\n var result = this._windowRef.instance.getActive();\n if (Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"b\" /* isDefined */])(result)) {\n event.preventDefault();\n event.stopPropagation();\n this._selectResult(result);\n }\n this._closePopup();\n break;\n case Key.Escape:\n event.preventDefault();\n this._resubscribeTypeahead.next(null);\n this.dismissPopup();\n break;\n }\n }\n };\n NgbTypeahead.prototype._openPopup = function () {\n var _this = this;\n if (!this.isPopupOpen()) {\n this._inputValueBackup = this._elementRef.nativeElement.value;\n this._windowRef = this._popupService.open();\n this._windowRef.instance.id = this.popupId;\n this._windowRef.instance.selectEvent.subscribe(function (result) { return _this._selectResultClosePopup(result); });\n this._windowRef.instance.activeChangeEvent.subscribe(function (activeId) { return _this.activeDescendant = activeId; });\n if (this.container === 'body') {\n window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);\n }\n }\n };\n NgbTypeahead.prototype._closePopup = function () {\n this._popupService.close();\n this._windowRef = null;\n this.activeDescendant = undefined;\n };\n NgbTypeahead.prototype._selectResult = function (result) {\n var defaultPrevented = false;\n this.selectItem.emit({ item: result, preventDefault: function () { defaultPrevented = true; } });\n this._resubscribeTypeahead.next(null);\n if (!defaultPrevented) {\n this.writeValue(result);\n this._onChange(result);\n }\n };\n NgbTypeahead.prototype._selectResultClosePopup = function (result) {\n this._selectResult(result);\n this._closePopup();\n };\n NgbTypeahead.prototype._showHint = function () {\n if (this.showHint && this._inputValueBackup != null) {\n var userInputLowerCase = this._inputValueBackup.toLowerCase();\n var formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());\n if (userInputLowerCase === formattedVal.substr(0, this._inputValueBackup.length).toLowerCase()) {\n this._writeInputValue(this._inputValueBackup + formattedVal.substr(this._inputValueBackup.length));\n this._elementRef.nativeElement['setSelectionRange'].apply(this._elementRef.nativeElement, [this._inputValueBackup.length, formattedVal.length]);\n }\n else {\n this.writeValue(this._windowRef.instance.getActive());\n }\n }\n };\n NgbTypeahead.prototype._formatItemForInput = function (item) {\n return item && this.inputFormatter ? this.inputFormatter(item) : Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(item);\n };\n NgbTypeahead.prototype._writeInputValue = function (value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', Object(__WEBPACK_IMPORTED_MODULE_10__util_util__[\"i\" /* toString */])(value));\n };\n NgbTypeahead.prototype._subscribeToUserInput = function (userInput$) {\n var _this = this;\n return userInput$.subscribe(function (results) {\n if (!results || results.length === 0) {\n _this._closePopup();\n }\n else {\n _this._openPopup();\n _this._windowRef.instance.focusFirst = _this.focusFirst;\n _this._windowRef.instance.results = results;\n _this._windowRef.instance.term = _this._elementRef.nativeElement.value;\n if (_this.resultFormatter) {\n _this._windowRef.instance.formatter = _this.resultFormatter;\n }\n if (_this.resultTemplate) {\n _this._windowRef.instance.resultTemplate = _this.resultTemplate;\n }\n _this._showHint();\n // The observable stream we are subscribing to might have async steps\n // and if a component containing typeahead is using the OnPush strategy\n // the change detection turn wouldn't be invoked automatically.\n // The observable stream we are subscribing to might have async steps\n // and if a component containing typeahead is using the OnPush strategy\n // the change detection turn wouldn't be invoked automatically.\n _this._windowRef.changeDetectorRef.detectChanges();\n }\n });\n };\n NgbTypeahead.prototype._unsubscribeFromUserInput = function () {\n if (this._subscription) {\n this._subscription.unsubscribe();\n }\n this._subscription = null;\n };\n NgbTypeahead.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Directive\"], args: [{\n selector: 'input[ngbTypeahead]',\n exportAs: 'ngbTypeahead',\n host: {\n '(blur)': 'handleBlur()',\n '[class.open]': 'isPopupOpen()',\n '(document:click)': 'onDocumentClick($event)',\n '(keydown)': 'handleKeyDown($event)',\n 'autocomplete': 'off',\n 'autocapitalize': 'off',\n 'autocorrect': 'off',\n 'role': 'combobox',\n 'aria-multiline': 'false',\n '[attr.aria-autocomplete]': 'showHint ? \"both\" : \"list\"',\n '[attr.aria-activedescendant]': 'activeDescendant',\n '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',\n '[attr.aria-expanded]': 'isPopupOpen()'\n },\n providers: [NGB_TYPEAHEAD_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NgbTypeahead.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ElementRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ViewContainerRef\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Renderer2\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injector\"], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"ComponentFactoryResolver\"], },\n { type: __WEBPACK_IMPORTED_MODULE_11__typeahead_config__[\"a\" /* NgbTypeaheadConfig */], },\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"NgZone\"], },\n ]; };\n NgbTypeahead.propDecorators = {\n \"container\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"editable\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"focusFirst\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"inputFormatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"ngbTypeahead\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultFormatter\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"resultTemplate\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"showHint\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"placement\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Input\"] },],\n \"selectItem\": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Output\"] },],\n };\n return NgbTypeahead;\n}());\n\n//# sourceMappingURL=typeahead.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8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R5cGUuaGFuZGxlQmx1ciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5fcmVzdWJzY3JpYmVUeXBlYWhlYWQubmV4dChudWxsKTtcbiAgICAgICAgdGhpcy5fb25Ub3VjaGVkKCk7XG4gICAgfTtcbiAgICBOZ2JUeXBlYWhlYWQucHJvdG90eXBlLmhhbmRsZUtleURvd24gPSBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzUG9wdXBPcGVuKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoS2V5W3RvU3RyaW5nKGV2ZW50LndoaWNoKV0pIHtcbiAgICAgICAgICAgIHN3aXRjaCAoZXZlbnQud2hpY2gpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5BcnJvd0Rvd246XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5uZXh0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Nob3dIaW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkFycm93VXA6XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5wcmV2KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Nob3dIaW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVudGVyOlxuICAgICAgICAgICAgICAgIGNhc2UgS2V5LlRhYjpcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHRoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5nZXRBY3RpdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHQocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jbG9zZVBvcHVwKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVzY2FwZTpcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVzdWJzY3JpYmVUeXBlYWhlYWQubmV4dChudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNtaXNzUG9wdXAoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE5nYlR5cGVhaGVhZC5wcm90b3R5cGUuX29wZW5Qb3B1cCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgaWYgKCF0aGlzLmlzUG9wdXBPcGVuKCkpIHtcbiAgICAgICAgICAgIHRoaXMuX2lucHV0VmFsdWVCYWNrdXAgPSB0aGlzLl9lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQudmFsdWU7XG4gICAgICAgICAgICB0aGlzLl93aW5kb3dSZWYgPSB0aGlzLl9wb3B1cFNlcnZpY2Uub3BlbigpO1xuICAgICAgICAgICAgdGhpcy5fd2luZG93UmVmLmluc3RhbmNlLmlkID0gdGhpcy5wb3B1cElkO1xuICAgICAgICAgIC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KGZ1bmN0aW9uIChyZXN1bHRzKSB7XG4gICAgICAgICAgICBpZiAoIXJlc3VsdHMgfHwgcmVzdWx0cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fY2xvc2VQb3B1cCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuX29wZW5Qb3B1cCgpO1xuICAgICAgICAgICAgICAgIF90aGlzLl93aW5kb3dSZWYuaW5zdGFuY2UuZm9jdXNGaXJzdCA9IF90aGlzLmZvY3VzRmlyc3Q7XG4gICAgICAgICAgICAgICAgX3RoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5yZXN1bHRzID0gcmVzdWx0cztcbiAgICAgICAgICAgICAgICBfdGhpcy5fd2luZG93UmVmLmluc3RhbmNlLnRlcm0gPSBfdGhpcy5fZWxlbWVudFJlZi5uYXRpdmVFbGVtZW50LnZhbHVlO1xuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5yZXN1bHRGb3JtYXR0ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3dpbmRvd1JlZi5pbnN0YW5jZS5mb3JtYXR0ZXIgPSBfdGhpcy5yZXN1bHRGb3JtYXR0ZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5yZXN1bHRUZW1wbGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5fd2luZG93UmVmLmluc3RhbmNlLnJlc3VsdFRlbXBsYXRlID0gX3RoaXMucmVzdWx0VGVtcGxhdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF90aGlzLl9zaG93SGludCgpO1xuICAgICAgICAgICAgICAgIC8vIFRoZSBvYnNlcnZhYmxlIHN0cmVhbSB3ZSBhcmUgc3Vic2NyaWJpbmcgdG8gbWlnaHQgaGF2ZSBhc3luYyBzdGVwc1xuICAgICAgICAgICAgICAg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mdiVHlwZWFoZWFkXScsXG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydEFzOiAnbmdiVHlwZWFoZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgaG9zdDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJyhibHVyKSc6ICdoYW5kbGVCbHVyKCknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1tjbGFzcy5vcGVuXSc6ICdpc1BvcHVwT3BlbigpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoZG9jdW1lbnQ6Y2xpY2spJzogJ29uRG9jdW1lbnRDbGljaygkZXZlbnQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcoa2V5ZG93biknOiAnaGFuZGxlS2V5RG93bigkZXZlbnQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRvY29tcGxldGUnOiAnb2ZmJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRvY2FwaXRhbGl6ZSc6ICdvZmYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dG9jb3JyZWN0JzogJ29mZicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncm9sZSc6ICdjb21ib2JveCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXJpYS1tdWx0aWxpbmUnOiAnZmFsc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtYXV0b2NvbXBsZXRlXSc6ICdzaG93SGludCA/IFwiYm90aFwiIDogXCJsaXN0XCInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtYWN0aXZlZGVzY2VuZGFudF0nOiAnYWN0aXZlRGVzY2VuZGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnW2F0dHIuYXJpYS1vd25zXSc6ICdpc1BvcHVwT3BlbigpID8gcG9wdXBJZCA6IG51bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1thdHRyLmFyaWEtZXhwYW5kZWRdJzogJ2lzUG9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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///299\n"); /***/ }), /* 300 */ @@ -1315,7 +1315,7 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n// Angular\r\n__webpack_require__(8);\r\n__webpack_require__(242);\r\n__webpack_require__(0);\r\n__webpack_require__(21);\r\n__webpack_require__(98);\r\n__webpack_require__(66);\r\n// Angular translations (i18n)\r\n__webpack_require__(22);\r\n__webpack_require__(251);\r\n// RxJS - Do not import here as a whole, since we only use very limited functionality\r\n// and UglifyJs' tree shaking does not remove all dead code\r\n// import 'rxjs';\r\n// Other vendors for example jQuery, Lodash or Bootstrap\r\n// You can import js, ts, css, sass, ...\r\n__webpack_require__(535);\r\n__webpack_require__(34);\r\n__webpack_require__(301);\r\n__webpack_require__(184);\r\n__webpack_require__(100);\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL3ZlbmRvci50cz84MjE0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIEFuZ3VsYXJcbmltcG9ydCAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XG5pbXBvcnQgJ0Bhbmd1bGFyL3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYyc7XG5pbXBvcnQgJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0ICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0ICdAYW5ndWxhci9jb21tb24vaHR0cCc7XG5pbXBvcnQgJ0Bhbmd1bGFyL3JvdXRlcic7XG5cbi8vIEFuZ3VsYXIgdHJhbnNsYXRpb25zIChpMThuKVxuaW1wb3J0ICdAbmd4LXRyYW5zbGF0ZS9jb3JlJztcbmltcG9ydCAnQG5neC10cmFuc2xhdGUvaHR0cC1sb2FkZXInO1xuXG4vLyBSeEpTIC0gRG8gbm90IGltcG9ydCBoZXJlIGFzIGEgd2hvbGUsIHNpbmNlIHdlIG9ubHkgdXNlIHZlcnkgbGltaXRlZCBmdW5jdGlvbmFsaXR5XG4vLyBhbmQgVWdsaWZ5SnMnIHRyZWUgc2hha2luZyBkb2VzIG5vdCByZW1vdmUgYWxsIGRlYWQgY29kZVxuLy8gaW1wb3J0ICdyeGpzJztcblxuLy8gT3RoZXIgdmVuZG9ycyBmb3IgZXhhbXBsZSBqUXVlcnksIExvZGFzaCBvciBCb290c3RyYXBcbi8vIFlvdSBjYW4gaW1wb3J0IGpzLCB0cywgY3NzLCBzYXNzLCAuLi5cblxuaW1wb3J0ICdqcXVlcnkvZGlzdC9qcXVlcnkuanMnO1xuaW1wb3J0ICdAbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcCc7XG5pbXBvcnQgJ2FuZ3VsYXIyLXV1aWQnO1xuaW1wb3J0ICdhbmd1bGFyLXNwbGl0JztcbmltcG9ydCAnbmcyLWRyYWd1bGEnO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIG5vZGVfbW9kdWxlcy9hbmd1bGFyMi10ZW1wbGF0ZS1sb2FkZXIhLi9zcmMvdmVuZG9yLnRzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///497\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n// Angular\r\n__webpack_require__(8);\r\n__webpack_require__(242);\r\n__webpack_require__(0);\r\n__webpack_require__(18);\r\n__webpack_require__(98);\r\n__webpack_require__(66);\r\n// Angular translations (i18n)\r\n__webpack_require__(22);\r\n__webpack_require__(251);\r\n// RxJS - Do not import here as a whole, since we only use very limited functionality\r\n// and UglifyJs' tree shaking does not remove all dead code\r\n// import 'rxjs';\r\n// Other vendors for example jQuery, Lodash or Bootstrap\r\n// You can import js, ts, css, sass, ...\r\n__webpack_require__(535);\r\n__webpack_require__(34);\r\n__webpack_require__(301);\r\n__webpack_require__(184);\r\n__webpack_require__(100);\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL3ZlbmRvci50cz84MjE0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIEFuZ3VsYXJcbm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uZG9yLnRzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///497\n"); /***/ }), /* 498 */ @@ -1601,7 +1601,7 @@ eval("\nvar __extends = (this && this.__extends) || function (d, b) {\n for ( /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerKeyMapService; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__datepicker_service__ = __webpack_require__(171);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(18);\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"Enter\"] = 13] = \"Enter\";\n Key[Key[\"Space\"] = 32] = \"Space\";\n Key[Key[\"PageUp\"] = 33] = \"PageUp\";\n Key[Key[\"PageDown\"] = 34] = \"PageDown\";\n Key[Key[\"End\"] = 35] = \"End\";\n Key[Key[\"Home\"] = 36] = \"Home\";\n Key[Key[\"ArrowLeft\"] = 37] = \"ArrowLeft\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowRight\"] = 39] = \"ArrowRight\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NgbDatepickerKeyMapService = (function () {\n function NgbDatepickerKeyMapService(_service, _calendar) {\n var _this = this;\n this._service = _service;\n this._calendar = _calendar;\n _service.model$.subscribe(function (model) {\n _this._minDate = model.minDate;\n _this._maxDate = model.maxDate;\n _this._firstViewDate = model.firstDate;\n _this._lastViewDate = model.lastDate;\n });\n }\n NgbDatepickerKeyMapService.prototype.processKey = function (event) {\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"i\" /* toString */])(event.which)]) {\n switch (event.which) {\n case Key.PageUp:\n this._service.focusMove(event.shiftKey ? 'y' : 'm', -1);\n break;\n case Key.PageDown:\n this._service.focusMove(event.shiftKey ? 'y' : 'm', 1);\n break;\n case Key.End:\n this._service.focus(event.shiftKey ? this._maxDate : this._lastViewDate);\n break;\n case Key.Home:\n this._service.focus(event.shiftKey ? this._minDate : this._firstViewDate);\n break;\n case Key.ArrowLeft:\n this._service.focusMove('d', -1);\n break;\n case Key.ArrowUp:\n this._service.focusMove('d', -this._calendar.getDaysPerWeek());\n break;\n case Key.ArrowRight:\n this._service.focusMove('d', 1);\n break;\n case Key.ArrowDown:\n this._service.focusMove('d', this._calendar.getDaysPerWeek());\n break;\n case Key.Enter:\n case Key.Space:\n this._service.focusSelect();\n break;\n default:\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n }\n };\n NgbDatepickerKeyMapService.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbDatepickerKeyMapService.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n return NgbDatepickerKeyMapService;\n}());\n\n//# sourceMappingURL=datepicker-keymap-service.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwa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4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVuZDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VydmljZS5mb2N1cyhldmVudC5zaGlmdEtleSA/IHRoaXMuX21heERhdGUgOiB0aGlzLl9sYXN0Vmlld0RhdGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5Ib21lOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzKGV2ZW50LnNoaWZ0S2V5ID8gdGhpcy5fbWluRGF0ZSA6IHRoaXMuX2ZpcnN0Vmlld0RhdGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5BcnJvd0xlZnQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlcnZpY2UuZm9jdXNNb3ZlKCdkJywgLTEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5BcnJvd1VwOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzTW92ZSgnZCcsIC10aGlzLl9jYWxlbmRhci5nZXREYXlzUGVyV2VlaygpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dSaWdodDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VydmljZS5mb2N1c01vdmUoJ2QnLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dEb3duOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzTW92ZSgnZCcsIHRoaXMuX2NhbGVuZGFyLmdldERheXNQZXJXZWVrKCkpO1xuICAgICAgICAgICAgICAgICAgICBicmVh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ZXJ2aWNlLmpzXG4vLyBtb2R1bGUgaWQgPSA1Mzhcbi8vIG1vZHVsZSBjaHVua3MgPSAyIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///538\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbDatepickerKeyMapService; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__datepicker_service__ = __webpack_require__(171);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(19);\n\n\n\n\nvar Key;\n(function (Key) {\n Key[Key[\"Enter\"] = 13] = \"Enter\";\n Key[Key[\"Space\"] = 32] = \"Space\";\n Key[Key[\"PageUp\"] = 33] = \"PageUp\";\n Key[Key[\"PageDown\"] = 34] = \"PageDown\";\n Key[Key[\"End\"] = 35] = \"End\";\n Key[Key[\"Home\"] = 36] = \"Home\";\n Key[Key[\"ArrowLeft\"] = 37] = \"ArrowLeft\";\n Key[Key[\"ArrowUp\"] = 38] = \"ArrowUp\";\n Key[Key[\"ArrowRight\"] = 39] = \"ArrowRight\";\n Key[Key[\"ArrowDown\"] = 40] = \"ArrowDown\";\n})(Key || (Key = {}));\nvar NgbDatepickerKeyMapService = (function () {\n function NgbDatepickerKeyMapService(_service, _calendar) {\n var _this = this;\n this._service = _service;\n this._calendar = _calendar;\n _service.model$.subscribe(function (model) {\n _this._minDate = model.minDate;\n _this._maxDate = model.maxDate;\n _this._firstViewDate = model.firstDate;\n _this._lastViewDate = model.lastDate;\n });\n }\n NgbDatepickerKeyMapService.prototype.processKey = function (event) {\n if (Key[Object(__WEBPACK_IMPORTED_MODULE_3__util_util__[\"i\" /* toString */])(event.which)]) {\n switch (event.which) {\n case Key.PageUp:\n this._service.focusMove(event.shiftKey ? 'y' : 'm', -1);\n break;\n case Key.PageDown:\n this._service.focusMove(event.shiftKey ? 'y' : 'm', 1);\n break;\n case Key.End:\n this._service.focus(event.shiftKey ? this._maxDate : this._lastViewDate);\n break;\n case Key.Home:\n this._service.focus(event.shiftKey ? this._minDate : this._firstViewDate);\n break;\n case Key.ArrowLeft:\n this._service.focusMove('d', -1);\n break;\n case Key.ArrowUp:\n this._service.focusMove('d', -this._calendar.getDaysPerWeek());\n break;\n case Key.ArrowRight:\n this._service.focusMove('d', 1);\n break;\n case Key.ArrowDown:\n this._service.focusMove('d', this._calendar.getDaysPerWeek());\n break;\n case Key.Enter:\n case Key.Space:\n this._service.focusSelect();\n break;\n default:\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n }\n };\n NgbDatepickerKeyMapService.decorators = [\n { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__[\"Injectable\"] },\n ];\n /** @nocollapse */\n NgbDatepickerKeyMapService.ctorParameters = function () { return [\n { type: __WEBPACK_IMPORTED_MODULE_1__datepicker_service__[\"a\" /* NgbDatepickerService */], },\n { type: __WEBPACK_IMPORTED_MODULE_2__ngb_calendar__[\"a\" /* NgbCalendar */], },\n ]; };\n return NgbDatepickerKeyMapService;\n}());\n\n//# sourceMappingURL=datepicker-keymap-service.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1rZXltYXAtc2VydmljZS5qcz81YzM4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE5nYkRhdGVwaWNrZXJTZXJ2aWNlIH0gZnJvbSAnLi9kYXRlcGlja2VyLXNlcnZpY2UnO1xuaW1wb3J0IHsgTmdiQ2FsZW5kYXIgfSBmcm9tICcuL25nYi1jYWxlbmRhcic7XG5pbXBvcnQgeyB0b1N0cmluZyB9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG52YXIgS2V5O1xuKGZ1bmN0aW9uIChLZXkpIHtcbiAgICBLZXlbS2V5W1wiRW50ZXJcIl0gPSAxM10gPSBcIkVudGVyXCI7XG4gICAgS2V5W0tleVtcIlNwYWNlXCJdID0gMzJdID0gXCJTcGFjZVwiO1xuICAgIEtleVtLZXlbXCJQYWdlVXBcIl0gPSAzM10gPSBcIlBhZ2VVcFwiO1xuICAgIEtleVtLZXlbXCJQYWdlRG93blwiXSA9IDM0XSA9IFwiUGFnZURvd25cIjtcbiAgICBLZXlbS2V5W1wiRW5kXCJdID0gMz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VudCkge1xuICAgICAgICBpZiAoS2V5W3RvU3RyaW5nKGV2ZW50LndoaWNoKV0pIHtcbiAgICAgICAgICAgIHN3aXRjaCAoZXZlbnQud2hpY2gpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5QYWdlVXA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlcnZpY2UuZm9jdXNNb3ZlKGV2ZW50LnNoaWZ0S2V5ID8gJ3knIDogJ20nLCAtMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LlBhZ2VEb3duOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzTW92ZShldmVudC5zaGlmdEtleSA/ICd5JyA6ICdtJywgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgS2V5LkVuZDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VydmljZS5mb2N1cyhldmVudC5zaGlmdEtleSA/IHRoaXMuX21heERhdGUgOiB0aGlzLl9sYXN0Vmlld0RhdGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5Ib21lOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzKGV2ZW50LnNoaWZ0S2V5ID8gdGhpcy5fbWluRGF0ZSA6IHRoaXMuX2ZpcnN0Vmlld0RhdGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5BcnJvd0xlZnQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlcnZpY2UuZm9jdXNNb3ZlKCdkJywgLTEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5BcnJvd1VwOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzTW92ZSgnZCcsIC10aGlzLl9jYWxlbmRhci5nZXREYXlzUGVyV2VlaygpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dSaWdodDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VydmljZS5mb2N1c01vdmUoJ2QnLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBLZXkuQXJyb3dEb3duOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXJ2aWNlLmZvY3VzTW92ZSgnZCcsIHRoaXMuX2NhbGVuZGFyLmdldERheXNQZXJXZWVrKCkpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5FbnRlcjpcbiAgICAgICAgICAgICAgICBjYXNlIEtleS5TcGFjZTpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VydmljZS5mb2N1c1NlbGVjdCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE5nYkRhdGVwaWNrZXJLZXlNYXBTZXJ2aWNlLmRlY29yYXRvcnMgPSBbXG4gICAgICAgIHsgdHlwZTogSW5qZWN0YWJsZSB9LFxuICAgIF07XG4gICAgLyoqIEBub2NvbGxhcHNlICovXG4gICAgTmdiRGF0ZXBpY2tlcktleU1hcFNlcnZpY2UuY3RvclBhcmFtZXRlcnMgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBbXG4gICAgICAgIHsgdHlwZTogTmdiRGF0ZXBpY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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///538\n"); /***/ }), /* 539 */ @@ -1615,7 +1615,7 @@ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTime; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(18);\n\nvar NgbTime = (function () {\n function NgbTime(hour, minute, second) {\n this.hour = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(hour);\n this.minute = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(minute);\n this.second = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(second);\n }\n NgbTime.prototype.changeHour = function (step) {\n if (step === void 0) { step = 1; }\n this.updateHour((isNaN(this.hour) ? 0 : this.hour) + step);\n };\n NgbTime.prototype.updateHour = function (hour) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(hour)) {\n this.hour = (hour < 0 ? 24 + hour : hour) % 24;\n }\n else {\n this.hour = NaN;\n }\n };\n NgbTime.prototype.changeMinute = function (step) {\n if (step === void 0) { step = 1; }\n this.updateMinute((isNaN(this.minute) ? 0 : this.minute) + step);\n };\n NgbTime.prototype.updateMinute = function (minute) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(minute)) {\n this.minute = minute % 60 < 0 ? 60 + minute % 60 : minute % 60;\n this.changeHour(Math.floor(minute / 60));\n }\n else {\n this.minute = NaN;\n }\n };\n NgbTime.prototype.changeSecond = function (step) {\n if (step === void 0) { step = 1; }\n this.updateSecond((isNaN(this.second) ? 0 : this.second) + step);\n };\n NgbTime.prototype.updateSecond = function (second) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(second)) {\n this.second = second < 0 ? 60 + second % 60 : second % 60;\n this.changeMinute(Math.floor(second / 60));\n }\n else {\n this.second = NaN;\n }\n };\n NgbTime.prototype.isValid = function (checkSecs) {\n if (checkSecs === void 0) { checkSecs = true; }\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.hour) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.minute) && (checkSecs ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.second) : true);\n };\n NgbTime.prototype.toString = function () { return (this.hour || 0) + \":\" + (this.minute || 0) + \":\" + (this.second || 0); };\n return NgbTime;\n}());\n\n//# sourceMappingURL=ngb-time.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvbmdiLXRpbWUuanM/ODU0NCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBpc051bWJlciwgdG9JbnRlZ2VyIH0gZnJvbSAnLi4vdXRpbC91dGlsJztcbnZhciBOZ2JUaW1lID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JUaW1lKGhvdXIsIG1pbnV0ZSwgc2Vjb25kKSB7XG4gICAgICAgIHRoaXMuaG91ciA9IHRvSW50ZWdlcihob3VyKTtcbiAgICAgICAgdGhpcy5taW51dGUgPSB0b0ludGVnZXIobWludXRlKTtcbiAgICAgICAgdGhpcy5zZWNvbmQgPSB0b0ludGVnZXIoc2Vjb25kKTtcbiAgICB9XG4gICAgTmdiVGltZS5wcm90b3R5cGUuY2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IgKyAodGhpcy5zZWNvbmQgfHwgMCk7IH07XG4gICAgcmV0dXJuIE5nYlRpbWU7XG59KCkpO1xuZXhwb3J0IHsgTmdiVGltZSB9O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9bmdiLXRpbWUuanMubWFwXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvdGltZXBpY2tlci9uZ2ItdGltZS5qc1xuLy8gbW9kdWxlIGlkID0gNTQwXG4vLyBtb2R1bGUgY2h1bmtzID0gMiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///540\n"); +eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return NgbTime; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(19);\n\nvar NgbTime = (function () {\n function NgbTime(hour, minute, second) {\n this.hour = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(hour);\n this.minute = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(minute);\n this.second = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"h\" /* toInteger */])(second);\n }\n NgbTime.prototype.changeHour = function (step) {\n if (step === void 0) { step = 1; }\n this.updateHour((isNaN(this.hour) ? 0 : this.hour) + step);\n };\n NgbTime.prototype.updateHour = function (hour) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(hour)) {\n this.hour = (hour < 0 ? 24 + hour : hour) % 24;\n }\n else {\n this.hour = NaN;\n }\n };\n NgbTime.prototype.changeMinute = function (step) {\n if (step === void 0) { step = 1; }\n this.updateMinute((isNaN(this.minute) ? 0 : this.minute) + step);\n };\n NgbTime.prototype.updateMinute = function (minute) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(minute)) {\n this.minute = minute % 60 < 0 ? 60 + minute % 60 : minute % 60;\n this.changeHour(Math.floor(minute / 60));\n }\n else {\n this.minute = NaN;\n }\n };\n NgbTime.prototype.changeSecond = function (step) {\n if (step === void 0) { step = 1; }\n this.updateSecond((isNaN(this.second) ? 0 : this.second) + step);\n };\n NgbTime.prototype.updateSecond = function (second) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(second)) {\n this.second = second < 0 ? 60 + second % 60 : second % 60;\n this.changeMinute(Math.floor(second / 60));\n }\n else {\n this.second = NaN;\n }\n };\n NgbTime.prototype.isValid = function (checkSecs) {\n if (checkSecs === void 0) { checkSecs = true; }\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.hour) && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.minute) && (checkSecs ? Object(__WEBPACK_IMPORTED_MODULE_0__util_util__[\"d\" /* isNumber */])(this.second) : true);\n };\n NgbTime.prototype.toString = function () { return (this.hour || 0) + \":\" + (this.minute || 0) + \":\" + (this.second || 0); };\n return NgbTime;\n}());\n\n//# sourceMappingURL=ngb-time.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL0BuZy1ib290c3RyYXAvbmctYm9vdHN0cmFwL3RpbWVwaWNrZXIvbmdiLXRpbWUuanM/ODU0NCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBpc051bWJlciwgdG9JbnRlZ2VyIH0gZnJvbSAnLi4vdXRpbC91dGlsJztcbnZhciBOZ2JUaW1lID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBOZ2JUaW1lKGhvdXIsIG1pbnV0ZSwgc2Vjb25kKSB7XG4gICAgICAgIHRoaXMuaG91ciA9IHRvSW50ZWdlcihob3VyKTtcbiAgICAgICAgdGhpcy5taW51dGUgPSB0b0ludGVnZXIobWludXRlKTtcbiAgICAgICAgdGhpcy5zZWNvbmQgPSB0b0ludGVnZXIoc2Vjb25kKTtcbiAgICB9XG4gICAgTmdiVGltZS5wcm90b3R5cGUuY2hhbmdlSG91ciA9IGZ1bmN0aW9uIChzdGVwKSB7XG4gICAgICAgIGlmIChzdGVwID09PSB2b2lkIDApIHsgc3RlcCA9IDE7IH1cbiAgICAgICAgdGhpcy51cGRhdGVIb3VyKChpc05hTih0aGlzLmhvdXIpID8gMCA6IHRoaXMuaG91cikgKyBzdGVwKTtcbiAgICB9O1xuICAgIE5nYlRpbWUucHJvdG90eXBlLnVwZGF0ZUhvdXIgPSBmdW5jdGlvbiAoaG91cikge1xuICAgICAgICBpZiAoaXNOdW1iZXIoaG91cikpIHtcbiAgICAgICAgICAgIHRoaXMuaG91ciA9IChob3VyIDwgMCA/IDI0ICsgaG91ciA6IGhvdXIpICUgMjQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmhvdXIgPSBOYU47XG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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///540\n"); /***/ }), /* 541 */ diff --git a/web/src/app/modules/navigation/modules/navigator/services/navigator.service.ts b/web/src/app/modules/navigation/modules/navigator/services/navigator.service.ts index d97b98fac..e1c89e9d9 100644 --- a/web/src/app/modules/navigation/modules/navigator/services/navigator.service.ts +++ b/web/src/app/modules/navigation/modules/navigator/services/navigator.service.ts @@ -3,8 +3,9 @@ import { Injectable, EventEmitter } from '@angular/core'; import { IContainer } from '../../../../../model/IContainer'; import { SpecmateDataService } from '../../../../data/modules/data-service/services/specmate-data.service'; import { LoggingService } from '../../../../views/side/modules/log-list/services/logging.service'; -import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'; +import { Router, NavigationEnd } from '@angular/router'; import { Url } from '../../../../../util/url'; +import { Location } from '@angular/common'; @Injectable() export class NavigatorService { @@ -18,20 +19,22 @@ export class NavigatorService { private dataService: SpecmateDataService, private logger: LoggingService, private router: Router, - private route: ActivatedRoute) { + private location: Location) { + + this.location.subscribe(pse => { + this.handleBrowserBackForwardButton(Url.stripBasePath(pse.url)); + }); let subscription: Subscription = this.router.events.subscribe((event) => { - if (event instanceof NavigationEnd && !this.hasHistory) { - if (!this.route.snapshot.children[0] || !Url.fromParams(this.route.snapshot.children[0].params)) { - return; - } - let currentUrl: string = Url.fromParams(this.route.snapshot.children[0].params); + if (event instanceof NavigationEnd && this.location.path()) { + let currentUrl: string = Url.stripBasePath(this.location.path()); this.dataService.readElement(currentUrl, true) .then((element: IContainer) => { if (element) { - this.current = 0; - this.history[this.current] = element; - subscription.unsubscribe(); + if (!this.hasHistory) { + this.current = 0; + this.history[this.current] = element; + } return Promise.resolve(); } return Promise.reject('Could not load element: ' + currentUrl); @@ -83,10 +86,21 @@ export class NavigatorService { return Promise.resolve(); } return Promise.reject('Navigation was not performed'); - }) - .then(() => this.dataService.readContents(this.currentElement.url, true)) - .then((contents: IContainer[]) => this._currentContents = contents) - .then(() => this.hasNavigated.emit(this.currentElement)); + }); + } + + private handleBrowserBackForwardButton(navigatedTo: String): void { + let previous: IContainer = this.previousElement; + let next: IContainer = this.nextElement; + + if (previous && navigatedTo == previous.url) { + this.current -= 1; + } else if (next && navigatedTo == next.url) { + this.current += 1; + } + + this.dataService.discardChanges(); + this.dataService.clearCommits(); } public get currentElement(): IContainer { diff --git a/web/src/app/util/url.ts b/web/src/app/util/url.ts index c2b966694..5453b629a 100644 --- a/web/src/app/util/url.ts +++ b/web/src/app/util/url.ts @@ -9,6 +9,14 @@ export class Url { return Config.VIEW_URL_PREFIX + cls.className; } + public static stripBasePath(path: string): string { + // Expected input: /-/basepath/url%2Fmorestuff + // Output: url/morestuff + path = decodeURIComponent(path); + path = path.slice(Config.VIEW_URL_PREFIX.length); + return path.slice(path.indexOf(this.SEP, path.indexOf(this.SEP) + 1) + 1); + } + public static parent(url: string): string { let parts: string[] = url.split(Url.SEP); parts.splice(parts.length - 1, 1);