diff --git a/.gitignore b/.gitignore
index e75012e4..59f50168 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,6 +43,7 @@ jsconfig.json
.vscode/*
.idea
*.iml
+.history
# project
#
diff --git a/README.md b/README.md
index 2e05fd6d..0d279010 100644
--- a/README.md
+++ b/README.md
@@ -260,12 +260,19 @@ const METHOD_DATA = [{
supportedMethods: ['android-pay'],
data: {
supportedNetworks: ['visa', 'mastercard', 'amex'],
+ // https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants.html
+ // PAYMENT_METHOD_CARD and PAYMENT_METHOD_TOKENIZED_CARD.. or [1, 2]
+ allowedPaymentMethods: [1, 2],
currencyCode: 'USD',
environment: 'TEST', // defaults to production
paymentMethodTokenizationParameters: {
- tokenizationType: 'NETWORK_TOKEN',
+ tokenizationType: 'PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT', // or PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY
parameters: {
- publicKey: 'your-pubic-key'
+ publicKey: 'your-pubic-key' // https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl
+ // if use PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY
+ // gateway: 'your gateway',
+ // gatewayMerchantId: 'your gatewayMerchantId',
+ // merchantName: 'your merchantName',
}
}
}
@@ -451,7 +458,7 @@ paymentRequest.addEventListener('shippingoptionchange', e => {
For a deeper dive on handling shipping in Payment Request, checkout Google's _[Shipping in Payment Request](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#shipping_in_payment_request_api)_.
-🚨 _Note: On Android, there are no `shippingaddresschange` and `shippingoptionchange` events. To allow users to update their shipping address, you'll need to trigger a new `PaymentRequest`. Updating shipping options typically happens after the receiving the `PaymentResponse` and before calling its `getPaymentToken` method._
+🚨 _Note: On Android, there are no `shippingaddresschange` and `shippingoptionchange` events. To allow users to update their shipping address, you'll need to trigger a new `PaymentRequest`. Updating shipping options typically happens after the receiving the `PaymentResponse`_
### Processing Payments
Now that we know how to initialize, display, and dismiss a Payment Request, let's take a look at how to process payments.
@@ -501,24 +508,19 @@ paymentRequest.show()
```es6
paymentRequest.show()
.then(paymentResponse => {
- const { getPaymentToken } = paymentResponse.details;
-
- return getPaymentToken()
- .then(paymentToken => {
- const { ephemeralPublicKey, encryptedMessage, tag } = paymentResponse.details;
-
- return fetch('...', {
- method: 'POST',
- body: {
- ephemeralPublicKey,
- encryptedMessage,
- tag
- }
- })
- .then(res => res.json())
- .then(successHandler)
- .catch(errorHandler)
- });
+ const { ephemeralPublicKey, encryptedMessage, tag } = paymentResponse.details.paymentToken;
+
+ return fetch('...', {
+ method: 'POST',
+ body: {
+ ephemeralPublicKey,
+ encryptedMessage,
+ tag
+ }
+ })
+ .then(res => res.json())
+ .then(successHandler)
+ .catch(errorHandler)
});
```
@@ -533,7 +535,7 @@ When using a payment processor, you'll receive a `paymentToken` field within the
```es6
paymentRequest.show()
.then(paymentResponse => {
- const { paymentToken } = paymentResponse.details; // On Android, you need to invoke the `getPaymentToken` method to receive the `paymentToken`.
+ const { paymentToken } = paymentResponse.details;
return fetch('...', {
method: 'POST',
@@ -554,19 +556,17 @@ paymentRequest.show()
```es6
paymentRequest.show()
.then(paymentResponse => {
- const { getPaymentToken } = paymentResponse.details;
-
- return getPaymentToken()
- .then(paymentToken => fetch('...', {
- method: 'POST',
- body: {
- paymentToken
- }
- })
- .then(res => res.json())
- .then(successHandler)
- .catch(errorHandler);
- });
+ const { paymentToken } = paymentResponse.details;
+
+ return fetch('...', {
+ method: 'POST',
+ body: {
+ paymentToken
+ }
+ })
+ .then(res => res.json())
+ .then(successHandler)
+ .catch(errorHandler);
});
```
@@ -631,6 +631,8 @@ Here's a list of Payment Processors that you can enable via add-ons:
- [Brand Guidelines](https://developers.google.com/pay/api/android/guides/brand-guidelines)
- [Gateway Token Approach](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/android-pay#gateway_token_approach)
- [Network Token Approach](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/android-pay#network_token_approach)
+- [WalletConstants](https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants)
+
# License
Licensed under the MIT License, Copyright © 2017, [Naoufal Kadhom](https://twitter.com/naoufal).
diff --git a/android/build.gradle b/android/build.gradle
index 0d066bd1..a08c7fbd 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 28
+ compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "28.0.3"
defaultConfig {
@@ -20,8 +20,8 @@ android {
dependencies {
implementation 'com.facebook.react:react-native:+'
- implementation 'com.google.android.gms:play-services-base:17.0.0'
- implementation 'com.google.android.gms:play-services-identity:17.0.0'
- implementation 'com.google.android.gms:play-services-wallet:17.0.0'
+ implementation 'com.google.android.gms:play-services-base:18.0.0'
+ implementation 'com.google.android.gms:play-services-identity:18.0.0'
+ implementation 'com.google.android.gms:play-services-wallet:18.0.0'
implementation 'com.android.support:support-v4:23.0.1'
}
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index 3bc7e98e..0a14dbfd 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -2,4 +2,9 @@
+
+
+
diff --git a/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java b/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java
index a47b50d4..7a749f16 100644
--- a/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java
+++ b/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java
@@ -5,11 +5,11 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
import android.app.Fragment;
import android.app.FragmentManager;
-import android.support.annotation.RequiresPermission;
+import androidx.annotation.RequiresPermission;
import android.util.Log;
import com.facebook.react.bridge.Callback;
@@ -22,6 +22,10 @@
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.identity.intents.model.UserAddress;
import com.google.android.gms.wallet.*;
+import com.google.android.gms.common.api.ApiException;
+import com.google.android.gms.common.api.Status;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
import com.facebook.react.bridge.ActivityEventListener;
import com.facebook.react.bridge.BaseActivityEventListener;
@@ -38,19 +42,20 @@
import java.util.List;
import java.util.Map;
-public class ReactNativePaymentsModule extends ReactContextBaseJavaModule implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONArray;
+
+public class ReactNativePaymentsModule extends ReactContextBaseJavaModule {
private static final int LOAD_MASKED_WALLET_REQUEST_CODE = 88;
- private static final int LOAD_FULL_WALLET_REQUEST_CODE = 89;
- // Google API Client
- private GoogleApiClient mGoogleApiClient = null;
+ // Payments Client
+ private PaymentsClient mPaymentsClient;
// Callbacks
private static Callback mShowSuccessCallback = null;
private static Callback mShowErrorCallback = null;
- private static Callback mGetFullWalletSuccessCallback= null;
- private static Callback mGetFullWalletErrorCallback = null;
public static final String REACT_CLASS = "ReactNativePayments";
@@ -69,26 +74,65 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
switch (resultCode) {
case Activity.RESULT_OK:
if (data != null) {
- MaskedWallet maskedWallet =
- data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
- Log.i(REACT_CLASS, "ANDROID PAY SUCCESS" + maskedWallet.getEmail());
- Log.i(REACT_CLASS, "ANDROID PAY SUCCESS" + buildAddressFromUserAddress(maskedWallet.getBuyerBillingAddress()));
+ PaymentData paymentData = PaymentData.getFromIntent(data);
+
+ Log.i(REACT_CLASS, "ANDROID PAY SUCCESS" + buildAddressFromUserAddress(paymentData.getCardInfo().getBillingAddress()));
- UserAddress userAddress = maskedWallet.getBuyerShippingAddress();
+ UserAddress userAddress = paymentData.getShippingAddress();
WritableNativeMap shippingAddress = userAddress != null
? buildAddressFromUserAddress(userAddress)
: null;
- // TODO: Move into function
WritableNativeMap paymentDetails = new WritableNativeMap();
- paymentDetails.putString("paymentDescription", maskedWallet.getPaymentDescriptions()[0]);
- paymentDetails.putString("payerEmail", maskedWallet.getEmail());
+ paymentDetails.putString("payerEmail", paymentData.getEmail());
paymentDetails.putMap("shippingAddress", shippingAddress);
- paymentDetails.putString("googleTransactionId", maskedWallet.getGoogleTransactionId());
+ paymentDetails.putString("googleTransactionId", paymentData.getGoogleTransactionId());
+
+ WritableNativeMap cardInfo = buildCardInfo(paymentData.getCardInfo());
+ paymentDetails.putMap("cardInfo", cardInfo);
+
+ String serializedPaymentToken = paymentData.getPaymentMethodToken().getToken();
+ try {
+ JSONObject paymentTokenJson = new JSONObject(serializedPaymentToken);
+ String protocolVersion = paymentTokenJson.getString("protocolVersion");
+ String signature = paymentTokenJson.getString("signature");
+ String signedMessage = paymentTokenJson.getString("signedMessage");
+
+ String serializeIntermediateSigningKey = paymentTokenJson.getString("intermediateSigningKey");
+
+ WritableNativeMap paymentToken = new WritableNativeMap();
+
+ JSONObject intermediateSigningKeyJson = new JSONObject(serializeIntermediateSigningKey);
+ WritableNativeMap intermediateSigningKey = new WritableNativeMap();
+
+ String signedKey = intermediateSigningKeyJson.getString("signedKey");
+ JSONArray signatures = intermediateSigningKeyJson.getJSONArray("signatures");
+ WritableNativeArray signaturesArray = new WritableNativeArray();
+
+ intermediateSigningKey.putString("signedKey", signedKey);
- sendEvent(reactContext, "NativePayments:onuseraccept", paymentDetails);
+ for (int i = 0; i < signatures.length(); i++) {
+ signaturesArray.pushString(signatures.getString(i));
+ }
+
+ intermediateSigningKey.putArray("signatures", signaturesArray);
+
+ paymentToken.putString("protocolVersion", protocolVersion);
+ paymentToken.putString("signature", signature);
+ paymentToken.putString("signedMessage", signedMessage);
+ paymentToken.putMap("intermediateSigningKey", intermediateSigningKey);
+
+ paymentDetails.putMap("paymentToken", paymentToken);
+
+
+ sendEvent(reactContext, "NativePayments:onuseraccept", paymentDetails);
+
+ } catch (JSONException e) {
+ Log.e(REACT_CLASS, "ANDROID PAY JSON ERROR", e);
+ mShowErrorCallback.invoke(errorCode);
+ }
}
break;
case Activity.RESULT_CANCELED:
@@ -102,17 +146,6 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
break;
}
break;
- case LOAD_FULL_WALLET_REQUEST_CODE:
- if (resultCode == Activity.RESULT_OK && data != null) {
- FullWallet fullWallet = data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
- String tokenJSON = fullWallet.getPaymentMethodToken().getToken();
- Log.i(REACT_CLASS, "FULL WALLET SUCCESS" + tokenJSON);
-
- mGetFullWalletSuccessCallback.invoke(tokenJSON);
- } else {
- Log.i(REACT_CLASS, "FULL WALLET FAILURE");
- mGetFullWalletErrorCallback.invoke();
- }
case WalletConstants.RESULT_ERROR:activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
// handleError(errorCode);
break;
@@ -151,25 +184,42 @@ public void getSupportedGateways(Callback errorCallback, Callback successCallbac
}
@ReactMethod
- public void canMakePayments(ReadableMap paymentMethodData, Callback errorCallback, Callback successCallback) {
- final Callback callback = successCallback;
- IsReadyToPayRequest req = IsReadyToPayRequest.newBuilder()
- .addAllowedCardNetwork(WalletConstants.CardNetwork.MASTERCARD)
- .addAllowedCardNetwork(WalletConstants.CardNetwork.VISA)
- .build();
+ public void canMakePayments(ReadableMap paymentMethodData, final Callback errorCallback, final Callback successCallback) {
+ IsReadyToPayRequest.Builder builder = IsReadyToPayRequest.newBuilder();
+
+ ReadableArray allowedCardNetworks = paymentMethodData.getArray("supportedNetworks");
+ if (allowedCardNetworks != null) {
+ builder.addAllowedCardNetworks(buildAllowedCardNetworks(allowedCardNetworks));
+ }
+
+ ReadableArray allowedPaymentMethods = paymentMethodData.getArray("allowedPaymentMethods");
+ if (allowedPaymentMethods != null) {
+ builder.addAllowedPaymentMethods(buildAllowedPaymentMethods(allowedPaymentMethods));
+ }
+
+ IsReadyToPayRequest request = builder.build();
+
int environment = getEnvironmentFromPaymentMethodData(paymentMethodData);
- if (mGoogleApiClient == null) {
- buildGoogleApiClient(getCurrentActivity(), environment);
+ if (mPaymentsClient == null) {
+ buildPaymentsClient(getCurrentActivity(), environment);
}
- Wallet.Payments.isReadyToPay(mGoogleApiClient, req)
- .setResultCallback(new ResultCallback() {
- @Override
- public void onResult(@NonNull BooleanResult booleanResult) {
- callback.invoke(booleanResult.getValue());
+ Task task = mPaymentsClient.isReadyToPay(request);
+ task.addOnCompleteListener(
+ new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ try {
+ boolean result = task.getResult(ApiException.class);
+ if (result) {
+ successCallback.invoke(result);
+ }
+ } catch (ApiException e) {
+ errorCallback.invoke(e.getMessage());
}
- });
+ }
+ });
}
@ReactMethod
@@ -198,53 +248,40 @@ public void show(
final PaymentMethodTokenizationParameters parameters = buildTokenizationParametersFromPaymentMethodData(paymentMethodData);
- // TODO: clean up MaskedWalletRequest
ReadableMap total = details.getMap("total").getMap("amount");
- final MaskedWalletRequest maskedWalletRequest = MaskedWalletRequest.newBuilder()
- .setPaymentMethodTokenizationParameters(parameters)
- .setPhoneNumberRequired(shouldRequestPayerPhone)
- .setShippingAddressRequired(shouldRequestShipping)
- .setEstimatedTotalPrice(total.getString("value"))
- .setCurrencyCode(total.getString("currency"))
- .build();
- int environment = getEnvironmentFromPaymentMethodData(paymentMethodData);
- if (mGoogleApiClient == null) {
- buildGoogleApiClient(getCurrentActivity(), environment);
- }
- Wallet.Payments.loadMaskedWallet(mGoogleApiClient, maskedWalletRequest, LOAD_MASKED_WALLET_REQUEST_CODE);
- }
+ PaymentDataRequest.Builder builder = PaymentDataRequest.newBuilder()
+ .setTransactionInfo(TransactionInfo.newBuilder()
+ .setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
+ .setTotalPrice(total.getString("value"))
+ .setCurrencyCode(total.getString("currency"))
+ .build())
+ .setPhoneNumberRequired(shouldRequestPayerPhone)
+ .setShippingAddressRequired(shouldRequestShipping)
+ .setPaymentMethodTokenizationParameters(parameters);
- @ReactMethod
- public void getFullWalletAndroid(
- String googleTransactionId,
- ReadableMap paymentMethodData,
- ReadableMap details,
- Callback errorCallback,
- Callback successCallback
- ) {
- mGetFullWalletSuccessCallback = successCallback;
- mGetFullWalletErrorCallback = errorCallback;
- ReadableMap total = details.getMap("total").getMap("amount");
- Log.i(REACT_CLASS, "ANDROID PAY getFullWalletAndroid" + details.getMap("total").getMap("amount"));
+ ReadableArray allowedCardNetworks = paymentMethodData.getArray("supportedNetworks");
+ if (allowedCardNetworks != null) {
+ builder.setCardRequirements(CardRequirements.newBuilder()
+ .addAllowedCardNetworks(buildAllowedCardNetworks(allowedCardNetworks)).build()
+ );
+ }
+
+ ReadableArray allowedPaymentMethods = paymentMethodData.getArray("allowedPaymentMethods");
+ if (allowedPaymentMethods != null) {
+ builder.addAllowedPaymentMethods(buildAllowedPaymentMethods(allowedPaymentMethods));
+ }
- FullWalletRequest fullWalletRequest = FullWalletRequest.newBuilder()
- .setGoogleTransactionId(googleTransactionId)
- .setCart(Cart.newBuilder()
- .setCurrencyCode(total.getString("currency"))
- .setTotalPrice(total.getString("value"))
- .setLineItems(buildLineItems(details.getArray("displayItems")))
- .build())
- .build();
+ PaymentDataRequest request = builder.build();
int environment = getEnvironmentFromPaymentMethodData(paymentMethodData);
- if (mGoogleApiClient == null) {
- buildGoogleApiClient(getCurrentActivity(), environment);
- }
- Wallet.Payments.loadFullWallet(mGoogleApiClient, fullWalletRequest, LOAD_FULL_WALLET_REQUEST_CODE);
+ if (mPaymentsClient == null) buildPaymentsClient(getCurrentActivity(), environment);
+
+ AutoResolveHelper.resolveTask(
+ mPaymentsClient.loadPaymentData(request), getCurrentActivity(), LOAD_MASKED_WALLET_REQUEST_CODE);
}
// Private Method
@@ -254,10 +291,10 @@ private static PaymentMethodTokenizationParameters buildTokenizationParametersFr
String tokenizationType = tokenizationParameters.getString("tokenizationType");
- if (tokenizationType.equals("GATEWAY_TOKEN")) {
+ if (tokenizationType.equals("PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY")) {
ReadableMap parameters = tokenizationParameters.getMap("parameters");
PaymentMethodTokenizationParameters.Builder parametersBuilder = PaymentMethodTokenizationParameters.newBuilder()
- .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.PAYMENT_GATEWAY)
+ .setPaymentMethodTokenizationType(WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY)
.addParameter("gateway", parameters.getString("gateway"));
ReadableMapKeySetIterator iterator = parameters.keySetIterator();
@@ -274,37 +311,75 @@ private static PaymentMethodTokenizationParameters buildTokenizationParametersFr
String publicKey = tokenizationParameters.getMap("parameters").getString("publicKey");
return PaymentMethodTokenizationParameters.newBuilder()
- .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN)
+ .setPaymentMethodTokenizationType(WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT)
.addParameter("publicKey", publicKey)
.build();
}
}
- private static List buildLineItems(ReadableArray displayItems) {
- List list = new ArrayList();
-
+ protected static List buildAllowedPaymentMethods(ReadableArray allowedPaymentMethods) {
+ List result = new ArrayList();
+ int size = allowedPaymentMethods.size();
+ for (int i = 0; i < size; ++i) {
+ int allowedPaymentMethod = allowedPaymentMethods.getInt(i);
+ result.add(allowedPaymentMethod);
+ }
- for (int i = 0; i < (displayItems.size() - 1); i++) {
- ReadableMap displayItem = displayItems.getMap(i);
- ReadableMap amount = displayItem.getMap("amount");
+ return result;
+ }
- list.add(LineItem.newBuilder()
- .setCurrencyCode(amount.getString("currency"))
- .setDescription(displayItem.getString("label"))
- .setQuantity("1")
- .setUnitPrice(amount.getString("value"))
- .setTotalPrice(amount.getString("value"))
- .build());
+ protected static List buildAllowedCardNetworks(ReadableArray allowedCardNetworks) {
+ List result = new ArrayList();
+ int size = allowedCardNetworks.size();
+ for (int i = 0; i < size; ++i) {
+ String allowedCardNetwork = allowedCardNetworks.getString(i);
+ switch (allowedCardNetwork) {
+ case "visa":
+ result.add(WalletConstants.CARD_NETWORK_VISA);
+ break;
+ case "mastercard":
+ result.add(WalletConstants.CARD_NETWORK_MASTERCARD);
+ break;
+ case "amex":
+ result.add(WalletConstants.CARD_NETWORK_AMEX);
+ break;
+ case "discover":
+ result.add(WalletConstants.CARD_NETWORK_DISCOVER);
+ break;
+ case "interac":
+ result.add(WalletConstants.CARD_NETWORK_INTERAC);
+ break;
+ case "jcb":
+ result.add(WalletConstants.CARD_NETWORK_JCB);
+ break;
+ default:
+ result.add(WalletConstants.CARD_NETWORK_OTHER);
+ }
}
- Log.i(REACT_CLASS, "ANDROID PAY getFullWalletAndroid" + list);
+ return result;
+ }
+
+ protected static WritableNativeMap buildCardInfo(CardInfo cardInfo) {
+
+ if (cardInfo == null) return null;
+
+
+ WritableNativeMap result = new WritableNativeMap();
+
+ result.putInt("cardClass", cardInfo.getCardClass());
+ result.putString("cardDescription", cardInfo.getCardDescription());
+ result.putString("cardDetails", cardInfo.getCardDetails());
+ result.putString("cardNetwork", cardInfo.getCardNetwork());
- return list;
+ return result;
}
private static WritableNativeMap buildAddressFromUserAddress(UserAddress userAddress) {
WritableNativeMap address = new WritableNativeMap();
+ if (userAddress == null) return address;
+
address.putString("recipient", userAddress.getName());
address.putString("organization", userAddress.getCompanyName());
address.putString("addressLine", userAddress.getAddress1());
@@ -336,36 +411,12 @@ private int getEnvironmentFromPaymentMethodData(ReadableMap paymentMethodData) {
: WalletConstants.ENVIRONMENT_PRODUCTION;
}
- // Google API Client
- // ---------------------------------------------------------------------------------------------
- private void buildGoogleApiClient(Activity currentActivity, int environment) {
- mGoogleApiClient = new GoogleApiClient.Builder(currentActivity)
- .addConnectionCallbacks(this)
- .addOnConnectionFailedListener(this)
- .addApi(Wallet.API, new Wallet.WalletOptions.Builder()
- .setEnvironment(environment)
- .setTheme(WalletConstants.THEME_LIGHT)
- .build())
- .build();
- mGoogleApiClient.connect();
- }
-
- @Override
- public void onConnected(Bundle connectionHint) {
-// mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
- }
-
-
- @Override
- public void onConnectionFailed(ConnectionResult result) {
- // Refer to Google Play documentation for what errors can be logged
- Log.i(REACT_CLASS, "Connection failed: ConnectionResult.getErrorCode() = " + result.getErrorCode());
- }
-
- @Override
- public void onConnectionSuspended(int cause) {
- // Attempts to reconnect if a disconnect occurs
- Log.i(REACT_CLASS, "Connection suspended");
- mGoogleApiClient.connect();
+ protected void buildPaymentsClient(Activity currentActivity, int environment) {
+ mPaymentsClient = Wallet.getPaymentsClient(
+ currentActivity,
+ new Wallet.WalletOptions.Builder()
+ .setEnvironment(environment)
+ .build()
+ );
}
}
diff --git a/examples/common/handlers/index.js b/examples/common/handlers/index.js
index 9995286a..5afd704b 100644
--- a/examples/common/handlers/index.js
+++ b/examples/common/handlers/index.js
@@ -15,11 +15,6 @@ function prDisplayHandler(paymentRequest) {
return paymentRequest
.show()
.then(paymentResponse => {
- if (Platform.OS === 'android') {
- // Fetch PaymentToken
- paymentResponse.details.getPaymentToken().then(console.log);
- }
-
paymentResponse.complete('success');
})
.catch(console.warn);
diff --git a/examples/native/ios/main.jsbundle b/examples/native/ios/main.jsbundle
deleted file mode 100644
index 5eec8e83..00000000
--- a/examples/native/ios/main.jsbundle
+++ /dev/null
@@ -1,16393 +0,0 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // identity function for calling harmony imports with the correct context
-/******/ __webpack_require__.i = function(value) { return value; };
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
-/******/ });
-/******/ }
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 0);
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "../../index.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-module.exports=__webpack_require__("../../lib/js/index.js");
-
-/***/ }),
-
-/***/ "../../lib/js/NativePayments.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-Object.defineProperty(exports,"__esModule",{value:true});var _reactNative=__webpack_require__("./node_modules/react-native/Libraries/react-native/react-native.js");var ReactNativePayments=_reactNative.NativeModules.ReactNativePayments;var IS_ANDROID=_reactNative.Platform.OS==='android';var NativePayments={supportedGateways:IS_ANDROID?['stripe','braintree']:ReactNativePayments.supportedGateways,canMakePayments:function canMakePayments(methodData){return new Promise(function(resolve,reject){if(IS_ANDROID){ReactNativePayments.canMakePayments(methodData,function(err){return reject(err);},function(canMakePayments){return resolve(true);});return;}resolve(ReactNativePayments.canMakePayments);});},createPaymentRequest:function createPaymentRequest(methodData,details){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return new Promise(function(resolve,reject){if(IS_ANDROID){return resolve();}ReactNativePayments.createPaymentRequest(methodData,details,options,function(err){if(err)return reject(err);resolve();});});},handleDetailsUpdate:function handleDetailsUpdate(details){return new Promise(function(resolve,reject){if(IS_ANDROID){resolve(undefined);return;}ReactNativePayments.handleDetailsUpdate(details,function(err){if(err)return reject(err);resolve();});});},show:function show(methodData,details){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return new Promise(function(resolve,reject){if(IS_ANDROID){ReactNativePayments.show(methodData,details,options,function(err){return reject(err);},function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}console.log(args);resolve(true);});return;}ReactNativePayments.show(function(err,paymentToken){if(err)return reject(err);resolve(true);});});},abort:function abort(){return new Promise(function(resolve,reject){if(IS_ANDROID){resolve(undefined);return;}ReactNativePayments.abort(function(err){if(err)return reject(err);resolve(true);});});},complete:function complete(paymentStatus){return new Promise(function(resolve,reject){if(IS_ANDROID){resolve(undefined);return;}ReactNativePayments.complete(paymentStatus,function(err){if(err)return reject(err);resolve(true);});});},getFullWalletAndroid:function getFullWalletAndroid(googleTransactionId,paymentMethodData,details){return new Promise(function(resolve,reject){if(!IS_ANDROID){reject(new Error('This method is only available on Android.'));return;}ReactNativePayments.getFullWalletAndroid(googleTransactionId,paymentMethodData,details,function(err){return reject(err);},function(serializedPaymenToken){return resolve({serializedPaymenToken:serializedPaymenToken,paymenToken:JSON.parse(serializedPaymenToken)});});});}};exports.default=NativePayments;
-
-/***/ }),
-
-/***/ "../../lib/js/PaymentRequest.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i0&&arguments[0]!==undefined?arguments[0]:[];var details=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};_classCallCheck(this,PaymentRequest);noop();if(!details.id){details.id=(0,_v2.default)();}var serializedMethodData=(0,_helpers.validatePaymentMethods)(methodData);(0,_helpers.validateTotal)(details.total,_errors.ConstructorError);(0,_helpers.validateDisplayItems)(details.displayItems,_errors.ConstructorError);var selectedShippingOption=null;(0,_helpers.validateShippingOptions)(details,_errors.ConstructorError);if(IS_IOS){selectedShippingOption=(0,_helpers.getSelectedShippingOption)(details.shippingOptions);}var serializedModifierData=[];this._options=options;this._state='created';this._updating=false;this._details=details;this._serializedModifierData=serializedModifierData;this._serializedMethodData=JSON.stringify(methodData);this._id=details.id;this._shippingOption=selectedShippingOption;this._shippingAddress=null;this._shippingType=IS_IOS&&options.requestShipping===true?options.shippingType:null;this._setupEventListeners();this._shippingAddressChangesCount=0;var platformMethodData=(0,_helpers.getPlatformMethodData)(methodData,_reactNative.Platform.OS);var normalizedDetails=(0,_helpers.convertDetailAmountsToString)(details);if((0,_helpers.hasGatewayConfig)(platformMethodData)){(0,_helpers.validateGateway)((0,_helpers.getGatewayName)(platformMethodData),_NativePayments2.default.supportedGateways);}_NativePayments2.default.createPaymentRequest(platformMethodData,normalizedDetails,options);}_createClass(PaymentRequest,[{key:'_setupEventListeners',value:function _setupEventListeners(){this._userDismissSubscription=_reactNative.DeviceEventEmitter.addListener(_constants.USER_DISMISS_EVENT,this._closePaymentRequest.bind(this));this._userAcceptSubscription=_reactNative.DeviceEventEmitter.addListener(_constants.USER_ACCEPT_EVENT,this._handleUserAccept.bind(this));if(IS_IOS){this._gatewayErrorSubscription=_reactNative.DeviceEventEmitter.addListener(_constants.GATEWAY_ERROR_EVENT,this._handleGatewayError.bind(this));this._shippingOptionChangeSubscription=_reactNative.DeviceEventEmitter.addListener(_constants.INTERNAL_SHIPPING_OPTION_CHANGE_EVENT,this._handleShippingOptionChange.bind(this));this._shippingAddressChangeSubscription=_reactNative.DeviceEventEmitter.addListener(_constants.INTERNAL_SHIPPING_ADDRESS_CHANGE_EVENT,this._handleShippingAddressChange.bind(this));}}},{key:'_handleShippingAddressChange',value:function _handleShippingAddressChange(postalAddress){this._shippingAddress=postalAddress;var event=new _PaymentRequestUpdateEvent2.default(_constants.SHIPPING_ADDRESS_CHANGE_EVENT,this);this._shippingAddressChangesCount++;if(IS_IOS&&this._shippingAddressChangesCount===1){return event.updateWith(this._details);}this._shippingAddressChangeFn(event);}},{key:'_handleShippingOptionChange',value:function _handleShippingOptionChange(_ref){var selectedShippingOptionId=_ref.selectedShippingOptionId;this._shippingOption=selectedShippingOptionId;var event=new _PaymentRequestUpdateEvent2.default(_constants.SHIPPING_OPTION_CHANGE_EVENT,this);this._shippingOptionChangeFn(event);}},{key:'_getPlatformDetails',value:function _getPlatformDetails(details){return IS_IOS?this._getPlatformDetailsIOS(details):this._getPlatformDetailsAndroid(details);}},{key:'_getPlatformDetailsIOS',value:function _getPlatformDetailsIOS(details){var transactionIdentifier=details.transactionIdentifier,serializedPaymentData=details.paymentData;var isSimulator=transactionIdentifier==='Simulated Identifier';if(isSimulator){return _extends({},details,{paymentData:null,serializedPaymentData:serializedPaymentData});}return{transactionIdentifier:transactionIdentifier,paymentData:JSON.parse(serializedPaymentData),serializedPaymentData:serializedPaymentData};}},{key:'_getPlatformDetailsAndroid',value:function _getPlatformDetailsAndroid(details){var _this=this;var googleTransactionId=details.googleTransactionId,paymentDescription=details.paymentDescription;return{googleTransactionId:googleTransactionId,paymentDescription:paymentDescription,getPaymentToken:function getPaymentToken(){return _NativePayments2.default.getFullWalletAndroid(googleTransactionId,(0,_helpers.getPlatformMethodData)(JSON.parse(_this._serializedMethodData,_reactNative.Platform.OS)),(0,_helpers.convertDetailAmountsToString)(_this._details));}};}},{key:'_handleUserAccept',value:function _handleUserAccept(details){if(IS_ANDROID){var _shippingAddress=details.shippingAddress;this._shippingAddress=_shippingAddress;}var platformDetails=this._getPlatformDetails(details);var paymentResponse=new _PaymentResponse2.default({requestId:this.id,methodName:IS_IOS?'apple-pay':'android-pay',details:platformDetails,shippingAddress:this._options.requestShipping?this._shippingAddress:null,shippingOption:IS_IOS?this._shippingOption:null,payerName:this._options.requestPayerName?this._shippingAddress.recipient:null,payerPhone:this._options.requestPayerPhone?this._shippingAddress.phone:null,payerEmail:IS_ANDROID&&this._options.requestPayerEmail?details.payerEmail:null});return this._acceptPromiseResolver(paymentResponse);}},{key:'_handleGatewayError',value:function _handleGatewayError(details){return this._acceptPromiseRejecter(new _errors.GatewayError(details.error));}},{key:'_closePaymentRequest',value:function _closePaymentRequest(){this._state='closed';this._acceptPromiseRejecter(new Error('AbortError'));this._removeEventListeners();}},{key:'_removeEventListeners',value:function _removeEventListeners(){_reactNative.DeviceEventEmitter.removeSubscription(this._userDismissSubscription);_reactNative.DeviceEventEmitter.removeSubscription(this._userAcceptSubscription);if(IS_IOS){_reactNative.DeviceEventEmitter.removeSubscription(this._shippingAddressChangeSubscription);_reactNative.DeviceEventEmitter.removeSubscription(this._shippingOptionChangeSubscription);}}},{key:'addEventListener',value:function addEventListener(eventName,fn){if(eventName===_constants.SHIPPING_ADDRESS_CHANGE_EVENT){return this._shippingAddressChangeFn=fn.bind(this);}if(eventName===_constants.SHIPPING_OPTION_CHANGE_EVENT){return this._shippingOptionChangeFn=fn.bind(this);}}},{key:'show',value:function show(){var _this2=this;this._acceptPromise=new Promise(function(resolve,reject){_this2._acceptPromiseResolver=resolve;_this2._acceptPromiseRejecter=reject;if(_this2._state!=='created'){return reject(new Error('InvalidStateError'));}_this2._state='interactive';var platformMethodData=(0,_helpers.getPlatformMethodData)(JSON.parse(_this2._serializedMethodData),_reactNative.Platform.OS);var normalizedDetails=(0,_helpers.convertDetailAmountsToString)(_this2._details);var options=_this2._options;return _NativePayments2.default.show(platformMethodData,normalizedDetails,options);});return this._acceptPromise;}},{key:'abort',value:function abort(){var _this3=this;return new Promise(function(resolve,reject){if(_this3._state!=='interactive'){return reject(new Error('InvalidStateError'));}_NativePayments2.default.abort(function(err){if(err){return reject(new Error('InvalidStateError'));}_this3._closePaymentRequest();return resolve(undefined);});});}},{key:'canMakePayments',value:function canMakePayments(){return _NativePayments2.default.canMakePayments((0,_helpers.getPlatformMethodData)(JSON.parse(this._serializedMethodData,_reactNative.Platform.OS)));}},{key:'id',get:function get(){return this._id;}},{key:'shippingAddress',get:function get(){return this._shippingAddress;}},{key:'shippingOption',get:function get(){return this._shippingOption;}}]);return PaymentRequest;}();exports.default=PaymentRequest;
-
-/***/ }),
-
-/***/ "../../lib/js/PaymentRequestUpdateEvent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i0){target._handleShippingOptionChange({selectedShippingOptionId:target._details.shippingOptions[0].id});}}).catch(function(e){_this._resetEvent();throw new Error('AbortError');});}},{key:'_resetEvent',value:function _resetEvent(){this._waitForUpdate=false;this.target._updating=false;noop();}},{key:'updateWith',value:function updateWith(PaymentDetailsModifierOrPromise){var event=this;var target=this.target;if(!(target instanceof _PaymentRequest2.default)){throw new Error('TypeError');}if(event._waitForUpdate===true){throw new Error('InvalidStateError');}if(target._state!=='interactive'){throw new Error('InvalidStateError');}if(target._updating===true){throw new Error('InvalidStateError');}noop();event._waitForUpdate=true;target._updating=true;noop();if(isPromise(PaymentDetailsModifierOrPromise)){var promise=PaymentDetailsModifierOrPromise;return promise.then(this._handleDetailsChange);}if(typeof PaymentDetailsModifierOrPromise==='object'){var paymentDetailsModifier=PaymentDetailsModifierOrPromise;return this._handleDetailsChange(paymentDetailsModifier);}}}]);return PaymentRequestUpdateEvent;}();exports.default=PaymentRequestUpdateEvent;
-
-/***/ }),
-
-/***/ "../../lib/js/PaymentResponse.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:Error;if(total===undefined){throw new errorType('required member total is undefined.');}var hasTotal=total&&total.amount&&total.amount.value;if(!hasTotal){throw new errorType('Missing required member(s): amount, label.');}var totalAmountValue=total.amount.value;if(!isValidDecimalMonetaryValue(totalAmountValue)){throw new errorType('\''+totalAmountValue+'\' is not a valid amount format for total');}if(isNegative(totalAmountValue)){throw new errorType('Total amount value should be non-negative');}}function validatePaymentMethods(methodData){if(methodData.length<1){throw new _errors.ConstructorError('At least one payment method is required');}var serializedMethodData=[];methodData.forEach(function(paymentMethod){if(paymentMethod.supportedMethods===undefined){throw new _errors.ConstructorError('required member supportedMethods is undefined.');}if(!Array.isArray(paymentMethod.supportedMethods)){throw new _errors.ConstructorError('required member supportedMethods is not iterable.');}if(paymentMethod.supportedMethods.length<1){throw new _errors.ConstructorError('Each payment method needs to include at least one payment method identifier');}var serializedData=paymentMethod.data?JSON.stringify(paymentMethod.data):null;serializedMethodData.push([paymentMethod.supportedMethods,serializedData]);});return serializedMethodData;}function validateDisplayItems(displayItems){var errorType=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Error;if(displayItems){displayItems.forEach(function(item){var amountValue=item&&item.amount&&item.amount.value;if(!amountValue){throw new errorType('required member value is undefined.');}if(!isValidDecimalMonetaryValue(amountValue)){throw new errorType('\''+amountValue+'\' is not a valid amount format for display items');}});}}function validateShippingOptions(details){var errorType=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Error;if(details.shippingOptions===undefined){return undefined;}var selectedShippingOption=null;if(!Array.isArray(details.shippingOptions)){throw new errorType('Iterator getter is not callable.');}if(details.shippingOptions){var seenIDs=[];details.shippingOptions.forEach(function(shippingOption){if(shippingOption.id===undefined){throw new errorType('required member id is undefined.');}if(shippingOption.id===null){shippingOption.id='null';}var amountValue=shippingOption.amount.value;if(!isValidDecimalMonetaryValue(amountValue)){throw new errorType('\''+amountValue+'\' is not a valid amount format for shippingOptions');}if(seenIDs.includes(shippingOption.id)){details.shippingOptions=[];console.warn('[ReactNativePayments] Duplicate shipping option identifier \''+shippingOption.id+'\' is treated as an invalid address indicator.');return undefined;}seenIDs.push(shippingOption.id);});}}function getSelectedShippingOption(shippingOptions){if(!Array.isArray(shippingOptions)){return null;}if(shippingOptions.length===0){return null;}var selectedShippingOption=shippingOptions.find(function(shippingOption){return shippingOption.selected;});if(selectedShippingOption){return selectedShippingOption.id;}return shippingOptions[0].id;}function hasGatewayConfig(){var platformMethodData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!platformMethodData){return false;}if(!platformMethodData.paymentMethodTokenizationParameters){return false;}if(!platformMethodData.paymentMethodTokenizationParameters.parameters){return false;}if(typeof platformMethodData.paymentMethodTokenizationParameters.parameters!=='object'){return false;}if(!platformMethodData.paymentMethodTokenizationParameters.parameters.gateway){return false;}if(typeof platformMethodData.paymentMethodTokenizationParameters.parameters.gateway!=='string'){return false;}return true;}function getGatewayName(platformMethodData){return platformMethodData.paymentMethodTokenizationParameters.parameters.gateway;}function validateGateway(){var selectedGateway=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var supportedGateways=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!supportedGateways.includes(selectedGateway)){throw new _errors.ConstructorError('"'+selectedGateway+'" is not a supported gateway. Visit https://goo.gl/fsxSFi for more info.');}}
-
-/***/ }),
-
-/***/ "../../lib/js/index.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-var _PaymentRequest=__webpack_require__("../../lib/js/PaymentRequest.js");var _PaymentRequest2=_interopRequireDefault(_PaymentRequest);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}module.exports={PaymentRequest:_PaymentRequest2.default};
-
-/***/ }),
-
-/***/ "../../package.json":
-/***/ (function(module, exports) {
-
-module.exports = {
- "name": "react-native-payments",
- "version": "0.2.0",
- "scripts": {
- "precommit": "lint-staged",
- "run:packager": "cd examples/native && yarn run:packager",
- "run:ios": "cd examples/native && yarn run:ios",
- "run:web": "cd examples/web && yarn run:web",
- "run:demo": "cd examples/native && yarn run:demo",
- "test": "jest"
- },
- "repository": "https://github.com/naoufal/react-native-payments",
- "keywords": [
- "react",
- "react-native",
- "apple-pay",
- "stripe",
- "braintree",
- "payments"
- ],
- "author": "Naoufal Kadhom",
- "license": "MIT",
- "dependencies": {
- "es6-error": "^4.0.2",
- "uuid": "^3.1.0",
- "validator": "^7.0.0"
- },
- "devDependencies": {
- "babel-jest": "20.0.3",
- "babel-preset-react-native": "2.0.0",
- "husky": "^0.14.1",
- "jest": "20.0.4",
- "lint-staged": "^4.0.0",
- "prettier": "^1.4.4",
- "react-test-renderer": "16.0.0-alpha.12"
- },
- "peerDependencies": {
- "react": "~15.4.0-rc.4",
- "react-native": "0.41.0"
- },
- "jest": {
- "testPathIgnorePatterns": [
- "/node_modules/",
- "/examples/",
- "lib/js/__tests__"
- ]
- },
- "lint-staged": {
- "*.js": [
- "prettier --single-quote --write",
- "git add"
- ]
- }
-};
-
-/***/ }),
-
-/***/ "../common/App.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i2&&arguments[2]!==undefined?arguments[2]:{};return new PaymentRequest(methodData,details,options);}function addDisplayItems(displayItems){return displayItems.reduce(function(acc,displayItem){return acc+parseFloat(displayItem.amount.value);},0);}function getTaxFromSubTotal(subTotal){var tax=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.15;return subTotal*tax;}function getPlatformTotalLabel(platformOS){return platformOS==='ios'?'Merchant':'Total';}var METHOD_DATA=[{supportedMethods:['basic-card'],data:{supportedNetworks:['visa','mastercard','amex']}},{supportedMethods:['apple-pay'],data:{merchantIdentifier:'merchant.com.react-native-payments.naoufal',supportedNetworks:['visa','mastercard','amex'],countryCode:'US',currencyCode:'USD'}},{supportedMethods:['android-pay'],data:{supportedNetworks:['visa','mastercard','amex'],countryCode:'US',currencyCode:'USD',environment:'TEST',paymentMethodTokenizationParameters:{tokenizationType:'NETWORK_TOKEN',parameters:{publicKey:'BOdoXP+9Aq473SnGwg3JU1aiNpsd9vH2ognq4PtDtlLGa3Kj8TPf+jaQNPyDSkh3JUhiS0KyrrlWhAgNZKHYF2Y='}}}}];var DISPLAY_ITEMS=[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}];var TOTAL={label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}};function oneItem(){var details={id:'oneItem',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var paymentRequest=initPR(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function twoItems(){var displayItems=[{label:'Movie Ticket',amount:{currency:'USD',value:15.0}},{label:'Popcorn',amount:{currency:'USD',value:10.0}}];var details={id:'twoItems',displayItems:displayItems,total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:addDisplayItems(displayItems)}}};var paymentRequest=initPR(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function twoItemsPlusTax(){var displayItems=[{label:'Movie Ticket',amount:{currency:'USD',value:15.0}},{label:'Popcorn',amount:{currency:'USD',value:10.0}}];var subtotal=addDisplayItems(displayItems);var tax=getTaxFromSubTotal(subtotal);var details={id:'twoItemsPlusTax',displayItems:[].concat(displayItems,[{label:'Tax',amount:{currency:'USD',value:tax}}]),total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:subtotal+tax}}};var paymentRequest=initPR(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function requestPayerName(){var details={id:'requestPayerName',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var options={requestPayerName:true};var paymentRequest=initPR(METHOD_DATA,details,options);return prDisplayHandler(paymentRequest);}function requestPayerPhone(){var details={id:'requestPayerPhone',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var options={requestPayerPhone:true};var paymentRequest=initPR(METHOD_DATA,details,options);return prDisplayHandler(paymentRequest);}function requestPayerEmail(){var details={id:'requestPayerEmail',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var options={requestPayerEmail:true};var paymentRequest=initPR(METHOD_DATA,details,options);return prDisplayHandler(paymentRequest);}function requestPayerAll(){var details={id:'requestPayerAll',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var options={requestPayerName:true,requestPayerPhone:true,requestPayerEmail:true};var paymentRequest=initPR(METHOD_DATA,details,options);return prDisplayHandler(paymentRequest);}function staticShipping(){var details={id:'staticShipping',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}},shippingOptions:[{id:'economy',label:'Economy Shipping',amount:{currency:'USD',value:'0.00'},detail:'Arrives in 3-5 days'},{id:'express',label:'Express Shipping',amount:{currency:'USD',value:'5.00'},detail:'Arrives tomorrow'}]};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){e.updateWith(details);});paymentRequest.addEventListener('shippingoptionchange',function(e){details.shippingOptions=details.shippingOptions.map(function(shippingOption){return _extends({},shippingOption,{selected:shippingOption.id===paymentRequest.shippingOption});});var selectedShippingOption=details.shippingOptions.find(function(shippingOption){return shippingOption.selected===true;});details.displayItems=details.displayItems.map(function(displayItem){if(displayItem.label==='Shipping'){return _extends({},displayItem,{amount:{currency:'USD',value:selectedShippingOption?selectedShippingOption.amount.value:'0.00'}});}return displayItem;});details.total=_extends({},details.total,{amount:{currency:details.total.amount.currency,value:addDisplayItems(details.displayItems)}});e.updateWith(details);});return prDisplayHandler(paymentRequest);}function getShippingOptionsForState(state){var isCalifornia=state==='CA';return[{id:'economy',label:'Economy Shipping',amount:{currency:'USD',value:isCalifornia?'0.00':'3.00'},detail:'Arrives in 3-5 days'},{id:'express',label:'Express Shipping',amount:{currency:'USD',value:isCalifornia?'5.00':'10.00'},detail:'Arrives tomorrow'}];}function dynamicShipping(){var details={id:'dynamicShipping',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}},shippingOptions:getShippingOptionsForState()};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){console.log(paymentRequest.shippingAddress);var updateDetailsWithPromise=new Promise(function(resolve,reject){updateDetailsWithMutation(paymentRequest,details,getShippingOptionsForState(paymentRequest.shippingAddress.region));setTimeout(function(){return resolve(details);},2000);});e.updateWith(updateDetailsWithPromise);});paymentRequest.addEventListener('shippingoptionchange',function(e){updateDetailsWithMutation(paymentRequest,details,getShippingOptionsForState(paymentRequest.shippingAddress.region));e.updateWith(details);});return prDisplayHandler(paymentRequest);}function updateDetailsWithMutation(paymentRequest,details,nextShippingOptions){details.shippingOptions=nextShippingOptions;details.shippingOptions=details.shippingOptions.map(function(shippingOption){return _extends({},shippingOption,{selected:shippingOption.id===paymentRequest.shippingOption});});var selectedShippingOption=details.shippingOptions.find(function(shippingOption){return shippingOption.selected===true;});details.displayItems=details.displayItems.map(function(displayItem){if(displayItem.label==='Shipping'){return _extends({},displayItem,{amount:{currency:'USD',value:selectedShippingOption?selectedShippingOption.amount.value:'0.00'}});}return displayItem;});details.total=_extends({},details.total,{amount:{currency:details.total.amount.currency,value:addDisplayItems(details.displayItems)}});return details;}function getShippingOptionsForCountry(countryCode){if(countryCode!=='US'){return[];}return[{id:'economy',label:'Economy Shipping',amount:{currency:'USD',value:'0.00'},detail:'Arrives in 3-5 days'},{id:'express',label:'Express Shipping',amount:{currency:'USD',value:'5.00'},detail:'Arrives tomorrow.'}];}function noInternationalShipping(){var details={id:'noInternationalShipping',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}},shippingOptions:getShippingOptionsForCountry()};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){var updateDetailsWithPromise=new Promise(function(resolve,reject){updateDetailsWithMutation(paymentRequest,details,getShippingOptionsForCountry(paymentRequest.shippingAddress.country));setTimeout(function(){return resolve(details);},2000);});e.updateWith(updateDetailsWithPromise);});paymentRequest.addEventListener('shippingoptionchange',function(e){updateDetailsWithMutation(paymentRequest,details,getShippingOptionsForCountry(paymentRequest.shippingAddress.country));e.updateWith(details);});return prDisplayHandler(paymentRequest);}function errorNoTotal(){var details={id:'errorNoTotal',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:null};var paymentRequest=new PaymentRequest(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function errorNegativeTotal(){var details={id:'errorNegativeTotal',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'-15.00'}}};var paymentRequest=new PaymentRequest(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function errorInvalidTotalAmount(){var details={id:'errorNoShippingOptions',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'10.'}}};var paymentRequest=new PaymentRequest(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function errorInvalidDisplayItemAmount(){var details={id:'errorNoShippingOptions',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'10.'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'10.00'}}};var paymentRequest=new PaymentRequest(METHOD_DATA,details);return prDisplayHandler(paymentRequest);}function errorNoShippingOptions(){var details={id:'errorNoShippingOptions',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}}};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){return e.updateWith(details);});paymentRequest.addEventListener('shippingoptionchange',function(e){return e.updateWith(details);});return prDisplayHandler(paymentRequest);}function errorInvalidShippingOptionsAmount(){var details={id:'errorInvalidShippingOptionsAmount',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}},shippingOptions:[{id:'next-day',label:'Next Day',amount:{currency:'USD',value:'10.'},detail:'Arrives tomorrow.'}]};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){return e.updateWith(details);});paymentRequest.addEventListener('shippingoptionchange',function(e){return e.updateWith(details);});return prDisplayHandler(paymentRequest);}function errorDuplicateShippingOptionsId(){var details={id:'errorDuplicateShippingOptionsId',displayItems:[{label:'Movie Ticket',amount:{currency:'USD',value:'15.00'}},{label:'Shipping',amount:{currency:'USD',value:'0.00'}}],total:{label:getPlatformTotalLabel(_reactNative.Platform.OS),amount:{currency:'USD',value:'15.00'}},shippingOptions:[{id:null,label:'foo',amount:{currency:'USD',value:'0.00'}},{id:null,label:'bar',amount:{currency:'USD',value:'1.00'}}]};var options={requestShipping:true};var paymentRequest=new PaymentRequest(METHOD_DATA,details,options);paymentRequest.addEventListener('shippingaddresschange',function(e){return e.updateWith(details);});paymentRequest.addEventListener('shippingoptionchange',function(e){return e.updateWith(details);});return prDisplayHandler(paymentRequest);}function errorGatewayNotSupported(){var methodData=[{supportedMethods:['apple-pay'],data:{merchantIdentifier:'merchant.com.react-native-payments.naoufal',supportedNetworks:['visa','mastercard','amex'],countryCode:'US',currencyCode:'USD',paymentMethodTokenizationParameters:{parameters:{gateway:'stripe','stripe:stripe:publishableKey':'pk_test_foo'}}}}];var details={displayItems:DISPLAY_ITEMS,total:TOTAL};var paymentRequest=new PaymentRequest(methodData,details);return prDisplayHandler(paymentRequest);}
-
-/***/ }),
-
-/***/ "../common/services/shipping.js":
-/***/ (function(module, exports) {
-
-Object.defineProperty(exports,"__esModule",{value:true});exports.getShippingOptions=getShippingOptions;function createShippingOption(id,label,price){var selected=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return{id:id,label:label,amount:{currency:'USD',value:price},selected:selected};}function getRandomPrice(){var min=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var max=arguments.length>1&&arguments[1]!==undefined?arguments[1]:99;var multiplier=100;var minVal=min*multiplier;var maxVal=max*multiplier;var priceFloat=(Math.floor(Math.random()*(maxVal-minVal))+minVal)/multiplier;return priceFloat.toString();}function getShippingOptions(){return[createShippingOption('economy','Economy Shipping (5-7 Days)','0.00'),createShippingOption('express','Express Shipping (2-3 Days)',getRandomPrice(5,10)),createShippingOption('next-day','Next Day Delivery',getRandomPrice(11,20))];}
-
-/***/ }),
-
-/***/ "../common/styles/index.js":
-/***/ (function(module, exports) {
-
-Object.defineProperty(exports,"__esModule",{value:true});var baseTextStyles=exports.baseTextStyles={fontWeight:'700',letterSpacing:-0.5};
-
-/***/ }),
-
-/***/ "./index.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(global) {var _react=__webpack_require__("./node_modules/react/react.js");var _react2=_interopRequireDefault(_react);var _reactNative=__webpack_require__("./node_modules/react-native/Libraries/react-native/react-native.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}global.PaymentRequest=__webpack_require__("../../index.js").PaymentRequest;var App=__webpack_require__("../common/App.js").default;_reactNative.AppRegistry.registerComponent('ReactNativePaymentsExample',function(){return App;});
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/art/core/class.js":
-/***/ (function(module, exports) {
-
-module.exports = function(mixins){
- var proto = {};
- for (var i = 0, l = arguments.length; i < l; i++){
- var mixin = arguments[i];
- if (typeof mixin == 'function') mixin = mixin.prototype;
- for (var key in mixin) proto[key] = mixin[key];
- }
- if (!proto.initialize) proto.initialize = function(){};
- proto.constructor = function(a,b,c,d,e,f,g,h){
- return new proto.initialize(a,b,c,d,e,f,g,h);
- };
- proto.constructor.prototype = proto.initialize.prototype = proto;
- return proto.constructor;
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/art/core/color.js":
-/***/ (function(module, exports) {
-
-var colors = {
- maroon: '#800000', red: '#ff0000', orange: '#ffA500', yellow: '#ffff00', olive: '#808000',
- purple: '#800080', fuchsia: "#ff00ff", white: '#ffffff', lime: '#00ff00', green: '#008000',
- navy: '#000080', blue: '#0000ff', aqua: '#00ffff', teal: '#008080',
- black: '#000000', silver: '#c0c0c0', gray: '#808080'
-};
-
-var map = function(array, fn){
- var results = [];
- for (var i = 0, l = array.length; i < l; i++)
- results[i] = fn(array[i], i);
- return results;
-};
-
-var Color = function(color, type){
-
- if (color.isColor){
-
- this.red = color.red;
- this.green = color.green;
- this.blue = color.blue;
- this.alpha = color.alpha;
-
- } else {
-
- var namedColor = colors[color];
- if (namedColor){
- color = namedColor;
- type = 'hex';
- }
-
- switch (typeof color){
- case 'string': if (!type) type = (type = color.match(/^rgb|^hsb|^hsl/)) ? type[0] : 'hex'; break;
- case 'object': type = type || 'rgb'; color = color.toString(); break;
- case 'number': type = 'hex'; color = color.toString(16); break;
- }
-
- color = Color['parse' + type.toUpperCase()](color);
- this.red = color[0];
- this.green = color[1];
- this.blue = color[2];
- this.alpha = color[3];
- }
-
- this.isColor = true;
-
-};
-
-var limit = function(number, min, max){
- return Math.min(max, Math.max(min, number));
-};
-
-var listMatch = /([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,?\s*([-.\d]*\%?)/;
-var hexMatch = /^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{0,2})$/i;
-
-Color.parseRGB = function(color){
- return map(color.match(listMatch).slice(1), function(bit, i){
- if (bit) bit = parseFloat(bit) * (bit[bit.length - 1] == '%' ? 2.55 : 1);
- return (i < 3) ? Math.round(((bit %= 256) < 0) ? bit + 256 : bit) : limit(((bit === '') ? 1 : Number(bit)), 0, 1);
- });
-};
-
-Color.parseHEX = function(color){
- if (color.length == 1) color = color + color + color;
- return map(color.match(hexMatch).slice(1), function(bit, i){
- if (i == 3) return (bit) ? parseInt(bit, 16) / 255 : 1;
- return parseInt((bit.length == 1) ? bit + bit : bit, 16);
- });
-};
-
-Color.parseHSB = function(color){
- var hsb = map(color.match(listMatch).slice(1), function(bit, i){
- if (bit) bit = parseFloat(bit);
- if (i === 0) return Math.round(((bit %= 360) < 0) ? (bit + 360) : bit);
- else if (i < 3) return limit(Math.round(bit), 0, 100);
- else return limit(((bit === '') ? 1 : Number(bit)), 0, 1);
- });
-
- var a = hsb[3];
- var br = Math.round(hsb[2] / 100 * 255);
- if (hsb[1] == 0) return [br, br, br, a];
-
- var hue = hsb[0];
- var f = hue % 60;
- var p = Math.round((hsb[2] * (100 - hsb[1])) / 10000 * 255);
- var q = Math.round((hsb[2] * (6000 - hsb[1] * f)) / 600000 * 255);
- var t = Math.round((hsb[2] * (6000 - hsb[1] * (60 - f))) / 600000 * 255);
-
- switch (Math.floor(hue / 60)){
- case 0: return [br, t, p, a];
- case 1: return [q, br, p, a];
- case 2: return [p, br, t, a];
- case 3: return [p, q, br, a];
- case 4: return [t, p, br, a];
- default: return [br, p, q, a];
- }
-};
-
-Color.parseHSL = function(color){
- var hsb = map(color.match(listMatch).slice(1), function(bit, i){
- if (bit) bit = parseFloat(bit);
- if (i === 0) return Math.round(((bit %= 360) < 0) ? (bit + 360) : bit);
- else if (i < 3) return limit(Math.round(bit), 0, 100);
- else return limit(((bit === '') ? 1 : Number(bit)), 0, 1);
- });
-
- var h = hsb[0] / 60;
- var s = hsb[1] / 100;
- var l = hsb[2] / 100;
- var a = hsb[3];
-
- var c = (1 - Math.abs(2 * l - 1)) * s;
- var x = c * (1 - Math.abs(h % 2 - 1));
- var m = l - c / 2;
-
- var p = Math.round((c + m) * 255);
- var q = Math.round((x + m) * 255);
- var t = Math.round((m) * 255);
-
- switch (Math.floor(h)){
- case 0: return [p, q, t, a];
- case 1: return [q, p, t, a];
- case 2: return [t, p, q, a];
- case 3: return [t, q, p, a];
- case 4: return [q, t, p, a];
- default: return [p, t, q, a];
- }
-};
-
-var toString = function(type, array){
- if (array[3] != 1) type += 'a';
- else array.pop();
- return type + '(' + array.join(', ') + ')';
-};
-
-Color.prototype = {
-
- toHSB: function(array){
- var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
-
- var max = Math.max(red, green, blue), min = Math.min(red, green, blue), delta = max - min;
- var hue = 0, saturation = (delta != 0) ? delta / max : 0, brightness = max / 255;
- if (saturation){
- var rr = (max - red) / delta, gr = (max - green) / delta, br = (max - blue) / delta;
- hue = (red == max) ? br - gr : (green == max) ? 2 + rr - br : 4 + gr - rr;
- if ((hue /= 6) < 0) hue++;
- }
-
- var hsb = [Math.round(hue * 360), Math.round(saturation * 100), Math.round(brightness * 100), alpha];
-
- return (array) ? hsb : toString('hsb', hsb);
- },
-
- toHSL: function(array){
- var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
-
- var max = Math.max(red, green, blue), min = Math.min(red, green, blue), delta = max - min;
- var hue = 0, saturation = (delta != 0) ? delta / (255 - Math.abs((max + min) - 255)) : 0, lightness = (max + min) / 512;
- if (saturation){
- var rr = (max - red) / delta, gr = (max - green) / delta, br = (max - blue) / delta;
- hue = (red == max) ? br - gr : (green == max) ? 2 + rr - br : 4 + gr - rr;
- if ((hue /= 6) < 0) hue++;
- }
-
- var hsl = [Math.round(hue * 360), Math.round(saturation * 100), Math.round(lightness * 100), alpha];
-
- return (array) ? hsl : toString('hsl', hsl);
- },
-
- toHEX: function(array){
-
- var a = this.alpha;
- var alpha = ((a = Math.round((a * 255)).toString(16)).length == 1) ? a + a : a;
-
- var hex = map([this.red, this.green, this.blue], function(bit){
- bit = bit.toString(16);
- return (bit.length == 1) ? '0' + bit : bit;
- });
-
- return (array) ? hex.concat(alpha) : '#' + hex.join('') + ((alpha == 'ff') ? '' : alpha);
- },
-
- toRGB: function(array){
- var rgb = [this.red, this.green, this.blue, this.alpha];
- return (array) ? rgb : toString('rgb', rgb);
- }
-
-};
-
-Color.prototype.toString = Color.prototype.toRGB;
-
-Color.hex = function(hex){
- return new Color(hex, 'hex');
-};
-
-if (this.hex == null) this.hex = Color.hex;
-
-Color.hsb = function(h, s, b, a){
- return new Color([h || 0, s || 0, b || 0, (a == null) ? 1 : a], 'hsb');
-};
-
-if (this.hsb == null) this.hsb = Color.hsb;
-
-Color.hsl = function(h, s, l, a){
- return new Color([h || 0, s || 0, l || 0, (a == null) ? 1 : a], 'hsl');
-};
-
-if (this.hsl == null) this.hsl = Color.hsl;
-
-Color.rgb = function(r, g, b, a){
- return new Color([r || 0, g || 0, b || 0, (a == null) ? 1 : a], 'rgb');
-};
-
-if (this.rgb == null) this.rgb = Color.rgb;
-
-Color.detach = function(color){
- color = new Color(color);
- return [Color.rgb(color.red, color.green, color.blue).toString(), color.alpha];
-};
-
-module.exports = Color;
-
-/***/ }),
-
-/***/ "./node_modules/art/core/path.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-var Class = __webpack_require__("./node_modules/art/core/class.js");
-
-module.exports = Class({
-
- initialize: function(path){
- this.reset().push(path);
- },
-
- /* parser */
-
- push: function(){
- var p = Array.prototype.join.call(arguments, ' ')
- .match(/[a-df-z]|[\-+]?(?:[\d\.]e[\-+]?|[^\s\-+,a-z])+/ig);
- if (!p) return this;
-
- var last, cmd = p[0], i = 1;
- while (cmd){
- switch (cmd){
- case 'm': this.move(p[i++], p[i++]); break;
- case 'l': this.line(p[i++], p[i++]); break;
- case 'c': this.curve(p[i++], p[i++], p[i++], p[i++], p[i++], p[i++]); break;
- case 's': this.curve(p[i++], p[i++], null, null, p[i++], p[i++]); break;
- case 'q': this.curve(p[i++], p[i++], p[i++], p[i++]); break;
- case 't': this.curve(p[i++], p[i++]); break;
- case 'a': this.arc(p[i+5], p[i+6], p[i], p[i+1], p[i+3], !+p[i+4], p[i+2]); i += 7; break;
- case 'h': this.line(p[i++], 0); break;
- case 'v': this.line(0, p[i++]); break;
-
- case 'M': this.moveTo(p[i++], p[i++]); break;
- case 'L': this.lineTo(p[i++], p[i++]); break;
- case 'C': this.curveTo(p[i++], p[i++], p[i++], p[i++], p[i++], p[i++]); break;
- case 'S': this.curveTo(p[i++], p[i++], null, null, p[i++], p[i++]); break;
- case 'Q': this.curveTo(p[i++], p[i++], p[i++], p[i++]); break;
- case 'T': this.curveTo(p[i++], p[i++]); break;
- case 'A': this.arcTo(p[i+5], p[i+6], p[i], p[i+1], p[i+3], !+p[i+4], p[i+2]); i += 7; break;
- case 'H': this.lineTo(p[i++], this.penY); break;
- case 'V': this.lineTo(this.penX, p[i++]); break;
-
- case 'Z': case 'z': this.close(); break;
- default: cmd = last; i--; continue;
- }
-
- last = cmd;
- if (last == 'm') last = 'l';
- else if (last == 'M') last = 'L';
- cmd = p[i++];
- }
- return this;
- },
-
- /* utility methods */
-
- reset: function(){
- this.penX = this.penY = 0;
- this.penDownX = this.penDownY = null;
- this._pivotX = this._pivotY = 0;
- this.onReset();
- return this;
- },
-
- move: function(x,y){
- this.onMove(this.penX, this.penY, this._pivotX = this.penX += (+x), this._pivotY = this.penY += (+y));
- return this;
- },
- moveTo: function(x,y){
- this.onMove(this.penX, this.penY, this._pivotX = this.penX = (+x), this._pivotY = this.penY = (+y));
- return this;
- },
-
- line: function(x,y){
- return this.lineTo(this.penX + (+x), this.penY + (+y));
- },
- lineTo: function(x,y){
- if (this.penDownX == null){ this.penDownX = this.penX; this.penDownY = this.penY; }
- this.onLine(this.penX, this.penY, this._pivotX = this.penX = (+x), this._pivotY = this.penY = (+y));
- return this;
- },
-
- curve: function(c1x, c1y, c2x, c2y, ex, ey){
- var x = this.penX, y = this.penY;
- return this.curveTo(
- x + (+c1x), y + (+c1y),
- c2x == null ? null : x + (+c2x),
- c2y == null ? null : y + (+c2y),
- ex == null ? null : x + (+ex),
- ey == null ? null : y + (+ey)
- );
- },
- curveTo: function(c1x, c1y, c2x, c2y, ex, ey){
- var x = this.penX, y = this.penY;
- if (c2x == null){
- c2x = +c1x; c2y = +c1y;
- c1x = (x * 2) - (this._pivotX || 0); c1y = (y * 2) - (this._pivotY || 0);
- }
- if (ex == null){
- this._pivotX = +c1x; this._pivotY = +c1y;
- ex = +c2x; ey = +c2y;
- c2x = (ex + (+c1x) * 2) / 3; c2y = (ey + (+c1y) * 2) / 3;
- c1x = (x + (+c1x) * 2) / 3; c1y = (y + (+c1y) * 2) / 3;
- } else {
- this._pivotX = +c2x; this._pivotY = +c2y;
- }
- if (this.penDownX == null){ this.penDownX = x; this.penDownY = y; }
- this.onBezierCurve(x, y, +c1x, +c1y, +c2x, +c2y, this.penX = +ex, this.penY = +ey);
- return this;
- },
-
- arc: function(x, y, rx, ry, outer, counterClockwise, rotation){
- return this.arcTo(this.penX + (+x), this.penY + (+y), rx, ry, outer, counterClockwise, rotation);
- },
- arcTo: function(x, y, rx, ry, outer, counterClockwise, rotation){
- ry = Math.abs(+ry || +rx || (+y - this.penY));
- rx = Math.abs(+rx || (+x - this.penX));
-
- if (!rx || !ry || (x == this.penX && y == this.penY)) return this.lineTo(x, y);
-
- var tX = this.penX, tY = this.penY, clockwise = !+counterClockwise, large = !!+outer;
-
- var rad = rotation ? rotation * Math.PI / 180 : 0, cos = Math.cos(rad), sin = Math.sin(rad);
- x -= tX; y -= tY;
-
- // Ellipse Center
- var cx = cos * x / 2 + sin * y / 2,
- cy = -sin * x / 2 + cos * y / 2,
- rxry = rx * rx * ry * ry,
- rycx = ry * ry * cx * cx,
- rxcy = rx * rx * cy * cy,
- a = rxry - rxcy - rycx;
-
- if (a < 0){
- a = Math.sqrt(1 - a / rxry);
- rx *= a; ry *= a;
- cx = x / 2; cy = y / 2;
- } else {
- a = Math.sqrt(a / (rxcy + rycx));
- if (large == clockwise) a = -a;
- var cxd = -a * cy * rx / ry,
- cyd = a * cx * ry / rx;
- cx = cos * cxd - sin * cyd + x / 2;
- cy = sin * cxd + cos * cyd + y / 2;
- }
-
- // Rotation + Scale Transform
- var xx = cos / rx, yx = sin / rx,
- xy = -sin / ry, yy = cos / ry;
-
- // Start and End Angle
- var sa = Math.atan2(xy * -cx + yy * -cy, xx * -cx + yx * -cy),
- ea = Math.atan2(xy * (x - cx) + yy * (y - cy), xx * (x - cx) + yx * (y - cy));
-
- cx += tX; cy += tY;
- x += tX; y += tY;
-
- // Circular Arc
- if (this.penDownX == null){ this.penDownX = this.penX; this.penDownY = this.penY; }
- this.onArc(
- tX, tY, this._pivotX = this.penX = x, this._pivotY = this.penY = y,
- cx, cy, rx, ry, sa, ea, !clockwise, rotation
- );
- return this;
- },
-
- counterArc: function(x, y, rx, ry, outer){
- return this.arc(x, y, rx, ry, outer, true);
- },
- counterArcTo: function(x, y, rx, ry, outer){
- return this.arcTo(x, y, rx, ry, outer, true);
- },
-
- close: function(){
- if (this.penDownX != null){
- this.onClose(this.penX, this.penY, this.penX = this.penDownX, this.penY = this.penDownY);
- this.penDownX = null;
- }
- return this;
- },
-
- /* overridable handlers */
-
- onReset: function(){
- },
-
- onMove: function(sx, sy, ex, ey){
- },
-
- onLine: function(sx, sy, ex, ey){
- this.onBezierCurve(sx, sy, sx, sy, ex, ey, ex, ey);
- },
-
- onBezierCurve: function(sx, sy, c1x, c1y, c2x, c2y, ex, ey){
- var gx = ex - sx, gy = ey - sy,
- g = gx * gx + gy * gy,
- v1, v2, cx, cy, u;
-
- cx = c1x - sx; cy = c1y - sy;
- u = cx * gx + cy * gy;
-
- if (u > g){
- cx -= gx;
- cy -= gy;
- } else if (u > 0 && g != 0){
- cx -= u/g * gx;
- cy -= u/g * gy;
- }
-
- v1 = cx * cx + cy * cy;
-
- cx = c2x - sx; cy = c2y - sy;
- u = cx * gx + cy * gy;
-
- if (u > g){
- cx -= gx;
- cy -= gy;
- } else if (u > 0 && g != 0){
- cx -= u/g * gx;
- cy -= u/g * gy;
- }
-
- v2 = cx * cx + cy * cy;
-
- if (v1 < 0.01 && v2 < 0.01){
- this.onLine(sx, sy, ex, ey);
- return;
- }
-
- // Avoid infinite recursion
- if (isNaN(v1) || isNaN(v2)){
- throw new Error('Bad input');
- }
-
- // Split curve
- var s1x = (c1x + c2x) * 0.5, s1y = (c1y + c2y) * 0.5,
- l1x = (c1x + sx) * 0.5, l1y = (c1y + sy) * 0.5,
- l2x = (l1x + s1x) * 0.5, l2y = (l1y + s1y) * 0.5,
- r2x = (ex + c2x) * 0.5, r2y = (ey + c2y) * 0.5,
- r1x = (r2x + s1x) * 0.5, r1y = (r2y + s1y) * 0.5,
- l2r1x = (l2x + r1x) * 0.5, l2r1y = (l2y + r1y) * 0.5;
-
- // TODO: Manual stack if necessary. Currently recursive without tail optimization.
- this.onBezierCurve(sx, sy, l1x, l1y, l2x, l2y, l2r1x, l2r1y);
- this.onBezierCurve(l2r1x, l2r1y, r1x, r1y, r2x, r2y, ex, ey);
- },
-
- onArc: function(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation){
- // Inverse Rotation + Scale Transform
- var rad = rotation ? rotation * Math.PI / 180 : 0, cos = Math.cos(rad), sin = Math.sin(rad),
- xx = cos * rx, yx = -sin * ry,
- xy = sin * rx, yy = cos * ry;
-
- // Bezier Curve Approximation
- var arc = ea - sa;
- if (arc < 0 && !ccw) arc += Math.PI * 2;
- else if (arc > 0 && ccw) arc -= Math.PI * 2;
-
- var n = Math.ceil(Math.abs(arc / (Math.PI / 2))),
- step = arc / n,
- k = (4 / 3) * Math.tan(step / 4);
-
- var x = Math.cos(sa), y = Math.sin(sa);
-
- for (var i = 0; i < n; i++){
- var cp1x = x - k * y, cp1y = y + k * x;
-
- sa += step;
- x = Math.cos(sa); y = Math.sin(sa);
-
- var cp2x = x + k * y, cp2y = y - k * x;
-
- this.onBezierCurve(
- sx, sy,
- cx + xx * cp1x + yx * cp1y, cy + xy * cp1x + yy * cp1y,
- cx + xx * cp2x + yx * cp2y, cy + xy * cp2x + yy * cp2y,
- (sx = (cx + xx * x + yx * y)), (sy = (cy + xy * x + yy * y))
- );
- }
- },
-
- onClose: function(sx, sy, ex, ey){
- this.onLine(sx, sy, ex, ey);
- }
-
-});
-
-/***/ }),
-
-/***/ "./node_modules/art/core/transform.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-var Class = __webpack_require__("./node_modules/art/core/class.js");
-
-function Transform(xx, yx, xy, yy, x, y){
- if (xx && typeof xx == 'object'){
- yx = xx.yx; yy = xx.yy; y = xx.y;
- xy = xx.xy; x = xx.x; xx = xx.xx;
- }
- this.xx = xx == null ? 1 : xx;
- this.yx = yx || 0;
- this.xy = xy || 0;
- this.yy = yy == null ? 1 : yy;
- this.x = (x == null ? this.x : x) || 0;
- this.y = (y == null ? this.y : y) || 0;
- this._transform();
- return this;
-};
-
-module.exports = Class({
-
- initialize: Transform,
-
- _transform: function(){},
-
- xx: 1, yx: 0, x: 0,
- xy: 0, yy: 1, y: 0,
-
- transform: function(xx, yx, xy, yy, x, y){
- var m = this;
- if (xx && typeof xx == 'object'){
- yx = xx.yx; yy = xx.yy; y = xx.y;
- xy = xx.xy; x = xx.x; xx = xx.xx;
- }
- if (!x) x = 0;
- if (!y) y = 0;
- return this.transformTo(
- m.xx * xx + m.xy * yx,
- m.yx * xx + m.yy * yx,
- m.xx * xy + m.xy * yy,
- m.yx * xy + m.yy * yy,
- m.xx * x + m.xy * y + m.x,
- m.yx * x + m.yy * y + m.y
- );
- },
-
- transformTo: Transform,
-
- translate: function(x, y){
- return this.transform(1, 0, 0, 1, x, y);
- },
-
- move: function(x, y){
- this.x += x || 0;
- this.y += y || 0;
- this._transform();
- return this;
- },
-
- scale: function(x, y){
- if (y == null) y = x;
- return this.transform(x, 0, 0, y, 0, 0);
- },
-
- rotate: function(deg, x, y){
- if (x == null || y == null){
- x = (this.left || 0) + (this.width || 0) / 2;
- y = (this.top || 0) + (this.height || 0) / 2;
- }
-
- var rad = deg * Math.PI / 180, sin = Math.sin(rad), cos = Math.cos(rad);
-
- this.transform(1, 0, 0, 1, x, y);
- var m = this;
-
- return this.transformTo(
- cos * m.xx - sin * m.yx,
- sin * m.xx + cos * m.yx,
- cos * m.xy - sin * m.yy,
- sin * m.xy + cos * m.yy,
- m.x,
- m.y
- ).transform(1, 0, 0, 1, -x, -y);
- },
-
- moveTo: function(x, y){
- var m = this;
- return this.transformTo(m.xx, m.yx, m.xy, m.yy, x, y);
- },
-
- rotateTo: function(deg, x, y){
- var m = this;
- var flip = m.yx / m.xx > m.yy / m.xy ? -1 : 1;
- if (m.xx < 0 ? m.xy >= 0 : m.xy < 0) flip = -flip;
- return this.rotate(deg - Math.atan2(flip * m.yx, flip * m.xx) * 180 / Math.PI, x, y);
- },
-
- scaleTo: function(x, y){
- // Normalize
- var m = this;
-
- var h = Math.sqrt(m.xx * m.xx + m.yx * m.yx);
- m.xx /= h; m.yx /= h;
-
- h = Math.sqrt(m.yy * m.yy + m.xy * m.xy);
- m.yy /= h; m.xy /= h;
-
- return this.scale(x, y);
- },
-
- resizeTo: function(width, height){
- var w = this.width, h = this.height;
- if (!w || !h) return this;
- return this.scaleTo(width / w, height / h);
- },
-
- /*
- inverse: function(){
- var a = this.xx, b = this.yx,
- c = this.xy, d = this.yy,
- e = this.x, f = this.y;
- if (a * d - b * c == 0) return null;
- return new Transform(
- d/(a * d-b * c), b/(b * c-a * d),
- c/(b * c-a * d), a/(a * d-b * c),
- (d * e-c * f)/(b * c-a * d), (b * e-a * f)/(a * d-b * c)
- );
- },
- */
-
- inversePoint: function(x, y){
- var a = this.xx, b = this.yx,
- c = this.xy, d = this.yy,
- e = this.x, f = this.y;
- var det = b * c - a * d;
- if (det == 0) return null;
- return {
- x: (d * (e - x) + c * (y - f)) / det,
- y: (a * (f - y) + b * (x - e)) / det
- };
- },
-
- point: function(x, y){
- var m = this;
- return {
- x: m.xx * x + m.xy * y + m.x,
- y: m.yx * x + m.yy * y + m.y
- };
- }
-
-});
-
-
-/***/ }),
-
-/***/ "./node_modules/base64-js/index.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-exports.byteLength = byteLength
-exports.toByteArray = toByteArray
-exports.fromByteArray = fromByteArray
-
-var lookup = []
-var revLookup = []
-var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
-var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
-}
-
-revLookup['-'.charCodeAt(0)] = 62
-revLookup['_'.charCodeAt(0)] = 63
-
-function placeHoldersCount (b64) {
- var len = b64.length
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // the number of equal signs (place holders)
- // if there are two placeholders, than the two characters before it
- // represent one byte
- // if there is only one, then the three characters before it represent 2 bytes
- // this is just a cheap hack to not do indexOf twice
- return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
-}
-
-function byteLength (b64) {
- // base64 is 4/3 + up to two characters of the original data
- return b64.length * 3 / 4 - placeHoldersCount(b64)
-}
-
-function toByteArray (b64) {
- var i, j, l, tmp, placeHolders, arr
- var len = b64.length
- placeHolders = placeHoldersCount(b64)
-
- arr = new Arr(len * 3 / 4 - placeHolders)
-
- // if there are placeholders, only get up to the last complete 4 chars
- l = placeHolders > 0 ? len - 4 : len
-
- var L = 0
-
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
- arr[L++] = (tmp >> 16) & 0xFF
- arr[L++] = (tmp >> 8) & 0xFF
- arr[L++] = tmp & 0xFF
- }
-
- if (placeHolders === 2) {
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[L++] = tmp & 0xFF
- } else if (placeHolders === 1) {
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[L++] = (tmp >> 8) & 0xFF
- arr[L++] = tmp & 0xFF
- }
-
- return arr
-}
-
-function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
-}
-
-function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
-}
-
-function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var output = ''
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- output += lookup[tmp >> 2]
- output += lookup[(tmp << 4) & 0x3F]
- output += '=='
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
- output += lookup[tmp >> 10]
- output += lookup[(tmp >> 4) & 0x3F]
- output += lookup[(tmp << 2) & 0x3F]
- output += '='
- }
-
- parts.push(output)
-
- return parts.join('')
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/es6-error/lib/index.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-function _extendableBuiltin(cls) {
- function ExtendableBuiltin() {
- cls.apply(this, arguments);
- }
-
- ExtendableBuiltin.prototype = Object.create(cls.prototype, {
- constructor: {
- value: cls,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
-
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(ExtendableBuiltin, cls);
- } else {
- ExtendableBuiltin.__proto__ = cls;
- }
-
- return ExtendableBuiltin;
-}
-
-var ExtendableError = function (_extendableBuiltin2) {
- _inherits(ExtendableError, _extendableBuiltin2);
-
- function ExtendableError() {
- var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
-
- _classCallCheck(this, ExtendableError);
-
- // extending Error is weird and does not propagate `message`
- var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message));
-
- Object.defineProperty(_this, 'message', {
- configurable: true,
- enumerable: false,
- value: message,
- writable: true
- });
-
- Object.defineProperty(_this, 'name', {
- configurable: true,
- enumerable: false,
- value: _this.constructor.name,
- writable: true
- });
-
- if (Error.hasOwnProperty('captureStackTrace')) {
- Error.captureStackTrace(_this, _this.constructor);
- return _possibleConstructorReturn(_this);
- }
-
- Object.defineProperty(_this, 'stack', {
- configurable: true,
- enumerable: false,
- value: new Error(message).stack,
- writable: true
- });
- return _this;
- }
-
- return ExtendableError;
-}(_extendableBuiltin(Error));
-
-exports.default = ExtendableError;
-module.exports = exports['default'];
-
-
-/***/ }),
-
-/***/ "./node_modules/event-target-shim/lib/commons.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * @author Toru Nagashima
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-
-
-/**
- * Creates a unique key.
- *
- * @param {string} name - A name to create.
- * @returns {symbol|string}
- * @private
- */
-var createUniqueKey = exports.createUniqueKey = (typeof Symbol !== "undefined" ?
- Symbol :
- function createUniqueKey(name) {
- return "[[" + name + "_" + Math.random().toFixed(8).slice(2) + "]]";
- });
-
-/**
- * The key of listeners.
- *
- * @type {symbol|string}
- * @private
- */
-exports.LISTENERS = createUniqueKey("listeners");
-
-/**
- * A value of kind for listeners which are registered in the capturing phase.
- *
- * @type {number}
- * @private
- */
-exports.CAPTURE = 1;
-
-/**
- * A value of kind for listeners which are registered in the bubbling phase.
- *
- * @type {number}
- * @private
- */
-exports.BUBBLE = 2;
-
-/**
- * A value of kind for listeners which are registered as an attribute.
- *
- * @type {number}
- * @private
- */
-exports.ATTRIBUTE = 3;
-
-/**
- * @typedef object ListenerNode
- * @property {function} listener - A listener function.
- * @property {number} kind - The kind of the listener.
- * @property {ListenerNode|null} next - The next node.
- * If this node is the last, this is `null`.
- */
-
-/**
- * Creates a node of singly linked list for a list of listeners.
- *
- * @param {function} listener - A listener function.
- * @param {number} kind - The kind of the listener.
- * @returns {ListenerNode} The created listener node.
- */
-exports.newNode = function newNode(listener, kind) {
- return {listener: listener, kind: kind, next: null};
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/event-target-shim/lib/custom-event-target.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * @author Toru Nagashima
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-
-
-//-----------------------------------------------------------------------------
-// Requirements
-//-----------------------------------------------------------------------------
-
-var Commons = __webpack_require__("./node_modules/event-target-shim/lib/commons.js");
-var LISTENERS = Commons.LISTENERS;
-var ATTRIBUTE = Commons.ATTRIBUTE;
-var newNode = Commons.newNode;
-
-//-----------------------------------------------------------------------------
-// Helpers
-//-----------------------------------------------------------------------------
-
-/**
- * Gets a specified attribute listener from a given EventTarget object.
- *
- * @param {EventTarget} eventTarget - An EventTarget object to get.
- * @param {string} type - An event type to get.
- * @returns {function|null} The found attribute listener.
- */
-function getAttributeListener(eventTarget, type) {
- var node = eventTarget[LISTENERS][type];
- while (node != null) {
- if (node.kind === ATTRIBUTE) {
- return node.listener;
- }
- node = node.next;
- }
- return null;
-}
-
-/**
- * Sets a specified attribute listener to a given EventTarget object.
- *
- * @param {EventTarget} eventTarget - An EventTarget object to set.
- * @param {string} type - An event type to set.
- * @param {function|null} listener - A listener to be set.
- * @returns {void}
- */
-function setAttributeListener(eventTarget, type, listener) {
- if (typeof listener !== "function" && typeof listener !== "object") {
- listener = null; // eslint-disable-line no-param-reassign
- }
-
- var prev = null;
- var node = eventTarget[LISTENERS][type];
- while (node != null) {
- if (node.kind === ATTRIBUTE) {
- // Remove old value.
- if (prev == null) {
- eventTarget[LISTENERS][type] = node.next;
- }
- else {
- prev.next = node.next;
- }
- }
- else {
- prev = node;
- }
-
- node = node.next;
- }
-
- // Add new value.
- if (listener != null) {
- if (prev == null) {
- eventTarget[LISTENERS][type] = newNode(listener, ATTRIBUTE);
- }
- else {
- prev.next = newNode(listener, ATTRIBUTE);
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-// Public Interface
-//-----------------------------------------------------------------------------
-
-/**
- * Defines an `EventTarget` implementation which has `onfoobar` attributes.
- *
- * @param {EventTarget} EventTargetBase - A base implementation of EventTarget.
- * @param {string[]} types - A list of event types which are defined as attribute listeners.
- * @returns {EventTarget} The defined `EventTarget` implementation which has attribute listeners.
- */
-exports.defineCustomEventTarget = function(EventTargetBase, types) {
- function EventTarget() {
- EventTargetBase.call(this);
- }
-
- var descripter = {
- constructor: {
- value: EventTarget,
- configurable: true,
- writable: true
- }
- };
-
- types.forEach(function(type) {
- descripter["on" + type] = {
- get: function() { return getAttributeListener(this, type); },
- set: function(listener) { setAttributeListener(this, type, listener); },
- configurable: true,
- enumerable: true
- };
- });
-
- EventTarget.prototype = Object.create(EventTargetBase.prototype, descripter);
-
- return EventTarget;
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/event-target-shim/lib/event-target.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * @author Toru Nagashima
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-
-
-//-----------------------------------------------------------------------------
-// Requirements
-//-----------------------------------------------------------------------------
-
-var Commons = __webpack_require__("./node_modules/event-target-shim/lib/commons.js");
-var CustomEventTarget = __webpack_require__("./node_modules/event-target-shim/lib/custom-event-target.js");
-var EventWrapper = __webpack_require__("./node_modules/event-target-shim/lib/event-wrapper.js");
-var LISTENERS = Commons.LISTENERS;
-var CAPTURE = Commons.CAPTURE;
-var BUBBLE = Commons.BUBBLE;
-var ATTRIBUTE = Commons.ATTRIBUTE;
-var newNode = Commons.newNode;
-var defineCustomEventTarget = CustomEventTarget.defineCustomEventTarget;
-var createEventWrapper = EventWrapper.createEventWrapper;
-var STOP_IMMEDIATE_PROPAGATION_FLAG =
- EventWrapper.STOP_IMMEDIATE_PROPAGATION_FLAG;
-
-//-----------------------------------------------------------------------------
-// Constants
-//-----------------------------------------------------------------------------
-
-/**
- * A flag which shows there is the native `EventTarget` interface object.
- *
- * @type {boolean}
- * @private
- */
-var HAS_EVENTTARGET_INTERFACE = (
- typeof window !== "undefined" &&
- typeof window.EventTarget !== "undefined"
-);
-
-//-----------------------------------------------------------------------------
-// Public Interface
-//-----------------------------------------------------------------------------
-
-/**
- * An implementation for `EventTarget` interface.
- *
- * @constructor
- * @public
- */
-var EventTarget = module.exports = function EventTarget() {
- if (this instanceof EventTarget) {
- // this[LISTENERS] is a Map.
- // Its key is event type.
- // Its value is ListenerNode object or null.
- //
- // interface ListenerNode {
- // var listener: Function
- // var kind: CAPTURE|BUBBLE|ATTRIBUTE
- // var next: ListenerNode|null
- // }
- Object.defineProperty(this, LISTENERS, {value: Object.create(null)});
- }
- else if (arguments.length === 1 && Array.isArray(arguments[0])) {
- return defineCustomEventTarget(EventTarget, arguments[0]);
- }
- else if (arguments.length > 0) {
- var types = Array(arguments.length);
- for (var i = 0; i < arguments.length; ++i) {
- types[i] = arguments[i];
- }
-
- // To use to extend with attribute listener properties.
- // e.g.
- // class MyCustomObject extends EventTarget("message", "error") {
- // //...
- // }
- return defineCustomEventTarget(EventTarget, types);
- }
- else {
- throw new TypeError("Cannot call a class as a function");
- }
-};
-
-EventTarget.prototype = Object.create(
- (HAS_EVENTTARGET_INTERFACE ? window.EventTarget : Object).prototype,
- {
- constructor: {
- value: EventTarget,
- writable: true,
- configurable: true
- },
-
- addEventListener: {
- value: function addEventListener(type, listener, capture) {
- if (listener == null) {
- return false;
- }
- if (typeof listener !== "function" && typeof listener !== "object") {
- throw new TypeError("\"listener\" is not an object.");
- }
-
- var kind = (capture ? CAPTURE : BUBBLE);
- var node = this[LISTENERS][type];
- if (node == null) {
- this[LISTENERS][type] = newNode(listener, kind);
- return true;
- }
-
- var prev = null;
- while (node != null) {
- if (node.listener === listener && node.kind === kind) {
- // Should ignore a duplicated listener.
- return false;
- }
- prev = node;
- node = node.next;
- }
-
- prev.next = newNode(listener, kind);
- return true;
- },
- configurable: true,
- writable: true
- },
-
- removeEventListener: {
- value: function removeEventListener(type, listener, capture) {
- if (listener == null) {
- return false;
- }
-
- var kind = (capture ? CAPTURE : BUBBLE);
- var prev = null;
- var node = this[LISTENERS][type];
- while (node != null) {
- if (node.listener === listener && node.kind === kind) {
- if (prev == null) {
- this[LISTENERS][type] = node.next;
- }
- else {
- prev.next = node.next;
- }
- return true;
- }
-
- prev = node;
- node = node.next;
- }
-
- return false;
- },
- configurable: true,
- writable: true
- },
-
- dispatchEvent: {
- value: function dispatchEvent(event) {
- // If listeners aren't registered, terminate.
- var node = this[LISTENERS][event.type];
- if (node == null) {
- return true;
- }
-
- // Since we cannot rewrite several properties, so wrap object.
- var wrapped = createEventWrapper(event, this);
-
- // This doesn't process capturing phase and bubbling phase.
- // This isn't participating in a tree.
- while (node != null) {
- if (typeof node.listener === "function") {
- node.listener.call(this, wrapped);
- }
- else if (node.kind !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
- node.listener.handleEvent(wrapped);
- }
-
- if (wrapped[STOP_IMMEDIATE_PROPAGATION_FLAG]) {
- break;
- }
- node = node.next;
- }
-
- return !wrapped.defaultPrevented;
- },
- configurable: true,
- writable: true
- }
- }
-);
-
-
-/***/ }),
-
-/***/ "./node_modules/event-target-shim/lib/event-wrapper.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * @author Toru Nagashima
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-
-
-//-----------------------------------------------------------------------------
-// Requirements
-//-----------------------------------------------------------------------------
-
-var createUniqueKey = __webpack_require__("./node_modules/event-target-shim/lib/commons.js").createUniqueKey;
-
-//-----------------------------------------------------------------------------
-// Constsnts
-//-----------------------------------------------------------------------------
-
-/**
- * The key of the flag which is turned on by `stopImmediatePropagation` method.
- *
- * @type {symbol|string}
- * @private
- */
-var STOP_IMMEDIATE_PROPAGATION_FLAG =
- createUniqueKey("stop_immediate_propagation_flag");
-
-/**
- * The key of the flag which is turned on by `preventDefault` method.
- *
- * @type {symbol|string}
- * @private
- */
-var CANCELED_FLAG = createUniqueKey("canceled_flag");
-
-/**
- * The key of the original event object.
- *
- * @type {symbol|string}
- * @private
- */
-var ORIGINAL_EVENT = createUniqueKey("original_event");
-
-/**
- * Method definitions for the event wrapper.
- *
- * @type {object}
- * @private
- */
-var wrapperPrototypeDefinition = Object.freeze({
- stopPropagation: Object.freeze({
- value: function stopPropagation() {
- var e = this[ORIGINAL_EVENT];
- if (typeof e.stopPropagation === "function") {
- e.stopPropagation();
- }
- },
- writable: true,
- configurable: true
- }),
-
- stopImmediatePropagation: Object.freeze({
- value: function stopImmediatePropagation() {
- this[STOP_IMMEDIATE_PROPAGATION_FLAG] = true;
-
- var e = this[ORIGINAL_EVENT];
- if (typeof e.stopImmediatePropagation === "function") {
- e.stopImmediatePropagation();
- }
- },
- writable: true,
- configurable: true
- }),
-
- preventDefault: Object.freeze({
- value: function preventDefault() {
- if (this.cancelable === true) {
- this[CANCELED_FLAG] = true;
- }
-
- var e = this[ORIGINAL_EVENT];
- if (typeof e.preventDefault === "function") {
- e.preventDefault();
- }
- },
- writable: true,
- configurable: true
- }),
-
- defaultPrevented: Object.freeze({
- get: function defaultPrevented() { return this[CANCELED_FLAG]; },
- enumerable: true,
- configurable: true
- })
-});
-
-//-----------------------------------------------------------------------------
-// Public Interface
-//-----------------------------------------------------------------------------
-
-exports.STOP_IMMEDIATE_PROPAGATION_FLAG = STOP_IMMEDIATE_PROPAGATION_FLAG;
-
-/**
- * Creates an event wrapper.
- *
- * We cannot modify several properties of `Event` object, so we need to create the wrapper.
- * Plus, this wrapper supports non `Event` objects.
- *
- * @param {Event|{type: string}} event - An original event to create the wrapper.
- * @param {EventTarget} eventTarget - The event target of the event.
- * @returns {Event} The created wrapper. This object is implemented `Event` interface.
- * @private
- */
-exports.createEventWrapper = function createEventWrapper(event, eventTarget) {
- var timeStamp = (
- typeof event.timeStamp === "number" ? event.timeStamp : Date.now()
- );
- var propertyDefinition = {
- type: {value: event.type, enumerable: true},
- target: {value: eventTarget, enumerable: true},
- currentTarget: {value: eventTarget, enumerable: true},
- eventPhase: {value: 2, enumerable: true},
- bubbles: {value: Boolean(event.bubbles), enumerable: true},
- cancelable: {value: Boolean(event.cancelable), enumerable: true},
- timeStamp: {value: timeStamp, enumerable: true},
- isTrusted: {value: false, enumerable: true}
- };
- propertyDefinition[STOP_IMMEDIATE_PROPAGATION_FLAG] = {value: false, writable: true};
- propertyDefinition[CANCELED_FLAG] = {value: false, writable: true};
- propertyDefinition[ORIGINAL_EVENT] = {value: event};
-
- // For CustomEvent.
- if (typeof event.detail !== "undefined") {
- propertyDefinition.detail = {value: event.detail, enumerable: true};
- }
-
- return Object.create(
- Object.create(event, wrapperPrototypeDefinition),
- propertyDefinition
- );
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/ExecutionEnvironment.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-
-
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-
-/**
- * Simple, lightweight module assisting with the detection and context of
- * Worker. Helps avoid circular dependencies and allows code to reason about
- * whether or not they are in a Worker, even if they never include the main
- * `ReactWorker` dependency.
- */
-var ExecutionEnvironment = {
-
- canUseDOM: canUseDOM,
-
- canUseWorkers: typeof Worker !== 'undefined',
-
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
-
- canUseViewport: canUseDOM && !!window.screen,
-
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
-
-};
-
-module.exports = ExecutionEnvironment;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/Promise.native.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- *
- * Copyright 2013-2016 Facebook, Inc.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * This module wraps and augments the minimally ES6-compliant Promise
- * implementation provided by the promise npm package.
- *
- */
-
-
-
-var Promise = __webpack_require__("./node_modules/promise/setimmediate/es6-extensions.js");
-__webpack_require__("./node_modules/promise/setimmediate/done.js");
-
-/**
- * Handle either fulfillment or rejection with the same callback.
- */
-Promise.prototype['finally'] = function (onSettled) {
- return this.then(onSettled, onSettled);
-};
-
-module.exports = Promise;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/TouchEventUtils.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-var TouchEventUtils = {
- /**
- * Utility function for common case of extracting out the primary touch from a
- * touch event.
- * - `touchEnd` events usually do not have the `touches` property.
- * http://stackoverflow.com/questions/3666929/
- * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed
- *
- * @param {Event} nativeEvent Native event that may or may not be a touch.
- * @return {TouchesObject?} an object with pageX and pageY or null.
- */
- extractSingleTouch: function extractSingleTouch(nativeEvent) {
- var touches = nativeEvent.touches;
- var changedTouches = nativeEvent.changedTouches;
- var hasTouches = touches && touches.length > 0;
- var hasChangedTouches = changedTouches && changedTouches.length > 0;
-
- return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
- }
-};
-
-module.exports = TouchEventUtils;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/emptyFunction.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-function makeEmptyFunction(arg) {
- return function () {
- return arg;
- };
-}
-
-/**
- * This function accepts and discards inputs; it has no side effects. This is
- * primarily useful idiomatically for overridable function endpoints which
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
- */
-var emptyFunction = function emptyFunction() {};
-
-emptyFunction.thatReturns = makeEmptyFunction;
-emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
-emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
-emptyFunction.thatReturnsNull = makeEmptyFunction(null);
-emptyFunction.thatReturnsThis = function () {
- return this;
-};
-emptyFunction.thatReturnsArgument = function (arg) {
- return arg;
-};
-
-module.exports = emptyFunction;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/emptyObject.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-
-
-var emptyObject = {};
-
-if (false) {
- Object.freeze(emptyObject);
-}
-
-module.exports = emptyObject;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/invariant.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var validateFormat = function validateFormat(format) {};
-
-if (false) {
- validateFormat = function validateFormat(format) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- };
-}
-
-function invariant(condition, format, a, b, c, d, e, f) {
- validateFormat(format);
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-}
-
-module.exports = invariant;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/isNode.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-/**
- * @param {*} object The object to check.
- * @return {boolean} Whether or not the object is a DOM node.
- */
-function isNode(object) {
- var doc = object ? object.ownerDocument || object : document;
- var defaultView = doc.defaultView || window;
- return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
-}
-
-module.exports = isNode;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/keyMirror.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks static-only
- */
-
-
-
-var invariant = __webpack_require__("./node_modules/fbjs/lib/invariant.js");
-
-/**
- * Constructs an enumeration with keys equal to their value.
- *
- * For example:
- *
- * var COLORS = keyMirror({blue: null, red: null});
- * var myColor = COLORS.blue;
- * var isColorValid = !!COLORS[myColor];
- *
- * The last line could not be performed if the values of the generated enum were
- * not equal to their keys.
- *
- * Input: {key1: val1, key2: val2}
- * Output: {key1: key1, key2: key2}
- *
- * @param {object} obj
- * @return {object}
- */
-var keyMirror = function keyMirror(obj) {
- var ret = {};
- var key;
- !(obj instanceof Object && !Array.isArray(obj)) ? false ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
- for (key in obj) {
- if (!obj.hasOwnProperty(key)) {
- continue;
- }
- ret[key] = key;
- }
- return ret;
-};
-
-module.exports = keyMirror;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/keyOf.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/**
- * Allows extraction of a minified key. Let's the build system minify keys
- * without losing the ability to dynamically use key strings as values
- * themselves. Pass in an object with a single key/val pair and it will return
- * you the string key of that single record. Suppose you want to grab the
- * value for a key 'className' inside of an object. Key/val minification may
- * have aliased that key to be 'xa12'. keyOf({className: null}) will return
- * 'xa12' in that case. Resolve keys you want to use once at startup time, then
- * reuse those resolutions.
- */
-var keyOf = function keyOf(oneKeyObj) {
- var key;
- for (key in oneKeyObj) {
- if (!oneKeyObj.hasOwnProperty(key)) {
- continue;
- }
- return key;
- }
- return null;
-};
-
-module.exports = keyOf;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/nativeRequestAnimationFrame.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-var nativeRequestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame || global.msRequestAnimationFrame;
-
-module.exports = nativeRequestAnimationFrame;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/performance.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-
-
-var ExecutionEnvironment = __webpack_require__("./node_modules/fbjs/lib/ExecutionEnvironment.js");
-
-var performance;
-
-if (ExecutionEnvironment.canUseDOM) {
- performance = window.performance || window.msPerformance || window.webkitPerformance;
-}
-
-module.exports = performance || {};
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/performanceNow.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-var performance = __webpack_require__("./node_modules/fbjs/lib/performance.js");
-
-var performanceNow;
-
-/**
- * Detect if we can use `window.performance.now()` and gracefully fallback to
- * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
- * because of Facebook's testing infrastructure.
- */
-if (performance.now) {
- performanceNow = function performanceNow() {
- return performance.now();
- };
-} else {
- performanceNow = function performanceNow() {
- return Date.now();
- };
-}
-
-module.exports = performanceNow;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/requestAnimationFrame.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {
-
-/**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-var emptyFunction = __webpack_require__("./node_modules/fbjs/lib/emptyFunction.js");
-var nativeRequestAnimationFrame = __webpack_require__("./node_modules/fbjs/lib/nativeRequestAnimationFrame.js");
-
-var lastTime = 0;
-
-var requestAnimationFrame = nativeRequestAnimationFrame || function (callback) {
- var currTime = Date.now();
- var timeDelay = Math.max(0, 16 - (currTime - lastTime));
- lastTime = currTime + timeDelay;
- return global.setTimeout(function () {
- callback(Date.now());
- }, timeDelay);
-};
-
-// Works around a rare bug in Safari 6 where the first request is never invoked.
-requestAnimationFrame(emptyFunction);
-
-module.exports = requestAnimationFrame;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/shallowEqual.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- *
- */
-
-/*eslint-disable no-self-compare */
-
-
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-/**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
-function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- // Added the nonzero y check to make Flow happy, but it is redundant
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
-}
-
-/**
- * Performs equality by iterating through keys on an object and returning false
- * when any key has values which are not strictly equal between the arguments.
- * Returns true when the values of all keys are strictly equal.
- */
-function shallowEqual(objA, objB) {
- if (is(objA, objB)) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
-
- if (keysA.length !== keysB.length) {
- return false;
- }
-
- // Test for A's keys different from B.
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
-
- return true;
-}
-
-module.exports = shallowEqual;
-
-/***/ }),
-
-/***/ "./node_modules/fbjs/lib/warning.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-
-
-var emptyFunction = __webpack_require__("./node_modules/fbjs/lib/emptyFunction.js");
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warning = emptyFunction;
-
-if (false) {
- (function () {
- var printWarning = function printWarning(format) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- warning = function warning(condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return; // Ignore CompositeComponent proptype check.
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(undefined, [format].concat(args));
- }
- };
- })();
-}
-
-module.exports = warning;
-
-/***/ }),
-
-/***/ "./node_modules/haul/src/utils/polyfillEnvironment.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(global) {__webpack_require__("./node_modules/haul/vendor/polyfills/console.js");__webpack_require__("./node_modules/haul/vendor/polyfills/error-guard.js");__webpack_require__("./node_modules/haul/vendor/polyfills/Number.es6.js");__webpack_require__("./node_modules/haul/vendor/polyfills/String.prototype.es6.js");__webpack_require__("./node_modules/haul/vendor/polyfills/Array.prototype.es6.js");__webpack_require__("./node_modules/haul/vendor/polyfills/Array.es6.js");__webpack_require__("./node_modules/haul/vendor/polyfills/Object.es6.js");__webpack_require__("./node_modules/haul/vendor/polyfills/Object.es7.js");__webpack_require__("./node_modules/haul/vendor/polyfills/babelHelpers.js");if(!global.self){global.self=global;}__webpack_require__("./node_modules/react-native/Libraries/Core/InitializeCore.js");
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/haul/vendor/polyfills/Array.es6.js":
-/***/ (function(module, exports) {
-
-if(!Array.from){Array.from=function(arrayLike){if(arrayLike==null){throw new TypeError('Object is null or undefined');}var mapFn=arguments[1];var thisArg=arguments[2];var C=this;var items=Object(arrayLike);var symbolIterator=typeof Symbol==='function'?typeof Symbol==='function'?Symbol.iterator:'@@iterator':'@@iterator';var mapping=typeof mapFn==='function';var usingIterator=typeof items[symbolIterator]==='function';var key=0;var ret;var value;if(usingIterator){ret=typeof C==='function'?new C():[];var it=items[symbolIterator]();var next;while(!(next=it.next()).done){value=next.value;if(mapping){value=mapFn.call(thisArg,value,key);}ret[key]=value;key+=1;}ret.length=key;return ret;}var len=items.length;if(isNaN(len)||len<0){len=0;}ret=typeof C==='function'?new C(len):new Array(len);while(key>>0;for(var i=0;i=0){k=n;}else{k=len+n;if(k<0){k=0;}}var currentElement;while(k1?Number(arguments[1])||0:0;var start=Math.min(Math.max(pos,0),string.length);return string.indexOf(String(search),pos)===start;};}if(!String.prototype.endsWith){String.prototype.endsWith=function(search){'use strict';if(this==null){throw TypeError();}var string=String(this);var stringLength=string.length;var searchString=String(search);var pos=arguments.length>1?Number(arguments[1])||0:stringLength;var end=Math.min(Math.max(pos,0),stringLength);var start=end-searchString.length;if(start<0){return false;}return string.lastIndexOf(searchString,start)===start;};}if(!String.prototype.repeat){String.prototype.repeat=function(count){'use strict';if(this==null){throw TypeError();}var string=String(this);count=Number(count)||0;if(count<0||count===Infinity){throw RangeError();}if(count===1){return string;}var result='';while(count){if(count&1){result+=string;}if(count>>=1){string+=string;}}return result;};}if(!String.prototype.includes){String.prototype.includes=function(search,start){'use strict';if(typeof start!=='number'){start=0;}if(start+search.length>this.length){return false;}else{return this.indexOf(search,start)!==-1;}};}
-
-/***/ }),
-
-/***/ "./node_modules/haul/vendor/polyfills/babelHelpers.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(global) {var babelHelpers=global.babelHelpers={};babelHelpers.typeof=typeof Symbol==="function"&&typeof(typeof Symbol==="function"?Symbol.iterator:"@@iterator")==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==(typeof Symbol==="function"?Symbol.prototype:"@@prototype")?"symbol":typeof obj;};babelHelpers.createRawReactElement=function(){var REACT_ELEMENT_TYPE=typeof Symbol==="function"&&(typeof Symbol==="function"?Symbol.for:"@@for")&&(typeof Symbol==="function"?Symbol.for:"@@for")("react.element")||0xeac7;return function createRawReactElement(type,key,props){return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:null,props:props,_owner:null};};}();babelHelpers.classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}};babelHelpers.createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;};babelHelpers.possibleConstructorReturn=function(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;};babelHelpers.slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[typeof Symbol==="function"?Symbol.iterator:"@@iterator"](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if((typeof Symbol==="function"?Symbol.iterator:"@@iterator")in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();babelHelpers.taggedTemplateLiteral=function(strings,raw){return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));};babelHelpers.toArray=function(arr){return Array.isArray(arr)?arr:Array.from(arr);};babelHelpers.toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i=0||keys.indexOf('description')>=0)){return formatError(value);}if(keys.length===0){if(isFunction(value)){var name=value.name?': '+value.name:'';return ctx.stylize('[Function'+name+']','special');}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),'date');}if(isError(value)){return formatError(value);}}var base='',array=false,braces=['{','}'];if(isArray(value)){array=true;braces=['[',']'];}if(isFunction(value)){var n=value.name?': '+value.name:'';base=' [Function'+n+']';}if(isRegExp(value)){base=' '+RegExp.prototype.toString.call(value);}if(isDate(value)){base=' '+Date.prototype.toUTCString.call(value);}if(isError(value)){base=' '+formatError(value);}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1];}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else{return ctx.stylize('[Object]','special');}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});}ctx.seen.pop();return reduceToSingleString(output,base,braces);}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize('undefined','undefined');if(isString(value)){var simple='\''+JSON.stringify(value).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+'\'';return ctx.stylize(simple,'string');}if(isNumber(value))return ctx.stylize(''+value,'number');if(isBoolean(value))return ctx.stylize(''+value,'boolean');if(isNull(value))return ctx.stylize('null','null');}function formatError(value){return'['+Error.prototype.toString.call(value)+']';}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split('\n').map(function(line){return' '+line;}).join('\n').substr(2);}else{str='\n'+str.split('\n').map(function(line){return' '+line;}).join('\n');}}}else{str=ctx.stylize('[Circular]','special');}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str;}name=JSON.stringify(''+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,'name');}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,'string');}}return name+': '+str;}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf('\n')>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;},0);if(length>60){return braces[0]+(base===''?'':base+'\n ')+' '+output.join(',\n ')+' '+braces[1];}return braces[0]+base+' '+output.join(', ')+' '+braces[1];}function isArray(ar){return Array.isArray(ar);}function isBoolean(arg){return typeof arg==='boolean';}function isNull(arg){return arg===null;}function isNullOrUndefined(arg){return arg==null;}function isNumber(arg){return typeof arg==='number';}function isString(arg){return typeof arg==='string';}function isSymbol(arg){return typeof arg==='symbol';}function isUndefined(arg){return arg===void 0;}function isRegExp(re){return isObject(re)&&objectToString(re)==='[object RegExp]';}function isObject(arg){return typeof arg==='object'&&arg!==null;}function isDate(d){return isObject(d)&&objectToString(d)==='[object Date]';}function isError(e){return isObject(e)&&(objectToString(e)==='[object Error]'||e instanceof Error);}function isFunction(arg){return typeof arg==='function';}function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||typeof arg==='symbol'||typeof arg==='undefined';}function objectToString(o){return Object.prototype.toString.call(o);}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}return inspect;}();var OBJECT_COLUMN_NAME='(index)';var LOG_LEVELS={trace:0,info:1,warn:2,error:3};var INSPECTOR_LEVELS=[];INSPECTOR_LEVELS[LOG_LEVELS.trace]='debug';INSPECTOR_LEVELS[LOG_LEVELS.info]='log';INSPECTOR_LEVELS[LOG_LEVELS.warn]='warning';INSPECTOR_LEVELS[LOG_LEVELS.error]='error';var INSPECTOR_FRAMES_TO_SKIP= false?2:1;function setupConsole(global){if(!global.nativeLoggingHook){return;}function getNativeLogFunction(level){return function(){var str=void 0;if(arguments.length===1&&typeof arguments[0]==='string'){str=arguments[0];}else{str=Array.prototype.map.call(arguments,function(arg){return inspect(arg,{depth:10});}).join(', ');}var logLevel=level;if(str.slice(0,9)==='Warning: '&&logLevel>=LOG_LEVELS.error){logLevel=LOG_LEVELS.warn;}if(global.__inspectorLog){global.__inspectorLog(INSPECTOR_LEVELS[logLevel],str,[].slice.call(arguments),INSPECTOR_FRAMES_TO_SKIP);}global.nativeLoggingHook(str,logLevel);};}function repeat(element,n){return Array.apply(null,Array(n)).map(function(){return element;});};function consoleTablePolyfill(rows){if(!Array.isArray(rows)){var data=rows;rows=[];for(var key in data){if(data.hasOwnProperty(key)){var row=data[key];row[OBJECT_COLUMN_NAME]=key;rows.push(row);}}}if(rows.length===0){global.nativeLoggingHook('',LOG_LEVELS.info);return;}var columns=Object.keys(rows[0]).sort();var stringRows=[];var columnWidths=[];columns.forEach(function(k,i){columnWidths[i]=k.length;for(var j=0;j';function guarded(){return ErrorUtils.applyWithGuard(fun,context||this,arguments,null,name);}return guarded;}};global.ErrorUtils=ErrorUtils;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/immutable/dist/immutable.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * Copyright (c) 2014-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-(function (global, factory) {
- true ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- global.Immutable = factory();
-}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;
-
- function createClass(ctor, superClass) {
- if (superClass) {
- ctor.prototype = Object.create(superClass.prototype);
- }
- ctor.prototype.constructor = ctor;
- }
-
- function Iterable(value) {
- return isIterable(value) ? value : Seq(value);
- }
-
-
- createClass(KeyedIterable, Iterable);
- function KeyedIterable(value) {
- return isKeyed(value) ? value : KeyedSeq(value);
- }
-
-
- createClass(IndexedIterable, Iterable);
- function IndexedIterable(value) {
- return isIndexed(value) ? value : IndexedSeq(value);
- }
-
-
- createClass(SetIterable, Iterable);
- function SetIterable(value) {
- return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
- }
-
-
-
- function isIterable(maybeIterable) {
- return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
- }
-
- function isKeyed(maybeKeyed) {
- return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
- }
-
- function isIndexed(maybeIndexed) {
- return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
- }
-
- function isAssociative(maybeAssociative) {
- return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
- }
-
- function isOrdered(maybeOrdered) {
- return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
- }
-
- Iterable.isIterable = isIterable;
- Iterable.isKeyed = isKeyed;
- Iterable.isIndexed = isIndexed;
- Iterable.isAssociative = isAssociative;
- Iterable.isOrdered = isOrdered;
-
- Iterable.Keyed = KeyedIterable;
- Iterable.Indexed = IndexedIterable;
- Iterable.Set = SetIterable;
-
-
- var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
- var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
- var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
- var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
-
- // Used for setting prototype methods that IE8 chokes on.
- var DELETE = 'delete';
-
- // Constants describing the size of trie nodes.
- var SHIFT = 5; // Resulted in best performance after ______?
- var SIZE = 1 << SHIFT;
- var MASK = SIZE - 1;
-
- // A consistent shared value representing "not set" which equals nothing other
- // than itself, and nothing that could be provided externally.
- var NOT_SET = {};
-
- // Boolean references, Rough equivalent of `bool &`.
- var CHANGE_LENGTH = { value: false };
- var DID_ALTER = { value: false };
-
- function MakeRef(ref) {
- ref.value = false;
- return ref;
- }
-
- function SetRef(ref) {
- ref && (ref.value = true);
- }
-
- // A function which returns a value representing an "owner" for transient writes
- // to tries. The return value will only ever equal itself, and will not equal
- // the return of any subsequent call of this function.
- function OwnerID() {}
-
- // http://jsperf.com/copy-array-inline
- function arrCopy(arr, offset) {
- offset = offset || 0;
- var len = Math.max(0, arr.length - offset);
- var newArr = new Array(len);
- for (var ii = 0; ii < len; ii++) {
- newArr[ii] = arr[ii + offset];
- }
- return newArr;
- }
-
- function ensureSize(iter) {
- if (iter.size === undefined) {
- iter.size = iter.__iterate(returnTrue);
- }
- return iter.size;
- }
-
- function wrapIndex(iter, index) {
- // This implements "is array index" which the ECMAString spec defines as:
- //
- // A String property name P is an array index if and only if
- // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
- // to 2^32−1.
- //
- // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
- if (typeof index !== 'number') {
- var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
- if ('' + uint32Index !== index || uint32Index === 4294967295) {
- return NaN;
- }
- index = uint32Index;
- }
- return index < 0 ? ensureSize(iter) + index : index;
- }
-
- function returnTrue() {
- return true;
- }
-
- function wholeSlice(begin, end, size) {
- return (begin === 0 || (size !== undefined && begin <= -size)) &&
- (end === undefined || (size !== undefined && end >= size));
- }
-
- function resolveBegin(begin, size) {
- return resolveIndex(begin, size, 0);
- }
-
- function resolveEnd(end, size) {
- return resolveIndex(end, size, size);
- }
-
- function resolveIndex(index, size, defaultIndex) {
- return index === undefined ?
- defaultIndex :
- index < 0 ?
- Math.max(0, size + index) :
- size === undefined ?
- index :
- Math.min(size, index);
- }
-
- /* global Symbol */
-
- var ITERATE_KEYS = 0;
- var ITERATE_VALUES = 1;
- var ITERATE_ENTRIES = 2;
-
- var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
-
- var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
-
-
- function Iterator(next) {
- this.next = next;
- }
-
- Iterator.prototype.toString = function() {
- return '[Iterator]';
- };
-
-
- Iterator.KEYS = ITERATE_KEYS;
- Iterator.VALUES = ITERATE_VALUES;
- Iterator.ENTRIES = ITERATE_ENTRIES;
-
- Iterator.prototype.inspect =
- Iterator.prototype.toSource = function () { return this.toString(); }
- Iterator.prototype[ITERATOR_SYMBOL] = function () {
- return this;
- };
-
-
- function iteratorValue(type, k, v, iteratorResult) {
- var value = type === 0 ? k : type === 1 ? v : [k, v];
- iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {
- value: value, done: false
- });
- return iteratorResult;
- }
-
- function iteratorDone() {
- return { value: undefined, done: true };
- }
-
- function hasIterator(maybeIterable) {
- return !!getIteratorFn(maybeIterable);
- }
-
- function isIterator(maybeIterator) {
- return maybeIterator && typeof maybeIterator.next === 'function';
- }
-
- function getIterator(iterable) {
- var iteratorFn = getIteratorFn(iterable);
- return iteratorFn && iteratorFn.call(iterable);
- }
-
- function getIteratorFn(iterable) {
- var iteratorFn = iterable && (
- (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
- iterable[FAUX_ITERATOR_SYMBOL]
- );
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
-
- function isArrayLike(value) {
- return value && typeof value.length === 'number';
- }
-
- createClass(Seq, Iterable);
- function Seq(value) {
- return value === null || value === undefined ? emptySequence() :
- isIterable(value) ? value.toSeq() : seqFromValue(value);
- }
-
- Seq.of = function(/*...values*/) {
- return Seq(arguments);
- };
-
- Seq.prototype.toSeq = function() {
- return this;
- };
-
- Seq.prototype.toString = function() {
- return this.__toString('Seq {', '}');
- };
-
- Seq.prototype.cacheResult = function() {
- if (!this._cache && this.__iterateUncached) {
- this._cache = this.entrySeq().toArray();
- this.size = this._cache.length;
- }
- return this;
- };
-
- // abstract __iterateUncached(fn, reverse)
-
- Seq.prototype.__iterate = function(fn, reverse) {
- return seqIterate(this, fn, reverse, true);
- };
-
- // abstract __iteratorUncached(type, reverse)
-
- Seq.prototype.__iterator = function(type, reverse) {
- return seqIterator(this, type, reverse, true);
- };
-
-
-
- createClass(KeyedSeq, Seq);
- function KeyedSeq(value) {
- return value === null || value === undefined ?
- emptySequence().toKeyedSeq() :
- isIterable(value) ?
- (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :
- keyedSeqFromValue(value);
- }
-
- KeyedSeq.prototype.toKeyedSeq = function() {
- return this;
- };
-
-
-
- createClass(IndexedSeq, Seq);
- function IndexedSeq(value) {
- return value === null || value === undefined ? emptySequence() :
- !isIterable(value) ? indexedSeqFromValue(value) :
- isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
- }
-
- IndexedSeq.of = function(/*...values*/) {
- return IndexedSeq(arguments);
- };
-
- IndexedSeq.prototype.toIndexedSeq = function() {
- return this;
- };
-
- IndexedSeq.prototype.toString = function() {
- return this.__toString('Seq [', ']');
- };
-
- IndexedSeq.prototype.__iterate = function(fn, reverse) {
- return seqIterate(this, fn, reverse, false);
- };
-
- IndexedSeq.prototype.__iterator = function(type, reverse) {
- return seqIterator(this, type, reverse, false);
- };
-
-
-
- createClass(SetSeq, Seq);
- function SetSeq(value) {
- return (
- value === null || value === undefined ? emptySequence() :
- !isIterable(value) ? indexedSeqFromValue(value) :
- isKeyed(value) ? value.entrySeq() : value
- ).toSetSeq();
- }
-
- SetSeq.of = function(/*...values*/) {
- return SetSeq(arguments);
- };
-
- SetSeq.prototype.toSetSeq = function() {
- return this;
- };
-
-
-
- Seq.isSeq = isSeq;
- Seq.Keyed = KeyedSeq;
- Seq.Set = SetSeq;
- Seq.Indexed = IndexedSeq;
-
- var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
-
- Seq.prototype[IS_SEQ_SENTINEL] = true;
-
-
-
- createClass(ArraySeq, IndexedSeq);
- function ArraySeq(array) {
- this._array = array;
- this.size = array.length;
- }
-
- ArraySeq.prototype.get = function(index, notSetValue) {
- return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
- };
-
- ArraySeq.prototype.__iterate = function(fn, reverse) {
- var array = this._array;
- var maxIndex = array.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
-
- ArraySeq.prototype.__iterator = function(type, reverse) {
- var array = this._array;
- var maxIndex = array.length - 1;
- var ii = 0;
- return new Iterator(function()
- {return ii > maxIndex ?
- iteratorDone() :
- iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}
- );
- };
-
-
-
- createClass(ObjectSeq, KeyedSeq);
- function ObjectSeq(object) {
- var keys = Object.keys(object);
- this._object = object;
- this._keys = keys;
- this.size = keys.length;
- }
-
- ObjectSeq.prototype.get = function(key, notSetValue) {
- if (notSetValue !== undefined && !this.has(key)) {
- return notSetValue;
- }
- return this._object[key];
- };
-
- ObjectSeq.prototype.has = function(key) {
- return this._object.hasOwnProperty(key);
- };
-
- ObjectSeq.prototype.__iterate = function(fn, reverse) {
- var object = this._object;
- var keys = this._keys;
- var maxIndex = keys.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- var key = keys[reverse ? maxIndex - ii : ii];
- if (fn(object[key], key, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
-
- ObjectSeq.prototype.__iterator = function(type, reverse) {
- var object = this._object;
- var keys = this._keys;
- var maxIndex = keys.length - 1;
- var ii = 0;
- return new Iterator(function() {
- var key = keys[reverse ? maxIndex - ii : ii];
- return ii++ > maxIndex ?
- iteratorDone() :
- iteratorValue(type, key, object[key]);
- });
- };
-
- ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;
-
-
- createClass(IterableSeq, IndexedSeq);
- function IterableSeq(iterable) {
- this._iterable = iterable;
- this.size = iterable.length || iterable.size;
- }
-
- IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterable = this._iterable;
- var iterator = getIterator(iterable);
- var iterations = 0;
- if (isIterator(iterator)) {
- var step;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- }
- return iterations;
- };
-
- IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterable = this._iterable;
- var iterator = getIterator(iterable);
- if (!isIterator(iterator)) {
- return new Iterator(iteratorDone);
- }
- var iterations = 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step : iteratorValue(type, iterations++, step.value);
- });
- };
-
-
-
- createClass(IteratorSeq, IndexedSeq);
- function IteratorSeq(iterator) {
- this._iterator = iterator;
- this._iteratorCache = [];
- }
-
- IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterator = this._iterator;
- var cache = this._iteratorCache;
- var iterations = 0;
- while (iterations < cache.length) {
- if (fn(cache[iterations], iterations++, this) === false) {
- return iterations;
- }
- }
- var step;
- while (!(step = iterator.next()).done) {
- var val = step.value;
- cache[iterations] = val;
- if (fn(val, iterations++, this) === false) {
- break;
- }
- }
- return iterations;
- };
-
- IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = this._iterator;
- var cache = this._iteratorCache;
- var iterations = 0;
- return new Iterator(function() {
- if (iterations >= cache.length) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- cache[iterations] = step.value;
- }
- return iteratorValue(type, iterations, cache[iterations++]);
- });
- };
-
-
-
-
- // # pragma Helper functions
-
- function isSeq(maybeSeq) {
- return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
- }
-
- var EMPTY_SEQ;
-
- function emptySequence() {
- return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
- }
-
- function keyedSeqFromValue(value) {
- var seq =
- Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :
- isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :
- hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :
- typeof value === 'object' ? new ObjectSeq(value) :
- undefined;
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of [k, v] entries, '+
- 'or keyed object: ' + value
- );
- }
- return seq;
- }
-
- function indexedSeqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value);
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of values: ' + value
- );
- }
- return seq;
- }
-
- function seqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value) ||
- (typeof value === 'object' && new ObjectSeq(value));
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of values, or keyed object: ' + value
- );
- }
- return seq;
- }
-
- function maybeIndexedSeqFromValue(value) {
- return (
- isArrayLike(value) ? new ArraySeq(value) :
- isIterator(value) ? new IteratorSeq(value) :
- hasIterator(value) ? new IterableSeq(value) :
- undefined
- );
- }
-
- function seqIterate(seq, fn, reverse, useKeys) {
- var cache = seq._cache;
- if (cache) {
- var maxIndex = cache.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- var entry = cache[reverse ? maxIndex - ii : ii];
- if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
- return ii + 1;
- }
- }
- return ii;
- }
- return seq.__iterateUncached(fn, reverse);
- }
-
- function seqIterator(seq, type, reverse, useKeys) {
- var cache = seq._cache;
- if (cache) {
- var maxIndex = cache.length - 1;
- var ii = 0;
- return new Iterator(function() {
- var entry = cache[reverse ? maxIndex - ii : ii];
- return ii++ > maxIndex ?
- iteratorDone() :
- iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
- });
- }
- return seq.__iteratorUncached(type, reverse);
- }
-
- function fromJS(json, converter) {
- return converter ?
- fromJSWith(converter, json, '', {'': json}) :
- fromJSDefault(json);
- }
-
- function fromJSWith(converter, json, key, parentJSON) {
- if (Array.isArray(json)) {
- return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
- }
- if (isPlainObj(json)) {
- return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
- }
- return json;
- }
-
- function fromJSDefault(json) {
- if (Array.isArray(json)) {
- return IndexedSeq(json).map(fromJSDefault).toList();
- }
- if (isPlainObj(json)) {
- return KeyedSeq(json).map(fromJSDefault).toMap();
- }
- return json;
- }
-
- function isPlainObj(value) {
- return value && (value.constructor === Object || value.constructor === undefined);
- }
-
- /**
- * An extension of the "same-value" algorithm as [described for use by ES6 Map
- * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
- *
- * NaN is considered the same as NaN, however -0 and 0 are considered the same
- * value, which is different from the algorithm described by
- * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
- *
- * This is extended further to allow Objects to describe the values they
- * represent, by way of `valueOf` or `equals` (and `hashCode`).
- *
- * Note: because of this extension, the key equality of Immutable.Map and the
- * value equality of Immutable.Set will differ from ES6 Map and Set.
- *
- * ### Defining custom values
- *
- * The easiest way to describe the value an object represents is by implementing
- * `valueOf`. For example, `Date` represents a value by returning a unix
- * timestamp for `valueOf`:
- *
- * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
- * var date2 = new Date(1234567890000);
- * date1.valueOf(); // 1234567890000
- * assert( date1 !== date2 );
- * assert( Immutable.is( date1, date2 ) );
- *
- * Note: overriding `valueOf` may have other implications if you use this object
- * where JavaScript expects a primitive, such as implicit string coercion.
- *
- * For more complex types, especially collections, implementing `valueOf` may
- * not be performant. An alternative is to implement `equals` and `hashCode`.
- *
- * `equals` takes another object, presumably of similar type, and returns true
- * if the it is equal. Equality is symmetrical, so the same result should be
- * returned if this and the argument are flipped.
- *
- * assert( a.equals(b) === b.equals(a) );
- *
- * `hashCode` returns a 32bit integer number representing the object which will
- * be used to determine how to store the value object in a Map or Set. You must
- * provide both or neither methods, one must not exist without the other.
- *
- * Also, an important relationship between these methods must be upheld: if two
- * values are equal, they *must* return the same hashCode. If the values are not
- * equal, they might have the same hashCode; this is called a hash collision,
- * and while undesirable for performance reasons, it is acceptable.
- *
- * if (a.equals(b)) {
- * assert( a.hashCode() === b.hashCode() );
- * }
- *
- * All Immutable collections implement `equals` and `hashCode`.
- *
- */
- function is(valueA, valueB) {
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- if (typeof valueA.valueOf === 'function' &&
- typeof valueB.valueOf === 'function') {
- valueA = valueA.valueOf();
- valueB = valueB.valueOf();
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- }
- if (typeof valueA.equals === 'function' &&
- typeof valueB.equals === 'function' &&
- valueA.equals(valueB)) {
- return true;
- }
- return false;
- }
-
- function deepEqual(a, b) {
- if (a === b) {
- return true;
- }
-
- if (
- !isIterable(b) ||
- a.size !== undefined && b.size !== undefined && a.size !== b.size ||
- a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||
- isKeyed(a) !== isKeyed(b) ||
- isIndexed(a) !== isIndexed(b) ||
- isOrdered(a) !== isOrdered(b)
- ) {
- return false;
- }
-
- if (a.size === 0 && b.size === 0) {
- return true;
- }
-
- var notAssociative = !isAssociative(a);
-
- if (isOrdered(a)) {
- var entries = a.entries();
- return b.every(function(v, k) {
- var entry = entries.next().value;
- return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
- }) && entries.next().done;
- }
-
- var flipped = false;
-
- if (a.size === undefined) {
- if (b.size === undefined) {
- if (typeof a.cacheResult === 'function') {
- a.cacheResult();
- }
- } else {
- flipped = true;
- var _ = a;
- a = b;
- b = _;
- }
- }
-
- var allEqual = true;
- var bSize = b.__iterate(function(v, k) {
- if (notAssociative ? !a.has(v) :
- flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
- allEqual = false;
- return false;
- }
- });
-
- return allEqual && a.size === bSize;
- }
-
- createClass(Repeat, IndexedSeq);
-
- function Repeat(value, times) {
- if (!(this instanceof Repeat)) {
- return new Repeat(value, times);
- }
- this._value = value;
- this.size = times === undefined ? Infinity : Math.max(0, times);
- if (this.size === 0) {
- if (EMPTY_REPEAT) {
- return EMPTY_REPEAT;
- }
- EMPTY_REPEAT = this;
- }
- }
-
- Repeat.prototype.toString = function() {
- if (this.size === 0) {
- return 'Repeat []';
- }
- return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
- };
-
- Repeat.prototype.get = function(index, notSetValue) {
- return this.has(index) ? this._value : notSetValue;
- };
-
- Repeat.prototype.includes = function(searchValue) {
- return is(this._value, searchValue);
- };
-
- Repeat.prototype.slice = function(begin, end) {
- var size = this.size;
- return wholeSlice(begin, end, size) ? this :
- new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
- };
-
- Repeat.prototype.reverse = function() {
- return this;
- };
-
- Repeat.prototype.indexOf = function(searchValue) {
- if (is(this._value, searchValue)) {
- return 0;
- }
- return -1;
- };
-
- Repeat.prototype.lastIndexOf = function(searchValue) {
- if (is(this._value, searchValue)) {
- return this.size;
- }
- return -1;
- };
-
- Repeat.prototype.__iterate = function(fn, reverse) {
- for (var ii = 0; ii < this.size; ii++) {
- if (fn(this._value, ii, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
-
- Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;
- var ii = 0;
- return new Iterator(function()
- {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}
- );
- };
-
- Repeat.prototype.equals = function(other) {
- return other instanceof Repeat ?
- is(this._value, other._value) :
- deepEqual(other);
- };
-
-
- var EMPTY_REPEAT;
-
- function invariant(condition, error) {
- if (!condition) throw new Error(error);
- }
-
- createClass(Range, IndexedSeq);
-
- function Range(start, end, step) {
- if (!(this instanceof Range)) {
- return new Range(start, end, step);
- }
- invariant(step !== 0, 'Cannot step a Range by 0');
- start = start || 0;
- if (end === undefined) {
- end = Infinity;
- }
- step = step === undefined ? 1 : Math.abs(step);
- if (end < start) {
- step = -step;
- }
- this._start = start;
- this._end = end;
- this._step = step;
- this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
- if (this.size === 0) {
- if (EMPTY_RANGE) {
- return EMPTY_RANGE;
- }
- EMPTY_RANGE = this;
- }
- }
-
- Range.prototype.toString = function() {
- if (this.size === 0) {
- return 'Range []';
- }
- return 'Range [ ' +
- this._start + '...' + this._end +
- (this._step > 1 ? ' by ' + this._step : '') +
- ' ]';
- };
-
- Range.prototype.get = function(index, notSetValue) {
- return this.has(index) ?
- this._start + wrapIndex(this, index) * this._step :
- notSetValue;
- };
-
- Range.prototype.includes = function(searchValue) {
- var possibleIndex = (searchValue - this._start) / this._step;
- return possibleIndex >= 0 &&
- possibleIndex < this.size &&
- possibleIndex === Math.floor(possibleIndex);
- };
-
- Range.prototype.slice = function(begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- begin = resolveBegin(begin, this.size);
- end = resolveEnd(end, this.size);
- if (end <= begin) {
- return new Range(0, 0);
- }
- return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
- };
-
- Range.prototype.indexOf = function(searchValue) {
- var offsetValue = searchValue - this._start;
- if (offsetValue % this._step === 0) {
- var index = offsetValue / this._step;
- if (index >= 0 && index < this.size) {
- return index
- }
- }
- return -1;
- };
-
- Range.prototype.lastIndexOf = function(searchValue) {
- return this.indexOf(searchValue);
- };
-
- Range.prototype.__iterate = function(fn, reverse) {
- var maxIndex = this.size - 1;
- var step = this._step;
- var value = reverse ? this._start + maxIndex * step : this._start;
- for (var ii = 0; ii <= maxIndex; ii++) {
- if (fn(value, ii, this) === false) {
- return ii + 1;
- }
- value += reverse ? -step : step;
- }
- return ii;
- };
-
- Range.prototype.__iterator = function(type, reverse) {
- var maxIndex = this.size - 1;
- var step = this._step;
- var value = reverse ? this._start + maxIndex * step : this._start;
- var ii = 0;
- return new Iterator(function() {
- var v = value;
- value += reverse ? -step : step;
- return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
- });
- };
-
- Range.prototype.equals = function(other) {
- return other instanceof Range ?
- this._start === other._start &&
- this._end === other._end &&
- this._step === other._step :
- deepEqual(this, other);
- };
-
-
- var EMPTY_RANGE;
-
- createClass(Collection, Iterable);
- function Collection() {
- throw TypeError('Abstract');
- }
-
-
- createClass(KeyedCollection, Collection);function KeyedCollection() {}
-
- createClass(IndexedCollection, Collection);function IndexedCollection() {}
-
- createClass(SetCollection, Collection);function SetCollection() {}
-
-
- Collection.Keyed = KeyedCollection;
- Collection.Indexed = IndexedCollection;
- Collection.Set = SetCollection;
-
- var imul =
- typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?
- Math.imul :
- function imul(a, b) {
- a = a | 0; // int
- b = b | 0; // int
- var c = a & 0xffff;
- var d = b & 0xffff;
- // Shift by 0 fixes the sign on the high part.
- return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int
- };
-
- // v8 has an optimization for storing 31-bit signed numbers.
- // Values which have either 00 or 11 as the high order bits qualify.
- // This function drops the highest order bit in a signed number, maintaining
- // the sign bit.
- function smi(i32) {
- return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);
- }
-
- function hash(o) {
- if (o === false || o === null || o === undefined) {
- return 0;
- }
- if (typeof o.valueOf === 'function') {
- o = o.valueOf();
- if (o === false || o === null || o === undefined) {
- return 0;
- }
- }
- if (o === true) {
- return 1;
- }
- var type = typeof o;
- if (type === 'number') {
- var h = o | 0;
- if (h !== o) {
- h ^= o * 0xFFFFFFFF;
- }
- while (o > 0xFFFFFFFF) {
- o /= 0xFFFFFFFF;
- h ^= o;
- }
- return smi(h);
- }
- if (type === 'string') {
- return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
- }
- if (typeof o.hashCode === 'function') {
- return o.hashCode();
- }
- if (type === 'object') {
- return hashJSObj(o);
- }
- if (typeof o.toString === 'function') {
- return hashString(o.toString());
- }
- throw new Error('Value type ' + type + ' cannot be hashed.');
- }
-
- function cachedHashString(string) {
- var hash = stringHashCache[string];
- if (hash === undefined) {
- hash = hashString(string);
- if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
- STRING_HASH_CACHE_SIZE = 0;
- stringHashCache = {};
- }
- STRING_HASH_CACHE_SIZE++;
- stringHashCache[string] = hash;
- }
- return hash;
- }
-
- // http://jsperf.com/hashing-strings
- function hashString(string) {
- // This is the hash from JVM
- // The hash code for a string is computed as
- // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
- // where s[i] is the ith character of the string and n is the length of
- // the string. We "mod" the result to make it between 0 (inclusive) and 2^31
- // (exclusive) by dropping high bits.
- var hash = 0;
- for (var ii = 0; ii < string.length; ii++) {
- hash = 31 * hash + string.charCodeAt(ii) | 0;
- }
- return smi(hash);
- }
-
- function hashJSObj(obj) {
- var hash;
- if (usingWeakMap) {
- hash = weakMap.get(obj);
- if (hash !== undefined) {
- return hash;
- }
- }
-
- hash = obj[UID_HASH_KEY];
- if (hash !== undefined) {
- return hash;
- }
-
- if (!canDefineProperty) {
- hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
- if (hash !== undefined) {
- return hash;
- }
-
- hash = getIENodeHash(obj);
- if (hash !== undefined) {
- return hash;
- }
- }
-
- hash = ++objHashUID;
- if (objHashUID & 0x40000000) {
- objHashUID = 0;
- }
-
- if (usingWeakMap) {
- weakMap.set(obj, hash);
- } else if (isExtensible !== undefined && isExtensible(obj) === false) {
- throw new Error('Non-extensible objects are not allowed as keys.');
- } else if (canDefineProperty) {
- Object.defineProperty(obj, UID_HASH_KEY, {
- 'enumerable': false,
- 'configurable': false,
- 'writable': false,
- 'value': hash
- });
- } else if (obj.propertyIsEnumerable !== undefined &&
- obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
- // Since we can't define a non-enumerable property on the object
- // we'll hijack one of the less-used non-enumerable properties to
- // save our hash on it. Since this is a function it will not show up in
- // `JSON.stringify` which is what we want.
- obj.propertyIsEnumerable = function() {
- return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
- };
- obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
- } else if (obj.nodeType !== undefined) {
- // At this point we couldn't get the IE `uniqueID` to use as a hash
- // and we couldn't use a non-enumerable property to exploit the
- // dontEnum bug so we simply add the `UID_HASH_KEY` on the node
- // itself.
- obj[UID_HASH_KEY] = hash;
- } else {
- throw new Error('Unable to set a non-enumerable property on object.');
- }
-
- return hash;
- }
-
- // Get references to ES5 object methods.
- var isExtensible = Object.isExtensible;
-
- // True if Object.defineProperty works as expected. IE8 fails this test.
- var canDefineProperty = (function() {
- try {
- Object.defineProperty({}, '@', {});
- return true;
- } catch (e) {
- return false;
- }
- }());
-
- // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
- // and avoid memory leaks from the IE cloneNode bug.
- function getIENodeHash(node) {
- if (node && node.nodeType > 0) {
- switch (node.nodeType) {
- case 1: // Element
- return node.uniqueID;
- case 9: // Document
- return node.documentElement && node.documentElement.uniqueID;
- }
- }
- }
-
- // If possible, use a WeakMap.
- var usingWeakMap = typeof WeakMap === 'function';
- var weakMap;
- if (usingWeakMap) {
- weakMap = new WeakMap();
- }
-
- var objHashUID = 0;
-
- var UID_HASH_KEY = '__immutablehash__';
- if (typeof Symbol === 'function') {
- UID_HASH_KEY = Symbol(UID_HASH_KEY);
- }
-
- var STRING_HASH_CACHE_MIN_STRLEN = 16;
- var STRING_HASH_CACHE_MAX_SIZE = 255;
- var STRING_HASH_CACHE_SIZE = 0;
- var stringHashCache = {};
-
- function assertNotInfinite(size) {
- invariant(
- size !== Infinity,
- 'Cannot perform this action with an infinite size.'
- );
- }
-
- createClass(Map, KeyedCollection);
-
- // @pragma Construction
-
- function Map(value) {
- return value === null || value === undefined ? emptyMap() :
- isMap(value) && !isOrdered(value) ? value :
- emptyMap().withMutations(function(map ) {
- var iter = KeyedIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v, k) {return map.set(k, v)});
- });
- }
-
- Map.prototype.toString = function() {
- return this.__toString('Map {', '}');
- };
-
- // @pragma Access
-
- Map.prototype.get = function(k, notSetValue) {
- return this._root ?
- this._root.get(0, undefined, k, notSetValue) :
- notSetValue;
- };
-
- // @pragma Modification
-
- Map.prototype.set = function(k, v) {
- return updateMap(this, k, v);
- };
-
- Map.prototype.setIn = function(keyPath, v) {
- return this.updateIn(keyPath, NOT_SET, function() {return v});
- };
-
- Map.prototype.remove = function(k) {
- return updateMap(this, k, NOT_SET);
- };
-
- Map.prototype.deleteIn = function(keyPath) {
- return this.updateIn(keyPath, function() {return NOT_SET});
- };
-
- Map.prototype.update = function(k, notSetValue, updater) {
- return arguments.length === 1 ?
- k(this) :
- this.updateIn([k], notSetValue, updater);
- };
-
- Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
- if (!updater) {
- updater = notSetValue;
- notSetValue = undefined;
- }
- var updatedValue = updateInDeepMap(
- this,
- forceIterator(keyPath),
- notSetValue,
- updater
- );
- return updatedValue === NOT_SET ? undefined : updatedValue;
- };
-
- Map.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._root = null;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyMap();
- };
-
- // @pragma Composition
-
- Map.prototype.merge = function(/*...iters*/) {
- return mergeIntoMapWith(this, undefined, arguments);
- };
-
- Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoMapWith(this, merger, iters);
- };
-
- Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
- return this.updateIn(
- keyPath,
- emptyMap(),
- function(m ) {return typeof m.merge === 'function' ?
- m.merge.apply(m, iters) :
- iters[iters.length - 1]}
- );
- };
-
- Map.prototype.mergeDeep = function(/*...iters*/) {
- return mergeIntoMapWith(this, deepMerger, arguments);
- };
-
- Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoMapWith(this, deepMergerWith(merger), iters);
- };
-
- Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
- return this.updateIn(
- keyPath,
- emptyMap(),
- function(m ) {return typeof m.mergeDeep === 'function' ?
- m.mergeDeep.apply(m, iters) :
- iters[iters.length - 1]}
- );
- };
-
- Map.prototype.sort = function(comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator));
- };
-
- Map.prototype.sortBy = function(mapper, comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator, mapper));
- };
-
- // @pragma Mutability
-
- Map.prototype.withMutations = function(fn) {
- var mutable = this.asMutable();
- fn(mutable);
- return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
- };
-
- Map.prototype.asMutable = function() {
- return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
- };
-
- Map.prototype.asImmutable = function() {
- return this.__ensureOwner();
- };
-
- Map.prototype.wasAltered = function() {
- return this.__altered;
- };
-
- Map.prototype.__iterator = function(type, reverse) {
- return new MapIterator(this, type, reverse);
- };
-
- Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- this._root && this._root.iterate(function(entry ) {
- iterations++;
- return fn(entry[1], entry[0], this$0);
- }, reverse);
- return iterations;
- };
-
- Map.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeMap(this.size, this._root, ownerID, this.__hash);
- };
-
-
- function isMap(maybeMap) {
- return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
- }
-
- Map.isMap = isMap;
-
- var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
-
- var MapPrototype = Map.prototype;
- MapPrototype[IS_MAP_SENTINEL] = true;
- MapPrototype[DELETE] = MapPrototype.remove;
- MapPrototype.removeIn = MapPrototype.deleteIn;
-
-
- // #pragma Trie Nodes
-
-
-
- function ArrayMapNode(ownerID, entries) {
- this.ownerID = ownerID;
- this.entries = entries;
- }
-
- ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
-
- ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
-
- var entries = this.entries;
- var idx = 0;
- for (var len = entries.length; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
-
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
-
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
-
- if (removed && entries.length === 1) {
- return; // undefined
- }
-
- if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
- return createNodes(ownerID, entries, key, value);
- }
-
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
-
- if (exists) {
- if (removed) {
- idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
-
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
-
- return new ArrayMapNode(ownerID, newEntries);
- };
-
-
-
-
- function BitmapIndexedNode(ownerID, bitmap, nodes) {
- this.ownerID = ownerID;
- this.bitmap = bitmap;
- this.nodes = nodes;
- }
-
- BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));
- var bitmap = this.bitmap;
- return (bitmap & bit) === 0 ? notSetValue :
- this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);
- };
-
- BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var bit = 1 << keyHashFrag;
- var bitmap = this.bitmap;
- var exists = (bitmap & bit) !== 0;
-
- if (!exists && value === NOT_SET) {
- return this;
- }
-
- var idx = popCount(bitmap & (bit - 1));
- var nodes = this.nodes;
- var node = exists ? nodes[idx] : undefined;
- var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
-
- if (newNode === node) {
- return this;
- }
-
- if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
- return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
- }
-
- if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
- return nodes[idx ^ 1];
- }
-
- if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
- return newNode;
- }
-
- var isEditable = ownerID && ownerID === this.ownerID;
- var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
- var newNodes = exists ? newNode ?
- setIn(nodes, idx, newNode, isEditable) :
- spliceOut(nodes, idx, isEditable) :
- spliceIn(nodes, idx, newNode, isEditable);
-
- if (isEditable) {
- this.bitmap = newBitmap;
- this.nodes = newNodes;
- return this;
- }
-
- return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
- };
-
-
-
-
- function HashArrayMapNode(ownerID, count, nodes) {
- this.ownerID = ownerID;
- this.count = count;
- this.nodes = nodes;
- }
-
- HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var node = this.nodes[idx];
- return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
- };
-
- HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var removed = value === NOT_SET;
- var nodes = this.nodes;
- var node = nodes[idx];
-
- if (removed && !node) {
- return this;
- }
-
- var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
- if (newNode === node) {
- return this;
- }
-
- var newCount = this.count;
- if (!node) {
- newCount++;
- } else if (!newNode) {
- newCount--;
- if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
- return packNodes(ownerID, nodes, newCount, idx);
- }
- }
-
- var isEditable = ownerID && ownerID === this.ownerID;
- var newNodes = setIn(nodes, idx, newNode, isEditable);
-
- if (isEditable) {
- this.count = newCount;
- this.nodes = newNodes;
- return this;
- }
-
- return new HashArrayMapNode(ownerID, newCount, newNodes);
- };
-
-
-
-
- function HashCollisionNode(ownerID, keyHash, entries) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entries = entries;
- }
-
- HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
-
- HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
-
- var removed = value === NOT_SET;
-
- if (keyHash !== this.keyHash) {
- if (removed) {
- return this;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
- }
-
- var entries = this.entries;
- var idx = 0;
- for (var len = entries.length; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
-
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
-
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
-
- if (removed && len === 2) {
- return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
- }
-
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
-
- if (exists) {
- if (removed) {
- idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
-
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
-
- return new HashCollisionNode(ownerID, this.keyHash, newEntries);
- };
-
-
-
-
- function ValueNode(ownerID, keyHash, entry) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entry = entry;
- }
-
- ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
- };
-
- ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
- var keyMatch = is(key, this.entry[0]);
- if (keyMatch ? value === this.entry[1] : removed) {
- return this;
- }
-
- SetRef(didAlter);
-
- if (removed) {
- SetRef(didChangeSize);
- return; // undefined
- }
-
- if (keyMatch) {
- if (ownerID && ownerID === this.ownerID) {
- this.entry[1] = value;
- return this;
- }
- return new ValueNode(ownerID, this.keyHash, [key, value]);
- }
-
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
- };
-
-
-
- // #pragma Iterators
-
- ArrayMapNode.prototype.iterate =
- HashCollisionNode.prototype.iterate = function (fn, reverse) {
- var entries = this.entries;
- for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
- if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
- return false;
- }
- }
- }
-
- BitmapIndexedNode.prototype.iterate =
- HashArrayMapNode.prototype.iterate = function (fn, reverse) {
- var nodes = this.nodes;
- for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
- var node = nodes[reverse ? maxIndex - ii : ii];
- if (node && node.iterate(fn, reverse) === false) {
- return false;
- }
- }
- }
-
- ValueNode.prototype.iterate = function (fn, reverse) {
- return fn(this.entry);
- }
-
- createClass(MapIterator, Iterator);
-
- function MapIterator(map, type, reverse) {
- this._type = type;
- this._reverse = reverse;
- this._stack = map._root && mapIteratorFrame(map._root);
- }
-
- MapIterator.prototype.next = function() {
- var type = this._type;
- var stack = this._stack;
- while (stack) {
- var node = stack.node;
- var index = stack.index++;
- var maxIndex;
- if (node.entry) {
- if (index === 0) {
- return mapIteratorValue(type, node.entry);
- }
- } else if (node.entries) {
- maxIndex = node.entries.length - 1;
- if (index <= maxIndex) {
- return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
- }
- } else {
- maxIndex = node.nodes.length - 1;
- if (index <= maxIndex) {
- var subNode = node.nodes[this._reverse ? maxIndex - index : index];
- if (subNode) {
- if (subNode.entry) {
- return mapIteratorValue(type, subNode.entry);
- }
- stack = this._stack = mapIteratorFrame(subNode, stack);
- }
- continue;
- }
- }
- stack = this._stack = this._stack.__prev;
- }
- return iteratorDone();
- };
-
-
- function mapIteratorValue(type, entry) {
- return iteratorValue(type, entry[0], entry[1]);
- }
-
- function mapIteratorFrame(node, prev) {
- return {
- node: node,
- index: 0,
- __prev: prev
- };
- }
-
- function makeMap(size, root, ownerID, hash) {
- var map = Object.create(MapPrototype);
- map.size = size;
- map._root = root;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
-
- var EMPTY_MAP;
- function emptyMap() {
- return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
- }
-
- function updateMap(map, k, v) {
- var newRoot;
- var newSize;
- if (!map._root) {
- if (v === NOT_SET) {
- return map;
- }
- newSize = 1;
- newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
- } else {
- var didChangeSize = MakeRef(CHANGE_LENGTH);
- var didAlter = MakeRef(DID_ALTER);
- newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
- if (!didAlter.value) {
- return map;
- }
- newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
- }
- if (map.__ownerID) {
- map.size = newSize;
- map._root = newRoot;
- map.__hash = undefined;
- map.__altered = true;
- return map;
- }
- return newRoot ? makeMap(newSize, newRoot) : emptyMap();
- }
-
- function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (!node) {
- if (value === NOT_SET) {
- return node;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return new ValueNode(ownerID, keyHash, [key, value]);
- }
- return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
- }
-
- function isLeafNode(node) {
- return node.constructor === ValueNode || node.constructor === HashCollisionNode;
- }
-
- function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
- if (node.keyHash === keyHash) {
- return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
- }
-
- var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
- var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
-
- var newNode;
- var nodes = idx1 === idx2 ?
- [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :
- ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);
-
- return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
- }
-
- function createNodes(ownerID, entries, key, value) {
- if (!ownerID) {
- ownerID = new OwnerID();
- }
- var node = new ValueNode(ownerID, hash(key), [key, value]);
- for (var ii = 0; ii < entries.length; ii++) {
- var entry = entries[ii];
- node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
- }
- return node;
- }
-
- function packNodes(ownerID, nodes, count, excluding) {
- var bitmap = 0;
- var packedII = 0;
- var packedNodes = new Array(count);
- for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
- var node = nodes[ii];
- if (node !== undefined && ii !== excluding) {
- bitmap |= bit;
- packedNodes[packedII++] = node;
- }
- }
- return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
- }
-
- function expandNodes(ownerID, nodes, bitmap, including, node) {
- var count = 0;
- var expandedNodes = new Array(SIZE);
- for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
- expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
- }
- expandedNodes[including] = node;
- return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
- }
-
- function mergeIntoMapWith(map, merger, iterables) {
- var iters = [];
- for (var ii = 0; ii < iterables.length; ii++) {
- var value = iterables[ii];
- var iter = KeyedIterable(value);
- if (!isIterable(value)) {
- iter = iter.map(function(v ) {return fromJS(v)});
- }
- iters.push(iter);
- }
- return mergeIntoCollectionWith(map, merger, iters);
- }
-
- function deepMerger(existing, value, key) {
- return existing && existing.mergeDeep && isIterable(value) ?
- existing.mergeDeep(value) :
- is(existing, value) ? existing : value;
- }
-
- function deepMergerWith(merger) {
- return function(existing, value, key) {
- if (existing && existing.mergeDeepWith && isIterable(value)) {
- return existing.mergeDeepWith(merger, value);
- }
- var nextValue = merger(existing, value, key);
- return is(existing, nextValue) ? existing : nextValue;
- };
- }
-
- function mergeIntoCollectionWith(collection, merger, iters) {
- iters = iters.filter(function(x ) {return x.size !== 0});
- if (iters.length === 0) {
- return collection;
- }
- if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
- return collection.constructor(iters[0]);
- }
- return collection.withMutations(function(collection ) {
- var mergeIntoMap = merger ?
- function(value, key) {
- collection.update(key, NOT_SET, function(existing )
- {return existing === NOT_SET ? value : merger(existing, value, key)}
- );
- } :
- function(value, key) {
- collection.set(key, value);
- }
- for (var ii = 0; ii < iters.length; ii++) {
- iters[ii].forEach(mergeIntoMap);
- }
- });
- }
-
- function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
- var isNotSet = existing === NOT_SET;
- var step = keyPathIter.next();
- if (step.done) {
- var existingValue = isNotSet ? notSetValue : existing;
- var newValue = updater(existingValue);
- return newValue === existingValue ? existing : newValue;
- }
- invariant(
- isNotSet || (existing && existing.set),
- 'invalid keyPath'
- );
- var key = step.value;
- var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
- var nextUpdated = updateInDeepMap(
- nextExisting,
- keyPathIter,
- notSetValue,
- updater
- );
- return nextUpdated === nextExisting ? existing :
- nextUpdated === NOT_SET ? existing.remove(key) :
- (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
- }
-
- function popCount(x) {
- x = x - ((x >> 1) & 0x55555555);
- x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
- x = (x + (x >> 4)) & 0x0f0f0f0f;
- x = x + (x >> 8);
- x = x + (x >> 16);
- return x & 0x7f;
- }
-
- function setIn(array, idx, val, canEdit) {
- var newArray = canEdit ? array : arrCopy(array);
- newArray[idx] = val;
- return newArray;
- }
-
- function spliceIn(array, idx, val, canEdit) {
- var newLen = array.length + 1;
- if (canEdit && idx + 1 === newLen) {
- array[idx] = val;
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- newArray[ii] = val;
- after = -1;
- } else {
- newArray[ii] = array[ii + after];
- }
- }
- return newArray;
- }
-
- function spliceOut(array, idx, canEdit) {
- var newLen = array.length - 1;
- if (canEdit && idx === newLen) {
- array.pop();
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- after = 1;
- }
- newArray[ii] = array[ii + after];
- }
- return newArray;
- }
-
- var MAX_ARRAY_MAP_SIZE = SIZE / 4;
- var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
- var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
-
- createClass(List, IndexedCollection);
-
- // @pragma Construction
-
- function List(value) {
- var empty = emptyList();
- if (value === null || value === undefined) {
- return empty;
- }
- if (isList(value)) {
- return value;
- }
- var iter = IndexedIterable(value);
- var size = iter.size;
- if (size === 0) {
- return empty;
- }
- assertNotInfinite(size);
- if (size > 0 && size < SIZE) {
- return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
- }
- return empty.withMutations(function(list ) {
- list.setSize(size);
- iter.forEach(function(v, i) {return list.set(i, v)});
- });
- }
-
- List.of = function(/*...values*/) {
- return this(arguments);
- };
-
- List.prototype.toString = function() {
- return this.__toString('List [', ']');
- };
-
- // @pragma Access
-
- List.prototype.get = function(index, notSetValue) {
- index = wrapIndex(this, index);
- if (index >= 0 && index < this.size) {
- index += this._origin;
- var node = listNodeFor(this, index);
- return node && node.array[index & MASK];
- }
- return notSetValue;
- };
-
- // @pragma Modification
-
- List.prototype.set = function(index, value) {
- return updateList(this, index, value);
- };
-
- List.prototype.remove = function(index) {
- return !this.has(index) ? this :
- index === 0 ? this.shift() :
- index === this.size - 1 ? this.pop() :
- this.splice(index, 1);
- };
-
- List.prototype.insert = function(index, value) {
- return this.splice(index, 0, value);
- };
-
- List.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = this._origin = this._capacity = 0;
- this._level = SHIFT;
- this._root = this._tail = null;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyList();
- };
-
- List.prototype.push = function(/*...values*/) {
- var values = arguments;
- var oldSize = this.size;
- return this.withMutations(function(list ) {
- setListBounds(list, 0, oldSize + values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(oldSize + ii, values[ii]);
- }
- });
- };
-
- List.prototype.pop = function() {
- return setListBounds(this, 0, -1);
- };
-
- List.prototype.unshift = function(/*...values*/) {
- var values = arguments;
- return this.withMutations(function(list ) {
- setListBounds(list, -values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(ii, values[ii]);
- }
- });
- };
-
- List.prototype.shift = function() {
- return setListBounds(this, 1);
- };
-
- // @pragma Composition
-
- List.prototype.merge = function(/*...iters*/) {
- return mergeIntoListWith(this, undefined, arguments);
- };
-
- List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoListWith(this, merger, iters);
- };
-
- List.prototype.mergeDeep = function(/*...iters*/) {
- return mergeIntoListWith(this, deepMerger, arguments);
- };
-
- List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoListWith(this, deepMergerWith(merger), iters);
- };
-
- List.prototype.setSize = function(size) {
- return setListBounds(this, 0, size);
- };
-
- // @pragma Iteration
-
- List.prototype.slice = function(begin, end) {
- var size = this.size;
- if (wholeSlice(begin, end, size)) {
- return this;
- }
- return setListBounds(
- this,
- resolveBegin(begin, size),
- resolveEnd(end, size)
- );
- };
-
- List.prototype.__iterator = function(type, reverse) {
- var index = 0;
- var values = iterateList(this, reverse);
- return new Iterator(function() {
- var value = values();
- return value === DONE ?
- iteratorDone() :
- iteratorValue(type, index++, value);
- });
- };
-
- List.prototype.__iterate = function(fn, reverse) {
- var index = 0;
- var values = iterateList(this, reverse);
- var value;
- while ((value = values()) !== DONE) {
- if (fn(value, index++, this) === false) {
- break;
- }
- }
- return index;
- };
-
- List.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- return this;
- }
- return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
- };
-
-
- function isList(maybeList) {
- return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
- }
-
- List.isList = isList;
-
- var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
-
- var ListPrototype = List.prototype;
- ListPrototype[IS_LIST_SENTINEL] = true;
- ListPrototype[DELETE] = ListPrototype.remove;
- ListPrototype.setIn = MapPrototype.setIn;
- ListPrototype.deleteIn =
- ListPrototype.removeIn = MapPrototype.removeIn;
- ListPrototype.update = MapPrototype.update;
- ListPrototype.updateIn = MapPrototype.updateIn;
- ListPrototype.mergeIn = MapPrototype.mergeIn;
- ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
- ListPrototype.withMutations = MapPrototype.withMutations;
- ListPrototype.asMutable = MapPrototype.asMutable;
- ListPrototype.asImmutable = MapPrototype.asImmutable;
- ListPrototype.wasAltered = MapPrototype.wasAltered;
-
-
-
- function VNode(array, ownerID) {
- this.array = array;
- this.ownerID = ownerID;
- }
-
- // TODO: seems like these methods are very similar
-
- VNode.prototype.removeBefore = function(ownerID, level, index) {
- if (index === level ? 1 << level : 0 || this.array.length === 0) {
- return this;
- }
- var originIndex = (index >>> level) & MASK;
- if (originIndex >= this.array.length) {
- return new VNode([], ownerID);
- }
- var removingFirst = originIndex === 0;
- var newChild;
- if (level > 0) {
- var oldChild = this.array[originIndex];
- newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
- if (newChild === oldChild && removingFirst) {
- return this;
- }
- }
- if (removingFirst && !newChild) {
- return this;
- }
- var editable = editableVNode(this, ownerID);
- if (!removingFirst) {
- for (var ii = 0; ii < originIndex; ii++) {
- editable.array[ii] = undefined;
- }
- }
- if (newChild) {
- editable.array[originIndex] = newChild;
- }
- return editable;
- };
-
- VNode.prototype.removeAfter = function(ownerID, level, index) {
- if (index === (level ? 1 << level : 0) || this.array.length === 0) {
- return this;
- }
- var sizeIndex = ((index - 1) >>> level) & MASK;
- if (sizeIndex >= this.array.length) {
- return this;
- }
-
- var newChild;
- if (level > 0) {
- var oldChild = this.array[sizeIndex];
- newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
- if (newChild === oldChild && sizeIndex === this.array.length - 1) {
- return this;
- }
- }
-
- var editable = editableVNode(this, ownerID);
- editable.array.splice(sizeIndex + 1);
- if (newChild) {
- editable.array[sizeIndex] = newChild;
- }
- return editable;
- };
-
-
-
- var DONE = {};
-
- function iterateList(list, reverse) {
- var left = list._origin;
- var right = list._capacity;
- var tailPos = getTailOffset(right);
- var tail = list._tail;
-
- return iterateNodeOrLeaf(list._root, list._level, 0);
-
- function iterateNodeOrLeaf(node, level, offset) {
- return level === 0 ?
- iterateLeaf(node, offset) :
- iterateNode(node, level, offset);
- }
-
- function iterateLeaf(node, offset) {
- var array = offset === tailPos ? tail && tail.array : node && node.array;
- var from = offset > left ? 0 : left - offset;
- var to = right - offset;
- if (to > SIZE) {
- to = SIZE;
- }
- return function() {
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- return array && array[idx];
- };
- }
-
- function iterateNode(node, level, offset) {
- var values;
- var array = node && node.array;
- var from = offset > left ? 0 : (left - offset) >> level;
- var to = ((right - offset) >> level) + 1;
- if (to > SIZE) {
- to = SIZE;
- }
- return function() {
- do {
- if (values) {
- var value = values();
- if (value !== DONE) {
- return value;
- }
- values = null;
- }
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- values = iterateNodeOrLeaf(
- array && array[idx], level - SHIFT, offset + (idx << level)
- );
- } while (true);
- };
- }
- }
-
- function makeList(origin, capacity, level, root, tail, ownerID, hash) {
- var list = Object.create(ListPrototype);
- list.size = capacity - origin;
- list._origin = origin;
- list._capacity = capacity;
- list._level = level;
- list._root = root;
- list._tail = tail;
- list.__ownerID = ownerID;
- list.__hash = hash;
- list.__altered = false;
- return list;
- }
-
- var EMPTY_LIST;
- function emptyList() {
- return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
- }
-
- function updateList(list, index, value) {
- index = wrapIndex(list, index);
-
- if (index !== index) {
- return list;
- }
-
- if (index >= list.size || index < 0) {
- return list.withMutations(function(list ) {
- index < 0 ?
- setListBounds(list, index).set(0, value) :
- setListBounds(list, 0, index + 1).set(index, value)
- });
- }
-
- index += list._origin;
-
- var newTail = list._tail;
- var newRoot = list._root;
- var didAlter = MakeRef(DID_ALTER);
- if (index >= getTailOffset(list._capacity)) {
- newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
- } else {
- newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
- }
-
- if (!didAlter.value) {
- return list;
- }
-
- if (list.__ownerID) {
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
- }
-
- function updateVNode(node, ownerID, level, index, value, didAlter) {
- var idx = (index >>> level) & MASK;
- var nodeHas = node && idx < node.array.length;
- if (!nodeHas && value === undefined) {
- return node;
- }
-
- var newNode;
-
- if (level > 0) {
- var lowerNode = node && node.array[idx];
- var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
- if (newLowerNode === lowerNode) {
- return node;
- }
- newNode = editableVNode(node, ownerID);
- newNode.array[idx] = newLowerNode;
- return newNode;
- }
-
- if (nodeHas && node.array[idx] === value) {
- return node;
- }
-
- SetRef(didAlter);
-
- newNode = editableVNode(node, ownerID);
- if (value === undefined && idx === newNode.array.length - 1) {
- newNode.array.pop();
- } else {
- newNode.array[idx] = value;
- }
- return newNode;
- }
-
- function editableVNode(node, ownerID) {
- if (ownerID && node && ownerID === node.ownerID) {
- return node;
- }
- return new VNode(node ? node.array.slice() : [], ownerID);
- }
-
- function listNodeFor(list, rawIndex) {
- if (rawIndex >= getTailOffset(list._capacity)) {
- return list._tail;
- }
- if (rawIndex < 1 << (list._level + SHIFT)) {
- var node = list._root;
- var level = list._level;
- while (node && level > 0) {
- node = node.array[(rawIndex >>> level) & MASK];
- level -= SHIFT;
- }
- return node;
- }
- }
-
- function setListBounds(list, begin, end) {
- // Sanitize begin & end using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- if (begin !== undefined) {
- begin = begin | 0;
- }
- if (end !== undefined) {
- end = end | 0;
- }
- var owner = list.__ownerID || new OwnerID();
- var oldOrigin = list._origin;
- var oldCapacity = list._capacity;
- var newOrigin = oldOrigin + begin;
- var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
- if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
- return list;
- }
-
- // If it's going to end after it starts, it's empty.
- if (newOrigin >= newCapacity) {
- return list.clear();
- }
-
- var newLevel = list._level;
- var newRoot = list._root;
-
- // New origin might need creating a higher root.
- var offsetShift = 0;
- while (newOrigin + offsetShift < 0) {
- newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);
- newLevel += SHIFT;
- offsetShift += 1 << newLevel;
- }
- if (offsetShift) {
- newOrigin += offsetShift;
- oldOrigin += offsetShift;
- newCapacity += offsetShift;
- oldCapacity += offsetShift;
- }
-
- var oldTailOffset = getTailOffset(oldCapacity);
- var newTailOffset = getTailOffset(newCapacity);
-
- // New size might need creating a higher root.
- while (newTailOffset >= 1 << (newLevel + SHIFT)) {
- newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);
- newLevel += SHIFT;
- }
-
- // Locate or create the new tail.
- var oldTail = list._tail;
- var newTail = newTailOffset < oldTailOffset ?
- listNodeFor(list, newCapacity - 1) :
- newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
-
- // Merge Tail into tree.
- if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
- newRoot = editableVNode(newRoot, owner);
- var node = newRoot;
- for (var level = newLevel; level > SHIFT; level -= SHIFT) {
- var idx = (oldTailOffset >>> level) & MASK;
- node = node.array[idx] = editableVNode(node.array[idx], owner);
- }
- node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
- }
-
- // If the size has been reduced, there's a chance the tail needs to be trimmed.
- if (newCapacity < oldCapacity) {
- newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
- }
-
- // If the new origin is within the tail, then we do not need a root.
- if (newOrigin >= newTailOffset) {
- newOrigin -= newTailOffset;
- newCapacity -= newTailOffset;
- newLevel = SHIFT;
- newRoot = null;
- newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
-
- // Otherwise, if the root has been trimmed, garbage collect.
- } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
- offsetShift = 0;
-
- // Identify the new top root node of the subtree of the old root.
- while (newRoot) {
- var beginIndex = (newOrigin >>> newLevel) & MASK;
- if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {
- break;
- }
- if (beginIndex) {
- offsetShift += (1 << newLevel) * beginIndex;
- }
- newLevel -= SHIFT;
- newRoot = newRoot.array[beginIndex];
- }
-
- // Trim the new sides of the new root.
- if (newRoot && newOrigin > oldOrigin) {
- newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
- }
- if (newRoot && newTailOffset < oldTailOffset) {
- newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
- }
- if (offsetShift) {
- newOrigin -= offsetShift;
- newCapacity -= offsetShift;
- }
- }
-
- if (list.__ownerID) {
- list.size = newCapacity - newOrigin;
- list._origin = newOrigin;
- list._capacity = newCapacity;
- list._level = newLevel;
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
- }
-
- function mergeIntoListWith(list, merger, iterables) {
- var iters = [];
- var maxSize = 0;
- for (var ii = 0; ii < iterables.length; ii++) {
- var value = iterables[ii];
- var iter = IndexedIterable(value);
- if (iter.size > maxSize) {
- maxSize = iter.size;
- }
- if (!isIterable(value)) {
- iter = iter.map(function(v ) {return fromJS(v)});
- }
- iters.push(iter);
- }
- if (maxSize > list.size) {
- list = list.setSize(maxSize);
- }
- return mergeIntoCollectionWith(list, merger, iters);
- }
-
- function getTailOffset(size) {
- return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);
- }
-
- createClass(OrderedMap, Map);
-
- // @pragma Construction
-
- function OrderedMap(value) {
- return value === null || value === undefined ? emptyOrderedMap() :
- isOrderedMap(value) ? value :
- emptyOrderedMap().withMutations(function(map ) {
- var iter = KeyedIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v, k) {return map.set(k, v)});
- });
- }
-
- OrderedMap.of = function(/*...values*/) {
- return this(arguments);
- };
-
- OrderedMap.prototype.toString = function() {
- return this.__toString('OrderedMap {', '}');
- };
-
- // @pragma Access
-
- OrderedMap.prototype.get = function(k, notSetValue) {
- var index = this._map.get(k);
- return index !== undefined ? this._list.get(index)[1] : notSetValue;
- };
-
- // @pragma Modification
-
- OrderedMap.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._map.clear();
- this._list.clear();
- return this;
- }
- return emptyOrderedMap();
- };
-
- OrderedMap.prototype.set = function(k, v) {
- return updateOrderedMap(this, k, v);
- };
-
- OrderedMap.prototype.remove = function(k) {
- return updateOrderedMap(this, k, NOT_SET);
- };
-
- OrderedMap.prototype.wasAltered = function() {
- return this._map.wasAltered() || this._list.wasAltered();
- };
-
- OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._list.__iterate(
- function(entry ) {return entry && fn(entry[1], entry[0], this$0)},
- reverse
- );
- };
-
- OrderedMap.prototype.__iterator = function(type, reverse) {
- return this._list.fromEntrySeq().__iterator(type, reverse);
- };
-
- OrderedMap.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- var newList = this._list.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- this._list = newList;
- return this;
- }
- return makeOrderedMap(newMap, newList, ownerID, this.__hash);
- };
-
-
- function isOrderedMap(maybeOrderedMap) {
- return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
- }
-
- OrderedMap.isOrderedMap = isOrderedMap;
-
- OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
- OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
-
-
-
- function makeOrderedMap(map, list, ownerID, hash) {
- var omap = Object.create(OrderedMap.prototype);
- omap.size = map ? map.size : 0;
- omap._map = map;
- omap._list = list;
- omap.__ownerID = ownerID;
- omap.__hash = hash;
- return omap;
- }
-
- var EMPTY_ORDERED_MAP;
- function emptyOrderedMap() {
- return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
- }
-
- function updateOrderedMap(omap, k, v) {
- var map = omap._map;
- var list = omap._list;
- var i = map.get(k);
- var has = i !== undefined;
- var newMap;
- var newList;
- if (v === NOT_SET) { // removed
- if (!has) {
- return omap;
- }
- if (list.size >= SIZE && list.size >= map.size * 2) {
- newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx});
- newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();
- if (omap.__ownerID) {
- newMap.__ownerID = newList.__ownerID = omap.__ownerID;
- }
- } else {
- newMap = map.remove(k);
- newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
- }
- } else {
- if (has) {
- if (v === list.get(i)[1]) {
- return omap;
- }
- newMap = map;
- newList = list.set(i, [k, v]);
- } else {
- newMap = map.set(k, list.size);
- newList = list.set(list.size, [k, v]);
- }
- }
- if (omap.__ownerID) {
- omap.size = newMap.size;
- omap._map = newMap;
- omap._list = newList;
- omap.__hash = undefined;
- return omap;
- }
- return makeOrderedMap(newMap, newList);
- }
-
- createClass(ToKeyedSequence, KeyedSeq);
- function ToKeyedSequence(indexed, useKeys) {
- this._iter = indexed;
- this._useKeys = useKeys;
- this.size = indexed.size;
- }
-
- ToKeyedSequence.prototype.get = function(key, notSetValue) {
- return this._iter.get(key, notSetValue);
- };
-
- ToKeyedSequence.prototype.has = function(key) {
- return this._iter.has(key);
- };
-
- ToKeyedSequence.prototype.valueSeq = function() {
- return this._iter.valueSeq();
- };
-
- ToKeyedSequence.prototype.reverse = function() {var this$0 = this;
- var reversedSequence = reverseFactory(this, true);
- if (!this._useKeys) {
- reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()};
- }
- return reversedSequence;
- };
-
- ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;
- var mappedSequence = mapFactory(this, mapper, context);
- if (!this._useKeys) {
- mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)};
- }
- return mappedSequence;
- };
-
- ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var ii;
- return this._iter.__iterate(
- this._useKeys ?
- function(v, k) {return fn(v, k, this$0)} :
- ((ii = reverse ? resolveSize(this) : 0),
- function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),
- reverse
- );
- };
-
- ToKeyedSequence.prototype.__iterator = function(type, reverse) {
- if (this._useKeys) {
- return this._iter.__iterator(type, reverse);
- }
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- var ii = reverse ? resolveSize(this) : 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, reverse ? --ii : ii++, step.value, step);
- });
- };
-
- ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;
-
-
- createClass(ToIndexedSequence, IndexedSeq);
- function ToIndexedSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
-
- ToIndexedSequence.prototype.includes = function(value) {
- return this._iter.includes(value);
- };
-
- ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);
- };
-
- ToIndexedSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- var iterations = 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, iterations++, step.value, step)
- });
- };
-
-
-
- createClass(ToSetSequence, SetSeq);
- function ToSetSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
-
- ToSetSequence.prototype.has = function(key) {
- return this._iter.includes(key);
- };
-
- ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);
- };
-
- ToSetSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, step.value, step.value, step);
- });
- };
-
-
-
- createClass(FromEntriesSequence, KeyedSeq);
- function FromEntriesSequence(entries) {
- this._iter = entries;
- this.size = entries.size;
- }
-
- FromEntriesSequence.prototype.entrySeq = function() {
- return this._iter.toSeq();
- };
-
- FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._iter.__iterate(function(entry ) {
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedIterable = isIterable(entry);
- return fn(
- indexedIterable ? entry.get(1) : entry[1],
- indexedIterable ? entry.get(0) : entry[0],
- this$0
- );
- }
- }, reverse);
- };
-
- FromEntriesSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function() {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedIterable = isIterable(entry);
- return iteratorValue(
- type,
- indexedIterable ? entry.get(0) : entry[0],
- indexedIterable ? entry.get(1) : entry[1],
- step
- );
- }
- }
- });
- };
-
-
- ToIndexedSequence.prototype.cacheResult =
- ToKeyedSequence.prototype.cacheResult =
- ToSetSequence.prototype.cacheResult =
- FromEntriesSequence.prototype.cacheResult =
- cacheResultThrough;
-
-
- function flipFactory(iterable) {
- var flipSequence = makeSequence(iterable);
- flipSequence._iter = iterable;
- flipSequence.size = iterable.size;
- flipSequence.flip = function() {return iterable};
- flipSequence.reverse = function () {
- var reversedSequence = iterable.reverse.apply(this); // super.reverse()
- reversedSequence.flip = function() {return iterable.reverse()};
- return reversedSequence;
- };
- flipSequence.has = function(key ) {return iterable.includes(key)};
- flipSequence.includes = function(key ) {return iterable.has(key)};
- flipSequence.cacheResult = cacheResultThrough;
- flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse);
- }
- flipSequence.__iteratorUncached = function(type, reverse) {
- if (type === ITERATE_ENTRIES) {
- var iterator = iterable.__iterator(type, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- if (!step.done) {
- var k = step.value[0];
- step.value[0] = step.value[1];
- step.value[1] = k;
- }
- return step;
- });
- }
- return iterable.__iterator(
- type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
- reverse
- );
- }
- return flipSequence;
- }
-
-
- function mapFactory(iterable, mapper, context) {
- var mappedSequence = makeSequence(iterable);
- mappedSequence.size = iterable.size;
- mappedSequence.has = function(key ) {return iterable.has(key)};
- mappedSequence.get = function(key, notSetValue) {
- var v = iterable.get(key, NOT_SET);
- return v === NOT_SET ?
- notSetValue :
- mapper.call(context, v, key, iterable);
- };
- mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(
- function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false},
- reverse
- );
- }
- mappedSequence.__iteratorUncached = function (type, reverse) {
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- return iteratorValue(
- type,
- key,
- mapper.call(context, entry[1], key, iterable),
- step
- );
- });
- }
- return mappedSequence;
- }
-
-
- function reverseFactory(iterable, useKeys) {
- var reversedSequence = makeSequence(iterable);
- reversedSequence._iter = iterable;
- reversedSequence.size = iterable.size;
- reversedSequence.reverse = function() {return iterable};
- if (iterable.flip) {
- reversedSequence.flip = function () {
- var flipSequence = flipFactory(iterable);
- flipSequence.reverse = function() {return iterable.flip()};
- return flipSequence;
- };
- }
- reversedSequence.get = function(key, notSetValue)
- {return iterable.get(useKeys ? key : -1 - key, notSetValue)};
- reversedSequence.has = function(key )
- {return iterable.has(useKeys ? key : -1 - key)};
- reversedSequence.includes = function(value ) {return iterable.includes(value)};
- reversedSequence.cacheResult = cacheResultThrough;
- reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse);
- };
- reversedSequence.__iterator =
- function(type, reverse) {return iterable.__iterator(type, !reverse)};
- return reversedSequence;
- }
-
-
- function filterFactory(iterable, predicate, context, useKeys) {
- var filterSequence = makeSequence(iterable);
- if (useKeys) {
- filterSequence.has = function(key ) {
- var v = iterable.get(key, NOT_SET);
- return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
- };
- filterSequence.get = function(key, notSetValue) {
- var v = iterable.get(key, NOT_SET);
- return v !== NOT_SET && predicate.call(context, v, key, iterable) ?
- v : notSetValue;
- };
- }
- filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- var iterations = 0;
- iterable.__iterate(function(v, k, c) {
- if (predicate.call(context, v, k, c)) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0);
- }
- }, reverse);
- return iterations;
- };
- filterSequence.__iteratorUncached = function (type, reverse) {
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var iterations = 0;
- return new Iterator(function() {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- var value = entry[1];
- if (predicate.call(context, value, key, iterable)) {
- return iteratorValue(type, useKeys ? key : iterations++, value, step);
- }
- }
- });
- }
- return filterSequence;
- }
-
-
- function countByFactory(iterable, grouper, context) {
- var groups = Map().asMutable();
- iterable.__iterate(function(v, k) {
- groups.update(
- grouper.call(context, v, k, iterable),
- 0,
- function(a ) {return a + 1}
- );
- });
- return groups.asImmutable();
- }
-
-
- function groupByFactory(iterable, grouper, context) {
- var isKeyedIter = isKeyed(iterable);
- var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
- iterable.__iterate(function(v, k) {
- groups.update(
- grouper.call(context, v, k, iterable),
- function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}
- );
- });
- var coerce = iterableClass(iterable);
- return groups.map(function(arr ) {return reify(iterable, coerce(arr))});
- }
-
-
- function sliceFactory(iterable, begin, end, useKeys) {
- var originalSize = iterable.size;
-
- // Sanitize begin & end using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- if (begin !== undefined) {
- begin = begin | 0;
- }
- if (end !== undefined) {
- end = end | 0;
- }
-
- if (wholeSlice(begin, end, originalSize)) {
- return iterable;
- }
-
- var resolvedBegin = resolveBegin(begin, originalSize);
- var resolvedEnd = resolveEnd(end, originalSize);
-
- // begin or end will be NaN if they were provided as negative numbers and
- // this iterable's size is unknown. In that case, cache first so there is
- // a known size and these do not resolve to NaN.
- if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
- return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
- }
-
- // Note: resolvedEnd is undefined when the original sequence's length is
- // unknown and this slice did not supply an end and should contain all
- // elements after resolvedBegin.
- // In that case, resolvedSize will be NaN and sliceSize will remain undefined.
- var resolvedSize = resolvedEnd - resolvedBegin;
- var sliceSize;
- if (resolvedSize === resolvedSize) {
- sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
- }
-
- var sliceSeq = makeSequence(iterable);
-
- // If iterable.size is undefined, the size of the realized sliceSeq is
- // unknown at this point unless the number of items to slice is 0
- sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;
-
- if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
- sliceSeq.get = function (index, notSetValue) {
- index = wrapIndex(this, index);
- return index >= 0 && index < sliceSize ?
- iterable.get(index + resolvedBegin, notSetValue) :
- notSetValue;
- }
- }
-
- sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;
- if (sliceSize === 0) {
- return 0;
- }
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var skipped = 0;
- var isSkipping = true;
- var iterations = 0;
- iterable.__iterate(function(v, k) {
- if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&
- iterations !== sliceSize;
- }
- });
- return iterations;
- };
-
- sliceSeq.__iteratorUncached = function(type, reverse) {
- if (sliceSize !== 0 && reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- // Don't bother instantiating parent iterator if taking 0.
- var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
- var skipped = 0;
- var iterations = 0;
- return new Iterator(function() {
- while (skipped++ < resolvedBegin) {
- iterator.next();
- }
- if (++iterations > sliceSize) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (useKeys || type === ITERATE_VALUES) {
- return step;
- } else if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations - 1, undefined, step);
- } else {
- return iteratorValue(type, iterations - 1, step.value[1], step);
- }
- });
- }
-
- return sliceSeq;
- }
-
-
- function takeWhileFactory(iterable, predicate, context) {
- var takeSequence = makeSequence(iterable);
- takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterations = 0;
- iterable.__iterate(function(v, k, c)
- {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}
- );
- return iterations;
- };
- takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var iterating = true;
- return new Iterator(function() {
- if (!iterating) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var k = entry[0];
- var v = entry[1];
- if (!predicate.call(context, v, k, this$0)) {
- iterating = false;
- return iteratorDone();
- }
- return type === ITERATE_ENTRIES ? step :
- iteratorValue(type, k, v, step);
- });
- };
- return takeSequence;
- }
-
-
- function skipWhileFactory(iterable, predicate, context, useKeys) {
- var skipSequence = makeSequence(iterable);
- skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var isSkipping = true;
- var iterations = 0;
- iterable.__iterate(function(v, k, c) {
- if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0);
- }
- });
- return iterations;
- };
- skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var skipping = true;
- var iterations = 0;
- return new Iterator(function() {
- var step, k, v;
- do {
- step = iterator.next();
- if (step.done) {
- if (useKeys || type === ITERATE_VALUES) {
- return step;
- } else if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations++, undefined, step);
- } else {
- return iteratorValue(type, iterations++, step.value[1], step);
- }
- }
- var entry = step.value;
- k = entry[0];
- v = entry[1];
- skipping && (skipping = predicate.call(context, v, k, this$0));
- } while (skipping);
- return type === ITERATE_ENTRIES ? step :
- iteratorValue(type, k, v, step);
- });
- };
- return skipSequence;
- }
-
-
- function concatFactory(iterable, values) {
- var isKeyedIterable = isKeyed(iterable);
- var iters = [iterable].concat(values).map(function(v ) {
- if (!isIterable(v)) {
- v = isKeyedIterable ?
- keyedSeqFromValue(v) :
- indexedSeqFromValue(Array.isArray(v) ? v : [v]);
- } else if (isKeyedIterable) {
- v = KeyedIterable(v);
- }
- return v;
- }).filter(function(v ) {return v.size !== 0});
-
- if (iters.length === 0) {
- return iterable;
- }
-
- if (iters.length === 1) {
- var singleton = iters[0];
- if (singleton === iterable ||
- isKeyedIterable && isKeyed(singleton) ||
- isIndexed(iterable) && isIndexed(singleton)) {
- return singleton;
- }
- }
-
- var concatSeq = new ArraySeq(iters);
- if (isKeyedIterable) {
- concatSeq = concatSeq.toKeyedSeq();
- } else if (!isIndexed(iterable)) {
- concatSeq = concatSeq.toSetSeq();
- }
- concatSeq = concatSeq.flatten(true);
- concatSeq.size = iters.reduce(
- function(sum, seq) {
- if (sum !== undefined) {
- var size = seq.size;
- if (size !== undefined) {
- return sum + size;
- }
- }
- },
- 0
- );
- return concatSeq;
- }
-
-
- function flattenFactory(iterable, depth, useKeys) {
- var flatSequence = makeSequence(iterable);
- flatSequence.__iterateUncached = function(fn, reverse) {
- var iterations = 0;
- var stopped = false;
- function flatDeep(iter, currentDepth) {var this$0 = this;
- iter.__iterate(function(v, k) {
- if ((!depth || currentDepth < depth) && isIterable(v)) {
- flatDeep(v, currentDepth + 1);
- } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
- stopped = true;
- }
- return !stopped;
- }, reverse);
- }
- flatDeep(iterable, 0);
- return iterations;
- }
- flatSequence.__iteratorUncached = function(type, reverse) {
- var iterator = iterable.__iterator(type, reverse);
- var stack = [];
- var iterations = 0;
- return new Iterator(function() {
- while (iterator) {
- var step = iterator.next();
- if (step.done !== false) {
- iterator = stack.pop();
- continue;
- }
- var v = step.value;
- if (type === ITERATE_ENTRIES) {
- v = v[1];
- }
- if ((!depth || stack.length < depth) && isIterable(v)) {
- stack.push(iterator);
- iterator = v.__iterator(type, reverse);
- } else {
- return useKeys ? step : iteratorValue(type, iterations++, v, step);
- }
- }
- return iteratorDone();
- });
- }
- return flatSequence;
- }
-
-
- function flatMapFactory(iterable, mapper, context) {
- var coerce = iterableClass(iterable);
- return iterable.toSeq().map(
- function(v, k) {return coerce(mapper.call(context, v, k, iterable))}
- ).flatten(true);
- }
-
-
- function interposeFactory(iterable, separator) {
- var interposedSequence = makeSequence(iterable);
- interposedSequence.size = iterable.size && iterable.size * 2 -1;
- interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- iterable.__iterate(function(v, k)
- {return (!iterations || fn(separator, iterations++, this$0) !== false) &&
- fn(v, iterations++, this$0) !== false},
- reverse
- );
- return iterations;
- };
- interposedSequence.__iteratorUncached = function(type, reverse) {
- var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
- var iterations = 0;
- var step;
- return new Iterator(function() {
- if (!step || iterations % 2) {
- step = iterator.next();
- if (step.done) {
- return step;
- }
- }
- return iterations % 2 ?
- iteratorValue(type, iterations++, separator) :
- iteratorValue(type, iterations++, step.value, step);
- });
- };
- return interposedSequence;
- }
-
-
- function sortFactory(iterable, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- var isKeyedIterable = isKeyed(iterable);
- var index = 0;
- var entries = iterable.toSeq().map(
- function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}
- ).toArray();
- entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(
- isKeyedIterable ?
- function(v, i) { entries[i].length = 2; } :
- function(v, i) { entries[i] = v[1]; }
- );
- return isKeyedIterable ? KeyedSeq(entries) :
- isIndexed(iterable) ? IndexedSeq(entries) :
- SetSeq(entries);
- }
-
-
- function maxFactory(iterable, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- if (mapper) {
- var entry = iterable.toSeq()
- .map(function(v, k) {return [v, mapper(v, k, iterable)]})
- .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a});
- return entry && entry[0];
- } else {
- return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a});
- }
- }
-
- function maxCompare(comparator, a, b) {
- var comp = comparator(b, a);
- // b is considered the new max if the comparator declares them equal, but
- // they are not equal and b is in fact a nullish value.
- return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;
- }
-
-
- function zipWithFactory(keyIter, zipper, iters) {
- var zipSequence = makeSequence(keyIter);
- zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
- // Note: this a generic base implementation of __iterate in terms of
- // __iterator which may be more generically useful in the future.
- zipSequence.__iterate = function(fn, reverse) {
- /* generic:
- var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- iterations++;
- if (fn(step.value[1], step.value[0], this) === false) {
- break;
- }
- }
- return iterations;
- */
- // indexed:
- var iterator = this.__iterator(ITERATE_VALUES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- return iterations;
- };
- zipSequence.__iteratorUncached = function(type, reverse) {
- var iterators = iters.map(function(i )
- {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}
- );
- var iterations = 0;
- var isDone = false;
- return new Iterator(function() {
- var steps;
- if (!isDone) {
- steps = iterators.map(function(i ) {return i.next()});
- isDone = steps.some(function(s ) {return s.done});
- }
- if (isDone) {
- return iteratorDone();
- }
- return iteratorValue(
- type,
- iterations++,
- zipper.apply(null, steps.map(function(s ) {return s.value}))
- );
- });
- };
- return zipSequence
- }
-
-
- // #pragma Helper Functions
-
- function reify(iter, seq) {
- return isSeq(iter) ? seq : iter.constructor(seq);
- }
-
- function validateEntry(entry) {
- if (entry !== Object(entry)) {
- throw new TypeError('Expected [K, V] tuple: ' + entry);
- }
- }
-
- function resolveSize(iter) {
- assertNotInfinite(iter.size);
- return ensureSize(iter);
- }
-
- function iterableClass(iterable) {
- return isKeyed(iterable) ? KeyedIterable :
- isIndexed(iterable) ? IndexedIterable :
- SetIterable;
- }
-
- function makeSequence(iterable) {
- return Object.create(
- (
- isKeyed(iterable) ? KeyedSeq :
- isIndexed(iterable) ? IndexedSeq :
- SetSeq
- ).prototype
- );
- }
-
- function cacheResultThrough() {
- if (this._iter.cacheResult) {
- this._iter.cacheResult();
- this.size = this._iter.size;
- return this;
- } else {
- return Seq.prototype.cacheResult.call(this);
- }
- }
-
- function defaultComparator(a, b) {
- return a > b ? 1 : a < b ? -1 : 0;
- }
-
- function forceIterator(keyPath) {
- var iter = getIterator(keyPath);
- if (!iter) {
- // Array might not be iterable in this environment, so we need a fallback
- // to our wrapped type.
- if (!isArrayLike(keyPath)) {
- throw new TypeError('Expected iterable or array-like: ' + keyPath);
- }
- iter = getIterator(Iterable(keyPath));
- }
- return iter;
- }
-
- createClass(Record, KeyedCollection);
-
- function Record(defaultValues, name) {
- var hasInitialized;
-
- var RecordType = function Record(values) {
- if (values instanceof RecordType) {
- return values;
- }
- if (!(this instanceof RecordType)) {
- return new RecordType(values);
- }
- if (!hasInitialized) {
- hasInitialized = true;
- var keys = Object.keys(defaultValues);
- setProps(RecordTypePrototype, keys);
- RecordTypePrototype.size = keys.length;
- RecordTypePrototype._name = name;
- RecordTypePrototype._keys = keys;
- RecordTypePrototype._defaultValues = defaultValues;
- }
- this._map = Map(values);
- };
-
- var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
- RecordTypePrototype.constructor = RecordType;
-
- return RecordType;
- }
-
- Record.prototype.toString = function() {
- return this.__toString(recordName(this) + ' {', '}');
- };
-
- // @pragma Access
-
- Record.prototype.has = function(k) {
- return this._defaultValues.hasOwnProperty(k);
- };
-
- Record.prototype.get = function(k, notSetValue) {
- if (!this.has(k)) {
- return notSetValue;
- }
- var defaultVal = this._defaultValues[k];
- return this._map ? this._map.get(k, defaultVal) : defaultVal;
- };
-
- // @pragma Modification
-
- Record.prototype.clear = function() {
- if (this.__ownerID) {
- this._map && this._map.clear();
- return this;
- }
- var RecordType = this.constructor;
- return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
- };
-
- Record.prototype.set = function(k, v) {
- if (!this.has(k)) {
- throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
- }
- var newMap = this._map && this._map.set(k, v);
- if (this.__ownerID || newMap === this._map) {
- return this;
- }
- return makeRecord(this, newMap);
- };
-
- Record.prototype.remove = function(k) {
- if (!this.has(k)) {
- return this;
- }
- var newMap = this._map && this._map.remove(k);
- if (this.__ownerID || newMap === this._map) {
- return this;
- }
- return makeRecord(this, newMap);
- };
-
- Record.prototype.wasAltered = function() {
- return this._map.wasAltered();
- };
-
- Record.prototype.__iterator = function(type, reverse) {var this$0 = this;
- return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse);
- };
-
- Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse);
- };
-
- Record.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map && this._map.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- return this;
- }
- return makeRecord(this, newMap, ownerID);
- };
-
-
- var RecordPrototype = Record.prototype;
- RecordPrototype[DELETE] = RecordPrototype.remove;
- RecordPrototype.deleteIn =
- RecordPrototype.removeIn = MapPrototype.removeIn;
- RecordPrototype.merge = MapPrototype.merge;
- RecordPrototype.mergeWith = MapPrototype.mergeWith;
- RecordPrototype.mergeIn = MapPrototype.mergeIn;
- RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
- RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
- RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
- RecordPrototype.setIn = MapPrototype.setIn;
- RecordPrototype.update = MapPrototype.update;
- RecordPrototype.updateIn = MapPrototype.updateIn;
- RecordPrototype.withMutations = MapPrototype.withMutations;
- RecordPrototype.asMutable = MapPrototype.asMutable;
- RecordPrototype.asImmutable = MapPrototype.asImmutable;
-
-
- function makeRecord(likeRecord, map, ownerID) {
- var record = Object.create(Object.getPrototypeOf(likeRecord));
- record._map = map;
- record.__ownerID = ownerID;
- return record;
- }
-
- function recordName(record) {
- return record._name || record.constructor.name || 'Record';
- }
-
- function setProps(prototype, names) {
- try {
- names.forEach(setProp.bind(undefined, prototype));
- } catch (error) {
- // Object.defineProperty failed. Probably IE8.
- }
- }
-
- function setProp(prototype, name) {
- Object.defineProperty(prototype, name, {
- get: function() {
- return this.get(name);
- },
- set: function(value) {
- invariant(this.__ownerID, 'Cannot set on an immutable record.');
- this.set(name, value);
- }
- });
- }
-
- createClass(Set, SetCollection);
-
- // @pragma Construction
-
- function Set(value) {
- return value === null || value === undefined ? emptySet() :
- isSet(value) && !isOrdered(value) ? value :
- emptySet().withMutations(function(set ) {
- var iter = SetIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v ) {return set.add(v)});
- });
- }
-
- Set.of = function(/*...values*/) {
- return this(arguments);
- };
-
- Set.fromKeys = function(value) {
- return this(KeyedIterable(value).keySeq());
- };
-
- Set.prototype.toString = function() {
- return this.__toString('Set {', '}');
- };
-
- // @pragma Access
-
- Set.prototype.has = function(value) {
- return this._map.has(value);
- };
-
- // @pragma Modification
-
- Set.prototype.add = function(value) {
- return updateSet(this, this._map.set(value, true));
- };
-
- Set.prototype.remove = function(value) {
- return updateSet(this, this._map.remove(value));
- };
-
- Set.prototype.clear = function() {
- return updateSet(this, this._map.clear());
- };
-
- // @pragma Composition
-
- Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);
- iters = iters.filter(function(x ) {return x.size !== 0});
- if (iters.length === 0) {
- return this;
- }
- if (this.size === 0 && !this.__ownerID && iters.length === 1) {
- return this.constructor(iters[0]);
- }
- return this.withMutations(function(set ) {
- for (var ii = 0; ii < iters.length; ii++) {
- SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});
- }
- });
- };
-
- Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function(iter ) {return SetIterable(iter)});
- var originalSet = this;
- return this.withMutations(function(set ) {
- originalSet.forEach(function(value ) {
- if (!iters.every(function(iter ) {return iter.includes(value)})) {
- set.remove(value);
- }
- });
- });
- };
-
- Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function(iter ) {return SetIterable(iter)});
- var originalSet = this;
- return this.withMutations(function(set ) {
- originalSet.forEach(function(value ) {
- if (iters.some(function(iter ) {return iter.includes(value)})) {
- set.remove(value);
- }
- });
- });
- };
-
- Set.prototype.merge = function() {
- return this.union.apply(this, arguments);
- };
-
- Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return this.union.apply(this, iters);
- };
-
- Set.prototype.sort = function(comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator));
- };
-
- Set.prototype.sortBy = function(mapper, comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator, mapper));
- };
-
- Set.prototype.wasAltered = function() {
- return this._map.wasAltered();
- };
-
- Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse);
- };
-
- Set.prototype.__iterator = function(type, reverse) {
- return this._map.map(function(_, k) {return k}).__iterator(type, reverse);
- };
-
- Set.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- return this;
- }
- return this.__make(newMap, ownerID);
- };
-
-
- function isSet(maybeSet) {
- return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
- }
-
- Set.isSet = isSet;
-
- var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
-
- var SetPrototype = Set.prototype;
- SetPrototype[IS_SET_SENTINEL] = true;
- SetPrototype[DELETE] = SetPrototype.remove;
- SetPrototype.mergeDeep = SetPrototype.merge;
- SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
- SetPrototype.withMutations = MapPrototype.withMutations;
- SetPrototype.asMutable = MapPrototype.asMutable;
- SetPrototype.asImmutable = MapPrototype.asImmutable;
-
- SetPrototype.__empty = emptySet;
- SetPrototype.__make = makeSet;
-
- function updateSet(set, newMap) {
- if (set.__ownerID) {
- set.size = newMap.size;
- set._map = newMap;
- return set;
- }
- return newMap === set._map ? set :
- newMap.size === 0 ? set.__empty() :
- set.__make(newMap);
- }
-
- function makeSet(map, ownerID) {
- var set = Object.create(SetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
-
- var EMPTY_SET;
- function emptySet() {
- return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
- }
-
- createClass(OrderedSet, Set);
-
- // @pragma Construction
-
- function OrderedSet(value) {
- return value === null || value === undefined ? emptyOrderedSet() :
- isOrderedSet(value) ? value :
- emptyOrderedSet().withMutations(function(set ) {
- var iter = SetIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v ) {return set.add(v)});
- });
- }
-
- OrderedSet.of = function(/*...values*/) {
- return this(arguments);
- };
-
- OrderedSet.fromKeys = function(value) {
- return this(KeyedIterable(value).keySeq());
- };
-
- OrderedSet.prototype.toString = function() {
- return this.__toString('OrderedSet {', '}');
- };
-
-
- function isOrderedSet(maybeOrderedSet) {
- return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
- }
-
- OrderedSet.isOrderedSet = isOrderedSet;
-
- var OrderedSetPrototype = OrderedSet.prototype;
- OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;
-
- OrderedSetPrototype.__empty = emptyOrderedSet;
- OrderedSetPrototype.__make = makeOrderedSet;
-
- function makeOrderedSet(map, ownerID) {
- var set = Object.create(OrderedSetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
-
- var EMPTY_ORDERED_SET;
- function emptyOrderedSet() {
- return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
- }
-
- createClass(Stack, IndexedCollection);
-
- // @pragma Construction
-
- function Stack(value) {
- return value === null || value === undefined ? emptyStack() :
- isStack(value) ? value :
- emptyStack().unshiftAll(value);
- }
-
- Stack.of = function(/*...values*/) {
- return this(arguments);
- };
-
- Stack.prototype.toString = function() {
- return this.__toString('Stack [', ']');
- };
-
- // @pragma Access
-
- Stack.prototype.get = function(index, notSetValue) {
- var head = this._head;
- index = wrapIndex(this, index);
- while (head && index--) {
- head = head.next;
- }
- return head ? head.value : notSetValue;
- };
-
- Stack.prototype.peek = function() {
- return this._head && this._head.value;
- };
-
- // @pragma Modification
-
- Stack.prototype.push = function(/*...values*/) {
- if (arguments.length === 0) {
- return this;
- }
- var newSize = this.size + arguments.length;
- var head = this._head;
- for (var ii = arguments.length - 1; ii >= 0; ii--) {
- head = {
- value: arguments[ii],
- next: head
- };
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
-
- Stack.prototype.pushAll = function(iter) {
- iter = IndexedIterable(iter);
- if (iter.size === 0) {
- return this;
- }
- assertNotInfinite(iter.size);
- var newSize = this.size;
- var head = this._head;
- iter.reverse().forEach(function(value ) {
- newSize++;
- head = {
- value: value,
- next: head
- };
- });
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
-
- Stack.prototype.pop = function() {
- return this.slice(1);
- };
-
- Stack.prototype.unshift = function(/*...values*/) {
- return this.push.apply(this, arguments);
- };
-
- Stack.prototype.unshiftAll = function(iter) {
- return this.pushAll(iter);
- };
-
- Stack.prototype.shift = function() {
- return this.pop.apply(this, arguments);
- };
-
- Stack.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._head = undefined;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyStack();
- };
-
- Stack.prototype.slice = function(begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- var resolvedBegin = resolveBegin(begin, this.size);
- var resolvedEnd = resolveEnd(end, this.size);
- if (resolvedEnd !== this.size) {
- // super.slice(begin, end);
- return IndexedCollection.prototype.slice.call(this, begin, end);
- }
- var newSize = this.size - resolvedBegin;
- var head = this._head;
- while (resolvedBegin--) {
- head = head.next;
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
-
- // @pragma Mutability
-
- Stack.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeStack(this.size, this._head, ownerID, this.__hash);
- };
-
- // @pragma Iteration
-
- Stack.prototype.__iterate = function(fn, reverse) {
- if (reverse) {
- return this.reverse().__iterate(fn);
- }
- var iterations = 0;
- var node = this._head;
- while (node) {
- if (fn(node.value, iterations++, this) === false) {
- break;
- }
- node = node.next;
- }
- return iterations;
- };
-
- Stack.prototype.__iterator = function(type, reverse) {
- if (reverse) {
- return this.reverse().__iterator(type);
- }
- var iterations = 0;
- var node = this._head;
- return new Iterator(function() {
- if (node) {
- var value = node.value;
- node = node.next;
- return iteratorValue(type, iterations++, value);
- }
- return iteratorDone();
- });
- };
-
-
- function isStack(maybeStack) {
- return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
- }
-
- Stack.isStack = isStack;
-
- var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
-
- var StackPrototype = Stack.prototype;
- StackPrototype[IS_STACK_SENTINEL] = true;
- StackPrototype.withMutations = MapPrototype.withMutations;
- StackPrototype.asMutable = MapPrototype.asMutable;
- StackPrototype.asImmutable = MapPrototype.asImmutable;
- StackPrototype.wasAltered = MapPrototype.wasAltered;
-
-
- function makeStack(size, head, ownerID, hash) {
- var map = Object.create(StackPrototype);
- map.size = size;
- map._head = head;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
-
- var EMPTY_STACK;
- function emptyStack() {
- return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
- }
-
- /**
- * Contributes additional methods to a constructor
- */
- function mixin(ctor, methods) {
- var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };
- Object.keys(methods).forEach(keyCopier);
- Object.getOwnPropertySymbols &&
- Object.getOwnPropertySymbols(methods).forEach(keyCopier);
- return ctor;
- }
-
- Iterable.Iterator = Iterator;
-
- mixin(Iterable, {
-
- // ### Conversion to other types
-
- toArray: function() {
- assertNotInfinite(this.size);
- var array = new Array(this.size || 0);
- this.valueSeq().__iterate(function(v, i) { array[i] = v; });
- return array;
- },
-
- toIndexedSeq: function() {
- return new ToIndexedSequence(this);
- },
-
- toJS: function() {
- return this.toSeq().map(
- function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}
- ).__toJS();
- },
-
- toJSON: function() {
- return this.toSeq().map(
- function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}
- ).__toJS();
- },
-
- toKeyedSeq: function() {
- return new ToKeyedSequence(this, true);
- },
-
- toMap: function() {
- // Use Late Binding here to solve the circular dependency.
- return Map(this.toKeyedSeq());
- },
-
- toObject: function() {
- assertNotInfinite(this.size);
- var object = {};
- this.__iterate(function(v, k) { object[k] = v; });
- return object;
- },
-
- toOrderedMap: function() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedMap(this.toKeyedSeq());
- },
-
- toOrderedSet: function() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
- },
-
- toSet: function() {
- // Use Late Binding here to solve the circular dependency.
- return Set(isKeyed(this) ? this.valueSeq() : this);
- },
-
- toSetSeq: function() {
- return new ToSetSequence(this);
- },
-
- toSeq: function() {
- return isIndexed(this) ? this.toIndexedSeq() :
- isKeyed(this) ? this.toKeyedSeq() :
- this.toSetSeq();
- },
-
- toStack: function() {
- // Use Late Binding here to solve the circular dependency.
- return Stack(isKeyed(this) ? this.valueSeq() : this);
- },
-
- toList: function() {
- // Use Late Binding here to solve the circular dependency.
- return List(isKeyed(this) ? this.valueSeq() : this);
- },
-
-
- // ### Common JavaScript methods and properties
-
- toString: function() {
- return '[Iterable]';
- },
-
- __toString: function(head, tail) {
- if (this.size === 0) {
- return head + tail;
- }
- return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;
- },
-
-
- // ### ES6 Collection methods (ES6 Array and Map)
-
- concat: function() {var values = SLICE$0.call(arguments, 0);
- return reify(this, concatFactory(this, values));
- },
-
- includes: function(searchValue) {
- return this.some(function(value ) {return is(value, searchValue)});
- },
-
- entries: function() {
- return this.__iterator(ITERATE_ENTRIES);
- },
-
- every: function(predicate, context) {
- assertNotInfinite(this.size);
- var returnValue = true;
- this.__iterate(function(v, k, c) {
- if (!predicate.call(context, v, k, c)) {
- returnValue = false;
- return false;
- }
- });
- return returnValue;
- },
-
- filter: function(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, true));
- },
-
- find: function(predicate, context, notSetValue) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[1] : notSetValue;
- },
-
- findEntry: function(predicate, context) {
- var found;
- this.__iterate(function(v, k, c) {
- if (predicate.call(context, v, k, c)) {
- found = [k, v];
- return false;
- }
- });
- return found;
- },
-
- findLastEntry: function(predicate, context) {
- return this.toSeq().reverse().findEntry(predicate, context);
- },
-
- forEach: function(sideEffect, context) {
- assertNotInfinite(this.size);
- return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
- },
-
- join: function(separator) {
- assertNotInfinite(this.size);
- separator = separator !== undefined ? '' + separator : ',';
- var joined = '';
- var isFirst = true;
- this.__iterate(function(v ) {
- isFirst ? (isFirst = false) : (joined += separator);
- joined += v !== null && v !== undefined ? v.toString() : '';
- });
- return joined;
- },
-
- keys: function() {
- return this.__iterator(ITERATE_KEYS);
- },
-
- map: function(mapper, context) {
- return reify(this, mapFactory(this, mapper, context));
- },
-
- reduce: function(reducer, initialReduction, context) {
- assertNotInfinite(this.size);
- var reduction;
- var useFirst;
- if (arguments.length < 2) {
- useFirst = true;
- } else {
- reduction = initialReduction;
- }
- this.__iterate(function(v, k, c) {
- if (useFirst) {
- useFirst = false;
- reduction = v;
- } else {
- reduction = reducer.call(context, reduction, v, k, c);
- }
- });
- return reduction;
- },
-
- reduceRight: function(reducer, initialReduction, context) {
- var reversed = this.toKeyedSeq().reverse();
- return reversed.reduce.apply(reversed, arguments);
- },
-
- reverse: function() {
- return reify(this, reverseFactory(this, true));
- },
-
- slice: function(begin, end) {
- return reify(this, sliceFactory(this, begin, end, true));
- },
-
- some: function(predicate, context) {
- return !this.every(not(predicate), context);
- },
-
- sort: function(comparator) {
- return reify(this, sortFactory(this, comparator));
- },
-
- values: function() {
- return this.__iterator(ITERATE_VALUES);
- },
-
-
- // ### More sequential methods
-
- butLast: function() {
- return this.slice(0, -1);
- },
-
- isEmpty: function() {
- return this.size !== undefined ? this.size === 0 : !this.some(function() {return true});
- },
-
- count: function(predicate, context) {
- return ensureSize(
- predicate ? this.toSeq().filter(predicate, context) : this
- );
- },
-
- countBy: function(grouper, context) {
- return countByFactory(this, grouper, context);
- },
-
- equals: function(other) {
- return deepEqual(this, other);
- },
-
- entrySeq: function() {
- var iterable = this;
- if (iterable._cache) {
- // We cache as an entries array, so we can just return the cache!
- return new ArraySeq(iterable._cache);
- }
- var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
- entriesSequence.fromEntrySeq = function() {return iterable.toSeq()};
- return entriesSequence;
- },
-
- filterNot: function(predicate, context) {
- return this.filter(not(predicate), context);
- },
-
- findLast: function(predicate, context, notSetValue) {
- return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
- },
-
- first: function() {
- return this.find(returnTrue);
- },
-
- flatMap: function(mapper, context) {
- return reify(this, flatMapFactory(this, mapper, context));
- },
-
- flatten: function(depth) {
- return reify(this, flattenFactory(this, depth, true));
- },
-
- fromEntrySeq: function() {
- return new FromEntriesSequence(this);
- },
-
- get: function(searchKey, notSetValue) {
- return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue);
- },
-
- getIn: function(searchKeyPath, notSetValue) {
- var nested = this;
- // Note: in an ES6 environment, we would prefer:
- // for (var key of searchKeyPath) {
- var iter = forceIterator(searchKeyPath);
- var step;
- while (!(step = iter.next()).done) {
- var key = step.value;
- nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
- if (nested === NOT_SET) {
- return notSetValue;
- }
- }
- return nested;
- },
-
- groupBy: function(grouper, context) {
- return groupByFactory(this, grouper, context);
- },
-
- has: function(searchKey) {
- return this.get(searchKey, NOT_SET) !== NOT_SET;
- },
-
- hasIn: function(searchKeyPath) {
- return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
- },
-
- isSubset: function(iter) {
- iter = typeof iter.includes === 'function' ? iter : Iterable(iter);
- return this.every(function(value ) {return iter.includes(value)});
- },
-
- isSuperset: function(iter) {
- iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);
- return iter.isSubset(this);
- },
-
- keySeq: function() {
- return this.toSeq().map(keyMapper).toIndexedSeq();
- },
-
- last: function() {
- return this.toSeq().reverse().first();
- },
-
- max: function(comparator) {
- return maxFactory(this, comparator);
- },
-
- maxBy: function(mapper, comparator) {
- return maxFactory(this, comparator, mapper);
- },
-
- min: function(comparator) {
- return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
- },
-
- minBy: function(mapper, comparator) {
- return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
- },
-
- rest: function() {
- return this.slice(1);
- },
-
- skip: function(amount) {
- return this.slice(Math.max(0, amount));
- },
-
- skipLast: function(amount) {
- return reify(this, this.toSeq().reverse().skip(amount).reverse());
- },
-
- skipWhile: function(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, true));
- },
-
- skipUntil: function(predicate, context) {
- return this.skipWhile(not(predicate), context);
- },
-
- sortBy: function(mapper, comparator) {
- return reify(this, sortFactory(this, comparator, mapper));
- },
-
- take: function(amount) {
- return this.slice(0, Math.max(0, amount));
- },
-
- takeLast: function(amount) {
- return reify(this, this.toSeq().reverse().take(amount).reverse());
- },
-
- takeWhile: function(predicate, context) {
- return reify(this, takeWhileFactory(this, predicate, context));
- },
-
- takeUntil: function(predicate, context) {
- return this.takeWhile(not(predicate), context);
- },
-
- valueSeq: function() {
- return this.toIndexedSeq();
- },
-
-
- // ### Hashable Object
-
- hashCode: function() {
- return this.__hash || (this.__hash = hashIterable(this));
- }
-
-
- // ### Internal
-
- // abstract __iterate(fn, reverse)
-
- // abstract __iterator(type, reverse)
- });
-
- // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
- // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
- // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
- // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
-
- var IterablePrototype = Iterable.prototype;
- IterablePrototype[IS_ITERABLE_SENTINEL] = true;
- IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
- IterablePrototype.__toJS = IterablePrototype.toArray;
- IterablePrototype.__toStringMapper = quoteString;
- IterablePrototype.inspect =
- IterablePrototype.toSource = function() { return this.toString(); };
- IterablePrototype.chain = IterablePrototype.flatMap;
- IterablePrototype.contains = IterablePrototype.includes;
-
- // Temporary warning about using length
- (function () {
- try {
- Object.defineProperty(IterablePrototype, 'length', {
- get: function () {
- if (!Iterable.noLengthWarning) {
- var stack;
- try {
- throw new Error();
- } catch (error) {
- stack = error.stack;
- }
- if (stack.indexOf('_wrapObject') === -1) {
- console && console.warn && console.warn(
- 'iterable.length has been deprecated, '+
- 'use iterable.size or iterable.count(). '+
- 'This warning will become a silent error in a future version. ' +
- stack
- );
- return this.size;
- }
- }
- }
- });
- } catch (e) {}
- })();
-
-
-
- mixin(KeyedIterable, {
-
- // ### More sequential methods
-
- flip: function() {
- return reify(this, flipFactory(this));
- },
-
- findKey: function(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry && entry[0];
- },
-
- findLastKey: function(predicate, context) {
- return this.toSeq().reverse().findKey(predicate, context);
- },
-
- keyOf: function(searchValue) {
- return this.findKey(function(value ) {return is(value, searchValue)});
- },
-
- lastKeyOf: function(searchValue) {
- return this.findLastKey(function(value ) {return is(value, searchValue)});
- },
-
- mapEntries: function(mapper, context) {var this$0 = this;
- var iterations = 0;
- return reify(this,
- this.toSeq().map(
- function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)}
- ).fromEntrySeq()
- );
- },
-
- mapKeys: function(mapper, context) {var this$0 = this;
- return reify(this,
- this.toSeq().flip().map(
- function(k, v) {return mapper.call(context, k, v, this$0)}
- ).flip()
- );
- }
-
- });
-
- var KeyedIterablePrototype = KeyedIterable.prototype;
- KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
- KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
- KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
- KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)};
-
-
-
- mixin(IndexedIterable, {
-
- // ### Conversion to other types
-
- toKeyedSeq: function() {
- return new ToKeyedSequence(this, false);
- },
-
-
- // ### ES6 Collection methods (ES6 Array and Map)
-
- filter: function(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, false));
- },
-
- findIndex: function(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[0] : -1;
- },
-
- indexOf: function(searchValue) {
- var key = this.toKeyedSeq().keyOf(searchValue);
- return key === undefined ? -1 : key;
- },
-
- lastIndexOf: function(searchValue) {
- var key = this.toKeyedSeq().reverse().keyOf(searchValue);
- return key === undefined ? -1 : key;
-
- // var index =
- // return this.toSeq().reverse().indexOf(searchValue);
- },
-
- reverse: function() {
- return reify(this, reverseFactory(this, false));
- },
-
- slice: function(begin, end) {
- return reify(this, sliceFactory(this, begin, end, false));
- },
-
- splice: function(index, removeNum /*, ...values*/) {
- var numArgs = arguments.length;
- removeNum = Math.max(removeNum | 0, 0);
- if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
- return this;
- }
- // If index is negative, it should resolve relative to the size of the
- // collection. However size may be expensive to compute if not cached, so
- // only call count() if the number is in fact negative.
- index = resolveBegin(index, index < 0 ? this.count() : this.size);
- var spliced = this.slice(0, index);
- return reify(
- this,
- numArgs === 1 ?
- spliced :
- spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
- );
- },
-
-
- // ### More collection methods
-
- findLastIndex: function(predicate, context) {
- var key = this.toKeyedSeq().findLastKey(predicate, context);
- return key === undefined ? -1 : key;
- },
-
- first: function() {
- return this.get(0);
- },
-
- flatten: function(depth) {
- return reify(this, flattenFactory(this, depth, false));
- },
-
- get: function(index, notSetValue) {
- index = wrapIndex(this, index);
- return (index < 0 || (this.size === Infinity ||
- (this.size !== undefined && index > this.size))) ?
- notSetValue :
- this.find(function(_, key) {return key === index}, undefined, notSetValue);
- },
-
- has: function(index) {
- index = wrapIndex(this, index);
- return index >= 0 && (this.size !== undefined ?
- this.size === Infinity || index < this.size :
- this.indexOf(index) !== -1
- );
- },
-
- interpose: function(separator) {
- return reify(this, interposeFactory(this, separator));
- },
-
- interleave: function(/*...iterables*/) {
- var iterables = [this].concat(arrCopy(arguments));
- var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
- var interleaved = zipped.flatten(true);
- if (zipped.size) {
- interleaved.size = zipped.size * iterables.length;
- }
- return reify(this, interleaved);
- },
-
- last: function() {
- return this.get(-1);
- },
-
- skipWhile: function(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, false));
- },
-
- zip: function(/*, ...iterables */) {
- var iterables = [this].concat(arrCopy(arguments));
- return reify(this, zipWithFactory(this, defaultZipper, iterables));
- },
-
- zipWith: function(zipper/*, ...iterables */) {
- var iterables = arrCopy(arguments);
- iterables[0] = this;
- return reify(this, zipWithFactory(this, zipper, iterables));
- }
-
- });
-
- IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
- IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;
-
-
-
- mixin(SetIterable, {
-
- // ### ES6 Collection methods (ES6 Array and Map)
-
- get: function(value, notSetValue) {
- return this.has(value) ? value : notSetValue;
- },
-
- includes: function(value) {
- return this.has(value);
- },
-
-
- // ### More sequential methods
-
- keySeq: function() {
- return this.valueSeq();
- }
-
- });
-
- SetIterable.prototype.has = IterablePrototype.includes;
-
-
- // Mixin subclasses
-
- mixin(KeyedSeq, KeyedIterable.prototype);
- mixin(IndexedSeq, IndexedIterable.prototype);
- mixin(SetSeq, SetIterable.prototype);
-
- mixin(KeyedCollection, KeyedIterable.prototype);
- mixin(IndexedCollection, IndexedIterable.prototype);
- mixin(SetCollection, SetIterable.prototype);
-
-
- // #pragma Helper functions
-
- function keyMapper(v, k) {
- return k;
- }
-
- function entryMapper(v, k) {
- return [k, v];
- }
-
- function not(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- }
- }
-
- function neg(predicate) {
- return function() {
- return -predicate.apply(this, arguments);
- }
- }
-
- function quoteString(value) {
- return typeof value === 'string' ? JSON.stringify(value) : value;
- }
-
- function defaultZipper() {
- return arrCopy(arguments);
- }
-
- function defaultNegComparator(a, b) {
- return a < b ? 1 : a > b ? -1 : 0;
- }
-
- function hashIterable(iterable) {
- if (iterable.size === Infinity) {
- return 0;
- }
- var ordered = isOrdered(iterable);
- var keyed = isKeyed(iterable);
- var h = ordered ? 1 : 0;
- var size = iterable.__iterate(
- keyed ?
- ordered ?
- function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :
- function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } :
- ordered ?
- function(v ) { h = 31 * h + hash(v) | 0; } :
- function(v ) { h = h + hash(v) | 0; }
- );
- return murmurHashOfSize(size, h);
- }
-
- function murmurHashOfSize(size, h) {
- h = imul(h, 0xCC9E2D51);
- h = imul(h << 15 | h >>> -15, 0x1B873593);
- h = imul(h << 13 | h >>> -13, 5);
- h = (h + 0xE6546B64 | 0) ^ size;
- h = imul(h ^ h >>> 16, 0x85EBCA6B);
- h = imul(h ^ h >>> 13, 0xC2B2AE35);
- h = smi(h ^ h >>> 16);
- return h;
- }
-
- function hashMerge(a, b) {
- return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int
- }
-
- var Immutable = {
-
- Iterable: Iterable,
-
- Seq: Seq,
- Collection: Collection,
- Map: Map,
- OrderedMap: OrderedMap,
- List: List,
- Stack: Stack,
- Set: Set,
- OrderedSet: OrderedSet,
-
- Record: Record,
- Range: Range,
- Repeat: Repeat,
-
- is: is,
- fromJS: fromJS
-
- };
-
- return Immutable;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/object-assign/index.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
-}
-
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
-
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/process/browser.js":
-/***/ (function(module, exports) {
-
-// shim for using process in browser
-var process = module.exports = {};
-
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
-
-var cachedSetTimeout;
-var cachedClearTimeout;
-
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-process.prependListener = noop;
-process.prependOnceListener = noop;
-
-process.listeners = function (name) { return [] }
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-
-/***/ }),
-
-/***/ "./node_modules/promise/setimmediate/core.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(setImmediate) {
-
-
-
-function noop() {}
-
-// States:
-//
-// 0 - pending
-// 1 - fulfilled with _value
-// 2 - rejected with _value
-// 3 - adopted the state of another promise, _value
-//
-// once the state is no longer pending (0) it is immutable
-
-// All `_` prefixed properties will be reduced to `_{random number}`
-// at build time to obfuscate them and discourage their use.
-// We don't use symbols or Object.defineProperty to fully hide them
-// because the performance isn't good enough.
-
-
-// to avoid using try/catch inside critical functions, we
-// extract them to here.
-var LAST_ERROR = null;
-var IS_ERROR = {};
-function getThen(obj) {
- try {
- return obj.then;
- } catch (ex) {
- LAST_ERROR = ex;
- return IS_ERROR;
- }
-}
-
-function tryCallOne(fn, a) {
- try {
- return fn(a);
- } catch (ex) {
- LAST_ERROR = ex;
- return IS_ERROR;
- }
-}
-function tryCallTwo(fn, a, b) {
- try {
- fn(a, b);
- } catch (ex) {
- LAST_ERROR = ex;
- return IS_ERROR;
- }
-}
-
-module.exports = Promise;
-
-function Promise(fn) {
- if (typeof this !== 'object') {
- throw new TypeError('Promises must be constructed via new');
- }
- if (typeof fn !== 'function') {
- throw new TypeError('Promise constructor\'s argument is not a function');
- }
- this._48 = 0;
- this._81 = 0;
- this._1 = null;
- this._36 = null;
- if (fn === noop) return;
- doResolve(fn, this);
-}
-Promise._66 = null;
-Promise._40 = null;
-Promise._21 = noop;
-
-Promise.prototype.then = function(onFulfilled, onRejected) {
- if (this.constructor !== Promise) {
- return safeThen(this, onFulfilled, onRejected);
- }
- var res = new Promise(noop);
- handle(this, new Handler(onFulfilled, onRejected, res));
- return res;
-};
-
-function safeThen(self, onFulfilled, onRejected) {
- return new self.constructor(function (resolve, reject) {
- var res = new Promise(noop);
- res.then(resolve, reject);
- handle(self, new Handler(onFulfilled, onRejected, res));
- });
-}
-function handle(self, deferred) {
- while (self._81 === 3) {
- self = self._1;
- }
- if (Promise._66) {
- Promise._66(self);
- }
- if (self._81 === 0) {
- if (self._48 === 0) {
- self._48 = 1;
- self._36 = deferred;
- return;
- }
- if (self._48 === 1) {
- self._48 = 2;
- self._36 = [self._36, deferred];
- return;
- }
- self._36.push(deferred);
- return;
- }
- handleResolved(self, deferred);
-}
-
-function handleResolved(self, deferred) {
- setImmediate(function() {
- var cb = self._81 === 1 ? deferred.onFulfilled : deferred.onRejected;
- if (cb === null) {
- if (self._81 === 1) {
- resolve(deferred.promise, self._1);
- } else {
- reject(deferred.promise, self._1);
- }
- return;
- }
- var ret = tryCallOne(cb, self._1);
- if (ret === IS_ERROR) {
- reject(deferred.promise, LAST_ERROR);
- } else {
- resolve(deferred.promise, ret);
- }
- });
-}
-function resolve(self, newValue) {
- // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
- if (newValue === self) {
- return reject(
- self,
- new TypeError('A promise cannot be resolved with itself.')
- );
- }
- if (
- newValue &&
- (typeof newValue === 'object' || typeof newValue === 'function')
- ) {
- var then = getThen(newValue);
- if (then === IS_ERROR) {
- return reject(self, LAST_ERROR);
- }
- if (
- then === self.then &&
- newValue instanceof Promise
- ) {
- self._81 = 3;
- self._1 = newValue;
- finale(self);
- return;
- } else if (typeof then === 'function') {
- doResolve(then.bind(newValue), self);
- return;
- }
- }
- self._81 = 1;
- self._1 = newValue;
- finale(self);
-}
-
-function reject(self, newValue) {
- self._81 = 2;
- self._1 = newValue;
- if (Promise._40) {
- Promise._40(self, newValue);
- }
- finale(self);
-}
-function finale(self) {
- if (self._48 === 1) {
- handle(self, self._36);
- self._36 = null;
- }
- if (self._48 === 2) {
- for (var i = 0; i < self._36.length; i++) {
- handle(self, self._36[i]);
- }
- self._36 = null;
- }
-}
-
-function Handler(onFulfilled, onRejected, promise){
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
- this.promise = promise;
-}
-
-/**
- * Take a potentially misbehaving resolver function and make sure
- * onFulfilled and onRejected are only called once.
- *
- * Makes no guarantees about asynchrony.
- */
-function doResolve(fn, promise) {
- var done = false;
- var res = tryCallTwo(fn, function (value) {
- if (done) return;
- done = true;
- resolve(promise, value);
- }, function (reason) {
- if (done) return;
- done = true;
- reject(promise, reason);
- });
- if (!done && res === IS_ERROR) {
- done = true;
- reject(promise, LAST_ERROR);
- }
-}
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/timers-browserify/main.js").setImmediate))
-
-/***/ }),
-
-/***/ "./node_modules/promise/setimmediate/done.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Promise = __webpack_require__("./node_modules/promise/setimmediate/core.js");
-
-module.exports = Promise;
-Promise.prototype.done = function (onFulfilled, onRejected) {
- var self = arguments.length ? this.then.apply(this, arguments) : this;
- self.then(null, function (err) {
- setTimeout(function () {
- throw err;
- }, 0);
- });
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/promise/setimmediate/es6-extensions.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-//This file contains the ES6 extensions to the core Promises/A+ API
-
-var Promise = __webpack_require__("./node_modules/promise/setimmediate/core.js");
-
-module.exports = Promise;
-
-/* Static Functions */
-
-var TRUE = valuePromise(true);
-var FALSE = valuePromise(false);
-var NULL = valuePromise(null);
-var UNDEFINED = valuePromise(undefined);
-var ZERO = valuePromise(0);
-var EMPTYSTRING = valuePromise('');
-
-function valuePromise(value) {
- var p = new Promise(Promise._21);
- p._81 = 1;
- p._1 = value;
- return p;
-}
-Promise.resolve = function (value) {
- if (value instanceof Promise) return value;
-
- if (value === null) return NULL;
- if (value === undefined) return UNDEFINED;
- if (value === true) return TRUE;
- if (value === false) return FALSE;
- if (value === 0) return ZERO;
- if (value === '') return EMPTYSTRING;
-
- if (typeof value === 'object' || typeof value === 'function') {
- try {
- var then = value.then;
- if (typeof then === 'function') {
- return new Promise(then.bind(value));
- }
- } catch (ex) {
- return new Promise(function (resolve, reject) {
- reject(ex);
- });
- }
- }
- return valuePromise(value);
-};
-
-Promise.all = function (arr) {
- var args = Array.prototype.slice.call(arr);
-
- return new Promise(function (resolve, reject) {
- if (args.length === 0) return resolve([]);
- var remaining = args.length;
- function res(i, val) {
- if (val && (typeof val === 'object' || typeof val === 'function')) {
- if (val instanceof Promise && val.then === Promise.prototype.then) {
- while (val._81 === 3) {
- val = val._1;
- }
- if (val._81 === 1) return res(i, val._1);
- if (val._81 === 2) reject(val._1);
- val.then(function (val) {
- res(i, val);
- }, reject);
- return;
- } else {
- var then = val.then;
- if (typeof then === 'function') {
- var p = new Promise(then.bind(val));
- p.then(function (val) {
- res(i, val);
- }, reject);
- return;
- }
- }
- }
- args[i] = val;
- if (--remaining === 0) {
- resolve(args);
- }
- }
- for (var i = 0; i < args.length; i++) {
- res(i, args[i]);
- }
- });
-};
-
-Promise.reject = function (value) {
- return new Promise(function (resolve, reject) {
- reject(value);
- });
-};
-
-Promise.race = function (values) {
- return new Promise(function (resolve, reject) {
- values.forEach(function(value){
- Promise.resolve(value).then(resolve, reject);
- });
- });
-};
-
-/* Prototype Methods */
-
-Promise.prototype['catch'] = function (onRejected) {
- return this.then(null, onRejected);
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/react-clone-referenced-element/cloneReferencedElement.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i2?_len-2:0),_key=2;_key<_len;_key++){children[_key-2]=arguments[_key];}if(originalRef==null||cloneRef==null){return React.cloneElement.apply(React,[element,config].concat(children));}if(typeof originalRef!=='function'){if(false){console.warn('Cloning an element with a ref that will be overwritten because it '+'is not a function. Use a composable callback-style ref instead. '+'Ignoring ref: '+originalRef);}return React.cloneElement.apply(React,[element,config].concat(children));}return React.cloneElement.apply(React,[element,_extends({},config,{ref:function ref(component){cloneRef(component);originalRef(component);}})].concat(children));}module.exports=cloneReferencedElement;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/ART/ARTSerializablePath.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Class=__webpack_require__("./node_modules/art/core/class.js");var Path=__webpack_require__("./node_modules/art/core/path.js");var MOVE_TO=0;var CLOSE=1;var LINE_TO=2;var CURVE_TO=3;var ARC=4;var SerializablePath=Class(Path,{initialize:function initialize(path){this.reset();if(path instanceof SerializablePath){this.path=path.path.slice(0);}else if(path){if(path.applyToPath){path.applyToPath(this);}else{this.push(path);}}},onReset:function onReset(){this.path=[];},onMove:function onMove(sx,sy,x,y){this.path.push(MOVE_TO,x,y);},onLine:function onLine(sx,sy,x,y){this.path.push(LINE_TO,x,y);},onBezierCurve:function onBezierCurve(sx,sy,p1x,p1y,p2x,p2y,x,y){this.path.push(CURVE_TO,p1x,p1y,p2x,p2y,x,y);},_arcToBezier:Path.prototype.onArc,onArc:function onArc(sx,sy,ex,ey,cx,cy,rx,ry,sa,ea,ccw,rotation){if(rx!==ry||rotation){return this._arcToBezier(sx,sy,ex,ey,cx,cy,rx,ry,sa,ea,ccw,rotation);}this.path.push(ARC,cx,cy,rx,sa,ea,ccw?0:1);},onClose:function onClose(){this.path.push(CLOSE);},toJSON:function toJSON(){return this.path;}});module.exports=SerializablePath;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/ART/ReactNativeART.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/ART/ReactNativeART.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i must be a child of a ');return React.createElement(NativeGroup,{opacity:extractOpacity(props),transform:extractTransform(props),__source:{fileName:_jsxFileName,lineNumber:226}},this.props.children);}}]);return Group;}(React.Component);Group.contextTypes={isInSurface:React.PropTypes.bool.isRequired};var ClippingRectangle=function(_React$Component3){_inherits(ClippingRectangle,_React$Component3);function ClippingRectangle(){_classCallCheck(this,ClippingRectangle);return _possibleConstructorReturn(this,(ClippingRectangle.__proto__||Object.getPrototypeOf(ClippingRectangle)).apply(this,arguments));}_createClass(ClippingRectangle,[{key:'render',value:function render(){var props=this.props;var x=extractNumber(props.x,0);var y=extractNumber(props.y,0);var w=extractNumber(props.width,0);var h=extractNumber(props.height,0);var clipping=[x,y,w,h];var propsExcludingXAndY=merge(props);delete propsExcludingXAndY.x;delete propsExcludingXAndY.y;return React.createElement(NativeGroup,{clipping:clipping,opacity:extractOpacity(props),transform:extractTransform(propsExcludingXAndY),__source:{fileName:_jsxFileName,lineNumber:248}},this.props.children);}}]);return ClippingRectangle;}(React.Component);var SOLID_COLOR=0;var LINEAR_GRADIENT=1;var RADIAL_GRADIENT=2;var PATTERN=3;function insertColorIntoArray(color,targetArray,atIndex){var c=new Color(color);targetArray[atIndex+0]=c.red/255;targetArray[atIndex+1]=c.green/255;targetArray[atIndex+2]=c.blue/255;targetArray[atIndex+3]=c.alpha;}function insertColorsIntoArray(stops,targetArray,atIndex){var i=0;if('length'in stops){while(i3&&arguments[3]!==undefined?arguments[3]:'plain-text';var defaultValue=arguments[4];if(typeof type==='function'){console.warn('You passed a callback function as the "type" argument to AlertIOS.prompt(). React Native is '+'assuming you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) '+'signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue) '+'and the old syntax will be removed in a future version.');var callback=type;var defaultValue=message;RCTAlertManager.alertWithArgs({title:title||undefined,type:'plain-text',defaultValue:defaultValue},function(id,value){callback(value);});return;}var callbacks=[];var buttons=[];var cancelButtonKey;var destructiveButtonKey;if(typeof callbackOrButtons==='function'){callbacks=[callbackOrButtons];}else if(callbackOrButtons instanceof Array){callbackOrButtons.forEach(function(btn,index){callbacks[index]=btn.onPress;if(btn.style==='cancel'){cancelButtonKey=String(index);}else if(btn.style==='destructive'){destructiveButtonKey=String(index);}if(btn.text||index<(callbackOrButtons||[]).length-1){var btnDef={};btnDef[index]=btn.text||'';buttons.push(btnDef);}});}RCTAlertManager.alertWithArgs({title:title||undefined,message:message||undefined,buttons:buttons,type:type||undefined,defaultValue:defaultValue,cancelButtonKey:cancelButtonKey,destructiveButtonKey:destructiveButtonKey},function(id,value){var cb=callbacks[id];cb&&cb(value);});}}]);return AlertIOS;}();module.exports=AlertIOS;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/Animated.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i=_iterator.length)break;_ref=_iterator[_i++];}else{_i=_iterator.next();if(_i.done)break;_ref=_i.value;}var child=_ref;child.__makeNative();NativeAnimatedAPI.connectAnimatedNodes(this.__getNativeTag(),child.__getNativeTag());}}}},{key:'__addChild',value:function __addChild(child){if(this._children.length===0){this.__attach();}this._children.push(child);if(this.__isNative){child.__makeNative();NativeAnimatedAPI.connectAnimatedNodes(this.__getNativeTag(),child.__getNativeTag());}}},{key:'__removeChild',value:function __removeChild(child){var index=this._children.indexOf(child);if(index===-1){console.warn('Trying to remove a child that doesn\'t exist');return;}if(this.__isNative&&child.__isNative){NativeAnimatedAPI.disconnectAnimatedNodes(this.__getNativeTag(),child.__getNativeTag());}this._children.splice(index,1);if(this._children.length===0){this.__detach();}}},{key:'__getChildren',value:function __getChildren(){return this._children;}}]);return AnimatedWithChildren;}(Animated);function _flush(rootNode){var animatedStyles=new Set();function findAnimatedStyles(node){if(typeof node.update==='function'){animatedStyles.add(node);}else{node.__getChildren().forEach(findAnimatedStyles);}}findAnimatedStyles(rootNode);animatedStyles.forEach(function(animatedStyle){return animatedStyle.update();});}var _easeInOut=void 0;function easeInOut(){if(!_easeInOut){var Easing=__webpack_require__("./node_modules/react-native/Libraries/Animated/src/Easing.js");_easeInOut=Easing.inOut(Easing.ease);}return _easeInOut;}var TimingAnimation=function(_Animation){_inherits(TimingAnimation,_Animation);function TimingAnimation(config){_classCallCheck(this,TimingAnimation);var _this2=_possibleConstructorReturn(this,(TimingAnimation.__proto__||Object.getPrototypeOf(TimingAnimation)).call(this));_this2._toValue=config.toValue;_this2._easing=config.easing!==undefined?config.easing:easeInOut();_this2._duration=config.duration!==undefined?config.duration:500;_this2._delay=config.delay!==undefined?config.delay:0;_this2.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;_this2._useNativeDriver=shouldUseNativeDriver(config);return _this2;}_createClass(TimingAnimation,[{key:'__getNativeAnimationConfig',value:function __getNativeAnimationConfig(){var frameDuration=1000.0/60.0;var frames=[];for(var dt=0.0;dt=this._startTime+this._duration){if(this._duration===0){this._onUpdate(this._toValue);}else{this._onUpdate(this._fromValue+this._easing(1)*(this._toValue-this._fromValue));}this.__debouncedOnEnd({finished:true});return;}this._onUpdate(this._fromValue+this._easing((now-this._startTime)/this._duration)*(this._toValue-this._fromValue));if(this.__active){this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop(){_get(TimingAnimation.prototype.__proto__||Object.getPrototypeOf(TimingAnimation.prototype),'stop',this).call(this);this.__active=false;clearTimeout(this._timeout);global.cancelAnimationFrame(this._animationFrame);this.__debouncedOnEnd({finished:false});}}]);return TimingAnimation;}(Animation);var DecayAnimation=function(_Animation2){_inherits(DecayAnimation,_Animation2);function DecayAnimation(config){_classCallCheck(this,DecayAnimation);var _this4=_possibleConstructorReturn(this,(DecayAnimation.__proto__||Object.getPrototypeOf(DecayAnimation)).call(this));_this4._deceleration=config.deceleration!==undefined?config.deceleration:0.998;_this4._velocity=config.velocity;_this4._useNativeDriver=shouldUseNativeDriver(config);_this4.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this4;}_createClass(DecayAnimation,[{key:'__getNativeAnimationConfig',value:function __getNativeAnimationConfig(){return{type:'decay',deceleration:this._deceleration,velocity:this._velocity};}},{key:'start',value:function start(fromValue,onUpdate,onEnd,previousAnimation,animatedValue){this.__active=true;this._lastValue=fromValue;this._fromValue=fromValue;this._onUpdate=onUpdate;this.__onEnd=onEnd;this._startTime=Date.now();if(this._useNativeDriver){this.__startNativeAnimation(animatedValue);}else{this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'onUpdate',value:function onUpdate(){var now=Date.now();var value=this._fromValue+this._velocity/(1-this._deceleration)*(1-Math.exp(-(1-this._deceleration)*(now-this._startTime)));this._onUpdate(value);if(Math.abs(this._lastValue-value)<0.1){this.__debouncedOnEnd({finished:true});return;}this._lastValue=value;if(this.__active){this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop(){_get(DecayAnimation.prototype.__proto__||Object.getPrototypeOf(DecayAnimation.prototype),'stop',this).call(this);this.__active=false;global.cancelAnimationFrame(this._animationFrame);this.__debouncedOnEnd({finished:false});}}]);return DecayAnimation;}(Animation);function withDefault(value,defaultValue){if(value===undefined||value===null){return defaultValue;}return value;}var SpringAnimation=function(_Animation3){_inherits(SpringAnimation,_Animation3);function SpringAnimation(config){_classCallCheck(this,SpringAnimation);var _this5=_possibleConstructorReturn(this,(SpringAnimation.__proto__||Object.getPrototypeOf(SpringAnimation)).call(this));_this5._overshootClamping=withDefault(config.overshootClamping,false);_this5._restDisplacementThreshold=withDefault(config.restDisplacementThreshold,0.001);_this5._restSpeedThreshold=withDefault(config.restSpeedThreshold,0.001);_this5._initialVelocity=config.velocity;_this5._lastVelocity=withDefault(config.velocity,0);_this5._toValue=config.toValue;_this5._useNativeDriver=shouldUseNativeDriver(config);_this5.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;var springConfig;if(config.bounciness!==undefined||config.speed!==undefined){invariant(config.tension===undefined&&config.friction===undefined,'You can only define bounciness/speed or tension/friction but not both');springConfig=SpringConfig.fromBouncinessAndSpeed(withDefault(config.bounciness,8),withDefault(config.speed,12));}else{springConfig=SpringConfig.fromOrigamiTensionAndFriction(withDefault(config.tension,40),withDefault(config.friction,7));}_this5._tension=springConfig.tension;_this5._friction=springConfig.friction;return _this5;}_createClass(SpringAnimation,[{key:'__getNativeAnimationConfig',value:function __getNativeAnimationConfig(){return{type:'spring',overshootClamping:this._overshootClamping,restDisplacementThreshold:this._restDisplacementThreshold,restSpeedThreshold:this._restSpeedThreshold,tension:this._tension,friction:this._friction,initialVelocity:withDefault(this._initialVelocity,this._lastVelocity),toValue:this._toValue};}},{key:'start',value:function start(fromValue,onUpdate,onEnd,previousAnimation,animatedValue){this.__active=true;this._startPosition=fromValue;this._lastPosition=this._startPosition;this._onUpdate=onUpdate;this.__onEnd=onEnd;this._lastTime=Date.now();if(previousAnimation instanceof SpringAnimation){var internalState=previousAnimation.getInternalState();this._lastPosition=internalState.lastPosition;this._lastVelocity=internalState.lastVelocity;this._lastTime=internalState.lastTime;}if(this._initialVelocity!==undefined&&this._initialVelocity!==null){this._lastVelocity=this._initialVelocity;}if(this._useNativeDriver){this.__startNativeAnimation(animatedValue);}else{this.onUpdate();}}},{key:'getInternalState',value:function getInternalState(){return{lastPosition:this._lastPosition,lastVelocity:this._lastVelocity,lastTime:this._lastTime};}},{key:'onUpdate',value:function onUpdate(){var position=this._lastPosition;var velocity=this._lastVelocity;var tempPosition=this._lastPosition;var tempVelocity=this._lastVelocity;var MAX_STEPS=64;var now=Date.now();if(now>this._lastTime+MAX_STEPS){now=this._lastTime+MAX_STEPS;}var TIMESTEP_MSEC=1;var numSteps=Math.floor((now-this._lastTime)/TIMESTEP_MSEC);for(var i=0;ithis._toValue;}else{isOvershooting=position1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,AnimatedEvent);this._argMapping=argMapping;this._listener=config.listener;this.__isNative=shouldUseNativeDriver(config);if(this.__isNative){invariant(!this._listener,'Listener is not supported for native driven events.');}if(false){this._validateMapping();}}_createClass(AnimatedEvent,[{key:'__attach',value:function __attach(viewRef,eventName){invariant(this.__isNative,'Only native driven events need to be attached.');var eventMappings=[];var traverse=function traverse(value,path){if(value instanceof AnimatedValue){value.__makeNative();eventMappings.push({nativeEventPath:path,animatedValueTag:value.__getNativeTag()});}else if(typeof value==='object'){for(var _key3 in value){traverse(value[_key3],path.concat(_key3));}}};invariant(this._argMapping[0]&&this._argMapping[0].nativeEvent,'Native driven events only support animated values contained inside `nativeEvent`.');traverse(this._argMapping[0].nativeEvent,[]);var viewTag=findNodeHandle(viewRef);eventMappings.forEach(function(mapping){NativeAnimatedAPI.addAnimatedEventToView(viewTag,eventName,mapping);});}},{key:'__detach',value:function __detach(viewTag,eventName){invariant(this.__isNative,'Only native driven events need to be detached.');NativeAnimatedAPI.removeAnimatedEventFromView(viewTag,eventName);}},{key:'__getHandler',value:function __getHandler(){var _this25=this;return function(){for(var _len=arguments.length,args=Array(_len),_key4=0;_key4<_len;_key4++){args[_key4]=arguments[_key4];}var traverse=function traverse(recMapping,recEvt,key){if(typeof recEvt==='number'&&recMapping instanceof AnimatedValue){recMapping.setValue(recEvt);}else if(typeof recMapping==='object'){for(var mappingKey in recMapping){traverse(recMapping[mappingKey],recEvt[mappingKey],mappingKey);}}};if(!_this25.__isNative){_this25._argMapping.forEach(function(mapping,idx){traverse(mapping,args[idx],'arg'+idx);});}if(_this25._listener){_this25._listener.apply(null,args);}};}},{key:'_validateMapping',value:function _validateMapping(){var traverse=function traverse(recMapping,recEvt,key){if(typeof recEvt==='number'){invariant(recMapping instanceof AnimatedValue,'Bad mapping of type '+typeof recMapping+' for key '+key+', event value must map to AnimatedValue');return;}invariant(typeof recMapping==='object','Bad mapping of type '+typeof recMapping+' for key '+key);invariant(typeof recEvt==='object','Bad event of type '+typeof recEvt+' for key '+key);for(var mappingKey in recMapping){traverse(recMapping[mappingKey],recEvt[mappingKey],mappingKey);}};}}]);return AnimatedEvent;}();var event=function event(argMapping,config){var animatedEvent=new AnimatedEvent(argMapping,config);if(animatedEvent.__isNative){return animatedEvent;}else{return animatedEvent.__getHandler();}};module.exports={Value:AnimatedValue,ValueXY:AnimatedValueXY,decay:decay,timing:timing,spring:spring,add:add,divide:divide,multiply:multiply,modulo:modulo,diffClamp:diffClamp,delay:delay,sequence:sequence,parallel:parallel,stagger:stagger,event:event,createAnimatedComponent:createAnimatedComponent,__PropsOnlyForTests:AnimatedProps};
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/Easing.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0?1:0;}},{key:'step1',value:function step1(n){return n>=1?1:0;}},{key:'linear',value:function linear(t){return t;}},{key:'ease',value:function ease(t){if(!_ease){_ease=Easing.bezier(0.42,0,1,1);}return _ease(t);}},{key:'quad',value:function quad(t){return t*t;}},{key:'cubic',value:function cubic(t){return t*t*t;}},{key:'poly',value:function poly(n){return function(t){return Math.pow(t,n);};}},{key:'sin',value:function sin(t){return 1-Math.cos(t*Math.PI/2);}},{key:'circle',value:function circle(t){return 1-Math.sqrt(1-t*t);}},{key:'exp',value:function exp(t){return Math.pow(2,10*(t-1));}},{key:'elastic',value:function elastic(){var bounciness=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var p=bounciness*Math.PI;return function(t){return 1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*p);};}},{key:'back',value:function back(s){if(s===undefined){s=1.70158;}return function(t){return t*t*((s+1)*t-s);};}},{key:'bounce',value:function bounce(t){if(t<1/2.75){return 7.5625*t*t;}if(t<2/2.75){t-=1.5/2.75;return 7.5625*t*t+0.75;}if(t<2.5/2.75){t-=2.25/2.75;return 7.5625*t*t+0.9375;}t-=2.625/2.75;return 7.5625*t*t+0.984375;}},{key:'bezier',value:function bezier(x1,y1,x2,y2){var _bezier=__webpack_require__("./node_modules/react-native/Libraries/Animated/src/bezier.js");return _bezier(x1,y1,x2,y2);}},{key:'in',value:function _in(easing){return easing;}},{key:'out',value:function out(easing){return function(t){return 1-easing(1-t);};}},{key:'inOut',value:function inOut(easing){return function(t){if(t<0.5){return easing(t*2)/2;}return 1-easing((1-t)*2)/2;};}}]);return Easing;}();module.exports=Easing;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/Interpolation.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;iinputMax){if(extrapolateRight==='identity'){return result;}else if(extrapolateRight==='clamp'){result=inputMax;}else if(extrapolateRight==='extend'){}}if(outputMin===outputMax){return outputMin;}if(inputMin===inputMax){if(input<=inputMin){return outputMin;}return outputMax;}if(inputMin===-Infinity){result=-result;}else if(inputMax===Infinity){result=result-inputMin;}else{result=(result-inputMin)/(inputMax-inputMin);}result=easing(result);if(outputMin===-Infinity){result=-result;}else if(outputMax===Infinity){result=result+outputMin;}else{result=result*(outputMax-outputMin)+outputMin;}return result;}function colorToRgba(input){var int32Color=normalizeColor(input);if(int32Color===null){return input;}int32Color=int32Color||0;var r=(int32Color&0xff000000)>>>24;var g=(int32Color&0x00ff0000)>>>16;var b=(int32Color&0x0000ff00)>>>8;var a=(int32Color&0x000000ff)/255;return'rgba('+r+', '+g+', '+b+', '+a+')';}var stringShapeRegex=/[0-9\.-]+/g;function createInterpolationFromStringOutputRange(config){var outputRange=config.outputRange;invariant(outputRange.length>=2,'Bad output range');outputRange=outputRange.map(colorToRgba);checkPattern(outputRange);var outputRanges=outputRange[0].match(stringShapeRegex).map(function(){return[];});outputRange.forEach(function(value){value.match(stringShapeRegex).forEach(function(number,i){outputRanges[i].push(+number);});});var interpolations=outputRange[0].match(stringShapeRegex).map(function(value,i){return Interpolation.create(_extends({},config,{outputRange:outputRanges[i]}));});var shouldRound=isRgbOrRgba(outputRange[0]);return function(input){var i=0;return outputRange[0].replace(stringShapeRegex,function(){var val=+interpolations[i++](input);var rounded=shouldRound&&i<4?Math.round(val):Math.round(val*1000)/1000;return String(rounded);});};}function isRgbOrRgba(range){return typeof range==='string'&&range.startsWith('rgb');}function checkPattern(arr){var pattern=arr[0].replace(stringShapeRegex,'');for(var i=1;i=input){break;}}return i-1;}function checkValidInputRange(arr){invariant(arr.length>=2,'inputRange must have at least 2 elements');for(var i=1;i=arr[i-1],'inputRange must be monotonically increasing '+arr);}}function checkInfiniteRange(name,arr){invariant(arr.length>=2,name+' must have at least 2 elements');invariant(arr.length!==2||arr[0]!==-Infinity||arr[1]!==Infinity,name+'cannot be ]-infinity;+infinity[ '+arr);}module.exports=Interpolation;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/NativeAnimatedHelper.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var NativeAnimatedModule=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").NativeAnimatedModule;var NativeEventEmitter=__webpack_require__("./node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var __nativeAnimatedNodeTagCount=1;var __nativeAnimationIdCount=1;var nativeEventEmitter=void 0;var API={createAnimatedNode:function createAnimatedNode(tag,config){assertNativeAnimatedModule();NativeAnimatedModule.createAnimatedNode(tag,config);},startListeningToAnimatedNodeValue:function startListeningToAnimatedNodeValue(tag){assertNativeAnimatedModule();NativeAnimatedModule.startListeningToAnimatedNodeValue(tag);},stopListeningToAnimatedNodeValue:function stopListeningToAnimatedNodeValue(tag){assertNativeAnimatedModule();NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag);},connectAnimatedNodes:function connectAnimatedNodes(parentTag,childTag){assertNativeAnimatedModule();NativeAnimatedModule.connectAnimatedNodes(parentTag,childTag);},disconnectAnimatedNodes:function disconnectAnimatedNodes(parentTag,childTag){assertNativeAnimatedModule();NativeAnimatedModule.disconnectAnimatedNodes(parentTag,childTag);},startAnimatingNode:function startAnimatingNode(animationId,nodeTag,config,endCallback){assertNativeAnimatedModule();NativeAnimatedModule.startAnimatingNode(animationId,nodeTag,config,endCallback);},stopAnimation:function stopAnimation(animationId){assertNativeAnimatedModule();NativeAnimatedModule.stopAnimation(animationId);},setAnimatedNodeValue:function setAnimatedNodeValue(nodeTag,value){assertNativeAnimatedModule();NativeAnimatedModule.setAnimatedNodeValue(nodeTag,value);},setAnimatedNodeOffset:function setAnimatedNodeOffset(nodeTag,offset){assertNativeAnimatedModule();NativeAnimatedModule.setAnimatedNodeOffset(nodeTag,offset);},flattenAnimatedNodeOffset:function flattenAnimatedNodeOffset(nodeTag){assertNativeAnimatedModule();NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag);},extractAnimatedNodeOffset:function extractAnimatedNodeOffset(nodeTag){assertNativeAnimatedModule();NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag);},connectAnimatedNodeToView:function connectAnimatedNodeToView(nodeTag,viewTag){assertNativeAnimatedModule();NativeAnimatedModule.connectAnimatedNodeToView(nodeTag,viewTag);},disconnectAnimatedNodeFromView:function disconnectAnimatedNodeFromView(nodeTag,viewTag){assertNativeAnimatedModule();NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag,viewTag);},dropAnimatedNode:function dropAnimatedNode(tag){assertNativeAnimatedModule();NativeAnimatedModule.dropAnimatedNode(tag);},addAnimatedEventToView:function addAnimatedEventToView(viewTag,eventName,eventMapping){assertNativeAnimatedModule();NativeAnimatedModule.addAnimatedEventToView(viewTag,eventName,eventMapping);},removeAnimatedEventFromView:function removeAnimatedEventFromView(viewTag,eventName){assertNativeAnimatedModule();NativeAnimatedModule.removeAnimatedEventFromView(viewTag,eventName);}};var PROPS_WHITELIST={style:{opacity:true,transform:true,scaleX:true,scaleY:true,translateX:true,translateY:true}};var TRANSFORM_WHITELIST={translateX:true,translateY:true,scale:true,scaleX:true,scaleY:true,rotate:true,rotateX:true,rotateY:true,perspective:true};function validateProps(params){for(var key in params){if(!PROPS_WHITELIST.hasOwnProperty(key)){throw new Error('Property \''+key+'\' is not supported by native animated module');}}}function validateTransform(configs){configs.forEach(function(config){if(!TRANSFORM_WHITELIST.hasOwnProperty(config.property)){throw new Error('Property \''+config.property+'\' is not supported by native animated module');}});}function validateStyles(styles){var STYLES_WHITELIST=PROPS_WHITELIST.style||{};for(var key in styles){if(!STYLES_WHITELIST.hasOwnProperty(key)){throw new Error('Style property \''+key+'\' is not supported by native animated module');}}}function validateInterpolation(config){var SUPPORTED_INTERPOLATION_PARAMS={inputRange:true,outputRange:true,extrapolate:true,extrapolateRight:true,extrapolateLeft:true};for(var key in config){if(!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)){throw new Error('Interpolation property \''+key+'\' is not supported by native animated module');}}}function generateNewNodeTag(){return __nativeAnimatedNodeTagCount++;}function generateNewAnimationId(){return __nativeAnimationIdCount++;}function assertNativeAnimatedModule(){invariant(NativeAnimatedModule,'Native animated module is not available');}function isNativeAnimatedAvailable(){return!!NativeAnimatedModule;}module.exports={API:API,validateProps:validateProps,validateStyles:validateStyles,validateTransform:validateTransform,validateInterpolation:validateInterpolation,generateNewNodeTag:generateNewNodeTag,generateNewAnimationId:generateNewAnimationId,assertNativeAnimatedModule:assertNativeAnimatedModule,isNativeAnimatedAvailable:isNativeAnimatedAvailable,get nativeEventEmitter(){if(!nativeEventEmitter){nativeEventEmitter=new NativeEventEmitter(NativeAnimatedModule);}return nativeEventEmitter;}};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/SpringConfig.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function tensionFromOrigamiValue(oValue){return(oValue-30)*3.62+194;}function frictionFromOrigamiValue(oValue){return(oValue-8)*3+25;}function fromOrigamiTensionAndFriction(tension,friction){return{tension:tensionFromOrigamiValue(tension),friction:frictionFromOrigamiValue(friction)};}function fromBouncinessAndSpeed(bounciness,speed){function normalize(value,startValue,endValue){return(value-startValue)/(endValue-startValue);}function projectNormal(n,start,end){return start+n*(end-start);}function linearInterpolation(t,start,end){return t*end+(1-t)*start;}function quadraticOutInterpolation(t,start,end){return linearInterpolation(2*t-t*t,start,end);}function b3Friction1(x){return 0.0007*Math.pow(x,3)-0.031*Math.pow(x,2)+0.64*x+1.28;}function b3Friction2(x){return 0.000044*Math.pow(x,3)-0.006*Math.pow(x,2)+0.36*x+2;}function b3Friction3(x){return 0.00000045*Math.pow(x,3)-0.000332*Math.pow(x,2)+0.1078*x+5.84;}function b3Nobounce(tension){if(tension<=18){return b3Friction1(tension);}else if(tension>18&&tension<=44){return b3Friction2(tension);}else{return b3Friction3(tension);}}var b=normalize(bounciness/1.7,0,20);b=projectNormal(b,0,0.8);var s=normalize(speed/1.7,0,20);var bouncyTension=projectNormal(s,0.5,200);var bouncyFriction=quadraticOutInterpolation(b,b3Nobounce(bouncyTension),0.01);return{tension:tensionFromOrigamiValue(bouncyTension),friction:frictionFromOrigamiValue(bouncyFriction)};}module.exports={fromOrigamiTensionAndFriction:fromOrigamiTensionAndFriction,fromBouncinessAndSpeed:fromBouncinessAndSpeed};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Animated/src/bezier.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var NEWTON_ITERATIONS=4;var NEWTON_MIN_SLOPE=0.001;var SUBDIVISION_PRECISION=0.0000001;var SUBDIVISION_MAX_ITERATIONS=10;var kSplineTableSize=11;var kSampleStepSize=1.0/(kSplineTableSize-1.0);var float32ArraySupported=typeof Float32Array==='function';function A(aA1,aA2){return 1.0-3.0*aA2+3.0*aA1;}function B(aA1,aA2){return 3.0*aA2-6.0*aA1;}function C(aA1){return 3.0*aA1;}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT;}function getSlope(aT,aA1,aA2){return 3.0*A(aA1,aA2)*aT*aT+2.0*B(aA1,aA2)*aT+C(aA1);}function binarySubdivide(aX,aA,aB,mX1,mX2){var currentX,currentT,i=0;do{currentT=aA+(aB-aA)/2.0;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0.0){aB=currentT;}else{aA=currentT;}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT,mX1,mX2);}else if(initialSlope===0.0){return guessForT;}else{return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize,mX1,mX2);}}return function BezierEasing(x){if(mX1===mY1&&mX2===mY2){return x;}if(x===0){return 0;}if(x===1){return 1;}return calcBezier(getTForX(x),mY1,mY2);};};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/AppState/AppState.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i>1;this._debugInfo[callId]=[moduleID,methodID];if(callId>DEBUG_INFO_LIMIT){delete this._debugInfo[callId-DEBUG_INFO_LIMIT];}}onFail&¶ms.push(this._callbackID);this._callbacks[this._callbackID++]=onFail;onSucc&¶ms.push(this._callbackID);this._callbacks[this._callbackID++]=onSucc;}if(false){global.nativeTraceBeginAsyncFlow&&global.nativeTraceBeginAsyncFlow(TRACE_TAG_REACT_APPS,'native',this._callID);}this._callID++;this._queue[MODULE_IDS].push(moduleID);this._queue[METHOD_IDS].push(methodID);if(false){JSON.stringify(params);deepFreezeAndThrowOnMutationInDev(params);}this._queue[PARAMS].push(params);var now=new Date().getTime();if(global.nativeFlushQueueImmediate&&now-this._lastFlush>=MIN_TIME_BETWEEN_FLUSHES_MS){global.nativeFlushQueueImmediate(this._queue);this._queue=[[],[],[],this._callID];this._lastFlush=now;}Systrace.counterEvent('pending_js_to_native_queue',this._queue[0].length);if(false){this.__spy({type:TO_NATIVE,module:this._remoteModuleTable[moduleID],method:this._remoteMethodTable[moduleID][methodID],args:params});}}},{key:'createDebugLookup',value:function createDebugLookup(moduleID,name,methods){if(false){this._remoteModuleTable[moduleID]=name;this._remoteMethodTable[moduleID]=methods;}}},{key:'__callImmediates',value:function __callImmediates(){Systrace.beginEvent('JSTimersExecution.callImmediates()');guard(function(){return JSTimersExecution.callImmediates();});Systrace.endEvent();}},{key:'__callFunction',value:function __callFunction(module,method,args){this._lastFlush=new Date().getTime();this._eventLoopStartTime=this._lastFlush;Systrace.beginEvent(module+'.'+method+'()');if(false){this.__spy({type:TO_JS,module:module,method:method,args:args});}var moduleMethods=this._callableModules[module];invariant(!!moduleMethods,'Module %s is not a registered callable module (calling %s)',module,method);invariant(!!moduleMethods[method],'Method %s does not exist on module %s',method,module);var result=moduleMethods[method].apply(moduleMethods,args);Systrace.endEvent();return result;}},{key:'__invokeCallback',value:function __invokeCallback(cbID,args){this._lastFlush=new Date().getTime();this._eventLoopStartTime=this._lastFlush;var callback=this._callbacks[cbID];if(false){var debug=this._debugInfo[cbID>>1];var _module=debug&&this._remoteModuleTable[debug[0]];var _method=debug&&this._remoteMethodTable[debug[0]][debug[1]];if(callback==null){var errorMessage='Callback with id '+cbID+': '+_module+'.'+_method+'() not found';if(_method){errorMessage='The callback '+_method+'() exists in module '+_module+', '+'but only one callback may be registered to a function in a native module.';}invariant(callback,errorMessage);}var profileName=debug?'':cbID;if(callback&&this.__spy&&__DEV__){this.__spy({type:TO_JS,module:null,method:profileName,args:args});}Systrace.beginEvent('MessageQueue.invokeCallback('+profileName+', '+stringifySafe(args)+')');}else{if(!callback){return;}}this._callbacks[cbID&~1]=null;this._callbacks[cbID|1]=null;callback.apply(null,args);if(false){Systrace.endEvent();}}}],[{key:'spy',value:function spy(spyOrToggle){if(spyOrToggle===true){MessageQueue.prototype.__spy=function(info){console.log((info.type===TO_JS?'N->JS':'JS->N')+' : '+(''+(info.module?info.module+'.':'')+info.method)+('('+JSON.stringify(info.args)+')'));};}else if(spyOrToggle===false){MessageQueue.prototype.__spy=null;}else{MessageQueue.prototype.__spy=spyOrToggle;}}}]);return MessageQueue;}();module.exports=MessageQueue;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var BatchedBridge=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js");var defineLazyObjectProperty=__webpack_require__("./node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");function genModule(config,moduleID){if(!config){return null;}var _config=_slicedToArray(config,5),moduleName=_config[0],constants=_config[1],methods=_config[2],promiseMethods=_config[3],syncMethods=_config[4];invariant(!moduleName.startsWith('RCT')&&!moduleName.startsWith('RK'),'Module name prefixes should\'ve been stripped by the native side '+'but wasn\'t for '+moduleName);if(!constants&&!methods){return{name:moduleName};}var module={};methods&&methods.forEach(function(methodName,methodID){var isPromise=promiseMethods&&arrayContains(promiseMethods,methodID);var isSync=syncMethods&&arrayContains(syncMethods,methodID);invariant(!isPromise||!isSync,'Cannot have a method that is both async and a sync hook');var methodType=isPromise?'promise':isSync?'sync':'async';module[methodName]=genMethod(moduleID,methodID,methodType);});_extends(module,constants);if(false){BatchedBridge.createDebugLookup(moduleID,moduleName,methods);}return{name:moduleName,module:module};}global.__fbGenNativeModule=genModule;function loadModule(name,moduleID){invariant(global.nativeRequireModuleConfig,'Can\'t lazily create module without nativeRequireModuleConfig');var config=global.nativeRequireModuleConfig(name);var info=genModule(config,moduleID);return info&&info.module;}function genMethod(moduleID,methodID,type){var fn=null;if(type==='promise'){fn=function fn(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return new Promise(function(resolve,reject){BatchedBridge.enqueueNativeCall(moduleID,methodID,args,function(data){return resolve(data);},function(errorData){return reject(createErrorFromErrorData(errorData));});});};}else if(type==='sync'){fn=function fn(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return global.nativeCallSyncHook(moduleID,methodID,args);};}else{fn=function fn(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3];}var lastArg=args.length>0?args[args.length-1]:null;var secondLastArg=args.length>1?args[args.length-2]:null;var hasSuccessCallback=typeof lastArg==='function';var hasErrorCallback=typeof secondLastArg==='function';hasErrorCallback&&invariant(hasSuccessCallback,'Cannot have a non-function arg after a function arg.');var onSuccess=hasSuccessCallback?lastArg:null;var onFail=hasErrorCallback?secondLastArg:null;var callbackCount=hasSuccessCallback+hasErrorCallback;args=args.slice(0,args.length-callbackCount);BatchedBridge.enqueueNativeCall(moduleID,methodID,args,onFail,onSuccess);};}fn.type=type;return fn;}function arrayContains(array,value){return array.indexOf(value)!==-1;}function createErrorFromErrorData(errorData){var message=errorData.message,extraErrorInfo=_objectWithoutProperties(errorData,['message']);var error=new Error(message);error.framesToPop=1;return _extends(error,extraErrorInfo);}var NativeModules={};if(global.nativeModuleProxy){NativeModules=global.nativeModuleProxy;}else{var bridgeConfig=global.__fbBatchedBridgeConfig;invariant(bridgeConfig,'__fbBatchedBridgeConfig is not set, cannot invoke native modules');(bridgeConfig.remoteModuleConfig||[]).forEach(function(config,moduleID){var info=genModule(config,moduleID);if(!info){return;}if(info.module){NativeModules[info.name]=info.module;}else{defineLazyObjectProperty(NativeModules,info.name,{get:function get(){return loadModule(info.name,moduleID);}});}});}module.exports=NativeModules;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/BugReporting/BugReporting.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[typeof Symbol==='function'?Symbol.iterator:'@@iterator'](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if((typeof Symbol==='function'?Symbol.iterator:'@@iterator')in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _createClass=function(){function defineProperties(target,props){for(var i=0;i=_iterator.length)break;_ref3=_iterator[_i++];}else{_i=_iterator.next();if(_i.done)break;_ref3=_i.value;}var _ref=_ref3;var _ref2=_slicedToArray(_ref,2);var _key=_ref2[0];var callback=_ref2[1];extraData[_key]=callback();}var fileData={};for(var _iterator2=BugReporting._fileSources,_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref6;if(_isArray2){if(_i2>=_iterator2.length)break;_ref6=_iterator2[_i2++];}else{_i2=_iterator2.next();if(_i2.done)break;_ref6=_i2.value;}var _ref4=_ref6;var _ref5=_slicedToArray(_ref4,2);var _key2=_ref5[0];var _callback=_ref5[1];fileData[_key2]=_callback();}infoLog('BugReporting extraData:',extraData);var BugReportingNativeModule=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").BugReporting;BugReportingNativeModule&&BugReportingNativeModule.setExtraData&&BugReportingNativeModule.setExtraData(extraData,fileData);return{extras:extraData,files:fileData};}}]);return BugReporting;}();BugReporting._extraSources=new Map();BugReporting._fileSources=new Map();BugReporting._subscription=null;module.exports=BugReporting;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/BugReporting/dumpReactTree.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactNativeMount=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeMount.js");var getReactData=__webpack_require__("./node_modules/react-native/Libraries/BugReporting/getReactData.js");var INDENTATION_SIZE=2;var MAX_DEPTH=2;var MAX_STRING_LENGTH=50;function dumpReactTree(){try{return getReactTree();}catch(e){return'Failed to dump react tree: '+e;}}function getReactTree(){var output='';var rootIds=Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID);for(var _iterator=rootIds,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++];}else{_i=_iterator.next();if(_i.done)break;_ref=_i.value;}var rootId=_ref;var instance=ReactNativeMount._instancesByContainerID[rootId];output+='============ Root ID: '+rootId+' ============\n';output+=dumpNode(instance,0);output+='============ End root ID: '+rootId+' ============\n';}return output;}function dumpNode(node,identation){var data=getReactData(node);if(data.nodeType==='Text'){return indent(identation)+data.text+'\n';}else if(data.nodeType==='Empty'){return'';}var output=indent(identation)+('<'+data.name);if(data.nodeType==='Composite'){for(var _iterator2=Object.getOwnPropertyNames(data.props||{}),_isArray2=Array.isArray(_iterator2),_i2=0,_iterator2=_isArray2?_iterator2:_iterator2[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref2;if(_isArray2){if(_i2>=_iterator2.length)break;_ref2=_iterator2[_i2++];}else{_i2=_iterator2.next();if(_i2.done)break;_ref2=_i2.value;}var propName=_ref2;if(isNormalProp(propName)){try{var value=convertValue(data.props[propName]);if(value){output+=' '+propName+'='+value;}}catch(e){var message='[Failed to get property: '+e+']';output+=' '+propName+'='+message;}}}}var childOutput='';for(var _iterator3=data.children||[],_isArray3=Array.isArray(_iterator3),_i3=0,_iterator3=_isArray3?_iterator3:_iterator3[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref3;if(_isArray3){if(_i3>=_iterator3.length)break;_ref3=_iterator3[_i3++];}else{_i3=_iterator3.next();if(_i3.done)break;_ref3=_i3.value;}var child=_ref3;childOutput+=dumpNode(child,identation+1);}if(childOutput){output+='>\n'+childOutput+indent(identation)+(''+data.name+'>\n');}else{output+=' />\n';}return output;}function isNormalProp(name){switch(name){case'children':case'key':case'ref':return false;default:return true;}}function convertObject(object,depth){if(depth>=MAX_DEPTH){return'[...omitted]';}var output='{';var first=true;for(var _iterator4=Object.getOwnPropertyNames(object),_isArray4=Array.isArray(_iterator4),_i4=0,_iterator4=_isArray4?_iterator4:_iterator4[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref4;if(_isArray4){if(_i4>=_iterator4.length)break;_ref4=_iterator4[_i4++];}else{_i4=_iterator4.next();if(_i4.done)break;_ref4=_i4.value;}var key=_ref4;if(!first){output+=', ';}output+=key+': '+convertValue(object[key],depth+1);first=false;}return output+'}';}function convertValue(value){var depth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!value){return null;}switch(typeof value){case'string':return JSON.stringify(possiblyEllipsis(value).replace('\n','\\n'));case'boolean':case'number':return JSON.stringify(value);case'function':return'[function]';case'object':return convertObject(value,depth);default:return null;}}function possiblyEllipsis(value){if(value.length>MAX_STRING_LENGTH){return value.slice(0,MAX_STRING_LENGTH)+'...';}else{return value;}}function indent(size){return' '.repeat(size*INDENTATION_SIZE);}module.exports=dumpReactTree;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/BugReporting/getReactData.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i=path.length){return value;}var key=path[idx];var updated=Array.isArray(obj)?obj.slice():_extends({},obj);updated[key]=copyWithSetImpl(obj[key],path,idx+1,value);return updated;}function copyWithSet(obj,path,value){return copyWithSetImpl(obj,path,0,value);}module.exports=getData;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CameraRoll/CameraRoll.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0){mediaType='video';}return RCTCameraRollManager.saveToCameraRoll(tag,mediaType);}},{key:'getPhotos',value:function getPhotos(params){if(false){getPhotosParamChecker({params:params},'params','CameraRoll.getPhotos');}if(arguments.length>1){console.warn('CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead');var successCallback=arguments[1];if(false){var callback=arguments[1];successCallback=function successCallback(response){getPhotosReturnChecker({response:response},'response','CameraRoll.getPhotos callback');callback(response);};}var errorCallback=arguments[2]||function(){};RCTCameraRollManager.getPhotos(params).then(successCallback,errorCallback);}return RCTCameraRollManager.getPhotos(params);}}]);return CameraRoll;}();CameraRoll.GroupTypesOptions=GROUP_TYPES_OPTIONS;CameraRoll.AssetTypeOptions=ASSET_TYPE_OPTIONS;module.exports=CameraRoll;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CameraRoll/ImagePickerIOS.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var ColorPropType=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/ColorPropType.js");var NativeMethodsMixin=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/NativeMethodsMixin.js");var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var StyleSheet=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/StyleSheet.js");var View=__webpack_require__("./node_modules/react-native/Libraries/Components/View/View.js");var requireNativeComponent=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js");var PropTypes=React.PropTypes;var GRAY='#999999';var ActivityIndicator=React.createClass({displayName:'ActivityIndicator',mixins:[NativeMethodsMixin],propTypes:_extends({},View.propTypes,{animating:PropTypes.bool,color:ColorPropType,size:PropTypes.oneOfType([PropTypes.oneOf(['small','large']),PropTypes.number]),hidesWhenStopped:PropTypes.bool}),getDefaultProps:function getDefaultProps(){return{animating:true,color:Platform.OS==='ios'?GRAY:undefined,hidesWhenStopped:true,size:'small'};},render:function render(){var _props=this.props,onLayout=_props.onLayout,style=_props.style,props=_objectWithoutProperties(_props,['onLayout','style']);var sizeStyle=void 0;switch(props.size){case'small':sizeStyle=styles.sizeSmall;break;case'large':sizeStyle=styles.sizeLarge;break;default:sizeStyle={height:props.size,width:props.size};break;}return React.createElement(View,{onLayout:onLayout,style:[styles.container,style],__source:{fileName:_jsxFileName,lineNumber:94}},React.createElement(RCTActivityIndicator,_extends({},props,{style:sizeStyle,styleAttr:'Normal',indeterminate:true,__source:{fileName:_jsxFileName,lineNumber:97}})));}});var styles=StyleSheet.create({container:{alignItems:'center',justifyContent:'center'},sizeSmall:{width:20,height:20},sizeLarge:{width:36,height:36}});if(Platform.OS==='ios'){var RCTActivityIndicator=requireNativeComponent('RCTActivityIndicatorView',ActivityIndicator,{nativeOnly:{activityIndicatorViewStyle:true}});}else if(Platform.OS==='android'){var RCTActivityIndicator=requireNativeComponent('AndroidProgressBar',ActivityIndicator,{nativeOnly:{indeterminate:true,progress:true,styleAttr:true}});}module.exports=ActivityIndicator;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/AppleTV/TVEventHandler.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var TVNavigationEventEmitter=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").TVNavigationEventEmitter;var NativeEventEmitter=__webpack_require__("./node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js");function TVEventHandler(){this.__nativeTVNavigationEventListener=null;this.__nativeTVNavigationEventEmitter=null;}TVEventHandler.prototype.enable=function(component,callback){if(!TVNavigationEventEmitter){return;}this.__nativeTVNavigationEventEmitter=new NativeEventEmitter(TVNavigationEventEmitter);this.__nativeTVNavigationEventListener=this.__nativeTVNavigationEventEmitter.addListener('onTVNavEvent',function(data){if(callback){callback(component,data);}});};TVEventHandler.prototype.disable=function(){if(this.__nativeTVNavigationEventListener){this.__nativeTVNavigationEventListener.remove();delete this.__nativeTVNavigationEventListener;}if(this.__nativeTVNavigationEventEmitter){delete this.__nativeTVNavigationEventEmitter;}};module.exports=TVEventHandler;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/AppleTV/TVViewPropTypes.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var PropTypes=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js").PropTypes;var TVViewPropTypes={isTVSelectable:PropTypes.bool,hasTVPreferredFocus:PropTypes.bool,tvParallaxProperties:PropTypes.object,tvParallaxShiftDistanceX:PropTypes.number,tvParallaxShiftDistanceY:PropTypes.number,tvParallaxTiltAngle:PropTypes.number,tvParallaxMagnification:PropTypes.number};module.exports=TVViewPropTypes;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Button.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/Button.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var Keyboard=__webpack_require__("./node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js");var LayoutAnimation=__webpack_require__("./node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js");var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var TimerMixin=__webpack_require__("./node_modules/react-timer-mixin/TimerMixin.js");var View=__webpack_require__("./node_modules/react-native/Libraries/Components/View/View.js");var PropTypes=React.PropTypes;var viewRef='VIEW';var KeyboardAvoidingView=React.createClass({displayName:'KeyboardAvoidingView',mixins:[TimerMixin],propTypes:_extends({},View.propTypes,{behavior:PropTypes.oneOf(['height','position','padding']),contentContainerStyle:View.propTypes.style,keyboardVerticalOffset:PropTypes.number.isRequired}),getDefaultProps:function getDefaultProps(){return{keyboardVerticalOffset:0};},getInitialState:function getInitialState(){return{bottom:0};},subscriptions:[],frame:null,relativeKeyboardHeight:function relativeKeyboardHeight(keyboardFrame){var frame=this.frame;if(!frame||!keyboardFrame){return 0;}var y1=Math.max(frame.y,keyboardFrame.screenY-this.props.keyboardVerticalOffset);var y2=Math.min(frame.y+frame.height,keyboardFrame.screenY+keyboardFrame.height-this.props.keyboardVerticalOffset);if(frame.y>keyboardFrame.screenY){return frame.y+frame.height-keyboardFrame.screenY-this.props.keyboardVerticalOffset;}return Math.max(y2-y1,0);},onKeyboardChange:function onKeyboardChange(event){if(!event){this.setState({bottom:0});return;}var duration=event.duration,easing=event.easing,endCoordinates=event.endCoordinates;var height=this.relativeKeyboardHeight(endCoordinates);if(duration&&easing){LayoutAnimation.configureNext({duration:duration,update:{duration:duration,type:LayoutAnimation.Types[easing]||'keyboard'}});}this.setState({bottom:height});},onLayout:function onLayout(event){this.frame=event.nativeEvent.layout;},componentWillUpdate:function componentWillUpdate(nextProps,nextState,nextContext){if(nextState.bottom===this.state.bottom&&this.props.behavior==='height'&&nextProps.behavior==='height'){nextState.bottom=0;}},componentWillMount:function componentWillMount(){if(Platform.OS==='ios'){this.subscriptions=[Keyboard.addListener('keyboardWillChangeFrame',this.onKeyboardChange)];}else{this.subscriptions=[Keyboard.addListener('keyboardDidHide',this.onKeyboardChange),Keyboard.addListener('keyboardDidShow',this.onKeyboardChange)];}},componentWillUnmount:function componentWillUnmount(){this.subscriptions.forEach(function(sub){return sub.remove();});},render:function render(){var _props=this.props,behavior=_props.behavior,children=_props.children,style=_props.style,props=_objectWithoutProperties(_props,['behavior','children','style']);switch(behavior){case'height':var heightStyle=void 0;if(this.frame){heightStyle={height:this.frame.height-this.state.bottom,flex:0};}return React.createElement(View,_extends({ref:viewRef,style:[style,heightStyle],onLayout:this.onLayout},props,{__source:{fileName:_jsxFileName,lineNumber:169}}),children);case'position':var positionStyle={bottom:this.state.bottom};var contentContainerStyle=this.props.contentContainerStyle;return React.createElement(View,_extends({ref:viewRef,style:style,onLayout:this.onLayout},props,{__source:{fileName:_jsxFileName,lineNumber:179}}),React.createElement(View,{style:[contentContainerStyle,positionStyle],__source:{fileName:_jsxFileName,lineNumber:180}},children));case'padding':var paddingStyle={paddingBottom:this.state.bottom};return React.createElement(View,_extends({ref:viewRef,style:[style,paddingStyle],onLayout:this.onLayout},props,{__source:{fileName:_jsxFileName,lineNumber:189}}),children);default:return React.createElement(View,_extends({ref:viewRef,onLayout:this.onLayout,style:style},props,{__source:{fileName:_jsxFileName,lineNumber:196}}),children);}}});module.exports=KeyboardAvoidingView;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/MapView/MapView.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/MapView/MapView.js';var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var EventEmitter=__webpack_require__("./node_modules/react-native/Libraries/EventEmitter/EventEmitter.js");var Image=__webpack_require__("./node_modules/react-native/Libraries/Image/Image.ios.js");var NavigationContext=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js");var RCTNavigatorManager=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").NavigatorManager;var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var ReactNative=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js");var StaticContainer=__webpack_require__("./node_modules/react-native/Libraries/Components/StaticContainer.js");var StyleSheet=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/StyleSheet.js");var TVEventHandler=__webpack_require__("./node_modules/react-native/Libraries/Components/AppleTV/TVEventHandler.ios.js");var View=__webpack_require__("./node_modules/react-native/Libraries/Components/View/View.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var logError=__webpack_require__("./node_modules/react-native/Libraries/Utilities/logError.js");var requireNativeComponent=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js");var keyMirror=__webpack_require__("./node_modules/fbjs/lib/keyMirror.js");var TRANSITIONER_REF='transitionerRef';var PropTypes=React.PropTypes;var __uid=0;function getuid(){return __uid++;}var NavigatorTransitionerIOS=function(_React$Component){_inherits(NavigatorTransitionerIOS,_React$Component);function NavigatorTransitionerIOS(){_classCallCheck(this,NavigatorTransitionerIOS);return _possibleConstructorReturn(this,(NavigatorTransitionerIOS.__proto__||Object.getPrototypeOf(NavigatorTransitionerIOS)).apply(this,arguments));}_createClass(NavigatorTransitionerIOS,[{key:'requestSchedulingNavigation',value:function requestSchedulingNavigation(cb){RCTNavigatorManager.requestSchedulingJavaScriptNavigation(ReactNative.findNodeHandle(this),logError,cb);}},{key:'render',value:function render(){return React.createElement(RCTNavigator,_extends({},this.props,{__source:{fileName:_jsxFileName,lineNumber:51}}));}}]);return NavigatorTransitionerIOS;}(React.Component);var SystemIconLabels={done:true,cancel:true,edit:true,save:true,add:true,compose:true,reply:true,action:true,organize:true,bookmarks:true,search:true,refresh:true,stop:true,camera:true,trash:true,play:true,pause:true,rewind:true,'fast-forward':true,undo:true,redo:true,'page-curl':true};var SystemIcons=keyMirror(SystemIconLabels);var NavigatorIOS=React.createClass({displayName:'NavigatorIOS',propTypes:{initialRoute:PropTypes.shape({component:PropTypes.func.isRequired,title:PropTypes.string.isRequired,titleImage:Image.propTypes.source,passProps:PropTypes.object,backButtonIcon:Image.propTypes.source,backButtonTitle:PropTypes.string,leftButtonIcon:Image.propTypes.source,leftButtonTitle:PropTypes.string,leftButtonSystemIcon:PropTypes.oneOf(Object.keys(SystemIcons)),onLeftButtonPress:PropTypes.func,rightButtonIcon:Image.propTypes.source,rightButtonTitle:PropTypes.string,rightButtonSystemIcon:PropTypes.oneOf(Object.keys(SystemIcons)),onRightButtonPress:PropTypes.func,wrapperStyle:View.propTypes.style,navigationBarHidden:PropTypes.bool,shadowHidden:PropTypes.bool,tintColor:PropTypes.string,barTintColor:PropTypes.string,titleTextColor:PropTypes.string,translucent:PropTypes.bool}).isRequired,navigationBarHidden:PropTypes.bool,shadowHidden:PropTypes.bool,itemWrapperStyle:View.propTypes.style,tintColor:PropTypes.string,barTintColor:PropTypes.string,titleTextColor:PropTypes.string,translucent:PropTypes.bool,interactivePopGestureEnabled:PropTypes.bool},navigator:undefined,navigationContext:new NavigationContext(),componentWillMount:function componentWillMount(){this.navigator={push:this.push,pop:this.pop,popN:this.popN,replace:this.replace,replaceAtIndex:this.replaceAtIndex,replacePrevious:this.replacePrevious,replacePreviousAndPop:this.replacePreviousAndPop,resetTo:this.resetTo,popToRoute:this.popToRoute,popToTop:this.popToTop,navigationContext:this.navigationContext};this._emitWillFocus(this.state.routeStack[this.state.observedTopOfStack]);},componentDidMount:function componentDidMount(){this._emitDidFocus(this.state.routeStack[this.state.observedTopOfStack]);this._enableTVEventHandler();},componentWillUnmount:function componentWillUnmount(){this.navigationContext.dispose();this.navigationContext=new NavigationContext();this._disableTVEventHandler();},getDefaultProps:function getDefaultProps(){return{translucent:true};},getInitialState:function getInitialState(){return{idStack:[getuid()],routeStack:[this.props.initialRoute],requestedTopOfStack:0,observedTopOfStack:0,progress:1,fromIndex:0,toIndex:0,makingNavigatorRequest:false,updatingAllIndicesAtOrBeyond:0};},_toFocusOnNavigationComplete:undefined,_handleFocusRequest:function _handleFocusRequest(item){if(this.state.makingNavigatorRequest){this._toFocusOnNavigationComplete=item;}else{this._getFocusEmitter().emit('focus',item);}},_focusEmitter:undefined,_getFocusEmitter:function _getFocusEmitter(){var focusEmitter=this._focusEmitter;if(!focusEmitter){focusEmitter=new EventEmitter();this._focusEmitter=focusEmitter;}return focusEmitter;},getChildContext:function getChildContext(){return{onFocusRequested:this._handleFocusRequest,focusEmitter:this._getFocusEmitter()};},childContextTypes:{onFocusRequested:React.PropTypes.func,focusEmitter:React.PropTypes.instanceOf(EventEmitter)},_tryLockNavigator:function _tryLockNavigator(cb){this.refs[TRANSITIONER_REF].requestSchedulingNavigation(function(acquiredLock){return acquiredLock&&cb();});},_handleNavigatorStackChanged:function _handleNavigatorStackChanged(e){var newObservedTopOfStack=e.nativeEvent.stackLength-1;this._emitDidFocus(this.state.routeStack[newObservedTopOfStack]);invariant(newObservedTopOfStack<=this.state.requestedTopOfStack,'No navigator item should be pushed without JS knowing about it %s %s',newObservedTopOfStack,this.state.requestedTopOfStack);var wasWaitingForConfirmation=this.state.requestedTopOfStack!==this.state.observedTopOfStack;if(wasWaitingForConfirmation){invariant(newObservedTopOfStack===this.state.requestedTopOfStack,'If waiting for observedTopOfStack to reach requestedTopOfStack, '+'the only valid observedTopOfStack should be requestedTopOfStack.');}var nextState={observedTopOfStack:newObservedTopOfStack,makingNavigatorRequest:false,updatingAllIndicesAtOrBeyond:null,progress:1,toIndex:newObservedTopOfStack,fromIndex:newObservedTopOfStack};this.setState(nextState,this._eliminateUnneededChildren);},_eliminateUnneededChildren:function _eliminateUnneededChildren(){var updatingAllIndicesAtOrBeyond=this.state.routeStack.length>this.state.observedTopOfStack+1?this.state.observedTopOfStack+1:null;this.setState({idStack:this.state.idStack.slice(0,this.state.observedTopOfStack+1),routeStack:this.state.routeStack.slice(0,this.state.observedTopOfStack+1),requestedTopOfStack:this.state.observedTopOfStack,makingNavigatorRequest:true,updatingAllIndicesAtOrBeyond:updatingAllIndicesAtOrBeyond});},_emitDidFocus:function _emitDidFocus(route){this.navigationContext.emit('didfocus',{route:route});},_emitWillFocus:function _emitWillFocus(route){this.navigationContext.emit('willfocus',{route:route});},push:function push(route){var _this2=this;invariant(!!route,'Must supply route to push');if(this.state.requestedTopOfStack===this.state.observedTopOfStack){this._tryLockNavigator(function(){_this2._emitWillFocus(route);var nextStack=_this2.state.routeStack.concat([route]);var nextIDStack=_this2.state.idStack.concat([getuid()]);_this2.setState({idStack:nextIDStack,routeStack:nextStack,requestedTopOfStack:nextStack.length-1,makingNavigatorRequest:true,updatingAllIndicesAtOrBeyond:nextStack.length-1});});}},popN:function popN(n){var _this3=this;if(n===0){return;}if(this.state.requestedTopOfStack===this.state.observedTopOfStack){if(this.state.requestedTopOfStack>0){this._tryLockNavigator(function(){var newRequestedTopOfStack=_this3.state.requestedTopOfStack-n;invariant(newRequestedTopOfStack>=0,'Cannot pop below 0');_this3._emitWillFocus(_this3.state.routeStack[newRequestedTopOfStack]);_this3.setState({requestedTopOfStack:newRequestedTopOfStack,makingNavigatorRequest:true,updatingAllIndicesAtOrBeyond:_this3.state.requestedTopOfStack-n});});}}},pop:function pop(){this.popN(1);},replaceAtIndex:function replaceAtIndex(route,index){invariant(!!route,'Must supply route to replace');if(index<0){index+=this.state.routeStack.length;}if(this.state.routeStack.length<=index){return;}var nextIDStack=this.state.idStack.slice();var nextRouteStack=this.state.routeStack.slice();nextIDStack[index]=getuid();nextRouteStack[index]=route;this.setState({idStack:nextIDStack,routeStack:nextRouteStack,makingNavigatorRequest:false,updatingAllIndicesAtOrBeyond:index});this._emitWillFocus(route);this._emitDidFocus(route);},replace:function replace(route){this.replaceAtIndex(route,-1);},replacePrevious:function replacePrevious(route){this.replaceAtIndex(route,-2);},popToTop:function popToTop(){this.popToRoute(this.state.routeStack[0]);},popToRoute:function popToRoute(route){var indexOfRoute=this.state.routeStack.indexOf(route);invariant(indexOfRoute!==-1,'Calling pop to route for a route that doesn\'t exist!');var numToPop=this.state.routeStack.length-indexOfRoute-1;this.popN(numToPop);},replacePreviousAndPop:function replacePreviousAndPop(route){var _this4=this;if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){return;}if(this.state.routeStack.length<2){return;}this._tryLockNavigator(function(){_this4.replacePrevious(route);_this4.setState({requestedTopOfStack:_this4.state.requestedTopOfStack-1,makingNavigatorRequest:true});});},resetTo:function resetTo(route){invariant(!!route,'Must supply route to push');if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){return;}this.replaceAtIndex(route,0);this.popToRoute(route);},_handleNavigationComplete:function _handleNavigationComplete(e){e.stopPropagation();if(this._toFocusOnNavigationComplete){this._getFocusEmitter().emit('focus',this._toFocusOnNavigationComplete);this._toFocusOnNavigationComplete=null;}this._handleNavigatorStackChanged(e);},_routeToStackItem:function _routeToStackItem(routeArg,i){var component=routeArg.component,wrapperStyle=routeArg.wrapperStyle,passProps=routeArg.passProps,route=_objectWithoutProperties(routeArg,['component','wrapperStyle','passProps']);var _props=this.props,itemWrapperStyle=_props.itemWrapperStyle,props=_objectWithoutProperties(_props,['itemWrapperStyle']);var shouldUpdateChild=this.state.updatingAllIndicesAtOrBeyond!=null&&this.state.updatingAllIndicesAtOrBeyond>=i;var Component=component;return React.createElement(StaticContainer,{key:'nav'+i,shouldUpdate:shouldUpdateChild,__source:{fileName:_jsxFileName,lineNumber:855}},React.createElement(RCTNavigatorItem,_extends({},props,route,{style:[styles.stackItem,itemWrapperStyle,wrapperStyle],__source:{fileName:_jsxFileName,lineNumber:856}}),React.createElement(Component,_extends({navigator:this.navigator,route:route},passProps,{__source:{fileName:_jsxFileName,lineNumber:864}}))));},_renderNavigationStackItems:function _renderNavigationStackItems(){var shouldRecurseToNavigator=this.state.makingNavigatorRequest||this.state.updatingAllIndicesAtOrBeyond!==null;var items=shouldRecurseToNavigator?this.state.routeStack.map(this._routeToStackItem):null;return React.createElement(StaticContainer,{shouldUpdate:shouldRecurseToNavigator,__source:{fileName:_jsxFileName,lineNumber:883}},React.createElement(NavigatorTransitionerIOS,{ref:TRANSITIONER_REF,style:styles.transitioner,vertical:this.props.vertical,requestedTopOfStack:this.state.requestedTopOfStack,onNavigationComplete:this._handleNavigationComplete,interactivePopGestureEnabled:this.props.interactivePopGestureEnabled,__source:{fileName:_jsxFileName,lineNumber:884}},items));},_tvEventHandler:undefined,_enableTVEventHandler:function _enableTVEventHandler(){this._tvEventHandler=new TVEventHandler();this._tvEventHandler.enable(this,function(cmp,evt){if(evt&&evt.eventType==='menu'){cmp.pop();}});},_disableTVEventHandler:function _disableTVEventHandler(){if(this._tvEventHandler){this._tvEventHandler.disable();delete this._tvEventHandler;}},render:function render(){return React.createElement(View,{style:this.props.style,__source:{fileName:_jsxFileName,lineNumber:917}},this._renderNavigationStackItems());}});var styles=StyleSheet.create({stackItem:{backgroundColor:'white',overflow:'hidden',position:'absolute',top:0,left:0,right:0,bottom:0},transitioner:{flex:1}});var RCTNavigator=requireNativeComponent('RCTNavigator');var RCTNavigatorItem=requireNativeComponent('RCTNavItem');module.exports=NavigatorIOS;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Picker/Picker.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/Picker/Picker.js',_class,_temp;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var Dimensions=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Dimensions.js");var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var Keyboard=__webpack_require__("./node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js");var ReactNative=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js");var Subscribable=__webpack_require__("./node_modules/react-native/Libraries/Components/Subscribable.js");var TextInputState=__webpack_require__("./node_modules/react-native/Libraries/Components/TextInput/TextInputState.js");var UIManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/UIManager.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var _require=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeComponentTree.js"),getInstanceFromNode=_require.getInstanceFromNode;var _require2=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js"),ScrollViewManager=_require2.ScrollViewManager;var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var IS_ANIMATING_TOUCH_START_THRESHOLD_MS=16;function isTagInstanceOfTextInput(tag){var instance=getInstanceFromNode(tag);return instance&&instance.viewConfig&&(instance.viewConfig.uiViewClassName==='AndroidTextInput'||instance.viewConfig.uiViewClassName==='RCTTextView'||instance.viewConfig.uiViewClassName==='RCTTextField');}var ScrollResponderMixin={mixins:[Subscribable.Mixin],scrollResponderMixinGetInitialState:function scrollResponderMixinGetInitialState(){return{isTouching:false,lastMomentumScrollBeginTime:0,lastMomentumScrollEndTime:0,observedScrollSinceBecomingResponder:false,becameResponderWhileAnimating:false};},scrollResponderHandleScrollShouldSetResponder:function scrollResponderHandleScrollShouldSetResponder(){return this.state.isTouching;},scrollResponderHandleStartShouldSetResponder:function scrollResponderHandleStartShouldSetResponder(e){var currentlyFocusedTextInput=TextInputState.currentlyFocusedField();if(this.props.keyboardShouldPersistTaps==='handled'&¤tlyFocusedTextInput!=null&&e.target!==currentlyFocusedTextInput){return true;}return false;},scrollResponderHandleStartShouldSetResponderCapture:function scrollResponderHandleStartShouldSetResponderCapture(e){var currentlyFocusedTextInput=TextInputState.currentlyFocusedField();var keyboardShouldPersistTaps=this.props.keyboardShouldPersistTaps;var keyboardNeverPersistTaps=!keyboardShouldPersistTaps||keyboardShouldPersistTaps==='never';if(keyboardNeverPersistTaps&¤tlyFocusedTextInput!=null&&!isTagInstanceOfTextInput(e.target)){return true;}return this.scrollResponderIsAnimating();},scrollResponderHandleResponderReject:function scrollResponderHandleResponderReject(){},scrollResponderHandleTerminationRequest:function scrollResponderHandleTerminationRequest(){return!this.state.observedScrollSinceBecomingResponder;},scrollResponderHandleTouchEnd:function scrollResponderHandleTouchEnd(e){var nativeEvent=e.nativeEvent;this.state.isTouching=nativeEvent.touches.length!==0;this.props.onTouchEnd&&this.props.onTouchEnd(e);},scrollResponderHandleResponderRelease:function scrollResponderHandleResponderRelease(e){this.props.onResponderRelease&&this.props.onResponderRelease(e);var currentlyFocusedTextInput=TextInputState.currentlyFocusedField();if(this.props.keyboardShouldPersistTaps!==true&&this.props.keyboardShouldPersistTaps!=='always'&¤tlyFocusedTextInput!=null&&e.target!==currentlyFocusedTextInput&&!this.state.observedScrollSinceBecomingResponder&&!this.state.becameResponderWhileAnimating){this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e);TextInputState.blurTextInput(currentlyFocusedTextInput);}},scrollResponderHandleScroll:function scrollResponderHandleScroll(e){this.state.observedScrollSinceBecomingResponder=true;this.props.onScroll&&this.props.onScroll(e);},scrollResponderHandleResponderGrant:function scrollResponderHandleResponderGrant(e){this.state.observedScrollSinceBecomingResponder=false;this.props.onResponderGrant&&this.props.onResponderGrant(e);this.state.becameResponderWhileAnimating=this.scrollResponderIsAnimating();},scrollResponderHandleScrollBeginDrag:function scrollResponderHandleScrollBeginDrag(e){this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e);},scrollResponderHandleScrollEndDrag:function scrollResponderHandleScrollEndDrag(e){this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e);},scrollResponderHandleMomentumScrollBegin:function scrollResponderHandleMomentumScrollBegin(e){this.state.lastMomentumScrollBeginTime=Date.now();this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e);},scrollResponderHandleMomentumScrollEnd:function scrollResponderHandleMomentumScrollEnd(e){this.state.lastMomentumScrollEndTime=Date.now();this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e);},scrollResponderHandleTouchStart:function scrollResponderHandleTouchStart(e){this.state.isTouching=true;this.props.onTouchStart&&this.props.onTouchStart(e);},scrollResponderHandleTouchMove:function scrollResponderHandleTouchMove(e){this.props.onTouchMove&&this.props.onTouchMove(e);},scrollResponderIsAnimating:function scrollResponderIsAnimating(){var now=Date.now();var timeSinceLastMomentumScrollEnd=now-this.state.lastMomentumScrollEndTime;var isAnimating=timeSinceLastMomentumScrollEnd0&&arguments[0]!==undefined?arguments[0]:0;var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;console.warn('`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead');this.scrollTo({x:x,y:y,animated:false});},_handleScroll:function _handleScroll(e){if(false){if(this.props.onScroll&&this.props.scrollEventThrottle==null&&Platform.OS==='ios'){console.log('You specified `onScroll` on a but not '+'`scrollEventThrottle`. You will only receive one event. '+'Using `16` you get all the events but be aware that it may '+'cause frame drops, use a bigger number if you don\'t need as '+'much precision.');}}if(Platform.OS==='android'){if(this.props.keyboardDismissMode==='on-drag'){dismissKeyboard();}}this.scrollResponderHandleScroll(e);},_handleContentOnLayout:function _handleContentOnLayout(e){var _e$nativeEvent$layout=e.nativeEvent.layout,width=_e$nativeEvent$layout.width,height=_e$nativeEvent$layout.height;this.props.onContentSizeChange&&this.props.onContentSizeChange(width,height);},_scrollViewRef:null,_setScrollViewRef:function _setScrollViewRef(ref){this._scrollViewRef=ref;},_innerViewRef:null,_setInnerViewRef:function _setInnerViewRef(ref){this._innerViewRef=ref;},render:function render(){var contentContainerStyle=[this.props.horizontal&&styles.contentContainerHorizontal,this.props.contentContainerStyle];var style=void 0,childLayoutProps=void 0;if(false){style=flattenStyle(this.props.style);childLayoutProps=['alignItems','justifyContent'].filter(function(prop){return style&&style[prop]!==undefined;});invariant(childLayoutProps.length===0,'ScrollView child layout ('+JSON.stringify(childLayoutProps)+') must be applied through the contentContainerStyle prop.');}var contentSizeChangeProps={};if(this.props.onContentSizeChange){contentSizeChangeProps={onLayout:this._handleContentOnLayout};}var contentContainer=React.createElement(View,_extends({},contentSizeChangeProps,{ref:this._setInnerViewRef,style:contentContainerStyle,removeClippedSubviews:this.props.removeClippedSubviews,collapsable:false,__source:{fileName:_jsxFileName,lineNumber:492}}),this.props.children);var alwaysBounceHorizontal=this.props.alwaysBounceHorizontal!==undefined?this.props.alwaysBounceHorizontal:this.props.horizontal;var alwaysBounceVertical=this.props.alwaysBounceVertical!==undefined?this.props.alwaysBounceVertical:!this.props.horizontal;var baseStyle=this.props.horizontal?styles.baseHorizontal:styles.baseVertical;var props=_extends({},this.props,{alwaysBounceHorizontal:alwaysBounceHorizontal,alwaysBounceVertical:alwaysBounceVertical,style:[baseStyle,this.props.style],onContentSizeChange:null,onTouchStart:this.scrollResponderHandleTouchStart,onTouchMove:this.scrollResponderHandleTouchMove,onTouchEnd:this.scrollResponderHandleTouchEnd,onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag,onScrollEndDrag:this.scrollResponderHandleScrollEndDrag,onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin,onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd,onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder,onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture,onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder,onScroll:this._handleScroll,onResponderGrant:this.scrollResponderHandleResponderGrant,onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest,onResponderTerminate:this.scrollResponderHandleTerminate,onResponderRelease:this.scrollResponderHandleResponderRelease,onResponderReject:this.scrollResponderHandleResponderReject,sendMomentumEvents:this.props.onMomentumScrollBegin||this.props.onMomentumScrollEnd?true:false});var decelerationRate=this.props.decelerationRate;if(decelerationRate){props.decelerationRate=processDecelerationRate(decelerationRate);}var ScrollViewClass=void 0;if(Platform.OS==='ios'){ScrollViewClass=RCTScrollView;}else if(Platform.OS==='android'){if(this.props.horizontal){ScrollViewClass=AndroidHorizontalScrollView;}else{ScrollViewClass=AndroidScrollView;}}invariant(ScrollViewClass!==undefined,'ScrollViewClass must not be undefined');var refreshControl=this.props.refreshControl;if(refreshControl){if(Platform.OS==='ios'){return React.createElement(ScrollViewClass,_extends({},props,{ref:this._setScrollViewRef,__source:{fileName:_jsxFileName,lineNumber:564}}),refreshControl,contentContainer);}else if(Platform.OS==='android'){return React.cloneElement(refreshControl,{style:props.style},React.createElement(ScrollViewClass,_extends({},props,{style:baseStyle,ref:this._setScrollViewRef,__source:{fileName:_jsxFileName,lineNumber:579}}),contentContainer));}}return React.createElement(ScrollViewClass,_extends({},props,{ref:this._setScrollViewRef,__source:{fileName:_jsxFileName,lineNumber:586}}),contentContainer);}});var styles=StyleSheet.create({baseVertical:{flexGrow:1,flexShrink:1,flexDirection:'column',overflow:'scroll'},baseHorizontal:{flexGrow:1,flexShrink:1,flexDirection:'row',overflow:'scroll'},contentContainerHorizontal:{flexDirection:'row'}});var nativeOnlyProps=void 0,AndroidScrollView=void 0,AndroidHorizontalScrollView=void 0,RCTScrollView=void 0;if(Platform.OS==='android'){nativeOnlyProps={nativeOnly:{sendMomentumEvents:true}};AndroidScrollView=requireNativeComponent('RCTScrollView',ScrollView,nativeOnlyProps);AndroidHorizontalScrollView=requireNativeComponent('AndroidHorizontalScrollView',ScrollView,nativeOnlyProps);}else if(Platform.OS==='ios'){nativeOnlyProps={nativeOnly:{onMomentumScrollBegin:true,onMomentumScrollEnd:true,onScrollBeginDrag:true,onScrollEndDrag:true}};RCTScrollView=requireNativeComponent('RCTScrollView',ScrollView,nativeOnlyProps);}module.exports=ScrollView;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/ScrollView/processDecelerationRate.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function processDecelerationRate(decelerationRate){if(decelerationRate==='normal'){decelerationRate=0.998;}else if(decelerationRate==='fast'){decelerationRate=0.99;}return decelerationRate;}module.exports=processDecelerationRate;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js';var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var Image=__webpack_require__("./node_modules/react-native/Libraries/Image/Image.ios.js");var NativeMethodsMixin=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/NativeMethodsMixin.js");var ReactNativeViewAttributes=__webpack_require__("./node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js");var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var StyleSheet=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/StyleSheet.js");var View=__webpack_require__("./node_modules/react-native/Libraries/Components/View/View.js");var requireNativeComponent=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js");var PropTypes=React.PropTypes;var Slider=React.createClass({displayName:'Slider',mixins:[NativeMethodsMixin],propTypes:_extends({},View.propTypes,{style:View.propTypes.style,value:PropTypes.number,step:PropTypes.number,minimumValue:PropTypes.number,maximumValue:PropTypes.number,minimumTrackTintColor:PropTypes.string,maximumTrackTintColor:PropTypes.string,disabled:PropTypes.bool,trackImage:Image.propTypes.source,minimumTrackImage:Image.propTypes.source,maximumTrackImage:Image.propTypes.source,thumbImage:Image.propTypes.source,onValueChange:PropTypes.func,onSlidingComplete:PropTypes.func,testID:PropTypes.string}),getDefaultProps:function getDefaultProps(){return{disabled:false,value:0,minimumValue:0,maximumValue:1,step:0};},viewConfig:{uiViewClassName:'RCTSlider',validAttributes:_extends({},ReactNativeViewAttributes.RCTView,{value:true})},render:function render(){var _props=this.props,style=_props.style,onValueChange=_props.onValueChange,onSlidingComplete=_props.onSlidingComplete,props=_objectWithoutProperties(_props,['style','onValueChange','onSlidingComplete']);props.style=[styles.slider,style];props.onValueChange=onValueChange&&function(event){var userEvent=true;if(Platform.OS==='android'){userEvent=event.nativeEvent.fromUser;}onValueChange&&userEvent&&onValueChange(event.nativeEvent.value);};props.onChange=props.onValueChange;props.onSlidingComplete=onSlidingComplete&&function(event){onSlidingComplete&&onSlidingComplete(event.nativeEvent.value);};return React.createElement(RCTSlider,_extends({},props,{enabled:!this.props.disabled,onStartShouldSetResponder:function onStartShouldSetResponder(){return true;},onResponderTerminationRequest:function onResponderTerminationRequest(){return false;},__source:{fileName:_jsxFileName,lineNumber:172}}));}});var styles=void 0;if(Platform.OS==='ios'){styles=StyleSheet.create({slider:{height:40}});}else{styles=StyleSheet.create({slider:{}});}var options={};if(Platform.OS==='android'){options={nativeOnly:{enabled:true}};}var RCTSlider=requireNativeComponent('RCTSlider',Slider,options);module.exports=Slider;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/StaticContainer.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var ColorPropType=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/ColorPropType.js");var Image=__webpack_require__("./node_modules/react-native/Libraries/Image/Image.ios.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var StaticContainer=__webpack_require__("./node_modules/react-native/Libraries/Components/StaticContainer.js");var StyleSheet=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/StyleSheet.js");var View=__webpack_require__("./node_modules/react-native/Libraries/Components/View/View.js");var requireNativeComponent=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js");var TabBarItemIOS=function(_React$Component){_inherits(TabBarItemIOS,_React$Component);function TabBarItemIOS(){var _ref;var _temp,_this,_ret;_classCallCheck(this,TabBarItemIOS);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this=_possibleConstructorReturn(this,(_ref=TabBarItemIOS.__proto__||Object.getPrototypeOf(TabBarItemIOS)).call.apply(_ref,[this].concat(args))),_this),_this.state={hasBeenSelected:false},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(TabBarItemIOS,[{key:'componentWillMount',value:function componentWillMount(){if(this.props.selected){this.setState({hasBeenSelected:true});}}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps){if(this.state.hasBeenSelected||nextProps.selected){this.setState({hasBeenSelected:true});}}},{key:'render',value:function render(){var _props=this.props,style=_props.style,children=_props.children,props=_objectWithoutProperties(_props,['style','children']);if(this.state.hasBeenSelected){var tabContents=React.createElement(StaticContainer,{shouldUpdate:this.props.selected,__source:{fileName:_jsxFileName,lineNumber:121}},children);}else{var tabContents=React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:125}});}return React.createElement(RCTTabBarItem,_extends({},props,{style:[styles.tab,style],__source:{fileName:_jsxFileName,lineNumber:129}}),tabContents);}}]);return TabBarItemIOS;}(React.Component);TabBarItemIOS.propTypes=_extends({},View.propTypes,{badge:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),badgeColor:ColorPropType,systemIcon:React.PropTypes.oneOf(['bookmarks','contacts','downloads','favorites','featured','history','more','most-recent','most-viewed','recents','search','top-rated']),icon:Image.propTypes.source,selectedIcon:Image.propTypes.source,onPress:React.PropTypes.func,renderAsOriginal:React.PropTypes.bool,selected:React.PropTypes.bool,style:View.propTypes.style,title:React.PropTypes.string,isTVSelectable:React.PropTypes.bool});var styles=StyleSheet.create({tab:{position:'absolute',top:0,right:0,bottom:0,left:0}});var RCTTabBarItem=requireNativeComponent('RCTTabBarItem',TabBarItemIOS);module.exports=TabBarItemIOS;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/TextInput/TextInput.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/TextInput/TextInput.js';var _extends=Object.assign||function(target){for(var i=1;i=1){children=React.createElement(Text,{style:props.style,__source:{fileName:_jsxFileName,lineNumber:669}},children);}if(props.inputView){children=[children,props.inputView];}textContainer=React.createElement(RCTTextView,_extends({ref:this._setNativeRef},props,{children:children,onFocus:this._onFocus,onBlur:this._onBlur,onChange:this._onChange,onContentSizeChange:this.props.onContentSizeChange,onSelectionChange:this._onSelectionChange,onTextInput:this._onTextInput,onSelectionChangeShouldSetResponder:emptyFunction.thatReturnsTrue,text:this._getText(),dataDetectorTypes:this.props.dataDetectorTypes,onScroll:this._onScroll,__source:{fileName:_jsxFileName,lineNumber:675}}));}return React.createElement(TouchableWithoutFeedback,{onLayout:props.onLayout,onPress:this._onPress,rejectResponderTermination:true,accessible:props.accessible,accessibilityLabel:props.accessibilityLabel,accessibilityTraits:props.accessibilityTraits,testID:props.testID,__source:{fileName:_jsxFileName,lineNumber:693}},textContainer);},_renderAndroid:function _renderAndroid(){var props=_extends({},this.props);props.style=[this.props.style];props.autoCapitalize=UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];var children=this.props.children;var childCount=0;React.Children.forEach(children,function(){return++childCount;});invariant(!(this.props.value&&childCount),'Cannot specify both value and children.');if(childCount>1){children=React.createElement(Text,{__source:{fileName:_jsxFileName,lineNumber:719}},children);}if(props.selection&&props.selection.end==null){props.selection={start:props.selection.start,end:props.selection.start};}var textContainer=React.createElement(AndroidTextInput,_extends({ref:this._setNativeRef},props,{mostRecentEventCount:0,onFocus:this._onFocus,onBlur:this._onBlur,onChange:this._onChange,onSelectionChange:this._onSelectionChange,onTextInput:this._onTextInput,text:this._getText(),children:children,disableFullscreenUI:this.props.disableFullscreenUI,textBreakStrategy:this.props.textBreakStrategy,__source:{fileName:_jsxFileName,lineNumber:727}}));return React.createElement(TouchableWithoutFeedback,{onLayout:this.props.onLayout,onPress:this._onPress,accessible:this.props.accessible,accessibilityLabel:this.props.accessibilityLabel,accessibilityComponentType:this.props.accessibilityComponentType,testID:this.props.testID,__source:{fileName:_jsxFileName,lineNumber:743}},textContainer);},_onFocus:function _onFocus(event){if(this.props.onFocus){this.props.onFocus(event);}if(this.props.selectionState){this.props.selectionState.focus();}},_onPress:function _onPress(event){if(this.props.editable||this.props.editable===undefined){this.focus();}},_onChange:function _onChange(event){this._inputRef.setNativeProps({mostRecentEventCount:event.nativeEvent.eventCount});var text=event.nativeEvent.text;this.props.onChange&&this.props.onChange(event);this.props.onChangeText&&this.props.onChangeText(text);if(!this._inputRef){return;}this._lastNativeText=text;this.forceUpdate();},_onSelectionChange:function _onSelectionChange(event){this.props.onSelectionChange&&this.props.onSelectionChange(event);if(!this._inputRef){return;}this._lastNativeSelection=event.nativeEvent.selection;if(this.props.selection||this.props.selectionState){this.forceUpdate();}},componentDidUpdate:function componentDidUpdate(){var nativeProps={};if(this._lastNativeText!==this.props.value&&typeof this.props.value==='string'){nativeProps.text=this.props.value;}var selection=this.props.selection;if(this._lastNativeSelection&&selection&&(this._lastNativeSelection.start!==selection.start||this._lastNativeSelection.end!==selection.end)){nativeProps.selection=this.props.selection;}if(Object.keys(nativeProps).length>0){this._inputRef.setNativeProps(nativeProps);}if(this.props.selectionState&&selection){this.props.selectionState.update(selection.start,selection.end);}},_onBlur:function _onBlur(event){this.blur();if(this.props.onBlur){this.props.onBlur(event);}if(this.props.selectionState){this.props.selectionState.blur();}},_onTextInput:function _onTextInput(event){this.props.onTextInput&&this.props.onTextInput(event);},_onScroll:function _onScroll(event){this.props.onScroll&&this.props.onScroll(event);}});var styles=StyleSheet.create({input:{alignSelf:'stretch'}});module.exports=TextInput;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/TextInput/TextInputState.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var UIManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/UIManager.js");var TextInputState={_currentlyFocusedID:null,currentlyFocusedField:function currentlyFocusedField(){return this._currentlyFocusedID;},focusTextInput:function focusTextInput(textFieldID){if(this._currentlyFocusedID!==textFieldID&&textFieldID!==null){this._currentlyFocusedID=textFieldID;if(Platform.OS==='ios'){UIManager.focus(textFieldID);}else if(Platform.OS==='android'){UIManager.dispatchViewManagerCommand(textFieldID,UIManager.AndroidTextInput.Commands.focusTextInput,null);}}},blurTextInput:function blurTextInput(textFieldID){if(this._currentlyFocusedID===textFieldID&&textFieldID!==null){this._currentlyFocusedID=null;if(Platform.OS==='ios'){UIManager.blur(textFieldID);}else if(Platform.OS==='android'){UIManager.dispatchViewManagerCommand(textFieldID,UIManager.AndroidTextInput.Commands.blurTextInput,null);}}}};module.exports=TextInputState;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var TimePickerAndroid={open:function open(options){return regeneratorRuntime.async(function open$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt('return',Promise.reject({message:'TimePickerAndroid is not supported on this platform.'}));case 1:case'end':return _context.stop();}}},null,this);}};module.exports=TimePickerAndroid;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/ToastAndroid/ToastAndroid.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var ToastAndroid={show:function show(message,duration){warning(false,'ToastAndroid is not supported on this platform.');}};module.exports=ToastAndroid;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-module.exports=__webpack_require__("./node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js");
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Touchable/BoundingDimensions.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var PooledClass=__webpack_require__("./node_modules/react/lib/PooledClass.js");var twoArgumentPooler=PooledClass.twoArgumentPooler;function BoundingDimensions(width,height){this.width=width;this.height=height;}BoundingDimensions.prototype.destructor=function(){this.width=null;this.height=null;};BoundingDimensions.getPooledFromElement=function(element){return BoundingDimensions.getPooled(element.offsetWidth,element.offsetHeight);};PooledClass.addPoolingTo(BoundingDimensions,twoArgumentPooler);module.exports=BoundingDimensions;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Touchable/Position.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var PooledClass=__webpack_require__("./node_modules/react/lib/PooledClass.js");var twoArgumentPooler=PooledClass.twoArgumentPooler;function Position(left,top){this.left=left;this.top=top;}Position.prototype.destructor=function(){this.left=null;this.top=null;};PooledClass.addPoolingTo(Position,twoArgumentPooler);module.exports=Position;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Touchable/Touchable.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;iLONG_PRESS_ALLOWED_MOVEMENT){this._cancelLongPressDelayTimeout();}}var isTouchWithinActive=pageX>positionOnActivate.left-pressExpandLeft&&pageY>positionOnActivate.top-pressExpandTop&&pageX'));if(Touchable.TOUCH_TARGET_DEBUG&&child.type&&child.type.displayName==='View'){children=React.Children.toArray(children);children.push(Touchable.renderDebugView({color:'red',hitSlop:this.props.hitSlop}));}var style=Touchable.TOUCH_TARGET_DEBUG&&child.type&&child.type.displayName==='Text'?[child.props.style,{color:'red'}]:child.props.style;return React.cloneElement(child,{accessible:this.props.accessible!==false,accessibilityLabel:this.props.accessibilityLabel,accessibilityComponentType:this.props.accessibilityComponentType,accessibilityTraits:this.props.accessibilityTraits,testID:this.props.testID,onLayout:this.props.onLayout,hitSlop:this.props.hitSlop,onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest,onResponderGrant:this.touchableHandleResponderGrant,onResponderMove:this.touchableHandleResponderMove,onResponderRelease:this.touchableHandleResponderRelease,onResponderTerminate:this.touchableHandleResponderTerminate,style:style,children:children});}});module.exports=TouchableWithoutFeedback;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Touchable/ensureComponentIsNative.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var ensureComponentIsNative=function ensureComponentIsNative(component){invariant(component&&typeof component.setNativeProps==='function','Touchable child must either be native or forward setNativeProps to a '+'native component');};module.exports=ensureComponentIsNative;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/Touchable/ensurePositiveDelayProps.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var ensurePositiveDelayProps=function ensurePositiveDelayProps(props){invariant(!(props.delayPressIn<0||props.delayPressOut<0||props.delayLongPress<0),'Touchable components cannot have negative delay properties');};module.exports=ensurePositiveDelayProps;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i2?_len-2:0),_key=2;_key<_len;_key++){args[_key-2]=arguments[_key];}var id=_allocateCallback(function(){return func.apply(undefined,args);},'setTimeout');RCTTiming.createTimer(id,duration||0,Date.now(),false);return id;},setInterval:function setInterval(func,duration){for(var _len2=arguments.length,args=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){args[_key2-2]=arguments[_key2];}var id=_allocateCallback(function(){return func.apply(undefined,args);},'setInterval');RCTTiming.createTimer(id,duration||0,Date.now(),true);return id;},setImmediate:function setImmediate(func){for(var _len3=arguments.length,args=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}var id=_allocateCallback(function(){return func.apply(undefined,args);},'setImmediate');JSTimersExecution.immediates.push(id);return id;},requestAnimationFrame:function requestAnimationFrame(func){var id=_allocateCallback(func,'requestAnimationFrame');RCTTiming.createTimer(id,1,Date.now(),false);return id;},requestIdleCallback:function requestIdleCallback(func){if(JSTimersExecution.requestIdleCallbacks.length===0){RCTTiming.setSendIdleEvents(true);}var id=_allocateCallback(func,'requestIdleCallback');JSTimersExecution.requestIdleCallbacks.push(id);return id;},cancelIdleCallback:function cancelIdleCallback(timerID){_freeCallback(timerID);var index=JSTimersExecution.requestIdleCallbacks.indexOf(timerID);if(index!==-1){JSTimersExecution.requestIdleCallbacks.splice(index,1);}if(JSTimersExecution.requestIdleCallbacks.length===0){RCTTiming.setSendIdleEvents(false);}},clearTimeout:function clearTimeout(timerID){_freeCallback(timerID);},clearInterval:function clearInterval(timerID){_freeCallback(timerID);},clearImmediate:function clearImmediate(timerID){_freeCallback(timerID);var index=JSTimersExecution.immediates.indexOf(timerID);if(index!==-1){JSTimersExecution.immediates.splice(index,1);}},cancelAnimationFrame:function cancelAnimationFrame(timerID){_freeCallback(timerID);}};module.exports=JSTimers;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Core/Timers/JSTimersExecution.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Systrace=__webpack_require__("./node_modules/react-native/Libraries/Performance/Systrace.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var performanceNow=__webpack_require__("./node_modules/fbjs/lib/performanceNow.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var FRAME_DURATION=1000/60;var IDLE_CALLBACK_FRAME_DEADLINE=1;var hasEmittedTimeDriftWarning=false;var JSTimersExecution={GUID:1,callbacks:[],types:[],timerIDs:[],immediates:[],requestIdleCallbacks:[],identifiers:[],errors:null,callTimer:function callTimer(timerID,frameTime){warning(timerID<=JSTimersExecution.GUID,'Tried to call timer with ID %s but no such timer exists.',timerID);var timerIndex=JSTimersExecution.timerIDs.indexOf(timerID);if(timerIndex===-1){return;}var type=JSTimersExecution.types[timerIndex];var callback=JSTimersExecution.callbacks[timerIndex];if(!callback||!type){console.error('No callback found for timerID '+timerID);return;}if(false){var identifier=JSTimersExecution.identifiers[timerIndex]||{};Systrace.beginEvent('Systrace.callTimer: '+identifier.methodName);}if(type==='setTimeout'||type==='setImmediate'||type==='requestAnimationFrame'||type==='requestIdleCallback'){JSTimersExecution._clearIndex(timerIndex);}try{if(type==='setTimeout'||type==='setInterval'||type==='setImmediate'){callback();}else if(type==='requestAnimationFrame'){callback(performanceNow());}else if(type==='requestIdleCallback'){callback({timeRemaining:function timeRemaining(){return Math.max(0,FRAME_DURATION-(performanceNow()-frameTime));}});}else{console.error('Tried to call a callback with invalid type: '+type);}}catch(e){if(!JSTimersExecution.errors){JSTimersExecution.errors=[e];}else{JSTimersExecution.errors.push(e);}}if(false){Systrace.endEvent();}},callTimers:function callTimers(timerIDs){invariant(timerIDs.length!==0,'Cannot call `callTimers` with an empty list of IDs.');JSTimersExecution.errors=null;for(var i=0;i1){for(var ii=1;ii0){var passIdleCallbacks=JSTimersExecution.requestIdleCallbacks.slice();JSTimersExecution.requestIdleCallbacks=[];for(var i=0;i0){var passImmediates=JSTimersExecution.immediates.slice();JSTimersExecution.immediates=[];for(var i=0;i0;},callImmediates:function callImmediates(){JSTimersExecution.errors=null;while(JSTimersExecution.callImmediatesPass()){}if(JSTimersExecution.errors){JSTimersExecution.errors.forEach(function(error){return __webpack_require__("./node_modules/react-native/Libraries/Core/Timers/JSTimers.js").setTimeout(function(){throw error;},0);});}},emitTimeDriftWarning:function emitTimeDriftWarning(warningMessage){if(hasEmittedTimeDriftWarning){return;}hasEmittedTimeDriftWarning=true;console.warn(warningMessage);},_clearIndex:function _clearIndex(i){JSTimersExecution.timerIDs[i]=null;JSTimersExecution.callbacks[i]=null;JSTimersExecution.types[i]=null;JSTimersExecution.identifiers[i]=null;}};module.exports=JSTimersExecution;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/ListView/ListView.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/CustomComponents/ListView/ListView.js';var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var ListViewDataSource=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/ListView/ListViewDataSource.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var ReactNative=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js");var RCTScrollViewManager=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").ScrollViewManager;var ScrollView=__webpack_require__("./node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js");var ScrollResponder=__webpack_require__("./node_modules/react-native/Libraries/Components/ScrollResponder.js");var StaticRenderer=__webpack_require__("./node_modules/react-native/Libraries/Components/StaticRenderer.js");var TimerMixin=__webpack_require__("./node_modules/react-timer-mixin/TimerMixin.js");var cloneReferencedElement=__webpack_require__("./node_modules/react-clone-referenced-element/cloneReferencedElement.js");var isEmpty=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/isEmpty.js");var merge=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/merge.js");var PropTypes=React.PropTypes;var DEFAULT_PAGE_SIZE=1;var DEFAULT_INITIAL_ROWS=10;var DEFAULT_SCROLL_RENDER_AHEAD=1000;var DEFAULT_END_REACHED_THRESHOLD=1000;var DEFAULT_SCROLL_CALLBACK_THROTTLE=50;var ListView=React.createClass({displayName:'ListView',_childFrames:[],_sentEndForContentLength:null,_scrollComponent:null,_prevRenderedRowsCount:0,_visibleRows:{},scrollProperties:{},mixins:[ScrollResponder.Mixin,TimerMixin],statics:{DataSource:ListViewDataSource},propTypes:_extends({},ScrollView.propTypes,{dataSource:PropTypes.instanceOf(ListViewDataSource).isRequired,renderSeparator:PropTypes.func,renderRow:PropTypes.func.isRequired,initialListSize:PropTypes.number.isRequired,onEndReached:PropTypes.func,onEndReachedThreshold:PropTypes.number.isRequired,pageSize:PropTypes.number.isRequired,renderFooter:PropTypes.func,renderHeader:PropTypes.func,renderSectionHeader:PropTypes.func,renderScrollComponent:React.PropTypes.func.isRequired,scrollRenderAheadDistance:React.PropTypes.number.isRequired,onChangeVisibleRows:React.PropTypes.func,removeClippedSubviews:React.PropTypes.bool,stickyHeaderIndices:PropTypes.arrayOf(PropTypes.number).isRequired,enableEmptySections:PropTypes.bool}),getMetrics:function getMetrics(){return{contentLength:this.scrollProperties.contentLength,totalRows:this.props.enableEmptySections?this.props.dataSource.getRowAndSectionCount():this.props.dataSource.getRowCount(),renderedRows:this.state.curRenderedRowsCount,visibleRows:Object.keys(this._visibleRows).length};},getScrollResponder:function getScrollResponder(){if(this._scrollComponent&&this._scrollComponent.getScrollResponder){return this._scrollComponent.getScrollResponder();}},getScrollableNode:function getScrollableNode(){if(this._scrollComponent&&this._scrollComponent.getScrollableNode){return this._scrollComponent.getScrollableNode();}else{return ReactNative.findNodeHandle(this._scrollComponent);}},scrollTo:function scrollTo(){if(this._scrollComponent&&this._scrollComponent.scrollTo){var _scrollComponent;(_scrollComponent=this._scrollComponent).scrollTo.apply(_scrollComponent,arguments);}},scrollToEnd:function scrollToEnd(options){if(this._scrollComponent){if(this._scrollComponent.scrollToEnd){this._scrollComponent.scrollToEnd(options);}else{console.warn('The scroll component used by the ListView does not support '+'scrollToEnd. Check the renderScrollComponent prop of your ListView.');}}},setNativeProps:function setNativeProps(props){if(this._scrollComponent){this._scrollComponent.setNativeProps(props);}},getDefaultProps:function getDefaultProps(){return{initialListSize:DEFAULT_INITIAL_ROWS,pageSize:DEFAULT_PAGE_SIZE,renderScrollComponent:function renderScrollComponent(props){return React.createElement(ScrollView,_extends({},props,{__source:{fileName:_jsxFileName,lineNumber:327}}));},scrollRenderAheadDistance:DEFAULT_SCROLL_RENDER_AHEAD,onEndReachedThreshold:DEFAULT_END_REACHED_THRESHOLD,stickyHeaderIndices:[]};},getInitialState:function getInitialState(){return{curRenderedRowsCount:this.props.initialListSize,highlightedRow:{}};},getInnerViewNode:function getInnerViewNode(){return this._scrollComponent.getInnerViewNode();},componentWillMount:function componentWillMount(){this.scrollProperties={visibleLength:null,contentLength:null,offset:0};this._childFrames=[];this._visibleRows={};this._prevRenderedRowsCount=0;this._sentEndForContentLength=null;},componentDidMount:function componentDidMount(){var _this=this;this.requestAnimationFrame(function(){_this._measureAndUpdateScrollProps();});},componentWillReceiveProps:function componentWillReceiveProps(nextProps){var _this2=this;if(this.props.dataSource!==nextProps.dataSource||this.props.initialListSize!==nextProps.initialListSize){this.setState(function(state,props){_this2._prevRenderedRowsCount=0;return{curRenderedRowsCount:Math.min(Math.max(state.curRenderedRowsCount,props.initialListSize),props.enableEmptySections?props.dataSource.getRowAndSectionCount():props.dataSource.getRowCount())};},function(){return _this2._renderMoreRowsIfNeeded();});}},componentDidUpdate:function componentDidUpdate(){var _this3=this;this.requestAnimationFrame(function(){_this3._measureAndUpdateScrollProps();});},_onRowHighlighted:function _onRowHighlighted(sectionID,rowID){this.setState({highlightedRow:{sectionID:sectionID,rowID:rowID}});},render:function render(){var bodyComponents=[];var dataSource=this.props.dataSource;var allRowIDs=dataSource.rowIdentities;var rowCount=0;var sectionHeaderIndices=[];var header=this.props.renderHeader&&this.props.renderHeader();var footer=this.props.renderFooter&&this.props.renderFooter();var totalIndex=header?1:0;for(var sectionIdx=0;sectionIdx=this._prevRenderedRowsCount&&dataSource.sectionHeaderShouldUpdate(sectionIdx);bodyComponents.push(React.createElement(StaticRenderer,{key:'s_'+sectionID,shouldUpdate:!!shouldUpdateHeader,render:this.props.renderSectionHeader.bind(null,dataSource.getSectionHeaderData(sectionIdx),sectionID),__source:{fileName:_jsxFileName,lineNumber:429}}));sectionHeaderIndices.push(totalIndex++);}for(var rowIdx=0;rowIdx=this._prevRenderedRowsCount&&dataSource.rowShouldUpdate(sectionIdx,rowIdx);var row=React.createElement(StaticRenderer,{key:'r_'+comboID,shouldUpdate:!!shouldUpdateRow,render:this.props.renderRow.bind(null,dataSource.getRowData(sectionIdx,rowIdx),sectionID,rowID,this._onRowHighlighted),__source:{fileName:_jsxFileName,lineNumber:448}});bodyComponents.push(row);totalIndex++;if(this.props.renderSeparator&&(rowIdx!==rowIDs.length-1||sectionIdx===allRowIDs.length-1)){var adjacentRowHighlighted=this.state.highlightedRow.sectionID===sectionID&&(this.state.highlightedRow.rowID===rowID||this.state.highlightedRow.rowID===rowIDs[rowIdx+1]);var separator=this.props.renderSeparator(sectionID,rowID,adjacentRowHighlighted);if(separator){bodyComponents.push(separator);totalIndex++;}}if(++rowCount===this.state.curRenderedRowsCount){break;}}if(rowCount>=this.state.curRenderedRowsCount){break;}}var _props=this.props,renderScrollComponent=_props.renderScrollComponent,props=_objectWithoutProperties(_props,['renderScrollComponent']);if(!props.scrollEventThrottle){props.scrollEventThrottle=DEFAULT_SCROLL_CALLBACK_THROTTLE;}if(props.removeClippedSubviews===undefined){props.removeClippedSubviews=true;}_extends(props,{onScroll:this._onScroll,stickyHeaderIndices:this.props.stickyHeaderIndices.concat(sectionHeaderIndices),onKeyboardWillShow:undefined,onKeyboardWillHide:undefined,onKeyboardDidShow:undefined,onKeyboardDidHide:undefined});return cloneReferencedElement(renderScrollComponent(props),{ref:this._setScrollComponentRef,onContentSizeChange:this._onContentSizeChange,onLayout:this._onLayout},header,bodyComponents,footer);},_measureAndUpdateScrollProps:function _measureAndUpdateScrollProps(){var scrollComponent=this.getScrollResponder();if(!scrollComponent||!scrollComponent.getInnerViewNode){return;}RCTScrollViewManager&&RCTScrollViewManager.calculateChildFrames&&RCTScrollViewManager.calculateChildFrames(ReactNative.findNodeHandle(scrollComponent),this._updateVisibleRows);},_setScrollComponentRef:function _setScrollComponentRef(scrollComponent){this._scrollComponent=scrollComponent;},_onContentSizeChange:function _onContentSizeChange(width,height){var contentLength=!this.props.horizontal?height:width;if(contentLength!==this.scrollProperties.contentLength){this.scrollProperties.contentLength=contentLength;this._updateVisibleRows();this._renderMoreRowsIfNeeded();}this.props.onContentSizeChange&&this.props.onContentSizeChange(width,height);},_onLayout:function _onLayout(event){var _event$nativeEvent$la=event.nativeEvent.layout,width=_event$nativeEvent$la.width,height=_event$nativeEvent$la.height;var visibleLength=!this.props.horizontal?height:width;if(visibleLength!==this.scrollProperties.visibleLength){this.scrollProperties.visibleLength=visibleLength;this._updateVisibleRows();this._renderMoreRowsIfNeeded();}this.props.onLayout&&this.props.onLayout(event);},_maybeCallOnEndReached:function _maybeCallOnEndReached(event){if(this.props.onEndReached&&this.scrollProperties.contentLength!==this._sentEndForContentLength&&this._getDistanceFromEnd(this.scrollProperties)visibleMax||maxthis.props.onEndReachedThreshold){this._sentEndForContentLength=null;}this.props.onScroll&&this.props.onScroll(e);}});module.exports=ListView;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/ListView/ListViewDataSource.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i=this.rowIdentities[ii].length){accessIndex-=this.rowIdentities[ii].length;}else{return this.rowIdentities[ii][accessIndex];}}return null;}},{key:'getSectionIDForFlatIndex',value:function getSectionIDForFlatIndex(index){var accessIndex=index;for(var ii=0;ii=this.rowIdentities[ii].length){accessIndex-=this.rowIdentities[ii].length;}else{return this.sectionIdentities[ii];}}return null;}},{key:'getSectionLengths',value:function getSectionLengths(){var results=[];for(var ii=0;ii=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var Animated=__webpack_require__("./node_modules/react-native/Libraries/Animated/src/Animated.js");var NavigationCardStackPanResponder=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackPanResponder.js");var NavigationCardStackStyleInterpolator=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js");var NavigationPagerPanResponder=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPagerPanResponder.js");var NavigationPagerStyleInterpolator=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js");var NavigationPointerEventsContainer=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPointerEventsContainer.js");var NavigationPropTypes=__webpack_require__("./node_modules/react-native/Libraries/NavigationExperimental/NavigationPropTypes.js");var React=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js");var StyleSheet=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/StyleSheet.js");var PropTypes=React.PropTypes;var NavigationCard=function(_React$Component){_inherits(NavigationCard,_React$Component);function NavigationCard(){_classCallCheck(this,NavigationCard);return _possibleConstructorReturn(this,(NavigationCard.__proto__||Object.getPrototypeOf(NavigationCard)).apply(this,arguments));}_createClass(NavigationCard,[{key:'render',value:function render(){var _props=this.props,panHandlers=_props.panHandlers,pointerEvents=_props.pointerEvents,renderScene=_props.renderScene,style=_props.style,props=_objectWithoutProperties(_props,['panHandlers','pointerEvents','renderScene','style']);var viewStyle=style===undefined?NavigationCardStackStyleInterpolator.forHorizontal(props):style;var viewPanHandlers=panHandlers===undefined?NavigationCardStackPanResponder.forHorizontal(_extends({},props,{onNavigateBack:this.props.onNavigateBack})):panHandlers;return React.createElement(Animated.View,_extends({},viewPanHandlers,{pointerEvents:pointerEvents,ref:this.props.onComponentRef,style:[styles.main,viewStyle],__source:{fileName:_jsxFileName,lineNumber:99}}),renderScene(props));}}]);return NavigationCard;}(React.Component);NavigationCard.propTypes=_extends({},NavigationPropTypes.SceneRendererProps,{onComponentRef:PropTypes.func.isRequired,onNavigateBack:PropTypes.func,panHandlers:NavigationPropTypes.panHandlers,pointerEvents:PropTypes.string.isRequired,renderScene:PropTypes.func.isRequired,style:PropTypes.any});var styles=StyleSheet.create({main:{backgroundColor:'#E9E9EF',bottom:0,left:0,position:'absolute',right:0,shadowColor:'black',shadowOffset:{width:0,height:0},shadowOpacity:0.4,shadowRadius:10,top:0}});NavigationCard=NavigationPointerEventsContainer.create(NavigationCard);NavigationCard.CardStackPanResponder=NavigationCardStackPanResponder;NavigationCard.CardStackStyleInterpolator=NavigationCardStackStyleInterpolator;NavigationCard.PagerPanResponder=NavigationPagerPanResponder;NavigationCard.PagerStyleInterpolator=NavigationPagerStyleInterpolator;module.exports=NavigationCard;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;ipositionMax){return false;}return Math.abs(currentDragDistance)>RESPOND_THRESHOLD&&maxDragDistance>0&&index>0;}},{key:'onPanResponderGrant',value:function onPanResponderGrant(){var _this2=this;this._isResponding=false;this._props.position.stopAnimation(function(value){_this2._isResponding=true;_this2._startValue=value;});}},{key:'onPanResponderMove',value:function onPanResponderMove(event,gesture){if(!this._isResponding){return;}var props=this._props;var layout=props.layout;var isVertical=this._isVertical;var axis=isVertical?'dy':'dx';var index=props.navigationState.index;var distance=isVertical?layout.height.__getValue():layout.width.__getValue();var currentValue=I18nManager.isRTL&&axis==='dx'?this._startValue+gesture[axis]/distance:this._startValue-gesture[axis]/distance;var value=clamp(index-1,currentValue,index);props.position.setValue(value);}},{key:'onPanResponderRelease',value:function onPanResponderRelease(event,gesture){var _this3=this;if(!this._isResponding){return;}this._isResponding=false;var props=this._props;var isVertical=this._isVertical;var axis=isVertical?'dy':'dx';var index=props.navigationState.index;var distance=I18nManager.isRTL&&axis==='dx'?-gesture[axis]:gesture[axis];props.position.stopAnimation(function(value){_this3._reset();if(!props.onNavigateBack){return;}if(distance>DISTANCE_THRESHOLD||value<=index-POSITION_THRESHOLD){props.onNavigateBack();}});}},{key:'onPanResponderTerminate',value:function onPanResponderTerminate(){this._isResponding=false;this._reset();}},{key:'_reset',value:function _reset(){var props=this._props;Animated.timing(props.position,{toValue:props.navigationState.index,duration:ANIMATION_DURATION,useNativeDriver:props.position.__isNative}).start();}},{key:'_addNativeListener',value:function _addNativeListener(animatedValue){if(!animatedValue.__isNative){return;}if(Object.keys(animatedValue._listeners).length===0){animatedValue.addListener(emptyFunction);}}}]);return NavigationCardStackPanResponder;}(NavigationAbstractPanResponder);function createPanHandlers(direction,props){var responder=new NavigationCardStackPanResponder(direction,props);return responder.panHandlers;}function forHorizontal(props){return createPanHandlers(Directions.HORIZONTAL,props);}function forVertical(props){return createPanHandlers(Directions.VERTICAL,props);}module.exports={ANIMATION_DURATION:ANIMATION_DURATION,DISTANCE_THRESHOLD:DISTANCE_THRESHOLD,POSITION_THRESHOLD:POSITION_THRESHOLD,RESPOND_THRESHOLD:RESPOND_THRESHOLD,Directions:Directions,forHorizontal:forHorizontal,forVertical:forVertical};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var I18nManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/I18nManager.js");function forInitial(props){var navigationState=props.navigationState,scene=props.scene;var focused=navigationState.index===scene.index;var opacity=focused?1:0;var translate=focused?0:1000000;return{opacity:opacity,transform:[{translateX:translate},{translateY:translate}]};}function forHorizontal(props){var layout=props.layout,position=props.position,scene=props.scene;if(!layout.isMeasured){return forInitial(props);}var index=scene.index;var inputRange=[index-1,index,index+0.99,index+1];var width=layout.initWidth;var outputRange=I18nManager.isRTL?[-width,0,10,10]:[width,0,-10,-10];var opacity=position.interpolate({inputRange:inputRange,outputRange:[1,1,0.3,0]});var scale=position.interpolate({inputRange:inputRange,outputRange:[1,1,0.95,0.95]});var translateY=0;var translateX=position.interpolate({inputRange:inputRange,outputRange:outputRange});return{opacity:opacity,transform:[{scale:scale},{translateX:translateX},{translateY:translateY}]};}function forVertical(props){var layout=props.layout,position=props.position,scene=props.scene;if(!layout.isMeasured){return forInitial(props);}var index=scene.index;var inputRange=[index-1,index,index+0.99,index+1];var height=layout.initHeight;var opacity=position.interpolate({inputRange:inputRange,outputRange:[1,1,0.3,0]});var scale=position.interpolate({inputRange:inputRange,outputRange:[1,1,0.95,0.95]});var translateX=0;var translateY=position.interpolate({inputRange:inputRange,outputRange:[height,0,-10,-10]});return{opacity:opacity,transform:[{scale:scale},{translateX:translateX},{translateY:translateY}]};}function canUseNativeDriver(isVertical){return true;}module.exports={forHorizontal:forHorizontal,forVertical:forVertical,canUseNativeDriver:canUseNativeDriver};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i2){return null;}var subViewProps=_extends({},props,{onNavigateBack:this.props.onNavigateBack});var subView=renderer(subViewProps);if(subView===null){return null;}var pointerEvents=offset!==0||isStale?'none':'box-none';return React.createElement(Animated.View,{pointerEvents:pointerEvents,key:name+'_'+key,style:[styles[name],{marginTop:this.props.statusBarHeight},styleInterpolator(props)],__source:{fileName:_jsxFileName,lineNumber:238}},subView);}}]);return NavigationHeader;}(React.Component);NavigationHeader.defaultProps={renderTitleComponent:function renderTitleComponent(props){var title=String(props.scene.route.title||'');return React.createElement(NavigationHeaderTitle,{__source:{fileName:_jsxFileName,lineNumber:92}},title);},renderLeftComponent:function renderLeftComponent(props){if(props.scene.index===0||!props.onNavigateBack){return null;}return React.createElement(NavigationHeaderBackButton,{onPress:props.onNavigateBack,__source:{fileName:_jsxFileName,lineNumber:100}});},renderRightComponent:function renderRightComponent(props){return null;},statusBarHeight:STATUSBAR_HEIGHT};NavigationHeader.propTypes=_extends({},NavigationPropTypes.SceneRendererProps,{onNavigateBack:PropTypes.func,renderLeftComponent:PropTypes.func,renderRightComponent:PropTypes.func,renderTitleComponent:PropTypes.func,style:View.propTypes.style,statusBarHeight:PropTypes.number,viewProps:PropTypes.shape(View.propTypes)});NavigationHeader.HEIGHT=APPBAR_HEIGHT+STATUSBAR_HEIGHT;NavigationHeader.Title=NavigationHeaderTitle;NavigationHeader.BackButton=NavigationHeaderBackButton;var styles=StyleSheet.create({appbar:{alignItems:'center',backgroundColor:Platform.OS==='ios'?'#EFEFF2':'#FFF',borderBottomColor:'rgba(0, 0, 0, .15)',borderBottomWidth:Platform.OS==='ios'?StyleSheet.hairlineWidth:0,elevation:4,flexDirection:'row',justifyContent:'flex-start'},title:{bottom:0,left:APPBAR_HEIGHT,position:'absolute',right:APPBAR_HEIGHT,top:0},left:{bottom:0,left:0,position:'absolute',top:0},right:{bottom:0,position:'absolute',right:0,top:0}});module.exports=NavigationHeader;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js';var React=__webpack_require__("./node_modules/react/react.js");var ReactNative=__webpack_require__("./node_modules/react-native/Libraries/react-native/react-native.js");var I18nManager=ReactNative.I18nManager,Image=ReactNative.Image,Platform=ReactNative.Platform,StyleSheet=ReactNative.StyleSheet,TouchableOpacity=ReactNative.TouchableOpacity;var NavigationHeaderBackButton=function NavigationHeaderBackButton(props){return React.createElement(TouchableOpacity,{style:styles.buttonContainer,onPress:props.onPress,__source:{fileName:_jsxFileName,lineNumber:42}},React.createElement(Image,{style:styles.button,source:__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@1x.ios.png"),__source:{fileName:_jsxFileName,lineNumber:43}}));};NavigationHeaderBackButton.propTypes={onPress:React.PropTypes.func.isRequired};var styles=StyleSheet.create({buttonContainer:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center'},button:{height:24,width:24,margin:Platform.OS==='ios'?10:16,resizeMode:'contain',transform:[{scaleX:I18nManager.isRTL?-1:1}]}});module.exports=NavigationHeaderBackButton;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderStyleInterpolator.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var I18nManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/I18nManager.js");function forLeft(props){var position=props.position,scene=props.scene;var index=scene.index;return{opacity:position.interpolate({inputRange:[index-1,index,index+1],outputRange:[0,1,0]})};}function forCenter(props){var position=props.position,scene=props.scene;var index=scene.index;return{opacity:position.interpolate({inputRange:[index-1,index,index+1],outputRange:[0,1,0]}),transform:[{translateX:position.interpolate({inputRange:[index-1,index+1],outputRange:I18nManager.isRTL?[-200,200]:[200,-200]})}]};}function forRight(props){var position=props.position,scene=props.scene;var index=scene.index;return{opacity:position.interpolate({inputRange:[index-1,index,index+1],outputRange:[0,1,0]})};}module.exports={forCenter:forCenter,forLeft:forLeft,forRight:forRight};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;iRESPOND_THRESHOLD&&distance>0&&index>=0;}},{key:'onPanResponderGrant',value:function onPanResponderGrant(){var _this2=this;this._isResponding=false;this._props.position.stopAnimation(function(value){_this2._isResponding=true;_this2._startValue=value;});}},{key:'onPanResponderMove',value:function onPanResponderMove(event,gesture){if(!this._isResponding){return;}var _props=this._props,layout=_props.layout,navigationState=_props.navigationState,position=_props.position,scenes=_props.scenes;var isVertical=this._isVertical;var axis=isVertical?'dy':'dx';var index=navigationState.index;var distance=isVertical?layout.height.__getValue():layout.width.__getValue();var currentValue=I18nManager.isRTL&&axis==='dx'?this._startValue+gesture[axis]/distance:this._startValue-gesture[axis]/distance;var prevIndex=Math.max(0,index-1);var nextIndex=Math.min(index+1,scenes.length-1);var value=clamp(prevIndex,currentValue,nextIndex);position.setValue(value);}},{key:'onPanResponderRelease',value:function onPanResponderRelease(event,gesture){var _this3=this;if(!this._isResponding){return;}this._isResponding=false;var _props2=this._props,navigationState=_props2.navigationState,onNavigateBack=_props2.onNavigateBack,onNavigateForward=_props2.onNavigateForward,position=_props2.position;var isVertical=this._isVertical;var axis=isVertical?'dy':'dx';var velocityAxis=isVertical?'vy':'vx';var index=navigationState.index;var distance=I18nManager.isRTL&&axis==='dx'?-gesture[axis]:gesture[axis];var moveSpeed=I18nManager.isRTL&&velocityAxis==='vx'?-gesture[velocityAxis]:gesture[velocityAxis];position.stopAnimation(function(value){_this3._reset();if(distance>DISTANCE_THRESHOLD||value<=index-POSITION_THRESHOLD||moveSpeed>VELOCITY_THRESHOLD){onNavigateBack&&onNavigateBack();return;}if(distance<-DISTANCE_THRESHOLD||value>=index+POSITION_THRESHOLD||moveSpeed<-VELOCITY_THRESHOLD){onNavigateForward&&onNavigateForward();}});}},{key:'onPanResponderTerminate',value:function onPanResponderTerminate(){this._isResponding=false;this._reset();}},{key:'_reset',value:function _reset(){var props=this._props;Animated.timing(props.position,{toValue:props.navigationState.index,duration:ANIMATION_DURATION}).start();}}]);return NavigationPagerPanResponder;}(NavigationAbstractPanResponder);function createPanHandlers(direction,props){var responder=new NavigationPagerPanResponder(direction,props);return responder.panHandlers;}function forHorizontal(props){return createPanHandlers(Directions.HORIZONTAL,props);}module.exports={forHorizontal:forHorizontal};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var I18nManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/I18nManager.js");function forInitial(props){var navigationState=props.navigationState,scene=props.scene;var focused=navigationState.index===scene.index;var opacity=focused?1:0;var dir=scene.index>navigationState.index?1:-1;var translate=focused?0:1000000*dir;return{opacity:opacity,transform:[{translateX:translate},{translateY:translate}]};}function forHorizontal(props){var layout=props.layout,position=props.position,scene=props.scene;if(!layout.isMeasured){return forInitial(props);}var index=scene.index;var inputRange=[index-1,index,index+1];var width=layout.initWidth;var outputRange=I18nManager.isRTL?[-width,0,width]:[width,0,-width];var translateX=position.interpolate({inputRange:inputRange,outputRange:outputRange});return{opacity:1,shadowColor:'transparent',shadowRadius:0,transform:[{scale:1},{translateX:translateX},{translateY:0}]};}module.exports={forHorizontal:forHorizontal};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPointerEventsContainer.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;inavigationState.index?'box-only':'none';}var offset=position.__getAnimatedValue()-navigationState.index;if(Math.abs(offset)>MIN_POSITION_OFFSET){return'box-only';}return'auto';}}]);return Container;}(React.Component);return Container;}module.exports={create:create};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@1x.ios.png":
-/***/ (function(module, exports, __webpack_require__) {
-
-
- var AssetRegistry = __webpack_require__("./node_modules/react-native/Libraries/Image/AssetRegistry.js");
- module.exports = AssetRegistry.registerAsset({
- __packager_asset: true,
- scales: [1,1.5,2,3,4],
- name: "back-icon",
- type: "png",
- hash: "8828f0675c7c99378725384aa7355fc3,286c41f9eb4069465cc92fbe36000764,4dafbb7ec26957b4e6d0220c9e963fd9,3eee61405320c98800a491b442654012,8ada8e63c7db95a513ab9025b211c5c3",
- httpServerLocation: __webpack_require__.p + "/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets",
-
- height: 24,
- width: 24,
- });
-
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){var args=Array.prototype.slice.call(arguments);this._emitQueue.push(args);return;}this._emitCounter++;if(LegacyEventTypes.has(eventType)){this.__emit(eventType,data,null,{defaultPrevented:false,eventPhase:AT_TARGET,propagationStopped:true,target:this});}else{var targets=[this];var parentTarget=this.parent;while(parentTarget){targets.unshift(parentTarget);parentTarget=parentTarget.parent;}var propagationStopped=false;var defaultPrevented=false;var callback=function callback(event){propagationStopped=propagationStopped||event.isPropagationStopped();defaultPrevented=defaultPrevented||event.defaultPrevented;};targets.some(function(currentTarget){if(propagationStopped){return true;}var extraInfo={defaultPrevented:defaultPrevented,eventPhase:CAPTURING_PHASE,propagationStopped:propagationStopped,target:_this};currentTarget.__emit(eventType,data,callback,extraInfo);},this);targets.reverse().some(function(currentTarget){if(propagationStopped){return true;}var extraInfo={defaultPrevented:defaultPrevented,eventPhase:BUBBLING_PHASE,propagationStopped:propagationStopped,target:_this};currentTarget.__emit(eventType,data,callback,extraInfo);},this);}if(didEmitCallback){var event=NavigationEvent.pool(eventType,this,data);propagationStopped&&event.stopPropagation();defaultPrevented&&event.preventDefault();didEmitCallback.call(this,event);event.dispose();}this._emitCounter--;while(this._emitQueue.length){var args=this._emitQueue.shift();this.emit.apply(this,args);}}},{key:'dispose',value:function dispose(){this._bubbleEventEmitter&&this._bubbleEventEmitter.removeAllListeners();this._captureEventEmitter&&this._captureEventEmitter.removeAllListeners();this._bubbleEventEmitter=null;this._captureEventEmitter=null;this._currentRoute=null;}},{key:'__emit',value:function __emit(eventType,data,didEmitCallback,extraInfo){var emitter;switch(extraInfo.eventPhase){case CAPTURING_PHASE:emitter=this._captureEventEmitter;break;case AT_TARGET:emitter=this._bubbleEventEmitter;break;case BUBBLING_PHASE:emitter=this._bubbleEventEmitter;break;default:invariant(false,'invalid event phase %s',extraInfo.eventPhase);}if(extraInfo.target===this){extraInfo.eventPhase=AT_TARGET;}if(emitter){emitter.emit(eventType,data,didEmitCallback,extraInfo);}}},{key:'_onFocus',value:function _onFocus(event){invariant(event.data&&event.data.hasOwnProperty('route'),'event type "%s" should provide route',event.type);this._currentRoute=event.data.route;}},{key:'parent',get:function get(){var parent=this.__node.getParent();return parent?parent.getValue():null;}},{key:'top',get:function get(){var result=null;var parentNode=this.__node.getParent();while(parentNode){result=parentNode.getValue();parentNode=parentNode.getParent();}return result;}},{key:'currentRoute',get:function get(){return this._currentRoute;}}]);return NavigationContext;}();module.exports=NavigationContext;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){event=this._list.pop();event.constructor.call(event,type,currentTarget,data);}else{event=new NavigationEvent(type,currentTarget,data);}return event;}},{key:'put',value:function put(event){this._list.push(event);}}]);return NavigationEventPool;}();var _navigationEventPool=new NavigationEventPool();var NavigationEvent=function(){_createClass(NavigationEvent,null,[{key:'pool',value:function pool(type,currentTarget,data){return _navigationEventPool.get(type,currentTarget,data);}}]);function NavigationEvent(type,currentTarget,data){_classCallCheck(this,NavigationEvent);this.target=currentTarget;this.eventPhase=NavigationEvent.NONE;this._type=type;this._currentTarget=currentTarget;this._data=data;this._defaultPrevented=false;this._disposed=false;this._propagationStopped=false;}_createClass(NavigationEvent,[{key:'preventDefault',value:function preventDefault(){this._defaultPrevented=true;}},{key:'stopPropagation',value:function stopPropagation(){this._propagationStopped=true;}},{key:'stop',value:function stop(){this.preventDefault();this.stopPropagation();}},{key:'isPropagationStopped',value:function isPropagationStopped(){return this._propagationStopped;}},{key:'dispose',value:function dispose(){invariant(!this._disposed,'NavigationEvent is already disposed');this._disposed=true;this.target=null;this.eventPhase=NavigationEvent.NONE;this._type='';this._currentTarget=null;this._data=null;this._defaultPrevented=false;_navigationEventPool.put(this);}},{key:'type',get:function get(){return this._type;}},{key:'currentTarget',get:function get(){return this._currentTarget;}},{key:'data',get:function get(){return this._data;}},{key:'defaultPrevented',get:function get(){return this._defaultPrevented;}}]);return NavigationEvent;}();NavigationEvent.NONE=0;NavigationEvent.CAPTURING_PHASE=1;NavigationEvent.AT_TARGET=2;NavigationEvent.BUBBLING_PHASE=3;module.exports=NavigationEvent;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/Navigation/NavigationEventEmitter.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i-1&&index-1,'The node to be removed is not a child of this node.');child.__parent=null;this._children=this._children.splice(index,1);}},{key:'indexOf',value:function indexOf(child){return this._children.indexOf(child);}},{key:'forEach',value:function forEach(callback,context){this._children.forEach(callback,context);}},{key:'map',value:function map(callback,context){return this._children.map(callback,context).toJS();}},{key:'some',value:function some(callback,context){return this._children.some(callback,context);}}]);return NavigationTreeNode;}();module.exports=NavigationTreeNode;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/Navigator.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i=1,'Navigator requires props.initialRoute or props.initialRouteStack.');var initialRouteIndex=routeStack.length-1;if(this.props.initialRoute){initialRouteIndex=routeStack.indexOf(this.props.initialRoute);invariant(initialRouteIndex!==-1,'initialRoute is not in initialRouteStack.');}return{sceneConfigStack:routeStack.map(function(route){return _this.props.configureScene(route,routeStack);}),routeStack:routeStack,presentedIndex:initialRouteIndex,transitionFromIndex:null,activeGesture:null,pendingGestureProgress:null,transitionQueue:[]};},componentWillMount:function componentWillMount(){var _this2=this;this.__defineGetter__('navigationContext',this._getNavigationContext);this._subRouteFocus=[];this.parentNavigator=this.props.navigator;this._handlers={};this.springSystem=new rebound.SpringSystem();this.spring=this.springSystem.createSpring();this.spring.setRestSpeedThreshold(0.05);this.spring.setCurrentValue(0).setAtRest();this.spring.addListener({onSpringEndStateChange:function onSpringEndStateChange(){if(!_this2._interactionHandle){_this2._interactionHandle=_this2.createInteractionHandle();}},onSpringUpdate:function onSpringUpdate(){_this2._handleSpringUpdate();},onSpringAtRest:function onSpringAtRest(){_this2._completeTransition();}});this.panGesture=PanResponder.create({onMoveShouldSetPanResponder:this._handleMoveShouldSetPanResponder,onPanResponderRelease:this._handlePanResponderRelease,onPanResponderMove:this._handlePanResponderMove,onPanResponderTerminate:this._handlePanResponderTerminate});this._interactionHandle=null;this._emitWillFocus(this.state.routeStack[this.state.presentedIndex]);},componentDidMount:function componentDidMount(){this._handleSpringUpdate();this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]);this._enableTVEventHandler();},componentWillUnmount:function componentWillUnmount(){if(this._navigationContext){this._navigationContext.dispose();this._navigationContext=null;}this.spring.destroy();if(this._interactionHandle){this.clearInteractionHandle(this._interactionHandle);}this._disableTVEventHandler();},immediatelyResetRouteStack:function immediatelyResetRouteStack(nextRouteStack){var _this3=this;var destIndex=nextRouteStack.length-1;this._emitWillFocus(nextRouteStack[destIndex]);this.setState({routeStack:nextRouteStack,sceneConfigStack:nextRouteStack.map(function(route){return _this3.props.configureScene(route,nextRouteStack);}),presentedIndex:destIndex,activeGesture:null,transitionFromIndex:null,transitionQueue:[]},function(){_this3._handleSpringUpdate();var navBar=_this3._navBar;if(navBar&&navBar.immediatelyRefresh){navBar.immediatelyRefresh();}_this3._emitDidFocus(_this3.state.routeStack[_this3.state.presentedIndex]);});},_transitionTo:function _transitionTo(destIndex,velocity,jumpSpringTo,cb){if(this.state.presentedIndex===destIndex){cb&&cb();return;}if(this.state.transitionFromIndex!==null){this.state.transitionQueue.push({destIndex:destIndex,velocity:velocity,cb:cb});return;}this.state.transitionFromIndex=this.state.presentedIndex;this.state.presentedIndex=destIndex;this.state.transitionCb=cb;this._onAnimationStart();if(AnimationsDebugModule){AnimationsDebugModule.startRecordingFps();}var sceneConfig=this.state.sceneConfigStack[this.state.transitionFromIndex]||this.state.sceneConfigStack[this.state.presentedIndex];invariant(sceneConfig,'Cannot configure scene at index '+this.state.transitionFromIndex);if(jumpSpringTo!=null){this.spring.setCurrentValue(jumpSpringTo);}this.spring.setOvershootClampingEnabled(true);this.spring.getSpringConfig().friction=sceneConfig.springFriction;this.spring.getSpringConfig().tension=sceneConfig.springTension;this.spring.setVelocity(velocity||sceneConfig.defaultTransitionVelocity);this.spring.setEndValue(1);},_handleSpringUpdate:function _handleSpringUpdate(){if(!this.isMounted()){return;}if(this.state.transitionFromIndex!=null){this._transitionBetween(this.state.transitionFromIndex,this.state.presentedIndex,this.spring.getCurrentValue());}else if(this.state.activeGesture!=null){var presentedToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);this._transitionBetween(this.state.presentedIndex,presentedToIndex,this.spring.getCurrentValue());}},_completeTransition:function _completeTransition(){if(!this.isMounted()){return;}if(this.spring.getCurrentValue()!==1&&this.spring.getCurrentValue()!==0){if(this.state.pendingGestureProgress){this.state.pendingGestureProgress=null;}return;}this._onAnimationEnd();var presentedIndex=this.state.presentedIndex;var didFocusRoute=this._subRouteFocus[presentedIndex]||this.state.routeStack[presentedIndex];if(AnimationsDebugModule){AnimationsDebugModule.stopRecordingFps(Date.now());}this.state.transitionFromIndex=null;this.spring.setCurrentValue(0).setAtRest();this._hideScenes();if(this.state.transitionCb){this.state.transitionCb();this.state.transitionCb=null;}this._emitDidFocus(didFocusRoute);if(this._interactionHandle){this.clearInteractionHandle(this._interactionHandle);this._interactionHandle=null;}if(this.state.pendingGestureProgress){var gestureToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);this._enableScene(gestureToIndex);this.spring.setEndValue(this.state.pendingGestureProgress);return;}if(this.state.transitionQueue.length){var queuedTransition=this.state.transitionQueue.shift();this._enableScene(queuedTransition.destIndex);this._emitWillFocus(this.state.routeStack[queuedTransition.destIndex]);this._transitionTo(queuedTransition.destIndex,queuedTransition.velocity,null,queuedTransition.cb);}},_emitDidFocus:function _emitDidFocus(route){this.navigationContext.emit('didfocus',{route:route});if(this.props.onDidFocus){this.props.onDidFocus(route);}},_emitWillFocus:function _emitWillFocus(route){this.navigationContext.emit('willfocus',{route:route});var navBar=this._navBar;if(navBar&&navBar.handleWillFocus){navBar.handleWillFocus(route);}if(this.props.onWillFocus){this.props.onWillFocus(route);}},_hideScenes:function _hideScenes(){var gesturingToIndex=null;if(this.state.activeGesture){gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);}for(var i=0;i=this.state.routeStack.length-1&&gestureName==='jumpForward';return wouldOverswipeForward||wouldOverswipeBack;},_deltaForGestureAction:function _deltaForGestureAction(gestureAction){switch(gestureAction){case'pop':case'jumpBack':return-1;case'jumpForward':return 1;default:invariant(false,'Unsupported gesture action '+gestureAction);return;}},_handlePanResponderRelease:function _handlePanResponderRelease(e,gestureState){var _this4=this;var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex];var releaseGestureAction=this.state.activeGesture;if(!releaseGestureAction){return;}var releaseGesture=sceneConfig.gestures[releaseGestureAction];var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);if(this.spring.getCurrentValue()===0){this.spring.setCurrentValue(0).setAtRest();this._completeTransition();return;}var isTravelVertical=releaseGesture.direction==='top-to-bottom'||releaseGesture.direction==='bottom-to-top';var isTravelInverted=releaseGesture.direction==='right-to-left'||releaseGesture.direction==='bottom-to-top';var velocity,gestureDistance;if(isTravelVertical){velocity=isTravelInverted?-gestureState.vy:gestureState.vy;gestureDistance=isTravelInverted?-gestureState.dy:gestureState.dy;}else{velocity=isTravelInverted?-gestureState.vx:gestureState.vx;gestureDistance=isTravelInverted?-gestureState.dx:gestureState.dx;}var transitionVelocity=clamp(-10,velocity,10);if(Math.abs(velocity)releaseGesture.fullDistance*releaseGesture.stillCompletionRatio;transitionVelocity=hasGesturedEnoughToComplete?releaseGesture.snapVelocity:-releaseGesture.snapVelocity;}if(transitionVelocity<0||this._doesGestureOverswipe(releaseGestureAction)){if(this.state.transitionFromIndex==null){var transitionBackToPresentedIndex=this.state.presentedIndex;this.state.presentedIndex=destIndex;this._transitionTo(transitionBackToPresentedIndex,-transitionVelocity,1-this.spring.getCurrentValue());}}else{this._emitWillFocus(this.state.routeStack[destIndex]);this._transitionTo(destIndex,transitionVelocity,null,function(){if(releaseGestureAction==='pop'){_this4._cleanScenesPastIndex(destIndex);}});}this._detachGesture();},_handlePanResponderTerminate:function _handlePanResponderTerminate(e,gestureState){if(this.state.activeGesture==null){return;}var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);this._detachGesture();var transitionBackToPresentedIndex=this.state.presentedIndex;this.state.presentedIndex=destIndex;this._transitionTo(transitionBackToPresentedIndex,null,1-this.spring.getCurrentValue());},_attachGesture:function _attachGesture(gestureId){this.state.activeGesture=gestureId;var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);this._enableScene(gesturingToIndex);},_detachGesture:function _detachGesture(){this.state.activeGesture=null;this.state.pendingGestureProgress=null;this._hideScenes();},_handlePanResponderMove:function _handlePanResponderMove(e,gestureState){if(this._isMoveGestureAttached!==undefined){invariant(this._expectingGestureGrant,'Responder granted unexpectedly.');this._attachGesture(this._expectingGestureGrant);this._onAnimationStart();this._expectingGestureGrant=undefined;}var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex];if(this.state.activeGesture){var gesture=sceneConfig.gestures[this.state.activeGesture];return this._moveAttachedGesture(gesture,gestureState);}var matchedGesture=this._matchGestureAction(GESTURE_ACTIONS,sceneConfig.gestures,gestureState);if(matchedGesture){this._attachGesture(matchedGesture);}},_moveAttachedGesture:function _moveAttachedGesture(gesture,gestureState){var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top';var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top';var distance=isTravelVertical?gestureState.dy:gestureState.dx;distance=isTravelInverted?-distance:distance;var gestureDetectMovement=gesture.gestureDetectMovement;var nextProgress=(distance-gestureDetectMovement)/(gesture.fullDistance-gestureDetectMovement);if(nextProgress<0&&gesture.isDetachable){var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);this._transitionBetween(this.state.presentedIndex,gesturingToIndex,0);this._detachGesture();if(this.state.pendingGestureProgress!=null){this.spring.setCurrentValue(0);}return;}if(gesture.overswipe&&this._doesGestureOverswipe(this.state.activeGesture)){var frictionConstant=gesture.overswipe.frictionConstant;var frictionByDistance=gesture.overswipe.frictionByDistance;var frictionRatio=1/(frictionConstant+Math.abs(nextProgress)*frictionByDistance);nextProgress*=frictionRatio;}nextProgress=clamp(0,nextProgress,1);if(this.state.transitionFromIndex!=null){this.state.pendingGestureProgress=nextProgress;}else if(this.state.pendingGestureProgress){this.spring.setEndValue(nextProgress);}else{this.spring.setCurrentValue(nextProgress);}},_matchGestureAction:function _matchGestureAction(eligibleGestures,gestures,gestureState){var _this5=this;if(!gestures||!eligibleGestures||!eligibleGestures.some){return null;}var matchedGesture=null;eligibleGestures.some(function(gestureName,gestureIndex){var gesture=gestures[gestureName];if(!gesture){return;}if(gesture.overswipe==null&&_this5._doesGestureOverswipe(gestureName)){return false;}var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top';var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top';var startedLoc=isTravelVertical?gestureState.y0:gestureState.x0;var currentLoc=isTravelVertical?gestureState.moveY:gestureState.moveX;var travelDist=isTravelVertical?gestureState.dy:gestureState.dx;var oppositeAxisTravelDist=isTravelVertical?gestureState.dx:gestureState.dy;var edgeHitWidth=gesture.edgeHitWidth;if(isTravelInverted){startedLoc=-startedLoc;currentLoc=-currentLoc;travelDist=-travelDist;oppositeAxisTravelDist=-oppositeAxisTravelDist;edgeHitWidth=isTravelVertical?-(SCREEN_HEIGHT-edgeHitWidth):-(SCREEN_WIDTH-edgeHitWidth);}if(startedLoc===0){startedLoc=currentLoc;}var moveStartedInRegion=gesture.edgeHitWidth==null||startedLoc=gesture.gestureDetectMovement;if(!moveTravelledFarEnough){return false;}var directionIsCorrect=Math.abs(travelDist)>Math.abs(oppositeAxisTravelDist)*gesture.directionRatio;if(directionIsCorrect){matchedGesture=gestureName;return true;}else{_this5._eligibleGestures=_this5._eligibleGestures.slice().splice(gestureIndex,1);}});return matchedGesture||null;},_transitionSceneStyle:function _transitionSceneStyle(fromIndex,toIndex,progress,index){var viewAtIndex=this._sceneRefs[index];if(viewAtIndex===null||viewAtIndex===undefined){return;}var sceneConfigIndex=fromIndex=0&&fromIndex>=0){navBar.updateProgress(progress,fromIndex,toIndex);}},_handleResponderTerminationRequest:function _handleResponderTerminationRequest(){return false;},_getDestIndexWithinBounds:function _getDestIndexWithinBounds(n){var currentIndex=this.state.presentedIndex;var destIndex=currentIndex+n;invariant(destIndex>=0,'Cannot jump before the first route.');var maxIndex=this.state.routeStack.length-1;invariant(maxIndex>=destIndex,'Cannot jump past the last route.');return destIndex;},_jumpN:function _jumpN(n){var destIndex=this._getDestIndexWithinBounds(n);this._enableScene(destIndex);this._emitWillFocus(this.state.routeStack[destIndex]);this._transitionTo(destIndex);},jumpTo:function jumpTo(route){var destIndex=this.state.routeStack.indexOf(route);invariant(destIndex!==-1,'Cannot jump to route that is not in the route stack');this._jumpN(destIndex-this.state.presentedIndex);},jumpForward:function jumpForward(){this._jumpN(1);},jumpBack:function jumpBack(){this._jumpN(-1);},push:function push(route){var _this6=this;invariant(!!route,'Must supply route to push');var activeLength=this.state.presentedIndex+1;var activeStack=this.state.routeStack.slice(0,activeLength);var activeAnimationConfigStack=this.state.sceneConfigStack.slice(0,activeLength);var nextStack=activeStack.concat([route]);var destIndex=nextStack.length-1;var nextSceneConfig=this.props.configureScene(route,nextStack);var nextAnimationConfigStack=activeAnimationConfigStack.concat([nextSceneConfig]);this._emitWillFocus(nextStack[destIndex]);this.setState({routeStack:nextStack,sceneConfigStack:nextAnimationConfigStack},function(){_this6._enableScene(destIndex);_this6._transitionTo(destIndex,nextSceneConfig.defaultTransitionVelocity);});},popN:function popN(n){var _this7=this;invariant(typeof n==='number','Must supply a number to popN');n=parseInt(n,10);if(n<=0||this.state.presentedIndex-n<0){return;}var popIndex=this.state.presentedIndex-n;var presentedRoute=this.state.routeStack[this.state.presentedIndex];var popSceneConfig=this.props.configureScene(presentedRoute);this._enableScene(popIndex);this._clearTransformations(popIndex);this._emitWillFocus(this.state.routeStack[popIndex]);this._transitionTo(popIndex,popSceneConfig.defaultTransitionVelocity,null,function(){_this7._cleanScenesPastIndex(popIndex);});},pop:function pop(){if(this.state.transitionQueue.length){return;}this.popN(1);},replaceAtIndex:function replaceAtIndex(route,index,cb){var _this8=this;invariant(!!route,'Must supply route to replace');if(index<0){index+=this.state.routeStack.length;}if(this.state.routeStack.length<=index){return;}var nextRouteStack=this.state.routeStack.slice();var nextAnimationModeStack=this.state.sceneConfigStack.slice();nextRouteStack[index]=route;nextAnimationModeStack[index]=this.props.configureScene(route,nextRouteStack);if(index===this.state.presentedIndex){this._emitWillFocus(route);}this.setState({routeStack:nextRouteStack,sceneConfigStack:nextAnimationModeStack},function(){if(index===_this8.state.presentedIndex){_this8._emitDidFocus(route);}cb&&cb();});},replace:function replace(route){this.replaceAtIndex(route,this.state.presentedIndex);},replacePrevious:function replacePrevious(route){this.replaceAtIndex(route,this.state.presentedIndex-1);},popToTop:function popToTop(){this.popToRoute(this.state.routeStack[0]);},popToRoute:function popToRoute(route){var indexOfRoute=this.state.routeStack.indexOf(route);invariant(indexOfRoute!==-1,'Calling popToRoute for a route that doesn\'t exist!');var numToPop=this.state.presentedIndex-indexOfRoute;this.popN(numToPop);},replacePreviousAndPop:function replacePreviousAndPop(route){if(this.state.routeStack.length<2){return;}this.replacePrevious(route);this.pop();},resetTo:function resetTo(route){var _this9=this;invariant(!!route,'Must supply route to push');this.replaceAtIndex(route,0,function(){_this9.popN(_this9.state.presentedIndex);});},getCurrentRoutes:function getCurrentRoutes(){return this.state.routeStack.slice();},_cleanScenesPastIndex:function _cleanScenesPastIndex(index){var newStackLength=index+1;if(newStackLengthfromIndex?progress:1-progress;var oldDistToCenter=index-fromIndex;var newDistToCenter=index-toIndex;var interpolate;invariant(Interpolators[index],'Cannot find breadcrumb interpolators for '+index);if(oldDistToCenter>0&&newDistToCenter===0||newDistToCenter>0&&oldDistToCenter===0){interpolate=Interpolators[index].RightToCenter;}else if(oldDistToCenter<0&&newDistToCenter===0||newDistToCenter<0&&oldDistToCenter===0){interpolate=Interpolators[index].CenterToLeft;}else if(oldDistToCenter===newDistToCenter){interpolate=Interpolators[index].RightToCenter;}else{interpolate=Interpolators[index].RightToLeft;}if(interpolate.Crumb(CRUMB_PROPS[index].style,amount)){this._setPropsIfExists('crumb_'+index,CRUMB_PROPS[index]);}if(interpolate.Icon(ICON_PROPS[index].style,amount)){this._setPropsIfExists('icon_'+index,ICON_PROPS[index]);}if(interpolate.Separator(SEPARATOR_PROPS[index].style,amount)){this._setPropsIfExists('separator_'+index,SEPARATOR_PROPS[index]);}if(interpolate.Title(TITLE_PROPS[index].style,amount)){this._setPropsIfExists('title_'+index,TITLE_PROPS[index]);}var right=this.refs['right_'+index];var rightButtonStyle=RIGHT_BUTTON_PROPS[index].style;if(right&&interpolate.RightItem(rightButtonStyle,amount)){right.setNativeProps({style:rightButtonStyle,pointerEvents:rightButtonStyle.opacity===0?'none':'auto'});}}},{key:'updateProgress',value:function updateProgress(progress,fromIndex,toIndex){var max=Math.max(fromIndex,toIndex);var min=Math.min(fromIndex,toIndex);for(var index=min;index<=max;index++){this._updateIndexProgress(progress,index,fromIndex,toIndex);}}},{key:'onAnimationStart',value:function onAnimationStart(fromIndex,toIndex){var max=Math.max(fromIndex,toIndex);var min=Math.min(fromIndex,toIndex);for(var index=min;index<=max;index++){this._setRenderViewsToHardwareTextureAndroid(index,true);}}},{key:'onAnimationEnd',value:function onAnimationEnd(){var max=this.props.navState.routeStack.length-1;for(var index=0;index<=max;index++){this._setRenderViewsToHardwareTextureAndroid(index,false);}}},{key:'_setRenderViewsToHardwareTextureAndroid',value:function _setRenderViewsToHardwareTextureAndroid(index,renderToHardwareTexture){var props={renderToHardwareTextureAndroid:renderToHardwareTexture};this._setPropsIfExists('icon_'+index,props);this._setPropsIfExists('separator_'+index,props);this._setPropsIfExists('title_'+index,props);this._setPropsIfExists('right_'+index,props);}},{key:'componentWillMount',value:function componentWillMount(){this._reset();}},{key:'render',value:function render(){var navState=this.props.navState;var icons=navState&&navState.routeStack.map(this._getBreadcrumb);var titles=navState.routeStack.map(this._getTitle);var buttons=navState.routeStack.map(this._getRightButton);return React.createElement(View,{key:this._key,style:[styles.breadCrumbContainer,this.props.style],__source:{fileName:_jsxFileName,lineNumber:196}},titles,icons,buttons);}},{key:'immediatelyRefresh',value:function immediatelyRefresh(){this._reset();this.forceUpdate();}},{key:'_reset',value:function _reset(){this._key=guid();this._descriptors={title:new Map(),right:new Map()};}},{key:'_setPropsIfExists',value:function _setPropsIfExists(ref,props){var ref=this.refs[ref];ref&&ref.setNativeProps(props);}}]);return NavigatorBreadcrumbNavigationBar;}(React.Component);NavigatorBreadcrumbNavigationBar.propTypes={navigator:PropTypes.shape({push:PropTypes.func,pop:PropTypes.func,replace:PropTypes.func,popToRoute:PropTypes.func,popToTop:PropTypes.func}),routeMapper:PropTypes.shape({rightContentForRoute:PropTypes.func,titleContentForRoute:PropTypes.func,iconForRoute:PropTypes.func}),navState:React.PropTypes.shape({routeStack:React.PropTypes.arrayOf(React.PropTypes.object),presentedIndex:React.PropTypes.number}),style:View.propTypes.style};NavigatorBreadcrumbNavigationBar.Styles=NavigatorBreadcrumbNavigationBarStyles;var styles=StyleSheet.create({breadCrumbContainer:{overflow:'hidden',position:'absolute',height:NavigatorNavigationBarStyles.General.TotalNavHeight,top:0,left:0,right:0}});module.exports=NavigatorBreadcrumbNavigationBar;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBarStyles.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Dimensions=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Dimensions.js");var NavigatorNavigationBarStylesIOS=__webpack_require__("./node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js");var buildStyleInterpolator=__webpack_require__("./node_modules/react-native/Libraries/Utilities/buildStyleInterpolator.js");var merge=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/merge.js");var SCREEN_WIDTH=Dimensions.get('window').width;var STATUS_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.StatusBarHeight;var NAV_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.NavBarHeight;var SPACING=4;var ICON_WIDTH=40;var SEPARATOR_WIDTH=9;var CRUMB_WIDTH=ICON_WIDTH+SEPARATOR_WIDTH;var OPACITY_RATIO=100;var ICON_INACTIVE_OPACITY=0.6;var MAX_BREADCRUMBS=10;var CRUMB_BASE={position:'absolute',flexDirection:'row',top:STATUS_BAR_HEIGHT,width:CRUMB_WIDTH,height:NAV_BAR_HEIGHT,backgroundColor:'transparent'};var ICON_BASE={width:ICON_WIDTH,height:NAV_BAR_HEIGHT};var SEPARATOR_BASE={width:SEPARATOR_WIDTH,height:NAV_BAR_HEIGHT};var TITLE_BASE={position:'absolute',top:STATUS_BAR_HEIGHT,height:NAV_BAR_HEIGHT,backgroundColor:'transparent'};var FIRST_TITLE_BASE=merge(TITLE_BASE,{left:0,right:0,alignItems:'center',height:NAV_BAR_HEIGHT});var RIGHT_BUTTON_BASE={position:'absolute',top:STATUS_BAR_HEIGHT,right:SPACING,overflow:'hidden',opacity:1,height:NAV_BAR_HEIGHT,backgroundColor:'transparent'};var LEFT=[];var CENTER=[];var RIGHT=[];for(var i=0;ifromIndex?progress:1-progress;var oldDistToCenter=index-fromIndex;var newDistToCenter=index-toIndex;var interpolate;if(oldDistToCenter>0&&newDistToCenter===0||newDistToCenter>0&&oldDistToCenter===0){interpolate=_this.props.navigationStyles.Interpolators.RightToCenter;}else if(oldDistToCenter<0&&newDistToCenter===0||newDistToCenter<0&&oldDistToCenter===0){interpolate=_this.props.navigationStyles.Interpolators.CenterToLeft;}else if(oldDistToCenter===newDistToCenter){interpolate=_this.props.navigationStyles.Interpolators.RightToCenter;}else{interpolate=_this.props.navigationStyles.Interpolators.RightToLeft;}COMPONENT_NAMES.forEach(function(componentName){var component=this._components[componentName].get(this.props.navState.routeStack[index]);var props=this._getReusableProps(componentName,index);if(component&&interpolate[componentName](props.style,amount)){props.pointerEvents=props.style.opacity===0?'none':'box-none';component.setNativeProps(props);}},_this);},_this.updateProgress=function(progress,fromIndex,toIndex){var max=Math.max(fromIndex,toIndex);var min=Math.min(fromIndex,toIndex);for(var index=min;index<=max;index++){_this._updateIndexProgress(progress,index,fromIndex,toIndex);}},_this._getComponent=function(componentName,route,index){if(_this._descriptors[componentName].includes(route)){return _this._descriptors[componentName].get(route);}var rendered=null;var content=_this.props.routeMapper[componentName](_this.props.navState.routeStack[index],_this.props.navigator,index,_this.props.navState);if(!content){return null;}var componentIsActive=index===navStatePresentedIndex(_this.props.navState);var initialStage=componentIsActive?_this.props.navigationStyles.Stages.Center:_this.props.navigationStyles.Stages.Left;rendered=React.createElement(View,{ref:function ref(_ref2){_this._components[componentName]=_this._components[componentName].set(route,_ref2);},pointerEvents:componentIsActive?'box-none':'none',style:initialStage[componentName],__source:{fileName:_jsxFileName,lineNumber:196}},content);_this._descriptors[componentName]=_this._descriptors[componentName].set(route,rendered);return rendered;},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(NavigatorNavigationBar,[{key:'componentWillMount',value:function componentWillMount(){this._reset();}},{key:'render',value:function render(){var _this2=this;var navBarStyle={height:this.props.navigationStyles.General.TotalNavHeight};var navState=this.props.navState;var components=navState.routeStack.map(function(route,index){return COMPONENT_NAMES.map(function(componentName){return _this2._getComponent(componentName,route,index);});});return React.createElement(View,{key:this._key,style:[styles.navBarContainer,navBarStyle,this.props.style],__source:{fileName:_jsxFileName,lineNumber:166}},components);}}]);return NavigatorNavigationBar;}(React.Component);NavigatorNavigationBar.propTypes={navigator:React.PropTypes.object,routeMapper:React.PropTypes.shape({Title:React.PropTypes.func.isRequired,LeftButton:React.PropTypes.func.isRequired,RightButton:React.PropTypes.func.isRequired}).isRequired,navState:React.PropTypes.shape({routeStack:React.PropTypes.arrayOf(React.PropTypes.object),presentedIndex:React.PropTypes.number}),navigationStyles:React.PropTypes.object,style:View.propTypes.style};NavigatorNavigationBar.Styles=NavigatorNavigationBarStyles;NavigatorNavigationBar.StylesAndroid=NavigatorNavigationBarStylesAndroid;NavigatorNavigationBar.StylesIOS=NavigatorNavigationBarStylesIOS;NavigatorNavigationBar.defaultProps={navigationStyles:NavigatorNavigationBarStyles};var styles=StyleSheet.create({navBarContainer:{position:'absolute',top:0,left:0,right:0,backgroundColor:'transparent'}});module.exports=NavigatorNavigationBar;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesAndroid.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var buildStyleInterpolator=__webpack_require__("./node_modules/react-native/Libraries/Utilities/buildStyleInterpolator.js");var merge=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/merge.js");var NAV_BAR_HEIGHT=56;var TITLE_LEFT=72;var BUTTON_SIZE=24;var TOUCH_TARGT_SIZE=48;var BUTTON_HORIZONTAL_MARGIN=16;var BUTTON_EFFECTIVE_MARGIN=BUTTON_HORIZONTAL_MARGIN-(TOUCH_TARGT_SIZE-BUTTON_SIZE)/2;var NAV_ELEMENT_HEIGHT=NAV_BAR_HEIGHT;var BASE_STYLES={Title:{position:'absolute',bottom:0,left:0,right:0,alignItems:'flex-start',height:NAV_ELEMENT_HEIGHT,backgroundColor:'transparent',marginLeft:TITLE_LEFT},LeftButton:{position:'absolute',top:0,left:BUTTON_EFFECTIVE_MARGIN,overflow:'hidden',height:NAV_ELEMENT_HEIGHT,backgroundColor:'transparent'},RightButton:{position:'absolute',top:0,right:BUTTON_EFFECTIVE_MARGIN,overflow:'hidden',alignItems:'flex-end',height:NAV_ELEMENT_HEIGHT,backgroundColor:'transparent'}};var Stages={Left:{Title:merge(BASE_STYLES.Title,{opacity:0}),LeftButton:merge(BASE_STYLES.LeftButton,{opacity:0}),RightButton:merge(BASE_STYLES.RightButton,{opacity:0})},Center:{Title:merge(BASE_STYLES.Title,{opacity:1}),LeftButton:merge(BASE_STYLES.LeftButton,{opacity:1}),RightButton:merge(BASE_STYLES.RightButton,{opacity:1})},Right:{Title:merge(BASE_STYLES.Title,{opacity:0}),LeftButton:merge(BASE_STYLES.LeftButton,{opacity:0}),RightButton:merge(BASE_STYLES.RightButton,{opacity:0})}};var opacityRatio=100;function buildSceneInterpolators(startStyles,endStyles){return{Title:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.Title.opacity,to:endStyles.Title.opacity,min:0,max:1},left:{type:'linear',from:startStyles.Title.left,to:endStyles.Title.left,min:0,max:1,extrapolate:true}}),LeftButton:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.LeftButton.opacity,to:endStyles.LeftButton.opacity,min:0,max:1,round:opacityRatio},left:{type:'linear',from:startStyles.LeftButton.left,to:endStyles.LeftButton.left,min:0,max:1}}),RightButton:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.RightButton.opacity,to:endStyles.RightButton.opacity,min:0,max:1,round:opacityRatio},left:{type:'linear',from:startStyles.RightButton.left,to:endStyles.RightButton.left,min:0,max:1,extrapolate:true}})};}var Interpolators={RightToCenter:buildSceneInterpolators(Stages.Right,Stages.Center),CenterToLeft:buildSceneInterpolators(Stages.Center,Stages.Left),RightToLeft:buildSceneInterpolators(Stages.Right,Stages.Left)};module.exports={General:{NavBarHeight:NAV_BAR_HEIGHT,StatusBarHeight:0,TotalNavHeight:NAV_BAR_HEIGHT},Interpolators:Interpolators,Stages:Stages};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Dimensions=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Dimensions.js");var buildStyleInterpolator=__webpack_require__("./node_modules/react-native/Libraries/Utilities/buildStyleInterpolator.js");var merge=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/merge.js");var SCREEN_WIDTH=Dimensions.get('window').width;var NAV_BAR_HEIGHT=44;var STATUS_BAR_HEIGHT=20;var NAV_HEIGHT=NAV_BAR_HEIGHT+STATUS_BAR_HEIGHT;var BASE_STYLES={Title:{position:'absolute',top:STATUS_BAR_HEIGHT,left:0,right:0,alignItems:'center',height:NAV_BAR_HEIGHT,backgroundColor:'transparent'},LeftButton:{position:'absolute',top:STATUS_BAR_HEIGHT,left:0,overflow:'hidden',opacity:1,height:NAV_BAR_HEIGHT,backgroundColor:'transparent'},RightButton:{position:'absolute',top:STATUS_BAR_HEIGHT,right:0,overflow:'hidden',opacity:1,alignItems:'flex-end',height:NAV_BAR_HEIGHT,backgroundColor:'transparent'}};var Stages={Left:{Title:merge(BASE_STYLES.Title,{left:-SCREEN_WIDTH/2,opacity:0}),LeftButton:merge(BASE_STYLES.LeftButton,{left:0,opacity:0}),RightButton:merge(BASE_STYLES.RightButton,{opacity:0})},Center:{Title:merge(BASE_STYLES.Title,{left:0,opacity:1}),LeftButton:merge(BASE_STYLES.LeftButton,{left:0,opacity:1}),RightButton:merge(BASE_STYLES.RightButton,{opacity:1})},Right:{Title:merge(BASE_STYLES.Title,{left:SCREEN_WIDTH/2,opacity:0}),LeftButton:merge(BASE_STYLES.LeftButton,{left:0,opacity:0}),RightButton:merge(BASE_STYLES.RightButton,{opacity:0})}};var opacityRatio=100;function buildSceneInterpolators(startStyles,endStyles){return{Title:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.Title.opacity,to:endStyles.Title.opacity,min:0,max:1},left:{type:'linear',from:startStyles.Title.left,to:endStyles.Title.left,min:0,max:1,extrapolate:true}}),LeftButton:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.LeftButton.opacity,to:endStyles.LeftButton.opacity,min:0,max:1,round:opacityRatio},left:{type:'linear',from:startStyles.LeftButton.left,to:endStyles.LeftButton.left,min:0,max:1}}),RightButton:buildStyleInterpolator({opacity:{type:'linear',from:startStyles.RightButton.opacity,to:endStyles.RightButton.opacity,min:0,max:1,round:opacityRatio},left:{type:'linear',from:startStyles.RightButton.left,to:endStyles.RightButton.left,min:0,max:1,extrapolate:true}})};}var Interpolators={RightToCenter:buildSceneInterpolators(Stages.Right,Stages.Center),CenterToLeft:buildSceneInterpolators(Stages.Center,Stages.Left),RightToLeft:buildSceneInterpolators(Stages.Right,Stages.Left)};module.exports={General:{NavBarHeight:NAV_BAR_HEIGHT,StatusBarHeight:STATUS_BAR_HEIGHT,TotalNavHeight:NAV_HEIGHT},Interpolators:Interpolators,Stages:Stages};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}(_emitter=this._emitter).emit.apply(_emitter,[eventType].concat(_toConsumableArray(args)));}},{key:'emitAndHold',value:function emitAndHold(eventType){var _eventHolder,_emitter2;for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}this._currentEventToken=(_eventHolder=this._eventHolder).holdEvent.apply(_eventHolder,[eventType].concat(_toConsumableArray(args)));(_emitter2=this._emitter).emit.apply(_emitter2,[eventType].concat(_toConsumableArray(args)));this._currentEventToken=null;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent(){if(this._currentEventToken){this._eventHolder.releaseEvent(this._currentEventToken);}else if(this._emittingHeldEvents){this._eventHolder.releaseCurrentEvent();}}},{key:'releaseHeldEventType',value:function releaseHeldEventType(eventType){this._eventHolder.releaseEventType(eventType);}}]);return EventEmitterWithHolding;}();module.exports=EventEmitterWithHolding;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/EventEmitter/EventHolder.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}eventsOfType.push(args);return key;}},{key:'emitToListener',value:function emitToListener(eventType,listener,context){var _this=this;var eventsOfType=this._heldEvents[eventType];if(!eventsOfType){return;}var origEventKey=this._currentEventKey;eventsOfType.forEach(function(eventHeld,index){if(!eventHeld){return;}_this._currentEventKey={eventType:eventType,index:index};listener.apply(context,eventHeld);});this._currentEventKey=origEventKey;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent(){invariant(this._currentEventKey!==null,'Not in an emitting cycle; there is no current event');this._currentEventKey&&this.releaseEvent(this._currentEventKey);}},{key:'releaseEvent',value:function releaseEvent(token){delete this._heldEvents[token.eventType][token.index];}},{key:'releaseEventType',value:function releaseEventType(type){this._heldEvents[type]=[];}}]);return EventHolder;}();module.exports=EventHolder;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/EventEmitter/EventSubscription.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;irecommendationB.distance){return 1;}else{return 0;}};var isCloseEnough=function isCloseEnough(closestType,actualType){return closestType.distance/actualType.length<0.334;};var damerauLevenshteinDistance=function damerauLevenshteinDistance(a,b){var i=void 0,j=void 0;var d=[];for(i=0;i<=a.length;i++){d[i]=[i];}for(j=1;j<=b.length;j++){d[0][j]=j;}for(i=1;i<=a.length;i++){for(j=1;j<=b.length;j++){var cost=a.charAt(i-1)===b.charAt(j-1)?0:1;d[i][j]=Math.min(d[i-1][j]+1,d[i][j-1]+1,d[i-1][j-1]+cost);if(i>1&&j>1&&a.charAt(i-1)===b.charAt(j-2)&&a.charAt(i-2)===b.charAt(j-1)){d[i][j]=Math.min(d[i][j],d[i-2][j-2]+cost);}}}return d[a.length][b.length];};}module.exports=EventValidator;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0;},_swipeFullSpeed:function _swipeFullSpeed(gestureState){this.state.currentLeft.setValue(this._previousLeft+gestureState.dx);},_swipeSlowSpeed:function _swipeSlowSpeed(gestureState){this.state.currentLeft.setValue(this._previousLeft+gestureState.dx/SLOW_SPEED_SWIPE_FACTOR);},_isSwipingExcessivelyRightFromClosedPosition:function _isSwipingExcessivelyRightFromClosedPosition(gestureState){var gestureStateDx=IS_RTL?-gestureState.dx:gestureState.dx;return this._isSwipingRightFromClosed(gestureState)&&gestureStateDx>RIGHT_SWIPE_THRESHOLD;},_onPanResponderTerminationRequest:function _onPanResponderTerminationRequest(event,gestureState){return false;},_animateTo:function _animateTo(toValue){var _this2=this;var duration=arguments.length>1&&arguments[1]!==undefined?arguments[1]:SWIPE_DURATION;var callback=arguments.length>2&&arguments[2]!==undefined?arguments[2]:emptyFunction;Animated.timing(this.state.currentLeft,{duration:duration,toValue:toValue}).start(function(){_this2._previousLeft=toValue;callback();});},_animateToOpenPosition:function _animateToOpenPosition(){var maxSwipeDistance=IS_RTL?-this.props.maxSwipeDistance:this.props.maxSwipeDistance;this._animateTo(-maxSwipeDistance);},_animateToOpenPositionWith:function _animateToOpenPositionWith(speed,distMoved){speed=speed>HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD?speed:HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD;var duration=Math.abs((this.props.maxSwipeDistance-Math.abs(distMoved))/speed);var maxSwipeDistance=IS_RTL?-this.props.maxSwipeDistance:this.props.maxSwipeDistance;this._animateTo(-maxSwipeDistance,duration);},_animateToClosedPosition:function _animateToClosedPosition(){var duration=arguments.length>0&&arguments[0]!==undefined?arguments[0]:SWIPE_DURATION;this._animateTo(CLOSED_LEFT_POSITION,duration);},_animateToClosedPositionDuringBounce:function _animateToClosedPositionDuringBounce(){this._animateToClosedPosition(RIGHT_SWIPE_BOUNCE_BACK_DURATION);},_animateBounceBack:function _animateBounceBack(duration){var swipeBounceBackDistance=IS_RTL?-RIGHT_SWIPE_BOUNCE_BACK_DISTANCE:RIGHT_SWIPE_BOUNCE_BACK_DISTANCE;this._animateTo(-swipeBounceBackDistance,duration,this._animateToClosedPositionDuringBounce);},_isValidSwipe:function _isValidSwipe(gestureState){return Math.abs(gestureState.dx)>HORIZONTAL_SWIPE_DISTANCE_THRESHOLD;},_shouldAnimateRemainder:function _shouldAnimateRemainder(gestureState){return Math.abs(gestureState.dx)>this.props.swipeThreshold||gestureState.vx>HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD;},_handlePanResponderEnd:function _handlePanResponderEnd(event,gestureState){var horizontalDistance=IS_RTL?-gestureState.dx:gestureState.dx;if(this._isSwipingRightFromClosed(gestureState)){this.props.onOpen();this._animateBounceBack(RIGHT_SWIPE_BOUNCE_BACK_DURATION);}else if(this._shouldAnimateRemainder(gestureState)){if(horizontalDistance<0){this.props.onOpen();this._animateToOpenPositionWith(gestureState.vx,horizontalDistance);}else{this._animateToClosedPosition();}}else{if(this._previousLeft===CLOSED_LEFT_POSITION){this._animateToClosedPosition();}else{this._animateToOpenPosition();}}this.props.onSwipeEnd();}});var styles=StyleSheet.create({slideOutContainer:{bottom:0,left:0,position:'absolute',right:0,top:0},swipeableContainer:{flex:1}});module.exports=SwipeableRow;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Geolocation/Geolocation.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var NativeEventEmitter=__webpack_require__("./node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js");var RCTLocationObserver=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").LocationObserver;var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var logError=__webpack_require__("./node_modules/react-native/Libraries/Utilities/logError.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var LocationEventEmitter=new NativeEventEmitter(RCTLocationObserver);var subscriptions=[];var updatesEnabled=false;var Geolocation={getCurrentPosition:function getCurrentPosition(geo_success,geo_error,geo_options){invariant(typeof geo_success==='function','Must provide a valid geo_success callback.');RCTLocationObserver.getCurrentPosition(geo_options||{},geo_success,geo_error||logError);},watchPosition:function watchPosition(success,error,options){if(!updatesEnabled){RCTLocationObserver.startObserving(options||{});updatesEnabled=true;}var watchID=subscriptions.length;subscriptions.push([LocationEventEmitter.addListener('geolocationDidChange',success),error?LocationEventEmitter.addListener('geolocationError',error):null]);return watchID;},clearWatch:function clearWatch(watchID){var sub=subscriptions[watchID];if(!sub){return;}sub[0].remove();var sub1=sub[1];sub1&&sub1.remove();subscriptions[watchID]=undefined;var noWatchers=true;for(var ii=0;ii=deviceScale){return scales[i];}}return scales[scales.length-1]||1;}}]);return AssetSourceResolver;}();module.exports=AssetSourceResolver;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Image/Image.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i component requires a `source` property rather than `src`.');}return React.createElement(RCTImageView,_extends({},this.props,{style:style,resizeMode:resizeMode,tintColor:tintColor,source:sources,__source:{fileName:_jsxFileName,lineNumber:365}}));}});var styles=StyleSheet.create({base:{overflow:'hidden'}});var RCTImageView=requireNativeComponent('RCTImageView',Image);module.exports=Image;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Image/ImageEditor.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){_nextUpdateHandle=setTimeout(_processUpdate,0+DEBUG_DELAY);}else{_nextUpdateHandle=setImmediate(_processUpdate);}}}function _processUpdate(){_nextUpdateHandle=0;var interactionCount=_interactionSet.size;_addInteractionSet.forEach(function(handle){return _interactionSet.add(handle);});_deleteInteractionSet.forEach(function(handle){return _interactionSet.delete(handle);});var nextInteractionCount=_interactionSet.size;if(interactionCount!==0&&nextInteractionCount===0){_emitter.emit(InteractionManager.Events.interactionComplete);}else if(interactionCount===0&&nextInteractionCount!==0){_emitter.emit(InteractionManager.Events.interactionStart);}if(nextInteractionCount===0){while(_taskQueue.hasTasksToProcess()){_taskQueue.processNext();if(_deadline>0&&BatchedBridge.getEventLoopRunningTime()>=_deadline){_scheduleUpdate();break;}}}_addInteractionSet.clear();_deleteInteractionSet.clear();}module.exports=InteractionManager;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/timers-browserify/main.js").setImmediate))
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Interaction/InteractionMixin.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var InteractionManager=__webpack_require__("./node_modules/react-native/Libraries/Interaction/InteractionManager.js");var InteractionMixin={componentWillUnmount:function componentWillUnmount(){while(this._interactionMixinHandles.length){InteractionManager.clearInteractionHandle(this._interactionMixinHandles.pop());}},_interactionMixinHandles:[],createInteractionHandle:function createInteractionHandle(){var handle=InteractionManager.createInteractionHandle();this._interactionMixinHandles.push(handle);return handle;},clearInteractionHandle:function clearInteractionHandle(clearHandle){InteractionManager.clearInteractionHandle(clearHandle);this._interactionMixinHandles=this._interactionMixinHandles.filter(function(handle){return handle!==clearHandle;});},runAfterInteractions:function runAfterInteractions(callback){InteractionManager.runAfterInteractions(callback);}};module.exports=InteractionMixin;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Interaction/PanResponder.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var InteractionManager=__webpack_require__("./node_modules/react-native/Libraries/Interaction/InteractionManager.js");var TouchHistoryMath=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js");var currentCentroidXOfTouchesChangedAfter=TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;var currentCentroidYOfTouchesChangedAfter=TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;var previousCentroidXOfTouchesChangedAfter=TouchHistoryMath.previousCentroidXOfTouchesChangedAfter;var previousCentroidYOfTouchesChangedAfter=TouchHistoryMath.previousCentroidYOfTouchesChangedAfter;var currentCentroidX=TouchHistoryMath.currentCentroidX;var currentCentroidY=TouchHistoryMath.currentCentroidY;var PanResponder={_initializeGestureState:function _initializeGestureState(gestureState){gestureState.moveX=0;gestureState.moveY=0;gestureState.x0=0;gestureState.y0=0;gestureState.dx=0;gestureState.dy=0;gestureState.vx=0;gestureState.vy=0;gestureState.numberActiveTouches=0;gestureState._accountsForMovesUpTo=0;},_updateGestureStateOnMove:function _updateGestureStateOnMove(gestureState,touchHistory){gestureState.numberActiveTouches=touchHistory.numberActiveTouches;gestureState.moveX=currentCentroidXOfTouchesChangedAfter(touchHistory,gestureState._accountsForMovesUpTo);gestureState.moveY=currentCentroidYOfTouchesChangedAfter(touchHistory,gestureState._accountsForMovesUpTo);var movedAfter=gestureState._accountsForMovesUpTo;var prevX=previousCentroidXOfTouchesChangedAfter(touchHistory,movedAfter);var x=currentCentroidXOfTouchesChangedAfter(touchHistory,movedAfter);var prevY=previousCentroidYOfTouchesChangedAfter(touchHistory,movedAfter);var y=currentCentroidYOfTouchesChangedAfter(touchHistory,movedAfter);var nextDX=gestureState.dx+(x-prevX);var nextDY=gestureState.dy+(y-prevY);var dt=touchHistory.mostRecentTimeStamp-gestureState._accountsForMovesUpTo;gestureState.vx=(nextDX-gestureState.dx)/dt;gestureState.vy=(nextDY-gestureState.dy)/dt;gestureState.dx=nextDX;gestureState.dy=nextDY;gestureState._accountsForMovesUpTo=touchHistory.mostRecentTimeStamp;},create:function create(config){var interactionState={handle:null};var gestureState={stateID:Math.random()};PanResponder._initializeGestureState(gestureState);var panHandlers={onStartShouldSetResponder:function onStartShouldSetResponder(e){return config.onStartShouldSetPanResponder===undefined?false:config.onStartShouldSetPanResponder(e,gestureState);},onMoveShouldSetResponder:function onMoveShouldSetResponder(e){return config.onMoveShouldSetPanResponder===undefined?false:config.onMoveShouldSetPanResponder(e,gestureState);},onStartShouldSetResponderCapture:function onStartShouldSetResponderCapture(e){if(e.nativeEvent.touches.length===1){PanResponder._initializeGestureState(gestureState);}gestureState.numberActiveTouches=e.touchHistory.numberActiveTouches;return config.onStartShouldSetPanResponderCapture!==undefined?config.onStartShouldSetPanResponderCapture(e,gestureState):false;},onMoveShouldSetResponderCapture:function onMoveShouldSetResponderCapture(e){var touchHistory=e.touchHistory;if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){return false;}PanResponder._updateGestureStateOnMove(gestureState,touchHistory);return config.onMoveShouldSetPanResponderCapture?config.onMoveShouldSetPanResponderCapture(e,gestureState):false;},onResponderGrant:function onResponderGrant(e){if(!interactionState.handle){interactionState.handle=InteractionManager.createInteractionHandle();}gestureState.x0=currentCentroidX(e.touchHistory);gestureState.y0=currentCentroidY(e.touchHistory);gestureState.dx=0;gestureState.dy=0;if(config.onPanResponderGrant){config.onPanResponderGrant(e,gestureState);}return config.onShouldBlockNativeResponder===undefined?true:config.onShouldBlockNativeResponder();},onResponderReject:function onResponderReject(e){clearInteractionHandle(interactionState,config.onPanResponderReject,e,gestureState);},onResponderRelease:function onResponderRelease(e){clearInteractionHandle(interactionState,config.onPanResponderRelease,e,gestureState);PanResponder._initializeGestureState(gestureState);},onResponderStart:function onResponderStart(e){var touchHistory=e.touchHistory;gestureState.numberActiveTouches=touchHistory.numberActiveTouches;if(config.onPanResponderStart){config.onPanResponderStart(e,gestureState);}},onResponderMove:function onResponderMove(e){var touchHistory=e.touchHistory;if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){return;}PanResponder._updateGestureStateOnMove(gestureState,touchHistory);if(config.onPanResponderMove){config.onPanResponderMove(e,gestureState);}},onResponderEnd:function onResponderEnd(e){var touchHistory=e.touchHistory;gestureState.numberActiveTouches=touchHistory.numberActiveTouches;clearInteractionHandle(interactionState,config.onPanResponderEnd,e,gestureState);},onResponderTerminate:function onResponderTerminate(e){clearInteractionHandle(interactionState,config.onPanResponderTerminate,e,gestureState);PanResponder._initializeGestureState(gestureState);},onResponderTerminationRequest:function onResponderTerminationRequest(e){return config.onPanResponderTerminationRequest===undefined?true:config.onPanResponderTerminationRequest(e,gestureState);}};return{panHandlers:panHandlers,getInteractionHandle:function getInteractionHandle(){return interactionState.handle;}};}};function clearInteractionHandle(interactionState,callback,event,gestureState){if(interactionState.handle){InteractionManager.clearInteractionHandle(interactionState.handle);interactionState.handle=null;}if(callback){callback(event,gestureState);}}module.exports=PanResponder;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Interaction/TaskQueue.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i0||idx===0;});}},{key:'hasTasksToProcess',value:function hasTasksToProcess(){return this._getCurrentQueue().length>0;}},{key:'processNext',value:function processNext(){var queue=this._getCurrentQueue();if(queue.length){var task=queue.shift();try{if(task.gen){DEBUG&&infoLog('genPromise for task '+task.name);this._genPromise(task);}else if(task.run){DEBUG&&infoLog('run task '+task.name);task.run();}else{invariant(typeof task==='function','Expected Function, SimpleTask, or PromiseTask, but got:\n'+JSON.stringify(task,null,2));DEBUG&&infoLog('run anonymous task');task();}}catch(e){e.message='TaskQueue: Error with task '+(task.name||'')+': '+e.message;throw e;}}}},{key:'_getCurrentQueue',value:function _getCurrentQueue(){var stackIdx=this._queueStack.length-1;var queue=this._queueStack[stackIdx];if(queue.popable&&queue.tasks.length===0&&this._queueStack.length>1){this._queueStack.pop();DEBUG&&infoLog('popped queue: ',{stackIdx:stackIdx,queueStackSize:this._queueStack.length});return this._getCurrentQueue();}else{return queue.tasks;}}},{key:'_genPromise',value:function _genPromise(task){var _this2=this;this._queueStack.push({tasks:[],popable:false});var stackIdx=this._queueStack.length-1;DEBUG&&infoLog('push new queue: ',{stackIdx:stackIdx});DEBUG&&infoLog('exec gen task '+task.name);task.gen().then(function(){DEBUG&&infoLog('onThen for gen task '+task.name,{stackIdx:stackIdx,queueStackSize:_this2._queueStack.length});_this2._queueStack[stackIdx].popable=true;_this2.hasTasksToProcess()&&_this2._onMoreTasks();}).catch(function(ex){ex.message='TaskQueue: Error resolving Promise in task '+task.name+': '+ex.message;throw ex;}).done();}}]);return TaskQueue;}();module.exports=TaskQueue;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _require=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js"),PropTypes=_require.PropTypes;var UIManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/UIManager.js");var createStrictShapeTypeChecker=__webpack_require__("./node_modules/react-native/Libraries/Utilities/createStrictShapeTypeChecker.js");var keyMirror=__webpack_require__("./node_modules/fbjs/lib/keyMirror.js");var TypesEnum={spring:true,linear:true,easeInEaseOut:true,easeIn:true,easeOut:true,keyboard:true};var Types=keyMirror(TypesEnum);var PropertiesEnum={opacity:true,scaleXY:true};var Properties=keyMirror(PropertiesEnum);var animChecker=createStrictShapeTypeChecker({duration:PropTypes.number,delay:PropTypes.number,springDamping:PropTypes.number,initialVelocity:PropTypes.number,type:PropTypes.oneOf(Object.keys(Types)).isRequired,property:PropTypes.oneOf(Object.keys(Properties))});var configChecker=createStrictShapeTypeChecker({duration:PropTypes.number.isRequired,create:animChecker,update:animChecker,delete:animChecker});function configureNext(config,onAnimationDidEnd){configChecker({config:config},'config','LayoutAnimation.configureNext');UIManager.configureNextLayoutAnimation(config,onAnimationDidEnd||function(){},function(){});}function create(duration,type,creationProp){return{duration:duration,create:{type:type,property:creationProp},update:{type:type},delete:{type:type,property:creationProp}};}var Presets={easeInEaseOut:create(300,Types.easeInEaseOut,Properties.opacity),linear:create(500,Types.linear,Properties.opacity),spring:{duration:700,create:{type:Types.linear,property:Properties.opacity},update:{type:Types.spring,springDamping:0.4},delete:{type:Types.linear,property:Properties.opacity}}};var LayoutAnimation={configureNext:configureNext,create:create,Types:Types,Properties:Properties,configChecker:configChecker,Presets:Presets,easeInEaseOut:configureNext.bind(null,Presets.easeInEaseOut),linear:configureNext.bind(null,Presets.linear),spring:configureNext.bind(null,Presets.spring)};module.exports=LayoutAnimation;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Linking/Linking.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){return 1;}if(delta<0){return-1;}return one>two?1:-1;}function compareScenes(one,two){if(one.index>two.index){return 1;}if(one.index=0,loaded:loaded,total:total});}},{key:'__didCompleteResponse',value:function __didCompleteResponse(requestId,error,timeOutError){if(requestId===this._requestId){if(error){if(this._responseType===''||this._responseType==='text'){this._response=error;}this._hasError=true;if(timeOutError){this._timedOut=true;}}this._clearSubscriptions();this._requestId=null;this.setReadyState(this.DONE);if(error){XMLHttpRequest._interceptor&&XMLHttpRequest._interceptor.loadingFailed(requestId,error);}else{XMLHttpRequest._interceptor&&XMLHttpRequest._interceptor.loadingFinished(requestId,this._response.length);}}}},{key:'_clearSubscriptions',value:function _clearSubscriptions(){(this._subscriptions||[]).forEach(function(sub){sub.remove();});this._subscriptions=[];}},{key:'getAllResponseHeaders',value:function getAllResponseHeaders(){if(!this.responseHeaders){return null;}var headers=this.responseHeaders||{};return Object.keys(headers).map(function(headerName){return headerName+': '+headers[headerName];}).join('\r\n');}},{key:'getResponseHeader',value:function getResponseHeader(header){var value=this._lowerCaseResponseHeaders[header.toLowerCase()];return value!==undefined?value:null;}},{key:'setRequestHeader',value:function setRequestHeader(header,value){if(this.readyState!==this.OPENED){throw new Error('Request has not been opened');}this._headers[header.toLowerCase()]=String(value);}},{key:'setTrackingName',value:function setTrackingName(trackingName){this._trackingName=trackingName;return this;}},{key:'open',value:function open(method,url,async){if(this.readyState!==this.UNSENT){throw new Error('Cannot open, already sending');}if(async!==undefined&&!async){throw new Error('Synchronous http requests are not supported');}if(!url){throw new Error('Cannot load an empty url');}this._method=method.toUpperCase();this._url=url;this._aborted=false;this.setReadyState(this.OPENED);}},{key:'send',value:function send(data){var _this3=this;if(this.readyState!==this.OPENED){throw new Error('Request has not been opened');}if(this._sent){throw new Error('Request has already been sent');}this._sent=true;var incrementalEvents=this._incrementalEvents||!!this.onreadystatechange||!!this.onprogress;this._subscriptions.push(RCTNetworking.addListener('didSendNetworkData',function(args){return _this3.__didUploadProgress.apply(_this3,_toConsumableArray(args));}));this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkResponse',function(args){return _this3.__didReceiveResponse.apply(_this3,_toConsumableArray(args));}));this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkData',function(args){return _this3.__didReceiveData.apply(_this3,_toConsumableArray(args));}));this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkIncrementalData',function(args){return _this3.__didReceiveIncrementalData.apply(_this3,_toConsumableArray(args));}));this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkDataProgress',function(args){return _this3.__didReceiveDataProgress.apply(_this3,_toConsumableArray(args));}));this._subscriptions.push(RCTNetworking.addListener('didCompleteNetworkResponse',function(args){return _this3.__didCompleteResponse.apply(_this3,_toConsumableArray(args));}));var nativeResponseType='text';if(this._responseType==='arraybuffer'||this._responseType==='blob'){nativeResponseType='base64';}invariant(this._method,'Request method needs to be defined.');invariant(this._url,'Request URL needs to be defined.');RCTNetworking.sendRequest(this._method,this._trackingName,this._url,this._headers,data,nativeResponseType,incrementalEvents,this.timeout,this.__didCreateRequest.bind(this));}},{key:'abort',value:function abort(){this._aborted=true;if(this._requestId){RCTNetworking.abortRequest(this._requestId);}if(!(this.readyState===this.UNSENT||this.readyState===this.OPENED&&!this._sent||this.readyState===this.DONE)){this._reset();this.setReadyState(this.DONE);}this._reset();}},{key:'setResponseHeaders',value:function setResponseHeaders(responseHeaders){this.responseHeaders=responseHeaders||null;var headers=responseHeaders||{};this._lowerCaseResponseHeaders=Object.keys(headers).reduce(function(lcaseHeaders,headerName){lcaseHeaders[headerName.toLowerCase()]=headers[headerName];return lcaseHeaders;},{});}},{key:'setReadyState',value:function setReadyState(newState){this.readyState=newState;this.dispatchEvent({type:'readystatechange'});if(newState===this.DONE){if(this._aborted){this.dispatchEvent({type:'abort'});}else if(this._hasError){if(this._timedOut){this.dispatchEvent({type:'timeout'});}else{this.dispatchEvent({type:'error'});}}else{this.dispatchEvent({type:'load'});}this.dispatchEvent({type:'loadend'});}}},{key:'addEventListener',value:function addEventListener(type,listener){if(type==='readystatechange'||type==='progress'){this._incrementalEvents=true;}_get(XMLHttpRequest.prototype.__proto__||Object.getPrototypeOf(XMLHttpRequest.prototype),'addEventListener',this).call(this,type,listener);}},{key:'responseType',get:function get(){return this._responseType;},set:function set(responseType){if(this._sent){throw new Error('Failed to set the \'responseType\' property on \'XMLHttpRequest\': The '+'response type cannot be set after the request has been sent.');}if(!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)){warning(false,'The provided value \''+responseType+'\' is not a valid \'responseType\'.');return;}invariant(SUPPORTED_RESPONSE_TYPES[responseType]||responseType==='document','The provided value \''+responseType+'\' is unsupported in this environment.');this._responseType=responseType;}},{key:'responseText',get:function get(){if(this._responseType!==''&&this._responseType!=='text'){throw new Error("The 'responseText' property is only available if 'responseType' "+('is set to \'\' or \'text\', but it is \''+this._responseType+'\'.'));}if(this.readyState1&&arguments[1]!==undefined?arguments[1]:{};var _error$message=error.message,message=_error$message===undefined?null:_error$message,_error$stack=error.stack,stack=_error$stack===undefined?null:_error$stack;var warning='Possible Unhandled Promise Rejection (id: '+id+'):\n'+(message==null?'':message+'\n')+(stack==null?'':stack);console.warn(warning);},onHandled:function onHandled(id){var warning='Promise Rejection Handled (id: '+id+')\n'+'This means you can ignore any previous messages of the form '+('"Possible Unhandled Promise Rejection (id: '+id+'):"');console.warn(warning);}});}module.exports=Promise;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i';invariant(false,componentName+' "viewConfig" is not defined.');}if(false){warnForStyleProps(nativeProps,this.viewConfig.validAttributes);}var updatePayload=ReactNativeAttributePayload.create(nativeProps,this.viewConfig.validAttributes);UIManager.updateView(findNodeHandle(this),this.viewConfig.uiViewClassName,updatePayload);},focus:function focus(){TextInputState.focusTextInput(findNodeHandle(this));},blur:function blur(){TextInputState.blurTextInput(findNodeHandle(this));}};function throwOnStylesProp(component,props){if(props.styles!==undefined){var owner=component._owner||null;var name=component.constructor.displayName;var msg='`styles` is not a supported property of `'+name+'`, did '+'you mean `style` (singular)?';if(owner&&owner.constructor&&owner.constructor.displayName){msg+='\n\nCheck the `'+owner.constructor.displayName+'` parent '+' component.';}throw new Error(msg);}}if(false){var NativeMethodsMixin_DEV=NativeMethodsMixin;invariant(!NativeMethodsMixin_DEV.componentWillMount&&!NativeMethodsMixin_DEV.componentWillReceiveProps,'Do not override existing functions.');NativeMethodsMixin_DEV.componentWillMount=function(){throwOnStylesProp(this,this.props);};NativeMethodsMixin_DEV.componentWillReceiveProps=function(newProps){throwOnStylesProp(this,newProps);};}function mountSafeCallback(context,callback){return function(){if(!callback||context.isMounted&&!context.isMounted()){return undefined;}return callback.apply(context,arguments);};}module.exports=NativeMethodsMixin;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactNativeComponentTree=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeComponentTree.js");var ReactNativeDefaultInjection=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeDefaultInjection.js");var ReactNativeMount=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeMount.js");var ReactUpdates=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactUpdates.js");var findNodeHandle=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/findNodeHandle.js");ReactNativeDefaultInjection.inject();var render=function render(element,mountInto,callback){return ReactNativeMount.renderComponent(element,mountInto,callback);};var ReactNative={hasReactNativeInitialized:false,findNodeHandle:findNodeHandle,render:render,unmountComponentAtNode:ReactNativeMount.unmountComponentAtNode,unstable_batchedUpdates:ReactUpdates.batchedUpdates,unmountComponentAtNodeAndRemoveContainer:ReactNativeMount.unmountComponentAtNodeAndRemoveContainer};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=='undefined'&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject==='function'){__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:function getClosestInstanceFromNode(node){return ReactNativeComponentTree.getClosestInstanceFromNode(node);},getNodeFromInstance:function getNodeFromInstance(inst){while(inst._renderedComponent){inst=inst._renderedComponent;}if(inst){return ReactNativeComponentTree.getNodeFromInstance(inst);}else{return null;}}},Mount:ReactNativeMount,Reconciler:__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js")});}module.exports=ReactNative;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeAttributePayload.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactNativePropRegistry=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry.js");var deepDiffer=__webpack_require__("./node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js");var flattenStyle=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/flattenStyle.js");var emptyObject={};var removedKeys=null;var removedKeyCount=0;function defaultDiffer(prevProp,nextProp){if(typeof nextProp!=='object'||nextProp===null){return true;}else{return deepDiffer(prevProp,nextProp);}}function resolveObject(idOrObject){if(typeof idOrObject==='number'){return ReactNativePropRegistry.getByID(idOrObject);}return idOrObject;}function restoreDeletedValuesInNestedArray(updatePayload,node,validAttributes){if(Array.isArray(node)){var i=node.length;while(i--&&removedKeyCount>0){restoreDeletedValuesInNestedArray(updatePayload,node[i],validAttributes);}}else if(node&&removedKeyCount>0){var obj=resolveObject(node);for(var propKey in removedKeys){if(!removedKeys[propKey]){continue;}var nextProp=obj[propKey];if(nextProp===undefined){continue;}var attributeConfig=validAttributes[propKey];if(!attributeConfig){continue;}if(typeof nextProp==='function'){nextProp=true;}if(typeof nextProp==='undefined'){nextProp=null;}if(typeof attributeConfig!=='object'){updatePayload[propKey]=nextProp;}else if(typeof attributeConfig.diff==='function'||typeof attributeConfig.process==='function'){var nextValue=typeof attributeConfig.process==='function'?attributeConfig.process(nextProp):nextProp;updatePayload[propKey]=nextValue;}removedKeys[propKey]=false;removedKeyCount--;}}}function diffNestedArrayProperty(updatePayload,prevArray,nextArray,validAttributes){var minLength=prevArray.length0&&updatePayload){restoreDeletedValuesInNestedArray(updatePayload,nextProp,attributeConfig);removedKeys=null;}}}for(propKey in prevProps){if(nextProps[propKey]!==undefined){continue;}attributeConfig=validAttributes[propKey];if(!attributeConfig){continue;}if(updatePayload&&updatePayload[propKey]!==undefined){continue;}prevProp=prevProps[propKey];if(prevProp===undefined){continue;}if(typeof attributeConfig!=='object'||typeof attributeConfig.diff==='function'||typeof attributeConfig.process==='function'){(updatePayload||(updatePayload={}))[propKey]=null;if(!removedKeys){removedKeys={};}if(!removedKeys[propKey]){removedKeys[propKey]=true;removedKeyCount++;}}else{updatePayload=clearNestedProperty(updatePayload,prevProp,attributeConfig);}}return updatePayload;}function addProperties(updatePayload,props,validAttributes){return diffProperties(updatePayload,emptyObject,props,validAttributes);}function clearProperties(updatePayload,prevProps,validAttributes){return diffProperties(updatePayload,prevProps,emptyObject,validAttributes);}var ReactNativeAttributePayload={create:function create(props,validAttributes){return addProperties(null,props,validAttributes);},diff:function diff(prevProps,nextProps,validAttributes){return diffProperties(null,prevProps,nextProps,validAttributes);}};module.exports=ReactNativeAttributePayload;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i component.',this._stringText);this._hostParent=hostParent;var tag=ReactNativeTagHandles.allocateTag();this._rootNodeID=tag;var nativeTopRootTag=hostContainerInfo._tag;UIManager.createView(tag,'RCTRawText',nativeTopRootTag,{text:this._stringText});ReactNativeComponentTree.precacheNode(this,tag);return tag;},getHostNode:function getHostNode(){return this._rootNodeID;},receiveComponent:function receiveComponent(nextText,transaction,context){if(nextText!==this._currentElement){this._currentElement=nextText;var nextStringText=''+nextText;if(nextStringText!==this._stringText){this._stringText=nextStringText;UIManager.updateView(this._rootNodeID,'RCTRawText',{text:this._stringText});}}},unmountComponent:function unmountComponent(){ReactNativeComponentTree.uncacheNode(this);this._currentElement=null;this._stringText=null;this._rootNodeID=0;}});module.exports=ReactNativeTextComponent;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeTreeTraversal.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function getLowestCommonAncestor(instA,instB){var depthA=0;for(var tempA=instA;tempA;tempA=tempA._hostParent){depthA++;}var depthB=0;for(var tempB=instB;tempB;tempB=tempB._hostParent){depthB++;}while(depthA-depthB>0){instA=instA._hostParent;depthA--;}while(depthB-depthA>0){instB=instB._hostParent;depthB--;}var depth=depthA;while(depth--){if(instA===instB){return instA;}instA=instA._hostParent;instB=instB._hostParent;}return null;}function isAncestor(instA,instB){while(instB){if(instB===instA){return true;}instB=instB._hostParent;}return false;}function getParentInstance(inst){return inst._hostParent;}function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._hostParent;}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i0;){fn(pathTo[i],'captured',argTo);}}module.exports={isAncestor:isAncestor,getLowestCommonAncestor:getLowestCommonAncestor,getParentInstance:getParentInstance,traverseTwoPhase:traverseTwoPhase,traverseEnterLeave:traverseEnterLeave};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactNativeBaseComponent=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js");var createReactNativeComponentClass=function createReactNativeComponentClass(viewConfig){var Constructor=function Constructor(element){this._currentElement=element;this._topLevelWrapper=null;this._hostParent=null;this._hostContainerInfo=null;this._rootNodeID=0;this._renderedChildren=null;};Constructor.displayName=viewConfig.uiViewClassName;Constructor.viewConfig=viewConfig;Constructor.propTypes=viewConfig.propTypes;Constructor.prototype=new ReactNativeBaseComponent(viewConfig);Constructor.prototype.constructor=Constructor;return Constructor;};module.exports=createReactNativeComponentClass;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/native/findNodeHandle.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactCurrentOwner=__webpack_require__("./node_modules/react/lib/ReactCurrentOwner.js");var ReactInstanceMap=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/shared/ReactInstanceMap.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");function findNodeHandle(componentOrHandle){if(false){var owner=ReactCurrentOwner.current;if(owner!==null){warning(owner._warnedAboutRefsInRender,'%s is accessing findNodeHandle inside its render(). '+'render() should be a pure function of props and state. It should '+'never access something that requires stale data from the previous '+'render, such as refs. Move this logic to componentDidMount and '+'componentDidUpdate instead.',owner.getName()||'A component');owner._warnedAboutRefsInRender=true;}}if(componentOrHandle==null){return null;}if(typeof componentOrHandle==='number'){return componentOrHandle;}var component=componentOrHandle;var internalInstance=ReactInstanceMap.get(component);if(internalInstance){return internalInstance.getHostNode();}else{var rootNodeID=component._rootNodeID;if(rootNodeID){return rootNodeID;}else{invariant(typeof component==='object'&&'_rootNodeID'in component||component.render!=null&&typeof component.render==='function','findNodeHandle(...): Argument is not a component '+'(type: %s, keys: %s)',typeof component,Object.keys(component));invariant(false,'findNodeHandle(...): Unable to find node handle for unmounted '+'component.');}}}module.exports=findNodeHandle;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/ReactInstrumentation.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var debugTool=null;if(false){var ReactDebugTool=require('ReactDebugTool');debugTool=ReactDebugTool;}module.exports={debugTool:debugTool};
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/shared/ReactInstanceMap.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactInstanceMap={remove:function remove(key){key._reactInternalInstance=undefined;},get:function get(key){return key._reactInternalInstance;},has:function has(key){return key._reactInternalInstance!==undefined;},set:function set(key,value){key._reactInternalInstance=value;}};module.exports=ReactInstanceMap;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/shared/shouldUpdateReactComponent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function shouldUpdateReactComponent(prevElement,nextElement){var prevEmpty=prevElement===null||prevElement===false;var nextEmpty=nextElement===null||nextElement===false;if(prevEmpty||nextEmpty){return prevEmpty===nextEmpty;}var prevType=typeof prevElement;var nextType=typeof nextElement;if(prevType==='string'||prevType==='number'){return nextType==='string'||nextType==='number';}else{return nextType==='object'&&prevElement.type===nextElement.type&&prevElement.key===nextElement.key;}}module.exports=shouldUpdateReactComponent;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/EventPluginHub.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var EventPluginRegistry=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/EventPluginRegistry.js");var EventPluginUtils=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/EventPluginUtils.js");var ReactErrorUtils=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/utils/ReactErrorUtils.js");var accumulateInto=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/utils/accumulateInto.js");var forEachAccumulated=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/utils/forEachAccumulated.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var listenerBank={};var eventQueue=null;var executeDispatchesAndRelease=function executeDispatchesAndRelease(event,simulated){if(event){EventPluginUtils.executeDispatchesInOrder(event,simulated);if(!event.isPersistent()){event.constructor.release(event);}}};var executeDispatchesAndReleaseSimulated=function executeDispatchesAndReleaseSimulated(e){return executeDispatchesAndRelease(e,true);};var executeDispatchesAndReleaseTopLevel=function executeDispatchesAndReleaseTopLevel(e){return executeDispatchesAndRelease(e,false);};var getDictionaryKey=function getDictionaryKey(inst){return'.'+inst._rootNodeID;};var EventPluginHub={injection:{injectEventPluginOrder:EventPluginRegistry.injectEventPluginOrder,injectEventPluginsByName:EventPluginRegistry.injectEventPluginsByName},putListener:function putListener(inst,registrationName,listener){invariant(typeof listener==='function','Expected %s listener to be a function, instead got type %s',registrationName,typeof listener);var key=getDictionaryKey(inst);var bankForRegistrationName=listenerBank[registrationName]||(listenerBank[registrationName]={});bankForRegistrationName[key]=listener;var PluginModule=EventPluginRegistry.registrationNameModules[registrationName];if(PluginModule&&PluginModule.didPutListener){PluginModule.didPutListener(inst,registrationName,listener);}},getListener:function getListener(inst,registrationName){var bankForRegistrationName=listenerBank[registrationName];var key=getDictionaryKey(inst);return bankForRegistrationName&&bankForRegistrationName[key];},deleteListener:function deleteListener(inst,registrationName){var PluginModule=EventPluginRegistry.registrationNameModules[registrationName];if(PluginModule&&PluginModule.willDeleteListener){PluginModule.willDeleteListener(inst,registrationName);}var bankForRegistrationName=listenerBank[registrationName];if(bankForRegistrationName){var key=getDictionaryKey(inst);delete bankForRegistrationName[key];}},deleteAllListeners:function deleteAllListeners(inst){var key=getDictionaryKey(inst);for(var registrationName in listenerBank){if(!listenerBank.hasOwnProperty(registrationName)){continue;}if(!listenerBank[registrationName][key]){continue;}var PluginModule=EventPluginRegistry.registrationNameModules[registrationName];if(PluginModule&&PluginModule.willDeleteListener){PluginModule.willDeleteListener(inst,registrationName);}delete listenerBank[registrationName][key];}},extractEvents:function extractEvents(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events;var plugins=EventPluginRegistry.plugins;for(var i=0;i-1,'EventPluginRegistry: Cannot inject event plugins that do not exist in '+'the plugin ordering, `%s`.',pluginName);if(EventPluginRegistry.plugins[pluginIndex]){continue;}invariant(pluginModule.extractEvents,'EventPluginRegistry: Event plugins must implement an `extractEvents` '+'method, but `%s` does not.',pluginName);EventPluginRegistry.plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){invariant(publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName),'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName);}}}function publishEventForPlugin(dispatchConfig,pluginModule,eventName){invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName),'EventPluginHub: More than one plugin attempted to publish the same '+'event name, `%s`.',eventName);EventPluginRegistry.eventNameDispatchConfigs[eventName]=dispatchConfig;var phasedRegistrationNames=dispatchConfig.phasedRegistrationNames;if(phasedRegistrationNames){for(var phaseName in phasedRegistrationNames){if(phasedRegistrationNames.hasOwnProperty(phaseName)){var phasedRegistrationName=phasedRegistrationNames[phaseName];publishRegistrationName(phasedRegistrationName,pluginModule,eventName);}}return true;}else if(dispatchConfig.registrationName){publishRegistrationName(dispatchConfig.registrationName,pluginModule,eventName);return true;}return false;}function publishRegistrationName(registrationName,pluginModule,eventName){invariant(!EventPluginRegistry.registrationNameModules[registrationName],'EventPluginHub: More than one plugin attempted to publish the same '+'registration name, `%s`.',registrationName);EventPluginRegistry.registrationNameModules[registrationName]=pluginModule;EventPluginRegistry.registrationNameDependencies[registrationName]=pluginModule.eventTypes[eventName].dependencies;if(false){var lowerCasedName=registrationName.toLowerCase();EventPluginRegistry.possibleRegistrationNames[lowerCasedName]=registrationName;if(registrationName==='onDoubleClick'){EventPluginRegistry.possibleRegistrationNames.ondblclick=registrationName;}}}var EventPluginRegistry={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames: false?{}:null,injectEventPluginOrder:function injectEventPluginOrder(injectedEventPluginOrder){invariant(!eventPluginOrder,'EventPluginRegistry: Cannot inject event plugin ordering more than '+'once. You are likely trying to load more than one copy of React.');eventPluginOrder=Array.prototype.slice.call(injectedEventPluginOrder);recomputePluginOrdering();},injectEventPluginsByName:function injectEventPluginsByName(injectedNamesToPlugins){var isOrderingDirty=false;for(var pluginName in injectedNamesToPlugins){if(!injectedNamesToPlugins.hasOwnProperty(pluginName)){continue;}var pluginModule=injectedNamesToPlugins[pluginName];if(!namesToPlugins.hasOwnProperty(pluginName)||namesToPlugins[pluginName]!==pluginModule){invariant(!namesToPlugins[pluginName],'EventPluginRegistry: Cannot inject two different event plugins '+'using the same name, `%s`.',pluginName);namesToPlugins[pluginName]=pluginModule;isOrderingDirty=true;}}if(isOrderingDirty){recomputePluginOrdering();}},getPluginModuleForEvent:function getPluginModuleForEvent(event){var dispatchConfig=event.dispatchConfig;if(dispatchConfig.registrationName){return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName]||null;}if(dispatchConfig.phasedRegistrationNames!==undefined){var phasedRegistrationNames=dispatchConfig.phasedRegistrationNames;for(var phase in phasedRegistrationNames){if(!phasedRegistrationNames.hasOwnProperty(phase)){continue;}var pluginModule=EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];if(pluginModule){return pluginModule;}}}return null;},_resetEventPlugins:function _resetEventPlugins(){eventPluginOrder=null;for(var pluginName in namesToPlugins){if(namesToPlugins.hasOwnProperty(pluginName)){delete namesToPlugins[pluginName];}}EventPluginRegistry.plugins.length=0;var eventNameDispatchConfigs=EventPluginRegistry.eventNameDispatchConfigs;for(var eventName in eventNameDispatchConfigs){if(eventNameDispatchConfigs.hasOwnProperty(eventName)){delete eventNameDispatchConfigs[eventName];}}var registrationNameModules=EventPluginRegistry.registrationNameModules;for(var registrationName in registrationNameModules){if(registrationNameModules.hasOwnProperty(registrationName)){delete registrationNameModules[registrationName];}}if(false){var possibleRegistrationNames=EventPluginRegistry.possibleRegistrationNames;for(var lowerCasedName in possibleRegistrationNames){if(possibleRegistrationNames.hasOwnProperty(lowerCasedName)){delete possibleRegistrationNames[lowerCasedName];}}}}};module.exports=EventPluginRegistry;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/EventPluginUtils.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactErrorUtils=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/utils/ReactErrorUtils.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var ComponentTree;var TreeTraversal;var injection={injectComponentTree:function injectComponentTree(Injected){ComponentTree=Injected;if(false){warning(Injected&&Injected.getNodeFromInstance&&Injected.getInstanceFromNode,'EventPluginUtils.injection.injectComponentTree(...): Injected '+'module is missing getNodeFromInstance or getInstanceFromNode.');}},injectTreeTraversal:function injectTreeTraversal(Injected){TreeTraversal=Injected;if(false){warning(Injected&&Injected.isAncestor&&Injected.getLowestCommonAncestor,'EventPluginUtils.injection.injectTreeTraversal(...): Injected '+'module is missing isAncestor or getLowestCommonAncestor.');}}};function isEndish(topLevelType){return topLevelType==='topMouseUp'||topLevelType==='topTouchEnd'||topLevelType==='topTouchCancel';}function isMoveish(topLevelType){return topLevelType==='topMouseMove'||topLevelType==='topTouchMove';}function isStartish(topLevelType){return topLevelType==='topMouseDown'||topLevelType==='topTouchStart';}var validateEventDispatches;if(false){validateEventDispatches=function validateEventDispatches(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;var listenersIsArr=Array.isArray(dispatchListeners);var listenersLen=listenersIsArr?dispatchListeners.length:dispatchListeners?1:0;var instancesIsArr=Array.isArray(dispatchInstances);var instancesLen=instancesIsArr?dispatchInstances.length:dispatchInstances?1:0;warning(instancesIsArr===listenersIsArr&&instancesLen===listenersLen,'EventPluginUtils: Invalid `event`.');};}function executeDispatch(event,simulated,listener,inst){var type=event.type||'unknown-event';event.currentTarget=EventPluginUtils.getNodeFromInstance(inst);if(simulated){ReactErrorUtils.invokeGuardedCallbackWithCatch(type,listener,event);}else{ReactErrorUtils.invokeGuardedCallback(type,listener,event);}event.currentTarget=null;}function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;if(false){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i0&&topLevelType==='topSelectionChange'||isStartish(topLevelType)||isMoveish(topLevelType));}function noResponderTouches(nativeEvent){var touches=nativeEvent.touches;if(!touches||touches.length===0){return true;}for(var i=0;i=0){trackedTouchCount-=1;}else{console.error('Ended a touch event which was not counted in `trackedTouchCount`.');return null;}}ResponderTouchHistoryStore.recordTouchTrack(topLevelType,nativeEvent);var extracted=canTriggerTransfer(topLevelType,targetInst,nativeEvent)?setResponderAndExtractTransfer(topLevelType,targetInst,nativeEvent,nativeEventTarget):null;var isResponderTouchStart=responderInst&&isStartish(topLevelType);var isResponderTouchMove=responderInst&&isMoveish(topLevelType);var isResponderTouchEnd=responderInst&&isEndish(topLevelType);var incrementalTouch=isResponderTouchStart?eventTypes.responderStart:isResponderTouchMove?eventTypes.responderMove:isResponderTouchEnd?eventTypes.responderEnd:null;if(incrementalTouch){var gesture=ResponderSyntheticEvent.getPooled(incrementalTouch,responderInst,nativeEvent,nativeEventTarget);gesture.touchHistory=ResponderTouchHistoryStore.touchHistory;EventPropagators.accumulateDirectDispatches(gesture);extracted=accumulate(extracted,gesture);}var isResponderTerminate=responderInst&&topLevelType==='topTouchCancel';var isResponderRelease=responderInst&&!isResponderTerminate&&isEndish(topLevelType)&&noResponderTouches(nativeEvent);var finalTouch=isResponderTerminate?eventTypes.responderTerminate:isResponderRelease?eventTypes.responderRelease:null;if(finalTouch){var finalEvent=ResponderSyntheticEvent.getPooled(finalTouch,responderInst,nativeEvent,nativeEventTarget);finalEvent.touchHistory=ResponderTouchHistoryStore.touchHistory;EventPropagators.accumulateDirectDispatches(finalEvent);extracted=accumulate(extracted,finalEvent);changeResponder(null);}var numberActiveTouches=ResponderTouchHistoryStore.touchHistory.numberActiveTouches;if(ResponderEventPlugin.GlobalInteractionHandler&&numberActiveTouches!==previousActiveTouches){ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches);}previousActiveTouches=numberActiveTouches;return extracted;},GlobalResponderHandler:null,GlobalInteractionHandler:null,injection:{injectGlobalResponderHandler:function injectGlobalResponderHandler(GlobalResponderHandler){ResponderEventPlugin.GlobalResponderHandler=GlobalResponderHandler;},injectGlobalInteractionHandler:function injectGlobalInteractionHandler(GlobalInteractionHandler){ResponderEventPlugin.GlobalInteractionHandler=GlobalInteractionHandler;}}};module.exports=ResponderEventPlugin;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/eventPlugins/ResponderSyntheticEvent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var SyntheticEvent=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/SyntheticEvent.js");var ResponderEventInterface={touchHistory:function touchHistory(nativeEvent){return null;}};function ResponderSyntheticEvent(dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget){return SyntheticEvent.call(this,dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget);}SyntheticEvent.augmentClass(ResponderSyntheticEvent,ResponderEventInterface);module.exports=ResponderSyntheticEvent;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/eventPlugins/ResponderTouchHistoryStore.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var EventPluginUtils=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/EventPluginUtils.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var isEndish=EventPluginUtils.isEndish,isMoveish=EventPluginUtils.isMoveish,isStartish=EventPluginUtils.isStartish;var MAX_TOUCH_BANK=20;var touchBank=[];var touchHistory={touchBank:touchBank,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0};function timestampForTouch(touch){return touch.timeStamp||touch.timestamp;}function createTouchRecord(touch){return{touchActive:true,startPageX:touch.pageX,startPageY:touch.pageY,startTimeStamp:timestampForTouch(touch),currentPageX:touch.pageX,currentPageY:touch.pageY,currentTimeStamp:timestampForTouch(touch),previousPageX:touch.pageX,previousPageY:touch.pageY,previousTimeStamp:timestampForTouch(touch)};}function resetTouchRecord(touchRecord,touch){touchRecord.touchActive=true;touchRecord.startPageX=touch.pageX;touchRecord.startPageY=touch.pageY;touchRecord.startTimeStamp=timestampForTouch(touch);touchRecord.currentPageX=touch.pageX;touchRecord.currentPageY=touch.pageY;touchRecord.currentTimeStamp=timestampForTouch(touch);touchRecord.previousPageX=touch.pageX;touchRecord.previousPageY=touch.pageY;touchRecord.previousTimeStamp=timestampForTouch(touch);}function getTouchIdentifier(_ref){var identifier=_ref.identifier;invariant(identifier!=null,'Touch object is missing identifier.');warning(identifier<=MAX_TOUCH_BANK,'Touch identifier %s is greater than maximum supported %s which causes '+'performance issues backfilling array locations for all of the indices.',identifier,MAX_TOUCH_BANK);return identifier;}function recordTouchStart(touch){var identifier=getTouchIdentifier(touch);var touchRecord=touchBank[identifier];if(touchRecord){resetTouchRecord(touchRecord,touch);}else{touchBank[identifier]=createTouchRecord(touch);}touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}function recordTouchMove(touch){var touchRecord=touchBank[getTouchIdentifier(touch)];if(touchRecord){touchRecord.touchActive=true;touchRecord.previousPageX=touchRecord.currentPageX;touchRecord.previousPageY=touchRecord.currentPageY;touchRecord.previousTimeStamp=touchRecord.currentTimeStamp;touchRecord.currentPageX=touch.pageX;touchRecord.currentPageY=touch.pageY;touchRecord.currentTimeStamp=timestampForTouch(touch);touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}else{console.error('Cannot record touch move without a touch start.\n'+'Touch Move: %s\n','Touch Bank: %s',printTouch(touch),printTouchBank());}}function recordTouchEnd(touch){var touchRecord=touchBank[getTouchIdentifier(touch)];if(touchRecord){touchRecord.touchActive=false;touchRecord.previousPageX=touchRecord.currentPageX;touchRecord.previousPageY=touchRecord.currentPageY;touchRecord.previousTimeStamp=touchRecord.currentTimeStamp;touchRecord.currentPageX=touch.pageX;touchRecord.currentPageY=touch.pageY;touchRecord.currentTimeStamp=timestampForTouch(touch);touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}else{console.error('Cannot record touch end without a touch start.\n'+'Touch End: %s\n','Touch Bank: %s',printTouch(touch),printTouchBank());}}function printTouch(touch){return JSON.stringify({identifier:touch.identifier,pageX:touch.pageX,pageY:touch.pageY,timestamp:timestampForTouch(touch)});}function printTouchBank(){var printed=JSON.stringify(touchBank.slice(0,MAX_TOUCH_BANK));if(touchBank.length>MAX_TOUCH_BANK){printed+=' (original size: '+touchBank.length+')';}return printed;}var ResponderTouchHistoryStore={recordTouchTrack:function recordTouchTrack(topLevelType,nativeEvent){if(isMoveish(topLevelType)){nativeEvent.changedTouches.forEach(recordTouchMove);}else if(isStartish(topLevelType)){nativeEvent.changedTouches.forEach(recordTouchStart);touchHistory.numberActiveTouches=nativeEvent.touches.length;if(touchHistory.numberActiveTouches===1){touchHistory.indexOfSingleActiveTouch=nativeEvent.touches[0].identifier;}}else if(isEndish(topLevelType)){nativeEvent.changedTouches.forEach(recordTouchEnd);touchHistory.numberActiveTouches=nativeEvent.touches.length;if(touchHistory.numberActiveTouches===1){for(var i=0;itouchesChangedAfter){total+=ofCurrent&&isXAxis?oneTouchData.currentPageX:ofCurrent&&!isXAxis?oneTouchData.currentPageY:!ofCurrent&&isXAxis?oneTouchData.previousPageX:oneTouchData.previousPageY;count=1;}}else{for(var i=0;i=touchesChangedAfter){var toAdd;if(ofCurrent&&isXAxis){toAdd=touchTrack.currentPageX;}else if(ofCurrent&&!isXAxis){toAdd=touchTrack.currentPageY;}else if(!ofCurrent&&isXAxis){toAdd=touchTrack.previousPageX;}else{toAdd=touchTrack.previousPageY;}total+=toAdd;count++;}}}return count>0?total/count:TouchHistoryMath.noCentroid;},currentCentroidXOfTouchesChangedAfter:function currentCentroidXOfTouchesChangedAfter(touchHistory,touchesChangedAfter){return TouchHistoryMath.centroidDimension(touchHistory,touchesChangedAfter,true,true);},currentCentroidYOfTouchesChangedAfter:function currentCentroidYOfTouchesChangedAfter(touchHistory,touchesChangedAfter){return TouchHistoryMath.centroidDimension(touchHistory,touchesChangedAfter,false,true);},previousCentroidXOfTouchesChangedAfter:function previousCentroidXOfTouchesChangedAfter(touchHistory,touchesChangedAfter){return TouchHistoryMath.centroidDimension(touchHistory,touchesChangedAfter,true,false);},previousCentroidYOfTouchesChangedAfter:function previousCentroidYOfTouchesChangedAfter(touchHistory,touchesChangedAfter){return TouchHistoryMath.centroidDimension(touchHistory,touchesChangedAfter,false,false);},currentCentroidX:function currentCentroidX(touchHistory){return TouchHistoryMath.centroidDimension(touchHistory,0,true,true);},currentCentroidY:function currentCentroidY(touchHistory){return TouchHistoryMath.centroidDimension(touchHistory,0,false,true);},noCentroid:-1};module.exports=TouchHistoryMath;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactChildReconciler.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {var ReactReconciler=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js");var instantiateReactComponent=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/instantiateReactComponent.js");var KeyEscapeUtils=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/shared/utils/KeyEscapeUtils.js");var shouldUpdateReactComponent=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/shared/shared/shouldUpdateReactComponent.js");var traverseAllChildren=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/shared/utils/traverseAllChildren.js");var warning=__webpack_require__("./node_modules/fbjs/lib/warning.js");var ReactComponentTreeHook;if(typeof process!=='undefined'&&__webpack_require__.i({"NODE_ENV":"production"})&&"production"==='test'){ReactComponentTreeHook=__webpack_require__("./node_modules/react/lib/ReactComponentTreeHook.js");}function instantiateChild(childInstances,child,name,selfDebugID){var keyUnique=childInstances[name]===undefined;if(false){if(!ReactComponentTreeHook){ReactComponentTreeHook=require('react/lib/ReactComponentTreeHook');}if(!keyUnique){warning(false,'flattenChildren(...): Encountered two children with the same key, '+'`%s`. Child keys must be unique; when two children share a key, only '+'the first child will be used.%s',KeyEscapeUtils.unescape(name),ReactComponentTreeHook.getStackAddendumByID(selfDebugID));}}if(child!=null&&keyUnique){childInstances[name]=instantiateReactComponent(child,true);}}var ReactChildReconciler={instantiateChildren:function instantiateChildren(nestedChildNodes,transaction,context,selfDebugID){if(nestedChildNodes==null){return null;}var childInstances={};if(false){traverseAllChildren(nestedChildNodes,function(childInsts,child,name){return instantiateChild(childInsts,child,name,selfDebugID);},childInstances);}else{traverseAllChildren(nestedChildNodes,instantiateChild,childInstances);}return childInstances;},updateChildren:function updateChildren(prevChildren,nextChildren,mountImages,removedNodes,transaction,hostParent,hostContainerInfo,context,selfDebugID){if(!nextChildren&&!prevChildren){return;}var name;var prevChild;for(name in nextChildren){if(!nextChildren.hasOwnProperty(name)){continue;}prevChild=prevChildren&&prevChildren[name];var prevElement=prevChild&&prevChild._currentElement;var nextElement=nextChildren[name];if(prevChild!=null&&shouldUpdateReactComponent(prevElement,nextElement)){ReactReconciler.receiveComponent(prevChild,nextElement,transaction,context);nextChildren[name]=prevChild;}else{if(prevChild){removedNodes[name]=ReactReconciler.getHostNode(prevChild);ReactReconciler.unmountComponent(prevChild,false);}var nextChildInstance=instantiateReactComponent(nextElement,true);nextChildren[name]=nextChildInstance;var nextChildMountImage=ReactReconciler.mountComponent(nextChildInstance,transaction,hostParent,hostContainerInfo,context,selfDebugID);mountImages.push(nextChildMountImage);}}for(name in prevChildren){if(prevChildren.hasOwnProperty(name)&&!(nextChildren&&nextChildren.hasOwnProperty(name))){prevChild=prevChildren[name];removedNodes[name]=ReactReconciler.getHostNode(prevChild);ReactReconciler.unmountComponent(prevChild,false);}}},unmountChildren:function unmountChildren(renderedChildren,safely){for(var name in renderedChildren){if(renderedChildren.hasOwnProperty(name)){var renderedChild=renderedChildren[name];ReactReconciler.unmountComponent(renderedChild,safely);}}}};module.exports=ReactChildReconciler;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/process/browser.js")))
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactComponentEnvironment.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var injected=false;var ReactComponentEnvironment={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function injectEnvironment(environment){invariant(!injected,'ReactCompositeComponent: injectEnvironment() can only be called once.');ReactComponentEnvironment.replaceNodeWithMarkup=environment.replaceNodeWithMarkup;ReactComponentEnvironment.processChildrenUpdates=environment.processChildrenUpdates;injected=true;}}};module.exports=ReactComponentEnvironment;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i0&&keys.length<20){return displayName+' (keys: '+keys.join(', ')+')';}return displayName;}function getInternalInstanceReadyForUpdate(publicInstance,callerName){var internalInstance=ReactInstanceMap.get(publicInstance);if(!internalInstance){if(false){var ctor=publicInstance.constructor;warning(!callerName,'%s(...): Can only update a mounted or mounting component. '+'This usually means you called %s() on an unmounted component. '+'This is a no-op. Please check the code for the %s component.',callerName,callerName,ctor&&(ctor.displayName||ctor.name)||'ReactClass');}return null;}if(false){warning(ReactCurrentOwner.current==null,'%s(...): Cannot update during an existing state transition (such as '+'within `render` or another component\'s constructor). Render methods '+'should be a pure function of props and state; constructor '+'side-effects are an anti-pattern, but can be moved to '+'`componentWillMount`.',callerName);}return internalInstance;}var ReactUpdateQueue={isMounted:function isMounted(publicInstance){if(false){var owner=ReactCurrentOwner.current;if(owner!==null){warning(owner._warnedAboutRefsInRender,'%s is accessing isMounted inside its render() function. '+'render() should be a pure function of props and state. It should '+'never access something that requires stale data from the previous '+'render, such as refs. Move this logic to componentDidMount and '+'componentDidUpdate instead.',owner.getName()||'A component');owner._warnedAboutRefsInRender=true;}}var internalInstance=ReactInstanceMap.get(publicInstance);if(internalInstance){return!!internalInstance._renderedComponent;}else{return false;}},enqueueCallback:function enqueueCallback(publicInstance,callback,callerName){ReactUpdateQueue.validateCallback(callback,callerName);var internalInstance=getInternalInstanceReadyForUpdate(publicInstance);if(!internalInstance){return null;}if(internalInstance._pendingCallbacks){internalInstance._pendingCallbacks.push(callback);}else{internalInstance._pendingCallbacks=[callback];}enqueueUpdate(internalInstance);},enqueueCallbackInternal:function enqueueCallbackInternal(internalInstance,callback){if(internalInstance._pendingCallbacks){internalInstance._pendingCallbacks.push(callback);}else{internalInstance._pendingCallbacks=[callback];}enqueueUpdate(internalInstance);},enqueueForceUpdate:function enqueueForceUpdate(publicInstance){var internalInstance=getInternalInstanceReadyForUpdate(publicInstance,'forceUpdate');if(!internalInstance){return;}internalInstance._pendingForceUpdate=true;enqueueUpdate(internalInstance);},enqueueReplaceState:function enqueueReplaceState(publicInstance,completeState){var internalInstance=getInternalInstanceReadyForUpdate(publicInstance,'replaceState');if(!internalInstance){return;}internalInstance._pendingStateQueue=[completeState];internalInstance._pendingReplaceState=true;enqueueUpdate(internalInstance);},enqueueSetState:function enqueueSetState(publicInstance,partialState){if(false){ReactInstrumentation.debugTool.onSetState();warning(partialState!=null,'setState(...): You passed an undefined or null state object; '+'instead, use forceUpdate().');}var internalInstance=getInternalInstanceReadyForUpdate(publicInstance,'setState');if(!internalInstance){return;}var queue=internalInstance._pendingStateQueue||(internalInstance._pendingStateQueue=[]);queue.push(partialState);enqueueUpdate(internalInstance);},enqueueElementInternal:function enqueueElementInternal(internalInstance,nextElement,nextContext){internalInstance._pendingElement=nextElement;internalInstance._context=nextContext;enqueueUpdate(internalInstance);},validateCallback:function validateCallback(callback,callerName){invariant(!callback||typeof callback==='function','%s(...): Expected the last optional `callback` argument to be a '+'function. Instead received: %s.',callerName,formatUnexpectedArgument(callback));}};module.exports=ReactUpdateQueue;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactUpdates.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _extends=Object.assign||function(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};invariant(typeof content==='object'&&content!==null,'Content to share must be a valid object');invariant(typeof content.url==='string'||typeof content.message==='string','At least one of URL and message is required');invariant(typeof options==='object'&&options!==null,'Options must be a valid object');if(Platform.OS==='android'){invariant(!content.title||typeof content.title==='string','Invalid title: title should be a string.');return ShareModule.share(content,options.dialogTitle);}else if(Platform.OS==='ios'){return new Promise(function(resolve,reject){ActionSheetManager.showShareActionSheetWithOptions(_extends({},content,options,{tintColor:processColor(options.tintColor)}),function(error){return reject(error);},function(success,activityType){if(success){resolve({'action':'sharedAction','activityType':activityType});}else{resolve({'action':'dismissedAction'});}});});}else{return Promise.reject(new Error('Unsupported platform'));}}},{key:'sharedAction',get:function get(){return'sharedAction';}},{key:'dismissedAction',get:function get(){return'dismissedAction';}}]);return Share;}();module.exports=Share;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Storage/AsyncStorage.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(setImmediate) {var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[typeof Symbol==='function'?Symbol.iterator:'@@iterator'](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if((typeof Symbol==='function'?Symbol.iterator:'@@iterator')in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var NativeModules=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js");var RCTAsyncSQLiteStorage=NativeModules.AsyncSQLiteDBStorage;var RCTAsyncRocksDBStorage=NativeModules.AsyncRocksDBStorage;var RCTAsyncFileStorage=NativeModules.AsyncLocalStorage;var RCTAsyncStorage=RCTAsyncRocksDBStorage||RCTAsyncSQLiteStorage||RCTAsyncFileStorage;var AsyncStorage={_getRequests:[],_getKeys:[],_immediate:null,getItem:function getItem(key,callback){return new Promise(function(resolve,reject){RCTAsyncStorage.multiGet([key],function(errors,result){var value=result&&result[0]&&result[0][1]?result[0][1]:null;var errs=convertErrors(errors);callback&&callback(errs&&errs[0],value);if(errs){reject(errs[0]);}else{resolve(value);}});});},setItem:function setItem(key,value,callback){return new Promise(function(resolve,reject){RCTAsyncStorage.multiSet([[key,value]],function(errors){var errs=convertErrors(errors);callback&&callback(errs&&errs[0]);if(errs){reject(errs[0]);}else{resolve(null);}});});},removeItem:function removeItem(key,callback){return new Promise(function(resolve,reject){RCTAsyncStorage.multiRemove([key],function(errors){var errs=convertErrors(errors);callback&&callback(errs&&errs[0]);if(errs){reject(errs[0]);}else{resolve(null);}});});},mergeItem:function mergeItem(key,value,callback){return new Promise(function(resolve,reject){RCTAsyncStorage.multiMerge([[key,value]],function(errors){var errs=convertErrors(errors);callback&&callback(errs&&errs[0]);if(errs){reject(errs[0]);}else{resolve(null);}});});},clear:function clear(callback){return new Promise(function(resolve,reject){RCTAsyncStorage.clear(function(error){callback&&callback(convertError(error));if(error&&convertError(error)){reject(convertError(error));}else{resolve(null);}});});},getAllKeys:function getAllKeys(callback){return new Promise(function(resolve,reject){RCTAsyncStorage.getAllKeys(function(error,keys){callback&&callback(convertError(error),keys);if(error){reject(convertError(error));}else{resolve(keys);}});});},flushGetRequests:function flushGetRequests(){var getRequests=this._getRequests;var getKeys=this._getKeys;this._getRequests=[];this._getKeys=[];RCTAsyncStorage.multiGet(getKeys,function(errors,result){var map={};result&&result.forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];map[key]=value;return value;});var reqLength=getRequests.length;for(var i=0;i>')+': '+JSON.stringify(style,null,' ')+(message2||''));};var allStylePropTypes={};StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes);StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);module.exports=StyleSheetValidation;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/StyleSheet/TransformPropTypes.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var deprecatedPropType=__webpack_require__("./node_modules/react-native/Libraries/Utilities/deprecatedPropType.js");var ReactPropTypes=__webpack_require__("./node_modules/react-native/Libraries/react-native/React.js").PropTypes;var TransformMatrixPropType=function TransformMatrixPropType(props,propName,componentName){if(props[propName]){return new Error('The transformMatrix style property is deprecated. '+'Use `transform: [{ matrix: ... }]` instead.');}};var DecomposedMatrixPropType=function DecomposedMatrixPropType(props,propName,componentName){if(props[propName]){return new Error('The decomposedMatrix style property is deprecated. '+'Use `transform: [...]` instead.');}};var TransformPropTypes={transform:ReactPropTypes.arrayOf(ReactPropTypes.oneOfType([ReactPropTypes.shape({perspective:ReactPropTypes.number}),ReactPropTypes.shape({rotate:ReactPropTypes.string}),ReactPropTypes.shape({rotateX:ReactPropTypes.string}),ReactPropTypes.shape({rotateY:ReactPropTypes.string}),ReactPropTypes.shape({rotateZ:ReactPropTypes.string}),ReactPropTypes.shape({scale:ReactPropTypes.number}),ReactPropTypes.shape({scaleX:ReactPropTypes.number}),ReactPropTypes.shape({scaleY:ReactPropTypes.number}),ReactPropTypes.shape({translateX:ReactPropTypes.number}),ReactPropTypes.shape({translateY:ReactPropTypes.number}),ReactPropTypes.shape({skewX:ReactPropTypes.string}),ReactPropTypes.shape({skewY:ReactPropTypes.string})])),transformMatrix:TransformMatrixPropType,decomposedMatrix:DecomposedMatrixPropType,scaleX:deprecatedPropType(ReactPropTypes.number,'Use the transform prop instead.'),scaleY:deprecatedPropType(ReactPropTypes.number,'Use the transform prop instead.'),rotation:deprecatedPropType(ReactPropTypes.number,'Use the transform prop instead.'),translateX:deprecatedPropType(ReactPropTypes.number,'Use the transform prop instead.'),translateY:deprecatedPropType(ReactPropTypes.number,'Use the transform prop instead.')};module.exports=TransformPropTypes;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/StyleSheet/flattenStyle.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactNativePropRegistry=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");function getStyle(style){if(typeof style==='number'){return ReactNativePropRegistry.getByID(style);}return style;}function flattenStyle(style){if(!style){return undefined;}invariant(style!==true,'style may be false but not true');if(!Array.isArray(style)){return getStyle(style);}var result={};for(var i=0,styleLength=style.length;i>>0===color&&color>=0&&color<=0xffffffff){return color;}return null;}if(match=matchers.hex6.exec(color)){return parseInt(match[1]+'ff',16)>>>0;}if(names.hasOwnProperty(color)){return names[color];}if(match=matchers.rgb.exec(color)){return(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|0x000000ff)>>>0;}if(match=matchers.rgba.exec(color)){return(parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|parse1(match[4]))>>>0;}if(match=matchers.hex3.exec(color)){return parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+'ff',16)>>>0;}if(match=matchers.hex8.exec(color)){return parseInt(match[1],16)>>>0;}if(match=matchers.hex4.exec(color)){return parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+match[4]+match[4],16)>>>0;}if(match=matchers.hsl.exec(color)){return(hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|0x000000ff)>>>0;}if(match=matchers.hsla.exec(color)){return(hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|parse1(match[4]))>>>0;}return null;}function hue2rgb(p,q,t){if(t<0){t+=1;}if(t>1){t-=1;}if(t<1/6){return p+(q-p)*6*t;}if(t<1/2){return q;}if(t<2/3){return p+(q-p)*(2/3-t)*6;}return p;}function hslToRgb(h,s,l){var q=l<0.5?l*(1+s):l+s-l*s;var p=2*l-q;var r=hue2rgb(p,q,h+1/3);var g=hue2rgb(p,q,h);var b=hue2rgb(p,q,h-1/3);return Math.round(r*255)<<24|Math.round(g*255)<<16|Math.round(b*255)<<8;}var NUMBER='[-+]?\\d*\\.?\\d+';var PERCENTAGE=NUMBER+'%';function call(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return'\\(\\s*('+args.join(')\\s*,\\s*(')+')\\s*\\)';}var matchers={rgb:new RegExp('rgb'+call(NUMBER,NUMBER,NUMBER)),rgba:new RegExp('rgba'+call(NUMBER,NUMBER,NUMBER,NUMBER)),hsl:new RegExp('hsl'+call(NUMBER,PERCENTAGE,PERCENTAGE)),hsla:new RegExp('hsla'+call(NUMBER,PERCENTAGE,PERCENTAGE,NUMBER)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/};function parse255(str){var int=parseInt(str,10);if(int<0){return 0;}if(int>255){return 255;}return int;}function parse360(str){var int=parseFloat(str);return(int%360+360)%360/360;}function parse1(str){var num=parseFloat(str);if(num<0){return 0;}if(num>1){return 255;}return Math.round(num*255);}function parsePercentage(str){var int=parseFloat(str,10);if(int<0){return 0;}if(int>100){return 1;}return int/100;}var names={transparent:0x00000000,aliceblue:0xf0f8ffff,antiquewhite:0xfaebd7ff,aqua:0x00ffffff,aquamarine:0x7fffd4ff,azure:0xf0ffffff,beige:0xf5f5dcff,bisque:0xffe4c4ff,black:0x000000ff,blanchedalmond:0xffebcdff,blue:0x0000ffff,blueviolet:0x8a2be2ff,brown:0xa52a2aff,burlywood:0xdeb887ff,burntsienna:0xea7e5dff,cadetblue:0x5f9ea0ff,chartreuse:0x7fff00ff,chocolate:0xd2691eff,coral:0xff7f50ff,cornflowerblue:0x6495edff,cornsilk:0xfff8dcff,crimson:0xdc143cff,cyan:0x00ffffff,darkblue:0x00008bff,darkcyan:0x008b8bff,darkgoldenrod:0xb8860bff,darkgray:0xa9a9a9ff,darkgreen:0x006400ff,darkgrey:0xa9a9a9ff,darkkhaki:0xbdb76bff,darkmagenta:0x8b008bff,darkolivegreen:0x556b2fff,darkorange:0xff8c00ff,darkorchid:0x9932ccff,darkred:0x8b0000ff,darksalmon:0xe9967aff,darkseagreen:0x8fbc8fff,darkslateblue:0x483d8bff,darkslategray:0x2f4f4fff,darkslategrey:0x2f4f4fff,darkturquoise:0x00ced1ff,darkviolet:0x9400d3ff,deeppink:0xff1493ff,deepskyblue:0x00bfffff,dimgray:0x696969ff,dimgrey:0x696969ff,dodgerblue:0x1e90ffff,firebrick:0xb22222ff,floralwhite:0xfffaf0ff,forestgreen:0x228b22ff,fuchsia:0xff00ffff,gainsboro:0xdcdcdcff,ghostwhite:0xf8f8ffff,gold:0xffd700ff,goldenrod:0xdaa520ff,gray:0x808080ff,green:0x008000ff,greenyellow:0xadff2fff,grey:0x808080ff,honeydew:0xf0fff0ff,hotpink:0xff69b4ff,indianred:0xcd5c5cff,indigo:0x4b0082ff,ivory:0xfffff0ff,khaki:0xf0e68cff,lavender:0xe6e6faff,lavenderblush:0xfff0f5ff,lawngreen:0x7cfc00ff,lemonchiffon:0xfffacdff,lightblue:0xadd8e6ff,lightcoral:0xf08080ff,lightcyan:0xe0ffffff,lightgoldenrodyellow:0xfafad2ff,lightgray:0xd3d3d3ff,lightgreen:0x90ee90ff,lightgrey:0xd3d3d3ff,lightpink:0xffb6c1ff,lightsalmon:0xffa07aff,lightseagreen:0x20b2aaff,lightskyblue:0x87cefaff,lightslategray:0x778899ff,lightslategrey:0x778899ff,lightsteelblue:0xb0c4deff,lightyellow:0xffffe0ff,lime:0x00ff00ff,limegreen:0x32cd32ff,linen:0xfaf0e6ff,magenta:0xff00ffff,maroon:0x800000ff,mediumaquamarine:0x66cdaaff,mediumblue:0x0000cdff,mediumorchid:0xba55d3ff,mediumpurple:0x9370dbff,mediumseagreen:0x3cb371ff,mediumslateblue:0x7b68eeff,mediumspringgreen:0x00fa9aff,mediumturquoise:0x48d1ccff,mediumvioletred:0xc71585ff,midnightblue:0x191970ff,mintcream:0xf5fffaff,mistyrose:0xffe4e1ff,moccasin:0xffe4b5ff,navajowhite:0xffdeadff,navy:0x000080ff,oldlace:0xfdf5e6ff,olive:0x808000ff,olivedrab:0x6b8e23ff,orange:0xffa500ff,orangered:0xff4500ff,orchid:0xda70d6ff,palegoldenrod:0xeee8aaff,palegreen:0x98fb98ff,paleturquoise:0xafeeeeff,palevioletred:0xdb7093ff,papayawhip:0xffefd5ff,peachpuff:0xffdab9ff,peru:0xcd853fff,pink:0xffc0cbff,plum:0xdda0ddff,powderblue:0xb0e0e6ff,purple:0x800080ff,rebeccapurple:0x663399ff,red:0xff0000ff,rosybrown:0xbc8f8fff,royalblue:0x4169e1ff,saddlebrown:0x8b4513ff,salmon:0xfa8072ff,sandybrown:0xf4a460ff,seagreen:0x2e8b57ff,seashell:0xfff5eeff,sienna:0xa0522dff,silver:0xc0c0c0ff,skyblue:0x87ceebff,slateblue:0x6a5acdff,slategray:0x708090ff,slategrey:0x708090ff,snow:0xfffafaff,springgreen:0x00ff7fff,steelblue:0x4682b4ff,tan:0xd2b48cff,teal:0x008080ff,thistle:0xd8bfd8ff,tomato:0xff6347ff,turquoise:0x40e0d0ff,violet:0xee82eeff,wheat:0xf5deb3ff,white:0xffffffff,whitesmoke:0xf5f5f5ff,yellow:0xffff00ff,yellowgreen:0x9acd32ff};module.exports=normalizeColor;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/StyleSheet/processColor.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var normalizeColor=__webpack_require__("./node_modules/react-native/Libraries/StyleSheet/normalizeColor.js");function processColor(color){if(color===undefined||color===null){return color;}var int32Color=normalizeColor(color);if(int32Color===null){return undefined;}int32Color=(int32Color<<24|int32Color>>>8)>>>0;if(Platform.OS==='android'){int32Color=int32Color|0x0;}return int32Color;}module.exports=processColor;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/StyleSheet/processTransform.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var MatrixMath=__webpack_require__("./node_modules/react-native/Libraries/Utilities/MatrixMath.js");var Platform=__webpack_require__("./node_modules/react-native/Libraries/Utilities/Platform.ios.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var stringifySafe=__webpack_require__("./node_modules/react-native/Libraries/Utilities/stringifySafe.js");function processTransform(transform){if(false){_validateTransforms(transform);}if(Platform.OS==='android'){return transform;}var result=MatrixMath.createIdentityMatrix();transform.forEach(function(transformation){var key=Object.keys(transformation)[0];var value=transformation[key];switch(key){case'matrix':MatrixMath.multiplyInto(result,result,value);break;case'perspective':_multiplyTransform(result,MatrixMath.reusePerspectiveCommand,[value]);break;case'rotateX':_multiplyTransform(result,MatrixMath.reuseRotateXCommand,[_convertToRadians(value)]);break;case'rotateY':_multiplyTransform(result,MatrixMath.reuseRotateYCommand,[_convertToRadians(value)]);break;case'rotate':case'rotateZ':_multiplyTransform(result,MatrixMath.reuseRotateZCommand,[_convertToRadians(value)]);break;case'scale':_multiplyTransform(result,MatrixMath.reuseScaleCommand,[value]);break;case'scaleX':_multiplyTransform(result,MatrixMath.reuseScaleXCommand,[value]);break;case'scaleY':_multiplyTransform(result,MatrixMath.reuseScaleYCommand,[value]);break;case'translate':_multiplyTransform(result,MatrixMath.reuseTranslate3dCommand,[value[0],value[1],value[2]||0]);break;case'translateX':_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[value,0]);break;case'translateY':_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[0,value]);break;case'skewX':_multiplyTransform(result,MatrixMath.reuseSkewXCommand,[_convertToRadians(value)]);break;case'skewY':_multiplyTransform(result,MatrixMath.reuseSkewYCommand,[_convertToRadians(value)]);break;default:throw new Error('Invalid transform name: '+key);}});return result;}function _multiplyTransform(result,matrixMathFunction,args){var matrixToApply=MatrixMath.createIdentityMatrix();var argsWithIdentity=[matrixToApply].concat(args);matrixMathFunction.apply(this,argsWithIdentity);MatrixMath.multiplyInto(result,result,matrixToApply);}function _convertToRadians(value){var floatValue=parseFloat(value,10);return value.indexOf('rad')>-1?floatValue:floatValue*Math.PI/180;}function _validateTransforms(transform){transform.forEach(function(transformation){var key=Object.keys(transformation)[0];var value=transformation[key];_validateTransform(key,value,transformation);});}function _validateTransform(key,value,transformation){invariant(!value.getValue,'You passed an Animated.Value to a normal component. '+'You need to wrap that component in an Animated. For example, '+'replace by .');var multivalueTransforms=['matrix','translate'];if(multivalueTransforms.indexOf(key)!==-1){invariant(Array.isArray(value),'Transform with key of %s must have an array as the value: %s',key,stringifySafe(transformation));}switch(key){case'matrix':invariant(value.length===9||value.length===16,'Matrix transform must have a length of 9 (2d) or 16 (3d). '+'Provided matrix has a length of %s: %s',value.length,stringifySafe(transformation));break;case'translate':break;case'rotateX':case'rotateY':case'rotateZ':case'rotate':case'skewX':case'skewY':invariant(typeof value==='string','Transform with key of "%s" must be a string: %s',key,stringifySafe(transformation));invariant(value.indexOf('deg')>-1||value.indexOf('rad')>-1,'Rotate transform must be expressed in degrees (deg) or radians '+'(rad): %s',stringifySafe(transformation));break;case'perspective':invariant(typeof value==='number','Transform with key of "%s" must be a number: %s',key,stringifySafe(transformation));invariant(value!==0,'Transform with key of "%s" cannot be zero: %s',key,stringifySafe(transformation));break;default:invariant(typeof value==='number','Transform with key of "%s" must be a number: %s',key,stringifySafe(transformation));}}module.exports=processTransform;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Text/Text.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _jsxFileName='/Users/naoufal/dev/personal/react-native-payments/packages/react-native-payments/examples/native/node_modules/react-native/Libraries/Text/Text.js';var _extends=Object.assign||function(target){for(var i=1;i0.49999*unit){return[0,2*Math.atan2(qx,qw)*conv,90];}if(test<-0.49999*unit){return[0,-2*Math.atan2(qx,qw)*conv,-90];}return[MatrixMath.roundTo3Places(Math.atan2(2*qx*qw-2*qy*qz,1-2*qx2-2*qz2)*conv),MatrixMath.roundTo3Places(Math.atan2(2*qy*qw-2*qx*qz,1-2*qy2-2*qz2)*conv),MatrixMath.roundTo3Places(Math.asin(2*qx*qy+2*qz*qw)*conv)];},roundTo3Places:function roundTo3Places(n){var arr=n.toString().split('e');return Math.round(arr[0]+'e'+(arr[1]?+arr[1]-3:3))*0.001;},decomposeMatrix:function decomposeMatrix(transformMatrix){invariant(transformMatrix.length===16,'Matrix decomposition needs a list of 3d matrix values, received %s',transformMatrix);var perspective=[];var quaternion=[];var scale=[];var skew=[];var translation=[];if(!transformMatrix[15]){return;}var matrix=[];var perspectiveMatrix=[];for(var i=0;i<4;i++){matrix.push([]);for(var j=0;j<4;j++){var value=transformMatrix[i*4+j]/transformMatrix[15];matrix[i].push(value);perspectiveMatrix.push(j===3?0:value);}}perspectiveMatrix[15]=1;if(!MatrixMath.determinant(perspectiveMatrix)){return;}if(matrix[0][3]!==0||matrix[1][3]!==0||matrix[2][3]!==0){var rightHandSide=[matrix[0][3],matrix[1][3],matrix[2][3],matrix[3][3]];var inversePerspectiveMatrix=MatrixMath.inverse(perspectiveMatrix);var transposedInversePerspectiveMatrix=MatrixMath.transpose(inversePerspectiveMatrix);var perspective=MatrixMath.multiplyVectorByMatrix(rightHandSide,transposedInversePerspectiveMatrix);}else{perspective[0]=perspective[1]=perspective[2]=0;perspective[3]=1;}for(var i=0;i<3;i++){translation[i]=matrix[3][i];}var row=[];for(i=0;i<3;i++){row[i]=[matrix[i][0],matrix[i][1],matrix[i][2]];}scale[0]=MatrixMath.v3Length(row[0]);row[0]=MatrixMath.v3Normalize(row[0],scale[0]);skew[0]=MatrixMath.v3Dot(row[0],row[1]);row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]);skew[0]=MatrixMath.v3Dot(row[0],row[1]);row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]);scale[1]=MatrixMath.v3Length(row[1]);row[1]=MatrixMath.v3Normalize(row[1],scale[1]);skew[0]/=scale[1];skew[1]=MatrixMath.v3Dot(row[0],row[2]);row[2]=MatrixMath.v3Combine(row[2],row[0],1.0,-skew[1]);skew[2]=MatrixMath.v3Dot(row[1],row[2]);row[2]=MatrixMath.v3Combine(row[2],row[1],1.0,-skew[2]);scale[2]=MatrixMath.v3Length(row[2]);row[2]=MatrixMath.v3Normalize(row[2],scale[2]);skew[1]/=scale[2];skew[2]/=scale[2];var pdum3=MatrixMath.v3Cross(row[1],row[2]);if(MatrixMath.v3Dot(row[0],pdum3)<0){for(i=0;i<3;i++){scale[i]*=-1;row[i][0]*=-1;row[i][1]*=-1;row[i][2]*=-1;}}quaternion[0]=0.5*Math.sqrt(Math.max(1+row[0][0]-row[1][1]-row[2][2],0));quaternion[1]=0.5*Math.sqrt(Math.max(1-row[0][0]+row[1][1]-row[2][2],0));quaternion[2]=0.5*Math.sqrt(Math.max(1-row[0][0]-row[1][1]+row[2][2],0));quaternion[3]=0.5*Math.sqrt(Math.max(1+row[0][0]+row[1][1]+row[2][2],0));if(row[2][1]>row[1][2]){quaternion[0]=-quaternion[0];}if(row[0][2]>row[2][0]){quaternion[1]=-quaternion[1];}if(row[1][0]>row[0][1]){quaternion[2]=-quaternion[2];}var rotationDegrees;if(quaternion[0]<0.001&&quaternion[0]>=0&&quaternion[1]<0.001&&quaternion[1]>=0){rotationDegrees=[0,0,MatrixMath.roundTo3Places(Math.atan2(row[0][1],row[0][0])*180/Math.PI)];}else{rotationDegrees=MatrixMath.quaternionToDegreesXYZ(quaternion,matrix,row);}return{rotationDegrees:rotationDegrees,perspective:perspective,quaternion:quaternion,scale:scale,skew:skew,translation:translation,rotate:rotationDegrees[2],rotateX:rotationDegrees[0],rotateY:rotationDegrees[1],scaleX:scale[0],scaleY:scale[1],translateX:translation[0],translateY:translation[1]};}};module.exports=MatrixMath;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/PerformanceLogger.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {var BatchedBridge=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js");var performanceNow=global.nativePerformanceNow||__webpack_require__("./node_modules/fbjs/lib/performanceNow.js");var timespans={};var extras={};var PerformanceLogger={addTimespan:function addTimespan(key,lengthInMs,description){if(timespans[key]){if(false){console.log('PerformanceLogger: Attempting to add a timespan that already exists ',key);}return;}timespans[key]={description:description,totalTime:lengthInMs};},startTimespan:function startTimespan(key,description){if(timespans[key]){if(false){console.log('PerformanceLogger: Attempting to start a timespan that already exists ',key);}return;}timespans[key]={description:description,startTime:performanceNow()};},stopTimespan:function stopTimespan(key){if(!timespans[key]||!timespans[key].startTime){if(false){console.log('PerformanceLogger: Attempting to end a timespan that has not started ',key);}return;}if(timespans[key].endTime){if(false){console.log('PerformanceLogger: Attempting to end a timespan that has already ended ',key);}return;}timespans[key].endTime=performanceNow();timespans[key].totalTime=timespans[key].endTime-timespans[key].startTime;},clear:function clear(){timespans={};extras={};},clearExceptTimespans:function clearExceptTimespans(keys){timespans=Object.keys(timespans).reduce(function(previous,key){if(keys.indexOf(key)!==-1){previous[key]=timespans[key];}return previous;},{});extras={};},getTimespans:function getTimespans(){return timespans;},hasTimespan:function hasTimespan(key){return!!timespans[key];},logTimespans:function logTimespans(){for(var key in timespans){if(timespans[key].totalTime){console.log(key+': '+timespans[key].totalTime+'ms');}}},addTimespans:function addTimespans(newTimespans,labels){for(var i=0,l=newTimespans.length;i 1 ? 1 : (ratio < 0 ? 0 : ratio);\n';}var roundOpen=hasRoundRatio?'Math.round('+roundRatio+' * ':'';var roundClose=hasRoundRatio?') / '+roundRatio:'';fn+=' '+tmpVarName+' = '+roundOpen+'('+from+' * (1 - ratio) + '+to+' * ratio)'+roundClose+';\n';return fn;};var computeNextValLinearScalar=function computeNextValLinearScalar(anim){return computeNextValLinear(anim,anim.from,anim.to,'nextScalarVal');};var computeNextValConstant=function computeNextValConstant(anim){var constantExpression=JSON.stringify(anim.value);return' nextScalarVal = '+constantExpression+';\n';};var computeNextValStep=function computeNextValStep(anim){return' nextScalarVal = value >= '+(anim.threshold+' ? '+anim.to+' : '+anim.from)+';\n';};var computeNextValIdentity=function computeNextValIdentity(anim){return' nextScalarVal = value;\n';};var operationVar=function operationVar(name){return name+'ReuseOp';};var createReusableOperationVars=function createReusableOperationVars(anims){var ret='';for(var name in anims){if(ShouldAllocateReusableOperationVars[name]){ret+='var '+operationVar(name)+' = [];\n';}}return ret;};var newlines=function newlines(statements){return'\n'+statements.join('\n')+'\n';};var computeNextMatrixOperationField=function computeNextMatrixOperationField(anim,name,dimension,index){var fieldAccess=operationVar(name)+'['+index+']';if(anim.from[dimension]!==undefined&&anim.to[dimension]!==undefined){return' '+anim.from[dimension]!==anim.to[dimension]?computeNextValLinear(anim,anim.from[dimension],anim.to[dimension],fieldAccess):fieldAccess+' = '+anim.from[dimension]+';';}else{return' '+fieldAccess+' = '+InitialOperationField[name][index]+';';}};var unrolledVars=[];for(var varIndex=0;varIndex<16;varIndex++){unrolledVars.push('m'+varIndex);}var setNextMatrixAndDetectChange=function setNextMatrixAndDetectChange(orderedMatrixOperations){var fn=[' var transform = result.transform !== undefined ? '+'result.transform : (result.transform = [{ matrix: [] }]);'+' var transformMatrix = transform[0].matrix;'];fn.push.apply(fn,inline(MatrixOps.unroll,['transformMatrix'].concat(unrolledVars)));for(var i=0;imax){return max;}return value;}module.exports=clamp;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/createStrictShapeTypeChecker.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactPropTypeLocationNames=__webpack_require__("./node_modules/react/lib/ReactPropTypeLocationNames.js");var ReactPropTypesSecret=__webpack_require__("./node_modules/react/lib/ReactPropTypesSecret.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var merge=__webpack_require__("./node_modules/react-native/Libraries/vendor/core/merge.js");function createStrictShapeTypeChecker(shapeTypes){function checkType(isRequired,props,propName,componentName,location){if(!props[propName]){if(isRequired){invariant(false,'Required object `'+propName+'` was not specified in '+('`'+componentName+'`.'));}return;}var propValue=props[propName];var propType=typeof propValue;var locationName=location&&ReactPropTypeLocationNames[location]||'(unknown)';if(propType!=='object'){invariant(false,'Invalid '+locationName+' `'+propName+'` of type `'+propType+'` '+('supplied to `'+componentName+'`, expected `object`.'));}var allKeys=merge(props[propName],shapeTypes);for(var key in allKeys){var checker=shapeTypes[key];if(!checker){invariant(false,'Invalid props.'+propName+' key `'+key+'` supplied to `'+componentName+'`.'+'\nBad object: '+JSON.stringify(props[propName],null,' ')+'\nValid keys: '+JSON.stringify(Object.keys(shapeTypes),null,' '));}var error=checker(propValue,key,componentName,location,null,ReactPropTypesSecret);if(error){invariant(false,error.message+'\nBad object: '+JSON.stringify(props[propName],null,' '));}}}function chainedCheckType(props,propName,componentName,location){return checkType(false,props,propName,componentName,location);}chainedCheckType.isRequired=checkType.bind(null,true);return chainedCheckType;}module.exports=createStrictShapeTypeChecker;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function deepFreezeAndThrowOnMutationInDev(object){if(false){if(typeof object!=='object'||object===null||Object.isFrozen(object)||Object.isSealed(object)){return;}for(var key in object){if(object.hasOwnProperty(key)){object.__defineGetter__(key,identity.bind(null,object[key]));object.__defineSetter__(key,throwOnImmutableMutation.bind(null,key));}}Object.freeze(object);Object.seal(object);for(var key in object){if(object.hasOwnProperty(key)){deepFreezeAndThrowOnMutationInDev(object[key]);}}}}function throwOnImmutableMutation(key,value){throw Error('You attempted to set the key `'+key+'` with the value `'+JSON.stringify(value)+'` on an object that is meant to be immutable '+'and has been frozen.');}function identity(value){return value;}module.exports=deepFreezeAndThrowOnMutationInDev;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function defineLazyObjectProperty(object,name,descriptor){var get=descriptor.get;var enumerable=descriptor.enumerable!==false;var writable=descriptor.writable!==false;var value=void 0;var valueSet=false;function getValue(){if(!valueSet){setValue(get());}return value;}function setValue(newValue){value=newValue;valueSet=true;Object.defineProperty(object,name,{value:newValue,configurable:true,enumerable:enumerable,writable:writable});}Object.defineProperty(object,name,{get:getValue,set:setValue,configurable:true,enumerable:enumerable});}module.exports=defineLazyObjectProperty;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/deprecatedPropType.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var UIManager=__webpack_require__("./node_modules/react-native/Libraries/ReactNative/UIManager.js");var ReactPropTypesSecret=__webpack_require__("./node_modules/react/lib/ReactPropTypesSecret.js");var ReactPropTypeLocations=__webpack_require__("./node_modules/react/lib/ReactPropTypeLocations.js");function deprecatedPropType(propType,explanation){return function validate(props,propName,componentName){if(!UIManager[componentName]&&props[propName]!==undefined){console.warn('`'+propName+'` supplied to `'+componentName+'` has been deprecated. '+explanation);}return propType(props,propName,componentName,ReactPropTypeLocations.prop,null,ReactPropTypesSecret);};}module.exports=deprecatedPropType;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var deepDiffer=function deepDiffer(one,two){if(one===two){return false;}if(typeof one==='function'&&typeof two==='function'){return false;}if(typeof one!=='object'||one===null){return one!==two;}if(typeof two!=='object'||two===null){return true;}if(one.constructor!==two.constructor){return true;}if(Array.isArray(one)){var len=one.length;if(two.length!==len){return true;}for(var ii=0;ii1&&arguments[1]!==undefined?arguments[1]:false;if(_vibrating){return;}_vibrating=true;if(pattern[0]===0){RCTVibration.vibrate();pattern=pattern.slice(1);}if(pattern.length===0){_vibrating=false;return;}setTimeout(function(){return vibrateScheduler(++_id,pattern,repeat,1);},pattern[0]);}function vibrateScheduler(id,pattern,repeat,nextIndex){if(!_vibrating||id!==_id){return;}RCTVibration.vibrate();if(nextIndex>=pattern.length){if(repeat){nextIndex=0;}else{_vibrating=false;return;}}setTimeout(function(){return vibrateScheduler(id,pattern,repeat,nextIndex+1);},pattern[nextIndex]);}var Vibration={vibrate:function vibrate(){var pattern=arguments.length>0&&arguments[0]!==undefined?arguments[0]:400;var repeat=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(Platform.OS==='android'){if(typeof pattern==='number'){RCTVibration.vibrate(pattern);}else if(Array.isArray(pattern)){RCTVibration.vibrateByPattern(pattern,repeat?0:-1);}else{throw new Error('Vibration pattern should be a number or array');}}else{if(_vibrating){return;}if(typeof pattern==='number'){RCTVibration.vibrate();}else if(Array.isArray(pattern)){vibrateByPattern(pattern,repeat);}else{throw new Error('Vibration pattern should be a number or array');}}},cancel:function cancel(){if(Platform.OS==='ios'){_vibrating=false;}else{RCTVibration.cancel();}}};module.exports=Vibration;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/Vibration/VibrationIOS.ios.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var RCTVibration=__webpack_require__("./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js").Vibration;var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var VibrationIOS={vibrate:function vibrate(){invariant(arguments[0]===undefined,'Vibration patterns not supported.');RCTVibration.vibrate();}};module.exports=VibrationIOS;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/WebSocket/WebSocket.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i=_iterator.length)break;_ref=_iterator[_i++];}else{_i=_iterator.next();if(_i.done)break;_ref=_i.value;}var key=_ref;_loop(key);}})();}var ReactNativeInternal=__webpack_require__("./node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js");function applyForwarding(key){if(false){Object.defineProperty(ReactNative,key,Object.getOwnPropertyDescriptor(ReactNativeInternal,key));return;}ReactNative[key]=ReactNativeInternal[key];}for(var key in ReactNativeInternal){applyForwarding(key);}module.exports=ReactNative;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/vendor/core/Map.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;i=len){this._iteratedObject=undefined;return createIterResultObject(undefined,true);}this._nextIndex=index+1;if(kind===KIND_KEY){return createIterResultObject(index,false);}else if(kind===KIND_VALUE){return createIterResultObject(array[index],false);}else if(kind===KIND_KEY_VAL){return createIterResultObject([index,array[index]],false);}}},{key:'@@iterator',value:function iterator(){return this;}}]);return ArrayIterator;}();var StringIterator=function(){function StringIterator(string){_classCallCheck(this,StringIterator);if(typeof string!=='string'){throw new TypeError('Object is not a string');}this._iteratedString=string;this._nextIndex=0;}_createClass(StringIterator,[{key:'next',value:function next(){if(!this instanceof StringIterator){throw new TypeError('Object is not a StringIterator');}if(this._iteratedString==null){return createIterResultObject(undefined,true);}var index=this._nextIndex;var s=this._iteratedString;var len=s.length;if(index>=len){this._iteratedString=undefined;return createIterResultObject(undefined,true);}var ret;var first=s.charCodeAt(index);if(first<0xD800||first>0xDBFF||index+1===len){ret=s[index];}else{var second=s.charCodeAt(index+1);if(second<0xDC00||second>0xDFFF){ret=s[index];}else{ret=s[index]+s[index+1];}}this._nextIndex=index+ret.length;return createIterResultObject(ret,false);}},{key:'@@iterator',value:function iterator(){return this;}}]);return StringIterator;}();function createIterResultObject(value,done){return{value:value,done:done};}return function(object,kind){if(typeof object==='string'){return new StringIterator(object);}else if(Array.isArray(object)){return new ArrayIterator(object,kind||KIND_VALUE);}else{return object[ITERATOR_SYMBOL]();}};}();}else{return function(object){return object[ITERATOR_SYMBOL]();};}}();_extends(toIterator,{KIND_KEY:KIND_KEY,KIND_VALUE:KIND_VALUE,KIND_KEY_VAL:KIND_KEY_VAL,ITERATOR_SYMBOL:ITERATOR_SYMBOL});module.exports=toIterator;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/Libraries/vendor/document/selection/DocumentSelectionState.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _createClass=function(){function defineProperties(target,props){for(var i=0;ithis._focusOffset;}},{key:'getAnchorOffset',value:function getAnchorOffset(){return this._hasFocus?this._anchorOffset:null;}},{key:'getFocusOffset',value:function getFocusOffset(){return this._hasFocus?this._focusOffset:null;}},{key:'getStartOffset',value:function getStartOffset(){return this._hasFocus?Math.min(this._anchorOffset,this._focusOffset):null;}},{key:'getEndOffset',value:function getEndOffset(){return this._hasFocus?Math.max(this._anchorOffset,this._focusOffset):null;}},{key:'overlaps',value:function overlaps(start,end){return this.hasFocus()&&this.getStartOffset()<=end&&start<=this.getEndOffset();}}]);return DocumentSelectionState;}();mixInEventEmitter(DocumentSelectionState,{'blur':true,'focus':true,'update':true});module.exports=DocumentSelectionState;
-
-/***/ }),
-
-/***/ "./node_modules/react-native/local-cli/bundle/assetPathUtils.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function getAndroidAssetSuffix(scale){switch(scale){case 0.75:return'ldpi';case 1:return'mdpi';case 1.5:return'hdpi';case 2:return'xhdpi';case 3:return'xxhdpi';case 4:return'xxxhdpi';}}function getAndroidDrawableFolderName(asset,scale){var suffix=getAndroidAssetSuffix(scale);if(!suffix){throw new Error('Don\'t know which android drawable suffix to use for asset: '+JSON.stringify(asset));}var androidFolder='drawable-'+suffix;return androidFolder;}function getAndroidResourceIdentifier(asset){var folderPath=getBasePath(asset);return(folderPath+'/'+asset.name).toLowerCase().replace(/\//g,'_').replace(/([^a-z0-9_])/g,'').replace(/^assets_/,'');}function getBasePath(asset){var basePath=asset.httpServerLocation;if(basePath[0]==='/'){basePath=basePath.substr(1);}return basePath;}module.exports={getAndroidAssetSuffix:getAndroidAssetSuffix,getAndroidDrawableFolderName:getAndroidDrawableFolderName,getAndroidResourceIdentifier:getAndroidResourceIdentifier,getBasePath:getBasePath};
-
-/***/ }),
-
-/***/ "./node_modules/react-timer-mixin/TimerMixin.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {var GLOBAL=typeof window==='undefined'?global:window;var setter=function setter(_setter,_clearer,array){return function(callback,delta){var id=_setter(function(){_clearer.call(this,id);callback.apply(this,arguments);}.bind(this),delta);if(!this[array]){this[array]=[id];}else{this[array].push(id);}return id;};};var clearer=function clearer(_clearer,array){return function(id){if(this[array]){var index=this[array].indexOf(id);if(index!==-1){this[array].splice(index,1);}}_clearer(id);};};var _timeouts='TimerMixin_timeouts';var _clearTimeout=clearer(GLOBAL.clearTimeout,_timeouts);var _setTimeout=setter(GLOBAL.setTimeout,_clearTimeout,_timeouts);var _intervals='TimerMixin_intervals';var _clearInterval=clearer(GLOBAL.clearInterval,_intervals);var _setInterval=setter(GLOBAL.setInterval,function(){},_intervals);var _immediates='TimerMixin_immediates';var _clearImmediate=clearer(GLOBAL.clearImmediate,_immediates);var _setImmediate=setter(GLOBAL.setImmediate,_clearImmediate,_immediates);var _rafs='TimerMixin_rafs';var _cancelAnimationFrame=clearer(GLOBAL.cancelAnimationFrame,_rafs);var _requestAnimationFrame=setter(GLOBAL.requestAnimationFrame,_cancelAnimationFrame,_rafs);var TimerMixin={componentWillUnmount:function componentWillUnmount(){this[_timeouts]&&this[_timeouts].forEach(function(id){GLOBAL.clearTimeout(id);});this[_timeouts]=null;this[_intervals]&&this[_intervals].forEach(function(id){GLOBAL.clearInterval(id);});this[_intervals]=null;this[_immediates]&&this[_immediates].forEach(function(id){GLOBAL.clearImmediate(id);});this[_immediates]=null;this[_rafs]&&this[_rafs].forEach(function(id){GLOBAL.cancelAnimationFrame(id);});this[_rafs]=null;},setTimeout:_setTimeout,clearTimeout:_clearTimeout,setInterval:_setInterval,clearInterval:_clearInterval,setImmediate:_setImmediate,clearImmediate:_clearImmediate,requestAnimationFrame:_requestAnimationFrame,cancelAnimationFrame:_cancelAnimationFrame};module.exports=TimerMixin;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/react/lib/KeyEscapeUtils.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-function escape(key){var escapeRegex=/[=:]/g;var escaperLookup={'=':'=0',':':'=2'};var escapedString=(''+key).replace(escapeRegex,function(match){return escaperLookup[match];});return'$'+escapedString;}function unescape(key){var unescapeRegex=/(=0|=2)/g;var unescaperLookup={'=0':'=','=2':':'};var keySubstring=key[0]==='.'&&key[1]==='$'?key.substring(2):key.substring(1);return(''+keySubstring).replace(unescapeRegex,function(match){return unescaperLookup[match];});}var KeyEscapeUtils={escape:escape,unescape:unescape};module.exports=KeyEscapeUtils;
-
-/***/ }),
-
-/***/ "./node_modules/react/lib/LinkedStateMixin.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var ReactLink=__webpack_require__("./node_modules/react/lib/ReactLink.js");var ReactStateSetters=__webpack_require__("./node_modules/react/lib/ReactStateSetters.js");var LinkedStateMixin={linkState:function linkState(key){return new ReactLink(this.state[key],ReactStateSetters.createStateKeySetter(this,key));}};module.exports=LinkedStateMixin;
-
-/***/ }),
-
-/***/ "./node_modules/react/lib/PooledClass.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var _prodInvariant=__webpack_require__("./node_modules/react/lib/reactProdInvariant.js");var invariant=__webpack_require__("./node_modules/fbjs/lib/invariant.js");var oneArgumentPooler=function oneArgumentPooler(copyFieldsFrom){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();Klass.call(instance,copyFieldsFrom);return instance;}else{return new Klass(copyFieldsFrom);}};var twoArgumentPooler=function twoArgumentPooler(a1,a2){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();Klass.call(instance,a1,a2);return instance;}else{return new Klass(a1,a2);}};var threeArgumentPooler=function threeArgumentPooler(a1,a2,a3){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();Klass.call(instance,a1,a2,a3);return instance;}else{return new Klass(a1,a2,a3);}};var fourArgumentPooler=function fourArgumentPooler(a1,a2,a3,a4){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();Klass.call(instance,a1,a2,a3,a4);return instance;}else{return new Klass(a1,a2,a3,a4);}};var standardReleaser=function standardReleaser(instance){var Klass=this;!(instance instanceof Klass)? false?invariant(false,'Trying to release an instance into a pool of a different type.'):_prodInvariant('25'):void 0;instance.destructor();if(Klass.instancePool.length1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}if(newThis!==component&&newThis!==null){process.env.NODE_ENV!=='production'?warning(false,'bind(): React component methods may only be bound to the '+'component instance. See %s',componentName):void 0;}else if(!args.length){process.env.NODE_ENV!=='production'?warning(false,'bind(): You are binding a component method to the component. '+'React does this for you automatically in a high-performance '+'way, so you can safely remove this call. See %s',componentName):void 0;return boundMethod;}var reboundMethod=_bind.apply(boundMethod,arguments);reboundMethod.__reactBoundContext=component;reboundMethod.__reactBoundMethod=method;reboundMethod.__reactBoundArguments=args;return reboundMethod;};}return boundMethod;}function bindAutoBindMethods(component){var pairs=component.__reactAutoBindPairs;for(var i=0;i1){var childArray=Array(childrenLength);for(var i=0;i1){var childArray=Array(childrenLength);for(var i=0;i
-//
-//
-//
-//
-//
-// Here's how it works.
-//
-// ```
-// // Get a reference to the logo element.
-// var el = document.getElementById('logo');
-//
-// // create a SpringSystem and a Spring with a bouncy config.
-// var springSystem = new rebound.SpringSystem();
-// var spring = springSystem.createSpring(50, 3);
-//
-// // Add a listener to the spring. Every time the physics
-// // solver updates the Spring's value onSpringUpdate will
-// // be called.
-// spring.addListener({
-// onSpringUpdate: function(spring) {
-// var val = spring.getCurrentValue();
-// val = rebound.MathUtil
-// .mapValueInRange(val, 0, 1, 1, 0.5);
-// scale(el, val);
-// }
-// });
-//
-// // Listen for mouse down/up/out and toggle the
-// //springs endValue from 0 to 1.
-// el.addEventListener('mousedown', function() {
-// spring.setEndValue(1);
-// });
-//
-// el.addEventListener('mouseout', function() {
-// spring.setEndValue(0);
-// });
-//
-// el.addEventListener('mouseup', function() {
-// spring.setEndValue(0);
-// });
-//
-// // Helper for scaling an element with css transforms.
-// function scale(el, val) {
-// el.style.mozTransform =
-// el.style.msTransform =
-// el.style.webkitTransform =
-// el.style.transform = 'scale3d(' +
-// val + ', ' + val + ', 1)';
-// }
-// ```
-
-(function() {
- var rebound = {};
- var util = rebound.util = {};
- var concat = Array.prototype.concat;
- var slice = Array.prototype.slice;
-
- // Bind a function to a context object.
- util.bind = function bind(func, context) {
- var args = slice.call(arguments, 2);
- return function() {
- func.apply(context, concat.call(args, slice.call(arguments)));
- };
- };
-
- // Add all the properties in the source to the target.
- util.extend = function extend(target, source) {
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- target[key] = source[key];
- }
- }
- };
-
- // SpringSystem
- // ------------
- // **SpringSystem** is a set of Springs that all run on the same physics
- // timing loop. To get started with a Rebound animation you first
- // create a new SpringSystem and then add springs to it.
- var SpringSystem = rebound.SpringSystem = function SpringSystem(looper) {
- this._springRegistry = {};
- this._activeSprings = [];
- this.listeners = [];
- this._idleSpringIndices = [];
- this.looper = looper || new AnimationLooper();
- this.looper.springSystem = this;
- };
-
- util.extend(SpringSystem.prototype, {
-
- _springRegistry: null,
-
- _isIdle: true,
-
- _lastTimeMillis: -1,
-
- _activeSprings: null,
-
- listeners: null,
-
- _idleSpringIndices: null,
-
- // A SpringSystem is iterated by a looper. The looper is responsible
- // for executing each frame as the SpringSystem is resolved to idle.
- // There are three types of Loopers described below AnimationLooper,
- // SimulationLooper, and SteppingSimulationLooper. AnimationLooper is
- // the default as it is the most useful for common UI animations.
- setLooper: function(looper) {
- this.looper = looper;
- looper.springSystem = this;
- },
-
- // Add a new spring to this SpringSystem. This Spring will now be solved for
- // during the physics iteration loop. By default the spring will use the
- // default Origami spring config with 40 tension and 7 friction, but you can
- // also provide your own values here.
- createSpring: function(tension, friction) {
- var springConfig;
- if (tension === undefined || friction === undefined) {
- springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;
- } else {
- springConfig =
- SpringConfig.fromOrigamiTensionAndFriction(tension, friction);
- }
- return this.createSpringWithConfig(springConfig);
- },
-
- // Add a spring with a specified bounciness and speed. To replicate Origami
- // compositions based on PopAnimation patches, use this factory method to
- // create matching springs.
- createSpringWithBouncinessAndSpeed: function(bounciness, speed) {
- var springConfig;
- if (bounciness === undefined || speed === undefined) {
- springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;
- } else {
- springConfig =
- SpringConfig.fromBouncinessAndSpeed(bounciness, speed);
- }
- return this.createSpringWithConfig(springConfig);
- },
-
- // Add a spring with the provided SpringConfig.
- createSpringWithConfig: function(springConfig) {
- var spring = new Spring(this);
- this.registerSpring(spring);
- spring.setSpringConfig(springConfig);
- return spring;
- },
-
- // You can check if a SpringSystem is idle or active by calling
- // getIsIdle. If all of the Springs in the SpringSystem are at rest,
- // i.e. the physics forces have reached equilibrium, then this
- // method will return true.
- getIsIdle: function() {
- return this._isIdle;
- },
-
- // Retrieve a specific Spring from the SpringSystem by id. This
- // can be useful for inspecting the state of a spring before
- // or after an integration loop in the SpringSystem executes.
- getSpringById: function (id) {
- return this._springRegistry[id];
- },
-
- // Get a listing of all the springs registered with this
- // SpringSystem.
- getAllSprings: function() {
- var vals = [];
- for (var id in this._springRegistry) {
- if (this._springRegistry.hasOwnProperty(id)) {
- vals.push(this._springRegistry[id]);
- }
- }
- return vals;
- },
-
- // registerSpring is called automatically as soon as you create
- // a Spring with SpringSystem#createSpring. This method sets the
- // spring up in the registry so that it can be solved in the
- // solver loop.
- registerSpring: function(spring) {
- this._springRegistry[spring.getId()] = spring;
- },
-
- // Deregister a spring with this SpringSystem. The SpringSystem will
- // no longer consider this Spring during its integration loop once
- // this is called. This is normally done automatically for you when
- // you call Spring#destroy.
- deregisterSpring: function(spring) {
- removeFirst(this._activeSprings, spring);
- delete this._springRegistry[spring.getId()];
- },
-
- advance: function(time, deltaTime) {
- while(this._idleSpringIndices.length > 0) this._idleSpringIndices.pop();
- for (var i = 0, len = this._activeSprings.length; i < len; i++) {
- var spring = this._activeSprings[i];
- if (spring.systemShouldAdvance()) {
- spring.advance(time / 1000.0, deltaTime / 1000.0);
- } else {
- this._idleSpringIndices.push(this._activeSprings.indexOf(spring));
- }
- }
- while(this._idleSpringIndices.length > 0) {
- var idx = this._idleSpringIndices.pop();
- idx >= 0 && this._activeSprings.splice(idx, 1);
- }
- },
-
- // This is our main solver loop called to move the simulation
- // forward through time. Before each pass in the solver loop
- // onBeforeIntegrate is called on an any listeners that have
- // registered themeselves with the SpringSystem. This gives you
- // an opportunity to apply any constraints or adjustments to
- // the springs that should be enforced before each iteration
- // loop. Next the advance method is called to move each Spring in
- // the systemShouldAdvance forward to the current time. After the
- // integration step runs in advance, onAfterIntegrate is called
- // on any listeners that have registered themselves with the
- // SpringSystem. This gives you an opportunity to run any post
- // integration constraints or adjustments on the Springs in the
- // SpringSystem.
- loop: function(currentTimeMillis) {
- var listener;
- if (this._lastTimeMillis === -1) {
- this._lastTimeMillis = currentTimeMillis -1;
- }
- var ellapsedMillis = currentTimeMillis - this._lastTimeMillis;
- this._lastTimeMillis = currentTimeMillis;
-
- var i = 0, len = this.listeners.length;
- for (i = 0; i < len; i++) {
- listener = this.listeners[i];
- listener.onBeforeIntegrate && listener.onBeforeIntegrate(this);
- }
-
- this.advance(currentTimeMillis, ellapsedMillis);
- if (this._activeSprings.length === 0) {
- this._isIdle = true;
- this._lastTimeMillis = -1;
- }
-
- for (i = 0; i < len; i++) {
- listener = this.listeners[i];
- listener.onAfterIntegrate && listener.onAfterIntegrate(this);
- }
-
- if (!this._isIdle) {
- this.looper.run();
- }
- },
-
- // activateSpring is used to notify the SpringSystem that a Spring
- // has become displaced. The system responds by starting its solver
- // loop up if it is currently idle.
- activateSpring: function(springId) {
- var spring = this._springRegistry[springId];
- if (this._activeSprings.indexOf(spring) == -1) {
- this._activeSprings.push(spring);
- }
- if (this.getIsIdle()) {
- this._isIdle = false;
- this.looper.run();
- }
- },
-
- // Add a listener to the SpringSystem so that you can receive
- // before/after integration notifications allowing Springs to be
- // constrained or adjusted.
- addListener: function(listener) {
- this.listeners.push(listener);
- },
-
- // Remove a previously added listener on the SpringSystem.
- removeListener: function(listener) {
- removeFirst(this.listeners, listener);
- },
-
- // Remove all previously added listeners on the SpringSystem.
- removeAllListeners: function() {
- this.listeners = [];
- }
-
- });
-
- // Spring
- // ------
- // **Spring** provides a model of a classical spring acting to
- // resolve a body to equilibrium. Springs have configurable
- // tension which is a force multipler on the displacement of the
- // spring from its rest point or `endValue` as defined by [Hooke's
- // law](http://en.wikipedia.org/wiki/Hooke's_law). Springs also have
- // configurable friction, which ensures that they do not oscillate
- // infinitely. When a Spring is displaced by updating it's resting
- // or `currentValue`, the SpringSystems that contain that Spring
- // will automatically start looping to solve for equilibrium. As each
- // timestep passes, `SpringListener` objects attached to the Spring
- // will be notified of the updates providing a way to drive an
- // animation off of the spring's resolution curve.
- var Spring = rebound.Spring = function Spring(springSystem) {
- this._id = 's' + Spring._ID++;
- this._springSystem = springSystem;
- this.listeners = [];
- this._currentState = new PhysicsState();
- this._previousState = new PhysicsState();
- this._tempState = new PhysicsState();
- };
-
- util.extend(Spring, {
- _ID: 0,
-
- MAX_DELTA_TIME_SEC: 0.064,
-
- SOLVER_TIMESTEP_SEC: 0.001
-
- });
-
- util.extend(Spring.prototype, {
-
- _id: 0,
-
- _springConfig: null,
-
- _overshootClampingEnabled: false,
-
- _currentState: null,
-
- _previousState: null,
-
- _tempState: null,
-
- _startValue: 0,
-
- _endValue: 0,
-
- _wasAtRest: true,
-
- _restSpeedThreshold: 0.001,
-
- _displacementFromRestThreshold: 0.001,
-
- listeners: null,
-
- _timeAccumulator: 0,
-
- _springSystem: null,
-
- // Remove a Spring from simulation and clear its listeners.
- destroy: function() {
- this.listeners = [];
- this.frames = [];
- this._springSystem.deregisterSpring(this);
- },
-
- // Get the id of the spring, which can be used to retrieve it from
- // the SpringSystems it participates in later.
- getId: function() {
- return this._id;
- },
-
- // Set the configuration values for this Spring. A SpringConfig
- // contains the tension and friction values used to solve for the
- // equilibrium of the Spring in the physics loop.
- setSpringConfig: function(springConfig) {
- this._springConfig = springConfig;
- return this;
- },
-
- // Retrieve the SpringConfig used by this Spring.
- getSpringConfig: function() {
- return this._springConfig;
- },
-
- // Set the current position of this Spring. Listeners will be updated
- // with this value immediately. If the rest or `endValue` is not
- // updated to match this value, then the spring will be dispalced and
- // the SpringSystem will start to loop to restore the spring to the
- // `endValue`.
- //
- // A common pattern is to move a Spring around without animation by
- // calling.
- //
- // ```
- // spring.setCurrentValue(n).setAtRest();
- // ```
- //
- // This moves the Spring to a new position `n`, sets the endValue
- // to `n`, and removes any velocity from the `Spring`. By doing
- // this you can allow the `SpringListener` to manage the position
- // of UI elements attached to the spring even when moving without
- // animation. For example, when dragging an element you can
- // update the position of an attached view through a spring
- // by calling `spring.setCurrentValue(x)`. When
- // the gesture ends you can update the Springs
- // velocity and endValue
- // `spring.setVelocity(gestureEndVelocity).setEndValue(flingTarget)`
- // to cause it to naturally animate the UI element to the resting
- // position taking into account existing velocity. The codepaths for
- // synchronous movement and spring driven animation can
- // be unified using this technique.
- setCurrentValue: function(currentValue, skipSetAtRest) {
- this._startValue = currentValue;
- this._currentState.position = currentValue;
- if (!skipSetAtRest) {
- this.setAtRest();
- }
- this.notifyPositionUpdated(false, false);
- return this;
- },
-
- // Get the position that the most recent animation started at. This
- // can be useful for determining the number off oscillations that
- // have occurred.
- getStartValue: function() {
- return this._startValue;
- },
-
- // Retrieve the current value of the Spring.
- getCurrentValue: function() {
- return this._currentState.position;
- },
-
- // Get the absolute distance of the Spring from it's resting endValue
- // position.
- getCurrentDisplacementDistance: function() {
- return this.getDisplacementDistanceForState(this._currentState);
- },
-
- getDisplacementDistanceForState: function(state) {
- return Math.abs(this._endValue - state.position);
- },
-
- // Set the endValue or resting position of the spring. If this
- // value is different than the current value, the SpringSystem will
- // be notified and will begin running its solver loop to resolve
- // the Spring to equilibrium. Any listeners that are registered
- // for onSpringEndStateChange will also be notified of this update
- // immediately.
- setEndValue: function(endValue) {
- if (this._endValue == endValue && this.isAtRest()) {
- return this;
- }
- this._startValue = this.getCurrentValue();
- this._endValue = endValue;
- this._springSystem.activateSpring(this.getId());
- for (var i = 0, len = this.listeners.length; i < len; i++) {
- var listener = this.listeners[i];
- var onChange = listener.onSpringEndStateChange;
- onChange && onChange(this);
- }
- return this;
- },
-
- // Retrieve the endValue or resting position of this spring.
- getEndValue: function() {
- return this._endValue;
- },
-
- // Set the current velocity of the Spring. As previously mentioned,
- // this can be useful when you are performing a direct manipulation
- // gesture. When a UI element is released you may call setVelocity
- // on its animation Spring so that the Spring continues with the
- // same velocity as the gesture ended with. The friction, tension,
- // and displacement of the Spring will then govern its motion to
- // return to rest on a natural feeling curve.
- setVelocity: function(velocity) {
- if (velocity === this._currentState.velocity) {
- return this;
- }
- this._currentState.velocity = velocity;
- this._springSystem.activateSpring(this.getId());
- return this;
- },
-
- // Get the current velocity of the Spring.
- getVelocity: function() {
- return this._currentState.velocity;
- },
-
- // Set a threshold value for the movement speed of the Spring below
- // which it will be considered to be not moving or resting.
- setRestSpeedThreshold: function(restSpeedThreshold) {
- this._restSpeedThreshold = restSpeedThreshold;
- return this;
- },
-
- // Retrieve the rest speed threshold for this Spring.
- getRestSpeedThreshold: function() {
- return this._restSpeedThreshold;
- },
-
- // Set a threshold value for displacement below which the Spring
- // will be considered to be not displaced i.e. at its resting
- // `endValue`.
- setRestDisplacementThreshold: function(displacementFromRestThreshold) {
- this._displacementFromRestThreshold = displacementFromRestThreshold;
- },
-
- // Retrieve the rest displacement threshold for this spring.
- getRestDisplacementThreshold: function() {
- return this._displacementFromRestThreshold;
- },
-
- // Enable overshoot clamping. This means that the Spring will stop
- // immediately when it reaches its resting position regardless of
- // any existing momentum it may have. This can be useful for certain
- // types of animations that should not oscillate such as a scale
- // down to 0 or alpha fade.
- setOvershootClampingEnabled: function(enabled) {
- this._overshootClampingEnabled = enabled;
- return this;
- },
-
- // Check if overshoot clamping is enabled for this spring.
- isOvershootClampingEnabled: function() {
- return this._overshootClampingEnabled;
- },
-
- // Check if the Spring has gone past its end point by comparing
- // the direction it was moving in when it started to the current
- // position and end value.
- isOvershooting: function() {
- var start = this._startValue;
- var end = this._endValue;
- return this._springConfig.tension > 0 &&
- ((start < end && this.getCurrentValue() > end) ||
- (start > end && this.getCurrentValue() < end));
- },
-
- // Spring.advance is the main solver method for the Spring. It takes
- // the current time and delta since the last time step and performs
- // an RK4 integration to get the new position and velocity state
- // for the Spring based on the tension, friction, velocity, and
- // displacement of the Spring.
- advance: function(time, realDeltaTime) {
- var isAtRest = this.isAtRest();
-
- if (isAtRest && this._wasAtRest) {
- return;
- }
-
- var adjustedDeltaTime = realDeltaTime;
- if (realDeltaTime > Spring.MAX_DELTA_TIME_SEC) {
- adjustedDeltaTime = Spring.MAX_DELTA_TIME_SEC;
- }
-
- this._timeAccumulator += adjustedDeltaTime;
-
- var tension = this._springConfig.tension,
- friction = this._springConfig.friction,
-
- position = this._currentState.position,
- velocity = this._currentState.velocity,
- tempPosition = this._tempState.position,
- tempVelocity = this._tempState.velocity,
-
- aVelocity, aAcceleration,
- bVelocity, bAcceleration,
- cVelocity, cAcceleration,
- dVelocity, dAcceleration,
-
- dxdt, dvdt;
-
- while(this._timeAccumulator >= Spring.SOLVER_TIMESTEP_SEC) {
-
- this._timeAccumulator -= Spring.SOLVER_TIMESTEP_SEC;
-
- if (this._timeAccumulator < Spring.SOLVER_TIMESTEP_SEC) {
- this._previousState.position = position;
- this._previousState.velocity = velocity;
- }
-
- aVelocity = velocity;
- aAcceleration =
- (tension * (this._endValue - tempPosition)) - friction * velocity;
-
- tempPosition = position + aVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- tempVelocity =
- velocity + aAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- bVelocity = tempVelocity;
- bAcceleration =
- (tension * (this._endValue - tempPosition)) - friction * tempVelocity;
-
- tempPosition = position + bVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- tempVelocity =
- velocity + bAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- cVelocity = tempVelocity;
- cAcceleration =
- (tension * (this._endValue - tempPosition)) - friction * tempVelocity;
-
- tempPosition = position + cVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- tempVelocity =
- velocity + cAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5;
- dVelocity = tempVelocity;
- dAcceleration =
- (tension * (this._endValue - tempPosition)) - friction * tempVelocity;
-
- dxdt =
- 1.0/6.0 * (aVelocity + 2.0 * (bVelocity + cVelocity) + dVelocity);
- dvdt = 1.0/6.0 * (
- aAcceleration + 2.0 * (bAcceleration + cAcceleration) + dAcceleration
- );
-
- position += dxdt * Spring.SOLVER_TIMESTEP_SEC;
- velocity += dvdt * Spring.SOLVER_TIMESTEP_SEC;
- }
-
- this._tempState.position = tempPosition;
- this._tempState.velocity = tempVelocity;
-
- this._currentState.position = position;
- this._currentState.velocity = velocity;
-
- if (this._timeAccumulator > 0) {
- this._interpolate(this._timeAccumulator / Spring.SOLVER_TIMESTEP_SEC);
- }
-
- if (this.isAtRest() ||
- this._overshootClampingEnabled && this.isOvershooting()) {
-
- if (this._springConfig.tension > 0) {
- this._startValue = this._endValue;
- this._currentState.position = this._endValue;
- } else {
- this._endValue = this._currentState.position;
- this._startValue = this._endValue;
- }
- this.setVelocity(0);
- isAtRest = true;
- }
-
- var notifyActivate = false;
- if (this._wasAtRest) {
- this._wasAtRest = false;
- notifyActivate = true;
- }
-
- var notifyAtRest = false;
- if (isAtRest) {
- this._wasAtRest = true;
- notifyAtRest = true;
- }
-
- this.notifyPositionUpdated(notifyActivate, notifyAtRest);
- },
-
- notifyPositionUpdated: function(notifyActivate, notifyAtRest) {
- for (var i = 0, len = this.listeners.length; i < len; i++) {
- var listener = this.listeners[i];
- if (notifyActivate && listener.onSpringActivate) {
- listener.onSpringActivate(this);
- }
-
- if (listener.onSpringUpdate) {
- listener.onSpringUpdate(this);
- }
-
- if (notifyAtRest && listener.onSpringAtRest) {
- listener.onSpringAtRest(this);
- }
- }
- },
-
-
- // Check if the SpringSystem should advance. Springs are advanced
- // a final frame after they reach equilibrium to ensure that the
- // currentValue is exactly the requested endValue regardless of the
- // displacement threshold.
- systemShouldAdvance: function() {
- return !this.isAtRest() || !this.wasAtRest();
- },
-
- wasAtRest: function() {
- return this._wasAtRest;
- },
-
- // Check if the Spring is atRest meaning that it's currentValue and
- // endValue are the same and that it has no velocity. The previously
- // described thresholds for speed and displacement define the bounds
- // of this equivalence check. If the Spring has 0 tension, then it will
- // be considered at rest whenever its absolute velocity drops below the
- // restSpeedThreshold.
- isAtRest: function() {
- return Math.abs(this._currentState.velocity) < this._restSpeedThreshold &&
- (this.getDisplacementDistanceForState(this._currentState) <=
- this._displacementFromRestThreshold ||
- this._springConfig.tension === 0);
- },
-
- // Force the spring to be at rest at its current position. As
- // described in the documentation for setCurrentValue, this method
- // makes it easy to do synchronous non-animated updates to ui
- // elements that are attached to springs via SpringListeners.
- setAtRest: function() {
- this._endValue = this._currentState.position;
- this._tempState.position = this._currentState.position;
- this._currentState.velocity = 0;
- return this;
- },
-
- _interpolate: function(alpha) {
- this._currentState.position = this._currentState.position *
- alpha + this._previousState.position * (1 - alpha);
- this._currentState.velocity = this._currentState.velocity *
- alpha + this._previousState.velocity * (1 - alpha);
- },
-
- getListeners: function() {
- return this.listeners;
- },
-
- addListener: function(newListener) {
- this.listeners.push(newListener);
- return this;
- },
-
- removeListener: function(listenerToRemove) {
- removeFirst(this.listeners, listenerToRemove);
- return this;
- },
-
- removeAllListeners: function() {
- this.listeners = [];
- return this;
- },
-
- currentValueIsApproximately: function(value) {
- return Math.abs(this.getCurrentValue() - value) <=
- this.getRestDisplacementThreshold();
- }
-
- });
-
- // PhysicsState
- // ------------
- // **PhysicsState** consists of a position and velocity. A Spring uses
- // this internally to keep track of its current and prior position and
- // velocity values.
- var PhysicsState = function PhysicsState() {};
-
- util.extend(PhysicsState.prototype, {
- position: 0,
- velocity: 0
- });
-
- // SpringConfig
- // ------------
- // **SpringConfig** maintains a set of tension and friction constants
- // for a Spring. You can use fromOrigamiTensionAndFriction to convert
- // values from the [Origami](http://facebook.github.io/origami/)
- // design tool directly to Rebound spring constants.
- var SpringConfig = rebound.SpringConfig =
- function SpringConfig(tension, friction) {
- this.tension = tension;
- this.friction = friction;
- };
-
- // Loopers
- // -------
- // **AnimationLooper** plays each frame of the SpringSystem on animation
- // timing loop. This is the default type of looper for a new spring system
- // as it is the most common when developing UI.
- var AnimationLooper = rebound.AnimationLooper = function AnimationLooper() {
- this.springSystem = null;
- var _this = this;
- var _run = function() {
- _this.springSystem.loop(Date.now());
- };
-
- this.run = function() {
- util.onFrame(_run);
- };
- };
-
- // **SimulationLooper** resolves the SpringSystem to a resting state in a
- // tight and blocking loop. This is useful for synchronously generating
- // pre-recorded animations that can then be played on a timing loop later.
- // Sometimes this lead to better performance to pre-record a single spring
- // curve and use it to drive many animations; however, it can make dynamic
- // response to user input a bit trickier to implement.
- rebound.SimulationLooper = function SimulationLooper(timestep) {
- this.springSystem = null;
- var time = 0;
- var running = false;
- timestep=timestep || 16.667;
-
- this.run = function() {
- if (running) {
- return;
- }
- running = true;
- while(!this.springSystem.getIsIdle()) {
- this.springSystem.loop(time+=timestep);
- }
- running = false;
- };
- };
-
- // **SteppingSimulationLooper** resolves the SpringSystem one step at a
- // time controlled by an outside loop. This is useful for testing and
- // verifying the behavior of a SpringSystem or if you want to control your own
- // timing loop for some reason e.g. slowing down or speeding up the
- // simulation.
- rebound.SteppingSimulationLooper = function(timestep) {
- this.springSystem = null;
- var time = 0;
-
- // this.run is NOOP'd here to allow control from the outside using
- // this.step.
- this.run = function(){};
-
- // Perform one step toward resolving the SpringSystem.
- this.step = function(timestep) {
- this.springSystem.loop(time+=timestep);
- };
- };
-
- // Math for converting from
- // [Origami](http://facebook.github.io/origami/) to
- // [Rebound](http://facebook.github.io/rebound).
- // You mostly don't need to worry about this, just use
- // SpringConfig.fromOrigamiTensionAndFriction(v, v);
- var OrigamiValueConverter = rebound.OrigamiValueConverter = {
- tensionFromOrigamiValue: function(oValue) {
- return (oValue - 30.0) * 3.62 + 194.0;
- },
-
- origamiValueFromTension: function(tension) {
- return (tension - 194.0) / 3.62 + 30.0;
- },
-
- frictionFromOrigamiValue: function(oValue) {
- return (oValue - 8.0) * 3.0 + 25.0;
- },
-
- origamiFromFriction: function(friction) {
- return (friction - 25.0) / 3.0 + 8.0;
- }
- };
-
- // BouncyConversion provides math for converting from Origami PopAnimation
- // config values to regular Origami tension and friction values. If you are
- // trying to replicate prototypes made with PopAnimation patches in Origami,
- // then you should create your springs with
- // SpringSystem.createSpringWithBouncinessAndSpeed, which uses this Math
- // internally to create a spring to match the provided PopAnimation
- // configuration from Origami.
- var BouncyConversion = rebound.BouncyConversion = function(bounciness, speed){
- this.bounciness = bounciness;
- this.speed = speed;
- var b = this.normalize(bounciness / 1.7, 0, 20.0);
- b = this.projectNormal(b, 0.0, 0.8);
- var s = this.normalize(speed / 1.7, 0, 20.0);
- this.bouncyTension = this.projectNormal(s, 0.5, 200)
- this.bouncyFriction = this.quadraticOutInterpolation(
- b,
- this.b3Nobounce(this.bouncyTension),
- 0.01);
- }
-
- util.extend(BouncyConversion.prototype, {
-
- normalize: function(value, startValue, endValue) {
- return (value - startValue) / (endValue - startValue);
- },
-
- projectNormal: function(n, start, end) {
- return start + (n * (end - start));
- },
-
- linearInterpolation: function(t, start, end) {
- return t * end + (1.0 - t) * start;
- },
-
- quadraticOutInterpolation: function(t, start, end) {
- return this.linearInterpolation(2*t - t*t, start, end);
- },
-
- b3Friction1: function(x) {
- return (0.0007 * Math.pow(x, 3)) -
- (0.031 * Math.pow(x, 2)) + 0.64 * x + 1.28;
- },
-
- b3Friction2: function(x) {
- return (0.000044 * Math.pow(x, 3)) -
- (0.006 * Math.pow(x, 2)) + 0.36 * x + 2.;
- },
-
- b3Friction3: function(x) {
- return (0.00000045 * Math.pow(x, 3)) -
- (0.000332 * Math.pow(x, 2)) + 0.1078 * x + 5.84;
- },
-
- b3Nobounce: function(tension) {
- var friction = 0;
- if (tension <= 18) {
- friction = this.b3Friction1(tension);
- } else if (tension > 18 && tension <= 44) {
- friction = this.b3Friction2(tension);
- } else {
- friction = this.b3Friction3(tension);
- }
- return friction;
- }
- });
-
- util.extend(SpringConfig, {
- // Convert an origami Spring tension and friction to Rebound spring
- // constants. If you are prototyping a design with Origami, this
- // makes it easy to make your springs behave exactly the same in
- // Rebound.
- fromOrigamiTensionAndFriction: function(tension, friction) {
- return new SpringConfig(
- OrigamiValueConverter.tensionFromOrigamiValue(tension),
- OrigamiValueConverter.frictionFromOrigamiValue(friction));
- },
-
- // Convert an origami PopAnimation Spring bounciness and speed to Rebound
- // spring constants. If you are using PopAnimation patches in Origami, this
- // utility will provide springs that match your prototype.
- fromBouncinessAndSpeed: function(bounciness, speed) {
- var bouncyConversion = new rebound.BouncyConversion(bounciness, speed);
- return this.fromOrigamiTensionAndFriction(
- bouncyConversion.bouncyTension,
- bouncyConversion.bouncyFriction);
- },
-
- // Create a SpringConfig with no tension or a coasting spring with some
- // amount of Friction so that it does not coast infininitely.
- coastingConfigWithOrigamiFriction: function(friction) {
- return new SpringConfig(
- 0,
- OrigamiValueConverter.frictionFromOrigamiValue(friction)
- );
- }
- });
-
- SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG =
- SpringConfig.fromOrigamiTensionAndFriction(40, 7);
-
- util.extend(SpringConfig.prototype, {friction: 0, tension: 0});
-
- // Here are a couple of function to convert colors between hex codes and RGB
- // component values. These are handy when performing color
- // tweening animations.
- var colorCache = {};
- util.hexToRGB = function(color) {
- if (colorCache[color]) {
- return colorCache[color];
- }
- color = color.replace('#', '');
- if (color.length === 3) {
- color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
- }
- var parts = color.match(/.{2}/g);
-
- var ret = {
- r: parseInt(parts[0], 16),
- g: parseInt(parts[1], 16),
- b: parseInt(parts[2], 16)
- };
-
- colorCache[color] = ret;
- return ret;
- };
-
- util.rgbToHex = function(r, g, b) {
- r = r.toString(16);
- g = g.toString(16);
- b = b.toString(16);
- r = r.length < 2 ? '0' + r : r;
- g = g.length < 2 ? '0' + g : g;
- b = b.length < 2 ? '0' + b : b;
- return '#' + r + g + b;
- };
-
- var MathUtil = rebound.MathUtil = {
- // This helper function does a linear interpolation of a value from
- // one range to another. This can be very useful for converting the
- // motion of a Spring to a range of UI property values. For example a
- // spring moving from position 0 to 1 could be interpolated to move a
- // view from pixel 300 to 350 and scale it from 0.5 to 1. The current
- // position of the `Spring` just needs to be run through this method
- // taking its input range in the _from_ parameters with the property
- // animation range in the _to_ parameters.
- mapValueInRange: function(value, fromLow, fromHigh, toLow, toHigh) {
- var fromRangeSize = fromHigh - fromLow;
- var toRangeSize = toHigh - toLow;
- var valueScale = (value - fromLow) / fromRangeSize;
- return toLow + (valueScale * toRangeSize);
- },
-
- // Interpolate two hex colors in a 0 - 1 range or optionally provide a
- // custom range with fromLow,fromHight. The output will be in hex by default
- // unless asRGB is true in which case it will be returned as an rgb string.
- interpolateColor:
- function(val, startColor, endColor, fromLow, fromHigh, asRGB) {
- fromLow = fromLow === undefined ? 0 : fromLow;
- fromHigh = fromHigh === undefined ? 1 : fromHigh;
- startColor = util.hexToRGB(startColor);
- endColor = util.hexToRGB(endColor);
- var r = Math.floor(
- util.mapValueInRange(val, fromLow, fromHigh, startColor.r, endColor.r)
- );
- var g = Math.floor(
- util.mapValueInRange(val, fromLow, fromHigh, startColor.g, endColor.g)
- );
- var b = Math.floor(
- util.mapValueInRange(val, fromLow, fromHigh, startColor.b, endColor.b)
- );
- if (asRGB) {
- return 'rgb(' + r + ',' + g + ',' + b + ')';
- } else {
- return util.rgbToHex(r, g, b);
- }
- },
-
- degreesToRadians: function(deg) {
- return (deg * Math.PI) / 180;
- },
-
- radiansToDegrees: function(rad) {
- return (rad * 180) / Math.PI;
- }
-
- }
-
- util.extend(util, MathUtil);
-
-
- // Utilities
- // ---------
- // Here are a few useful JavaScript utilities.
-
- // Lop off the first occurence of the reference in the Array.
- function removeFirst(array, item) {
- var idx = array.indexOf(item);
- idx != -1 && array.splice(idx, 1);
- }
-
- var _onFrame;
- if (typeof window !== 'undefined') {
- _onFrame = window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- function(callback) {
- window.setTimeout(callback, 1000 / 60);
- };
- }
- if (!_onFrame && typeof process !== 'undefined' && process.title === 'node') {
- _onFrame = setImmediate;
- }
-
- // Cross browser/node timer functions.
- util.onFrame = function onFrame(func) {
- return _onFrame(func);
- };
-
- // Export the public api using exports for common js or the window for
- // normal browser inclusion.
- if (true) {
- util.extend(exports, rebound);
- } else if (typeof window != 'undefined') {
- window.rebound = rebound;
- }
-})();
-
-
-// Legal Stuff
-// -----------
-/**
- * Copyright (c) 2013, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/process/browser.js"), __webpack_require__("./node_modules/timers-browserify/main.js").setImmediate))
-
-/***/ }),
-
-/***/ "./node_modules/regenerator-runtime/runtime.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(global) {/**
- * Copyright (c) 2014, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
- * additional grant of patent rights can be found in the PATENTS file in
- * the same directory.
- */
-
-!(function(global) {
- "use strict";
-
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined; // More compressible than void 0.
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
-
- var inModule = typeof module === "object";
- var runtime = global.regeneratorRuntime;
- if (runtime) {
- if (inModule) {
- // If regeneratorRuntime is defined globally and we're in a module,
- // make the exports object identical to regeneratorRuntime.
- module.exports = runtime;
- }
- // Don't bother evaluating the rest of this file if the runtime was
- // already defined globally.
- return;
- }
-
- // Define the runtime globally (as expected by generated code) as either
- // module.exports (if we're in a module) or a new, empty object.
- runtime = global.regeneratorRuntime = inModule ? module.exports : {};
-
- function wrap(innerFn, outerFn, self, tryLocsList) {
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
-
- // The ._invoke method unifies the implementations of the .next,
- // .throw, and .return methods.
- generator._invoke = makeInvokeMethod(innerFn, self, context);
-
- return generator;
- }
- runtime.wrap = wrap;
-
- // Try/catch helper to minimize deoptimizations. Returns a completion
- // record like context.tryEntries[i].completion. This interface could
- // have been (and was previously) designed to take a closure to be
- // invoked without arguments, but in all the cases we care about we
- // already have an existing method we want to call, so there's no need
- // to create a new function object. We can even get away with assuming
- // the method takes exactly one argument, since that happens to be true
- // in every case, so we don't have to touch the arguments object. The
- // only additional allocation required is the completion record, which
- // has a stable shape and so hopefully should be cheap to allocate.
- function tryCatch(fn, obj, arg) {
- try {
- return { type: "normal", arg: fn.call(obj, arg) };
- } catch (err) {
- return { type: "throw", arg: err };
- }
- }
-
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
-
- // Returning this object from the innerFn has the same effect as
- // breaking out of the dispatch switch statement.
- var ContinueSentinel = {};
-
- // Dummy constructor functions that we use as the .constructor and
- // .constructor.prototype properties for functions that return Generator
- // objects. For full spec compliance, you may wish to configure your
- // minifier not to mangle the names of these two functions.
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
-
- // This is a polyfill for %IteratorPrototype% for environments that
- // don't natively support it.
- var IteratorPrototype = {};
- IteratorPrototype[iteratorSymbol] = function () {
- return this;
- };
-
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype &&
- NativeIteratorPrototype !== Op &&
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- // This environment has a native %IteratorPrototype%; use it instead
- // of the polyfill.
- IteratorPrototype = NativeIteratorPrototype;
- }
-
- var Gp = GeneratorFunctionPrototype.prototype =
- Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
- GeneratorFunctionPrototype[toStringTagSymbol] =
- GeneratorFunction.displayName = "GeneratorFunction";
-
- // Helper for defining the .next, .throw, and .return methods of the
- // Iterator interface in terms of a single ._invoke method.
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function(method) {
- prototype[method] = function(arg) {
- return this._invoke(method, arg);
- };
- });
- }
-
- runtime.isGeneratorFunction = function(genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor
- ? ctor === GeneratorFunction ||
- // For the native GeneratorFunction constructor, the best we can
- // do is to check its .name property.
- (ctor.displayName || ctor.name) === "GeneratorFunction"
- : false;
- };
-
- runtime.mark = function(genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- if (!(toStringTagSymbol in genFun)) {
- genFun[toStringTagSymbol] = "GeneratorFunction";
- }
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
-
- // Within the body of any async function, `await x` is transformed to
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
- // meant to be awaited.
- runtime.awrap = function(arg) {
- return { __await: arg };
- };
-
- function AsyncIterator(generator) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value &&
- typeof value === "object" &&
- hasOwn.call(value, "__await")) {
- return Promise.resolve(value.__await).then(function(value) {
- invoke("next", value, resolve, reject);
- }, function(err) {
- invoke("throw", err, resolve, reject);
- });
- }
-
- return Promise.resolve(value).then(function(unwrapped) {
- // When a yielded Promise is resolved, its final value becomes
- // the .value of the Promise<{value,done}> result for the
- // current iteration. If the Promise is rejected, however, the
- // result for this iteration will be rejected with the same
- // reason. Note that rejections of yielded Promises are not
- // thrown back into the generator function, as is the case
- // when an awaited Promise is rejected. This difference in
- // behavior between yield and await is important, because it
- // allows the consumer to decide what to do with the yielded
- // rejection (swallow it and continue, manually .throw it back
- // into the generator, abandon iteration, whatever). With
- // await, by contrast, there is no opportunity to examine the
- // rejection reason outside the generator function, so the
- // only option is to throw it from the await expression, and
- // let the generator function handle the exception.
- result.value = unwrapped;
- resolve(result);
- }, reject);
- }
- }
-
- if (typeof global.process === "object" && global.process.domain) {
- invoke = global.process.domain.bind(invoke);
- }
-
- var previousPromise;
-
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new Promise(function(resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
-
- return previousPromise =
- // If enqueue has been called before, then we want to wait until
- // all previous Promises have been resolved before calling invoke,
- // so that results are always delivered in the correct order. If
- // enqueue has not been called before, then it is important to
- // call invoke immediately, without waiting on a callback to fire,
- // so that the async generator function has the opportunity to do
- // any necessary setup in a predictable way. This predictability
- // is why the Promise constructor synchronously invokes its
- // executor callback, and why async functions synchronously
- // execute code before the first await. Since we implement simple
- // async functions in terms of async generators, it is especially
- // important to get this right, even though it requires care.
- previousPromise ? previousPromise.then(
- callInvokeWithMethodAndArg,
- // Avoid propagating failures to Promises returned by later
- // invocations of the iterator.
- callInvokeWithMethodAndArg
- ) : callInvokeWithMethodAndArg();
- }
-
- // Define the unified helper method that is used to implement .next,
- // .throw, and .return (see defineIteratorMethods).
- this._invoke = enqueue;
- }
-
- defineIteratorMethods(AsyncIterator.prototype);
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
- return this;
- };
- runtime.AsyncIterator = AsyncIterator;
-
- // Note that simple async functions are implemented on top of
- // AsyncIterator objects; they just return a Promise for the value of
- // the final result produced by the iterator.
- runtime.async = function(innerFn, outerFn, self, tryLocsList) {
- var iter = new AsyncIterator(
- wrap(innerFn, outerFn, self, tryLocsList)
- );
-
- return runtime.isGeneratorFunction(outerFn)
- ? iter // If outerFn is a generator, return the full iterator.
- : iter.next().then(function(result) {
- return result.done ? result.value : iter.next();
- });
- };
-
- function makeInvokeMethod(innerFn, self, context) {
- var state = GenStateSuspendedStart;
-
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
-
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
-
- // Be forgiving, per 25.3.3.3.3 of the spec:
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
- return doneResult();
- }
-
- context.method = method;
- context.arg = arg;
-
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
- }
- }
-
- if (context.method === "next") {
- // Setting context._sent for legacy support of Babel's
- // function.sent implementation.
- context.sent = context._sent = context.arg;
-
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
-
- context.dispatchException(context.arg);
-
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
-
- state = GenStateExecuting;
-
- var record = tryCatch(innerFn, self, context);
- if (record.type === "normal") {
- // If an exception is thrown from innerFn, we leave state ===
- // GenStateExecuting and loop back for another invocation.
- state = context.done
- ? GenStateCompleted
- : GenStateSuspendedYield;
-
- if (record.arg === ContinueSentinel) {
- continue;
- }
-
- return {
- value: record.arg,
- done: context.done
- };
-
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- // Dispatch the exception by looping back around to the
- // context.dispatchException(context.arg) call above.
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
-
- // Call delegate.iterator[context.method](context.arg) and handle the
- // result, either by returning a { value, done } result from the
- // delegate iterator, or by modifying context.method and context.arg,
- // setting context.delegate to null, and returning the ContinueSentinel.
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined) {
- // A .throw or .return when the delegate iterator has no .throw
- // method always terminates the yield* loop.
- context.delegate = null;
-
- if (context.method === "throw") {
- if (delegate.iterator.return) {
- // If the delegate iterator has a return method, give it a
- // chance to clean up.
- context.method = "return";
- context.arg = undefined;
- maybeInvokeDelegate(delegate, context);
-
- if (context.method === "throw") {
- // If maybeInvokeDelegate(context) changed context.method from
- // "return" to "throw", let that override the TypeError below.
- return ContinueSentinel;
- }
- }
-
- context.method = "throw";
- context.arg = new TypeError(
- "The iterator does not provide a 'throw' method");
- }
-
- return ContinueSentinel;
- }
-
- var record = tryCatch(method, delegate.iterator, context.arg);
-
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
-
- var info = record.arg;
-
- if (! info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
-
- if (info.done) {
- // Assign the result of the finished delegate to the temporary
- // variable specified by delegate.resultName (see delegateYield).
- context[delegate.resultName] = info.value;
-
- // Resume execution at the desired location (see delegateYield).
- context.next = delegate.nextLoc;
-
- // If context.method was "throw" but the delegate handled the
- // exception, let the outer generator proceed normally. If
- // context.method was "next", forget context.arg since it has been
- // "consumed" by the delegate iterator. If context.method was
- // "return", allow the original .return call to continue in the
- // outer generator.
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined;
- }
-
- } else {
- // Re-yield the result returned by the delegate method.
- return info;
- }
-
- // The delegate iterator is finished, so forget it and continue with
- // the outer generator.
- context.delegate = null;
- return ContinueSentinel;
- }
-
- // Define Generator.prototype.{next,throw,return} in terms of the
- // unified ._invoke helper method.
- defineIteratorMethods(Gp);
-
- Gp[toStringTagSymbol] = "Generator";
-
- // A Generator should always return itself as the iterator object when the
- // @@iterator function is called on it. Some browsers' implementations of the
- // iterator prototype chain incorrectly implement this, causing the Generator
- // object to not be returned from this call. This ensures that doesn't happen.
- // See https://github.com/facebook/regenerator/issues/274 for more details.
- Gp[iteratorSymbol] = function() {
- return this;
- };
-
- Gp.toString = function() {
- return "[object Generator]";
- };
-
- function pushTryEntry(locs) {
- var entry = { tryLoc: locs[0] };
-
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
-
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
-
- this.tryEntries.push(entry);
- }
-
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
-
- function Context(tryLocsList) {
- // The root entry object (effectively a try statement without a catch
- // or a finally block) gives us a place to store values thrown from
- // locations where there is no enclosing try statement.
- this.tryEntries = [{ tryLoc: "root" }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
-
- runtime.keys = function(object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
-
- // Rather than returning an object with a next method, we keep
- // things simple and return the next function itself.
- return function next() {
- while (keys.length) {
- var key = keys.pop();
- if (key in object) {
- next.value = key;
- next.done = false;
- return next;
- }
- }
-
- // To avoid creating an additional object, we just hang the .value
- // and .done properties off the next function object itself. This
- // also ensures that the minifier will not anonymize the function.
- next.done = true;
- return next;
- };
- };
-
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
-
- if (typeof iterable.next === "function") {
- return iterable;
- }
-
- if (!isNaN(iterable.length)) {
- var i = -1, next = function next() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next.value = iterable[i];
- next.done = false;
- return next;
- }
- }
-
- next.value = undefined;
- next.done = true;
-
- return next;
- };
-
- return next.next = next;
- }
- }
-
- // Return an iterator with no values.
- return { next: doneResult };
- }
- runtime.values = values;
-
- function doneResult() {
- return { value: undefined, done: true };
- }
-
- Context.prototype = {
- constructor: Context,
-
- reset: function(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- // Resetting context._sent for legacy support of Babel's
- // function.sent implementation.
- this.sent = this._sent = undefined;
- this.done = false;
- this.delegate = null;
-
- this.method = "next";
- this.arg = undefined;
-
- this.tryEntries.forEach(resetTryEntry);
-
- if (!skipTempReset) {
- for (var name in this) {
- // Not sure about the optimal order of these conditions:
- if (name.charAt(0) === "t" &&
- hasOwn.call(this, name) &&
- !isNaN(+name.slice(1))) {
- this[name] = undefined;
- }
- }
- }
- },
-
- stop: function() {
- this.done = true;
-
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
-
- return this.rval;
- },
-
- dispatchException: function(exception) {
- if (this.done) {
- throw exception;
- }
-
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
-
- if (caught) {
- // If the dispatched exception was caught by a catch block,
- // then let that catch block handle the exception normally.
- context.method = "next";
- context.arg = undefined;
- }
-
- return !! caught;
- }
-
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
-
- if (entry.tryLoc === "root") {
- // Exception thrown outside of any try block that could handle
- // it, so set the completion value of the entire function to
- // throw the exception.
- return handle("end");
- }
-
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
-
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
-
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
-
- abrupt: function(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev &&
- hasOwn.call(entry, "finallyLoc") &&
- this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
-
- if (finallyEntry &&
- (type === "break" ||
- type === "continue") &&
- finallyEntry.tryLoc <= arg &&
- arg <= finallyEntry.finallyLoc) {
- // Ignore the finally entry if control is not jumping to a
- // location outside the try/catch block.
- finallyEntry = null;
- }
-
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
-
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
-
- return this.complete(record);
- },
-
- complete: function(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
-
- if (record.type === "break" ||
- record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
-
- return ContinueSentinel;
- },
-
- finish: function(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
-
- "catch": function(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
-
- // The context.catch method must only be called with a location
- // argument that corresponds to a known catch block.
- throw new Error("illegal catch attempt");
- },
-
- delegateYield: function(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- };
-
- if (this.method === "next") {
- // Deliberately forget the last sent value so that we don't
- // accidentally pass it on to the delegate.
- this.arg = undefined;
- }
-
- return ContinueSentinel;
- }
- };
-})(
- // Among the various tricks for obtaining a reference to the global
- // object, this seems to be the most reliable technique that does not
- // use indirect eval (which violates Content Security Policy).
- typeof global === "object" ? global :
- typeof window === "object" ? window :
- typeof self === "object" ? self : this
-);
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
-
-/***/ }),
-
-/***/ "./node_modules/setimmediate/setImmediate.js":
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
- "use strict";
-
- if (global.setImmediate) {
- return;
- }
-
- var nextHandle = 1; // Spec says greater than zero
- var tasksByHandle = {};
- var currentlyRunningATask = false;
- var doc = global.document;
- var registerImmediate;
-
- function setImmediate(callback) {
- // Callback can either be a function or a string
- if (typeof callback !== "function") {
- callback = new Function("" + callback);
- }
- // Copy function arguments
- var args = new Array(arguments.length - 1);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i + 1];
- }
- // Store and register the task
- var task = { callback: callback, args: args };
- tasksByHandle[nextHandle] = task;
- registerImmediate(nextHandle);
- return nextHandle++;
- }
-
- function clearImmediate(handle) {
- delete tasksByHandle[handle];
- }
-
- function run(task) {
- var callback = task.callback;
- var args = task.args;
- switch (args.length) {
- case 0:
- callback();
- break;
- case 1:
- callback(args[0]);
- break;
- case 2:
- callback(args[0], args[1]);
- break;
- case 3:
- callback(args[0], args[1], args[2]);
- break;
- default:
- callback.apply(undefined, args);
- break;
- }
- }
-
- function runIfPresent(handle) {
- // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
- // So if we're currently running a task, we'll need to delay this invocation.
- if (currentlyRunningATask) {
- // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
- // "too much recursion" error.
- setTimeout(runIfPresent, 0, handle);
- } else {
- var task = tasksByHandle[handle];
- if (task) {
- currentlyRunningATask = true;
- try {
- run(task);
- } finally {
- clearImmediate(handle);
- currentlyRunningATask = false;
- }
- }
- }
- }
-
- function installNextTickImplementation() {
- registerImmediate = function(handle) {
- process.nextTick(function () { runIfPresent(handle); });
- };
- }
-
- function canUsePostMessage() {
- // The test against `importScripts` prevents this implementation from being installed inside a web worker,
- // where `global.postMessage` means something completely different and can't be used for this purpose.
- if (global.postMessage && !global.importScripts) {
- var postMessageIsAsynchronous = true;
- var oldOnMessage = global.onmessage;
- global.onmessage = function() {
- postMessageIsAsynchronous = false;
- };
- global.postMessage("", "*");
- global.onmessage = oldOnMessage;
- return postMessageIsAsynchronous;
- }
- }
-
- function installPostMessageImplementation() {
- // Installs an event handler on `global` for the `message` event: see
- // * https://developer.mozilla.org/en/DOM/window.postMessage
- // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
-
- var messagePrefix = "setImmediate$" + Math.random() + "$";
- var onGlobalMessage = function(event) {
- if (event.source === global &&
- typeof event.data === "string" &&
- event.data.indexOf(messagePrefix) === 0) {
- runIfPresent(+event.data.slice(messagePrefix.length));
- }
- };
-
- if (global.addEventListener) {
- global.addEventListener("message", onGlobalMessage, false);
- } else {
- global.attachEvent("onmessage", onGlobalMessage);
- }
-
- registerImmediate = function(handle) {
- global.postMessage(messagePrefix + handle, "*");
- };
- }
-
- function installMessageChannelImplementation() {
- var channel = new MessageChannel();
- channel.port1.onmessage = function(event) {
- var handle = event.data;
- runIfPresent(handle);
- };
-
- registerImmediate = function(handle) {
- channel.port2.postMessage(handle);
- };
- }
-
- function installReadyStateChangeImplementation() {
- var html = doc.documentElement;
- registerImmediate = function(handle) {
- // Create a