From 5cf44146ec9e493c81831437973fe9b7caae1d65 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sat, 23 Nov 2024 10:12:18 -0500 Subject: [PATCH 01/18] feature #79 - add recording support --- README.md | 25 ++++++++++ .../geb/ContainerGebConfiguration.groovy | 44 +++++++++++++++++ .../geb/ContainerGebRecordingExtension.groovy | 47 +++++++++++++++++++ .../grails/plugin/geb/ContainerGebSpec.groovy | 14 ++---- .../geb/ContainerGebTestDescription.groovy | 19 ++++++++ .../geb/ContainerGebTestListener.groovy | 32 +++++++++++++ ...amework.runtime.extension.IGlobalExtension | 1 + 7 files changed, 172 insertions(+), 10 deletions(-) create mode 100644 src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy create mode 100644 src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy create mode 100644 src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy create mode 100644 src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy create mode 100644 src/testFixtures/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension diff --git a/README.md b/README.md index 5db4161..df53bad 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,31 @@ This requires a [compatible container runtime](https://java.testcontainers.org/s If you choose to use the `ContainerGebSpec` class, as long as you have a compatible container runtime installed, you don't need to do anything else. Just run `./gradlew integrationTest` and a container will be started and configured to start a browser that can access your application under test. +#### Recording +By default, all failed tests will generate a video recording of the test execution. These recordings are saved to a `recordings` directory under the project's `build` directory. + +The following system properties can be change to configure the recording behavior: +* `grails.geb.recording.enabled` + * purpose: toggle for recording + * possible values: `true` or `false` + + +* `grails.geb.recording.directory` + * purpose: the directory to save the recordings relative to the project directory + * defaults to `build/recordings` + + +* `grails.geb.recording.mode` + * purpose: which tests to record via the enum `VncRecordingMode` + * possible values: `RECORD_ALL` or `RECORD_FAILING` + * defaults to `RECORD_FAILING` + + +* `grails.geb.recording.format` + * purpose: sets the format of the recording + * possible values are `FLV` or `MP4` + * defaults to `MP4` + ### GebSpec If you choose to extend `GebSpec`, you will need to have a [Selenium WebDriver](https://www.selenium.dev/documentation/webdriver/browsers/) installed that matches a browser you have installed on your system. diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy new file mode 100644 index 0000000..5cc1581 --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy @@ -0,0 +1,44 @@ +package grails.plugin.geb + +import groovy.transform.CompileStatic +import groovy.transform.Memoized +import groovy.util.logging.Slf4j +import org.testcontainers.containers.BrowserWebDriverContainer +import org.testcontainers.containers.VncRecordingContainer + +@Slf4j +@CompileStatic +class ContainerGebConfiguration { + String recordingDirectoryName + + boolean recording + + BrowserWebDriverContainer.VncRecordingMode recordingMode + + VncRecordingContainer.VncRecordingFormat recordingFormat + + ContainerGebConfiguration() { + recording = Boolean.parseBoolean(System.getProperty('grails.geb.recording.enabled', true as String)) + recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') + recordingMode = BrowserWebDriverContainer.VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING.name())) + recordingFormat = VncRecordingContainer.VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', VncRecordingContainer.VncRecordingFormat.MP4.name())) + } + + @Memoized + File getRecordingDirectory() { + if(!recording) { + return null + } + + File recordingDirectory = new File(recordingDirectoryName) + if(!recordingDirectory.exists()) { + log.info("Could not find `${recordingDirectoryName}` directory for recording. Creating...") + recordingDirectory.mkdir() + } + else if(!recordingDirectory.isDirectory()) { + throw new IllegalStateException("Recording Directory name expected to be `${recordingDirectoryName}, but found file instead.") + } + + recordingDirectory + } +} diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy new file mode 100644 index 0000000..2c60b9d --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -0,0 +1,47 @@ +package grails.plugin.geb + +import groovy.transform.TailRecursive +import groovy.util.logging.Slf4j +import org.spockframework.runtime.extension.IGlobalExtension +import org.spockframework.runtime.model.SpecInfo + +import java.time.LocalDateTime + +@Slf4j +class ContainerGebRecordingExtension implements IGlobalExtension { + ContainerGebConfiguration configuration + + @Override + void start() { + configuration = new ContainerGebConfiguration() + } + + @Override + void visitSpec(SpecInfo spec) { + if (isContainerizedGebSpec(spec)) { + ContainerGebTestListener listener = new ContainerGebTestListener(spec, LocalDateTime.now()) + // TODO: We should initialize the web driver container once for all geb tests so we don't have to spin it up & down. + spec.addSetupInterceptor { + ContainerGebSpec gebSpec = it.instance as ContainerGebSpec + gebSpec.initialize() + if(configuration.recording) { + listener.webDriverContainer = gebSpec.webDriverContainer.withRecordingMode(configuration.recordingMode, configuration.recordingDirectory, configuration.recordingFormat) + } + } + + spec.addListener(listener) + } + } + + @TailRecursive + boolean isContainerizedGebSpec(SpecInfo spec) { + if(spec != null) { + if(spec.filename.startsWith('ContainerGebSpec.')) { + return true + } + + return isContainerizedGebSpec(spec.superSpec) + } + return false + } +} diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index 82a927d..b0ddd54 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -72,6 +72,10 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, @PackageScope void initialize() { + if(webDriverContainer) { + return + } + webDriverContainer = new BrowserWebDriverContainer() Testcontainers.exposeHostPorts(port) webDriverContainer.tap { @@ -85,12 +89,6 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, WebDriver driver = new RemoteWebDriver(webDriverContainer.seleniumAddress, new ChromeOptions()) driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)) browser.driver = driver - } - - void setup() { - if (notInitialized) { - initialize() - } browser.baseUrl = "$protocol://$hostName:$port" } @@ -164,8 +162,4 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, private boolean isHostNameChanged() { return hostNameFromContainer != DEFAULT_HOSTNAME_FROM_CONTAINER } - - private boolean isNotInitialized() { - webDriverContainer == null - } } \ No newline at end of file diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy new file mode 100644 index 0000000..214d9a8 --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy @@ -0,0 +1,19 @@ +package grails.plugin.geb + +import org.spockframework.runtime.model.IterationInfo +import org.testcontainers.lifecycle.TestDescription + +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class ContainerGebTestDescription implements TestDescription { + String testId + String filesystemFriendlyName + + ContainerGebTestDescription(IterationInfo testInfo, LocalDateTime runDate) { + testId = testInfo.displayName + + String safeName = testId.replaceAll("\\W+", "") + filesystemFriendlyName = "${DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss").format(runDate)}_${safeName}" + } +} diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy new file mode 100644 index 0000000..9cb01db --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy @@ -0,0 +1,32 @@ +package grails.plugin.geb + +import org.spockframework.runtime.AbstractRunListener +import org.spockframework.runtime.model.ErrorInfo +import org.spockframework.runtime.model.IterationInfo +import org.spockframework.runtime.model.SpecInfo +import org.testcontainers.containers.BrowserWebDriverContainer + +import java.time.LocalDateTime + +class ContainerGebTestListener extends AbstractRunListener { + BrowserWebDriverContainer webDriverContainer + ErrorInfo errorInfo + SpecInfo spec + LocalDateTime runDate + + ContainerGebTestListener(SpecInfo spec, LocalDateTime runDate) { + this.spec = spec + this.runDate = runDate + } + + @Override + void afterIteration(IterationInfo iteration) { + webDriverContainer.afterTest(new ContainerGebTestDescription(iteration, runDate), Optional.of(errorInfo?.exception)) + errorInfo = null + } + + @Override + void error(ErrorInfo error) { + errorInfo = error + } +} \ No newline at end of file diff --git a/src/testFixtures/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension b/src/testFixtures/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension new file mode 100644 index 0000000..893fab6 --- /dev/null +++ b/src/testFixtures/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension @@ -0,0 +1 @@ +grails.plugin.geb.ContainerGebRecordingExtension \ No newline at end of file From 7f5593333aceea2f0f174f46b9f3a3aee4fb04c1 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sat, 23 Nov 2024 10:23:20 -0500 Subject: [PATCH 02/18] cleanup - compilestatic, license, and documentation --- .../geb/ContainerGebConfiguration.groovy | 22 ++++++++++++++++ .../geb/ContainerGebRecordingExtension.groovy | 23 ++++++++++++++++ .../geb/ContainerGebTestDescription.groovy | 25 ++++++++++++++++++ .../geb/ContainerGebTestListener.groovy | 26 +++++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy index 5cc1581..7f1a33b 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy @@ -1,11 +1,33 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package grails.plugin.geb import groovy.transform.CompileStatic import groovy.transform.Memoized +import groovy.transform.PackageScope import groovy.util.logging.Slf4j import org.testcontainers.containers.BrowserWebDriverContainer import org.testcontainers.containers.VncRecordingContainer +/** + * A container class to parse the configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} + * + * @author James Daugherty + * @since 5.0.0 + */ @Slf4j @CompileStatic class ContainerGebConfiguration { diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 2c60b9d..7c29ce7 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -1,5 +1,21 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package grails.plugin.geb +import groovy.transform.CompileStatic import groovy.transform.TailRecursive import groovy.util.logging.Slf4j import org.spockframework.runtime.extension.IGlobalExtension @@ -7,7 +23,14 @@ import org.spockframework.runtime.model.SpecInfo import java.time.LocalDateTime +/** + * A Spock Extension that manages the Testcontainers lifecycle for a {@link grails.plugin.geb.ContainerGebSpec} + * + * @author James Daugherty + * @since 5.0.0 + */ @Slf4j +@CompileStatic class ContainerGebRecordingExtension implements IGlobalExtension { ContainerGebConfiguration configuration diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy index 214d9a8..ea1b8d4 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy @@ -1,11 +1,36 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package grails.plugin.geb +import groovy.transform.CompileStatic import org.spockframework.runtime.model.IterationInfo import org.testcontainers.lifecycle.TestDescription import java.time.LocalDateTime import java.time.format.DateTimeFormatter +/** + * Implements {@link org.testcontainers.lifecycle.TestDescription} to customize recording names. + * + * @see org.testcontainers.lifecycle.TestDescription + * + * @author James Daugherty + * @since 5.0 + */ +@CompileStatic class ContainerGebTestDescription implements TestDescription { String testId String filesystemFriendlyName diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy index 9cb01db..b9fed69 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy @@ -1,5 +1,21 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package grails.plugin.geb +import groovy.transform.CompileStatic import org.spockframework.runtime.AbstractRunListener import org.spockframework.runtime.model.ErrorInfo import org.spockframework.runtime.model.IterationInfo @@ -8,6 +24,16 @@ import org.testcontainers.containers.BrowserWebDriverContainer import java.time.LocalDateTime +/** + * A test listener that reports the test result to {@link org.testcontainers.containers.BrowserWebDriverContainer} so + * that recordings may be saved. + * + * @see org.testcontainers.containers.BrowserWebDriverContainer#afterTest + * + * @author James Daugherty + * @since 5.0 + */ +@CompileStatic class ContainerGebTestListener extends AbstractRunListener { BrowserWebDriverContainer webDriverContainer ErrorInfo errorInfo From 5d77412e18162da41a92258022cba78fd9884e56 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sat, 23 Nov 2024 10:23:53 -0500 Subject: [PATCH 03/18] Move webDriverContainer stop to extension --- .../grails/plugin/geb/ContainerGebRecordingExtension.groovy | 6 +++++- .../groovy/grails/plugin/geb/ContainerGebSpec.groovy | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 7c29ce7..83c937c 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -51,13 +51,17 @@ class ContainerGebRecordingExtension implements IGlobalExtension { listener.webDriverContainer = gebSpec.webDriverContainer.withRecordingMode(configuration.recordingMode, configuration.recordingDirectory, configuration.recordingFormat) } } + spec.addCleanupInterceptor { + ContainerGebSpec gebSpec = it.instance as ContainerGebSpec + gebSpec.container?.stop() + } spec.addListener(listener) } } @TailRecursive - boolean isContainerizedGebSpec(SpecInfo spec) { + private boolean isContainerizedGebSpec(SpecInfo spec) { if(spec != null) { if(spec.filename.startsWith('ContainerGebSpec.')) { return true diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index b0ddd54..208a719 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -92,10 +92,6 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, browser.baseUrl = "$protocol://$hostName:$port" } - def cleanupSpec() { - webDriverContainer?.stop() - } - /** * Get access to container running the web-driver, for convenience to execInContainer, copyFileToContainer etc. * From fdc7f20e17369d6b644764059ce308d9c4820a9b Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 11:08:54 -0500 Subject: [PATCH 04/18] feedback - formating, use existing enum instead of recording flag, and clean-up --- README.md | 14 ++++------- .../geb/ContainerAwareDownloadSupport.groovy | 3 ++- .../geb/ContainerGebConfiguration.groovy | 24 +++++++------------ .../geb/ContainerGebRecordingExtension.groovy | 23 +++++++++++------- .../grails/plugin/geb/ContainerGebSpec.groovy | 4 ++-- .../geb/ContainerGebTestDescription.groovy | 5 ++-- .../geb/ContainerGebTestListener.groovy | 12 ++++++---- 7 files changed, 42 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index df53bad..3997dcf 100644 --- a/README.md +++ b/README.md @@ -57,9 +57,11 @@ Just run `./gradlew integrationTest` and a container will be started and configu By default, all failed tests will generate a video recording of the test execution. These recordings are saved to a `recordings` directory under the project's `build` directory. The following system properties can be change to configure the recording behavior: -* `grails.geb.recording.enabled` - * purpose: toggle for recording - * possible values: `true` or `false` + +* `grails.geb.recording.mode` + * purpose: which tests to record + * possible values: `SKIP`, `RECORD_ALL`, or `RECORD_FAILING` + * defaults to `RECORD_FAILING` * `grails.geb.recording.directory` @@ -67,12 +69,6 @@ The following system properties can be change to configure the recording behavio * defaults to `build/recordings` -* `grails.geb.recording.mode` - * purpose: which tests to record via the enum `VncRecordingMode` - * possible values: `RECORD_ALL` or `RECORD_FAILING` - * defaults to `RECORD_FAILING` - - * `grails.geb.recording.format` * purpose: sets the format of the recording * possible values are `FLV` or `MP4` diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy index 3663d3d..407ddbe 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy @@ -35,7 +35,7 @@ import java.util.regex.Pattern * setups, ensuring the host network context is used for download requests.

* * @author Mattias Reichel - * @since 5.0.0 + * @since 5.0 */ @CompileStatic @SelfType(ContainerGebSpec) @@ -45,6 +45,7 @@ trait ContainerAwareDownloadSupport implements DownloadSupport { private final DownloadSupport downloadSupport = new LocalhostDownloadSupport(browser, this) abstract Browser getBrowser() + abstract String getHostNameFromHost() private static class LocalhostDownloadSupport extends DefaultDownloadSupport { diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy index 7f1a33b..a3afa2b 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy @@ -17,30 +17,25 @@ package grails.plugin.geb import groovy.transform.CompileStatic import groovy.transform.Memoized -import groovy.transform.PackageScope import groovy.util.logging.Slf4j import org.testcontainers.containers.BrowserWebDriverContainer import org.testcontainers.containers.VncRecordingContainer /** - * A container class to parse the configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} + * Handles parsing various configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} * * @author James Daugherty - * @since 5.0.0 + * @since 5.0 */ @Slf4j @CompileStatic class ContainerGebConfiguration { - String recordingDirectoryName - - boolean recording + String recordingDirectoryName BrowserWebDriverContainer.VncRecordingMode recordingMode - VncRecordingContainer.VncRecordingFormat recordingFormat ContainerGebConfiguration() { - recording = Boolean.parseBoolean(System.getProperty('grails.geb.recording.enabled', true as String)) recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') recordingMode = BrowserWebDriverContainer.VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING.name())) recordingFormat = VncRecordingContainer.VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', VncRecordingContainer.VncRecordingFormat.MP4.name())) @@ -48,19 +43,18 @@ class ContainerGebConfiguration { @Memoized File getRecordingDirectory() { - if(!recording) { + if (recordingMode == BrowserWebDriverContainer.VncRecordingMode.SKIP) { return null } File recordingDirectory = new File(recordingDirectoryName) - if(!recordingDirectory.exists()) { - log.info("Could not find `${recordingDirectoryName}` directory for recording. Creating...") - recordingDirectory.mkdir() - } - else if(!recordingDirectory.isDirectory()) { + if (!recordingDirectory.exists()) { + log.info("Could not find `{}` directory for recording. Creating...", recordingDirectoryName) + recordingDirectory.mkdirs() + } else if (!recordingDirectory.isDirectory()) { throw new IllegalStateException("Recording Directory name expected to be `${recordingDirectoryName}, but found file instead.") } - recordingDirectory + return recordingDirectory } } diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 83c937c..936c4fb 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -20,6 +20,7 @@ import groovy.transform.TailRecursive import groovy.util.logging.Slf4j import org.spockframework.runtime.extension.IGlobalExtension import org.spockframework.runtime.model.SpecInfo +import org.testcontainers.containers.BrowserWebDriverContainer import java.time.LocalDateTime @@ -27,7 +28,7 @@ import java.time.LocalDateTime * A Spock Extension that manages the Testcontainers lifecycle for a {@link grails.plugin.geb.ContainerGebSpec} * * @author James Daugherty - * @since 5.0.0 + * @since 5.0 */ @Slf4j @CompileStatic @@ -41,14 +42,19 @@ class ContainerGebRecordingExtension implements IGlobalExtension { @Override void visitSpec(SpecInfo spec) { - if (isContainerizedGebSpec(spec)) { + if (isContainerGebSpec(spec)) { ContainerGebTestListener listener = new ContainerGebTestListener(spec, LocalDateTime.now()) // TODO: We should initialize the web driver container once for all geb tests so we don't have to spin it up & down. spec.addSetupInterceptor { ContainerGebSpec gebSpec = it.instance as ContainerGebSpec gebSpec.initialize() - if(configuration.recording) { - listener.webDriverContainer = gebSpec.webDriverContainer.withRecordingMode(configuration.recordingMode, configuration.recordingDirectory, configuration.recordingFormat) + if (configuration.recordingMode != BrowserWebDriverContainer.VncRecordingMode.SKIP) { + listener.webDriverContainer = gebSpec.webDriverContainer + .withRecordingMode( + configuration.recordingMode, + configuration.recordingDirectory, + configuration.recordingFormat + ) } } spec.addCleanupInterceptor { @@ -61,13 +67,12 @@ class ContainerGebRecordingExtension implements IGlobalExtension { } @TailRecursive - private boolean isContainerizedGebSpec(SpecInfo spec) { - if(spec != null) { - if(spec.filename.startsWith('ContainerGebSpec.')) { + private boolean isContainerGebSpec(SpecInfo spec) { + if (spec != null) { + if (spec.filename.startsWith('ContainerGebSpec.')) { return true } - - return isContainerizedGebSpec(spec.superSpec) + return isContainerGebSpec(spec.superSpec) } return false } diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index 208a719..9eb0259 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -46,7 +46,7 @@ import java.time.Duration * * @author Søren Berg Glasius * @author Mattias Reichel - * @since 5.0.0 + * @since 5.0 */ @DynamicallyDispatchesToBrowser abstract class ContainerGebSpec extends Specification implements ManagedGebTest, ContainerAwareDownloadSupport { @@ -72,7 +72,7 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, @PackageScope void initialize() { - if(webDriverContainer) { + if (webDriverContainer) { return } diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy index ea1b8d4..0002123 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy @@ -26,19 +26,18 @@ import java.time.format.DateTimeFormatter * Implements {@link org.testcontainers.lifecycle.TestDescription} to customize recording names. * * @see org.testcontainers.lifecycle.TestDescription - * * @author James Daugherty * @since 5.0 */ @CompileStatic class ContainerGebTestDescription implements TestDescription { + String testId String filesystemFriendlyName ContainerGebTestDescription(IterationInfo testInfo, LocalDateTime runDate) { testId = testInfo.displayName - - String safeName = testId.replaceAll("\\W+", "") + String safeName = testId.replaceAll('\\W+', '_') filesystemFriendlyName = "${DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss").format(runDate)}_${safeName}" } } diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy index b9fed69..059b38b 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy @@ -35,10 +35,11 @@ import java.time.LocalDateTime */ @CompileStatic class ContainerGebTestListener extends AbstractRunListener { + BrowserWebDriverContainer webDriverContainer - ErrorInfo errorInfo - SpecInfo spec - LocalDateTime runDate + ErrorInfo errorInfo + SpecInfo spec + LocalDateTime runDate ContainerGebTestListener(SpecInfo spec, LocalDateTime runDate) { this.spec = spec @@ -47,7 +48,10 @@ class ContainerGebTestListener extends AbstractRunListener { @Override void afterIteration(IterationInfo iteration) { - webDriverContainer.afterTest(new ContainerGebTestDescription(iteration, runDate), Optional.of(errorInfo?.exception)) + webDriverContainer.afterTest( + new ContainerGebTestDescription(iteration, runDate), + Optional.ofNullable(errorInfo?.exception) + ) errorInfo = null } From 268b341fd06166a5f92150ea41454e5337142844 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 11:13:51 -0500 Subject: [PATCH 05/18] feedback - add back isInitialized helper --- .../groovy/grails/plugin/geb/ContainerGebSpec.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index 9eb0259..98dc535 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -72,7 +72,7 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, @PackageScope void initialize() { - if (webDriverContainer) { + if (initialized) { return } @@ -158,4 +158,8 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, private boolean isHostNameChanged() { return hostNameFromContainer != DEFAULT_HOSTNAME_FROM_CONTAINER } + + private boolean isInitialized() { + webDriverContainer == null + } } \ No newline at end of file From d7761da88e88d868b3918362e054a28724d3da43 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 13:04:22 -0500 Subject: [PATCH 06/18] Reduce the number of times the container is started across tests --- README.md | 4 + .../geb/ContainerGebConfiguration.groovy | 56 +++---- .../geb/ContainerGebRecordingExtension.groovy | 37 +++-- .../grails/plugin/geb/ContainerGebSpec.groovy | 79 +--------- .../geb/ContainerGebTestListener.groovy | 7 +- .../plugin/geb/RecordingSettings.groovy | 60 ++++++++ .../geb/WebDriverContainerHolder.groovy | 137 ++++++++++++++++++ 7 files changed, 252 insertions(+), 128 deletions(-) create mode 100644 src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy create mode 100644 src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy diff --git a/README.md b/README.md index 3997dcf..1d96537 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ This requires a [compatible container runtime](https://java.testcontainers.org/s If you choose to use the `ContainerGebSpec` class, as long as you have a compatible container runtime installed, you don't need to do anything else. Just run `./gradlew integrationTest` and a container will be started and configured to start a browser that can access your application under test. +#### Custom Host Configuration + +The annotation `ContainerGebConfiguration` exists to customize the connection the container will use to access the application under test. The annotation is not required and `ContainerGebSpec` will use the default values in this annotation if it's not present. + #### Recording By default, all failed tests will generate a video recording of the test execution. These recordings are saved to a `recordings` directory under the project's `build` directory. diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy index a3afa2b..83577e6 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy @@ -15,46 +15,34 @@ */ package grails.plugin.geb -import groovy.transform.CompileStatic -import groovy.transform.Memoized -import groovy.util.logging.Slf4j -import org.testcontainers.containers.BrowserWebDriverContainer -import org.testcontainers.containers.VncRecordingContainer +import java.lang.annotation.ElementType +import java.lang.annotation.Retention +import java.lang.annotation.RetentionPolicy +import java.lang.annotation.Target /** - * Handles parsing various configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} + * Can be used to configure the protocol and hostname that the container's browser will use * * @author James Daugherty * @since 5.0 */ -@Slf4j -@CompileStatic -class ContainerGebConfiguration { +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface ContainerGebConfiguration { - String recordingDirectoryName - BrowserWebDriverContainer.VncRecordingMode recordingMode - VncRecordingContainer.VncRecordingFormat recordingFormat + static final String DEFAULT_HOSTNAME_FROM_CONTAINER = 'host.testcontainers.internal' + static final String DEFAULT_PROTOCOL = 'http' - ContainerGebConfiguration() { - recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') - recordingMode = BrowserWebDriverContainer.VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING.name())) - recordingFormat = VncRecordingContainer.VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', VncRecordingContainer.VncRecordingFormat.MP4.name())) - } + /** + * The protocol that the container's browser will use to access the server under test. + *

Defaults to {@code http}. + */ + String protocol() default DEFAULT_PROTOCOL - @Memoized - File getRecordingDirectory() { - if (recordingMode == BrowserWebDriverContainer.VncRecordingMode.SKIP) { - return null - } - - File recordingDirectory = new File(recordingDirectoryName) - if (!recordingDirectory.exists()) { - log.info("Could not find `{}` directory for recording. Creating...", recordingDirectoryName) - recordingDirectory.mkdirs() - } else if (!recordingDirectory.isDirectory()) { - throw new IllegalStateException("Recording Directory name expected to be `${recordingDirectoryName}, but found file instead.") - } - - return recordingDirectory - } -} + /** + * The hostname that the container's browser will use to access the server under test. + *

Defaults to {@code host.testcontainers.internal}. + *

This is useful when the server under test needs to be accessed with a certain hostname. + */ + String hostName() default DEFAULT_HOSTNAME_FROM_CONTAINER +} \ No newline at end of file diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 936c4fb..61fc1cd 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -15,12 +15,12 @@ */ package grails.plugin.geb +import grails.testing.mixin.integration.Integration import groovy.transform.CompileStatic import groovy.transform.TailRecursive import groovy.util.logging.Slf4j import org.spockframework.runtime.extension.IGlobalExtension import org.spockframework.runtime.model.SpecInfo -import org.testcontainers.containers.BrowserWebDriverContainer import java.time.LocalDateTime @@ -33,33 +33,25 @@ import java.time.LocalDateTime @Slf4j @CompileStatic class ContainerGebRecordingExtension implements IGlobalExtension { - ContainerGebConfiguration configuration + WebDriverContainerHolder holder @Override void start() { - configuration = new ContainerGebConfiguration() + holder = new WebDriverContainerHolder(new RecordingSettings()) + addShutdownHook { + holder.stop() + } } @Override void visitSpec(SpecInfo spec) { if (isContainerGebSpec(spec)) { - ContainerGebTestListener listener = new ContainerGebTestListener(spec, LocalDateTime.now()) - // TODO: We should initialize the web driver container once for all geb tests so we don't have to spin it up & down. + validateContainerGebSpec(spec) + + ContainerGebTestListener listener = new ContainerGebTestListener(holder, spec, LocalDateTime.now()) spec.addSetupInterceptor { - ContainerGebSpec gebSpec = it.instance as ContainerGebSpec - gebSpec.initialize() - if (configuration.recordingMode != BrowserWebDriverContainer.VncRecordingMode.SKIP) { - listener.webDriverContainer = gebSpec.webDriverContainer - .withRecordingMode( - configuration.recordingMode, - configuration.recordingDirectory, - configuration.recordingFormat - ) - } - } - spec.addCleanupInterceptor { - ContainerGebSpec gebSpec = it.instance as ContainerGebSpec - gebSpec.container?.stop() + holder.reinitialize(it) + (it.sharedInstance as ContainerGebSpec).webDriverContainer = holder.current } spec.addListener(listener) @@ -76,4 +68,11 @@ class ContainerGebRecordingExtension implements IGlobalExtension { } return false } + + private static void validateContainerGebSpec(SpecInfo specInfo) { + if (!specInfo.annotations.find { it.annotationType() == Integration }) { + throw new IllegalArgumentException("ContainerGebSpec classes must be annotated with @Integration") + } + } } + diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index 98dc535..4962393 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -44,19 +44,17 @@ import java.time.Duration * * * + * @see grails.plugin.geb.ContainerGebConfiguration for how to customize the container's connection information + * * @author Søren Berg Glasius * @author Mattias Reichel + * @author James Daugherty * @since 5.0 */ @DynamicallyDispatchesToBrowser abstract class ContainerGebSpec extends Specification implements ManagedGebTest, ContainerAwareDownloadSupport { - private static final String DEFAULT_HOSTNAME_FROM_CONTAINER = 'host.testcontainers.internal' private static final String DEFAULT_HOSTNAME_FROM_HOST = 'localhost' - private static final String DEFAULT_PROTOCOL = 'http' - - private String hostNameFromContainer = DEFAULT_HOSTNAME_FROM_CONTAINER - boolean reportingEnabled = false @Override @@ -70,28 +68,6 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, @Shared BrowserWebDriverContainer webDriverContainer - @PackageScope - void initialize() { - if (initialized) { - return - } - - webDriverContainer = new BrowserWebDriverContainer() - Testcontainers.exposeHostPorts(port) - webDriverContainer.tap { - addExposedPort(this.port) - withAccessToHost(true) - start() - } - if (hostNameChanged) { - webDriverContainer.execInContainer('/bin/sh', '-c', "echo '$hostIp\t$hostName' | sudo tee -a /etc/hosts") - } - WebDriver driver = new RemoteWebDriver(webDriverContainer.seleniumAddress, new ChromeOptions()) - driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)) - browser.driver = driver - browser.baseUrl = "$protocol://$hostName:$port" - } - /** * Get access to container running the web-driver, for convenience to execInContainer, copyFileToContainer etc. * @@ -104,62 +80,21 @@ abstract class ContainerGebSpec extends Specification implements ManagedGebTest, return webDriverContainer } - /** - * Returns the protocol that the browser will use to access the server under test. - *

Defaults to {@code http}. - * - * @return the protocol for accessing the server under test - */ - String getProtocol() { - return DEFAULT_PROTOCOL - } - - /** - * Returns the hostname that the browser will use to access the server under test. - *

Defaults to {@code host.testcontainers.internal}. - *

This is useful when the server under test needs to be accessed with a certain hostname. - * - * @return the hostname for accessing the server under test - */ - String getHostName() { - return hostNameFromContainer - } - - void setHostName(String hostName) { - hostNameFromContainer = hostName - } - /** * Returns the hostname that the server under test is available on from the host. *

This is useful when using any of the {@code download*()} methods as they will connect from the host, * and not from within the container. - *

Defaults to {@code localhost}. If the value returned by {@code getHostName()} - * is different from the default, this method will return the same value same as {@code getHostName()}. + *

Defaults to {@code localhost}. If the value returned by {@code webDriverContainer.getHost()} + * is different from the default, this method will return the same value same as {@code webDriverContainer.getHost()}. * * @return the hostname for accessing the server under test from the host */ @Override String getHostNameFromHost() { - return hostNameChanged ? hostName : DEFAULT_HOSTNAME_FROM_HOST - } - - int getPort() { - try { - return (int) getProperty('serverPort') - } catch (Exception ignore) { - throw new IllegalStateException('Test class must be annotated with @Integration for serverPort to be injected') - } - } - - private static String getHostIp() { - PortForwardingContainer.INSTANCE.network.get().ipAddress + return hostNameChanged ? webDriverContainer.host : DEFAULT_HOSTNAME_FROM_HOST } private boolean isHostNameChanged() { - return hostNameFromContainer != DEFAULT_HOSTNAME_FROM_CONTAINER - } - - private boolean isInitialized() { - webDriverContainer == null + return webDriverContainer.host != ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER } } \ No newline at end of file diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy index 059b38b..eb0334a 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy @@ -36,19 +36,20 @@ import java.time.LocalDateTime @CompileStatic class ContainerGebTestListener extends AbstractRunListener { - BrowserWebDriverContainer webDriverContainer + WebDriverContainerHolder containerHolder ErrorInfo errorInfo SpecInfo spec LocalDateTime runDate - ContainerGebTestListener(SpecInfo spec, LocalDateTime runDate) { + ContainerGebTestListener(WebDriverContainerHolder containerHolder, SpecInfo spec, LocalDateTime runDate) { this.spec = spec this.runDate = runDate + this.containerHolder = containerHolder } @Override void afterIteration(IterationInfo iteration) { - webDriverContainer.afterTest( + containerHolder.current.afterTest( new ContainerGebTestDescription(iteration, runDate), Optional.ofNullable(errorInfo?.exception) ) diff --git a/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy new file mode 100644 index 0000000..97f0feb --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy @@ -0,0 +1,60 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package grails.plugin.geb + +import groovy.transform.CompileStatic +import groovy.transform.Memoized +import groovy.util.logging.Slf4j +import org.testcontainers.containers.BrowserWebDriverContainer +import org.testcontainers.containers.VncRecordingContainer + +/** + * Handles parsing various recording configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} + * + * @author James Daugherty + * @since 5.0 + */ +@Slf4j +@CompileStatic +class RecordingSettings { + + String recordingDirectoryName + BrowserWebDriverContainer.VncRecordingMode recordingMode + VncRecordingContainer.VncRecordingFormat recordingFormat + + RecordingSettings() { + recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') + recordingMode = BrowserWebDriverContainer.VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING.name())) + recordingFormat = VncRecordingContainer.VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', VncRecordingContainer.VncRecordingFormat.MP4.name())) + } + + @Memoized + File getRecordingDirectory() { + if (recordingMode == BrowserWebDriverContainer.VncRecordingMode.SKIP) { + return null + } + + File recordingDirectory = new File(recordingDirectoryName) + if (!recordingDirectory.exists()) { + log.info("Could not find `{}` directory for recording. Creating...", recordingDirectoryName) + recordingDirectory.mkdirs() + } else if (!recordingDirectory.isDirectory()) { + throw new IllegalStateException("Recording Directory name expected to be `${recordingDirectoryName}, but found file instead.") + } + + return recordingDirectory + } +} diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy new file mode 100644 index 0000000..a0ad90c --- /dev/null +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -0,0 +1,137 @@ +/* + * Copyright 2024 original author or authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package grails.plugin.geb + +import geb.Browser +import groovy.transform.EqualsAndHashCode +import org.openqa.selenium.WebDriver +import org.openqa.selenium.chrome.ChromeOptions +import org.openqa.selenium.remote.RemoteWebDriver +import org.spockframework.runtime.extension.IMethodInvocation +import org.spockframework.runtime.model.SpecInfo +import org.testcontainers.Testcontainers +import org.testcontainers.containers.BrowserWebDriverContainer + +import java.time.Duration + +/** + * Responsible for initializing a {@link org.testcontainers.containers.BrowserWebDriverContainer BrowserWebDriverContainer} + * per the Spec's {@link grails.plugin.geb.ContainerGebConfiguration ContainerGebConfiguration}. This class will try to + * reuse the same container if the configuration matches the current container. + * + * @author James Daugherty + * @since 5.0 + */ +class WebDriverContainerHolder { + RecordingSettings recordingSettings + WebDriverContainerConfiguration configuration + BrowserWebDriverContainer current + + WebDriverContainerHolder(RecordingSettings recordingSettings) { + this.recordingSettings = recordingSettings + } + + boolean isInitialized() { + current != null + } + + boolean stop() { + if (!current) { + return false + } + current.stop() + current = null + configuration = null + return true + } + + boolean matchesCurrentContainerConfiguration(WebDriverContainerConfiguration specConfiguration) { + specConfiguration == configuration + } + + private static int getPort(IMethodInvocation invocation) { + try { + return (int) invocation.instance.metaClass.getProperty(invocation.instance, 'serverPort') + } catch (Exception ignore) { + throw new IllegalStateException('Test class must be annotated with @Integration for serverPort to be injected') + } + } + + boolean reinitialize(IMethodInvocation invocation) { + WebDriverContainerConfiguration specConfiguration = new WebDriverContainerConfiguration(getPort(invocation), invocation.getSpec()) + if (matchesCurrentContainerConfiguration(specConfiguration)) { + return false + } + + if (isInitialized()) { + stop() + } + + configuration = specConfiguration + current = new BrowserWebDriverContainer() + Testcontainers.exposeHostPorts(configuration.port) + current.tap { + addExposedPort(configuration.port) + withAccessToHost(true) + start() + } + if (!isDefaultHostname()) { + current.execInContainer('/bin/sh', '-c', "echo '$hostIp\t${configuration.hostName}' | sudo tee -a /etc/hosts") + } + + if (recordingSettings.recordingMode != BrowserWebDriverContainer.VncRecordingMode.SKIP) { + current = current.withRecordingMode( + recordingSettings.recordingMode, + recordingSettings.recordingDirectory, + recordingSettings.recordingFormat + ) + } + + WebDriver driver = new RemoteWebDriver(current.seleniumAddress, new ChromeOptions()) + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)) + + // Update the browser to use this container + Browser browser = (invocation.sharedInstance as ContainerGebSpec).browser + browser.driver = driver + browser.baseUrl = "${configuration.protocol}://${configuration.hostName}:${configuration.port}" + + true + } + + private boolean isDefaultHostname() { + return configuration.hostName == ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER + } + + private String getHostIp() { + current.getContainerInfo().getNetworkSettings().getNetworks().entrySet().first().value.ipAddress + } + + @EqualsAndHashCode + private static class WebDriverContainerConfiguration { + String protocol + String hostName + int port + + WebDriverContainerConfiguration(int port, SpecInfo spec) { + ContainerGebConfiguration configuration = spec.annotations.find { it.annotationType() == ContainerGebConfiguration } as ContainerGebConfiguration + + protocol = configuration?.protocol() ?: ContainerGebConfiguration.DEFAULT_PROTOCOL + hostName = configuration?.hostName() ?: ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER + this.port = port + } + } +} + From 606d31ce327dca711d20d68905e84cc4204eeee6 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 13:07:57 -0500 Subject: [PATCH 07/18] Add explicit return for clarity --- .../groovy/grails/plugin/geb/WebDriverContainerHolder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index a0ad90c..c4ef7f2 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -108,7 +108,7 @@ class WebDriverContainerHolder { browser.driver = driver browser.baseUrl = "${configuration.protocol}://${configuration.hostName}:${configuration.port}" - true + return true } private boolean isDefaultHostname() { From 9c1050509d896bb1b31f83b0e6eba29833d9c3d5 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 13:08:22 -0500 Subject: [PATCH 08/18] Remove return --- .../groovy/grails/plugin/geb/WebDriverContainerHolder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index c4ef7f2..a224a1d 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -112,7 +112,7 @@ class WebDriverContainerHolder { } private boolean isDefaultHostname() { - return configuration.hostName == ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER + configuration.hostName == ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER } private String getHostIp() { From e47e1f30c3d26ccd094b4d41350a75d6346638c0 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 14:39:09 -0500 Subject: [PATCH 09/18] Remove unused imports --- .../groovy/grails/plugin/geb/ContainerGebSpec.groovy | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy index 4962393..0b3e8a0 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy @@ -18,18 +18,10 @@ package grails.plugin.geb import geb.test.GebTestManager import geb.test.ManagedGebTest import geb.transform.DynamicallyDispatchesToBrowser -import groovy.transform.PackageScope -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeOptions -import org.openqa.selenium.remote.RemoteWebDriver -import org.testcontainers.Testcontainers import org.testcontainers.containers.BrowserWebDriverContainer -import org.testcontainers.containers.PortForwardingContainer import spock.lang.Shared import spock.lang.Specification -import java.time.Duration - /** * A {@link geb.spock.GebSpec GebSpec} that leverages Testcontainers to run the browser inside a container. * From 55abfd710e64a7f1204a10c1d639bbda5de80d95 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 14:39:29 -0500 Subject: [PATCH 10/18] Switch to single quotes --- .../groovy/grails/plugin/geb/ContainerGebTestDescription.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy index 0002123..d1a5cc7 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy @@ -38,6 +38,6 @@ class ContainerGebTestDescription implements TestDescription { ContainerGebTestDescription(IterationInfo testInfo, LocalDateTime runDate) { testId = testInfo.displayName String safeName = testId.replaceAll('\\W+', '_') - filesystemFriendlyName = "${DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss").format(runDate)}_${safeName}" + filesystemFriendlyName = "${DateTimeFormatter.ofPattern('yyyyMMdd_HHmmss').format(runDate)}_${safeName}" } } From 8a8a85114a82ba43f268e362858993b05e20f584 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 14:51:29 -0500 Subject: [PATCH 11/18] Code Review Feedback --- .../geb/ContainerGebRecordingExtension.groovy | 5 ++- .../geb/ContainerGebTestListener.groovy | 3 +- .../plugin/geb/RecordingSettings.groovy | 24 ++++++++--- .../geb/WebDriverContainerHolder.groovy | 43 +++++++++++-------- 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 61fc1cd..275b762 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -33,6 +33,7 @@ import java.time.LocalDateTime @Slf4j @CompileStatic class ContainerGebRecordingExtension implements IGlobalExtension { + WebDriverContainerHolder holder @Override @@ -51,7 +52,7 @@ class ContainerGebRecordingExtension implements IGlobalExtension { ContainerGebTestListener listener = new ContainerGebTestListener(holder, spec, LocalDateTime.now()) spec.addSetupInterceptor { holder.reinitialize(it) - (it.sharedInstance as ContainerGebSpec).webDriverContainer = holder.current + (it.sharedInstance as ContainerGebSpec).webDriverContainer = holder.currentContainer } spec.addListener(listener) @@ -71,7 +72,7 @@ class ContainerGebRecordingExtension implements IGlobalExtension { private static void validateContainerGebSpec(SpecInfo specInfo) { if (!specInfo.annotations.find { it.annotationType() == Integration }) { - throw new IllegalArgumentException("ContainerGebSpec classes must be annotated with @Integration") + throw new IllegalArgumentException('ContainerGebSpec classes must be annotated with @Integration') } } } diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy index eb0334a..5da846a 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestListener.groovy @@ -20,7 +20,6 @@ import org.spockframework.runtime.AbstractRunListener import org.spockframework.runtime.model.ErrorInfo import org.spockframework.runtime.model.IterationInfo import org.spockframework.runtime.model.SpecInfo -import org.testcontainers.containers.BrowserWebDriverContainer import java.time.LocalDateTime @@ -49,7 +48,7 @@ class ContainerGebTestListener extends AbstractRunListener { @Override void afterIteration(IterationInfo iteration) { - containerHolder.current.afterTest( + containerHolder.currentContainer.afterTest( new ContainerGebTestDescription(iteration, runDate), Optional.ofNullable(errorInfo?.exception) ) diff --git a/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy index 97f0feb..42b78f1 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy @@ -21,6 +21,9 @@ import groovy.util.logging.Slf4j import org.testcontainers.containers.BrowserWebDriverContainer import org.testcontainers.containers.VncRecordingContainer +import static org.testcontainers.containers.BrowserWebDriverContainer.* +import static org.testcontainers.containers.VncRecordingContainer.* + /** * Handles parsing various recording configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} * @@ -31,28 +34,35 @@ import org.testcontainers.containers.VncRecordingContainer @CompileStatic class RecordingSettings { + private static VncRecordingMode DEFAULT_RECORDING_MODE = VncRecordingMode.SKIP + private static VncRecordingFormat DEFAULT_RECORDING_FORMAT = VncRecordingFormat.MP4 + String recordingDirectoryName - BrowserWebDriverContainer.VncRecordingMode recordingMode - VncRecordingContainer.VncRecordingFormat recordingFormat + VncRecordingMode recordingMode + VncRecordingFormat recordingFormat RecordingSettings() { recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') - recordingMode = BrowserWebDriverContainer.VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING.name())) - recordingFormat = VncRecordingContainer.VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', VncRecordingContainer.VncRecordingFormat.MP4.name())) + recordingMode = VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', DEFAULT_RECORDING_MODE.name())) + recordingFormat = VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', DEFAULT_RECORDING_FORMAT.name())) + } + + boolean isRecordingEnabled() { + recordingMode != VncRecordingMode.SKIP } @Memoized File getRecordingDirectory() { - if (recordingMode == BrowserWebDriverContainer.VncRecordingMode.SKIP) { + if (!recordingEnabled) { return null } File recordingDirectory = new File(recordingDirectoryName) if (!recordingDirectory.exists()) { - log.info("Could not find `{}` directory for recording. Creating...", recordingDirectoryName) + log.info('Could not find `{}` Directory for recording. Creating...', recordingDirectoryName) recordingDirectory.mkdirs() } else if (!recordingDirectory.isDirectory()) { - throw new IllegalStateException("Recording Directory name expected to be `${recordingDirectoryName}, but found file instead.") + throw new IllegalStateException("Configured recording directory '${recordingDirectory}' is expected to be a directory, but found file instead.") } return recordingDirectory diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index a224a1d..a9e93f2 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -36,24 +36,25 @@ import java.time.Duration * @since 5.0 */ class WebDriverContainerHolder { + RecordingSettings recordingSettings WebDriverContainerConfiguration configuration - BrowserWebDriverContainer current + BrowserWebDriverContainer currentContainer WebDriverContainerHolder(RecordingSettings recordingSettings) { this.recordingSettings = recordingSettings } boolean isInitialized() { - current != null + currentContainer != null } boolean stop() { - if (!current) { + if (!currentContainer) { return false } - current.stop() - current = null + currentContainer.stop() + currentContainer = null configuration = null return true } @@ -71,36 +72,39 @@ class WebDriverContainerHolder { } boolean reinitialize(IMethodInvocation invocation) { - WebDriverContainerConfiguration specConfiguration = new WebDriverContainerConfiguration(getPort(invocation), invocation.getSpec()) + WebDriverContainerConfiguration specConfiguration = new WebDriverContainerConfiguration( + getPort(invocation), + invocation.getSpec() + ) if (matchesCurrentContainerConfiguration(specConfiguration)) { return false } - if (isInitialized()) { + if (initialized) { stop() } configuration = specConfiguration - current = new BrowserWebDriverContainer() + currentContainer = new BrowserWebDriverContainer() Testcontainers.exposeHostPorts(configuration.port) - current.tap { + currentContainer.tap { addExposedPort(configuration.port) withAccessToHost(true) start() } - if (!isDefaultHostname()) { - current.execInContainer('/bin/sh', '-c', "echo '$hostIp\t${configuration.hostName}' | sudo tee -a /etc/hosts") + if (hostnameChanged) { + currentContainer.execInContainer('/bin/sh', '-c', "echo '$hostIp\t${configuration.hostName}' | sudo tee -a /etc/hosts") } - if (recordingSettings.recordingMode != BrowserWebDriverContainer.VncRecordingMode.SKIP) { - current = current.withRecordingMode( + if (recordingSettings.recordingEnabled) { + currentContainer = currentContainer.withRecordingMode( recordingSettings.recordingMode, recordingSettings.recordingDirectory, recordingSettings.recordingFormat ) } - WebDriver driver = new RemoteWebDriver(current.seleniumAddress, new ChromeOptions()) + WebDriver driver = new RemoteWebDriver(currentContainer.seleniumAddress, new ChromeOptions()) driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)) // Update the browser to use this container @@ -111,22 +115,25 @@ class WebDriverContainerHolder { return true } - private boolean isDefaultHostname() { - configuration.hostName == ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER + private boolean getHostnameChanged() { + configuration.hostName != ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER } private String getHostIp() { - current.getContainerInfo().getNetworkSettings().getNetworks().entrySet().first().value.ipAddress + currentContainer.getContainerInfo().getNetworkSettings().getNetworks().entrySet().first().value.ipAddress } @EqualsAndHashCode private static class WebDriverContainerConfiguration { + String protocol String hostName int port WebDriverContainerConfiguration(int port, SpecInfo spec) { - ContainerGebConfiguration configuration = spec.annotations.find { it.annotationType() == ContainerGebConfiguration } as ContainerGebConfiguration + ContainerGebConfiguration configuration = spec.annotations.find { + it.annotationType() == ContainerGebConfiguration + } as ContainerGebConfiguration protocol = configuration?.protocol() ?: ContainerGebConfiguration.DEFAULT_PROTOCOL hostName = configuration?.hostName() ?: ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER From b0a5e7d6d050b7d0267963aedadbd4a15e0e8256 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 14:55:10 -0500 Subject: [PATCH 12/18] Update readme for default change --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1d96537..5c3a0e6 100644 --- a/README.md +++ b/README.md @@ -58,14 +58,12 @@ Just run `./gradlew integrationTest` and a container will be started and configu The annotation `ContainerGebConfiguration` exists to customize the connection the container will use to access the application under test. The annotation is not required and `ContainerGebSpec` will use the default values in this annotation if it's not present. #### Recording -By default, all failed tests will generate a video recording of the test execution. These recordings are saved to a `recordings` directory under the project's `build` directory. - -The following system properties can be change to configure the recording behavior: +By default, no test recording will be performed. Here are the system properties available to change the recording behavior: * `grails.geb.recording.mode` * purpose: which tests to record * possible values: `SKIP`, `RECORD_ALL`, or `RECORD_FAILING` - * defaults to `RECORD_FAILING` + * defaults to `SKIP` * `grails.geb.recording.directory` From 06db4c70897a47c6ec0eb54b11edfc38898a55a1 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 15:45:01 -0500 Subject: [PATCH 13/18] Feedback --- .../geb/ContainerGebRecordingExtension.groovy | 8 ++++---- .../grails/plugin/geb/RecordingSettings.groovy | 14 ++++++++------ .../plugin/geb/WebDriverContainerHolder.groovy | 8 +++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy index 275b762..80dfde2 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerGebRecordingExtension.groovy @@ -46,9 +46,7 @@ class ContainerGebRecordingExtension implements IGlobalExtension { @Override void visitSpec(SpecInfo spec) { - if (isContainerGebSpec(spec)) { - validateContainerGebSpec(spec) - + if (isContainerGebSpec(spec) && validateContainerGebSpec(spec)) { ContainerGebTestListener listener = new ContainerGebTestListener(holder, spec, LocalDateTime.now()) spec.addSetupInterceptor { holder.reinitialize(it) @@ -70,10 +68,12 @@ class ContainerGebRecordingExtension implements IGlobalExtension { return false } - private static void validateContainerGebSpec(SpecInfo specInfo) { + private static boolean validateContainerGebSpec(SpecInfo specInfo) { if (!specInfo.annotations.find { it.annotationType() == Integration }) { throw new IllegalArgumentException('ContainerGebSpec classes must be annotated with @Integration') } + + return true } } diff --git a/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy index 42b78f1..da46322 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/RecordingSettings.groovy @@ -18,11 +18,9 @@ package grails.plugin.geb import groovy.transform.CompileStatic import groovy.transform.Memoized import groovy.util.logging.Slf4j -import org.testcontainers.containers.BrowserWebDriverContainer -import org.testcontainers.containers.VncRecordingContainer -import static org.testcontainers.containers.BrowserWebDriverContainer.* -import static org.testcontainers.containers.VncRecordingContainer.* +import static org.testcontainers.containers.BrowserWebDriverContainer.VncRecordingMode +import static org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat /** * Handles parsing various recording configuration used by {@link grails.plugin.geb.ContainerGebRecordingExtension} @@ -43,8 +41,12 @@ class RecordingSettings { RecordingSettings() { recordingDirectoryName = System.getProperty('grails.geb.recording.directory', 'build/recordings') - recordingMode = VncRecordingMode.valueOf(System.getProperty('grails.geb.recording.mode', DEFAULT_RECORDING_MODE.name())) - recordingFormat = VncRecordingFormat.valueOf(System.getProperty('grails.geb.recording.format', DEFAULT_RECORDING_FORMAT.name())) + recordingMode = VncRecordingMode.valueOf( + System.getProperty('grails.geb.recording.mode', DEFAULT_RECORDING_MODE.name()) + ) + recordingFormat = VncRecordingFormat.valueOf( + System.getProperty('grails.geb.recording.format', DEFAULT_RECORDING_FORMAT.name()) + ) } boolean isRecordingEnabled() { diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index a9e93f2..1c2f8af 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -16,6 +16,7 @@ package grails.plugin.geb import geb.Browser +import groovy.transform.CompileStatic import groovy.transform.EqualsAndHashCode import org.openqa.selenium.WebDriver import org.openqa.selenium.chrome.ChromeOptions @@ -35,6 +36,7 @@ import java.time.Duration * @author James Daugherty * @since 5.0 */ +@CompileStatic class WebDriverContainerHolder { RecordingSettings recordingSettings @@ -49,14 +51,13 @@ class WebDriverContainerHolder { currentContainer != null } - boolean stop() { + void stop() { if (!currentContainer) { - return false + return } currentContainer.stop() currentContainer = null configuration = null - return true } boolean matchesCurrentContainerConfiguration(WebDriverContainerConfiguration specConfiguration) { @@ -123,6 +124,7 @@ class WebDriverContainerHolder { currentContainer.getContainerInfo().getNetworkSettings().getNetworks().entrySet().first().value.ipAddress } + @CompileStatic @EqualsAndHashCode private static class WebDriverContainerConfiguration { From b159b219fbd2dbbd0a60cf54e68336d8444782af Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Sun, 24 Nov 2024 21:58:01 +0100 Subject: [PATCH 14/18] Feedback --- .../groovy/grails/plugin/geb/WebDriverContainerHolder.groovy | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index 1c2f8af..035f155 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -52,10 +52,7 @@ class WebDriverContainerHolder { } void stop() { - if (!currentContainer) { - return - } - currentContainer.stop() + currentContainer?.stop() currentContainer = null configuration = null } From a36bd7ec2771ede94ad364974a13ef4090a4d394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Berg=20Glasius?= Date: Mon, 25 Nov 2024 10:06:08 +0100 Subject: [PATCH 15/18] WebDriverContainerHolder getHostIp did not get Host ip, but container IP --- .../plugin/geb/WebDriverContainerHolder.groovy | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy index 035f155..aaf9be0 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy @@ -15,6 +15,7 @@ */ package grails.plugin.geb +import com.github.dockerjava.api.model.ContainerNetwork import geb.Browser import groovy.transform.CompileStatic import groovy.transform.EqualsAndHashCode @@ -25,6 +26,7 @@ import org.spockframework.runtime.extension.IMethodInvocation import org.spockframework.runtime.model.SpecInfo import org.testcontainers.Testcontainers import org.testcontainers.containers.BrowserWebDriverContainer +import org.testcontainers.containers.PortForwardingContainer import java.time.Duration @@ -117,8 +119,16 @@ class WebDriverContainerHolder { configuration.hostName != ContainerGebConfiguration.DEFAULT_HOSTNAME_FROM_CONTAINER } - private String getHostIp() { - currentContainer.getContainerInfo().getNetworkSettings().getNetworks().entrySet().first().value.ipAddress + private static String getHostIp() { + try { + PortForwardingContainer.getDeclaredMethod("getNetwork").with { + accessible = true + Optional network = invoke(PortForwardingContainer.INSTANCE) as Optional + return network.get().ipAddress + } + } catch (Exception e) { + throw new RuntimeException("Could not access network from PortForwardingContainer", e) + } } @CompileStatic From 895466bb085ac286ad103b80165adaa0b541c47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Berg=20Glasius?= Date: Mon, 25 Nov 2024 10:34:25 +0100 Subject: [PATCH 16/18] Suggesting a test-app for the basic tests. * Not auto-imported * Stand-alone project * Includes 'geb' as subproject (not the other way around) * Project has grails.geb.recording.mode = RECORD_ALL in build.gradle --- spock-container-test-app/.gitignore | 42 + spock-container-test-app/build.gradle | 60 + .../buildSrc/build.gradle | 10 + spock-container-test-app/gradle.properties | 7 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43583 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + spock-container-test-app/gradlew | 252 + spock-container-test-app/gradlew.bat | 94 + .../assets/images/advancedgrails.svg | 27 + .../assets/images/apple-touch-icon-retina.png | Bin 0 -> 7038 bytes .../assets/images/apple-touch-icon.png | Bin 0 -> 3077 bytes .../assets/images/documentation.svg | 19 + .../grails-app/assets/images/favicon.ico | Bin 0 -> 5558 bytes .../images/grails-cupsonly-logo-white.svg | 26 + .../grails-app/assets/images/grails.svg | 13 + .../assets/images/skin/database_add.png | Bin 0 -> 658 bytes .../assets/images/skin/database_delete.png | Bin 0 -> 659 bytes .../assets/images/skin/database_edit.png | Bin 0 -> 767 bytes .../assets/images/skin/database_save.png | Bin 0 -> 755 bytes .../assets/images/skin/database_table.png | Bin 0 -> 726 bytes .../assets/images/skin/exclamation.png | Bin 0 -> 701 bytes .../grails-app/assets/images/skin/house.png | Bin 0 -> 806 bytes .../assets/images/skin/information.png | Bin 0 -> 778 bytes .../assets/images/skin/sorted_asc.gif | Bin 0 -> 835 bytes .../assets/images/skin/sorted_desc.gif | Bin 0 -> 834 bytes .../grails-app/assets/images/slack.svg | 18 + .../grails-app/assets/images/spinner.gif | Bin 0 -> 2037 bytes .../assets/javascripts/application.js | 11 + .../assets/javascripts/bootstrap.bundle.js | 6972 ++++++++++ .../javascripts/bootstrap.bundle.js.map | 1 + .../javascripts/bootstrap.bundle.min.js | 7 + .../javascripts/bootstrap.bundle.min.js.map | 1 + .../assets/javascripts/bootstrap.js | 4357 +++++++ .../assets/javascripts/bootstrap.js.map | 1 + .../assets/javascripts/bootstrap.min.js | 7 + .../assets/javascripts/bootstrap.min.js.map | 1 + .../assets/javascripts/jquery-3.5.1.js | 10872 ++++++++++++++++ .../assets/javascripts/jquery-3.5.1.min.js | 2 + .../javascripts/jquery-3.5.1.min.js.map | 1 + .../grails-app/assets/javascripts/popper.js | 2624 ++++ .../assets/javascripts/popper.min.js | 5 + .../assets/javascripts/popper.min.js.map | 1 + .../assets/stylesheets/application.css | 15 + .../assets/stylesheets/bootstrap-grid.css | 3872 ++++++ .../assets/stylesheets/bootstrap-grid.css.map | 1 + .../assets/stylesheets/bootstrap-grid.min.css | 7 + .../stylesheets/bootstrap-grid.min.css.map | 1 + .../assets/stylesheets/bootstrap-reboot.css | 331 + .../assets/stylesheets/bootstrap.css | 10315 +++++++++++++++ .../assets/stylesheets/bootstrap.css.map | 1 + .../assets/stylesheets/bootstrap.min.css | 7 + .../assets/stylesheets/bootstrap.min.css.map | 1 + .../grails-app/assets/stylesheets/errors.css | 98 + .../grails-app/assets/stylesheets/grails.css | 1052 ++ .../grails-app/assets/stylesheets/main.css | 589 + .../grails-app/assets/stylesheets/mobile.css | 82 + .../grails-app/conf/application.yml | 94 + .../grails-app/conf/logback-spring.xml | 39 + .../grails-app/conf/spring/resources.groovy | 3 + .../demo/spock/ServerNameController.groovy | 9 + .../org/demo/spock/UrlMappings.groovy | 16 + .../grails-app/i18n/messages.properties | 56 + .../init/org/demo/spock/Application.groovy | 13 + .../init/org/demo/spock/BootStrap.groovy | 9 + .../grails-app/views/error.gsp | 31 + .../grails-app/views/index.gsp | 78 + .../grails-app/views/layouts/main.gsp | 73 + .../grails-app/views/notFound.gsp | 14 + .../grails-app/views/serverName/index.gsp | 17 + spock-container-test-app/grails-cli.yml | 8 + spock-container-test-app/grails-wrapper.jar | Bin 0 -> 5743 bytes spock-container-test-app/grailsw | 152 + spock-container-test-app/grailsw.bat | 89 + spock-container-test-app/settings.gradle | 17 + .../groovy/org/demo/spock/RootPageSpec.groovy | 20 + .../spock/ServerNameControllerSpec.groovy | 22 + 76 files changed, 42570 insertions(+) create mode 100644 spock-container-test-app/.gitignore create mode 100644 spock-container-test-app/build.gradle create mode 100644 spock-container-test-app/buildSrc/build.gradle create mode 100644 spock-container-test-app/gradle.properties create mode 100644 spock-container-test-app/gradle/wrapper/gradle-wrapper.jar create mode 100644 spock-container-test-app/gradle/wrapper/gradle-wrapper.properties create mode 100755 spock-container-test-app/gradlew create mode 100644 spock-container-test-app/gradlew.bat create mode 100644 spock-container-test-app/grails-app/assets/images/advancedgrails.svg create mode 100644 spock-container-test-app/grails-app/assets/images/apple-touch-icon-retina.png create mode 100644 spock-container-test-app/grails-app/assets/images/apple-touch-icon.png create mode 100644 spock-container-test-app/grails-app/assets/images/documentation.svg create mode 100644 spock-container-test-app/grails-app/assets/images/favicon.ico create mode 100644 spock-container-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg create mode 100644 spock-container-test-app/grails-app/assets/images/grails.svg create mode 100644 spock-container-test-app/grails-app/assets/images/skin/database_add.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/database_delete.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/database_edit.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/database_save.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/database_table.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/exclamation.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/house.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/information.png create mode 100644 spock-container-test-app/grails-app/assets/images/skin/sorted_asc.gif create mode 100644 spock-container-test-app/grails-app/assets/images/skin/sorted_desc.gif create mode 100644 spock-container-test-app/grails-app/assets/images/slack.svg create mode 100644 spock-container-test-app/grails-app/assets/images/spinner.gif create mode 100644 spock-container-test-app/grails-app/assets/javascripts/application.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.js.map create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.min.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.min.js.map create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.js.map create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.min.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/bootstrap.min.js.map create mode 100644 spock-container-test-app/grails-app/assets/javascripts/jquery-3.5.1.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/jquery-3.5.1.min.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/jquery-3.5.1.min.js.map create mode 100644 spock-container-test-app/grails-app/assets/javascripts/popper.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/popper.min.js create mode 100644 spock-container-test-app/grails-app/assets/javascripts/popper.min.js.map create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/application.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap-grid.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap-grid.css.map create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap-grid.min.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap-grid.min.css.map create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap-reboot.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap.css.map create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap.min.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/bootstrap.min.css.map create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/errors.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/grails.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/main.css create mode 100644 spock-container-test-app/grails-app/assets/stylesheets/mobile.css create mode 100644 spock-container-test-app/grails-app/conf/application.yml create mode 100644 spock-container-test-app/grails-app/conf/logback-spring.xml create mode 100644 spock-container-test-app/grails-app/conf/spring/resources.groovy create mode 100644 spock-container-test-app/grails-app/controllers/org/demo/spock/ServerNameController.groovy create mode 100644 spock-container-test-app/grails-app/controllers/org/demo/spock/UrlMappings.groovy create mode 100644 spock-container-test-app/grails-app/i18n/messages.properties create mode 100644 spock-container-test-app/grails-app/init/org/demo/spock/Application.groovy create mode 100644 spock-container-test-app/grails-app/init/org/demo/spock/BootStrap.groovy create mode 100644 spock-container-test-app/grails-app/views/error.gsp create mode 100644 spock-container-test-app/grails-app/views/index.gsp create mode 100644 spock-container-test-app/grails-app/views/layouts/main.gsp create mode 100644 spock-container-test-app/grails-app/views/notFound.gsp create mode 100644 spock-container-test-app/grails-app/views/serverName/index.gsp create mode 100644 spock-container-test-app/grails-cli.yml create mode 100644 spock-container-test-app/grails-wrapper.jar create mode 100755 spock-container-test-app/grailsw create mode 100644 spock-container-test-app/grailsw.bat create mode 100644 spock-container-test-app/settings.gradle create mode 100644 spock-container-test-app/src/integration-test/groovy/org/demo/spock/RootPageSpec.groovy create mode 100644 spock-container-test-app/src/integration-test/groovy/org/demo/spock/ServerNameControllerSpec.groovy diff --git a/spock-container-test-app/.gitignore b/spock-container-test-app/.gitignore new file mode 100644 index 0000000..cc02599 --- /dev/null +++ b/spock-container-test-app/.gitignore @@ -0,0 +1,42 @@ +### Gradle ### +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Other ### +Thumbs.db +.DS_Store +target/ diff --git a/spock-container-test-app/build.gradle b/spock-container-test-app/build.gradle new file mode 100644 index 0000000..dc7d0c0 --- /dev/null +++ b/spock-container-test-app/build.gradle @@ -0,0 +1,60 @@ +plugins { + id "groovy" + id "org.grails.grails-web" + id "org.grails.grails-gsp" + id "war" + id "idea" + id "com.bertramlabs.asset-pipeline" version "5.0.1" + id "eclipse" +} + +group = "org.demo.spock" + +repositories { + mavenCentral() + maven { url "https://repo.grails.org/grails/core/" } + maven { url "https://repository.apache.org/content/repositories/snapshots"} +} + +dependencies { + profile("org.grails.profiles:web") + implementation("org.grails:grails-core") + implementation("org.grails:grails-logging") + implementation("org.grails:grails-plugin-databinding") + implementation("org.grails:grails-plugin-i18n") + implementation("org.grails:grails-plugin-interceptors") + implementation("org.grails:grails-plugin-rest") + implementation("org.grails:grails-plugin-services") + implementation("org.grails:grails-plugin-url-mappings") + implementation("org.grails:grails-web-boot") + implementation("org.grails.plugins:gsp") + implementation("org.grails.plugins:hibernate5") + implementation("org.grails.plugins:scaffolding") + implementation("org.sitemesh:grails-plugin-sitemesh3:7.0.0-SNAPSHOT") + implementation("org.springframework.boot:spring-boot-autoconfigure") + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("org.springframework.boot:spring-boot-starter-logging") + implementation("org.springframework.boot:spring-boot-starter-tomcat") + implementation("org.springframework.boot:spring-boot-starter-validation") + console("org.grails:grails-console") + runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails") + runtimeOnly("com.h2database:h2") + runtimeOnly("org.apache.tomcat:tomcat-jdbc") + runtimeOnly("org.fusesource.jansi:jansi") + integrationTestImplementation testFixtures(project(':geb')) + testImplementation("org.grails:grails-gorm-testing-support") + testImplementation("org.grails:grails-web-testing-support") + testImplementation("org.spockframework:spock-core") +} + +compileJava.options.release = 17 + +tasks.withType(Test) { + useJUnitPlatform() + systemProperty 'grails.geb.recording.mode', 'RECORD_ALL' +} +assets { + minifyJs = true + minifyCss = true +} diff --git a/spock-container-test-app/buildSrc/build.gradle b/spock-container-test-app/buildSrc/build.gradle new file mode 100644 index 0000000..538b219 --- /dev/null +++ b/spock-container-test-app/buildSrc/build.gradle @@ -0,0 +1,10 @@ +repositories { + mavenCentral() + maven { url "https://repo.grails.org/grails/core/" } + maven { url "https://repository.apache.org/content/repositories/snapshots"} +} +dependencies { + implementation platform("org.grails:grails-bom:7.0.0-SNAPSHOT") + implementation("org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT") + implementation("org.grails.plugins:hibernate5:9.0.0-SNAPSHOT") +} diff --git a/spock-container-test-app/gradle.properties b/spock-container-test-app/gradle.properties new file mode 100644 index 0000000..3f27b29 --- /dev/null +++ b/spock-container-test-app/gradle.properties @@ -0,0 +1,7 @@ +grailsVersion=7.0.0-SNAPSHOT +grailsGradlePluginVersion=7.0.0-SNAPSHOT +version=0.1 +org.gradle.caching=true +org.gradle.daemon=true +org.gradle.parallel=true +org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M diff --git a/spock-container-test-app/gradle/wrapper/gradle-wrapper.jar b/spock-container-test-app/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..a4b76b9530d66f5e68d973ea569d8e19de379189 GIT binary patch literal 43583 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F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)-06)!#Mq<6GhP z-Q?qmgo${aFBApb5p}$1OJKTClfi8%PpnczyVKkoHw7Ml9e7ikrF0d~UB}i3vizos zXW4DN$SiEV9{faLt5bHy2a>33K%7Td-n5C*N;f&ZqAg#2hIqEb(y<&f4u5BWJ>2^4 z414GosL=Aom#m&=x_v<0-fp1r%oVJ{T-(xnomNJ(Dryv zh?vj+%=II_nV+@NR+(!fZZVM&(W6{6%9cm+o+Z6}KqzLw{(>E86uA1`_K$HqINlb1 zKelh3-jr2I9V?ych`{hta9wQ2c9=MM`2cC{m6^MhlL2{DLv7C^j z$xXBCnDl_;l|bPGMX@*tV)B!c|4oZyftUlP*?$YU9C_eAsuVHJ58?)zpbr30P*C`T z7y#ao`uE-SOG(Pi+`$=e^mle~)pRrdwL5)N;o{gpW21of(QE#U6w%*C~`v-z0QqBML!!5EeYA5IQB0 z^l01c;L6E(iytN!LhL}wfwP7W9PNAkb+)Cst?qg#$n;z41O4&v+8-zPs+XNb-q zIeeBCh#ivnFLUCwfS;p{LC0O7tm+Sf9Jn)~b%uwP{%69;QC)Ok0t%*a5M+=;y8j=v z#!*pp$9@!x;UMIs4~hP#pnfVc!%-D<+wsG@R2+J&%73lK|2G!EQC)O05TCV=&3g)C!lT=czLpZ@Sa%TYuoE?v8T8`V;e$#Zf2_Nj6nvBgh1)2 GZ~q4|mN%#X literal 0 HcmV?d00001 diff --git a/spock-container-test-app/gradle/wrapper/gradle-wrapper.properties b/spock-container-test-app/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..df97d72 --- /dev/null +++ b/spock-container-test-app/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/spock-container-test-app/gradlew b/spock-container-test-app/gradlew new file mode 100755 index 0000000..f5feea6 --- /dev/null +++ b/spock-container-test-app/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/spock-container-test-app/gradlew.bat b/spock-container-test-app/gradlew.bat new file mode 100644 index 0000000..9d21a21 --- /dev/null +++ b/spock-container-test-app/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/spock-container-test-app/grails-app/assets/images/advancedgrails.svg b/spock-container-test-app/grails-app/assets/images/advancedgrails.svg new file mode 100644 index 0000000..8b63ec8 --- /dev/null +++ b/spock-container-test-app/grails-app/assets/images/advancedgrails.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + diff --git a/spock-container-test-app/grails-app/assets/images/apple-touch-icon-retina.png b/spock-container-test-app/grails-app/assets/images/apple-touch-icon-retina.png new file mode 100644 index 0000000000000000000000000000000000000000..d5bc4c0da0bf34d32c86eee86f14845f1e5bf412 GIT binary patch literal 7038 zcmV-^8-e7BP)Py5I7vi7RCodHT??FD)4Bh?edZBlroEM*RKi6)f?Kb8q)LcnCT_hiqMrTTqHe32 znM_IBd#Arvq{$@JYJ*ZjdP!V@y3I@?1QkUil%j){#G{B_%!It=>~;U&x6e7V&zb!^ zXP=WZk@cH1d+oKp^{wx*-s@XyGYw*Ay4pWOX3d^NHh#P(88d>I8^DtDGkCHQKat^H zV(Nv@`5A+EUWJHmBCDHtXg4>t|DVDR!hbwiXf_LfUQhJ;VPx6IKw(EgF{2EbVM)@@ z#P31z&qKivlWjdnwDaRU;nMX<=20$ORjo*~sAVrQbP9fBpuEwBXsdDw!V52ivldEy z3^n;d{1))|nSb$utA?0niGK|*qnNZxh#+XB@K}cB|nE8)T?5$L9=JA-B?`6ZQ z;aN3`MD1%Pn=VG5)ocvaR)cW-Xkey|=#x9iqU%sgJN@7)8NNvsi5kbWs0~eLdJ2?x zU?mw(DlaH?1#xOBji0^%H5RS^rg57@k;dGSqOK<=lCh_N^Sw6>>&fN{LB2?AO{JzU z-p+h_I$7-D*eb3_vv~4oO53wh8}|<k=L}V_7Asub3ir5VMx1V|af) zn$e2oTS;MN^FnirnGw$+s{1ZaxN3DayqwR92-I}8TnN^tfxCYyCo|QC8}rilG0MGy znr8f}-2G=+73r+J^v*#u`ju)EawX}367M5!IKP}LM`cr_>1;h5gPD04%#5g{(5f{r zDD!npSZGU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^AcN_U6i8koQF8xHW3@}1lVZd;gS)m**un$**{mjjo zw*O#pXF9Zd4-D)PY>RX6*Tj_e0V1-%xW*!6v}$ zYxy_yOuRNj&uzHvzgm|NB>hI8JQ+a;KflatacK9IQ3fg=Bh!_n^(P)}PJ!>vsro90 zANYD8$ScM`r=4S0)<`@;Fn1yz%ff|>mG+2AOK}|%lY}nHgUttb$WuNUetCJA`N57o zr7tVY7@2)#vC&TySB5KPsAs1=9!*K-FXKCjPk6LB1<3=4Z)vBORqXc2AN64q3B8FcoS0vXAc}&yWO@b+C+1yYpa%)_ien;rq29c6x{FuzYq>`jr@rIVPn)~S-%p8(&i|7Lp84JN01lZJA;qkRb7sT59GV`s9g0|JN&pDBMm~| z$>=kZyvZId_z)9B%leutu%W&&2*+gqLm1{j%oPfgiGVpY;A8mZ0I?i3%)AsQ|Iq=k zS2cP=e-Dr?VD!Vue6iJMBvBt?-GxaspzEkeEL5@`b{xx}p(n`0Ey#O2Q>YG?6p64B)$Qa$q- zs7>-3Y519kKzJw9vDA?C4IGbK^bXuD`m1vR*)UMw@yv`Pi#5_*H<*V&9T-vJk>;gG zob)UXr<&VP9GHMKhs1bVfrm=kAn%;a;f9LNQJfWj8yAd%ZA>s=`3oEd7g78fuBrD> zdD(GlOIMI(_cON%BID6+EaqflT?}7~afpwegJC^_keIrOy65sMNwwXCXD%Oxo{Zlx z#B|iDpp0CVU&J#|qjyJznro1A_2qJ~Q_kr(=pkdz<^LuK8mo14qx~)VzmWd}oqpOb TOgI^o00000NkvXXu0mjfLl)`& literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/documentation.svg b/spock-container-test-app/grails-app/assets/images/documentation.svg new file mode 100644 index 0000000..29bc9d5 --- /dev/null +++ b/spock-container-test-app/grails-app/assets/images/documentation.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/spock-container-test-app/grails-app/assets/images/favicon.ico b/spock-container-test-app/grails-app/assets/images/favicon.ico new file mode 100644 index 0000000000000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zPJ{X@l0TxkBu$_EIRCo!7x`r!RjOZqrr}9iBmJHAC$OV+4>{w1jMe1&JNYh6;+q+p zjy2Zu#3Xi{FX=bm6|Q>!Xwvp7&YFGyi0YH{{-toE_XYcmY3XCr@%?Y!zoI&zU-SNn z95#aceH1n>^A2N^eT>Pud3^tj>494DKY9O-tMR}3&F>`mbRxfyH2a;TdvNM*)KBjq zUysXX`#U%`mw{Nn>Lvd@`0XX+`|nU&z6<&7x+A_u{d$RWNi{BUyN9X|!naRu{!|Fw zB{{pgLGksPQ%^DmHXlN*g*9BO=J+Hgz7L$D9CHNkyS(Ea>L?yx#CgP23aUl?og~B!g%=2 zVLI1vo-&k$ZrhX`pUkP8$M_!B#xi%C?i(0$!+p)>OUfcnFDiLCZ;NC3A@A8Iwx7O+ z`tgtXv2V~_gEKf1#V~9i-+O#1PhRZvn~kV#rBK2@zK`i8F|07iO&vmei7VNm@*@di zHA9_dWhL~G-y$e0?PmuQ$fsY`ENt)t?>7C|^JU6%8TPOf_W1?xu5X9U-$v|sQ*-do zQm-|ufmy$AH<51n|(Hp aAB7=xL9F5|-{N;0+0aiDzfp{|{l5XfK*m4- literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg b/spock-container-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg new file mode 100644 index 0000000..d3fe882 --- /dev/null +++ b/spock-container-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spock-container-test-app/grails-app/assets/images/grails.svg b/spock-container-test-app/grails-app/assets/images/grails.svg new file mode 100644 index 0000000..79f698b --- /dev/null +++ b/spock-container-test-app/grails-app/assets/images/grails.svg @@ -0,0 +1,13 @@ + + + + grails + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/spock-container-test-app/grails-app/assets/images/skin/database_add.png b/spock-container-test-app/grails-app/assets/images/skin/database_add.png new file mode 100644 index 0000000000000000000000000000000000000000..802bd6cde02d442288490c5f278b225e192927b5 GIT binary patch literal 658 zcmV;D0&V??P)$< zN?sD2BV4j9Yl`*+fsWQD?H_4>L?~r48B=l;Spkuc)A?yA6iP)R5d;DO`2BwH_g=3D z!!XcjG|+Ch%jCP5&1Rc|$N`LEvA9yN*EyX%X^loByIQT_h>#+l_9wi@{(Z?D2RE zUDq)j4#hY2{Z&BrR!Yn$4g z^!3C0RHpz#W@n--_jThHPEAe2R834DnuV#1kUlxXv}=C^n7~&>f1RO6h@8fUuT`wRE91*{Z%LW-oO8KckjTdf s77ewwyuEar+*b)ffn+a07*qoM6N<$f>LlT?EnA( literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/skin/database_delete.png b/spock-container-test-app/grails-app/assets/images/skin/database_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..cce652e845cde732ac3ce9a4132b597301ad660e GIT binary patch literal 659 zcmV;E0&M+>P)ps_J1 zHhTmGl@tMUh=_=a3Fb%)BqZVTW3s!xH?UsxE?7A5@n+t<@6Gq#%m~l(@IOPFT;%il z03|#}Sa4nU2-$-Kn!4}FekQv@$S0FY$L9!N0g;c={9!m8K4zLG48uSu6aw$J+ii5a zT~sO+G#ZW9!I0fqFSvY9*@h|sR=YqL#x%oU@(yD@pz0* zr-R{eDEHX6V*RaK<|4rWl@GKt@8COeKZT>%ICBq4+h_I-+?Y*V28oxmqBc+Oz5 zc>4@kzJgDe<1lkKXYEtktsNC`FoTI)4qLaF!_1E&4qv>EKx`iUcee83)!MzalltZ# z3K)~8`*H_w9^uf5^9X)<39-6>(AOuJvu0IKc#FRkFoCa%ULtC>8v6bIR-H|{S~CWm zy|LB2yL+L!Vs5g8ONBz=aUzj0EX$JbfSV}a#vT*B_2)32Uc<0oLyzLS9V$=7hM4?~ znM@`|iEa~8)bZW?7q}d~l*7K(I`+@}grT|_=WaH**u tj~DMRZZpzVy^OjT85Vq(G=8XD@S91FH}kp`d7hyPh1 z5CCa%X>*RH50W(1GMNlqE*ChCgTvu4bCM)M5Co)BDTG2HvvyYjmSvI4<)A2v`CcxU zQ79BpEEdf*P56K_c;lUWy=bic9s#4IZm`yWps?HR<^;5uf_%3rLf1Uy7}ym7{u3SG zgQxL#;V@<+y-&7GK#MIB!!Xb^&5SuEhPoOV9{wDJpWonQN~qlHho`!h-y&cUDCjiw zot3{JSR;b3Z$U9V2&bDtVsaL$Qu?FFtIb;kXm<)qqyl<=9Kq@&_)r^^)N|OJWjH)_ za7i;6X_aj`duRB^h5&`toyKA^3V-E1_yb`=eg>PPj8Y+p^vFkpk)_tg?(s>=HO~R< zNVkfdL~{$}rBQI|9QHR{MrpYhcBg@2p$?h%pAnUsbBDUeKUv#oTc6-&EEZdf$Kwze zM&QwZLDd6D&pd?=1#1F{N2f6?Hf8gwvt`>|pf)ft5F|nm_AI~XywcT&?}K--v^WN? z_7vo-s3)9F{TXfF{hpqll^q2vdwBb}datvKg-yfc+gC^|#8-K5)%lB$rlxi}-rEGO xUZ|2A>wRp~(I5;*aZFyx-fDe3J-^%i_y?+(!m^mX(n$aS002ovPDHLkV1gwlT*CkW literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/skin/database_save.png b/spock-container-test-app/grails-app/assets/images/skin/database_save.png new file mode 100644 index 0000000000000000000000000000000000000000..44c06dddf19fbda14efe428b9b1793c13f46b2cf GIT binary patch literal 755 zcmV3^_07cLZBR}_>&jXObH zw2it@svr%qE?kJ(Xuudu+DSW|WWK!jNvbU^UO02#+Tt zYOko4%Vx8c4Gh!M(=Qem7g;XcE?n0Qi^XD?&*vX7@xPFCIh;%;@xMr?(;$(vo9j9i z6;riZMJyIWG#Z6r7^-I5HtO{{DwPWQ`}>&y+Y;!yjz*&a$8prX=XtO!3$0d5J>%Mz z1f8>Jnx-7^X2#7Yb#zC2VYfZ>c17@L{s)8{OuWBa3WHFfVXfhLv2t?V0V~q5R2D*D z&315l_#iF}b>Zoo?-;+7*`WOJWsMw(x3WXv`@U*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>M&NEf08>)#)k<{$fCT_r>rPi=BV=hFh6WS^qqze>C6Ek}o{M5% za|@JGowu0t{&hgNzySHZxy@LTNh);YzZ2zSp_ zl$^T&Dnc|NLb&RD_!4>pt@VHdP)ZGER%5ZmWEe$lryR&y;2u^3cOkO4#6c%-(EY6a{600000NkvXXu0mjfxS2AI literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/skin/house.png b/spock-container-test-app/grails-app/assets/images/skin/house.png new file mode 100644 index 0000000000000000000000000000000000000000..fed62219f57cdfb854782dbadf5123c44d056bd4 GIT binary patch literal 806 zcmV+>1KIqEP)v;U&v3%|^C`Ga3?LtY&4dQB4Oz;1v;J%z!D&%WRH@BZ?x; z3)8@IUIv@hG|@IwyHLC`l{1<4BK>wam95g|i|?Cfzt876&-Zx_0f5*l-9`IJI&mHu zE6$@xB)6N}7VeR;!X8D!TAw;;&0Bsj?A071cO>X3K0wl7WZ1;Tg!4LHyNcnzoeQ7t zNW`aSlm8WXYkek&ir$13=ngczvf zV0vnjNpCF&K8px}dunv+`LIb-sOC$_jD(;IBI$xC|7`(+9cA>Vir_V#z{?k7SX^Ah z^71m~W@q439Ycqfhi7+gp#A14n1n1!e>$EdeATG|f798Y=ggzwEKH2Q!qU2QA(Se?dwqG69%>n$6rtE z%F(845Az8c{w(XgimJg96!jLMz?zS6I1HUm2baqQx7&@nx;lhHA!r6vs2|fqJETOu zLxeu2OQ(3(au%dg>AcZsWI(zXn9XJg1cLe8k~0h0wOL=&HK}7X k{AKr*U4z7Szv)i%9gTgghwgU$Q~&?~07*qoM6N<$g31kYk^lez literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/skin/information.png b/spock-container-test-app/grails-app/assets/images/skin/information.png new file mode 100644 index 0000000000000000000000000000000000000000..12cd1aef900803abba99b26920337ec01ad5c267 GIT binary patch literal 778 zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@ zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@ zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*FMR=dr@6o0ZXGBB_+=zx3%$`cG63Jm-*84Da1I50Ew7%?y?G#+5$ UVU>wEFhP-tNtBU=gM+~u00(^_>i_@% literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/skin/sorted_desc.gif b/spock-container-test-app/grails-app/assets/images/skin/sorted_desc.gif new file mode 100644 index 0000000000000000000000000000000000000000..38b3a01d078418d3afcdb2765251a9f21b7995be GIT binary patch literal 834 zcmZ?wbhEHbWMg1s_|Cu}C@83_tE;D{=jG+)?d|RKCt}{bc?%XSShQ%-?%lih?%lh8 z|9*y1Fd72GGz1iXvM@3*urla?{0GVt3>@+doD32i4hNW;7z9Kl3=A9^nYh^GDt25@ NJj%i*$Hu~74FL5|8=3$B literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/images/slack.svg b/spock-container-test-app/grails-app/assets/images/slack.svg new file mode 100644 index 0000000..34fcf4c --- /dev/null +++ b/spock-container-test-app/grails-app/assets/images/slack.svg @@ -0,0 +1,18 @@ + + + + slack_orange + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/spock-container-test-app/grails-app/assets/images/spinner.gif b/spock-container-test-app/grails-app/assets/images/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..1ed786f2ece49ec5db07dee13a56ef38025b628c GIT binary patch literal 2037 zcmY*ZcTf|19{+AO8xjIZfItFCFrkL3BodGwflvety+|>T03uy{D35o<4X`9Q3=bSU zojZMs3Qw_)j=f_!)B!!mUKqwc>ezd^4c;H{$Ifr|uTTHRC8&buXgI)uM*u&6{`~Rd zM}L3+_wV1IK7G1x-@ebEKY#i1<^B8j-@bj@wr$&s7cWknII(;8?sMnPJ$(4^-Me>t z_wN1p@#D#pCr3v|A3b`6qUeJM5ANT;KRi7A^5x65YuBDSb?WNXs}mCwVPRo|gM+(v z?RxX(&Gzlv_w3no`}XavTesf4dGq@9>xT~?_VDnybm`KK8#fLfJh*P%x(gRB?AWp6 z>({T(pFdAaOMCY0SzBA%hYueT6BF;;xnpHzb@}q;O`A4(d3im4{J5Z?;ONn#0|NsW zFJ9cgfB);(ugAv5a&vP_OG`&aMz(C(^6J&A@$vBk2M!!Re*DRkCvV@rJ%9duQ&ZFC z&6|%MJC>4?a{Bb?vuDqqIdg`~z*4Ws1>(;I2=4ORL zQCC-|R4OYgD_5;rwQSk44I4IW+_=%t&(GD>Rj=1yxpHM_Xh`ytnG&0k9<5Zz%KT@c z2mnYvQ>hsF`jQ_R5(mKIydH2saldkg!Gzlvi9nFeu<gyfnCs8|SGO1R0M3N~Sp zx@MoynP5Rh(303ldPHFemMT%$+lXy}A1JR?IwL6=E`apW=@Z-0R!QO^@j_&{6#;i|5R1o$ zJ1J~xCDQ$1cs9`DW9Z!)D)^+%&Ug81908UkMXX;jkp>#b+SE}d{`0S>>Ef(`Ns6oa zB~H-LX25y1!BDgW%?nC0$RettYz8zsuz>9Z!g8TH$kU;rwYWrSTkjuYCH9utgFU6b z*wzBKaG6IjEXYSpAo5j4&c(t zwi-c(Q6YX2N-v2q(mgN`>wuCTV&XSRUA4h-f8g+uV2k_=o;2wb`7N)&+7T-C+CT_Bu4KrjWmK>x0AbH2rmR&7+q6fX+R0o&}V!t?TP+g0{x`8PSP{7CvnEPL^Hzx^T2Eus2 zi$U6ZM7}+l%$}afWn#%|+MPTsC236GKi9-ad*Z9;Ymg?jSO$L1s$w4BvDzu_kH9>z zTWC{K?jx4~H3oGGt3}I}LWNw@H)C>9GF4^|x(5n#+Va}kr_cb>{a+K%>B+@JNrC8? zJOUkD3fe*NdA-rJupqo?FfRK}k zOm!l7Dj$dsL|kS`3FL3^@^7axrU9d*@79yf!+bu3kXbziU!v&TO3p#w{y_lYG5ZPzDh;giB_lkGp((nqZ12&%LTrgm4vY= z{ffd0B$DiUKReJ9>?{#_KVrMyhiu_A8fNd!&DWTZ4+9S|1lJHkLv-^}a0IC{WI9N! zQTY-}db!%OH^;l2ZeajnA&Q6Uv=#0KZB9;^^lzMOi^0~bS~m!&K#e6hia79(ItV9M SXP~*+AU!zMlD%~Wg#Hic*k=_0 literal 0 HcmV?d00001 diff --git a/spock-container-test-app/grails-app/assets/javascripts/application.js b/spock-container-test-app/grails-app/assets/javascripts/application.js new file mode 100644 index 0000000..6f6ef0b --- /dev/null +++ b/spock-container-test-app/grails-app/assets/javascripts/application.js @@ -0,0 +1,11 @@ +// This is a manifest file that'll be compiled into application.js. +// +// Any JavaScript file within this directory can be referenced here using a relative path. +// +// You're free to add application-wide JavaScript to this file, but it's generally better +// to create separate JavaScript files as needed. +// +//= require jquery-3.5.1.min +//= require popper.min +//= require bootstrap +//= require_self diff --git a/spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.js b/spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.js new file mode 100644 index 0000000..f2df15a --- /dev/null +++ b/spock-container-test-app/grails-app/assets/javascripts/bootstrap.bundle.js @@ -0,0 +1,6972 @@ +/*! + * Bootstrap v4.6.1 (https://getbootstrap.com/) + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : + typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery)); +})(this, (function (exports, $) { 'use strict'; + + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + + var $__default = /*#__PURE__*/_interopDefaultLegacy($); + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _extends$1() { + _extends$1 = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends$1.apply(this, arguments); + } + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + + _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.6.1): util.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + /** + * Private TransitionEnd Helpers + */ + + var TRANSITION_END = 'transitionend'; + var MAX_UID = 1000000; + var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) + + function toType(obj) { + if (obj === null || typeof obj === 'undefined') { + return "" + obj; + } + + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); + } + + function getSpecialTransitionEndEvent() { + return { + bindType: TRANSITION_END, + delegateType: TRANSITION_END, + handle: function handle(event) { + if ($__default["default"](event.target).is(this)) { + return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params + } + + return undefined; + } + }; + } + + function transitionEndEmulator(duration) { + var _this = this; + + var called = false; + $__default["default"](this).one(Util.TRANSITION_END, function () { + called = true; + }); + setTimeout(function () { + if (!called) { + Util.triggerTransitionEnd(_this); + } + }, duration); + return this; + } + + function setTransitionEndSupport() { + $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; + $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); + } + /** + * Public Util API + */ + + + var Util = { + TRANSITION_END: 'bsTransitionEnd', + getUID: function getUID(prefix) { + do { + // eslint-disable-next-line no-bitwise + prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here + } while (document.getElementById(prefix)); + + return prefix; + }, + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = element.getAttribute('data-target'); + + if (!selector || selector === '#') { + var hrefAttr = element.getAttribute('href'); + selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; + } + + try { + return document.querySelector(selector) ? selector : null; + } catch (_) { + return null; + } + }, + getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { + if (!element) { + return 0; + } // Get transition-duration of the element + + + var transitionDuration = $__default["default"](element).css('transition-duration'); + var transitionDelay = $__default["default"](element).css('transition-delay'); + var floatTransitionDuration = parseFloat(transitionDuration); + var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found + + if (!floatTransitionDuration && !floatTransitionDelay) { + return 0; + } // If multiple durations are defined, take the first + + + transitionDuration = transitionDuration.split(',')[0]; + transitionDelay = transitionDelay.split(',')[0]; + return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; + }, + reflow: function reflow(element) { + return element.offsetHeight; + }, + triggerTransitionEnd: function triggerTransitionEnd(element) { + $__default["default"](element).trigger(TRANSITION_END); + }, + supportsTransitionEnd: function supportsTransitionEnd() { + return Boolean(TRANSITION_END); + }, + isElement: function isElement(obj) { + return (obj[0] || obj).nodeType; + }, + typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { + for (var property in configTypes) { + if (Object.prototype.hasOwnProperty.call(configTypes, property)) { + var expectedTypes = configTypes[property]; + var value = config[property]; + var valueType = value && Util.isElement(value) ? 'element' : toType(value); + + if (!new RegExp(expectedTypes).test(valueType)) { + throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); + } + } + } + }, + findShadowRoot: function findShadowRoot(element) { + if (!document.documentElement.attachShadow) { + return null; + } // Can find the shadow root otherwise it'll return the document + + + if (typeof element.getRootNode === 'function') { + var root = element.getRootNode(); + return root instanceof ShadowRoot ? root : null; + } + + if (element instanceof ShadowRoot) { + return element; + } // when we don't find a shadow root + + + if (!element.parentNode) { + return null; + } + + return Util.findShadowRoot(element.parentNode); + }, + jQueryDetection: function jQueryDetection() { + if (typeof $__default["default"] === 'undefined') { + throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); + } + + var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); + var minMajor = 1; + var ltMajor = 2; + var minMinor = 9; + var minPatch = 1; + var maxMajor = 4; + + if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); + } + } + }; + Util.jQueryDetection(); + setTransitionEndSupport(); + + /** + * Constants + */ + + var NAME$a = 'alert'; + var VERSION$a = '4.6.1'; + var DATA_KEY$a = 'bs.alert'; + var EVENT_KEY$a = "." + DATA_KEY$a; + var DATA_API_KEY$7 = '.data-api'; + var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; + var CLASS_NAME_ALERT = 'alert'; + var CLASS_NAME_FADE$5 = 'fade'; + var CLASS_NAME_SHOW$7 = 'show'; + var EVENT_CLOSE = "close" + EVENT_KEY$a; + var EVENT_CLOSED = "closed" + EVENT_KEY$a; + var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; + var SELECTOR_DISMISS = '[data-dismiss="alert"]'; + /** + * Class definition + */ + + var Alert = /*#__PURE__*/function () { + function Alert(element) { + this._element = element; + } // Getters + + + var _proto = Alert.prototype; + + // Public + _proto.close = function close(element) { + var rootElement = this._element; + + if (element) { + rootElement = this._getRootElement(element); + } + + var customEvent = this._triggerCloseEvent(rootElement); + + if (customEvent.isDefaultPrevented()) { + return; + } + + this._removeElement(rootElement); + }; + + _proto.dispose = function dispose() { + $__default["default"].removeData(this._element, DATA_KEY$a); + this._element = null; + } // Private + ; + + _proto._getRootElement = function _getRootElement(element) { + var selector = Util.getSelectorFromElement(element); + var parent = false; + + if (selector) { + parent = document.querySelector(selector); + } + + if (!parent) { + parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; + } + + return parent; + }; + + _proto._triggerCloseEvent = function _triggerCloseEvent(element) { + var closeEvent = $__default["default"].Event(EVENT_CLOSE); + $__default["default"](element).trigger(closeEvent); + return closeEvent; + }; + + _proto._removeElement = function _removeElement(element) { + var _this = this; + + $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); + + if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { + this._destroyElement(element); + + return; + } + + var transitionDuration = Util.getTransitionDurationFromElement(element); + $__default["default"](element).one(Util.TRANSITION_END, function (event) { + return _this._destroyElement(element, event); + }).emulateTransitionEnd(transitionDuration); + }; + + _proto._destroyElement = function _destroyElement(element) { + $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); + } // Static + ; + + Alert._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $element = $__default["default"](this); + var data = $element.data(DATA_KEY$a); + + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY$a, data); + } + + if (config === 'close') { + data[config](this); + } + }); + }; + + Alert._handleDismiss = function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + }; + + _createClass(Alert, null, [{ + key: "VERSION", + get: function get() { + return VERSION$a; + } + }]); + + return Alert; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); + /** + * jQuery + */ + + $__default["default"].fn[NAME$a] = Alert._jQueryInterface; + $__default["default"].fn[NAME$a].Constructor = Alert; + + $__default["default"].fn[NAME$a].noConflict = function () { + $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; + return Alert._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$9 = 'button'; + var VERSION$9 = '4.6.1'; + var DATA_KEY$9 = 'bs.button'; + var EVENT_KEY$9 = "." + DATA_KEY$9; + var DATA_API_KEY$6 = '.data-api'; + var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; + var CLASS_NAME_ACTIVE$3 = 'active'; + var CLASS_NAME_BUTTON = 'btn'; + var CLASS_NAME_FOCUS = 'focus'; + var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; + var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); + var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; + var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; + var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; + var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; + var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; + var SELECTOR_INPUT = 'input:not([type="hidden"])'; + var SELECTOR_ACTIVE$2 = '.active'; + var SELECTOR_BUTTON = '.btn'; + /** + * Class definition + */ + + var Button = /*#__PURE__*/function () { + function Button(element) { + this._element = element; + this.shouldAvoidTriggerChange = false; + } // Getters + + + var _proto = Button.prototype; + + // Public + _proto.toggle = function toggle() { + var triggerChangeEvent = true; + var addAriaPressed = true; + var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; + + if (rootElement) { + var input = this._element.querySelector(SELECTOR_INPUT); + + if (input) { + if (input.type === 'radio') { + if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { + triggerChangeEvent = false; + } else { + var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); + + if (activeElement) { + $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); + } + } + } + + if (triggerChangeEvent) { + // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input + if (input.type === 'checkbox' || input.type === 'radio') { + input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); + } + + if (!this.shouldAvoidTriggerChange) { + $__default["default"](input).trigger('change'); + } + } + + input.focus(); + addAriaPressed = false; + } + } + + if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); + } + + if (triggerChangeEvent) { + $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); + } + } + }; + + _proto.dispose = function dispose() { + $__default["default"].removeData(this._element, DATA_KEY$9); + this._element = null; + } // Static + ; + + Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { + return this.each(function () { + var $element = $__default["default"](this); + var data = $element.data(DATA_KEY$9); + + if (!data) { + data = new Button(this); + $element.data(DATA_KEY$9, data); + } + + data.shouldAvoidTriggerChange = avoidTriggerChange; + + if (config === 'toggle') { + data[config](); + } + }); + }; + + _createClass(Button, null, [{ + key: "VERSION", + get: function get() { + return VERSION$9; + } + }]); + + return Button; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { + var button = event.target; + var initialButton = button; + + if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { + button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; + } + + if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { + event.preventDefault(); // work around Firefox bug #1540995 + } else { + var inputBtn = button.querySelector(SELECTOR_INPUT); + + if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { + event.preventDefault(); // work around Firefox bug #1540995 + + return; + } + + if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { + Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); + } + } + }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { + var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; + $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); + }); + $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { + // ensure correct active class is set to match the controls' actual values/states + // find all checkboxes/readio buttons inside data-toggle groups + var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); + + for (var i = 0, len = buttons.length; i < len; i++) { + var button = buttons[i]; + var input = button.querySelector(SELECTOR_INPUT); + + if (input.checked || input.hasAttribute('checked')) { + button.classList.add(CLASS_NAME_ACTIVE$3); + } else { + button.classList.remove(CLASS_NAME_ACTIVE$3); + } + } // find all button toggles + + + buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); + + for (var _i = 0, _len = buttons.length; _i < _len; _i++) { + var _button = buttons[_i]; + + if (_button.getAttribute('aria-pressed') === 'true') { + _button.classList.add(CLASS_NAME_ACTIVE$3); + } else { + _button.classList.remove(CLASS_NAME_ACTIVE$3); + } + } + }); + /** + * jQuery + */ + + $__default["default"].fn[NAME$9] = Button._jQueryInterface; + $__default["default"].fn[NAME$9].Constructor = Button; + + $__default["default"].fn[NAME$9].noConflict = function () { + $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; + return Button._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$8 = 'carousel'; + var VERSION$8 = '4.6.1'; + var DATA_KEY$8 = 'bs.carousel'; + var EVENT_KEY$8 = "." + DATA_KEY$8; + var DATA_API_KEY$5 = '.data-api'; + var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; + var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key + + var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key + + var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch + + var SWIPE_THRESHOLD = 40; + var CLASS_NAME_CAROUSEL = 'carousel'; + var CLASS_NAME_ACTIVE$2 = 'active'; + var CLASS_NAME_SLIDE = 'slide'; + var CLASS_NAME_RIGHT = 'carousel-item-right'; + var CLASS_NAME_LEFT = 'carousel-item-left'; + var CLASS_NAME_NEXT = 'carousel-item-next'; + var CLASS_NAME_PREV = 'carousel-item-prev'; + var CLASS_NAME_POINTER_EVENT = 'pointer-event'; + var DIRECTION_NEXT = 'next'; + var DIRECTION_PREV = 'prev'; + var DIRECTION_LEFT = 'left'; + var DIRECTION_RIGHT = 'right'; + var EVENT_SLIDE = "slide" + EVENT_KEY$8; + var EVENT_SLID = "slid" + EVENT_KEY$8; + var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; + var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; + var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; + var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; + var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; + var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; + var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; + var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; + var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; + var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; + var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; + var SELECTOR_ACTIVE$1 = '.active'; + var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; + var SELECTOR_ITEM = '.carousel-item'; + var SELECTOR_ITEM_IMG = '.carousel-item img'; + var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; + var SELECTOR_INDICATORS = '.carousel-indicators'; + var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; + var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; + var Default$7 = { + interval: 5000, + keyboard: true, + slide: false, + pause: 'hover', + wrap: true, + touch: true + }; + var DefaultType$7 = { + interval: '(number|boolean)', + keyboard: 'boolean', + slide: '(boolean|string)', + pause: '(string|boolean)', + wrap: 'boolean', + touch: 'boolean' + }; + var PointerType = { + TOUCH: 'touch', + PEN: 'pen' + }; + /** + * Class definition + */ + + var Carousel = /*#__PURE__*/function () { + function Carousel(element, config) { + this._items = null; + this._interval = null; + this._activeElement = null; + this._isPaused = false; + this._isSliding = false; + this.touchTimeout = null; + this.touchStartX = 0; + this.touchDeltaX = 0; + this._config = this._getConfig(config); + this._element = element; + this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); + this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; + this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); + + this._addEventListeners(); + } // Getters + + + var _proto = Carousel.prototype; + + // Public + _proto.next = function next() { + if (!this._isSliding) { + this._slide(DIRECTION_NEXT); + } + }; + + _proto.nextWhenVisible = function nextWhenVisible() { + var $element = $__default["default"](this._element); // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + + if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { + this.next(); + } + }; + + _proto.prev = function prev() { + if (!this._isSliding) { + this._slide(DIRECTION_PREV); + } + }; + + _proto.pause = function pause(event) { + if (!event) { + this._isPaused = true; + } + + if (this._element.querySelector(SELECTOR_NEXT_PREV)) { + Util.triggerTransitionEnd(this._element); + this.cycle(true); + } + + clearInterval(this._interval); + this._interval = null; + }; + + _proto.cycle = function cycle(event) { + if (!event) { + this._isPaused = false; + } + + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } + + if (this._config.interval && !this._isPaused) { + this._updateInterval(); + + this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); + } + }; + + _proto.to = function to(index) { + var _this = this; + + this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); + + var activeIndex = this._getItemIndex(this._activeElement); + + if (index > this._items.length - 1 || index < 0) { + return; + } + + if (this._isSliding) { + $__default["default"](this._element).one(EVENT_SLID, function () { + return _this.to(index); + }); + return; + } + + if (activeIndex === index) { + this.pause(); + this.cycle(); + return; + } + + var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; + + this._slide(direction, this._items[index]); + }; + + _proto.dispose = function dispose() { + $__default["default"](this._element).off(EVENT_KEY$8); + $__default["default"].removeData(this._element, DATA_KEY$8); + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + } // Private + ; + + _proto._getConfig = function _getConfig(config) { + config = _extends$1({}, Default$7, config); + Util.typeCheckConfig(NAME$8, config, DefaultType$7); + return config; + }; + + _proto._handleSwipe = function _handleSwipe() { + var absDeltax = Math.abs(this.touchDeltaX); + + if (absDeltax <= SWIPE_THRESHOLD) { + return; + } + + var direction = absDeltax / this.touchDeltaX; + this.touchDeltaX = 0; // swipe left + + if (direction > 0) { + this.prev(); + } // swipe right + + + if (direction < 0) { + this.next(); + } + }; + + _proto._addEventListeners = function _addEventListeners() { + var _this2 = this; + + if (this._config.keyboard) { + $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { + return _this2._keydown(event); + }); + } + + if (this._config.pause === 'hover') { + $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { + return _this2.pause(event); + }).on(EVENT_MOUSELEAVE, function (event) { + return _this2.cycle(event); + }); + } + + if (this._config.touch) { + this._addTouchEventListeners(); + } + }; + + _proto._addTouchEventListeners = function _addTouchEventListeners() { + var _this3 = this; + + if (!this._touchSupported) { + return; + } + + var start = function start(event) { + if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { + _this3.touchStartX = event.originalEvent.clientX; + } else if (!_this3._pointerEvent) { + _this3.touchStartX = event.originalEvent.touches[0].clientX; + } + }; + + var move = function move(event) { + // ensure swiping with one touch and not pinching + _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; + }; + + var end = function end(event) { + if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { + _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; + } + + _this3._handleSwipe(); + + if (_this3._config.pause === 'hover') { + // If it's a touch-enabled device, mouseenter/leave are fired as + // part of the mouse compatibility events on first tap - the carousel + // would stop cycling until user tapped out of it; + // here, we listen for touchend, explicitly pause the carousel + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + _this3.pause(); + + if (_this3.touchTimeout) { + clearTimeout(_this3.touchTimeout); + } + + _this3.touchTimeout = setTimeout(function (event) { + return _this3.cycle(event); + }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); + } + }; + + $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { + return e.preventDefault(); + }); + + if (this._pointerEvent) { + $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { + return start(event); + }); + $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { + return end(event); + }); + + this._element.classList.add(CLASS_NAME_POINTER_EVENT); + } else { + $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { + return start(event); + }); + $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { + return move(event); + }); + $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { + return end(event); + }); + } + }; + + _proto._keydown = function _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + event.preventDefault(); + this.prev(); + break; + + case ARROW_RIGHT_KEYCODE: + event.preventDefault(); + this.next(); + break; + } + }; + + _proto._getItemIndex = function _getItemIndex(element) { + this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; + return this._items.indexOf(element); + }; + + _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === DIRECTION_NEXT; + var isPrevDirection = direction === DIRECTION_PREV; + + var activeIndex = this._getItemIndex(activeElement); + + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } + + var delta = direction === DIRECTION_PREV ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + }; + + _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + + var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); + + var slideEvent = $__default["default"].Event(EVENT_SLIDE, { + relatedTarget: relatedTarget, + direction: eventDirectionName, + from: fromIndex, + to: targetIndex + }); + $__default["default"](this._element).trigger(slideEvent); + return slideEvent; + }; + + _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); + $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); + + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + + if (nextIndicator) { + $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); + } + } + }; + + _proto._updateInterval = function _updateInterval() { + var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); + + if (!element) { + return; + } + + var elementInterval = parseInt(element.getAttribute('data-interval'), 10); + + if (elementInterval) { + this._config.defaultInterval = this._config.defaultInterval || this._config.interval; + this._config.interval = elementInterval; + } else { + this._config.interval = this._config.defaultInterval || this._config.interval; + } + }; + + _proto._slide = function _slide(direction, element) { + var _this4 = this; + + var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); + + var activeElementIndex = this._getItemIndex(activeElement); + + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + + var nextElementIndex = this._getItemIndex(nextElement); + + var isCycling = Boolean(this._interval); + var directionalClassName; + var orderClassName; + var eventDirectionName; + + if (direction === DIRECTION_NEXT) { + directionalClassName = CLASS_NAME_LEFT; + orderClassName = CLASS_NAME_NEXT; + eventDirectionName = DIRECTION_LEFT; + } else { + directionalClassName = CLASS_NAME_RIGHT; + orderClassName = CLASS_NAME_PREV; + eventDirectionName = DIRECTION_RIGHT; + } + + if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { + this._isSliding = false; + return; + } + + var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); + + if (slideEvent.isDefaultPrevented()) { + return; + } + + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + return; + } + + this._isSliding = true; + + if (isCycling) { + this.pause(); + } + + this._setActiveIndicatorElement(nextElement); + + this._activeElement = nextElement; + var slidEvent = $__default["default"].Event(EVENT_SLID, { + relatedTarget: nextElement, + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex + }); + + if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { + $__default["default"](nextElement).addClass(orderClassName); + Util.reflow(nextElement); + $__default["default"](activeElement).addClass(directionalClassName); + $__default["default"](nextElement).addClass(directionalClassName); + var transitionDuration = Util.getTransitionDurationFromElement(activeElement); + $__default["default"](activeElement).one(Util.TRANSITION_END, function () { + $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); + $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); + _this4._isSliding = false; + setTimeout(function () { + return $__default["default"](_this4._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(transitionDuration); + } else { + $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); + $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); + this._isSliding = false; + $__default["default"](this._element).trigger(slidEvent); + } + + if (isCycling) { + this.cycle(); + } + } // Static + ; + + Carousel._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $__default["default"](this).data(DATA_KEY$8); + + var _config = _extends$1({}, Default$7, $__default["default"](this).data()); + + if (typeof config === 'object') { + _config = _extends$1({}, _config, config); + } + + var action = typeof config === 'string' ? config : _config.slide; + + if (!data) { + data = new Carousel(this, _config); + $__default["default"](this).data(DATA_KEY$8, data); + } + + if (typeof config === 'number') { + data.to(config); + } else if (typeof action === 'string') { + if (typeof data[action] === 'undefined') { + throw new TypeError("No method named \"" + action + "\""); + } + + data[action](); + } else if (_config.interval && _config.ride) { + data.pause(); + data.cycle(); + } + }); + }; + + Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { + var selector = Util.getSelectorFromElement(this); + + if (!selector) { + return; + } + + var target = $__default["default"](selector)[0]; + + if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { + return; + } + + var config = _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data()); + + var slideIndex = this.getAttribute('data-slide-to'); + + if (slideIndex) { + config.interval = false; + } + + Carousel._jQueryInterface.call($__default["default"](target), config); + + if (slideIndex) { + $__default["default"](target).data(DATA_KEY$8).to(slideIndex); + } + + event.preventDefault(); + }; + + _createClass(Carousel, null, [{ + key: "VERSION", + get: function get() { + return VERSION$8; + } + }, { + key: "Default", + get: function get() { + return Default$7; + } + }]); + + return Carousel; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); + $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { + var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); + + for (var i = 0, len = carousels.length; i < len; i++) { + var $carousel = $__default["default"](carousels[i]); + + Carousel._jQueryInterface.call($carousel, $carousel.data()); + } + }); + /** + * jQuery + */ + + $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; + $__default["default"].fn[NAME$8].Constructor = Carousel; + + $__default["default"].fn[NAME$8].noConflict = function () { + $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; + return Carousel._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$7 = 'collapse'; + var VERSION$7 = '4.6.1'; + var DATA_KEY$7 = 'bs.collapse'; + var EVENT_KEY$7 = "." + DATA_KEY$7; + var DATA_API_KEY$4 = '.data-api'; + var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; + var CLASS_NAME_SHOW$6 = 'show'; + var CLASS_NAME_COLLAPSE = 'collapse'; + var CLASS_NAME_COLLAPSING = 'collapsing'; + var CLASS_NAME_COLLAPSED = 'collapsed'; + var DIMENSION_WIDTH = 'width'; + var DIMENSION_HEIGHT = 'height'; + var EVENT_SHOW$4 = "show" + EVENT_KEY$7; + var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; + var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; + var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; + var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; + var SELECTOR_ACTIVES = '.show, .collapsing'; + var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; + var Default$6 = { + toggle: true, + parent: '' + }; + var DefaultType$6 = { + toggle: 'boolean', + parent: '(string|element)' + }; + /** + * Class definition + */ + + var Collapse = /*#__PURE__*/function () { + function Collapse(element, config) { + this._isTransitioning = false; + this._element = element; + this._config = this._getConfig(config); + this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); + var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); + + for (var i = 0, len = toggleList.length; i < len; i++) { + var elem = toggleList[i]; + var selector = Util.getSelectorFromElement(elem); + var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { + return foundElem === element; + }); + + if (selector !== null && filterElement.length > 0) { + this._selector = selector; + + this._triggerArray.push(elem); + } + } + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } + + if (this._config.toggle) { + this.toggle(); + } + } // Getters + + + var _proto = Collapse.prototype; + + // Public + _proto.toggle = function toggle() { + if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { + this.hide(); + } else { + this.show(); + } + }; + + _proto.show = function show() { + var _this = this; + + if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { + return; + } + + var actives; + var activesData; + + if (this._parent) { + actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { + if (typeof _this._config.parent === 'string') { + return elem.getAttribute('data-parent') === _this._config.parent; + } + + return elem.classList.contains(CLASS_NAME_COLLAPSE); + }); + + if (actives.length === 0) { + actives = null; + } + } + + if (actives) { + activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); + + if (activesData && activesData._isTransitioning) { + return; + } + } + + var startEvent = $__default["default"].Event(EVENT_SHOW$4); + $__default["default"](this._element).trigger(startEvent); + + if (startEvent.isDefaultPrevented()) { + return; + } + + if (actives) { + Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); + + if (!activesData) { + $__default["default"](actives).data(DATA_KEY$7, null); + } + } + + var dimension = this._getDimension(); + + $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); + this._element.style[dimension] = 0; + + if (this._triggerArray.length) { + $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); + } + + this.setTransitioning(true); + + var complete = function complete() { + $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); + _this._element.style[dimension] = ''; + + _this.setTransitioning(false); + + $__default["default"](_this._element).trigger(EVENT_SHOWN$4); + }; + + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = "scroll" + capitalizedDimension; + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + this._element.style[dimension] = this._element[scrollSize] + "px"; + }; + + _proto.hide = function hide() { + var _this2 = this; + + if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { + return; + } + + var startEvent = $__default["default"].Event(EVENT_HIDE$4); + $__default["default"](this._element).trigger(startEvent); + + if (startEvent.isDefaultPrevented()) { + return; + } + + var dimension = this._getDimension(); + + this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; + Util.reflow(this._element); + $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); + var triggerArrayLength = this._triggerArray.length; + + if (triggerArrayLength > 0) { + for (var i = 0; i < triggerArrayLength; i++) { + var trigger = this._triggerArray[i]; + var selector = Util.getSelectorFromElement(trigger); + + if (selector !== null) { + var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); + + if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { + $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); + } + } + } + } + + this.setTransitioning(true); + + var complete = function complete() { + _this2.setTransitioning(false); + + $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); + }; + + this._element.style[dimension] = ''; + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + }; + + _proto.setTransitioning = function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + }; + + _proto.dispose = function dispose() { + $__default["default"].removeData(this._element, DATA_KEY$7); + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + } // Private + ; + + _proto._getConfig = function _getConfig(config) { + config = _extends$1({}, Default$6, config); + config.toggle = Boolean(config.toggle); // Coerce string values + + Util.typeCheckConfig(NAME$7, config, DefaultType$6); + return config; + }; + + _proto._getDimension = function _getDimension() { + var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); + return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; + }; + + _proto._getParent = function _getParent() { + var _this3 = this; + + var parent; + + if (Util.isElement(this._config.parent)) { + parent = this._config.parent; // It's a jQuery object + + if (typeof this._config.parent.jquery !== 'undefined') { + parent = this._config.parent[0]; + } + } else { + parent = document.querySelector(this._config.parent); + } + + var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; + var children = [].slice.call(parent.querySelectorAll(selector)); + $__default["default"](children).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); + return parent; + }; + + _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { + var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); + + if (triggerArray.length) { + $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } + } // Static + ; + + Collapse._getTargetFromElement = function _getTargetFromElement(element) { + var selector = Util.getSelectorFromElement(element); + return selector ? document.querySelector(selector) : null; + }; + + Collapse._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $element = $__default["default"](this); + var data = $element.data(DATA_KEY$7); + + var _config = _extends$1({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); + + if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $element.data(DATA_KEY$7, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Collapse, null, [{ + key: "VERSION", + get: function get() { + return VERSION$7; + } + }, { + key: "Default", + get: function get() { + return Default$6; + } + }]); + + return Collapse; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { + // preventDefault only for elements (which change the URL) not inside the collapsible element + if (event.currentTarget.tagName === 'A') { + event.preventDefault(); + } + + var $trigger = $__default["default"](this); + var selector = Util.getSelectorFromElement(this); + var selectors = [].slice.call(document.querySelectorAll(selector)); + $__default["default"](selectors).each(function () { + var $target = $__default["default"](this); + var data = $target.data(DATA_KEY$7); + var config = data ? 'toggle' : $trigger.data(); + + Collapse._jQueryInterface.call($target, config); + }); + }); + /** + * jQuery + */ + + $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; + $__default["default"].fn[NAME$7].Constructor = Collapse; + + $__default["default"].fn[NAME$7].noConflict = function () { + $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; + return Collapse._jQueryInterface; + }; + + /**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.16.1 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; + + var timeoutDuration = function () { + var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; + for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { + if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { + return 1; + } + } + return 0; + }(); + + function microtaskDebounce(fn) { + var called = false; + return function () { + if (called) { + return; + } + called = true; + window.Promise.resolve().then(function () { + called = false; + fn(); + }); + }; + } + + function taskDebounce(fn) { + var scheduled = false; + return function () { + if (!scheduled) { + scheduled = true; + setTimeout(function () { + scheduled = false; + fn(); + }, timeoutDuration); + } + }; + } + + var supportsMicroTasks = isBrowser && window.Promise; + + /** + * Create a debounced version of a method, that's asynchronously deferred + * but called in the minimum time possible. + * + * @method + * @memberof Popper.Utils + * @argument {Function} fn + * @returns {Function} + */ + var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; + + /** + * Check if the given variable is a function + * @method + * @memberof Popper.Utils + * @argument {Any} functionToCheck - variable to check + * @returns {Boolean} answer to: is a function? + */ + function isFunction(functionToCheck) { + var getType = {}; + return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; + } + + /** + * Get CSS computed property of the given element + * @method + * @memberof Popper.Utils + * @argument {Eement} element + * @argument {String} property + */ + function getStyleComputedProperty(element, property) { + if (element.nodeType !== 1) { + return []; + } + // NOTE: 1 DOM access here + var window = element.ownerDocument.defaultView; + var css = window.getComputedStyle(element, null); + return property ? css[property] : css; + } + + /** + * Returns the parentNode or the host of the element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} parent + */ + function getParentNode(element) { + if (element.nodeName === 'HTML') { + return element; + } + return element.parentNode || element.host; + } + + /** + * Returns the scrolling parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} scroll parent + */ + function getScrollParent(element) { + // Return body, `getScroll` will take care to get the correct `scrollTop` from it + if (!element) { + return document.body; + } + + switch (element.nodeName) { + case 'HTML': + case 'BODY': + return element.ownerDocument.body; + case '#document': + return element.body; + } + + // Firefox want us to check `-x` and `-y` variations as well + + var _getStyleComputedProp = getStyleComputedProperty(element), + overflow = _getStyleComputedProp.overflow, + overflowX = _getStyleComputedProp.overflowX, + overflowY = _getStyleComputedProp.overflowY; + + if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { + return element; + } + + return getScrollParent(getParentNode(element)); + } + + /** + * Returns the reference node of the reference object, or the reference object itself. + * @method + * @memberof Popper.Utils + * @param {Element|Object} reference - the reference element (the popper will be relative to this) + * @returns {Element} parent + */ + function getReferenceNode(reference) { + return reference && reference.referenceNode ? reference.referenceNode : reference; + } + + var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); + var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); + + /** + * Determines if the browser is Internet Explorer + * @method + * @memberof Popper.Utils + * @param {Number} version to check + * @returns {Boolean} isIE + */ + function isIE(version) { + if (version === 11) { + return isIE11; + } + if (version === 10) { + return isIE10; + } + return isIE11 || isIE10; + } + + /** + * Returns the offset parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} offset parent + */ + function getOffsetParent(element) { + if (!element) { + return document.documentElement; + } + + var noOffsetParent = isIE(10) ? document.body : null; + + // NOTE: 1 DOM access here + var offsetParent = element.offsetParent || null; + // Skip hidden elements which don't have an offsetParent + while (offsetParent === noOffsetParent && element.nextElementSibling) { + offsetParent = (element = element.nextElementSibling).offsetParent; + } + + var nodeName = offsetParent && offsetParent.nodeName; + + if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { + return element ? element.ownerDocument.documentElement : document.documentElement; + } + + // .offsetParent will return the closest TH, TD or TABLE in case + // no offsetParent is present, I hate this job... + if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { + return getOffsetParent(offsetParent); + } + + return offsetParent; + } + + function isOffsetContainer(element) { + var nodeName = element.nodeName; + + if (nodeName === 'BODY') { + return false; + } + return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; + } + + /** + * Finds the root node (document, shadowDOM root) of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} node + * @returns {Element} root node + */ + function getRoot(node) { + if (node.parentNode !== null) { + return getRoot(node.parentNode); + } + + return node; + } + + /** + * Finds the offset parent common to the two provided nodes + * @method + * @memberof Popper.Utils + * @argument {Element} element1 + * @argument {Element} element2 + * @returns {Element} common offset parent + */ + function findCommonOffsetParent(element1, element2) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { + return document.documentElement; + } + + // Here we make sure to give as "start" the element that comes first in the DOM + var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; + var start = order ? element1 : element2; + var end = order ? element2 : element1; + + // Get common ancestor container + var range = document.createRange(); + range.setStart(start, 0); + range.setEnd(end, 0); + var commonAncestorContainer = range.commonAncestorContainer; + + // Both nodes are inside #document + + if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { + if (isOffsetContainer(commonAncestorContainer)) { + return commonAncestorContainer; + } + + return getOffsetParent(commonAncestorContainer); + } + + // one of the nodes is inside shadowDOM, find which one + var element1root = getRoot(element1); + if (element1root.host) { + return findCommonOffsetParent(element1root.host, element2); + } else { + return findCommonOffsetParent(element1, getRoot(element2).host); + } + } + + /** + * Gets the scroll value of the given element in the given side (top and left) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {String} side `top` or `left` + * @returns {number} amount of scrolled pixels + */ + function getScroll(element) { + var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; + + var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; + var nodeName = element.nodeName; + + if (nodeName === 'BODY' || nodeName === 'HTML') { + var html = element.ownerDocument.documentElement; + var scrollingElement = element.ownerDocument.scrollingElement || html; + return scrollingElement[upperSide]; + } + + return element[upperSide]; + } + + /* + * Sum or subtract the element scroll values (left and top) from a given rect object + * @method + * @memberof Popper.Utils + * @param {Object} rect - Rect object you want to change + * @param {HTMLElement} element - The element from the function reads the scroll values + * @param {Boolean} subtract - set to true if you want to subtract the scroll values + * @return {Object} rect - The modifier rect object + */ + function includeScroll(rect, element) { + var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + var modifier = subtract ? -1 : 1; + rect.top += scrollTop * modifier; + rect.bottom += scrollTop * modifier; + rect.left += scrollLeft * modifier; + rect.right += scrollLeft * modifier; + return rect; + } + + /* + * Helper to detect borders of a given element + * @method + * @memberof Popper.Utils + * @param {CSSStyleDeclaration} styles + * Result of `getStyleComputedProperty` on the given element + * @param {String} axis - `x` or `y` + * @return {number} borders - The borders size of the given axis + */ + + function getBordersSize(styles, axis) { + var sideA = axis === 'x' ? 'Left' : 'Top'; + var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; + + return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); + } + + function getSize(axis, body, html, computedStyle) { + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); + } + + function getWindowSizes(document) { + var body = document.body; + var html = document.documentElement; + var computedStyle = isIE(10) && getComputedStyle(html); + + return { + height: getSize('Height', body, html, computedStyle), + width: getSize('Width', body, html, computedStyle) + }; + } + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + + + + + var defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + }; + + var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + /** + * Given element offsets, generate an output similar to getBoundingClientRect + * @method + * @memberof Popper.Utils + * @argument {Object} offsets + * @returns {Object} ClientRect like output + */ + function getClientRect(offsets) { + return _extends({}, offsets, { + right: offsets.left + offsets.width, + bottom: offsets.top + offsets.height + }); + } + + /** + * Get bounding client rect of given element + * @method + * @memberof Popper.Utils + * @param {HTMLElement} element + * @return {Object} client rect + */ + function getBoundingClientRect(element) { + var rect = {}; + + // IE10 10 FIX: Please, don't ask, the element isn't + // considered in DOM in some circumstances... + // This isn't reproducible in IE10 compatibility mode of IE11 + try { + if (isIE(10)) { + rect = element.getBoundingClientRect(); + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + rect.top += scrollTop; + rect.left += scrollLeft; + rect.bottom += scrollTop; + rect.right += scrollLeft; + } else { + rect = element.getBoundingClientRect(); + } + } catch (e) {} + + var result = { + left: rect.left, + top: rect.top, + width: rect.right - rect.left, + height: rect.bottom - rect.top + }; + + // subtract scrollbar size from sizes + var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; + var width = sizes.width || element.clientWidth || result.width; + var height = sizes.height || element.clientHeight || result.height; + + var horizScrollbar = element.offsetWidth - width; + var vertScrollbar = element.offsetHeight - height; + + // if an hypothetical scrollbar is detected, we must be sure it's not a `border` + // we make this check conditional for performance reasons + if (horizScrollbar || vertScrollbar) { + var styles = getStyleComputedProperty(element); + horizScrollbar -= getBordersSize(styles, 'x'); + vertScrollbar -= getBordersSize(styles, 'y'); + + result.width -= horizScrollbar; + result.height -= vertScrollbar; + } + + return getClientRect(result); + } + + function getOffsetRectRelativeToArbitraryNode(children, parent) { + var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var isIE10 = isIE(10); + var isHTML = parent.nodeName === 'HTML'; + var childrenRect = getBoundingClientRect(children); + var parentRect = getBoundingClientRect(parent); + var scrollParent = getScrollParent(children); + + var styles = getStyleComputedProperty(parent); + var borderTopWidth = parseFloat(styles.borderTopWidth); + var borderLeftWidth = parseFloat(styles.borderLeftWidth); + + // In cases where the parent is fixed, we must ignore negative scroll in offset calc + if (fixedPosition && isHTML) { + parentRect.top = Math.max(parentRect.top, 0); + parentRect.left = Math.max(parentRect.left, 0); + } + var offsets = getClientRect({ + top: childrenRect.top - parentRect.top - borderTopWidth, + left: childrenRect.left - parentRect.left - borderLeftWidth, + width: childrenRect.width, + height: childrenRect.height + }); + offsets.marginTop = 0; + offsets.marginLeft = 0; + + // Subtract margins of documentElement in case it's being used as parent + // we do this only on HTML because it's the only element that behaves + // differently when margins are applied to it. The margins are included in + // the box of the documentElement, in the other cases not. + if (!isIE10 && isHTML) { + var marginTop = parseFloat(styles.marginTop); + var marginLeft = parseFloat(styles.marginLeft); + + offsets.top -= borderTopWidth - marginTop; + offsets.bottom -= borderTopWidth - marginTop; + offsets.left -= borderLeftWidth - marginLeft; + offsets.right -= borderLeftWidth - marginLeft; + + // Attach marginTop and marginLeft because in some circumstances we may need them + offsets.marginTop = marginTop; + offsets.marginLeft = marginLeft; + } + + if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { + offsets = includeScroll(offsets, parent); + } + + return offsets; + } + + function getViewportOffsetRectRelativeToArtbitraryNode(element) { + var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var html = element.ownerDocument.documentElement; + var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); + var width = Math.max(html.clientWidth, window.innerWidth || 0); + var height = Math.max(html.clientHeight, window.innerHeight || 0); + + var scrollTop = !excludeScroll ? getScroll(html) : 0; + var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; + + var offset = { + top: scrollTop - relativeOffset.top + relativeOffset.marginTop, + left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, + width: width, + height: height + }; + + return getClientRect(offset); + } + + /** + * Check if the given element is fixed or is inside a fixed parent + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {Element} customContainer + * @returns {Boolean} answer to "isFixed?" + */ + function isFixed(element) { + var nodeName = element.nodeName; + if (nodeName === 'BODY' || nodeName === 'HTML') { + return false; + } + if (getStyleComputedProperty(element, 'position') === 'fixed') { + return true; + } + var parentNode = getParentNode(element); + if (!parentNode) { + return false; + } + return isFixed(parentNode); + } + + /** + * Finds the first parent of an element that has a transformed property defined + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} first transformed parent or documentElement + */ + + function getFixedPositionOffsetParent(element) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element || !element.parentElement || isIE()) { + return document.documentElement; + } + var el = element.parentElement; + while (el && getStyleComputedProperty(el, 'transform') === 'none') { + el = el.parentElement; + } + return el || document.documentElement; + } + + /** + * Computed the boundaries limits and return them + * @method + * @memberof Popper.Utils + * @param {HTMLElement} popper + * @param {HTMLElement} reference + * @param {number} padding + * @param {HTMLElement} boundariesElement - Element used to define the boundaries + * @param {Boolean} fixedPosition - Is in fixed position mode + * @returns {Object} Coordinates of the boundaries + */ + function getBoundaries(popper, reference, padding, boundariesElement) { + var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + // NOTE: 1 DOM access here + + var boundaries = { top: 0, left: 0 }; + var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); + + // Handle viewport case + if (boundariesElement === 'viewport') { + boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); + } else { + // Handle other cases based on DOM element used as boundaries + var boundariesNode = void 0; + if (boundariesElement === 'scrollParent') { + boundariesNode = getScrollParent(getParentNode(reference)); + if (boundariesNode.nodeName === 'BODY') { + boundariesNode = popper.ownerDocument.documentElement; + } + } else if (boundariesElement === 'window') { + boundariesNode = popper.ownerDocument.documentElement; + } else { + boundariesNode = boundariesElement; + } + + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); + + // In case of HTML, we need a different computation + if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { + var _getWindowSizes = getWindowSizes(popper.ownerDocument), + height = _getWindowSizes.height, + width = _getWindowSizes.width; + + boundaries.top += offsets.top - offsets.marginTop; + boundaries.bottom = height + offsets.top; + boundaries.left += offsets.left - offsets.marginLeft; + boundaries.right = width + offsets.left; + } else { + // for all the other DOM elements, this one is good + boundaries = offsets; + } + } + + // Add paddings + padding = padding || 0; + var isPaddingNumber = typeof padding === 'number'; + boundaries.left += isPaddingNumber ? padding : padding.left || 0; + boundaries.top += isPaddingNumber ? padding : padding.top || 0; + boundaries.right -= isPaddingNumber ? padding : padding.right || 0; + boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; + + return boundaries; + } + + function getArea(_ref) { + var width = _ref.width, + height = _ref.height; + + return width * height; + } + + /** + * Utility used to transform the `auto` placement to the placement with more + * available space. + * @method + * @memberof Popper.Utils + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { + var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + + if (placement.indexOf('auto') === -1) { + return placement; + } + + var boundaries = getBoundaries(popper, reference, padding, boundariesElement); + + var rects = { + top: { + width: boundaries.width, + height: refRect.top - boundaries.top + }, + right: { + width: boundaries.right - refRect.right, + height: boundaries.height + }, + bottom: { + width: boundaries.width, + height: boundaries.bottom - refRect.bottom + }, + left: { + width: refRect.left - boundaries.left, + height: boundaries.height + } + }; + + var sortedAreas = Object.keys(rects).map(function (key) { + return _extends({ + key: key + }, rects[key], { + area: getArea(rects[key]) + }); + }).sort(function (a, b) { + return b.area - a.area; + }); + + var filteredAreas = sortedAreas.filter(function (_ref2) { + var width = _ref2.width, + height = _ref2.height; + return width >= popper.clientWidth && height >= popper.clientHeight; + }); + + var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; + + var variation = placement.split('-')[1]; + + return computedPlacement + (variation ? '-' + variation : ''); + } + + /** + * Get offsets to the reference element + * @method + * @memberof Popper.Utils + * @param {Object} state + * @param {Element} popper - the popper element + * @param {Element} reference - the reference element (the popper will be relative to this) + * @param {Element} fixedPosition - is in fixed position mode + * @returns {Object} An object containing the offsets which will be applied to the popper + */ + function getReferenceOffsets(state, popper, reference) { + var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); + return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); + } + + /** + * Get the outer sizes of the given element (offset size + margins) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Object} object containing width and height properties + */ + function getOuterSizes(element) { + var window = element.ownerDocument.defaultView; + var styles = window.getComputedStyle(element); + var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); + var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); + var result = { + width: element.offsetWidth + y, + height: element.offsetHeight + x + }; + return result; + } + + /** + * Get the opposite placement of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement + * @returns {String} flipped placement + */ + function getOppositePlacement(placement) { + var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); + } + + /** + * Get offsets to the popper + * @method + * @memberof Popper.Utils + * @param {Object} position - CSS position the Popper will get applied + * @param {HTMLElement} popper - the popper element + * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) + * @param {String} placement - one of the valid placement options + * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper + */ + function getPopperOffsets(popper, referenceOffsets, placement) { + placement = placement.split('-')[0]; + + // Get popper node sizes + var popperRect = getOuterSizes(popper); + + // Add position, width and height to our offsets object + var popperOffsets = { + width: popperRect.width, + height: popperRect.height + }; + + // depending by the popper placement we have to compute its offsets slightly differently + var isHoriz = ['right', 'left'].indexOf(placement) !== -1; + var mainSide = isHoriz ? 'top' : 'left'; + var secondarySide = isHoriz ? 'left' : 'top'; + var measurement = isHoriz ? 'height' : 'width'; + var secondaryMeasurement = !isHoriz ? 'height' : 'width'; + + popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; + if (placement === secondarySide) { + popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; + } else { + popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; + } + + return popperOffsets; + } + + /** + * Mimics the `find` method of Array + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ + function find(arr, check) { + // use native find if supported + if (Array.prototype.find) { + return arr.find(check); + } + + // use `filter` to obtain the same behavior of `find` + return arr.filter(check)[0]; + } + + /** + * Return the index of the matching object + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ + function findIndex(arr, prop, value) { + // use native findIndex if supported + if (Array.prototype.findIndex) { + return arr.findIndex(function (cur) { + return cur[prop] === value; + }); + } + + // use `find` + `indexOf` if `findIndex` isn't supported + var match = find(arr, function (obj) { + return obj[prop] === value; + }); + return arr.indexOf(match); + } + + /** + * Loop trough the list of modifiers and run them in order, + * each of them will then edit the data object. + * @method + * @memberof Popper.Utils + * @param {dataObject} data + * @param {Array} modifiers + * @param {String} ends - Optional modifier name used as stopper + * @returns {dataObject} + */ + function runModifiers(modifiers, data, ends) { + var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); + + modifiersToRun.forEach(function (modifier) { + if (modifier['function']) { + // eslint-disable-line dot-notation + console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); + } + var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation + if (modifier.enabled && isFunction(fn)) { + // Add properties to offsets to make them a complete clientRect object + // we do this before each modifier to make sure the previous one doesn't + // mess with these values + data.offsets.popper = getClientRect(data.offsets.popper); + data.offsets.reference = getClientRect(data.offsets.reference); + + data = fn(data, modifier); + } + }); + + return data; + } + + /** + * Updates the position of the popper, computing the new offsets and applying + * the new style.
+ * Prefer `scheduleUpdate` over `update` because of performance reasons. + * @method + * @memberof Popper + */ + function update() { + // if popper is destroyed, don't perform any further update + if (this.state.isDestroyed) { + return; + } + + var data = { + instance: this, + styles: {}, + arrowStyles: {}, + attributes: {}, + flipped: false, + offsets: {} + }; + + // compute reference element offsets + data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); + + // store the computed placement inside `originalPlacement` + data.originalPlacement = data.placement; + + data.positionFixed = this.options.positionFixed; + + // compute the popper offsets + data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); + + data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; + + // run the modifiers + data = runModifiers(this.modifiers, data); + + // the first `update` will call `onCreate` callback + // the other ones will call `onUpdate` callback + if (!this.state.isCreated) { + this.state.isCreated = true; + this.options.onCreate(data); + } else { + this.options.onUpdate(data); + } + } + + /** + * Helper used to know if the given modifier is enabled. + * @method + * @memberof Popper.Utils + * @returns {Boolean} + */ + function isModifierEnabled(modifiers, modifierName) { + return modifiers.some(function (_ref) { + var name = _ref.name, + enabled = _ref.enabled; + return enabled && name === modifierName; + }); + } + + /** + * Get the prefixed supported property name + * @method + * @memberof Popper.Utils + * @argument {String} property (camelCase) + * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) + */ + function getSupportedPropertyName(property) { + var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; + var upperProp = property.charAt(0).toUpperCase() + property.slice(1); + + for (var i = 0; i < prefixes.length; i++) { + var prefix = prefixes[i]; + var toCheck = prefix ? '' + prefix + upperProp : property; + if (typeof document.body.style[toCheck] !== 'undefined') { + return toCheck; + } + } + return null; + } + + /** + * Destroys the popper. + * @method + * @memberof Popper + */ + function destroy() { + this.state.isDestroyed = true; + + // touch DOM only if `applyStyle` modifier is enabled + if (isModifierEnabled(this.modifiers, 'applyStyle')) { + this.popper.removeAttribute('x-placement'); + this.popper.style.position = ''; + this.popper.style.top = ''; + this.popper.style.left = ''; + this.popper.style.right = ''; + this.popper.style.bottom = ''; + this.popper.style.willChange = ''; + this.popper.style[getSupportedPropertyName('transform')] = ''; + } + + this.disableEventListeners(); + + // remove the popper if user explicitly asked for the deletion on destroy + // do not use `remove` because IE11 doesn't support it + if (this.options.removeOnDestroy) { + this.popper.parentNode.removeChild(this.popper); + } + return this; + } + + /** + * Get the window associated with the element + * @argument {Element} element + * @returns {Window} + */ + function getWindow(element) { + var ownerDocument = element.ownerDocument; + return ownerDocument ? ownerDocument.defaultView : window; + } + + function attachToScrollParents(scrollParent, event, callback, scrollParents) { + var isBody = scrollParent.nodeName === 'BODY'; + var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; + target.addEventListener(event, callback, { passive: true }); + + if (!isBody) { + attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); + } + scrollParents.push(target); + } + + /** + * Setup needed event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ + function setupEventListeners(reference, options, state, updateBound) { + // Resize event listener on window + state.updateBound = updateBound; + getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); + + // Scroll event listener on scroll parents + var scrollElement = getScrollParent(reference); + attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); + state.scrollElement = scrollElement; + state.eventsEnabled = true; + + return state; + } + + /** + * It will add resize/scroll events and start recalculating + * position of the popper element when they are triggered. + * @method + * @memberof Popper + */ + function enableEventListeners() { + if (!this.state.eventsEnabled) { + this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); + } + } + + /** + * Remove event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ + function removeEventListeners(reference, state) { + // Remove resize event listener on window + getWindow(reference).removeEventListener('resize', state.updateBound); + + // Remove scroll event listener on scroll parents + state.scrollParents.forEach(function (target) { + target.removeEventListener('scroll', state.updateBound); + }); + + // Reset state + state.updateBound = null; + state.scrollParents = []; + state.scrollElement = null; + state.eventsEnabled = false; + return state; + } + + /** + * It will remove resize/scroll events and won't recalculate popper position + * when they are triggered. It also won't trigger `onUpdate` callback anymore, + * unless you call `update` method manually. + * @method + * @memberof Popper + */ + function disableEventListeners() { + if (this.state.eventsEnabled) { + cancelAnimationFrame(this.scheduleUpdate); + this.state = removeEventListeners(this.reference, this.state); + } + } + + /** + * Tells if a given input is a number + * @method + * @memberof Popper.Utils + * @param {*} input to check + * @return {Boolean} + */ + function isNumeric(n) { + return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); + } + + /** + * Set the style to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the style to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ + function setStyles(element, styles) { + Object.keys(styles).forEach(function (prop) { + var unit = ''; + // add unit if the value is numeric and is one of the following + if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { + unit = 'px'; + } + element.style[prop] = styles[prop] + unit; + }); + } + + /** + * Set the attributes to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the attributes to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ + function setAttributes(element, attributes) { + Object.keys(attributes).forEach(function (prop) { + var value = attributes[prop]; + if (value !== false) { + element.setAttribute(prop, attributes[prop]); + } else { + element.removeAttribute(prop); + } + }); + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} data.styles - List of style properties - values to apply to popper element + * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The same data object + */ + function applyStyle(data) { + // any property present in `data.styles` will be applied to the popper, + // in this way we can make the 3rd party modifiers add custom styles to it + // Be aware, modifiers could override the properties defined in the previous + // lines of this modifier! + setStyles(data.instance.popper, data.styles); + + // any property present in `data.attributes` will be applied to the popper, + // they will be set as HTML attributes of the element + setAttributes(data.instance.popper, data.attributes); + + // if arrowElement is defined and arrowStyles has some properties + if (data.arrowElement && Object.keys(data.arrowStyles).length) { + setStyles(data.arrowElement, data.arrowStyles); + } + + return data; + } + + /** + * Set the x-placement attribute before everything else because it could be used + * to add margins to the popper margins needs to be calculated to get the + * correct popper offsets. + * @method + * @memberof Popper.modifiers + * @param {HTMLElement} reference - The reference element used to position the popper + * @param {HTMLElement} popper - The HTML element used as popper + * @param {Object} options - Popper.js options + */ + function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { + // compute reference element offsets + var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); + + popper.setAttribute('x-placement', placement); + + // Apply `position` to popper before anything else because + // without the position applied we can't guarantee correct computations + setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); + + return options; + } + + /** + * @function + * @memberof Popper.Utils + * @argument {Object} data - The data object generated by `update` method + * @argument {Boolean} shouldRound - If the offsets should be rounded at all + * @returns {Object} The popper's position offsets rounded + * + * The tale of pixel-perfect positioning. It's still not 100% perfect, but as + * good as it can be within reason. + * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 + * + * Low DPI screens cause a popper to be blurry if not using full pixels (Safari + * as well on High DPI screens). + * + * Firefox prefers no rounding for positioning and does not have blurriness on + * high DPI screens. + * + * Only horizontal placement and left/right values need to be considered. + */ + function getRoundedOffsets(data, shouldRound) { + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + var round = Math.round, + floor = Math.floor; + + var noRound = function noRound(v) { + return v; + }; + + var referenceWidth = round(reference.width); + var popperWidth = round(popper.width); + + var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; + var isVariation = data.placement.indexOf('-') !== -1; + var sameWidthParity = referenceWidth % 2 === popperWidth % 2; + var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; + + var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; + var verticalToInteger = !shouldRound ? noRound : round; + + return { + left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), + top: verticalToInteger(popper.top), + bottom: verticalToInteger(popper.bottom), + right: horizontalToInteger(popper.right) + }; + } + + var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function computeStyle(data, options) { + var x = options.x, + y = options.y; + var popper = data.offsets.popper; + + // Remove this legacy support in Popper.js v2 + + var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'applyStyle'; + }).gpuAcceleration; + if (legacyGpuAccelerationOption !== undefined) { + console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); + } + var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; + + var offsetParent = getOffsetParent(data.instance.popper); + var offsetParentRect = getBoundingClientRect(offsetParent); + + // Styles + var styles = { + position: popper.position + }; + + var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); + + var sideA = x === 'bottom' ? 'top' : 'bottom'; + var sideB = y === 'right' ? 'left' : 'right'; + + // if gpuAcceleration is set to `true` and transform is supported, + // we use `translate3d` to apply the position to the popper we + // automatically use the supported prefixed version if needed + var prefixedProperty = getSupportedPropertyName('transform'); + + // now, let's make a step back and look at this code closely (wtf?) + // If the content of the popper grows once it's been positioned, it + // may happen that the popper gets misplaced because of the new content + // overflowing its reference element + // To avoid this problem, we provide two options (x and y), which allow + // the consumer to define the offset origin. + // If we position a popper on top of a reference element, we can set + // `x` to `top` to make the popper grow towards its top instead of + // its bottom. + var left = void 0, + top = void 0; + if (sideA === 'bottom') { + // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar) + // and not the bottom of the html element + if (offsetParent.nodeName === 'HTML') { + top = -offsetParent.clientHeight + offsets.bottom; + } else { + top = -offsetParentRect.height + offsets.bottom; + } + } else { + top = offsets.top; + } + if (sideB === 'right') { + if (offsetParent.nodeName === 'HTML') { + left = -offsetParent.clientWidth + offsets.right; + } else { + left = -offsetParentRect.width + offsets.right; + } + } else { + left = offsets.left; + } + if (gpuAcceleration && prefixedProperty) { + styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; + styles[sideA] = 0; + styles[sideB] = 0; + styles.willChange = 'transform'; + } else { + // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties + var invertTop = sideA === 'bottom' ? -1 : 1; + var invertLeft = sideB === 'right' ? -1 : 1; + styles[sideA] = top * invertTop; + styles[sideB] = left * invertLeft; + styles.willChange = sideA + ', ' + sideB; + } + + // Attributes + var attributes = { + 'x-placement': data.placement + }; + + // Update `data` attributes, styles and arrowStyles + data.attributes = _extends({}, attributes, data.attributes); + data.styles = _extends({}, styles, data.styles); + data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); + + return data; + } + + /** + * Helper used to know if the given modifier depends from another one.
+ * It checks if the needed modifier is listed and enabled. + * @method + * @memberof Popper.Utils + * @param {Array} modifiers - list of modifiers + * @param {String} requestingName - name of requesting modifier + * @param {String} requestedName - name of requested modifier + * @returns {Boolean} + */ + function isModifierRequired(modifiers, requestingName, requestedName) { + var requesting = find(modifiers, function (_ref) { + var name = _ref.name; + return name === requestingName; + }); + + var isRequired = !!requesting && modifiers.some(function (modifier) { + return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; + }); + + if (!isRequired) { + var _requesting = '`' + requestingName + '`'; + var requested = '`' + requestedName + '`'; + console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); + } + return isRequired; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function arrow(data, options) { + var _data$offsets$arrow; + + // arrow depends on keepTogether in order to work + if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { + return data; + } + + var arrowElement = options.element; + + // if arrowElement is a string, suppose it's a CSS selector + if (typeof arrowElement === 'string') { + arrowElement = data.instance.popper.querySelector(arrowElement); + + // if arrowElement is not found, don't run the modifier + if (!arrowElement) { + return data; + } + } else { + // if the arrowElement isn't a query selector we must check that the + // provided DOM node is child of its popper node + if (!data.instance.popper.contains(arrowElement)) { + console.warn('WARNING: `arrow.element` must be child of its popper element!'); + return data; + } + } + + var placement = data.placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isVertical = ['left', 'right'].indexOf(placement) !== -1; + + var len = isVertical ? 'height' : 'width'; + var sideCapitalized = isVertical ? 'Top' : 'Left'; + var side = sideCapitalized.toLowerCase(); + var altSide = isVertical ? 'left' : 'top'; + var opSide = isVertical ? 'bottom' : 'right'; + var arrowElementSize = getOuterSizes(arrowElement)[len]; + + // + // extends keepTogether behavior making sure the popper and its + // reference have enough pixels in conjunction + // + + // top/left side + if (reference[opSide] - arrowElementSize < popper[side]) { + data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); + } + // bottom/right side + if (reference[side] + arrowElementSize > popper[opSide]) { + data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; + } + data.offsets.popper = getClientRect(data.offsets.popper); + + // compute center of the popper + var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; + + // Compute the sideValue using the updated popper offsets + // take popper margin in account because we don't have this info available + var css = getStyleComputedProperty(data.instance.popper); + var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); + var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); + var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; + + // prevent arrowElement from being placed not contiguously to its popper + sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); + + data.arrowElement = arrowElement; + data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); + + return data; + } + + /** + * Get the opposite placement variation of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement variation + * @returns {String} flipped placement variation + */ + function getOppositeVariation(variation) { + if (variation === 'end') { + return 'start'; + } else if (variation === 'start') { + return 'end'; + } + return variation; + } + + /** + * List of accepted placements to use as values of the `placement` option.
+ * Valid placements are: + * - `auto` + * - `top` + * - `right` + * - `bottom` + * - `left` + * + * Each placement can have a variation from this list: + * - `-start` + * - `-end` + * + * Variations are interpreted easily if you think of them as the left to right + * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` + * is right.
+ * Vertically (`left` and `right`), `start` is top and `end` is bottom. + * + * Some valid examples are: + * - `top-end` (on top of reference, right aligned) + * - `right-start` (on right of reference, top aligned) + * - `bottom` (on bottom, centered) + * - `auto-end` (on the side with more space available, alignment depends by placement) + * + * @static + * @type {Array} + * @enum {String} + * @readonly + * @method placements + * @memberof Popper + */ + var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; + + // Get rid of `auto` `auto-start` and `auto-end` + var validPlacements = placements.slice(3); + + /** + * Given an initial placement, returns all the subsequent placements + * clockwise (or counter-clockwise). + * + * @method + * @memberof Popper.Utils + * @argument {String} placement - A valid placement (it accepts variations) + * @argument {Boolean} counter - Set to true to walk the placements counterclockwise + * @returns {Array} placements including their variations + */ + function clockwise(placement) { + var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var index = validPlacements.indexOf(placement); + var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); + return counter ? arr.reverse() : arr; + } + + var BEHAVIORS = { + FLIP: 'flip', + CLOCKWISE: 'clockwise', + COUNTERCLOCKWISE: 'counterclockwise' + }; + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function flip(data, options) { + // if `inner` modifier is enabled, we can't use the `flip` modifier + if (isModifierEnabled(data.instance.modifiers, 'inner')) { + return data; + } + + if (data.flipped && data.placement === data.originalPlacement) { + // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides + return data; + } + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); + + var placement = data.placement.split('-')[0]; + var placementOpposite = getOppositePlacement(placement); + var variation = data.placement.split('-')[1] || ''; + + var flipOrder = []; + + switch (options.behavior) { + case BEHAVIORS.FLIP: + flipOrder = [placement, placementOpposite]; + break; + case BEHAVIORS.CLOCKWISE: + flipOrder = clockwise(placement); + break; + case BEHAVIORS.COUNTERCLOCKWISE: + flipOrder = clockwise(placement, true); + break; + default: + flipOrder = options.behavior; + } + + flipOrder.forEach(function (step, index) { + if (placement !== step || flipOrder.length === index + 1) { + return data; + } + + placement = data.placement.split('-')[0]; + placementOpposite = getOppositePlacement(placement); + + var popperOffsets = data.offsets.popper; + var refOffsets = data.offsets.reference; + + // using floor because the reference offsets may contain decimals we are not going to consider here + var floor = Math.floor; + var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); + + var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); + var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); + var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); + var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); + + var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; + + // flip the variation if required + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + + // flips variation if reference element overflows boundaries + var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); + + // flips variation if popper content overflows boundaries + var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); + + var flippedVariation = flippedVariationByRef || flippedVariationByContent; + + if (overlapsRef || overflowsBoundaries || flippedVariation) { + // this boolean to detect any flip loop + data.flipped = true; + + if (overlapsRef || overflowsBoundaries) { + placement = flipOrder[index + 1]; + } + + if (flippedVariation) { + variation = getOppositeVariation(variation); + } + + data.placement = placement + (variation ? '-' + variation : ''); + + // this object contains `position`, we want to preserve it along with + // any additional property we may add in the future + data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); + + data = runModifiers(data.instance.modifiers, data, 'flip'); + } + }); + return data; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function keepTogether(data) { + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var placement = data.placement.split('-')[0]; + var floor = Math.floor; + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var side = isVertical ? 'right' : 'bottom'; + var opSide = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + if (popper[side] < floor(reference[opSide])) { + data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; + } + if (popper[opSide] > floor(reference[side])) { + data.offsets.popper[opSide] = floor(reference[side]); + } + + return data; + } + + /** + * Converts a string containing value + unit into a px value number + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} str - Value + unit string + * @argument {String} measurement - `height` or `width` + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @returns {Number|String} + * Value in pixels, or original string if no values were extracted + */ + function toValue(str, measurement, popperOffsets, referenceOffsets) { + // separate value from unit + var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); + var value = +split[1]; + var unit = split[2]; + + // If it's not a number it's an operator, I guess + if (!value) { + return str; + } + + if (unit.indexOf('%') === 0) { + var element = void 0; + switch (unit) { + case '%p': + element = popperOffsets; + break; + case '%': + case '%r': + default: + element = referenceOffsets; + } + + var rect = getClientRect(element); + return rect[measurement] / 100 * value; + } else if (unit === 'vh' || unit === 'vw') { + // if is a vh or vw, we calculate the size based on the viewport + var size = void 0; + if (unit === 'vh') { + size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + } else { + size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); + } + return size / 100 * value; + } else { + // if is an explicit pixel unit, we get rid of the unit and keep the value + // if is an implicit unit, it's px, and we return just the value + return value; + } + } + + /** + * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} offset + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @argument {String} basePlacement + * @returns {Array} a two cells array with x and y offsets in numbers + */ + function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { + var offsets = [0, 0]; + + // Use height if placement is left or right and index is 0 otherwise use width + // in this way the first offset will use an axis and the second one + // will use the other one + var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; + + // Split the offset string to obtain a list of values and operands + // The regex addresses values with the plus or minus sign in front (+10, -20, etc) + var fragments = offset.split(/(\+|\-)/).map(function (frag) { + return frag.trim(); + }); + + // Detect if the offset string contains a pair of values or a single one + // they could be separated by comma or space + var divider = fragments.indexOf(find(fragments, function (frag) { + return frag.search(/,|\s/) !== -1; + })); + + if (fragments[divider] && fragments[divider].indexOf(',') === -1) { + console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); + } + + // If divider is found, we divide the list of values and operands to divide + // them by ofset X and Y. + var splitRegex = /\s*,\s*|\s+/; + var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; + + // Convert the values with units to absolute pixels to allow our computations + ops = ops.map(function (op, index) { + // Most of the units rely on the orientation of the popper + var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; + var mergeWithPrevious = false; + return op + // This aggregates any `+` or `-` sign that aren't considered operators + // e.g.: 10 + +5 => [10, +, +5] + .reduce(function (a, b) { + if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { + a[a.length - 1] = b; + mergeWithPrevious = true; + return a; + } else if (mergeWithPrevious) { + a[a.length - 1] += b; + mergeWithPrevious = false; + return a; + } else { + return a.concat(b); + } + }, []) + // Here we convert the string values into number values (in px) + .map(function (str) { + return toValue(str, measurement, popperOffsets, referenceOffsets); + }); + }); + + // Loop trough the offsets arrays and execute the operations + ops.forEach(function (op, index) { + op.forEach(function (frag, index2) { + if (isNumeric(frag)) { + offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); + } + }); + }); + return offsets; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @argument {Number|String} options.offset=0 + * The offset value as described in the modifier description + * @returns {Object} The data object, properly modified + */ + function offset(data, _ref) { + var offset = _ref.offset; + var placement = data.placement, + _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var basePlacement = placement.split('-')[0]; + + var offsets = void 0; + if (isNumeric(+offset)) { + offsets = [+offset, 0]; + } else { + offsets = parseOffset(offset, popper, reference, basePlacement); + } + + if (basePlacement === 'left') { + popper.top += offsets[0]; + popper.left -= offsets[1]; + } else if (basePlacement === 'right') { + popper.top += offsets[0]; + popper.left += offsets[1]; + } else if (basePlacement === 'top') { + popper.left += offsets[0]; + popper.top -= offsets[1]; + } else if (basePlacement === 'bottom') { + popper.left += offsets[0]; + popper.top += offsets[1]; + } + + data.popper = popper; + return data; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function preventOverflow(data, options) { + var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); + + // If offsetParent is the reference element, we really want to + // go one step up and use the next offsetParent as reference to + // avoid to make this modifier completely useless and look like broken + if (data.instance.reference === boundariesElement) { + boundariesElement = getOffsetParent(boundariesElement); + } + + // NOTE: DOM access here + // resets the popper's position so that the document size can be calculated excluding + // the size of the popper element itself + var transformProp = getSupportedPropertyName('transform'); + var popperStyles = data.instance.popper.style; // assignment to help minification + var top = popperStyles.top, + left = popperStyles.left, + transform = popperStyles[transformProp]; + + popperStyles.top = ''; + popperStyles.left = ''; + popperStyles[transformProp] = ''; + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); + + // NOTE: DOM access here + // restores the original style properties after the offsets have been computed + popperStyles.top = top; + popperStyles.left = left; + popperStyles[transformProp] = transform; + + options.boundaries = boundaries; + + var order = options.priority; + var popper = data.offsets.popper; + + var check = { + primary: function primary(placement) { + var value = popper[placement]; + if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { + value = Math.max(popper[placement], boundaries[placement]); + } + return defineProperty({}, placement, value); + }, + secondary: function secondary(placement) { + var mainSide = placement === 'right' ? 'left' : 'top'; + var value = popper[mainSide]; + if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { + value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); + } + return defineProperty({}, mainSide, value); + } + }; + + order.forEach(function (placement) { + var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; + popper = _extends({}, popper, check[side](placement)); + }); + + data.offsets.popper = popper; + + return data; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function shift(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var shiftvariation = placement.split('-')[1]; + + // if shift shiftvariation is specified, run the modifier + if (shiftvariation) { + var _data$offsets = data.offsets, + reference = _data$offsets.reference, + popper = _data$offsets.popper; + + var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; + var side = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + var shiftOffsets = { + start: defineProperty({}, side, reference[side]), + end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) + }; + + data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); + } + + return data; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function hide(data) { + if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { + return data; + } + + var refRect = data.offsets.reference; + var bound = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'preventOverflow'; + }).boundaries; + + if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === true) { + return data; + } + + data.hide = true; + data.attributes['x-out-of-boundaries'] = ''; + } else { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === false) { + return data; + } + + data.hide = false; + data.attributes['x-out-of-boundaries'] = false; + } + + return data; + } + + /** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ + function inner(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; + + var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; + + popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); + + data.placement = getOppositePlacement(placement); + data.offsets.popper = getClientRect(popper); + + return data; + } + + /** + * Modifier function, each modifier can have a function of this type assigned + * to its `fn` property.
+ * These functions will be called on each update, this means that you must + * make sure they are performant enough to avoid performance bottlenecks. + * + * @function ModifierFn + * @argument {dataObject} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {dataObject} The data object, properly modified + */ + + /** + * Modifiers are plugins used to alter the behavior of your poppers.
+ * Popper.js uses a set of 9 modifiers to provide all the basic functionalities + * needed by the library. + * + * Usually you don't want to override the `order`, `fn` and `onLoad` props. + * All the other properties are configurations that could be tweaked. + * @namespace modifiers + */ + var modifiers = { + /** + * Modifier used to shift the popper on the start or end of its reference + * element.
+ * It will read the variation of the `placement` property.
+ * It can be one either `-end` or `-start`. + * @memberof modifiers + * @inner + */ + shift: { + /** @prop {number} order=100 - Index used to define the order of execution */ + order: 100, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: shift + }, + + /** + * The `offset` modifier can shift your popper on both its axis. + * + * It accepts the following units: + * - `px` or unit-less, interpreted as pixels + * - `%` or `%r`, percentage relative to the length of the reference element + * - `%p`, percentage relative to the length of the popper element + * - `vw`, CSS viewport width unit + * - `vh`, CSS viewport height unit + * + * For length is intended the main axis relative to the placement of the popper.
+ * This means that if the placement is `top` or `bottom`, the length will be the + * `width`. In case of `left` or `right`, it will be the `height`. + * + * You can provide a single value (as `Number` or `String`), or a pair of values + * as `String` divided by a comma or one (or more) white spaces.
+ * The latter is a deprecated method because it leads to confusion and will be + * removed in v2.
+ * Additionally, it accepts additions and subtractions between different units. + * Note that multiplications and divisions aren't supported. + * + * Valid examples are: + * ``` + * 10 + * '10%' + * '10, 10' + * '10%, 10' + * '10 + 10%' + * '10 - 5vh + 3%' + * '-10px + 5vh, 5px - 6%' + * ``` + * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap + * > with their reference element, unfortunately, you will have to disable the `flip` modifier. + * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). + * + * @memberof modifiers + * @inner + */ + offset: { + /** @prop {number} order=200 - Index used to define the order of execution */ + order: 200, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: offset, + /** @prop {Number|String} offset=0 + * The offset value as described in the modifier description + */ + offset: 0 + }, + + /** + * Modifier used to prevent the popper from being positioned outside the boundary. + * + * A scenario exists where the reference itself is not within the boundaries.
+ * We can say it has "escaped the boundaries" — or just "escaped".
+ * In this case we need to decide whether the popper should either: + * + * - detach from the reference and remain "trapped" in the boundaries, or + * - if it should ignore the boundary and "escape with its reference" + * + * When `escapeWithReference` is set to`true` and reference is completely + * outside its boundaries, the popper will overflow (or completely leave) + * the boundaries in order to remain attached to the edge of the reference. + * + * @memberof modifiers + * @inner + */ + preventOverflow: { + /** @prop {number} order=300 - Index used to define the order of execution */ + order: 300, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: preventOverflow, + /** + * @prop {Array} [priority=['left','right','top','bottom']] + * Popper will try to prevent overflow following these priorities by default, + * then, it could overflow on the left and on top of the `boundariesElement` + */ + priority: ['left', 'right', 'top', 'bottom'], + /** + * @prop {number} padding=5 + * Amount of pixel used to define a minimum distance between the boundaries + * and the popper. This makes sure the popper always has a little padding + * between the edges of its container + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='scrollParent' + * Boundaries used by the modifier. Can be `scrollParent`, `window`, + * `viewport` or any DOM element. + */ + boundariesElement: 'scrollParent' + }, + + /** + * Modifier used to make sure the reference and its popper stay near each other + * without leaving any gap between the two. Especially useful when the arrow is + * enabled and you want to ensure that it points to its reference element. + * It cares only about the first axis. You can still have poppers with margin + * between the popper and its reference element. + * @memberof modifiers + * @inner + */ + keepTogether: { + /** @prop {number} order=400 - Index used to define the order of execution */ + order: 400, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: keepTogether + }, + + /** + * This modifier is used to move the `arrowElement` of the popper to make + * sure it is positioned between the reference element and its popper element. + * It will read the outer size of the `arrowElement` node to detect how many + * pixels of conjunction are needed. + * + * It has no effect if no `arrowElement` is provided. + * @memberof modifiers + * @inner + */ + arrow: { + /** @prop {number} order=500 - Index used to define the order of execution */ + order: 500, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: arrow, + /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ + element: '[x-arrow]' + }, + + /** + * Modifier used to flip the popper's placement when it starts to overlap its + * reference element. + * + * Requires the `preventOverflow` modifier before it in order to work. + * + * **NOTE:** this modifier will interrupt the current update cycle and will + * restart it if it detects the need to flip the placement. + * @memberof modifiers + * @inner + */ + flip: { + /** @prop {number} order=600 - Index used to define the order of execution */ + order: 600, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: flip, + /** + * @prop {String|Array} behavior='flip' + * The behavior used to change the popper's placement. It can be one of + * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid + * placements (with optional variations) + */ + behavior: 'flip', + /** + * @prop {number} padding=5 + * The popper will flip if it hits the edges of the `boundariesElement` + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='viewport' + * The element which will define the boundaries of the popper position. + * The popper will never be placed outside of the defined boundaries + * (except if `keepTogether` is enabled) + */ + boundariesElement: 'viewport', + /** + * @prop {Boolean} flipVariations=false + * The popper will switch placement variation between `-start` and `-end` when + * the reference element overlaps its boundaries. + * + * The original placement should have a set variation. + */ + flipVariations: false, + /** + * @prop {Boolean} flipVariationsByContent=false + * The popper will switch placement variation between `-start` and `-end` when + * the popper element overlaps its reference boundaries. + * + * The original placement should have a set variation. + */ + flipVariationsByContent: false + }, + + /** + * Modifier used to make the popper flow toward the inner of the reference element. + * By default, when this modifier is disabled, the popper will be placed outside + * the reference element. + * @memberof modifiers + * @inner + */ + inner: { + /** @prop {number} order=700 - Index used to define the order of execution */ + order: 700, + /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ + enabled: false, + /** @prop {ModifierFn} */ + fn: inner + }, + + /** + * Modifier used to hide the popper when its reference element is outside of the + * popper boundaries. It will set a `x-out-of-boundaries` attribute which can + * be used to hide with a CSS selector the popper when its reference is + * out of boundaries. + * + * Requires the `preventOverflow` modifier before it in order to work. + * @memberof modifiers + * @inner + */ + hide: { + /** @prop {number} order=800 - Index used to define the order of execution */ + order: 800, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: hide + }, + + /** + * Computes the style that will be applied to the popper element to gets + * properly positioned. + * + * Note that this modifier will not touch the DOM, it just prepares the styles + * so that `applyStyle` modifier can apply it. This separation is useful + * in case you need to replace `applyStyle` with a custom implementation. + * + * This modifier has `850` as `order` value to maintain backward compatibility + * with previous versions of Popper.js. Expect the modifiers ordering method + * to change in future major versions of the library. + * + * @memberof modifiers + * @inner + */ + computeStyle: { + /** @prop {number} order=850 - Index used to define the order of execution */ + order: 850, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: computeStyle, + /** + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3D transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties + */ + gpuAcceleration: true, + /** + * @prop {string} [x='bottom'] + * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. + * Change this if your popper should grow in a direction different from `bottom` + */ + x: 'bottom', + /** + * @prop {string} [x='left'] + * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. + * Change this if your popper should grow in a direction different from `right` + */ + y: 'right' + }, + + /** + * Applies the computed styles to the popper element. + * + * All the DOM manipulations are limited to this modifier. This is useful in case + * you want to integrate Popper.js inside a framework or view library and you + * want to delegate all the DOM manipulations to it. + * + * Note that if you disable this modifier, you must make sure the popper element + * has its position set to `absolute` before Popper.js can do its work! + * + * Just disable this modifier and define your own to achieve the desired effect. + * + * @memberof modifiers + * @inner + */ + applyStyle: { + /** @prop {number} order=900 - Index used to define the order of execution */ + order: 900, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: applyStyle, + /** @prop {Function} */ + onLoad: applyStyleOnLoad, + /** + * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3D transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties + */ + gpuAcceleration: undefined + } + }; + + /** + * The `dataObject` is an object containing all the information used by Popper.js. + * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. + * @name dataObject + * @property {Object} data.instance The Popper.js instance + * @property {String} data.placement Placement applied to popper + * @property {String} data.originalPlacement Placement originally defined on init + * @property {Boolean} data.flipped True if popper has been flipped by flip modifier + * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper + * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier + * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.boundaries Offsets of the popper boundaries + * @property {Object} data.offsets The measurements of popper, reference and arrow elements + * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 + */ + + /** + * Default options provided to Popper.js constructor.
+ * These can be overridden using the `options` argument of Popper.js.
+ * To override an option, simply pass an object with the same + * structure of the `options` object, as the 3rd argument. For example: + * ``` + * new Popper(ref, pop, { + * modifiers: { + * preventOverflow: { enabled: false } + * } + * }) + * ``` + * @type {Object} + * @static + * @memberof Popper + */ + var Defaults = { + /** + * Popper's placement. + * @prop {Popper.placements} placement='bottom' + */ + placement: 'bottom', + + /** + * Set this to true if you want popper to position it self in 'fixed' mode + * @prop {Boolean} positionFixed=false + */ + positionFixed: false, + + /** + * Whether events (resize, scroll) are initially enabled. + * @prop {Boolean} eventsEnabled=true + */ + eventsEnabled: true, + + /** + * Set to true if you want to automatically remove the popper when + * you call the `destroy` method. + * @prop {Boolean} removeOnDestroy=false + */ + removeOnDestroy: false, + + /** + * Callback called when the popper is created.
+ * By default, it is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onCreate} + */ + onCreate: function onCreate() {}, + + /** + * Callback called when the popper is updated. This callback is not called + * on the initialization/creation of the popper, but only on subsequent + * updates.
+ * By default, it is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onUpdate} + */ + onUpdate: function onUpdate() {}, + + /** + * List of modifiers used to modify the offsets before they are applied to the popper. + * They provide most of the functionalities of Popper.js. + * @prop {modifiers} + */ + modifiers: modifiers + }; + + /** + * @callback onCreate + * @param {dataObject} data + */ + + /** + * @callback onUpdate + * @param {dataObject} data + */ + + // Utils + // Methods + var Popper = function () { + /** + * Creates a new Popper.js instance. + * @class Popper + * @param {Element|referenceObject} reference - The reference element used to position the popper + * @param {Element} popper - The HTML / XML element used as the popper + * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) + * @return {Object} instance - The generated Popper.js instance + */ + function Popper(reference, popper) { + var _this = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + classCallCheck(this, Popper); + + this.scheduleUpdate = function () { + return requestAnimationFrame(_this.update); + }; + + // make update() debounced, so that it only runs at most once-per-tick + this.update = debounce(this.update.bind(this)); + + // with {} we create a new object with the options inside it + this.options = _extends({}, Popper.Defaults, options); + + // init state + this.state = { + isDestroyed: false, + isCreated: false, + scrollParents: [] + }; + + // get reference and popper elements (allow jQuery wrappers) + this.reference = reference && reference.jquery ? reference[0] : reference; + this.popper = popper && popper.jquery ? popper[0] : popper; + + // Deep merge modifiers options + this.options.modifiers = {}; + Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { + _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); + }); + + // Refactoring modifiers' list (Object => Array) + this.modifiers = Object.keys(this.options.modifiers).map(function (name) { + return _extends({ + name: name + }, _this.options.modifiers[name]); + }) + // sort the modifiers by order + .sort(function (a, b) { + return a.order - b.order; + }); + + // modifiers have the ability to execute arbitrary code when Popper.js get inited + // such code is executed in the same order of its modifier + // they could add new properties to their options configuration + // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! + this.modifiers.forEach(function (modifierOptions) { + if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { + modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); + } + }); + + // fire the first update to position the popper in the right place + this.update(); + + var eventsEnabled = this.options.eventsEnabled; + if (eventsEnabled) { + // setup event listeners, they will take care of update the position in specific situations + this.enableEventListeners(); + } + + this.state.eventsEnabled = eventsEnabled; + } + + // We can't use class properties because they don't get listed in the + // class prototype and break stuff like Sinon stubs + + + createClass(Popper, [{ + key: 'update', + value: function update$$1() { + return update.call(this); + } + }, { + key: 'destroy', + value: function destroy$$1() { + return destroy.call(this); + } + }, { + key: 'enableEventListeners', + value: function enableEventListeners$$1() { + return enableEventListeners.call(this); + } + }, { + key: 'disableEventListeners', + value: function disableEventListeners$$1() { + return disableEventListeners.call(this); + } + + /** + * Schedules an update. It will run on the next UI update available. + * @method scheduleUpdate + * @memberof Popper + */ + + + /** + * Collection of utilities useful when writing custom modifiers. + * Starting from version 1.7, this method is available only if you + * include `popper-utils.js` before `popper.js`. + * + * **DEPRECATION**: This way to access PopperUtils is deprecated + * and will be removed in v2! Use the PopperUtils module directly instead. + * Due to the high instability of the methods contained in Utils, we can't + * guarantee them to follow semver. Use them at your own risk! + * @static + * @private + * @type {Object} + * @deprecated since version 1.8 + * @member Utils + * @memberof Popper + */ + + }]); + return Popper; + }(); + + /** + * The `referenceObject` is an object that provides an interface compatible with Popper.js + * and lets you use it as replacement of a real DOM node.
+ * You can use this method to position a popper relatively to a set of coordinates + * in case you don't have a DOM node to use as reference. + * + * ``` + * new Popper(referenceObject, popperNode); + * ``` + * + * NB: This feature isn't supported in Internet Explorer 10. + * @name referenceObject + * @property {Function} data.getBoundingClientRect + * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. + * @property {number} data.clientWidth + * An ES6 getter that will return the width of the virtual reference element. + * @property {number} data.clientHeight + * An ES6 getter that will return the height of the virtual reference element. + */ + + + Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; + Popper.placements = placements; + Popper.Defaults = Defaults; + + var Popper$1 = Popper; + + /** + * Constants + */ + + var NAME$6 = 'dropdown'; + var VERSION$6 = '4.6.1'; + var DATA_KEY$6 = 'bs.dropdown'; + var EVENT_KEY$6 = "." + DATA_KEY$6; + var DATA_API_KEY$3 = '.data-api'; + var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; + var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key + + var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key + + var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key + + var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key + + var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key + + var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) + + var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); + var CLASS_NAME_DISABLED$1 = 'disabled'; + var CLASS_NAME_SHOW$5 = 'show'; + var CLASS_NAME_DROPUP = 'dropup'; + var CLASS_NAME_DROPRIGHT = 'dropright'; + var CLASS_NAME_DROPLEFT = 'dropleft'; + var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; + var CLASS_NAME_POSITION_STATIC = 'position-static'; + var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; + var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; + var EVENT_SHOW$3 = "show" + EVENT_KEY$6; + var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; + var EVENT_CLICK = "click" + EVENT_KEY$6; + var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; + var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; + var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; + var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; + var SELECTOR_FORM_CHILD = '.dropdown form'; + var SELECTOR_MENU = '.dropdown-menu'; + var SELECTOR_NAVBAR_NAV = '.navbar-nav'; + var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; + var PLACEMENT_TOP = 'top-start'; + var PLACEMENT_TOPEND = 'top-end'; + var PLACEMENT_BOTTOM = 'bottom-start'; + var PLACEMENT_BOTTOMEND = 'bottom-end'; + var PLACEMENT_RIGHT = 'right-start'; + var PLACEMENT_LEFT = 'left-start'; + var Default$5 = { + offset: 0, + flip: true, + boundary: 'scrollParent', + reference: 'toggle', + display: 'dynamic', + popperConfig: null + }; + var DefaultType$5 = { + offset: '(number|string|function)', + flip: 'boolean', + boundary: '(string|element)', + reference: '(string|element)', + display: 'string', + popperConfig: '(null|object)' + }; + /** + * Class definition + */ + + var Dropdown = /*#__PURE__*/function () { + function Dropdown(element, config) { + this._element = element; + this._popper = null; + this._config = this._getConfig(config); + this._menu = this._getMenuElement(); + this._inNavbar = this._detectNavbar(); + + this._addEventListeners(); + } // Getters + + + var _proto = Dropdown.prototype; + + // Public + _proto.toggle = function toggle() { + if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { + return; + } + + var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); + + Dropdown._clearMenus(); + + if (isActive) { + return; + } + + this.show(true); + }; + + _proto.show = function show(usePopper) { + if (usePopper === void 0) { + usePopper = false; + } + + if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { + return; + } + + var relatedTarget = { + relatedTarget: this._element + }; + var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); + + var parent = Dropdown._getParentFromElement(this._element); + + $__default["default"](parent).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; + } // Totally disable Popper for Dropdowns in Navbar + + + if (!this._inNavbar && usePopper) { + // Check for Popper dependency + if (typeof Popper$1 === 'undefined') { + throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); + } + + var referenceElement = this._element; + + if (this._config.reference === 'parent') { + referenceElement = parent; + } else if (Util.isElement(this._config.reference)) { + referenceElement = this._config.reference; // Check if it's jQuery element + + if (typeof this._config.reference.jquery !== 'undefined') { + referenceElement = this._config.reference[0]; + } + } // If boundary is not `scrollParent`, then set position to `static` + // to allow the menu to "escape" the scroll parent's boundaries + // https://github.com/twbs/bootstrap/issues/24251 + + + if (this._config.boundary !== 'scrollParent') { + $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); + } + + this._popper = new Popper$1(referenceElement, this._menu, this._getPopperConfig()); + } // If this is a touch-enabled device we add extra + // empty mouseover listeners to the body's immediate children; + // only needed because of broken event delegation on iOS + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + + + if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { + $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); + } + + this._element.focus(); + + this._element.setAttribute('aria-expanded', true); + + $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); + $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); + }; + + _proto.hide = function hide() { + if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { + return; + } + + var relatedTarget = { + relatedTarget: this._element + }; + var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); + + var parent = Dropdown._getParentFromElement(this._element); + + $__default["default"](parent).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; + } + + if (this._popper) { + this._popper.destroy(); + } + + $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); + $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); + }; + + _proto.dispose = function dispose() { + $__default["default"].removeData(this._element, DATA_KEY$6); + $__default["default"](this._element).off(EVENT_KEY$6); + this._element = null; + this._menu = null; + + if (this._popper !== null) { + this._popper.destroy(); + + this._popper = null; + } + }; + + _proto.update = function update() { + this._inNavbar = this._detectNavbar(); + + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } + } // Private + ; + + _proto._addEventListeners = function _addEventListeners() { + var _this = this; + + $__default["default"](this._element).on(EVENT_CLICK, function (event) { + event.preventDefault(); + event.stopPropagation(); + + _this.toggle(); + }); + }; + + _proto._getConfig = function _getConfig(config) { + config = _extends$1({}, this.constructor.Default, $__default["default"](this._element).data(), config); + Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); + return config; + }; + + _proto._getMenuElement = function _getMenuElement() { + if (!this._menu) { + var parent = Dropdown._getParentFromElement(this._element); + + if (parent) { + this._menu = parent.querySelector(SELECTOR_MENU); + } + } + + return this._menu; + }; + + _proto._getPlacement = function _getPlacement() { + var $parentDropdown = $__default["default"](this._element.parentNode); + var placement = PLACEMENT_BOTTOM; // Handle dropup + + if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { + placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; + } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { + placement = PLACEMENT_RIGHT; + } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { + placement = PLACEMENT_LEFT; + } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { + placement = PLACEMENT_BOTTOMEND; + } + + return placement; + }; + + _proto._detectNavbar = function _detectNavbar() { + return $__default["default"](this._element).closest('.navbar').length > 0; + }; + + _proto._getOffset = function _getOffset() { + var _this2 = this; + + var offset = {}; + + if (typeof this._config.offset === 'function') { + offset.fn = function (data) { + data.offsets = _extends$1({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); + return data; + }; + } else { + offset.offset = this._config.offset; + } + + return offset; + }; + + _proto._getPopperConfig = function _getPopperConfig() { + var popperConfig = { + placement: this._getPlacement(), + modifiers: { + offset: this._getOffset(), + flip: { + enabled: this._config.flip + }, + preventOverflow: { + boundariesElement: this._config.boundary + } + } + }; // Disable Popper if we have a static display + + if (this._config.display === 'static') { + popperConfig.modifiers.applyStyle = { + enabled: false + }; + } + + return _extends$1({}, popperConfig, this._config.popperConfig); + } // Static + ; + + Dropdown._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $__default["default"](this).data(DATA_KEY$6); + + var _config = typeof config === 'object' ? config : null; + + if (!data) { + data = new Dropdown(this, _config); + $__default["default"](this).data(DATA_KEY$6, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + Dropdown._clearMenus = function _clearMenus(event) { + if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { + return; + } + + var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); + + for (var i = 0, len = toggles.length; i < len; i++) { + var parent = Dropdown._getParentFromElement(toggles[i]); + + var context = $__default["default"](toggles[i]).data(DATA_KEY$6); + var relatedTarget = { + relatedTarget: toggles[i] + }; + + if (event && event.type === 'click') { + relatedTarget.clickEvent = event; + } + + if (!context) { + continue; + } + + var dropdownMenu = context._menu; + + if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { + continue; + } + + if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { + continue; + } + + var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); + $__default["default"](parent).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + continue; + } // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + + + if ('ontouchstart' in document.documentElement) { + $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); + } + + toggles[i].setAttribute('aria-expanded', 'false'); + + if (context._popper) { + context._popper.destroy(); + } + + $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); + $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); + } + }; + + Dropdown._getParentFromElement = function _getParentFromElement(element) { + var parent; + var selector = Util.getSelectorFromElement(element); + + if (selector) { + parent = document.querySelector(selector); + } + + return parent || element.parentNode; + } // eslint-disable-next-line complexity + ; + + Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { + // If not input/textarea: + // - And not a key in REGEXP_KEYDOWN => not a dropdown command + // If input/textarea: + // - If space key => not a dropdown command + // - If key is other than escape + // - If key is not up or down => not a dropdown command + // - If trigger inside the menu => not a dropdown command + if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { + return; + } + + if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { + return; + } + + var parent = Dropdown._getParentFromElement(this); + + var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); + + if (!isActive && event.which === ESCAPE_KEYCODE$1) { + return; + } + + event.preventDefault(); + event.stopPropagation(); + + if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { + if (event.which === ESCAPE_KEYCODE$1) { + $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); + } + + $__default["default"](this).trigger('click'); + return; + } + + var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { + return $__default["default"](item).is(':visible'); + }); + + if (items.length === 0) { + return; + } + + var index = items.indexOf(event.target); + + if (event.which === ARROW_UP_KEYCODE && index > 0) { + // Up + index--; + } + + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { + // Down + index++; + } + + if (index < 0) { + index = 0; + } + + items[index].focus(); + }; + + _createClass(Dropdown, null, [{ + key: "VERSION", + get: function get() { + return VERSION$6; + } + }, { + key: "Default", + get: function get() { + return Default$5; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$5; + } + }]); + + return Dropdown; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { + event.preventDefault(); + event.stopPropagation(); + + Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); + }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { + e.stopPropagation(); + }); + /** + * jQuery + */ + + $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; + $__default["default"].fn[NAME$6].Constructor = Dropdown; + + $__default["default"].fn[NAME$6].noConflict = function () { + $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; + return Dropdown._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$5 = 'modal'; + var VERSION$5 = '4.6.1'; + var DATA_KEY$5 = 'bs.modal'; + var EVENT_KEY$5 = "." + DATA_KEY$5; + var DATA_API_KEY$2 = '.data-api'; + var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; + var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + + var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; + var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; + var CLASS_NAME_BACKDROP = 'modal-backdrop'; + var CLASS_NAME_OPEN = 'modal-open'; + var CLASS_NAME_FADE$4 = 'fade'; + var CLASS_NAME_SHOW$4 = 'show'; + var CLASS_NAME_STATIC = 'modal-static'; + var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; + var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; + var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; + var EVENT_SHOW$2 = "show" + EVENT_KEY$5; + var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; + var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; + var EVENT_RESIZE = "resize" + EVENT_KEY$5; + var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; + var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; + var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; + var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; + var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; + var SELECTOR_DIALOG = '.modal-dialog'; + var SELECTOR_MODAL_BODY = '.modal-body'; + var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; + var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; + var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; + var SELECTOR_STICKY_CONTENT = '.sticky-top'; + var Default$4 = { + backdrop: true, + keyboard: true, + focus: true, + show: true + }; + var DefaultType$4 = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + focus: 'boolean', + show: 'boolean' + }; + /** + * Class definition + */ + + var Modal = /*#__PURE__*/function () { + function Modal(element, config) { + this._config = this._getConfig(config); + this._element = element; + this._dialog = element.querySelector(SELECTOR_DIALOG); + this._backdrop = null; + this._isShown = false; + this._isBodyOverflowing = false; + this._ignoreBackdropClick = false; + this._isTransitioning = false; + this._scrollbarWidth = 0; + } // Getters + + + var _proto = Modal.prototype; + + // Public + _proto.toggle = function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + }; + + _proto.show = function show(relatedTarget) { + var _this = this; + + if (this._isShown || this._isTransitioning) { + return; + } + + var showEvent = $__default["default"].Event(EVENT_SHOW$2, { + relatedTarget: relatedTarget + }); + $__default["default"](this._element).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; + } + + this._isShown = true; + + if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { + this._isTransitioning = true; + } + + this._checkScrollbar(); + + this._setScrollbar(); + + this._adjustDialog(); + + this._setEscapeEvent(); + + this._setResizeEvent(); + + $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { + return _this.hide(event); + }); + $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { + $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { + if ($__default["default"](event.target).is(_this._element)) { + _this._ignoreBackdropClick = true; + } + }); + }); + + this._showBackdrop(function () { + return _this._showElement(relatedTarget); + }); + }; + + _proto.hide = function hide(event) { + var _this2 = this; + + if (event) { + event.preventDefault(); + } + + if (!this._isShown || this._isTransitioning) { + return; + } + + var hideEvent = $__default["default"].Event(EVENT_HIDE$2); + $__default["default"](this._element).trigger(hideEvent); + + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } + + this._isShown = false; + var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); + + if (transition) { + this._isTransitioning = true; + } + + this._setEscapeEvent(); + + this._setResizeEvent(); + + $__default["default"](document).off(EVENT_FOCUSIN); + $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); + $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); + $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); + + if (transition) { + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { + return _this2._hideModal(event); + }).emulateTransitionEnd(transitionDuration); + } else { + this._hideModal(); + } + }; + + _proto.dispose = function dispose() { + [window, this._element, this._dialog].forEach(function (htmlElement) { + return $__default["default"](htmlElement).off(EVENT_KEY$5); + }); + /** + * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` + * Do not move `document` in `htmlElements` array + * It will remove `EVENT_CLICK_DATA_API` event that should remain + */ + + $__default["default"](document).off(EVENT_FOCUSIN); + $__default["default"].removeData(this._element, DATA_KEY$5); + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._isTransitioning = null; + this._scrollbarWidth = null; + }; + + _proto.handleUpdate = function handleUpdate() { + this._adjustDialog(); + } // Private + ; + + _proto._getConfig = function _getConfig(config) { + config = _extends$1({}, Default$4, config); + Util.typeCheckConfig(NAME$5, config, DefaultType$4); + return config; + }; + + _proto._triggerBackdropTransition = function _triggerBackdropTransition() { + var _this3 = this; + + var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); + $__default["default"](this._element).trigger(hideEventPrevented); + + if (hideEventPrevented.isDefaultPrevented()) { + return; + } + + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!isModalOverflowing) { + this._element.style.overflowY = 'hidden'; + } + + this._element.classList.add(CLASS_NAME_STATIC); + + var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); + $__default["default"](this._element).off(Util.TRANSITION_END); + $__default["default"](this._element).one(Util.TRANSITION_END, function () { + _this3._element.classList.remove(CLASS_NAME_STATIC); + + if (!isModalOverflowing) { + $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { + _this3._element.style.overflowY = ''; + }).emulateTransitionEnd(_this3._element, modalTransitionDuration); + } + }).emulateTransitionEnd(modalTransitionDuration); + + this._element.focus(); + }; + + _proto._showElement = function _showElement(relatedTarget) { + var _this4 = this; + + var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); + var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; + + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // Don't move modal's DOM position + document.body.appendChild(this._element); + } + + this._element.style.display = 'block'; + + this._element.removeAttribute('aria-hidden'); + + this._element.setAttribute('aria-modal', true); + + this._element.setAttribute('role', 'dialog'); + + if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { + modalBody.scrollTop = 0; + } else { + this._element.scrollTop = 0; + } + + if (transition) { + Util.reflow(this._element); + } + + $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); + + if (this._config.focus) { + this._enforceFocus(); + } + + var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { + relatedTarget: relatedTarget + }); + + var transitionComplete = function transitionComplete() { + if (_this4._config.focus) { + _this4._element.focus(); + } + + _this4._isTransitioning = false; + $__default["default"](_this4._element).trigger(shownEvent); + }; + + if (transition) { + var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); + $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); + } else { + transitionComplete(); + } + }; + + _proto._enforceFocus = function _enforceFocus() { + var _this5 = this; + + $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop + .on(EVENT_FOCUSIN, function (event) { + if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { + _this5._element.focus(); + } + }); + }; + + _proto._setEscapeEvent = function _setEscapeEvent() { + var _this6 = this; + + if (this._isShown) { + $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { + if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { + event.preventDefault(); + + _this6.hide(); + } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { + _this6._triggerBackdropTransition(); + } + }); + } else if (!this._isShown) { + $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); + } + }; + + _proto._setResizeEvent = function _setResizeEvent() { + var _this7 = this; + + if (this._isShown) { + $__default["default"](window).on(EVENT_RESIZE, function (event) { + return _this7.handleUpdate(event); + }); + } else { + $__default["default"](window).off(EVENT_RESIZE); + } + }; + + _proto._hideModal = function _hideModal() { + var _this8 = this; + + this._element.style.display = 'none'; + + this._element.setAttribute('aria-hidden', true); + + this._element.removeAttribute('aria-modal'); + + this._element.removeAttribute('role'); + + this._isTransitioning = false; + + this._showBackdrop(function () { + $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); + + _this8._resetAdjustments(); + + _this8._resetScrollbar(); + + $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); + }); + }; + + _proto._removeBackdrop = function _removeBackdrop() { + if (this._backdrop) { + $__default["default"](this._backdrop).remove(); + this._backdrop = null; + } + }; + + _proto._showBackdrop = function _showBackdrop(callback) { + var _this9 = this; + + var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; + + if (this._isShown && this._config.backdrop) { + this._backdrop = document.createElement('div'); + this._backdrop.className = CLASS_NAME_BACKDROP; + + if (animate) { + this._backdrop.classList.add(animate); + } + + $__default["default"](this._backdrop).appendTo(document.body); + $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { + if (_this9._ignoreBackdropClick) { + _this9._ignoreBackdropClick = false; + return; + } + + if (event.target !== event.currentTarget) { + return; + } + + if (_this9._config.backdrop === 'static') { + _this9._triggerBackdropTransition(); + } else { + _this9.hide(); + } + }); + + if (animate) { + Util.reflow(this._backdrop); + } + + $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); + + if (!callback) { + return; + } + + if (!animate) { + callback(); + return; + } + + var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); + $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); + } else if (!this._isShown && this._backdrop) { + $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); + + var callbackRemove = function callbackRemove() { + _this9._removeBackdrop(); + + if (callback) { + callback(); + } + }; + + if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { + var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); + + $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); + } else { + callbackRemove(); + } + } else if (callback) { + callback(); + } + } // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- + ; + + _proto._adjustDialog = function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + "px"; + } + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + "px"; + } + }; + + _proto._resetAdjustments = function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + }; + + _proto._checkScrollbar = function _checkScrollbar() { + var rect = document.body.getBoundingClientRect(); + this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + }; + + _proto._setScrollbar = function _setScrollbar() { + var _this10 = this; + + if (this._isBodyOverflowing) { + // Note: DOMNode.style.paddingRight returns the actual value or '' if not set + // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set + var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); + var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding + + $__default["default"](fixedContent).each(function (index, element) { + var actualPadding = element.style.paddingRight; + var calculatedPadding = $__default["default"](element).css('padding-right'); + $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); + }); // Adjust sticky content margin + + $__default["default"](stickyContent).each(function (index, element) { + var actualMargin = element.style.marginRight; + var calculatedMargin = $__default["default"](element).css('margin-right'); + $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); + }); // Adjust body padding + + var actualPadding = document.body.style.paddingRight; + var calculatedPadding = $__default["default"](document.body).css('padding-right'); + $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); + } + + $__default["default"](document.body).addClass(CLASS_NAME_OPEN); + }; + + _proto._resetScrollbar = function _resetScrollbar() { + // Restore fixed content padding + var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); + $__default["default"](fixedContent).each(function (index, element) { + var padding = $__default["default"](element).data('padding-right'); + $__default["default"](element).removeData('padding-right'); + element.style.paddingRight = padding ? padding : ''; + }); // Restore sticky content + + var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); + $__default["default"](elements).each(function (index, element) { + var margin = $__default["default"](element).data('margin-right'); + + if (typeof margin !== 'undefined') { + $__default["default"](element).css('margin-right', margin).removeData('margin-right'); + } + }); // Restore body padding + + var padding = $__default["default"](document.body).data('padding-right'); + $__default["default"](document.body).removeData('padding-right'); + document.body.style.paddingRight = padding ? padding : ''; + }; + + _proto._getScrollbarWidth = function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + } // Static + ; + + Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $__default["default"](this).data(DATA_KEY$5); + + var _config = _extends$1({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); + + if (!data) { + data = new Modal(this, _config); + $__default["default"](this).data(DATA_KEY$5, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + }; + + _createClass(Modal, null, [{ + key: "VERSION", + get: function get() { + return VERSION$5; + } + }, { + key: "Default", + get: function get() { + return Default$4; + } + }]); + + return Modal; + }(); + /** + * Data API implementation + */ + + + $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { + var _this11 = this; + + var target; + var selector = Util.getSelectorFromElement(this); + + if (selector) { + target = document.querySelector(selector); + } + + var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data()); + + if (this.tagName === 'A' || this.tagName === 'AREA') { + event.preventDefault(); + } + + var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { + if (showEvent.isDefaultPrevented()) { + // Only register focus restorer if modal will actually get shown + return; + } + + $target.one(EVENT_HIDDEN$2, function () { + if ($__default["default"](_this11).is(':visible')) { + _this11.focus(); + } + }); + }); + + Modal._jQueryInterface.call($__default["default"](target), config, this); + }); + /** + * jQuery + */ + + $__default["default"].fn[NAME$5] = Modal._jQueryInterface; + $__default["default"].fn[NAME$5].Constructor = Modal; + + $__default["default"].fn[NAME$5].noConflict = function () { + $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; + return Modal._jQueryInterface; + }; + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.6.1): tools/sanitizer.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; + var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; + var DefaultWhitelist = { + // Global attributes allowed on any supplied element below. + '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], + a: ['target', 'href', 'title', 'rel'], + area: [], + b: [], + br: [], + col: [], + code: [], + div: [], + em: [], + hr: [], + h1: [], + h2: [], + h3: [], + h4: [], + h5: [], + h6: [], + i: [], + img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], + li: [], + ol: [], + p: [], + pre: [], + s: [], + small: [], + span: [], + sub: [], + sup: [], + strong: [], + u: [], + ul: [] + }; + /** + * A pattern that recognizes a commonly useful subset of URLs that are safe. + * + * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts + */ + + var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; + /** + * A pattern that matches safe data URLs. Only matches image, video and audio types. + * + * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts + */ + + var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; + + function allowedAttribute(attr, allowedAttributeList) { + var attrName = attr.nodeName.toLowerCase(); + + if (allowedAttributeList.indexOf(attrName) !== -1) { + if (uriAttrs.indexOf(attrName) !== -1) { + return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); + } + + return true; + } + + var regExp = allowedAttributeList.filter(function (attrRegex) { + return attrRegex instanceof RegExp; + }); // Check if a regular expression validates the attribute. + + for (var i = 0, len = regExp.length; i < len; i++) { + if (regExp[i].test(attrName)) { + return true; + } + } + + return false; + } + + function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { + if (unsafeHtml.length === 0) { + return unsafeHtml; + } + + if (sanitizeFn && typeof sanitizeFn === 'function') { + return sanitizeFn(unsafeHtml); + } + + var domParser = new window.DOMParser(); + var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); + var whitelistKeys = Object.keys(whiteList); + var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); + + var _loop = function _loop(i, len) { + var el = elements[i]; + var elName = el.nodeName.toLowerCase(); + + if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { + el.parentNode.removeChild(el); + return "continue"; + } + + var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread + + var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); + attributeList.forEach(function (attr) { + if (!allowedAttribute(attr, whitelistedAttributes)) { + el.removeAttribute(attr.nodeName); + } + }); + }; + + for (var i = 0, len = elements.length; i < len; i++) { + var _ret = _loop(i); + + if (_ret === "continue") continue; + } + + return createdDocument.body.innerHTML; + } + + /** + * Constants + */ + + var NAME$4 = 'tooltip'; + var VERSION$4 = '4.6.1'; + var DATA_KEY$4 = 'bs.tooltip'; + var EVENT_KEY$4 = "." + DATA_KEY$4; + var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; + var CLASS_PREFIX$1 = 'bs-tooltip'; + var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); + var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; + var CLASS_NAME_FADE$3 = 'fade'; + var CLASS_NAME_SHOW$3 = 'show'; + var HOVER_STATE_SHOW = 'show'; + var HOVER_STATE_OUT = 'out'; + var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; + var SELECTOR_ARROW = '.arrow'; + var TRIGGER_HOVER = 'hover'; + var TRIGGER_FOCUS = 'focus'; + var TRIGGER_CLICK = 'click'; + var TRIGGER_MANUAL = 'manual'; + var AttachmentMap = { + AUTO: 'auto', + TOP: 'top', + RIGHT: 'right', + BOTTOM: 'bottom', + LEFT: 'left' + }; + var Default$3 = { + animation: true, + template: '

', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + selector: false, + placement: 'top', + offset: 0, + container: false, + fallbackPlacement: 'flip', + boundary: 'scrollParent', + customClass: '', + sanitize: true, + sanitizeFn: null, + whiteList: DefaultWhitelist, + popperConfig: null + }; + var DefaultType$3 = { + animation: 'boolean', + template: 'string', + title: '(string|element|function)', + trigger: 'string', + delay: '(number|object)', + html: 'boolean', + selector: '(string|boolean)', + placement: '(string|function)', + offset: '(number|string|function)', + container: '(string|element|boolean)', + fallbackPlacement: '(string|array)', + boundary: '(string|element)', + customClass: '(string|function)', + sanitize: 'boolean', + sanitizeFn: '(null|function)', + whiteList: 'object', + popperConfig: '(null|object)' + }; + var Event$1 = { + HIDE: "hide" + EVENT_KEY$4, + HIDDEN: "hidden" + EVENT_KEY$4, + SHOW: "show" + EVENT_KEY$4, + SHOWN: "shown" + EVENT_KEY$4, + INSERTED: "inserted" + EVENT_KEY$4, + CLICK: "click" + EVENT_KEY$4, + FOCUSIN: "focusin" + EVENT_KEY$4, + FOCUSOUT: "focusout" + EVENT_KEY$4, + MOUSEENTER: "mouseenter" + EVENT_KEY$4, + MOUSELEAVE: "mouseleave" + EVENT_KEY$4 + }; + /** + * Class definition + */ + + var Tooltip = /*#__PURE__*/function () { + function Tooltip(element, config) { + if (typeof Popper$1 === 'undefined') { + throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); + } // Private + + + this._isEnabled = true; + this._timeout = 0; + this._hoverState = ''; + this._activeTrigger = {}; + this._popper = null; // Protected + + this.element = element; + this.config = this._getConfig(config); + this.tip = null; + + this._setListeners(); + } // Getters + + + var _proto = Tooltip.prototype; + + // Public + _proto.enable = function enable() { + this._isEnabled = true; + }; + + _proto.disable = function disable() { + this._isEnabled = false; + }; + + _proto.toggleEnabled = function toggleEnabled() { + this._isEnabled = !this._isEnabled; + }; + + _proto.toggle = function toggle(event) { + if (!this._isEnabled) { + return; + } + + if (event) { + var dataKey = this.constructor.DATA_KEY; + var context = $__default["default"](event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $__default["default"](event.currentTarget).data(dataKey, context); + } + + context._activeTrigger.click = !context._activeTrigger.click; + + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); + } + } else { + if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { + this._leave(null, this); + + return; + } + + this._enter(null, this); + } + }; + + _proto.dispose = function dispose() { + clearTimeout(this._timeout); + $__default["default"].removeData(this.element, this.constructor.DATA_KEY); + $__default["default"](this.element).off(this.constructor.EVENT_KEY); + $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); + + if (this.tip) { + $__default["default"](this.tip).remove(); + } + + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + + if (this._popper) { + this._popper.destroy(); + } + + this._popper = null; + this.element = null; + this.config = null; + this.tip = null; + }; + + _proto.show = function show() { + var _this = this; + + if ($__default["default"](this.element).css('display') === 'none') { + throw new Error('Please use show on visible elements'); + } + + var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); + + if (this.isWithContent() && this._isEnabled) { + $__default["default"](this.element).trigger(showEvent); + var shadowRoot = Util.findShadowRoot(this.element); + var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); + + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } + + var tip = this.getTipElement(); + var tipId = Util.getUID(this.constructor.NAME); + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); + this.setContent(); + + if (this.config.animation) { + $__default["default"](tip).addClass(CLASS_NAME_FADE$3); + } + + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; + + var attachment = this._getAttachment(placement); + + this.addAttachmentClass(attachment); + + var container = this._getContainer(); + + $__default["default"](tip).data(this.constructor.DATA_KEY, this); + + if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { + $__default["default"](tip).appendTo(container); + } + + $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); + this._popper = new Popper$1(this.element, tip, this._getPopperConfig(attachment)); + $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); + $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra + // empty mouseover listeners to the body's immediate children; + // only needed because of broken event delegation on iOS + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + + if ('ontouchstart' in document.documentElement) { + $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); + } + + var complete = function complete() { + if (_this.config.animation) { + _this._fixTransition(); + } + + var prevHoverState = _this._hoverState; + _this._hoverState = null; + $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); + + if (prevHoverState === HOVER_STATE_OUT) { + _this._leave(null, _this); + } + }; + + if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { + var transitionDuration = Util.getTransitionDurationFromElement(this.tip); + $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + } else { + complete(); + } + } + }; + + _proto.hide = function hide(callback) { + var _this2 = this; + + var tip = this.getTipElement(); + var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); + + var complete = function complete() { + if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { + tip.parentNode.removeChild(tip); + } + + _this2._cleanTipClass(); + + _this2.element.removeAttribute('aria-describedby'); + + $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); + + if (_this2._popper !== null) { + _this2._popper.destroy(); + } + + if (callback) { + callback(); + } + }; + + $__default["default"](this.element).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; + } + + $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + + if ('ontouchstart' in document.documentElement) { + $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); + } + + this._activeTrigger[TRIGGER_CLICK] = false; + this._activeTrigger[TRIGGER_FOCUS] = false; + this._activeTrigger[TRIGGER_HOVER] = false; + + if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { + var transitionDuration = Util.getTransitionDurationFromElement(tip); + $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + } else { + complete(); + } + + this._hoverState = ''; + }; + + _proto.update = function update() { + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } + } // Protected + ; + + _proto.isWithContent = function isWithContent() { + return Boolean(this.getTitle()); + }; + + _proto.addAttachmentClass = function addAttachmentClass(attachment) { + $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); + }; + + _proto.getTipElement = function getTipElement() { + this.tip = this.tip || $__default["default"](this.config.template)[0]; + return this.tip; + }; + + _proto.setContent = function setContent() { + var tip = this.getTipElement(); + this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); + $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); + }; + + _proto.setElementContent = function setElementContent($element, content) { + if (typeof content === 'object' && (content.nodeType || content.jquery)) { + // Content is a DOM node or a jQuery + if (this.config.html) { + if (!$__default["default"](content).parent().is($element)) { + $element.empty().append(content); + } + } else { + $element.text($__default["default"](content).text()); + } + + return; + } + + if (this.config.html) { + if (this.config.sanitize) { + content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); + } + + $element.html(content); + } else { + $element.text(content); + } + }; + + _proto.getTitle = function getTitle() { + var title = this.element.getAttribute('data-original-title'); + + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + } + + return title; + } // Private + ; + + _proto._getPopperConfig = function _getPopperConfig(attachment) { + var _this3 = this; + + var defaultBsConfig = { + placement: attachment, + modifiers: { + offset: this._getOffset(), + flip: { + behavior: this.config.fallbackPlacement + }, + arrow: { + element: SELECTOR_ARROW + }, + preventOverflow: { + boundariesElement: this.config.boundary + } + }, + onCreate: function onCreate(data) { + if (data.originalPlacement !== data.placement) { + _this3._handlePopperPlacementChange(data); + } + }, + onUpdate: function onUpdate(data) { + return _this3._handlePopperPlacementChange(data); + } + }; + return _extends$1({}, defaultBsConfig, this.config.popperConfig); + }; + + _proto._getOffset = function _getOffset() { + var _this4 = this; + + var offset = {}; + + if (typeof this.config.offset === 'function') { + offset.fn = function (data) { + data.offsets = _extends$1({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); + return data; + }; + } else { + offset.offset = this.config.offset; + } + + return offset; + }; + + _proto._getContainer = function _getContainer() { + if (this.config.container === false) { + return document.body; + } + + if (Util.isElement(this.config.container)) { + return $__default["default"](this.config.container); + } + + return $__default["default"](document).find(this.config.container); + }; + + _proto._getAttachment = function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + }; + + _proto._setListeners = function _setListeners() { + var _this5 = this; + + var triggers = this.config.trigger.split(' '); + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { + return _this5.toggle(event); + }); + } else if (trigger !== TRIGGER_MANUAL) { + var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; + var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; + $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { + return _this5._enter(event); + }).on(eventOut, _this5.config.selector, function (event) { + return _this5._leave(event); + }); + } + }); + + this._hideModalHandler = function () { + if (_this5.element) { + _this5.hide(); + } + }; + + $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); + + if (this.config.selector) { + this.config = _extends$1({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); + } + }; + + _proto._fixTitle = function _fixTitle() { + var titleType = typeof this.element.getAttribute('data-original-title'); + + if (this.element.getAttribute('title') || titleType !== 'string') { + this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); + this.element.setAttribute('title', ''); + } + }; + + _proto._enter = function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; + context = context || $__default["default"](event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $__default["default"](event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; + } + + if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { + context._hoverState = HOVER_STATE_SHOW; + return; + } + + clearTimeout(context._timeout); + context._hoverState = HOVER_STATE_SHOW; + + if (!context.config.delay || !context.config.delay.show) { + context.show(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HOVER_STATE_SHOW) { + context.show(); + } + }, context.config.delay.show); + }; + + _proto._leave = function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; + context = context || $__default["default"](event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $__default["default"](event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; + } + + if (context._isWithActiveTrigger()) { + return; + } + + clearTimeout(context._timeout); + context._hoverState = HOVER_STATE_OUT; + + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HOVER_STATE_OUT) { + context.hide(); + } + }, context.config.delay.hide); + }; + + _proto._isWithActiveTrigger = function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; + } + } + + return false; + }; + + _proto._getConfig = function _getConfig(config) { + var dataAttributes = $__default["default"](this.element).data(); + Object.keys(dataAttributes).forEach(function (dataAttr) { + if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { + delete dataAttributes[dataAttr]; + } + }); + config = _extends$1({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); + + if (typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } + + if (typeof config.title === 'number') { + config.title = config.title.toString(); + } + + if (typeof config.content === 'number') { + config.content = config.content.toString(); + } + + Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); + + if (config.sanitize) { + config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); + } + + return config; + }; + + _proto._getDelegateConfig = function _getDelegateConfig() { + var config = {}; + + if (this.config) { + for (var key in this.config) { + if (this.constructor.Default[key] !== this.config[key]) { + config[key] = this.config[key]; + } + } + } + + return config; + }; + + _proto._cleanTipClass = function _cleanTipClass() { + var $tip = $__default["default"](this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); + + if (tabClass !== null && tabClass.length) { + $tip.removeClass(tabClass.join('')); + } + }; + + _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { + this.tip = popperData.instance.popper; + + this._cleanTipClass(); + + this.addAttachmentClass(this._getAttachment(popperData.placement)); + }; + + _proto._fixTransition = function _fixTransition() { + var tip = this.getTipElement(); + var initConfigAnimation = this.config.animation; + + if (tip.getAttribute('x-placement') !== null) { + return; + } + + $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); + this.config.animation = false; + this.hide(); + this.show(); + this.config.animation = initConfigAnimation; + } // Static + ; + + Tooltip._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $element = $__default["default"](this); + var data = $element.data(DATA_KEY$4); + + var _config = typeof config === 'object' && config; + + if (!data && /dispose|hide/.test(config)) { + return; + } + + if (!data) { + data = new Tooltip(this, _config); + $element.data(DATA_KEY$4, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Tooltip, null, [{ + key: "VERSION", + get: function get() { + return VERSION$4; + } + }, { + key: "Default", + get: function get() { + return Default$3; + } + }, { + key: "NAME", + get: function get() { + return NAME$4; + } + }, { + key: "DATA_KEY", + get: function get() { + return DATA_KEY$4; + } + }, { + key: "Event", + get: function get() { + return Event$1; + } + }, { + key: "EVENT_KEY", + get: function get() { + return EVENT_KEY$4; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$3; + } + }]); + + return Tooltip; + }(); + /** + * jQuery + */ + + + $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; + $__default["default"].fn[NAME$4].Constructor = Tooltip; + + $__default["default"].fn[NAME$4].noConflict = function () { + $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; + return Tooltip._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$3 = 'popover'; + var VERSION$3 = '4.6.1'; + var DATA_KEY$3 = 'bs.popover'; + var EVENT_KEY$3 = "." + DATA_KEY$3; + var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; + var CLASS_PREFIX = 'bs-popover'; + var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); + var CLASS_NAME_FADE$2 = 'fade'; + var CLASS_NAME_SHOW$2 = 'show'; + var SELECTOR_TITLE = '.popover-header'; + var SELECTOR_CONTENT = '.popover-body'; + + var Default$2 = _extends$1({}, Tooltip.Default, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }); + + var DefaultType$2 = _extends$1({}, Tooltip.DefaultType, { + content: '(string|element|function)' + }); + + var Event = { + HIDE: "hide" + EVENT_KEY$3, + HIDDEN: "hidden" + EVENT_KEY$3, + SHOW: "show" + EVENT_KEY$3, + SHOWN: "shown" + EVENT_KEY$3, + INSERTED: "inserted" + EVENT_KEY$3, + CLICK: "click" + EVENT_KEY$3, + FOCUSIN: "focusin" + EVENT_KEY$3, + FOCUSOUT: "focusout" + EVENT_KEY$3, + MOUSEENTER: "mouseenter" + EVENT_KEY$3, + MOUSELEAVE: "mouseleave" + EVENT_KEY$3 + }; + /** + * Class definition + */ + + var Popover = /*#__PURE__*/function (_Tooltip) { + _inheritsLoose(Popover, _Tooltip); + + function Popover() { + return _Tooltip.apply(this, arguments) || this; + } + + var _proto = Popover.prototype; + + // Overrides + _proto.isWithContent = function isWithContent() { + return this.getTitle() || this._getContent(); + }; + + _proto.addAttachmentClass = function addAttachmentClass(attachment) { + $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); + }; + + _proto.getTipElement = function getTipElement() { + this.tip = this.tip || $__default["default"](this.config.template)[0]; + return this.tip; + }; + + _proto.setContent = function setContent() { + var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events + + this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); + + var content = this._getContent(); + + if (typeof content === 'function') { + content = content.call(this.element); + } + + this.setElementContent($tip.find(SELECTOR_CONTENT), content); + $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); + } // Private + ; + + _proto._getContent = function _getContent() { + return this.element.getAttribute('data-content') || this.config.content; + }; + + _proto._cleanTipClass = function _cleanTipClass() { + var $tip = $__default["default"](this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')); + } + } // Static + ; + + Popover._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $__default["default"](this).data(DATA_KEY$3); + + var _config = typeof config === 'object' ? config : null; + + if (!data && /dispose|hide/.test(config)) { + return; + } + + if (!data) { + data = new Popover(this, _config); + $__default["default"](this).data(DATA_KEY$3, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Popover, null, [{ + key: "VERSION", + get: // Getters + function get() { + return VERSION$3; + } + }, { + key: "Default", + get: function get() { + return Default$2; + } + }, { + key: "NAME", + get: function get() { + return NAME$3; + } + }, { + key: "DATA_KEY", + get: function get() { + return DATA_KEY$3; + } + }, { + key: "Event", + get: function get() { + return Event; + } + }, { + key: "EVENT_KEY", + get: function get() { + return EVENT_KEY$3; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$2; + } + }]); + + return Popover; + }(Tooltip); + /** + * jQuery + */ + + + $__default["default"].fn[NAME$3] = Popover._jQueryInterface; + $__default["default"].fn[NAME$3].Constructor = Popover; + + $__default["default"].fn[NAME$3].noConflict = function () { + $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; + return Popover._jQueryInterface; + }; + + /** + * Constants + */ + + var NAME$2 = 'scrollspy'; + var VERSION$2 = '4.6.1'; + var DATA_KEY$2 = 'bs.scrollspy'; + var EVENT_KEY$2 = "." + DATA_KEY$2; + var DATA_API_KEY$1 = '.data-api'; + var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; + var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; + var CLASS_NAME_ACTIVE$1 = 'active'; + var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; + var EVENT_SCROLL = "scroll" + EVENT_KEY$2; + var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; + var METHOD_OFFSET = 'offset'; + var METHOD_POSITION = 'position'; + var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; + var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; + var SELECTOR_NAV_LINKS = '.nav-link'; + var SELECTOR_NAV_ITEMS = '.nav-item'; + var SELECTOR_LIST_ITEMS = '.list-group-item'; + var SELECTOR_DROPDOWN$1 = '.dropdown'; + var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; + var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; + var Default$1 = { + offset: 10, + method: 'auto', + target: '' + }; + var DefaultType$1 = { + offset: 'number', + method: 'string', + target: '(string|element)' + }; + /** + * Class definition + */ + + var ScrollSpy = /*#__PURE__*/function () { + function ScrollSpy(element, config) { + var _this = this; + + this._element = element; + this._scrollElement = element.tagName === 'BODY' ? window : element; + this._config = this._getConfig(config); + this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); + this._offsets = []; + this._targets = []; + this._activeTarget = null; + this._scrollHeight = 0; + $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { + return _this._process(event); + }); + this.refresh(); + + this._process(); + } // Getters + + + var _proto = ScrollSpy.prototype; + + // Public + _proto.refresh = function refresh() { + var _this2 = this; + + var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; + this._offsets = []; + this._targets = []; + this._scrollHeight = this._getScrollHeight(); + var targets = [].slice.call(document.querySelectorAll(this._selector)); + targets.map(function (element) { + var target; + var targetSelector = Util.getSelectorFromElement(element); + + if (targetSelector) { + target = document.querySelector(targetSelector); + } + + if (target) { + var targetBCR = target.getBoundingClientRect(); + + if (targetBCR.width || targetBCR.height) { + // TODO (fat): remove sketch reliance on jQuery position/offset + return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; + } + } + + return null; + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this2._offsets.push(item[0]); + + _this2._targets.push(item[1]); + }); + }; + + _proto.dispose = function dispose() { + $__default["default"].removeData(this._element, DATA_KEY$2); + $__default["default"](this._scrollElement).off(EVENT_KEY$2); + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; + } // Private + ; + + _proto._getConfig = function _getConfig(config) { + config = _extends$1({}, Default$1, typeof config === 'object' && config ? config : {}); + + if (typeof config.target !== 'string' && Util.isElement(config.target)) { + var id = $__default["default"](config.target).attr('id'); + + if (!id) { + id = Util.getUID(NAME$2); + $__default["default"](config.target).attr('id', id); + } + + config.target = "#" + id; + } + + Util.typeCheckConfig(NAME$2, config, DefaultType$1); + return config; + }; + + _proto._getScrollTop = function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; + }; + + _proto._getScrollHeight = function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + }; + + _proto._getOffsetHeight = function _getOffsetHeight() { + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; + }; + + _proto._process = function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + + var scrollHeight = this._getScrollHeight(); + + var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } + + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; + + if (this._activeTarget !== target) { + this._activate(target); + } + + return; + } + + if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { + this._activeTarget = null; + + this._clear(); + + return; + } + + for (var i = this._offsets.length; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); + + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } + }; + + _proto._activate = function _activate(target) { + this._activeTarget = target; + + this._clear(); + + var queries = this._selector.split(',').map(function (selector) { + return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; + }); + + var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); + + if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { + $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); + $link.addClass(CLASS_NAME_ACTIVE$1); + } else { + // Set triggered link as active + $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active + // With both