text
stringlengths 1
22.8M
|
|---|
K-571 Krasnoyarsk is a nuclear-powered cruise missile submarine of the Russian Navy. It is the third boat of the project Yasen-M. Considerable changes were made to the initial Yasen design. Differences in the project have appeared sufficient to consider it as a new upgraded version Yasen-M (). The submarine is named after the city of Krasnoyarsk.
Design
The submarine project was developed in the Malachite Design Bureau in Saint Petersburg. The Russian navy declared that the submarine will be improved in comparison to , the first of the class.
Compared to the first-of-class Severodvinsk, Kazan, Novosibirsk and Krasnoyarsk are some shorter, resulting in the deletion of a sonar array from the former's bow. According to one naval analyst, the intention was likely to reduce construction costs without meaningfully reducing the submarine's capabilities. Krasnoyarsk will also include a nuclear reactor with a newly designed cooling system.
History
On 30 July 2021, Krasnoyarsk was rolled out of the construction hall and subsequently launched on the water. The submarine's future commander Captain 2nd Rank Ivan Artyushin traditionally smashed a bottle against the ship's board. In February 2022, Krasnoyarsk started the mooring trials. Sea trials started on 26 June. The submarine is expected to be commissioned in 2023.
References
Yasen-class submarines
Ships built by Sevmash
2021 ships
|
The Texas Tennis Open was a professional tennis tournament for women. After some contradictory statements, the Women's Tennis Association (WTA) made it a late addition to the 2011 WTA Tour. It was played at the Hilton Lakes Tennis & Sports Club in Grapevine (near Dallas), Texas in the United States. It was an International level event in August during the same week (the week before the US Open) as the New Haven Open at Yale. In 2013, the event was cancelled from the WTA calendar due to economic reasons.
Finals
Singles
Doubles
References
External links
Hard court tennis tournaments
Defunct tennis tournaments in the United States
Recurring sporting events established in 2011
Recurring sporting events disestablished in 2013
2011 establishments in Texas
2013 disestablishments in Texas
|
```java
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.beam.sdk.io.gcp.spanner.changestreams.restriction;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.google.cloud.Timestamp;
import org.junit.Before;
import org.junit.Test;
public class DetectNewPartitionsRangeTrackerTest {
private TimestampRange range;
private DetectNewPartitionsRangeTracker tracker;
@Before
public void setUp() throws Exception {
range = TimestampRange.of(Timestamp.ofTimeMicroseconds(10L), Timestamp.ofTimeMicroseconds(20L));
tracker = new DetectNewPartitionsRangeTracker(range);
}
@Test
public void testTryClaim() {
assertEquals(range, tracker.currentRestriction());
assertTrue(tracker.tryClaim(Timestamp.ofTimeMicroseconds(10L)));
assertTrue(tracker.tryClaim(Timestamp.ofTimeMicroseconds(10L)));
assertTrue(tracker.tryClaim(Timestamp.ofTimeMicroseconds(11L)));
assertTrue(tracker.tryClaim(Timestamp.ofTimeMicroseconds(11L)));
assertTrue(tracker.tryClaim(Timestamp.ofTimeMicroseconds(19L)));
assertFalse(tracker.tryClaim(Timestamp.ofTimeMicroseconds(20L)));
}
}
```
|
```java
package com.thealgorithms.datastructures.lists;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
public class SinglyLinkedListTest {
/**
* Initialize a list with natural order values with pre-defined length
* @param length
* @return linked list with pre-defined number of nodes
*/
private SinglyLinkedList createSampleList(int length) {
List<Node> nodeList = new ArrayList<>();
for (int i = 1; i <= length; i++) {
Node node = new Node(i);
nodeList.add(node);
}
for (int i = 0; i < length - 1; i++) {
nodeList.get(i).next = nodeList.get(i + 1);
}
return new SinglyLinkedList(nodeList.get(0), length);
}
@Test
void detectLoop() {
// List has cycle
Node firstNode = new Node(1);
Node secondNode = new Node(2);
Node thirdNode = new Node(3);
Node fourthNode = new Node(4);
firstNode.next = secondNode;
secondNode.next = thirdNode;
thirdNode.next = fourthNode;
fourthNode.next = firstNode;
SinglyLinkedList listHasLoop = new SinglyLinkedList(firstNode, 4);
assertTrue(listHasLoop.detectLoop());
SinglyLinkedList listHasNoLoop = createSampleList(5);
assertFalse(listHasNoLoop.detectLoop());
}
@Test
void middle() {
int oddNumberOfNode = 7;
SinglyLinkedList list = createSampleList(oddNumberOfNode);
assertEquals(oddNumberOfNode / 2 + 1, list.middle().value);
int evenNumberOfNode = 8;
list = createSampleList(evenNumberOfNode);
assertEquals(evenNumberOfNode / 2, list.middle().value);
// return null if empty
list = new SinglyLinkedList();
assertNull(list.middle());
// return head if there is only one node
list = createSampleList(1);
assertEquals(list.getHead(), list.middle());
}
@Test
void swap() {
SinglyLinkedList list = createSampleList(5);
assertEquals(1, list.getHead().value);
assertEquals(5, list.getNth(4));
list.swapNodes(1, 5);
assertEquals(5, list.getHead().value);
assertEquals(1, list.getNth(4));
}
@Test
void clear() {
SinglyLinkedList list = createSampleList(5);
assertEquals(5, list.size());
list.clear();
assertEquals(0, list.size());
assertTrue(list.isEmpty());
}
@Test
void search() {
SinglyLinkedList list = createSampleList(10);
assertTrue(list.search(5));
assertFalse(list.search(20));
}
@Test
void deleteNth() {
SinglyLinkedList list = createSampleList(10);
assertTrue(list.search(7));
list.deleteNth(6); // Index 6 has value 7
assertFalse(list.search(7));
}
// Test to check whether the method reverseList() works fine
@Test
void reverseList() {
// Creating a new LinkedList of size:4
// The linkedlist will be 1->2->3->4->null
SinglyLinkedList list = createSampleList(4);
// Reversing the LinkedList using reverseList() method and storing the head of the reversed
// linkedlist in a head node The reversed linkedlist will be 4->3->2->1->null
Node head = list.reverseListIter(list.getHead());
// Recording the Nodes after reversing the LinkedList
Node firstNode = head; // 4
Node secondNode = firstNode.next; // 3
Node thirdNode = secondNode.next; // 2
Node fourthNode = thirdNode.next; // 1
// Checking whether the LinkedList is reversed or not by comparing the original list and
// reversed list nodes
assertEquals(1, fourthNode.value);
assertEquals(2, thirdNode.value);
assertEquals(3, secondNode.value);
assertEquals(4, firstNode.value);
}
// Test to check whether implemented reverseList() method handles NullPointer Exception for
// TestCase where head==null
@Test
void reverseListNullPointer() {
// Creating a linkedlist with first node assigned to null
SinglyLinkedList list = new SinglyLinkedList();
Node first = list.getHead();
// Reversing the linkedlist
Node head = list.reverseListIter(first);
// checking whether the method works fine if the input is null
assertEquals(head, first);
}
// Testing reverseList() method for a linkedlist of size: 20
@Test
void reverseListTest() {
// Creating a new linkedlist
SinglyLinkedList list = createSampleList(20);
// Reversing the LinkedList using reverseList() method and storing the head of the reversed
// linkedlist in a head node
Node head = list.reverseListIter(list.getHead());
// Storing the head in a temp variable, so that we cannot loose the track of head
Node temp = head;
int i = 20; // This is for the comparison of values of nodes of the reversed linkedlist
// Checking whether the reverseList() method performed its task
while (temp != null && i > 0) {
assertEquals(i, temp.value);
temp = temp.next;
i--;
}
}
// This is Recursive Reverse List Test
// Test to check whether the method reverseListRec() works fine
void recursiveReverseList() {
// Create a linked list: 1 -> 2 -> 3 -> 4 -> 5
SinglyLinkedList list = createSampleList(5);
// Reversing the linked list using reverseList() method
Node head = list.reverseListRec(list.getHead());
// Check if the reversed list is: 5 -> 4 -> 3 -> 2 -> 1
assertEquals(5, head.value);
assertEquals(4, head.next.value);
assertEquals(3, head.next.next.value);
assertEquals(2, head.next.next.next.value);
assertEquals(1, head.next.next.next.next.value);
}
@Test
void recursiveReverseListNullPointer() {
// Create an empty linked list
SinglyLinkedList list = new SinglyLinkedList();
Node first = list.getHead();
// Reversing the empty linked list
Node head = list.reverseListRec(first);
// Check if the head remains the same (null)
assertNull(head);
}
@Test
void recursiveReverseListTest() {
// Create a linked list with values from 1 to 20
SinglyLinkedList list = createSampleList(20);
// Reversing the linked list using reverseList() method
Node head = list.reverseListRec(list.getHead());
// Check if the reversed list has the correct values
int i = 20;
Node temp = head;
while (temp != null && i > 0) {
assertEquals(i, temp.value);
temp = temp.next;
i--;
}
}
@Test
void readWithEnhancedForLoopTest() {
final var expeced = new ArrayList<Integer>(Arrays.asList(10, 20, 30));
SinglyLinkedList list = new SinglyLinkedList();
for (final var x : expeced) {
list.insert(x);
}
var readElements = new ArrayList<Integer>();
for (final var x : list) {
readElements.add(x);
}
assertEquals(readElements, expeced);
}
@Test
void toStringTest() {
SinglyLinkedList list = new SinglyLinkedList();
list.insert(1);
list.insert(2);
list.insert(3);
assertEquals("1->2->3", list.toString());
}
@Test
void toStringForEmptyListTest() {
SinglyLinkedList list = new SinglyLinkedList();
assertEquals("", list.toString());
}
@Test
void countTest() {
SinglyLinkedList list = new SinglyLinkedList();
list.insert(10);
list.insert(20);
assertEquals(2, list.count());
}
@Test
void countForEmptyListTest() {
SinglyLinkedList list = new SinglyLinkedList();
assertEquals(0, list.count());
}
}
```
|
```php
<?php
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*/
namespace Google\Service\RealTimeBidding;
class PretargetingConfig extends \Google\Collection
{
protected $collection_key = 'invalidGeoIds';
/**
* @var string[]
*/
public $allowedUserTargetingModes;
protected $appTargetingType = AppTargeting::class;
protected $appTargetingDataType = '';
/**
* @var string
*/
public $billingId;
/**
* @var string
*/
public $displayName;
/**
* @var string[]
*/
public $excludedContentLabelIds;
protected $geoTargetingType = NumericTargetingDimension::class;
protected $geoTargetingDataType = '';
protected $includedCreativeDimensionsType = CreativeDimensions::class;
protected $includedCreativeDimensionsDataType = 'array';
/**
* @var string[]
*/
public $includedEnvironments;
/**
* @var string[]
*/
public $includedFormats;
/**
* @var string[]
*/
public $includedLanguages;
/**
* @var string[]
*/
public $includedMobileOperatingSystemIds;
/**
* @var string[]
*/
public $includedPlatforms;
/**
* @var string[]
*/
public $includedUserIdTypes;
/**
* @var string
*/
public $interstitialTargeting;
/**
* @var string[]
*/
public $invalidGeoIds;
/**
* @var string
*/
public $maximumQps;
/**
* @var int
*/
public $minimumViewabilityDecile;
/**
* @var string
*/
public $name;
protected $publisherTargetingType = StringTargetingDimension::class;
protected $publisherTargetingDataType = '';
/**
* @var string
*/
public $state;
protected $userListTargetingType = NumericTargetingDimension::class;
protected $userListTargetingDataType = '';
protected $verticalTargetingType = NumericTargetingDimension::class;
protected $verticalTargetingDataType = '';
protected $webTargetingType = StringTargetingDimension::class;
protected $webTargetingDataType = '';
/**
* @param string[]
*/
public function setAllowedUserTargetingModes($allowedUserTargetingModes)
{
$this->allowedUserTargetingModes = $allowedUserTargetingModes;
}
/**
* @return string[]
*/
public function getAllowedUserTargetingModes()
{
return $this->allowedUserTargetingModes;
}
/**
* @param AppTargeting
*/
public function setAppTargeting(AppTargeting $appTargeting)
{
$this->appTargeting = $appTargeting;
}
/**
* @return AppTargeting
*/
public function getAppTargeting()
{
return $this->appTargeting;
}
/**
* @param string
*/
public function setBillingId($billingId)
{
$this->billingId = $billingId;
}
/**
* @return string
*/
public function getBillingId()
{
return $this->billingId;
}
/**
* @param string
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* @param string[]
*/
public function setExcludedContentLabelIds($excludedContentLabelIds)
{
$this->excludedContentLabelIds = $excludedContentLabelIds;
}
/**
* @return string[]
*/
public function getExcludedContentLabelIds()
{
return $this->excludedContentLabelIds;
}
/**
* @param NumericTargetingDimension
*/
public function setGeoTargeting(NumericTargetingDimension $geoTargeting)
{
$this->geoTargeting = $geoTargeting;
}
/**
* @return NumericTargetingDimension
*/
public function getGeoTargeting()
{
return $this->geoTargeting;
}
/**
* @param CreativeDimensions[]
*/
public function setIncludedCreativeDimensions($includedCreativeDimensions)
{
$this->includedCreativeDimensions = $includedCreativeDimensions;
}
/**
* @return CreativeDimensions[]
*/
public function getIncludedCreativeDimensions()
{
return $this->includedCreativeDimensions;
}
/**
* @param string[]
*/
public function setIncludedEnvironments($includedEnvironments)
{
$this->includedEnvironments = $includedEnvironments;
}
/**
* @return string[]
*/
public function getIncludedEnvironments()
{
return $this->includedEnvironments;
}
/**
* @param string[]
*/
public function setIncludedFormats($includedFormats)
{
$this->includedFormats = $includedFormats;
}
/**
* @return string[]
*/
public function getIncludedFormats()
{
return $this->includedFormats;
}
/**
* @param string[]
*/
public function setIncludedLanguages($includedLanguages)
{
$this->includedLanguages = $includedLanguages;
}
/**
* @return string[]
*/
public function getIncludedLanguages()
{
return $this->includedLanguages;
}
/**
* @param string[]
*/
public function setIncludedMobileOperatingSystemIds($includedMobileOperatingSystemIds)
{
$this->includedMobileOperatingSystemIds = $includedMobileOperatingSystemIds;
}
/**
* @return string[]
*/
public function getIncludedMobileOperatingSystemIds()
{
return $this->includedMobileOperatingSystemIds;
}
/**
* @param string[]
*/
public function setIncludedPlatforms($includedPlatforms)
{
$this->includedPlatforms = $includedPlatforms;
}
/**
* @return string[]
*/
public function getIncludedPlatforms()
{
return $this->includedPlatforms;
}
/**
* @param string[]
*/
public function setIncludedUserIdTypes($includedUserIdTypes)
{
$this->includedUserIdTypes = $includedUserIdTypes;
}
/**
* @return string[]
*/
public function getIncludedUserIdTypes()
{
return $this->includedUserIdTypes;
}
/**
* @param string
*/
public function setInterstitialTargeting($interstitialTargeting)
{
$this->interstitialTargeting = $interstitialTargeting;
}
/**
* @return string
*/
public function getInterstitialTargeting()
{
return $this->interstitialTargeting;
}
/**
* @param string[]
*/
public function setInvalidGeoIds($invalidGeoIds)
{
$this->invalidGeoIds = $invalidGeoIds;
}
/**
* @return string[]
*/
public function getInvalidGeoIds()
{
return $this->invalidGeoIds;
}
/**
* @param string
*/
public function setMaximumQps($maximumQps)
{
$this->maximumQps = $maximumQps;
}
/**
* @return string
*/
public function getMaximumQps()
{
return $this->maximumQps;
}
/**
* @param int
*/
public function setMinimumViewabilityDecile($minimumViewabilityDecile)
{
$this->minimumViewabilityDecile = $minimumViewabilityDecile;
}
/**
* @return int
*/
public function getMinimumViewabilityDecile()
{
return $this->minimumViewabilityDecile;
}
/**
* @param string
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param StringTargetingDimension
*/
public function setPublisherTargeting(StringTargetingDimension $publisherTargeting)
{
$this->publisherTargeting = $publisherTargeting;
}
/**
* @return StringTargetingDimension
*/
public function getPublisherTargeting()
{
return $this->publisherTargeting;
}
/**
* @param string
*/
public function setState($state)
{
$this->state = $state;
}
/**
* @return string
*/
public function getState()
{
return $this->state;
}
/**
* @param NumericTargetingDimension
*/
public function setUserListTargeting(NumericTargetingDimension $userListTargeting)
{
$this->userListTargeting = $userListTargeting;
}
/**
* @return NumericTargetingDimension
*/
public function getUserListTargeting()
{
return $this->userListTargeting;
}
/**
* @param NumericTargetingDimension
*/
public function setVerticalTargeting(NumericTargetingDimension $verticalTargeting)
{
$this->verticalTargeting = $verticalTargeting;
}
/**
* @return NumericTargetingDimension
*/
public function getVerticalTargeting()
{
return $this->verticalTargeting;
}
/**
* @param StringTargetingDimension
*/
public function setWebTargeting(StringTargetingDimension $webTargeting)
{
$this->webTargeting = $webTargeting;
}
/**
* @return StringTargetingDimension
*/
public function getWebTargeting()
{
return $this->webTargeting;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PretargetingConfig::class, 'Google_Service_RealTimeBidding_PretargetingConfig');
```
|
```php
<?php namespace App\Cancellation;
use App\Models\Attendee;
use App\Models\Order;
use Superbalist\Money\Money;
class OrderCancellation
{
/** @var Order $order */
private $order;
/** @var array $attendees */
private $attendees;
/** @var OrderRefund $orderRefund */
private $orderRefund;
/**
* OrderCancellation constructor.
*
* @param Order $order
* @param $attendees
*/
public function __construct(Order $order, $attendees)
{
$this->order = $order;
$this->attendees = $attendees;
}
/**
* Create a new instance to be used statically
*
* @param Order $order
* @param $attendees
* @return OrderCancellation
*/
public static function make(Order $order, $attendees): OrderCancellation
{
return new static($order, $attendees);
}
/**
* Cancels an order
*
* @throws OrderRefundException
*/
public function cancel(): void
{
$orderAwaitingPayment = false;
if ($this->order->order_status_id == config('attendize.order.awaiting_payment')) {
$orderAwaitingPayment = true;
$orderCancel = OrderCancel::make($this->order, $this->attendees);
$orderCancel->cancel();
}
// If order can do a refund then refund first
if ($this->order->canRefund() && !$orderAwaitingPayment) {
$orderRefund = OrderRefund::make($this->order, $this->attendees);
$orderRefund->refund();
$this->orderRefund = $orderRefund;
}
// TODO if no refunds can be done, mark the order as cancelled to indicate attendees are cancelled
// Cancel the attendees
$this->attendees->map(static function (Attendee $attendee) {
$attendee->is_cancelled = true;
$attendee->save();
});
}
/**
* Returns the return amount
*
* @return Money
*/
public function getRefundAmount()
{
if ($this->orderRefund === null) {
return new Money('0');
}
return $this->orderRefund->getRefundAmount();
}
}
```
|
```sqlpl
DROP TABLE IF EXISTS cool_table;
CREATE TABLE IF NOT EXISTS cool_table
(
id UInt64,
n Nested(n UInt64, lc1 LowCardinality(String))
)
ENGINE = MergeTree
ORDER BY id;
INSERT INTO cool_table SELECT number, range(number), range(number) FROM numbers(10);
ALTER TABLE cool_table ADD COLUMN IF NOT EXISTS `n.lc2` Array(LowCardinality(String));
SELECT n.lc1, n.lc2 FROM cool_table ORDER BY id;
DROP TABLE IF EXISTS cool_table;
CREATE TABLE IF NOT EXISTS cool_table
(
id UInt64,
n Nested(n UInt64, lc1 Array(LowCardinality(String)))
)
ENGINE = MergeTree
ORDER BY id;
INSERT INTO cool_table SELECT number, range(number), arrayMap(x -> range(x % 4), range(number)) FROM numbers(10);
ALTER TABLE cool_table ADD COLUMN IF NOT EXISTS `n.lc2` Array(Array(LowCardinality(String)));
SELECT n.lc1, n.lc2 FROM cool_table ORDER BY id;
DROP TABLE IF EXISTS cool_table;
CREATE TABLE IF NOT EXISTS cool_table
(
id UInt64,
n Nested(n UInt64, lc1 Map(LowCardinality(String), UInt64))
)
ENGINE = MergeTree
ORDER BY id;
INSERT INTO cool_table SELECT number, range(number), arrayMap(x -> (arrayMap(y -> 'k' || toString(y), range(x % 4)), range(x % 4))::Map(LowCardinality(String), UInt64), range(number)) FROM numbers(10);
ALTER TABLE cool_table ADD COLUMN IF NOT EXISTS `n.lc2` Array(Map(LowCardinality(String), UInt64));
SELECT n.lc1, n.lc2 FROM cool_table ORDER BY id;
DROP TABLE IF EXISTS cool_table;
```
|
```java
/*
* All Rights Reserved.
*/
package me.zhanghai.android.douya.network.api.info.frodo;
import android.os.Parcel;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class AwardCategory extends SimpleAwardCategory {
@SerializedName("results")
public ArrayList<AwardWinner> winners = new ArrayList<>();
public static final Creator<AwardCategory> CREATOR = new Creator<AwardCategory>() {
@Override
public AwardCategory createFromParcel(Parcel source) {
return new AwardCategory(source);
}
@Override
public AwardCategory[] newArray(int size) {
return new AwardCategory[size];
}
};
public AwardCategory() {}
protected AwardCategory(Parcel in) {
super(in);
winners = in.createTypedArrayList(AwardWinner.CREATOR);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeTypedList(winners);
}
}
```
|
```javascript
import { getFilterObjectPath } from "utils/rules/getFilterObjectPath";
import deleteObjectAtPath from "./deleteObjectAtPath";
const set = require("lodash/set");
const get = require("lodash/get");
export const setReactSelectValue = (
currentlySelectedRuleData,
setCurrentlySelectedRule,
pairIndex,
newValues,
targetPath,
dispatch
) => {
if (newValues === null || newValues.length === 0) {
deleteObjectAtPath(currentlySelectedRuleData, setCurrentlySelectedRule, targetPath, pairIndex, dispatch);
} else {
const copyOfCurrentlySelectedRule = JSON.parse(JSON.stringify(currentlySelectedRuleData));
const extractedValues = newValues.map((value) => value.value);
set(copyOfCurrentlySelectedRule.pairs[pairIndex], getFilterObjectPath(targetPath), extractedValues);
setCurrentlySelectedRule(dispatch, copyOfCurrentlySelectedRule, true);
}
};
export const getReactSelectValue = (currentlySelectedRuleData, pairIndex, arrayPath, allOptions) => {
const currentArray = get(currentlySelectedRuleData.pairs[pairIndex], getFilterObjectPath(arrayPath), []);
return allOptions.filter((value) => currentArray.includes(value.value));
};
```
|
Deimantė Kizalaitė (born 1 August 1999) is a Lithuanian figure skater. She qualified for the free skate at the 2014 World Junior Championships in Sofia and at the 2015 World Junior Championships in Tallinn. She is the sister of ice dancer Deividas Kizala.
Programs
Competitive highlights
CS: Challenger Series; JGP: Junior Grand Prix
References
External links
1999 births
Lithuanian female single skaters
Living people
Sportspeople from Kaunas
|
Robert S. Bevier (April 28, 1834, Painted Post, New York – February 24, 1889, Owensboro, Kentucky) was an American military officer. He was a Missouri colonel in the American Civil War and fought with the Confederate Army.
Bevier fought in the Wakarusa War against Kansas Jayhawkers in 1855. He opened a law practice in Macon, Missouri in 1858, and was a founder of Bevier, Missouri, which was laid out in 1858 and named for him.
With the coming of the Civil War, Bevier enlisted in the Confederate Missouri State Guard in 1861. He was elected Colonel of the 4th Regiment of the 3rd Division. At the Battle of Pea Ridge on March 6–8, 1862, Bevier was in command of Bevier's Missouri Infantry Battalion which fought with the Missouri State Guard on the left wing of the Confederate forces. By September 1, 1862, Bevier was Colonel of a four-company battalion which, with another battalion led by James McCown, formed the understrength 5th Regiment of Missouri Infantry. At the encampment of the Confederate Army of the West (1862) at Saltillo, Mississippi on that date, the 5th Regiment was brought up to full strength with the addition of another company and achieved regimental status. McCown was elected Colonel of the regiment with Bevier as his lieutenant.
The regiment was involved in nearly continuous combat during the war. The regiment went on to fight in the Iuka-Corinth Campaign at Iuka (September 19, 1862) and in the Second Battle of Corinth (October 3–4, 1862) and in the Vicksburg Campaign. It was captured en masse at the fall of Vicksburg although paroled soldiers were formed into a consolidated 3rd and 5th Regiment which fought until the end of the war. Robert Bevier was one of two Lieutenant Colonels in this consolidated regiment.
Bevier later wrote a war history, A History of the First and Second Missouri Confederate Brigades, published in 1879.
Works
References
Further reading
External links
1834 births
1889 deaths
People from Painted Post, New York
People of Missouri in the American Civil War
People from Macon County, Missouri
Confederate States Army officers
People from Macon, Missouri
Writers from Missouri
|
```dart
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
enum ResultFilterEnum {
all,
log,
output,
}
```
|
```python
#
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# ==============================================================================
"""Faster RCNN box coder.
Faster RCNN box coder follows the coding schema described below:
ty = (y - ya) / ha
tx = (x - xa) / wa
th = log(h / ha)
tw = log(w / wa)
where x, y, w, h denote the box's center coordinates, width and height
respectively. Similarly, xa, ya, wa, ha denote the anchor's center
coordinates, width and height. tx, ty, tw and th denote the anchor-encoded
center, width and height respectively.
See path_to_url for details.
"""
import tensorflow.compat.v1 as tf
from object_detection.core import box_coder
from object_detection.core import box_list
EPSILON = 1e-8
class FasterRcnnBoxCoder(box_coder.BoxCoder):
"""Faster RCNN box coder."""
def __init__(self, scale_factors=None):
"""Constructor for FasterRcnnBoxCoder.
Args:
scale_factors: List of 4 positive scalars to scale ty, tx, th and tw.
If set to None, does not perform scaling. For Faster RCNN,
the open-source implementation recommends using [10.0, 10.0, 5.0, 5.0].
"""
if scale_factors:
assert len(scale_factors) == 4
for scalar in scale_factors:
assert scalar > 0
self._scale_factors = scale_factors
@property
def code_size(self):
return 4
def _encode(self, boxes, anchors):
"""Encode a box collection with respect to anchor collection.
Args:
boxes: BoxList holding N boxes to be encoded.
anchors: BoxList of anchors.
Returns:
a tensor representing N anchor-encoded boxes of the format
[ty, tx, th, tw].
"""
# Convert anchors to the center coordinate representation.
ycenter_a, xcenter_a, ha, wa = anchors.get_center_coordinates_and_sizes()
ycenter, xcenter, h, w = boxes.get_center_coordinates_and_sizes()
# Avoid NaN in division and log below.
ha += EPSILON
wa += EPSILON
h += EPSILON
w += EPSILON
tx = (xcenter - xcenter_a) / wa
ty = (ycenter - ycenter_a) / ha
tw = tf.log(w / wa)
th = tf.log(h / ha)
# Scales location targets as used in paper for joint training.
if self._scale_factors:
ty *= self._scale_factors[0]
tx *= self._scale_factors[1]
th *= self._scale_factors[2]
tw *= self._scale_factors[3]
return tf.transpose(tf.stack([ty, tx, th, tw]))
def _decode(self, rel_codes, anchors):
"""Decode relative codes to boxes.
Args:
rel_codes: a tensor representing N anchor-encoded boxes.
anchors: BoxList of anchors.
Returns:
boxes: BoxList holding N bounding boxes.
"""
ycenter_a, xcenter_a, ha, wa = anchors.get_center_coordinates_and_sizes()
ty, tx, th, tw = tf.unstack(tf.transpose(rel_codes))
if self._scale_factors:
ty /= self._scale_factors[0]
tx /= self._scale_factors[1]
th /= self._scale_factors[2]
tw /= self._scale_factors[3]
w = tf.exp(tw) * wa
h = tf.exp(th) * ha
ycenter = ty * ha + ycenter_a
xcenter = tx * wa + xcenter_a
ymin = ycenter - h / 2.
xmin = xcenter - w / 2.
ymax = ycenter + h / 2.
xmax = xcenter + w / 2.
return box_list.BoxList(tf.transpose(tf.stack([ymin, xmin, ymax, xmax])))
```
|
Maryam Rashed Alzoaby() is an Emirati writer and novelist women, born in the Emirate of Ras Al Khaimah. She holds a Bachelor of Arts in the College of Humanities and Social Sciences from the United Arab Emirates University, majoring in history and archaeology, and a specialized certificate in heritage from the United Arab Emirates University and Zayed University. She is currently working as an employee in the Ministry of Culture, Youth and Community Development in the UAE.
Her first novel was published in 2009 under the title Only in Red, then she published the novel For what sin was she killed and their events take place in the Palestinian territories , where the events of the novel For what sin was she killed takes place in the Gaza City in Palestine about a Palestinian journalist trying hard to reach the truth and demanding the rights of vulnerable Palestinian refugees in the camps inside and outside Palestine, and her wish was to reach the Israeli Knesset to raise the voice of truth in it, and she would be exposed to many events and pains on her journey.
She also published two collections of short stories, the first entitled It Happened One Night and the second directed to children, entitled The Little Astronaut.
Awards
Naguib Mahfouz Award for Arabic Fiction in 2013, granted by the Supreme Council of Culture in Egypt.
Literary Activity
Writer of stories and novels in the UAE pain forums under the name "narrator" under the pseudonym (Ghinwat al-Bahar) on the Internet.
Writer of short stories in Marami magazine, which is issued by the Supreme Council for Family Affairs in Sharjah.
Writer of a satirical article in Al-Alam newspaper, which was published monthly in the UAE.
Member of the Arab Writers Union forums.
Member of the forum word tune.
Member of the Architectural Heritage Association.
Member of the UAE Women Writers Association.
Member of the Emirates Writers Union.
Literary Versions
Resources
References
Living people
21st-century Emirati writers
21st-century Emirati women writers
United Arab Emirates University alumni
People from the Emirate of Ras Al Khaimah
Year of birth missing (living people)
|
Jennifer Tietjen-Prozzo (; born July 14, 1977) is an American retired soccer player who used to play for the Philadelphia Charge.
Early life and education
Tietjen-Prozzo and her identical twin sister, Margaret, were born in 1977; they have two older brothers. The sisters played with the Cold Spring Harbor Thumpers, where they won multiple Long Island Junior Soccer League and Eastern New York Youth Soccer Association titles.
They attended Huntington High School. In 1994, the sisters were named All-Americans and Co-Players of the Year in New York and helped their team win the state title.
Following their graduation in 1995, Tietjen-Prozzo attended the University of Connecticut, receiving a Bachelor of Science in kinesiology and exercise science in 1999. She has also received a coaching diploma from the National Soccer Coaches Association of America.
Career
College soccer
While attending the University of Connecticut, Tietjen-Prozzo played for the university's soccer team. Providing 64 assists across 97 games, Tietjen-Prozzo became an assist record holder, providing 23 assists her sophomore year and 22 her junior year. In 1997, she was named the team's Most Valuable Player (MVP). The following year, she was a finalist for Soccer Buzz's Player of the Year. On three separate occasions, she was named a First Team All-Big East, All-Northeast, and All-New England honoree.
Professional career
In 1997, Tietjen-Prozzo made her debut in the USL W-League playing for the Long Island Lady Riders. She remained with the team until 2000 and served as team captain.
In 2001, Tietjen-Prozzo was drafted for the Philadelphia Charge, a Women's United Soccer Association (WUSA) team. She remained on the team until WUSA suspended operations. At the end of her first season, Tietjen-Prozzo was named team caption and remained in the position for the remainder of her tenure with the team. In 2002, she was a finalist for Defensive Player of the Year.
In 2003, she played for the Western Massachusetts Lady Pioneers, where she served as team captain.
Coaching
Tietjen-Prozzo began her career as an assistant at Central Connecticut State University prior to the 2004 season. In her tenure, the team has received numerous titles, including nine Northeast Conference Regular Season titles and eight Northeast Conference Tournament titles. She has also received personal honors, including the United Soccer Coaches Regional Coaching Staff of the Year award twice, the Northeast Conference Team Sportsmanship Award twice, and the NEWISA Division I Assistant Coach of the Year.
Personal life
Tietjen-Prozzo married Darren Prozzo in 2001. As of 2012, the couple lived in Southington, Connecticut with their two children.
Honors
In 2019, both Tietjen-Prozzo and her sister were inducted into the Long Island Soccer Player Hall of Fame.
References
1977 births
Living people
Women's association football defenders
American women's soccer players
Women's United Soccer Association players
Philadelphia Charge players
American women's soccer coaches
University of Connecticut alumni
UConn Huskies women's soccer players
|
Jorge Acosta (born May 29, 1964) is a Colombian-born American retired soccer forward. He spent most of his career in the lower U.S. divisions, as well as four in the Colombian first division. He also earned twelve caps with the U.S. national team in 1991 and 1992.
Early life
Acosta was born in Colombia, but attended Kennedy High School in Paterson, New Jersey where he played on the boys' soccer team. In two seasons, he scored sixty-three goals, including 34 as a senior. After graduating from high school in 1982, Acosta attended Long Island University.
Career
Professional
In 1988, he signed with the New Jersey Eagles of the American Soccer League (ASL). The Eagles played their home games in historic Hinchliffe Stadium. That season he led the ASL in scoring with fourteen goals, garnering All Star honors. Acosta spent two more seasons with the Eagles, his scoring declining each year. The Eagles folded at the end of the 1990 season and Acosta moved to the Albany Capitals. However, he managed only a single goal in ten games with the Capitals. The team folded at the end of the season and Acosta moved to Colombia to pursue a career there. While with the Eagles, the St. Louis Steamers of the Major Indoor Soccer League (MISL) drafted Acosta in the second round of the 1988 Player Draft. However, the Steamers folded before the season began and the league held a dispersal draft. The Dallas Sidekicks then selected Acosta. Acosta spent one season with the Sidekicks, scoring only five goals in thirty-seven games. The Sidekicks released Acosta at the end of the season and he returned to the Eagles for the 1989 ASL season. In 1991, he played for the Albany Capitals. In 1991, Acosta moved to Colombia where he joined Deportivo Cali. He played for Deportivo until 1995, when he returned to the United States and signed with the New York Fever of USISL. He played fifteen games and scored three goals that year. The MetroStars of Major League Soccer (MLS) selected Acosta in the 15th round (149th overall) of the 1996 MLS Inaugural Player Draft. However, the MetroStars waived Acosta on April 15, 1996 and he rejoined the Fever. He scored his first of five goals in the 1996 season nine days after he was released from the MetroStars.
International
Acosta earned twelve caps with the U.S. national team. His first cap came in a September 14, 1991 win over Jamaica. He became a regular with the team through the rest of 1991 and into 1992. However, he was unable to score and by the end of 1992, he was dropped from the national team.
Coaching
Since retiring from playing professionally, Acosta has held various youth athletic and soccer positions including Assistant Camp Director of the Mickey Kydes Soccer Enterprises and the program director for Rec clinics at Old Greenwich Riverside Civic Center in Connecticut.
References
External links
Sidekicks profile
Mickey Kydes Soccer Enterprises
1964 births
Colombian men's footballers
Footballers from Barranquilla
Colombian emigrants to the United States
John F. Kennedy High School (Paterson, New Jersey) alumni
Sportspeople from Paterson, New Jersey
Men's association football forwards
Albany Capitals players
A-League (1995–2004) players
Soccer players from New Jersey
American Professional Soccer League players
American Soccer League (1988–89) players
American expatriate men's soccer players
Dallas Sidekicks (original MISL) players
Deportivo Cali footballers
LIU Brooklyn Blackbirds men's soccer players
Major Indoor Soccer League (1978–1992) players
New Jersey Eagles players
New York Fever players
Penn-Jersey Spirit players
United States men's international soccer players
USL Second Division players
Living people
American men's soccer players
|
```javascript
/**
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
/* eslint-disable no-empty-function */
'use strict';
// MODULES //
var bench = require( '@stdlib/bench' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var pkg = require( './../package.json' ).name;
var isLocalhost = require( './../lib' );
// MAIN //
bench( pkg, function benchmark( b ) {
var values;
var bool;
var i;
values = [
'[::1]',
'localhost',
'127.0.0.1',
'localhost/',
'google.com',
'example.w3.org/path%20with%20spaces.html',
'example.w3.org/%20',
'ftp://ftp.is.co.za/rfc/rfc1808.txt',
'ftp://ftp.is.co.za/../../../rfc/rfc1808.txt',
'www.ietf.org/rfc/rfc2396.txt',
'ldap://[2001:db8::7]/c=GB?objectClass?one',
'mailto:John.Doe@example.com',
'news:comp.infosystems.www.servers.unix',
'tel:+1-816-555-1212',
'telnet://192.0.2.16:80/',
'urn:oasis:names:specification:docbook:dtd:xml:4.1.2',
5,
null,
void 0,
true,
NaN,
{},
[],
function noop() {},
'',
'foo',
'foo@bar',
'://foo/',
'foo',
'<foo>',
'example.w3.org/%illegal.html',
'example.w3.org/%a',
'example.w3.org/%a/foo',
'example.w3.org/%at'
];
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
bool = isLocalhost( values[ i % values.length ] );
if ( typeof bool !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
```
|
Prayers for the Damned (referred to as Prayers for the Damned, Vol. 1 on its album cover) is the fourth studio album by American rock band Sixx:A.M. It is the first half of the Prayers for the Damned/Blessed double album. It was followed by the second half, Prayers for the Blessed seven months later.
Release
In July 2015, Nikki Sixx announced that they would release two albums in 2016. On March 1, 2016, the band announced that the title of the first of these two albums would be "Prayers for the Damned" and released its lead single, "Rise". The first album was released on April 29, 2016.
Reception
Prayers for the Damned received mixed to positive reviews from critics. On Metacritic, the album holds a score of 71/100 based on 4 reviews, indicating "generally favorable reviews".
Track listing
Credits
Nikki Sixx – bass guitar, composer, backing vocals
DJ Ashba – lead guitar, composer, backing vocals
James Michael – lead vocals, keyboards, composer
Dustin Steinke – drums
Melissa Harding – backing vocals
Amber Vanbuskirk – backing vocals
Dave Donnelly – mastering
Joel Ferber – assistant engineer, music editor
Charts
References
2016 albums
Eleven Seven Label Group albums
Sixx:A.M. albums
|
```java
package com.ctrip.xpipe.concurrent;
import com.ctrip.xpipe.AbstractTest;
import com.ctrip.xpipe.api.command.CommandFuture;
import com.ctrip.xpipe.api.command.CommandFutureListener;
import com.ctrip.xpipe.command.ParallelCommandChain;
import com.ctrip.xpipe.command.TestCommand;
import com.ctrip.xpipe.utils.XpipeThreadFactory;
import org.junit.*;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author chen.zhu
* <p>
* Jan 22, 2020
*/
public class KeyedOneThreadMutexableTaskExecutorTest extends AbstractTest {
private int sleepInterval = 100;
private KeyedOneThreadMutexableTaskExecutor<String> keyed;
@Before
public void beforeKeyedOneThreadMutexableTaskExecutorTest(){
keyed = new KeyedOneThreadMutexableTaskExecutor<>(executors, scheduled);
}
@Test
public void testClearAndExecute() {
int taskNum = 100;
AtomicInteger counter = new AtomicInteger();
for (int i = 0; i < taskNum; i++) {
keyed.clearAndExecute("key" + i, new CountingCommand(counter, 10));
}
sleep(200);
Assert.assertEquals(taskNum, counter.get());
}
@Test
@Ignore
public void testHang() throws TimeoutException, IOException {
int threadCount = 10;
int taskCount = threadCount;
ExecutorService executorService = null;
try{
executorService = Executors.newFixedThreadPool(threadCount, XpipeThreadFactory.create("test-hang"));
keyed = new KeyedOneThreadMutexableTaskExecutor<>(executorService, scheduled);
AtomicInteger completeCount = new AtomicInteger();
for(int i=0; i<taskCount ;i++){
int finalI = i;
ParallelCommandChain parallelCommandChain = new ParallelCommandChain(executorService);
parallelCommandChain.add(new TestCommand("success:" + i, sleepInterval));
parallelCommandChain.future().addListener(new CommandFutureListener<Object>() {
@Override
public void operationComplete(CommandFuture<Object> commandFuture) throws Exception {
logger.info("[operationComplete]{}", finalI);
completeCount.incrementAndGet();
}
});
keyed.execute(String.valueOf(i), parallelCommandChain);
}
waitConditionUntilTimeOut(() -> completeCount.get() == taskCount);
}finally {
executorService.shutdownNow();
}
}
@Test
@Ignore
public void testSameKey(){
BlockingCommand command1 = new BlockingCommand(sleepInterval);
BlockingCommand command2 = new BlockingCommand(sleepInterval);
keyed.execute("key1", command1);
keyed.execute("key1", command2);
sleep(sleepInterval/2);
Assert.assertTrue(command1.isProcessing());
Assert.assertFalse(command2.isProcessing());
}
@Test
@Ignore
public void testDifferentKey(){
BlockingCommand command1 = new BlockingCommand(sleepInterval);
BlockingCommand command2 = new BlockingCommand(sleepInterval);
keyed.execute("key1", command1);
keyed.execute("key2", command2);
sleep(sleepInterval/2);
Assert.assertTrue(command1.isProcessing());
Assert.assertTrue(command2.isProcessing());
}
@After
public void afterKeyedOneThreadTaskExecutorTest() throws Exception{
keyed.destroy();
}
}
```
|
```handlebars
{{layout/logo-heading
title=(localize 'search')
desc=(localize 'admin_search_explain')
icon=constants.Icon.Search}}
{{customize/search-index searchStatus=model reindex=(action "reindex")}}
```
|
```java
/*******************************************************************************
*
* All rights reserved. This program and the accompanying materials
*
* path_to_url
* path_to_url
*/
package org.eclipse.paho.android.sample.activity;
import android.util.Log;
import org.eclipse.paho.android.service.MqttTraceHandler;
class MqttTraceCallback implements MqttTraceHandler {
public void traceDebug(java.lang.String arg0, java.lang.String arg1) {
Log.i(arg0, arg1);
}
public void traceError(java.lang.String arg0, java.lang.String arg1) {
Log.e(arg0, arg1);
}
public void traceException(java.lang.String arg0, java.lang.String arg1,
java.lang.Exception arg2) {
Log.e(arg0, arg1, arg2);
}
}
```
|
Kalaikunda railway station is a railway station on Howrah–Nagpur–Mumbai line under Kharagpur railway division of South Eastern Railway zone. It is situated at Kharagpur in Paschim Medinipur district in the Indian state of West Bengal. It is from Kharagpur Junction.
References
Railway stations in Paschim Medinipur district
Kharagpur railway division
|
```python
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import numpy as np
# Weird imports / assignment because the normal import syntax doesn't work for tf.keras in tf 1.8
from tensorflow import keras
# pylint:disable=wrong-import-position
Sequential = keras.models.Sequential
Dense = keras.layers.Dense
Activation = keras.layers.Activation
from cleverhans.utils_keras import KerasModelWrapper
class TestKerasModelWrapper(unittest.TestCase):
def setUp(self):
import tensorflow as tf
def dummy_model():
input_shape = (100,)
return Sequential(
[
Dense(20, name="l1", input_shape=input_shape),
Dense(10, name="l2"),
Activation("softmax", name="softmax"),
]
)
self.sess = tf.Session()
self.sess.as_default()
self.model = dummy_model()
def test_softmax_layer_name_is_softmax(self):
model = KerasModelWrapper(self.model)
softmax_name = model._get_softmax_name()
self.assertEqual(softmax_name, "softmax")
def test_logit_layer_name_is_logits(self):
model = KerasModelWrapper(self.model)
logits_name = model._get_logits_name()
self.assertEqual(logits_name, "l2")
def test_get_logits(self):
import tensorflow as tf
model = KerasModelWrapper(self.model)
x = tf.placeholder(tf.float32, shape=(None, 100))
preds = model.get_probs(x)
logits = model.get_logits(x)
x_val = np.random.rand(2, 100)
tf.global_variables_initializer().run(session=self.sess)
p_val, logits = self.sess.run([preds, logits], feed_dict={x: x_val})
p_gt = np.exp(logits) / np.sum(np.exp(logits), axis=1, keepdims=True)
self.assertTrue(np.allclose(p_val, p_gt, atol=1e-6))
def test_get_probs(self):
import tensorflow as tf
model = KerasModelWrapper(self.model)
x = tf.placeholder(tf.float32, shape=(None, 100))
preds = model.get_probs(x)
x_val = np.random.rand(2, 100)
tf.global_variables_initializer().run(session=self.sess)
p_val = self.sess.run(preds, feed_dict={x: x_val})
self.assertTrue(np.allclose(np.sum(p_val, axis=1), 1, atol=1e-6))
self.assertTrue(np.all(p_val >= 0))
self.assertTrue(np.all(p_val <= 1))
def test_get_layer_names(self):
model = KerasModelWrapper(self.model)
layer_names = model.get_layer_names()
self.assertEqual(layer_names, ["l1", "l2", "softmax"])
def test_fprop(self):
import tensorflow as tf
model = KerasModelWrapper(self.model)
x = tf.placeholder(tf.float32, shape=(None, 100))
out_dict = model.fprop(x)
self.assertEqual(set(out_dict.keys()), set(["l1", "l2", "softmax"]))
# Test the dimension of the hidden represetation
self.assertEqual(int(out_dict["l1"].shape[1]), 20)
self.assertEqual(int(out_dict["l2"].shape[1]), 10)
# Test the caching
x2 = tf.placeholder(tf.float32, shape=(None, 100))
out_dict2 = model.fprop(x2)
self.assertEqual(set(out_dict2.keys()), set(["l1", "l2", "softmax"]))
self.assertEqual(int(out_dict2["l1"].shape[1]), 20)
if __name__ == "__main__":
unittest.main()
```
|
Mallosia nonnigra is a species of beetle in the family Cerambycidae. It was described by Hüseyin Özdikmen and Fatih Aytar in 2012. It is known from Turkey.
This species was described based on a single specimen from Erdemli. The holotype is a female that has a body length of .
References
Saperdini
Beetles of Asia
Endemic fauna of Turkey
Beetles described in 2012
|
The Haunted Pampero is a collection of fantasy and other short stories by William Hope Hodgson. It was first published in 1992 by Donald M. Grant, Publisher, Inc. in an edition of 500 copies, all of which were signed by the editor, Sam Moskowitz. The stories first appeared in the magazines The Premier Magazine, The Red Magazine, Cornhill Magazine, The Idler, Shadow: Fantasy Literature Review, The Royal Magazine, The Blue Magazine, Sea Stories, The New Age, Everybody’s Weekly and Short Stories.
Contents
Preface, by Sam Moskowitz
"The Posthumous Acceptance of William Hope Hodgson 1918-1943", by Sam Moskowitz
"The Haunted 'Pampero'"
"The Ghosts of the 'Glen Doon'"
"The Valley of the Lost Children"
"Carnacki, The Ghost Finder: The House Among the Laurels"
"The Silent Ship"
"The Goddess of Death"
"A Timely Escape"
"The Wild Man of the Sea"
"Date 1965: Modern Warfare"
"Bullion"
"Old Golly"
"The Storm"
References
1992 short story collections
Fantasy short story collections
Short story collections by William Hope Hodgson
Donald M. Grant, Publisher books
|
```asciidoc
include::variables.adoc[]
= Choosing the ISO Image
:icons:
:toc: macro
:toc-title:
:toclevels: 1
toc::[]
[[choosing-iso-image-overview]]
== Overview
When you start {project}, it downloads a live ISO image that the hypervisor uses to provision the {project} VM.
By default, {project} uses the link:path_to_url{project} CentOS ISO image].
This ISO image is based on link:path_to_url an enterprise-ready Linux distribution that resembles a production environment.
[NOTE]
====
You cannot run the same {project} instance with different ISO images concurrently.
To switch between ISO images, delete the {project} instance and start a new instance with the ISO image that you want to use.
====
[[choosing-iso-image-using-remote-image]]
== Using a Remote ISO Image
To use a remotely available ISO image, specify the URL of the {project} ISO image during `minishift start` using the `--iso-url` flag:
[subs="+attributes"]
----
$ minishift start --iso-url path_to_url{centos-iso-version}/minishift-centos7.iso
----
[[choosing-iso-image-using-local-image]]
== Using a Local ISO Image
To use a locally available ISO image, follow these steps:
. Manually download the {project} CentOS ISO image from the link:path_to_url CentOS ISO releases page].
. Specify the file URI to the image during `minishift start` using the `--iso-url` flag.
The path given for a file URI must be an absolute path.
On Linux or macOS, the path must begin with *_/_*.
For example:
----
$ minishift start --iso-url file:///path/to/image.iso
----
On Windows, the path must begin with a drive letter such as *_C:_*.
For example:
----
C:\> minishift.exe start --iso-url file://d:/path/to/image.iso
----
```
|
```racket
#lang curly-fn racket/base
(require racket/require hackett/private/util/require hackett/private/type-reqprov
(for-syntax (multi-in racket [base contract string format list match syntax])
(multi-in syntax/parse [class/local-value class/paren-shape
experimental/template])
syntax/apply-transformer
threading
hackett/private/expand+elaborate
hackett/private/infix
hackett/private/prop-case-pattern-expander
hackett/private/util/list
hackett/private/util/stx)
(postfix-in - (multi-in racket [base match promise splicing]))
syntax/parse/define
(except-in hackett/private/base @%app)
(only-in hackett/private/class class-id derive-instance)
(only-in hackett/private/kernel [ plain-])
(only-in (unmangle-types-in #:no-introduce (only-types-in hackett/private/kernel))
forall [#%app @%app]))
(provide (for-syntax type-constructor-spec data-constructor-spec
type-constructor-val data-constructor-val
data-constructor-field-types)
(rename-out [ lambda] [* lambda*])
data case* case * defn _)
(begin-for-syntax
(provide (contract-out [struct type-constructor ([type type?]
[arity exact-nonnegative-integer?]
[data-constructors (listof identifier?)]
[fixity (or/c operator-fixity? #f)])]
[struct data-constructor ([macro procedure?]
[type type?]
[make-match-pat procedure?]
[fixity (or/c operator-fixity? #f)])])))
(begin-for-syntax
(define-splicing-syntax-class type-constructor-spec
#:attributes [tag [arg 1] len nullary? fixity]
#:commit
#:description #f
[pattern {~seq tag:id {~optional :fixity-annotation}}
#:attr [arg 1] '()
#:attr len 0
#:attr nullary? #t]
[pattern {~seq (~parens tag:id arg:id ...+) {~optional :fixity-annotation}}
#:attr len (length (attribute arg))
#:attr nullary? #f]
[pattern {~seq {~braces a:id tag:id b:id} {~optional :fixity-annotation}}
#:with [arg ...] #'[a b]
#:attr len 2
#:attr nullary? #f]
[pattern {~and (tag:id)
{~fail (~a "types without arguments should not be enclosed in parentheses; perhaps"
" you meant " (syntax-e #'tag) "?")}}
#:attr [arg 1] #f
#:attr len #f
#:attr nullary? #f
#:attr fixity #f])
(define-splicing-syntax-class data-constructor-spec
#:attributes [tag [arg 1] len nullary? fixity]
#:commit
#:description #f
[pattern {~seq tag:id {~optional :fixity-annotation}}
#:attr [arg 1] '()
#:attr len 0
#:attr nullary? #t]
[pattern {~seq (~parens tag:id arg ...+) {~optional :fixity-annotation}}
#:attr len (length (attribute arg))
#:attr nullary? #f]
[pattern {~seq {~braces a tag:id b} {~optional :fixity-annotation}}
#:with [arg ...] #'[a b]
#:attr len 2
#:attr nullary? #f]
[pattern {~and (tag:id)
{~fail (~a "data constructors without arguments should not be enclosed in "
"parentheses; perhaps you meant " (syntax-e #'tag) "?")}}
#:attr [arg 1] #f
#:attr len #f
#:attr nullary? #f
#:attr fixity #f])
(struct type-constructor (type arity data-constructors fixity)
#:transparent
#:property prop:procedure
( (ctor stx) ((make-variable-like-transformer (type-constructor-type ctor)) stx))
#:property prop:infix-operator ( (ctor) (type-constructor-fixity ctor)))
(struct data-constructor (macro type make-match-pat fixity)
#:transparent
#:property prop:procedure (struct-field-index macro)
#:property prop:infix-operator ( (ctor) (data-constructor-fixity ctor)))
(define-syntax-class type-constructor-val
#:attributes [local-value type arity data-constructors fixity]
#:commit
#:description #f
[pattern
{~var || (local-value type-constructor? #:failure-message "not bound as a type constructor")}
#:attr type (type-constructor-type (attribute local-value))
#:attr arity (type-constructor-arity (attribute local-value))
#:attr data-constructors (type-constructor-data-constructors (attribute local-value))
#:attr fixity (type-constructor-fixity (attribute local-value))])
(define-syntax-class data-constructor-val
#:attributes [local-value macro type make-match-pat fixity]
#:commit
#:description #f
[pattern
{~var || (local-value data-constructor? #:failure-message "not bound as a data constructor")}
#:attr macro (data-constructor-macro (attribute local-value))
#:attr type (data-constructor-type (attribute local-value))
#:attr make-match-pat (data-constructor-make-match-pat (attribute local-value))
#:attr fixity (data-constructor-fixity (attribute local-value))])
; Given a curried function type, produce a list of uncurried arguments and the result type. If the
; function is quantified, the type will be instantiated with fresh solver variables.
;
; Example:
; > (function-type-args/result ( a (-> a (-> B (C a)))))
; (list a^ B)
; (C a^)
(define/contract function-type-args/result!
(-> type? (values (listof type?) type?))
(syntax-parser
#:context 'function-type-args/result!
#:literal-sets [type-literals]
[(~#%type:forall* [x ...] (~->* t ... r))
#:with [x^ ...] (generate-temporaries (attribute x))
#:do [(define inst-map (map cons (attribute x) (syntax->list #'[(#%type:wobbly-var x^) ...])))]
(values (map #{insts % inst-map} (attribute t))
(insts #'r inst-map))]))
(define/contract function-type-arity
(-> type? exact-integer?)
(syntax-parser
#:context 'function-type-arity
#:literal-sets [type-literals]
[(~#%type:forall* _ (~->* t ...))
(sub1 (length (attribute t)))]))
(define/contract (data-constructor-args/result! ctor)
(-> data-constructor? (values (listof type?) type?))
(function-type-args/result! (data-constructor-type ctor)))
(define/contract (data-constructor-arity ctor)
(-> data-constructor? exact-integer?)
(function-type-arity (data-constructor-type ctor)))
(define/contract (data-constructor-all-tags ctor)
(-> data-constructor? (listof identifier?))
(let ([t (data-constructor-type ctor)])
(syntax-parse (data-constructor-type ctor)
#:context 'data-constructor-all-tags
#:literal-sets [type-literals]
[(~#%type:forall* _ (~->* _ ... (~#%type:app* (#%type:con type-id) _ ...)))
(type-constructor-data-constructors (syntax-local-value #'type-id))])))
; Given the type of a data constructor, returns the types of its fields, where all type variables
; are instantiated using the provided list of replacement types. Order of instantiation is
; consistent with the order of type arguments to the type constructor, so when fetching the fields
; for (Tuple a b), the first element of inst-tys will be used for a, and the second will be used
; for b. If the number of supplied replacement types is inconsistent with the number of arguments to
; the type constructor, a contract violation is raised.
;
; Example:
; > (data-constructor-field-types (list x^ y^)
; (forall [b a] {a -> Integer -> (Maybe b) -> (Foo a b)}))
; (list x^ Integer (Maybe y^))
;
; While the data constructor type must be a fully-expanded type, the replacement types do not
; strictly need to be; they may be arbitrary syntax objects, in which case they will be left
; unexpanded in the result.
(define/contract (data-constructor-field-types inst-tys con-ty)
(-> (listof type?) type? (listof type?))
(define/syntax-parse {~#%type:forall* [x ...] t_fn} con-ty)
(define/syntax-parse
{~->* t_arg ... {~#%type:app* ({~literal #%type:con} _) con-var:id ...}}
#'t_fn)
(unless (equal? (length (attribute x)) (length (attribute con-var)))
(raise-arguments-error 'data-constructor-field-types
"unexpected number of quantified variables in constructor"
"quantified" (length (attribute x))
"constructor" (length (attribute con-var))))
(unless (equal? (length (attribute con-var)) (length inst-tys))
(raise-arguments-error 'data-constructor-field-types
(format "too ~a variables given for instantiation"
(if (> (length (attribute con-var)) (length inst-tys))
"few" "many"))
"expected" (length (attribute con-var))
"given" (length inst-tys)))
(define var-subst (map cons (attribute con-var) inst-tys))
(map #{insts % var-subst} (attribute t_arg)))
(struct pat-base (stx) #:transparent)
(struct pat-var pat-base (id) #:transparent)
(struct pat-hole pat-base () #:transparent)
(struct pat-con pat-base (constructor) #:transparent)
(struct pat-app pat-base (head pats) #:transparent)
(struct pat-str pat-base (str) #:transparent)
(struct pat-int pat-base (int) #:transparent)
(define pat? pat-base?)
(define-syntax-class pat
#:description "a pattern"
#:attributes [pat disappeared-uses]
#:commit
[pattern {~and pat-exp
{~or pat-id (pat-id . _)}}
#:declare pat-id (local-value case-pattern-expander?)
#:do [(define trans
(case-pattern-expander-transformer (attribute pat-id.local-value)))]
#:with p:pat (local-apply-transformer trans #'pat-exp 'expression)
#:attr pat (attribute p.pat)
#:attr disappeared-uses (cons (syntax-local-introduce #'pat-id)
(attribute p.disappeared-uses))]
[pattern {~and constructor:data-constructor-val ~!}
#:do [(define val (attribute constructor.local-value))]
#:attr pat (pat-con #'constructor val)
#:attr disappeared-uses (list (syntax-local-introduce #'constructor))]
[pattern (~parens head:pat ~! arg:pat ...)
#:attr pat (pat-app this-syntax
(attribute head.pat)
(attribute arg.pat))
#:attr disappeared-uses (append (attribute head.disappeared-uses)
(append* (attribute arg.disappeared-uses)))]
[pattern {~braces a:pat constructor:data-constructor-val b:pat}
#:do [(define val (attribute constructor.local-value))
(define arity (data-constructor-arity val))]
#:fail-when (zero? arity)
(~a "cannot match " (syntax-e #'constructor) " infix; it is a value "
"and should matched as a bare identifier")
#:fail-when (not (= arity 2))
(~a "cannot match " (syntax-e #'constructor) " infix; it has arity "
arity ", but constructors matched infix must have arity 2")
#:attr pat (pat-app this-syntax
(pat-con #'constructor val)
(list (attribute a.pat) (attribute b.pat)))
#:attr disappeared-uses (cons (syntax-local-introduce #'constructor)
(append (attribute a.disappeared-uses)
(attribute b.disappeared-uses)))]
[pattern {~braces a:pat ctor:data-constructor-val b:pat
{~seq ctors:data-constructor-val bs:expr} ...}
#:when (eq? 'left (data-constructor-fixity (attribute ctor.local-value)))
#:with ~! #f
#:fail-unless (andmap #{eq? % 'left}
(map data-constructor-fixity (attribute ctors.local-value)))
(~a "cannot mix left- and right-associative operators in the same infix "
"pattern")
#:with :pat (template {{a ctor b} {?@ ctors bs} ...})]
[pattern {~braces {~seq as:expr ctors:data-constructor-val} ...
a:pat ctor:data-constructor-val b:pat}
#:when (eq? 'right (data-constructor-fixity (attribute ctor.local-value)))
#:and ~!
#:fail-unless (andmap #{eq? % 'right}
(map data-constructor-fixity (attribute ctors.local-value)))
(~a "cannot mix left- and right-associative operators in the same infix "
"pattern")
#:with :pat (template {{?@ as ctors} ... {a ctor b}})]
[pattern {~literal _}
#:attr pat (pat-hole this-syntax)
#:attr disappeared-uses (list (syntax-local-introduce this-syntax))]
[pattern id:id
#:attr pat (pat-var this-syntax #'id)
#:attr disappeared-uses '()]
[pattern str:str
#:attr pat (pat-str this-syntax #'str)
#:attr disappeared-uses '()]
[pattern int:integer
#:attr pat (pat-int this-syntax #'int)
#:attr disappeared-uses '()])
(define/contract (pat! pat)
(-> pat?
(values type? ; the inferred type the pattern matches against;
(listof (cons/c identifier? type?)))) ; the types of bindings produced by the pattern
(match pat
[(pat-var _ id)
(let ([a^ (generate-temporary)])
(values #`(#%type:wobbly-var #,a^) (list (cons id #`(#%type:wobbly-var #,a^)))))]
[(pat-hole _)
(let ([a^ (generate-temporary)])
(values #`(#%type:wobbly-var #,a^) '()))]
[(pat-str _ str)
(values (expand-type #'String) '())]
[(pat-int _ int)
(values (expand-type #'Integer) '())]
[(pat-con stx con)
(define arity (data-constructor-arity con))
(unless (zero? arity)
(raise-syntax-error #f
(~a "cannot match " (syntax-e stx) " as a value; it is a "
"constructor with arity " arity)
stx))
(pat! (pat-app stx pat '()))]
[(pat-app stx (pat-con cstx con) pats)
(define arity (data-constructor-arity con))
(when {(length pats) . < . arity}
(raise-syntax-error #f
(~a "not enough arguments provided for constructor "
(syntax-e cstx) ", which has arity " arity)
stx))
(when {(length pats) . > . arity}
(raise-syntax-error #f
(~a "too many arguments provided for constructor "
(syntax-e cstx) ", which has arity " arity)
stx))
(let*-values ([(s_args _result) (data-constructor-args/result! con)]
[(assumps) (pats! pats s_args)])
(values _result assumps))]
[(pat-app outer-stx (pat-base inner-stx) _)
(raise-syntax-error #f "expected a constructor" outer-stx inner-stx)]))
(define/contract (pat! pat t)
(-> pat? type? (listof (cons/c identifier? type?)))
(let-values ([(t_ assumps) (pat! pat)])
(type<:! t t_ #:src (pat-base-stx pat))
assumps))
(define/contract (pats! pats)
(-> (listof pat?) (values (listof type?) (listof (cons/c identifier? type?))))
(define-values [ts assumps]
(for/lists [ts assumps]
([pat (in-list pats)])
(pat! pat)))
(values ts (append* assumps)))
(define/contract (pats! pats ts)
(-> (listof pat?) (listof type?) (listof (cons/c identifier? type?)))
(append* (for/list ([pat (in-list pats)]
[t (in-list ts)])
(pat! pat t))))
; Given a pattern, returns a function that produces a racket/match pattern given a list of binding
; identifiers. The input to this function may provide more identifiers than the pattern actually
; binds, and any leftover identifiers will be returned as the second value.
;
; The order in which identifiers are consumed by the produced function must agree with the order
; in which they are returned from pat! and pat!.
(define/contract (pat->mk-match-pat pat)
(-> pat? (-> (listof identifier?) (values syntax? (listof identifier?))))
(match pat
[(pat-var _ _)
(match-lambda [(cons id rest) (values id rest)])]
[(pat-hole _)
#{values #'_ %}]
[(pat-str _ str)
#{values #`(app force- #,str) %}]
[(pat-int _ int)
#{values #`(app force- #,int) %}]
[(pat-con stx con)
(pat->mk-match-pat (pat-app stx pat '()))]
[(pat-app stx (pat-con cstx con) pats)
(let ([mk-pats (combine-pattern-constructors (map pat->mk-match-pat pats))])
( (ids) (let-values ([(match-pats rest) (mk-pats ids)])
(values ((data-constructor-make-match-pat con) match-pats) rest))))]))
; Combines a list of racket/match pattern constructors to properly run them against a list of
; identifiers in sequence, then combine the results into a list of patterns. Used by
; pat->mk-match-pat.
(define/contract (combine-pattern-constructors mk-pats)
(-> (listof (-> (listof identifier?) (values syntax? (listof identifier?))))
(-> (listof identifier?) (values (listof syntax?) (listof identifier?))))
( (ids) (for/fold ([match-pats '()]
[rest ids]
#:result (values (reverse match-pats) rest))
([mk-pat (in-list mk-pats)])
(let-values ([(match-pat rest*) (mk-pat rest)])
(values (cons match-pat match-pats) rest*)))))
;; your_sha256_hash---------------------------------
;; Exhaustiveness checking
(struct ideal-con (ctor-tag args))
; An ideal pattern represents unmatched patterns, used by the exhaustiveness checker.
; Specifically, the current set of ideals represents the minimal set of patterns that would cover
; all uncovered cases without covering covered ones. As the exhaustiveness checker runs, it consults
; user provided patterns, and adjusts the set of ideals accordingly: it eliminates covered ideals
; and splits partially-covered ideals into more specific ones.
;
; An ideal pattern can be a variable, which corresponds to a pat-var or pat-hole (that is, it
; matches anything), or a constructor, which contains sub-ideals for each argument to the
; constructor.
(define ideal?
(or/c symbol? ; ideal variable
ideal-con?)) ; ideal for specific constructor
; Creates a list of n fresh ideal variables.
(define (generate-fresh-ideals n)
(build-list n ( (_) (gensym))))
; Returns a pretty representation of ideal. Uses syntax-e to turn constructor tags into strings,
; and replaces symbols with _.
(define (ideal->string q)
(define ideal->datum
(match-lambda
[(? symbol?)
'_]
[(ideal-con ctor-tag '())
(syntax-e ctor-tag)]
[(ideal-con ctor-tag qs)
(cons (syntax-e ctor-tag)
(map ideal->datum qs))]))
(format "~a" (ideal->datum q)))
; Generates a new ideal-con from a data constructors tag identifier
(define (constructor-tag->ideal-con ctor-tag)
(define arity (data-constructor-arity (syntax-local-value ctor-tag)))
(ideal-con ctor-tag (generate-fresh-ideals arity)))
; Returns a substition function f for the given ideal q such that (f r) is just like q, except that
; all occurences of x are replaced by r.
(define (ideal->subst-fn q x)
(match q
[(== x eq?)
( (r) r)]
[(ideal-con ctor qs)
(let ([fns (map #{ideal->subst-fn % x} qs)])
( (r) (ideal-con ctor (map #{% r} fns))))]
[_
( (r) q)]))
; Substitutes occurences of symbol x with each ideal in rs, for each ideal in qs.
;
; e.g.
; (subs 'A '(B C) (list 'D (con "*" 'A)))
; =
; (list (list 'D (con "*" 'B))
; (list 'D (con "*" 'C)))
(define (substitute-ideals x rs qs)
(let ([subst-fns (map #{ideal->subst-fn % x} qs)])
(for/list ([r (in-list rs)])
(for/list ([fn (in-list subst-fns)])
(fn r)))))
(define current-exhaust-split-handler
(make-parameter #f))
; Checks if the ideals are covered by the patterns. Returns #t if the ideals are fully covered, #f
; if some ideals are left uncovered, or a pair of a symbol and its replacements if it needs to be
; split.
(define (check-ideals ideals pats)
(for/fold ([acc #t])
([p (in-list pats)]
[q (in-list ideals)])
#:break (not (eq? #t acc))
(match p
; The ideal is always satisfied when we hit a wildcard pattern, such as a variable or a hole,
; since they match everything.
[(pat-var _ _) #t]
[(pat-hole _) #t]
; When we hit a constructor pattern, we check the ideal. If it is a constructor, compare the
; tags and then recur for the sub-patterns. If it is a variable, then split the ideal into new
; ideals for each kind of constructor.
[(or (pat-app _ (pat-con _ ctor) sub-pats)
(and (pat-con _ ctor) (app ( (x) '()) sub-pats)))
(match q
[(ideal-con ctor-tag sub-ideals)
(and (eq? (syntax-local-value ctor-tag) ctor)
(check-ideals sub-ideals sub-pats))]
[(? symbol? x)
(let ([split-into (map constructor-tag->ideal-con (data-constructor-all-tags ctor))])
(cons x split-into))])]
; TODO: better exhaustiveness checking on strings. OCaml checks for the strings "*", "**",
; "***" etc. It would be fairly easy to do the same using splitting.
[(pat-str _ s) #f]
[(pat-int _ i) #f])))
; Checks if patterns are exhaustive or not. Given a list of pattern-lists, returns #f if no
; un-matched patterns are found. Otherwise, returns an example of an un-matched pattern-list.
(define/contract (check-exhaustiveness patss pat-count)
(-> (listof (listof pat?))
exact-nonnegative-integer?
(or/c #f (listof ideal?)))
; Initially, use a fresh ideal variable for each pattern.
(let check ([idealss (list (generate-fresh-ideals pat-count))])
(match idealss
; No more ideals to check; #f signals that the pattern is exhaustive.
['() #f]
; Check if the most recent ideal is exhaustive, or if it split into more ideals.
[(cons ideals rest-idealss)
(match (for/or ([pats (in-list patss)])
(check-ideals ideals pats))
[#t
(check rest-idealss)]
; Non-exhaustive! return un-matched ideals.
[#f
ideals]
; In case of split, substitute and append.
[(cons x rs)
(let ([new-idealss (substitute-ideals x rs ideals)])
(check (append new-idealss rest-idealss)))])]))))
(define-syntax-parser define-data-constructor
[(_ [:type-constructor-spec] [constructor:data-constructor-spec])
#:with tag- (generate-temporary #'constructor.tag)
#:with tag-/curried (generate-temporary #'constructor.tag)
; calculate the result type of the data constructor, after being applied to args (if any)
#:with _result (if (attribute .nullary?) #'.tag #'(@%app .tag .arg ...))
; calculate the type of the underlying constructor, with arguments, unquantified
#:with _con_unquantified (foldr #{begin #`(@%app -> #,%1 #,%2)}
#'_result
(map type-namespace-introduce (attribute constructor.arg)))
; quantify the type using the type variables in , then evaluate the type
#:with _con:type #'(forall [.arg ...] _con_unquantified)
#:with [field ...] (generate-temporaries (attribute constructor.arg))
#:with fixity (attribute constructor.fixity)
#`(begin-
(define-values- [] _con.residual)
; check if the constructor is nullary or not
#,(if (attribute constructor.nullary?)
; if it is, just define a value
#'(begin-
(define- tag-
(let- ()
(struct- constructor.tag ())
(constructor.tag)))
(define-syntax- constructor.tag
(data-constructor
(make-typed-var-transformer #'tag- (quote-syntax _con.expansion))
(quote-syntax _con.expansion)
(match-lambda [(list) #'(app force- (==- tag-))])
'fixity)))
; if it isnt, define a constructor function
#`(splicing-local- [(struct- tag- (field ...) #:transparent
#:reflection-name 'constructor.tag)
(define- #,(foldl #{begin #`(#,%2 #,%1)}
#'tag-/curried
(attribute field))
(tag- field ...))]
(define-syntax- constructor.tag
(data-constructor (make-typed-var-transformer #'tag-/curried
(quote-syntax _con.expansion))
(quote-syntax _con.expansion)
(match-lambda [(list field ...)
#`(app force- (tag- #,field ...))])
'fixity)))))])
(define-syntax-parser data
[(_ :type-constructor-spec constructor:data-constructor-spec ...
{~optional
{~seq #:deriving [{~type {~var class-id (class-id #:require-deriving-transformer? #t)}} ...]}
#:defaults ([[class-id 1] '()])})
#:with [*:type-constructor-spec] (type-namespace-introduce #')
#:with fixity (attribute .fixity)
#`(begin-
(define-syntax- *.tag (type-constructor
#'(#%type:con *.tag)
'#,(attribute *.len)
(list #'constructor.tag ...)
'fixity))
(define-data-constructor * constructor) ...
(derive-instance class-id *.tag) ...)])
(begin-for-syntax
(define-syntax-class (case*-clause num-pats)
#:attributes [[pat 1] [pat.pat 1] body]
#:description "a pattern-matching clause"
[pattern [[p:pat ...+] body:expr]
#:fail-unless (= (length (attribute p)) num-pats)
(~a "mismatch between number of patterns and number of values (expected "
num-pats " patterns, found " (length (attribute p)) ")")
#:attr [pat 1] (attribute p)
#:attr [pat.pat 1] (attribute p.pat)]))
(define-syntax case*
(make-elaborating-transformer
#:allowed-passes '[expand]
(syntax-parser
[(_ [val:expr ...+] {~var clause (case*-clause (length (attribute val)))} ...+)
#:do [; Determine the type to use to unify all of the body clauses. If there is
; an expected type (from /!), then use that type, otherwise generate a
; wobbly var that will be unified against each body type.
(define t_body
(or (get-expected this-syntax)
#`(#%type:wobbly-var #,(generate-temporary #'body))))
; Infer the types of each clause and expand the bodies. Each clause has N patterns, each
; of which match against a particular type, and it also has a body, which must be
; typechecked as well. Additionally, inferring the pattern types produces a racket/match
; pattern, which we can use to implement the untyped expression.
(define-values [tss_pats bound-idss- bodies-]
(for/lists [tss_pats bound-idss- bodies-]
([clause (in-list (attribute clause))]
[body (in-list (attribute clause.body))]
[pats (in-list (attribute clause.pat.pat))])
(match-let*-values
([; Infer the type each pattern will match against and collect the assumptions.
(ts_pats assumpss)
(for/lists [ts_pats assumpss]
([pat (in-list pats)])
(pat! pat))]
; Collect the set of bindings introduced by the patterns.
[(assumps) (append* assumpss)]
; Typecheck the body expression against the expected type.
[(bound-ids- body-) (/! body t_body assumps)])
; Return all the results of the inference process.
(values ts_pats bound-ids- body-))))
; Now that weve inferred the types that each pattern can match against, we should infer
; the types of each value being matched and ensure that all the patterns match against it.
; In order to do this, we want to transpose the list of inferred pattern types so that we
; can group all the types together that correspond to the same value. We also want to do
; the same for the patterns themselves, though only to provide useful source location
; information for type errors errors.
(define tss_pats-transposed (apply map list tss_pats))
(define patss-transposed (apply map list (attribute clause.pat)))]
; Now we can iterate over the types and ensure each value has the appropriate type.
#:with [val- ...] (for/list ([val (in-list (attribute val))]
[ts_pats (in-list tss_pats-transposed)]
[pats (in-list patss-transposed)])
(let ([val^ (generate-temporary)])
(for ([t_pat (in-list ts_pats)]
[pat (in-list pats)])
(type<:! t_pat #`(#%type:wobbly-var #,val^) #:src pat))
(! val (apply-current-subst #`(#%type:wobbly-var #,val^)))))
#:do [; Perform exhaustiveness checking.
(define non-exhaust (check-exhaustiveness (attribute clause.pat.pat)
(length (attribute val))))]
#:fail-when non-exhaust (string-append
"non-exhaustive pattern match\n unmatched case"
(if (= (length non-exhaust) 1) "" "s")
":" (string-append* (map #{string-append "\n " (ideal->string %)}
non-exhaust)))
#:do [; The resulting type of the case expression is the type we unified each clause against.
(define t_result
(apply-current-subst t_body))]
; Finally, we can actually emit the result syntax, using racket/match.
#:with [[bound-id- ...] ...] bound-idss-
#:with [body- ...] bodies-
(~> (syntax/loc this-syntax
(deferred-case* [val- ...] [[bound-id- ...] [clause.pat ...] body-] ...))
(attach-type t_result))])))
; Since racket/match uses syntax-parameterize, which in turn uses local-expand, we need to avoid
; expanding to `match` too early, since that will potentially force expansion of things that should be
; deferred to elaboration. To accommodate this, this macro waits until finalization to actually expand
; into `match`.
;
; (This will hopefully get less ugly once Hackett has a real core language, since a core #%case form
; should be able to subsume this macro.)
(define-syntax deferred-case*
(make-elaborating-transformer
(syntax-parser
[(head [val-:expr ...+] [[x-:id ...] [pat:pat ...] body-:expr] ...)
(match (syntax-local-elaborate-pass)
; In 'expand or 'elaborate mode, we need to manually expand the body forms, making sure the
; runtime binding are locally bound using a definition context.
[(or 'expand 'elaborate)
(let ([intdef-ctx (syntax-local-make-definition-context)])
(syntax-local-bind-syntaxes (append* (attribute x-)) #f intdef-ctx)
(with-syntax ([[val-* ...]
(for/list ([val- (in-list (attribute val-))])
(local-expand/defer-elaborate val- 'expression '()))]
[[[x-* ...] ...]
(internal-definition-context-introduce intdef-ctx #'[[x- ...] ...])]
[[body-* ...]
(for/list ([body- (in-list (attribute body-))])
(local-expand/defer-elaborate body- 'expression '() (list intdef-ctx)))])
(syntax-local-elaborate-defer
(syntax/loc this-syntax
(head [val-* ...] [[x-* ...] [pat ...] body-*] ...)))))]
; In 'finalize mode, we actually generate racket/match patterns from Hackett patterns and
; expand to a use of `match` from racket/match.
['finalize
(with-syntax ([[match-pats- ...]
(for/list ([xs- (in-list (attribute x-))]
[pats (in-list (attribute pat.pat))])
(match-define-values [match-pats- (list)]
(for/fold ([match-pats- '()]
[xs- xs-])
([pat (in-list pats)])
(let-values ([(match-pat- xs-*) ((pat->mk-match-pat pat) xs-)])
(values (cons match-pat- match-pats-) xs-*))))
(reverse match-pats-))])
(~> (quasisyntax/loc this-syntax
(lazy- #,(syntax/loc this-syntax
(match*- [val- ...] [match-pats- body-] ...))))
(syntax-property 'disappeared-use (attribute pat.disappeared-uses))))])])))
(define-syntax-parser case
[(_ val:expr {~describe "a pattern-matching clause" [pat:pat body:expr]} ...+)
(syntax/loc this-syntax
(case* [val]
[[pat] body] ...))])
(define-syntax-parser
[(_ [pat:pat ...+] e:expr)
(syntax/loc this-syntax
(* [[pat ...] e]))])
(begin-for-syntax
(define-splicing-syntax-class *-clauses
#:description "a pattern-matching clause"
#:attributes [[arg-id 1] [clause 1]]
[pattern {~seq {~and clause [[pat:pat ...+] e:expr]} ...+}
#:do [(define num-pats (length (first (attribute pat))))]
#:fail-when (ormap #{and (not (= %1 num-pats)) %2}
(rest (map length (attribute pat)))
(rest (attribute clause)))
"all clauses must have the same number of patterns"
#:with [arg-id ...] (map #{datum->syntax %1 (syntax-e %1) %2}
(generate-temporaries (first (attribute pat)))
(first (attribute pat)))]))
(define-syntax-parser *
[(_ clauses:*-clauses)
(quasisyntax/loc this-syntax
(plain- [clauses.arg-id ...]
#,(syntax/loc this-syntax
(case* [clauses.arg-id ...]
clauses.clause ...))))])
(define-syntax-parser defn
#:literals [:]
[(_ id:id
{~or {~optional {~seq {~and : {~var :/use}} {~type t:type}}}
{~optional fixity:fixity-annotation}}
...
clauses:*-clauses)
(quasitemplate
(def id {?? {?@ :/use t}} {?? {?@ . fixity}}
#,(syntax/loc this-syntax
(* clauses.clause ...))))])
```
|
Saint Spyridon Church (; ) is a Serbian Orthodox church in Trieste, Italy.
History
The Orthodox community in Trieste was established in 1748 but it was not until 1751 when Empress Maria Theresa allowed the free exercise of religion for Orthodox Christians. This prompted the immigration of Serbian traders from Herceg Novi, Trebinje and Sarajevo to Trieste. The first Eastern Orthodox Church was built in the mid-18th century and it served as a place of worship for both local Serbs and Greeks. It was thanks to Damaskinos Omiros, a well-traveled Greek monk from Mount Athos who went to Vienna to consult with the empress in person, that the wheels were set in motion.
In 1752 the Serbian Orthodox Metropolitan Vasilije Petrović celebrated the liturgy on his stopover in Trieste and elevated Father Damaskin (Omiros) to archimandrite. Soon after the momentous beginning, the Greek congregation ran into financial trouble, and the Serbs came to their aid and eventually paid off the debt.
The Orthodox church was completed by 1756 and Jovo Kurtović was elected president of the new church board on 4 May 1757.
That the Serbs were an essential part of the parish is without doubt, and they soon requested that a Serbian priest be assigned to Saint Spyridon in addition to the three existing Greek priests. Only Katerina Kurtović, the wife of Jovo Kurtović, understood some Greek, while the rest of the Serbs were unable to understand the liturgy or communicate with the priests without an interpreter.
Maria Theresa had appointed Father Damaskin the head of the parish, but the question of Serbian priests presented a continuing jurisdictional impediment. The ecclesiastical service for the Serbs of Trieste was at times under the Upper Karlovac Diocese and the Karlovac Bishop Danilo Jakšić (1750–1777) sent messages to Trieste through the head of the Gomirje monastery, Teofil Aleksić.
In 1759 Bishop Jakšić sent the first Serbian priest, Father Melentije, to Trieste, but in less than a year he was transferred first to serve the Russians and then to the Serbian chapel of St. George in Vienna. In 1761, Jakšić sent Trieste a second priest, Teodosije Marković, but he did not stay long either.
Much of the information known about the Serbs of Trieste in this period comes from the attempts of Trieste's Serbs to document their numbers and their social and economic standing in order to justify their request for a permanent Serbian priest. At one point in 1769 the Serbs reminded the empress of their wealth and suggested that another city might be more amenable for their trade. Only then did Maria Theresa issue the Triestine Serbs the right to have an "Illyrian" (Serbian) priest. The first permanent Serbian priest in Trieste was Haralampije Mamula from Ogulin in the western Military Frontier.
He served from 1771 until his death in 1790.
Such issues of church affairs between the ecclesiastical and the state (Maria Theresa) led to the dissolution of the joint community in 1781. The Greek left Saint Spyridon and later built a new church dedicated to St. Nicholas. The Serbs eventually paid them 20,000 florins for their share of Saint Spyridon. The separate Serb community continued its work independently and as early as 1782 it was officially established.
Due to the instability of the grounds on which the first church was erected, a joint decision was made to demolish the existing one and to erect the second church. The construction began on March 2, 1861, and it was designed by architect Carlo Maciachini. The exterior decor was entrusted to Pompey Bertini and Antony Karelia, the interior painted decorations and design of exterior decorations were produced by Giuseppe Bertini, and Emilio Bisi produced sculptures for the facade. The marble used to build the church comes from Carrara, Verona, Karst Plateau and Istria. The construction of the church was finished on September 2, 1868, and a small consecration took place on September 20, 1869.
From 1994 up to administrative changes within the dioceses of the Serbian Orthodox Church, the parish in Trieste fell within the Metropolitanate of Zagreb and Ljubljana. Since 2011, it is under the jurisdiction of the Serbian Orthodox Eparchy of Austria and Switzerland.
Saint Spyridon Church treasury holds numerous objects, historical documents, icons and various works of art, dating back to 1751.
Next to the church is a Serbian curriculum school. The school is named for Jovan Miletić, a wealthy merchant from Sarajevo who in his will left 24,000 florins for the education of the Serbian children of Trieste.
Gallery
See also
Serbs in Italy
Scuola di San Giorgio degli Schiavoni
References
External links
Neo-Byzantine architecture
Serbian Orthodox church buildings in Italy
Buildings and structures in Trieste
Churches in the province of Trieste
Churches completed in 1868
|
```javascript
import {isNever, never} from '../../index.js';
import {any, property} from '../util/props.js';
import {eq, test} from '../util/util.js';
test('returns true about never', function (){
eq(isNever(never), true);
});
property('returns false about everything else', any, function (value){
return isNever(value) === false;
});
```
|
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage
xmlns="path_to_url"
xmlns:x="path_to_url"
x:Class="Xamarin.Forms.Controls.GalleryPages.SwipeViewGalleries.SwipeVerticalCollectionViewGallery"
Title="Swipe CollectionView">
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="TitleStyle" TargetType="Label">
<Setter Property="FontSize" Value="14" />
<Setter Property="TextColor" Value="Black" />
<Setter Property="Margin" Value="6, 0, 6, 6" />
</Style>
<Style x:Key="DateStyle" TargetType="Label">
<Setter Property="TextColor" Value="DarkGray" />
<Setter Property="FontSize" Value="10" />
<Setter Property="Margin" Value="6, 0, 6, 6" />
</Style>
<Style x:Key="SubTitleStyle" TargetType="Label">
<Setter Property="TextColor" Value="DarkGray" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="6, 0" />
</Style>
<DataTemplate x:Key="MessageTemplate">
<SwipeView
HeightRequest="80">
<SwipeView.LeftItems>
<SwipeItems>
<SwipeItem
Text="Favourite"
Icon="calculator.png"
BackgroundColor="Yellow"
Command="{Binding Source={x:Reference SwipeCollectionView}, Path=BindingContext.FavouriteCommand}"/>
</SwipeItems>
</SwipeView.LeftItems>
<SwipeView.RightItems>
<SwipeItems
Mode="Execute">
<SwipeItem
Text="Delete"
Icon="coffee.png"
BackgroundColor="Red"
Command="{Binding Source={x:Reference SwipeCollectionView}, Path=BindingContext.DeleteCommand}"/>
</SwipeItems>
</SwipeView.RightItems>
<SwipeView.Content>
<Grid
BackgroundColor="White"
RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Grid.Column="0"
Grid.Row="0"
Text="{Binding Title}"
Style="{StaticResource TitleStyle}"/>
<Label
Grid.Column="1"
Grid.Row="0"
Text="{Binding Date}"
Style="{StaticResource DateStyle}"/>
<Label
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="1"
Text="{Binding SubTitle}"
Style="{StaticResource SubTitleStyle}"/>
<Label
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="2"
Text="{Binding Description}"
Style="{StaticResource SubTitleStyle}"/>
</Grid>
</SwipeView.Content>
</SwipeView>
</DataTemplate>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<CollectionView
x:Name="SwipeCollectionView"
ItemsSource="{Binding Messages}"
ItemTemplate="{StaticResource MessageTemplate}"
SelectionMode="Single"
SelectionChanged="OnSwipeCollectionViewSelectionChanged"/>
</Grid>
</ContentPage.Content>
</ContentPage>
```
|
```smalltalk
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// ==========================================================================
using Migrations.Migrations.Backup;
using Squidex.Domain.Apps.Entities.Apps;
using Squidex.Domain.Apps.Entities.Assets;
using Squidex.Domain.Apps.Entities.Backup;
using Squidex.Domain.Apps.Entities.Contents;
using Squidex.Domain.Apps.Entities.Rules;
using Squidex.Domain.Apps.Entities.Schemas;
using Squidex.Infrastructure.Migrations;
namespace Squidex.Config.Domain;
public static class BackupsServices
{
public static void AddSquidexBackups(this IServiceCollection services)
{
services.AddHttpClient("Backup", options =>
{
options.Timeout = TimeSpan.FromHours(1);
});
services.AddSingletonAs<TempFolderBackupArchiveLocation>()
.As<IBackupArchiveLocation>();
services.AddSingletonAs<DefaultBackupHandlerFactory>()
.As<IBackupHandlerFactory>();
services.AddSingletonAs<DefaultBackupArchiveStore>()
.As<IBackupArchiveStore>();
services.AddTransientAs<BackupApps>()
.As<IBackupHandler>();
services.AddTransientAs<BackupAssets>()
.As<IBackupHandler>();
services.AddTransientAs<BackupContents>()
.As<IBackupHandler>();
services.AddTransientAs<BackupRules>()
.As<IBackupHandler>();
services.AddTransientAs<BackupSchemas>()
.As<IBackupHandler>();
services.AddTransientAs<RestoreJob>()
.AsSelf();
services.AddTransientAs<ConvertBackup>()
.As<IMigration>();
}
}
```
|
Sir Nigel Edward Strutt DL TD (18 January 1916 – 28 January 2004) was the chairman of the Strutt & Parker (Farms) Ltd firm of agricultural property consultants, land agents and farm managers. He farmed in Essex and Suffolk. He was a Deputy Lieutenant for Essex from 1954, and High Sheriff of Essex in 1966. He was offered of a peerage but declined it, as had his great-great-grandfather, Joseph Holden Strutt.
Early life
Strutt was the youngest son of Captain Edward Jolliffe Strutt and his wife Amelie (née Devas). His grandfather, Hon. Edward Gerald Strutt, was the fifth son of John James Strutt, 2nd Baron Rayleigh, and younger brother of Nobel Prize-winning physicist, John Strutt, 3rd Baron Rayleigh. His great-uncle was a founder member of the Order of Merit; his grandfather was an early Companion of Honour.
The Strutts can trace their ancestry to a miller from Essex who died in 1694. They became stalwart members of the shire gentry, and several members of the family sat in Parliament from the 18th century. Nigel's great-great-grandfather, Joseph Strutt, was an MP for 40 years and colonel of several regiments of Essex militia. He was offered a peerage, but suggested that the title be conferred on his wife instead, so Lady Charlotte Strutt became Baroness Rayleigh.
Strutt was educated at Winchester College, following in the footsteps of his father and grandfather. He showed interest in farming, and attended Wye College in Kent.
Career
Strutt joined the Essex Yeomanry in 1937, and moved to Africa to become an honorary aide-de-camp to the governor of Northern Rhodesia. He joined the Essex Yeomanry Royal Horse Artillery on the outbreak of the Second World War. He served as a forward observation officer in North Africa and was severely wounded in 1941 near Bardia, in Libya, losing his right eye. After recovering from his injuries, he was offered a staff position as an ADC in Palestine, but asked to be returned to his regiment instead. However, before he could rejoin his comrades, he was captured by a German patrol and sent to a prisoner-of-war camp in northern Italy. In Camp 41, near Parma, he shared a room with Edward Tomkins and Pat Gibson, all three becoming firm friends. He was best man at Tomkins's wedding in 1955.
Strutt was repatriated in 1943 on medical grounds and in exchange for a German prisoner. He kept his parole, rejoining the Essex Yeomanry after the war and was later awarded the Territorial Decoration.
After the war, Strutt became a farmer, living for the remainder of his life in a farmhouse in Terling. He farmed in Essex and Suffolk, through two family firms, Lord Rayleigh's Farms and Strutt & Parker Farms. The farms produced wheat, oats, barley, potatoes, peas and sugar beet, with herds of Friesian cattle at Terling and Lavenham producing two million gallons of milk per annum.
Later life
Strutt was a member of the National Economic Development Council for Agriculture, and chairman of the Advisory Council for Agriculture and Horticulture from 1973-80. He was president of the Country Landowners' Association from 1967-9, president of the British Friesian Cattle Society in 1974-5, and president of the Royal Agricultural Society of England in 1982-3. He became a fellow at Wye College in 1970, and was Master of the Worshipful Company of Farmers in 1976-7. He received the Massey Ferguson Award in 1976, and received honorary degrees from Cranfield University and Essex University.
Strutt became a Deputy Lieutenant for Essex in 1954 and in 1966 he was High Sheriff of Essex. He was knighted in 1972. Like his ancestor, Joseph Strutt, he was offered of a peerage, but declined.
Strutt had an apartment in The Albany, and was a member of Brooks's. He enjoyed outdoor activities, such as walking, game shooting, and skiing. He never married.
References
1916 births
2004 deaths
People from Terling
Alumni of Wye College
Royal Horse Artillery officers
British Army personnel of World War II
British World War II prisoners of war
World War II prisoners of war held by Italy
Deputy Lieutenants of Essex
High Sheriffs of Essex
Nigel
Essex Yeomanry officers
|
```smalltalk
using System;
using Android.App;
using Android.Content;
using Android.Content.Res;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
[Obsolete("MasterDetailPage is obsolete as of version 5.0.0. Please use FlyoutPage instead.")]
internal class MasterDetailContainer : ViewGroup
{
const int DefaultMasterSize = 320;
const int DefaultSmallMasterSize = 240;
readonly bool _isMaster;
readonly MasterDetailPage _parent;
VisualElement _childView;
public MasterDetailContainer(MasterDetailPage parent, bool isMaster, Context context) : base(context)
{
_parent = parent;
_isMaster = isMaster;
}
public MasterDetailContainer(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { }
IMasterDetailPageController MasterDetailPageController => _parent as IMasterDetailPageController;
public VisualElement ChildView
{
get { return _childView; }
set
{
if (_childView == value)
return;
RemoveAllViews();
if (_childView != null)
DisposeChildRenderers();
_childView = value;
if (_childView == null)
return;
AddChildView(_childView);
}
}
protected virtual void AddChildView(VisualElement childView)
{
IVisualElementRenderer renderer = Platform.GetRenderer(childView);
if (renderer == null)
Platform.SetRenderer(childView, renderer = Platform.CreateRenderer(childView, Context));
if (renderer.View.Parent != this)
{
if (renderer.View.Parent != null)
renderer.View.RemoveFromParent();
SetDefaultBackgroundColor(renderer);
AddView(renderer.View);
renderer.UpdateLayout();
}
}
public int TopPadding { get; set; }
double DefaultWidthMaster
{
get
{
double w = Context.FromPixels(Resources.DisplayMetrics.WidthPixels);
return w < DefaultSmallMasterSize ? w : (w < DefaultMasterSize ? DefaultSmallMasterSize : DefaultMasterSize);
}
}
public override bool OnInterceptTouchEvent(MotionEvent ev)
{
bool isShowingPopover = _parent.IsPresented && !MasterDetailPageController.ShouldShowSplitMode;
if (!_isMaster && isShowingPopover)
return true;
return base.OnInterceptTouchEvent(ev);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
RemoveAllViews();
DisposeChildRenderers();
}
base.Dispose(disposing);
}
protected override void OnLayout(bool changed, int l, int t, int r, int b)
{
if (_childView == null)
return;
Rectangle bounds = GetBounds(_isMaster, l, t, r, b);
if (_isMaster)
MasterDetailPageController.MasterBounds = bounds;
else
MasterDetailPageController.DetailBounds = bounds;
IVisualElementRenderer renderer = Platform.GetRenderer(_childView);
renderer?.UpdateLayout();
}
void DisposeChildRenderers()
{
IVisualElementRenderer childRenderer = Platform.GetRenderer(_childView);
childRenderer?.Dispose();
_childView?.ClearValue(Platform.RendererProperty);
}
Rectangle GetBounds(bool isMasterPage, int left, int top, int right, int bottom)
{
double width = Context.FromPixels(right - left);
double height = Context.FromPixels(bottom - top);
double xPos = 0;
bool supressPadding = false;
//splitview
if (MasterDetailPageController.ShouldShowSplitMode)
{
//to keep some behavior we have on iPad where you can toggle and it won't do anything
bool isDefaultNoToggle = _parent.MasterBehavior == MasterBehavior.Default;
xPos = isMasterPage ? 0 : (_parent.IsPresented || isDefaultNoToggle ? DefaultWidthMaster : 0);
width = isMasterPage ? DefaultWidthMaster : _parent.IsPresented || isDefaultNoToggle ? width - DefaultWidthMaster : width;
}
else
{
//if we are showing the normal popover master doesn't have padding
supressPadding = isMasterPage;
//popover make the master smaller
width = isMasterPage && (Device.Info.CurrentOrientation.IsLandscape() || Device.Idiom == TargetIdiom.Tablet) ? DefaultWidthMaster : width;
}
double padding = supressPadding ? 0 : Context.FromPixels(TopPadding);
return new Rectangle(xPos, padding, width, height - padding);
}
protected void SetDefaultBackgroundColor(IVisualElementRenderer renderer)
{
if (ChildView.BackgroundColor == Color.Default)
{
TypedArray colors = Context.Theme.ObtainStyledAttributes(new[] { global::Android.Resource.Attribute.ColorBackground });
renderer.View.SetBackgroundColor(new global::Android.Graphics.Color(colors.GetColor(0, 0)));
}
}
}
}
```
|
Jergens is a surname. Notable people with the surname include:
Adele Jergens (1917–2002), American actress
Diane Jergens (1935–2018), American film and television actress
See also
Andrew Jergens Company
Jurgens
|
```objective-c
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_MACRO_GEN_H_
#define V8_WASM_MACRO_GEN_H_
#include "src/wasm/wasm-opcodes.h"
#include "src/zone/zone-containers.h"
#define U32_LE(v) \
static_cast<byte>(v), static_cast<byte>((v) >> 8), \
static_cast<byte>((v) >> 16), static_cast<byte>((v) >> 24)
#define U16_LE(v) static_cast<byte>(v), static_cast<byte>((v) >> 8)
#define WASM_MODULE_HEADER U32_LE(kWasmMagic), U32_LE(kWasmVersion)
#define IMPORT_SIG_INDEX(v) U32V_1(v)
#define FUNC_INDEX(v) U32V_1(v)
#define TABLE_INDEX(v) U32V_1(v)
#define NO_NAME U32V_1(0)
#define NAME_LENGTH(v) U32V_1(v)
#define ENTRY_COUNT(v) U32V_1(v)
#define ZERO_ALIGNMENT 0
#define ZERO_OFFSET 0
#define BR_TARGET(v) U32V_1(v)
#define MASK_7 ((1 << 7) - 1)
#define MASK_14 ((1 << 14) - 1)
#define MASK_21 ((1 << 21) - 1)
#define MASK_28 ((1 << 28) - 1)
#define U32V_1(x) static_cast<byte>((x)&MASK_7)
#define U32V_2(x) \
static_cast<byte>(((x)&MASK_7) | 0x80), static_cast<byte>(((x) >> 7) & MASK_7)
#define U32V_3(x) \
static_cast<byte>((((x)) & MASK_7) | 0x80), \
static_cast<byte>((((x) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((x) >> 14) & MASK_7)
#define U32V_4(x) \
static_cast<byte>(((x)&MASK_7) | 0x80), \
static_cast<byte>((((x) >> 7) & MASK_7) | 0x80), \
static_cast<byte>((((x) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((x) >> 21) & MASK_7)
#define U32V_5(x) \
static_cast<byte>(((x)&MASK_7) | 0x80), \
static_cast<byte>((((x) >> 7) & MASK_7) | 0x80), \
static_cast<byte>((((x) >> 14) & MASK_7) | 0x80), \
static_cast<byte>((((x) >> 21) & MASK_7) | 0x80), \
static_cast<byte>((((x) >> 28) & MASK_7))
// Convenience macros for building Wasm bytecode directly into a byte array.
//your_sha256_hash--------------
// Control.
//your_sha256_hash--------------
#define WASM_NOP kExprNop
#define WASM_END kExprEnd
#define ARITY_0 0
#define ARITY_1 1
#define ARITY_2 2
#define DEPTH_0 0
#define DEPTH_1 1
#define DEPTH_2 2
#define ARITY_2 2
#define WASM_BLOCK(...) kExprBlock, kLocalVoid, __VA_ARGS__, kExprEnd
#define WASM_BLOCK_I(...) kExprBlock, kLocalI32, __VA_ARGS__, kExprEnd
#define WASM_BLOCK_L(...) kExprBlock, kLocalI64, __VA_ARGS__, kExprEnd
#define WASM_BLOCK_F(...) kExprBlock, kLocalF32, __VA_ARGS__, kExprEnd
#define WASM_BLOCK_D(...) kExprBlock, kLocalF64, __VA_ARGS__, kExprEnd
#define WASM_BLOCK_T(t, ...) \
kExprBlock, static_cast<byte>(ValueTypes::ValueTypeCodeFor(t)), __VA_ARGS__, \
kExprEnd
#define WASM_BLOCK_X(index, ...) \
kExprBlock, static_cast<byte>(index), __VA_ARGS__, kExprEnd
#define WASM_INFINITE_LOOP kExprLoop, kLocalVoid, kExprBr, DEPTH_0, kExprEnd
#define WASM_LOOP(...) kExprLoop, kLocalVoid, __VA_ARGS__, kExprEnd
#define WASM_LOOP_I(...) kExprLoop, kLocalI32, __VA_ARGS__, kExprEnd
#define WASM_LOOP_L(...) kExprLoop, kLocalI64, __VA_ARGS__, kExprEnd
#define WASM_LOOP_F(...) kExprLoop, kLocalF32, __VA_ARGS__, kExprEnd
#define WASM_LOOP_D(...) kExprLoop, kLocalF64, __VA_ARGS__, kExprEnd
#define WASM_LOOP_T(t, ...) \
kExprLoop, static_cast<byte>(ValueTypes::ValueTypeCodeFor(t)), __VA_ARGS__, \
kExprEnd
#define WASM_LOOP_X(index, ...) \
kExprLoop, static_cast<byte>(index), __VA_ARGS__, kExprEnd
#define WASM_IF(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd
#define WASM_IF_T(t, cond, ...) \
cond, kExprIf, static_cast<byte>(ValueTypes::ValueTypeCodeFor(t)), \
__VA_ARGS__, kExprEnd
#define WASM_IF_X(index, cond, ...) \
cond, kExprIf, static_cast<byte>(index), __VA_ARGS__, kExprEnd
#define WASM_IF_ELSE(cond, tstmt, fstmt) \
cond, kExprIf, kLocalVoid, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_I(cond, tstmt, fstmt) \
cond, kExprIf, kLocalI32, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_L(cond, tstmt, fstmt) \
cond, kExprIf, kLocalI64, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_F(cond, tstmt, fstmt) \
cond, kExprIf, kLocalF32, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_D(cond, tstmt, fstmt) \
cond, kExprIf, kLocalF64, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_T(t, cond, tstmt, fstmt) \
cond, kExprIf, static_cast<byte>(ValueTypes::ValueTypeCodeFor(t)), tstmt, \
kExprElse, fstmt, kExprEnd
#define WASM_IF_ELSE_X(index, cond, tstmt, fstmt) \
cond, kExprIf, static_cast<byte>(index), tstmt, kExprElse, fstmt, kExprEnd
#define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect
#define WASM_RETURN0 kExprReturn
#define WASM_RETURN1(val) val, kExprReturn
#define WASM_RETURNN(count, ...) __VA_ARGS__, kExprReturn
#define WASM_BR(depth) kExprBr, static_cast<byte>(depth)
#define WASM_BR_IF(depth, cond) cond, kExprBrIf, static_cast<byte>(depth)
#define WASM_BR_IFD(depth, val, cond) \
val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop
#define WASM_CONTINUE(depth) kExprBr, static_cast<byte>(depth)
#define WASM_UNREACHABLE kExprUnreachable
#define WASM_BR_TABLE(key, count, ...) \
key, kExprBrTable, U32V_1(count), __VA_ARGS__
#define WASM_CASE(x) static_cast<byte>(x), static_cast<byte>(x >> 8)
#define WASM_CASE_BR(x) static_cast<byte>(x), static_cast<byte>(0x80 | (x) >> 8)
//your_sha256_hash--------------
// Misc expressions.
//your_sha256_hash--------------
#define WASM_ID(...) __VA_ARGS__
#define WASM_ZERO kExprI32Const, 0
#define WASM_ONE kExprI32Const, 1
#define I32V_MIN(length) -(1 << (6 + (7 * ((length)-1))))
#define I32V_MAX(length) ((1 << (6 + (7 * ((length)-1)))) - 1)
#define I64V_MIN(length) -(1LL << (6 + (7 * ((length)-1))))
#define I64V_MAX(length) ((1LL << (6 + 7 * ((length)-1))) - 1)
#define I32V_IN_RANGE(value, length) \
((value) >= I32V_MIN(length) && (value) <= I32V_MAX(length))
#define I64V_IN_RANGE(value, length) \
((value) >= I64V_MIN(length) && (value) <= I64V_MAX(length))
#define WASM_NO_LOCALS 0
namespace v8 {
namespace internal {
namespace wasm {
inline void CheckI32v(int32_t value, int length) {
DCHECK(length >= 1 && length <= 5);
DCHECK(length == 5 || I32V_IN_RANGE(value, length));
}
inline void CheckI64v(int64_t value, int length) {
DCHECK(length >= 1 && length <= 10);
DCHECK(length == 10 || I64V_IN_RANGE(value, length));
}
inline WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) {
switch (type.representation()) {
case MachineRepresentation::kWord8:
return store ? kExprI32StoreMem8
: type.IsSigned() ? kExprI32LoadMem8S : kExprI32LoadMem8U;
case MachineRepresentation::kWord16:
return store ? kExprI32StoreMem16
: type.IsSigned() ? kExprI32LoadMem16S : kExprI32LoadMem16U;
case MachineRepresentation::kWord32:
return store ? kExprI32StoreMem : kExprI32LoadMem;
case MachineRepresentation::kWord64:
return store ? kExprI64StoreMem : kExprI64LoadMem;
case MachineRepresentation::kFloat32:
return store ? kExprF32StoreMem : kExprF32LoadMem;
case MachineRepresentation::kFloat64:
return store ? kExprF64StoreMem : kExprF64LoadMem;
case MachineRepresentation::kSimd128:
return store ? kExprS128StoreMem : kExprS128LoadMem;
default:
UNREACHABLE();
}
}
} // namespace wasm
} // namespace internal
} // namespace v8
//your_sha256_hash--------------
// Int32 Const operations
//your_sha256_hash--------------
#define WASM_I32V(val) kExprI32Const, U32V_5(val)
#define WASM_I32V_1(val) \
static_cast<byte>(CheckI32v((val), 1), kExprI32Const), U32V_1(val)
#define WASM_I32V_2(val) \
static_cast<byte>(CheckI32v((val), 2), kExprI32Const), U32V_2(val)
#define WASM_I32V_3(val) \
static_cast<byte>(CheckI32v((val), 3), kExprI32Const), U32V_3(val)
#define WASM_I32V_4(val) \
static_cast<byte>(CheckI32v((val), 4), kExprI32Const), U32V_4(val)
#define WASM_I32V_5(val) \
static_cast<byte>(CheckI32v((val), 5), kExprI32Const), U32V_5(val)
//your_sha256_hash--------------
// Int64 Const operations
//your_sha256_hash--------------
#define WASM_I64V(val) \
kExprI64Const, \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 35) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 42) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 49) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 56) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 63) & MASK_7)
#define WASM_I64V_1(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 1), kExprI64Const), \
static_cast<byte>(static_cast<int64_t>(val) & MASK_7)
#define WASM_I64V_2(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 2), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 7) & MASK_7)
#define WASM_I64V_3(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 3), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 14) & MASK_7)
#define WASM_I64V_4(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 4), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 21) & MASK_7)
#define WASM_I64V_5(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 5), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 28) & MASK_7)
#define WASM_I64V_6(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 6), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 35) & MASK_7)
#define WASM_I64V_7(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 7), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 35) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 42) & MASK_7)
#define WASM_I64V_8(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 8), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 35) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 42) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 49) & MASK_7)
#define WASM_I64V_9(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 9), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 35) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 42) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 49) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 56) & MASK_7)
#define WASM_I64V_10(val) \
static_cast<byte>(CheckI64v(static_cast<int64_t>(val), 10), kExprI64Const), \
static_cast<byte>((static_cast<int64_t>(val) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 7) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 14) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 21) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 28) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 35) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 42) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 49) & MASK_7) | 0x80), \
static_cast<byte>(((static_cast<int64_t>(val) >> 56) & MASK_7) | 0x80), \
static_cast<byte>((static_cast<int64_t>(val) >> 63) & MASK_7)
#define WASM_F32(val) \
kExprF32Const, \
static_cast<byte>(bit_cast<int32_t>(static_cast<float>(val))), \
static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 8), \
static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 16), \
static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 24)
#define WASM_F64(val) \
kExprF64Const, \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val))), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 8), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 16), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 24), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 32), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 40), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 48), \
static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 56)
#define WASM_REF_NULL kExprRefNull
#define WASM_GET_LOCAL(index) kExprGetLocal, static_cast<byte>(index)
#define WASM_SET_LOCAL(index, val) val, kExprSetLocal, static_cast<byte>(index)
#define WASM_TEE_LOCAL(index, val) val, kExprTeeLocal, static_cast<byte>(index)
#define WASM_DROP kExprDrop
#define WASM_GET_GLOBAL(index) kExprGetGlobal, static_cast<byte>(index)
#define WASM_SET_GLOBAL(index, val) \
val, kExprSetGlobal, static_cast<byte>(index)
#define WASM_LOAD_MEM(type, index) \
index, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, false)), \
ZERO_ALIGNMENT, ZERO_OFFSET
#define WASM_STORE_MEM(type, index, val) \
index, val, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, true)), \
ZERO_ALIGNMENT, ZERO_OFFSET
#define WASM_LOAD_MEM_OFFSET(type, offset, index) \
index, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, false)), \
ZERO_ALIGNMENT, offset
#define WASM_STORE_MEM_OFFSET(type, offset, index, val) \
index, val, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, true)), \
ZERO_ALIGNMENT, offset
#define WASM_LOAD_MEM_ALIGNMENT(type, index, alignment) \
index, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, false)), \
alignment, ZERO_OFFSET
#define WASM_STORE_MEM_ALIGNMENT(type, index, alignment, val) \
index, val, \
static_cast<byte>(v8::internal::wasm::LoadStoreOpcodeOf(type, true)), \
alignment, ZERO_OFFSET
#define WASM_CALL_FUNCTION0(index) kExprCallFunction, static_cast<byte>(index)
#define WASM_CALL_FUNCTION(index, ...) \
__VA_ARGS__, kExprCallFunction, static_cast<byte>(index)
#define TABLE_ZERO 0
// TODO(titzer): change usages of these macros to put func last.
#define WASM_CALL_INDIRECT0(index, func) \
func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT1(index, func, a) \
a, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT2(index, func, a, b) \
a, b, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT3(index, func, a, b, c) \
a, b, c, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT4(index, func, a, b, c, d) \
a, b, c, d, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT5(index, func, a, b, c, d, e) \
a, b, c, d, e, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECTN(arity, index, func, ...) \
__VA_ARGS__, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_NOT(x) x, kExprI32Eqz
#define WASM_SEQ(...) __VA_ARGS__
//your_sha256_hash--------------
// Constructs that are composed of multiple bytecodes.
//your_sha256_hash--------------
#define WASM_WHILE(x, y) \
kExprLoop, kLocalVoid, x, kExprIf, kLocalVoid, y, kExprBr, DEPTH_1, \
kExprEnd, kExprEnd
#define WASM_INC_LOCAL(index) \
kExprGetLocal, static_cast<byte>(index), kExprI32Const, 1, kExprI32Add, \
kExprTeeLocal, static_cast<byte>(index)
#define WASM_INC_LOCAL_BYV(index, count) \
kExprGetLocal, static_cast<byte>(index), kExprI32Const, \
static_cast<byte>(count), kExprI32Add, kExprTeeLocal, \
static_cast<byte>(index)
#define WASM_INC_LOCAL_BY(index, count) \
kExprGetLocal, static_cast<byte>(index), kExprI32Const, \
static_cast<byte>(count), kExprI32Add, kExprSetLocal, \
static_cast<byte>(index)
#define WASM_UNOP(opcode, x) x, static_cast<byte>(opcode)
#define WASM_BINOP(opcode, x, y) x, y, static_cast<byte>(opcode)
//your_sha256_hash--------------
// Int32 operations
//your_sha256_hash--------------
#define WASM_I32_ADD(x, y) x, y, kExprI32Add
#define WASM_I32_SUB(x, y) x, y, kExprI32Sub
#define WASM_I32_MUL(x, y) x, y, kExprI32Mul
#define WASM_I32_DIVS(x, y) x, y, kExprI32DivS
#define WASM_I32_DIVU(x, y) x, y, kExprI32DivU
#define WASM_I32_REMS(x, y) x, y, kExprI32RemS
#define WASM_I32_REMU(x, y) x, y, kExprI32RemU
#define WASM_I32_AND(x, y) x, y, kExprI32And
#define WASM_I32_IOR(x, y) x, y, kExprI32Ior
#define WASM_I32_XOR(x, y) x, y, kExprI32Xor
#define WASM_I32_SHL(x, y) x, y, kExprI32Shl
#define WASM_I32_SHR(x, y) x, y, kExprI32ShrU
#define WASM_I32_SAR(x, y) x, y, kExprI32ShrS
#define WASM_I32_ROR(x, y) x, y, kExprI32Ror
#define WASM_I32_ROL(x, y) x, y, kExprI32Rol
#define WASM_I32_EQ(x, y) x, y, kExprI32Eq
#define WASM_I32_NE(x, y) x, y, kExprI32Ne
#define WASM_I32_LTS(x, y) x, y, kExprI32LtS
#define WASM_I32_LES(x, y) x, y, kExprI32LeS
#define WASM_I32_LTU(x, y) x, y, kExprI32LtU
#define WASM_I32_LEU(x, y) x, y, kExprI32LeU
#define WASM_I32_GTS(x, y) x, y, kExprI32GtS
#define WASM_I32_GES(x, y) x, y, kExprI32GeS
#define WASM_I32_GTU(x, y) x, y, kExprI32GtU
#define WASM_I32_GEU(x, y) x, y, kExprI32GeU
#define WASM_I32_CLZ(x) x, kExprI32Clz
#define WASM_I32_CTZ(x) x, kExprI32Ctz
#define WASM_I32_POPCNT(x) x, kExprI32Popcnt
#define WASM_I32_EQZ(x) x, kExprI32Eqz
//your_sha256_hash--------------
// Asmjs Int32 operations
//your_sha256_hash--------------
#define WASM_I32_ASMJS_DIVS(x, y) x, y, kExprI32AsmjsDivS
#define WASM_I32_ASMJS_REMS(x, y) x, y, kExprI32AsmjsRemS
#define WASM_I32_ASMJS_DIVU(x, y) x, y, kExprI32AsmjsDivU
#define WASM_I32_ASMJS_REMU(x, y) x, y, kExprI32AsmjsRemU
//your_sha256_hash--------------
// Int64 operations
//your_sha256_hash--------------
#define WASM_I64_ADD(x, y) x, y, kExprI64Add
#define WASM_I64_SUB(x, y) x, y, kExprI64Sub
#define WASM_I64_MUL(x, y) x, y, kExprI64Mul
#define WASM_I64_DIVS(x, y) x, y, kExprI64DivS
#define WASM_I64_DIVU(x, y) x, y, kExprI64DivU
#define WASM_I64_REMS(x, y) x, y, kExprI64RemS
#define WASM_I64_REMU(x, y) x, y, kExprI64RemU
#define WASM_I64_AND(x, y) x, y, kExprI64And
#define WASM_I64_IOR(x, y) x, y, kExprI64Ior
#define WASM_I64_XOR(x, y) x, y, kExprI64Xor
#define WASM_I64_SHL(x, y) x, y, kExprI64Shl
#define WASM_I64_SHR(x, y) x, y, kExprI64ShrU
#define WASM_I64_SAR(x, y) x, y, kExprI64ShrS
#define WASM_I64_ROR(x, y) x, y, kExprI64Ror
#define WASM_I64_ROL(x, y) x, y, kExprI64Rol
#define WASM_I64_EQ(x, y) x, y, kExprI64Eq
#define WASM_I64_NE(x, y) x, y, kExprI64Ne
#define WASM_I64_LTS(x, y) x, y, kExprI64LtS
#define WASM_I64_LES(x, y) x, y, kExprI64LeS
#define WASM_I64_LTU(x, y) x, y, kExprI64LtU
#define WASM_I64_LEU(x, y) x, y, kExprI64LeU
#define WASM_I64_GTS(x, y) x, y, kExprI64GtS
#define WASM_I64_GES(x, y) x, y, kExprI64GeS
#define WASM_I64_GTU(x, y) x, y, kExprI64GtU
#define WASM_I64_GEU(x, y) x, y, kExprI64GeU
#define WASM_I64_CLZ(x) x, kExprI64Clz
#define WASM_I64_CTZ(x) x, kExprI64Ctz
#define WASM_I64_POPCNT(x) x, kExprI64Popcnt
#define WASM_I64_EQZ(x) x, kExprI64Eqz
//your_sha256_hash--------------
// Float32 operations
//your_sha256_hash--------------
#define WASM_F32_ADD(x, y) x, y, kExprF32Add
#define WASM_F32_SUB(x, y) x, y, kExprF32Sub
#define WASM_F32_MUL(x, y) x, y, kExprF32Mul
#define WASM_F32_DIV(x, y) x, y, kExprF32Div
#define WASM_F32_MIN(x, y) x, y, kExprF32Min
#define WASM_F32_MAX(x, y) x, y, kExprF32Max
#define WASM_F32_ABS(x) x, kExprF32Abs
#define WASM_F32_NEG(x) x, kExprF32Neg
#define WASM_F32_COPYSIGN(x, y) x, y, kExprF32CopySign
#define WASM_F32_CEIL(x) x, kExprF32Ceil
#define WASM_F32_FLOOR(x) x, kExprF32Floor
#define WASM_F32_TRUNC(x) x, kExprF32Trunc
#define WASM_F32_NEARESTINT(x) x, kExprF32NearestInt
#define WASM_F32_SQRT(x) x, kExprF32Sqrt
#define WASM_F32_EQ(x, y) x, y, kExprF32Eq
#define WASM_F32_NE(x, y) x, y, kExprF32Ne
#define WASM_F32_LT(x, y) x, y, kExprF32Lt
#define WASM_F32_LE(x, y) x, y, kExprF32Le
#define WASM_F32_GT(x, y) x, y, kExprF32Gt
#define WASM_F32_GE(x, y) x, y, kExprF32Ge
//your_sha256_hash--------------
// Float64 operations
//your_sha256_hash--------------
#define WASM_F64_ADD(x, y) x, y, kExprF64Add
#define WASM_F64_SUB(x, y) x, y, kExprF64Sub
#define WASM_F64_MUL(x, y) x, y, kExprF64Mul
#define WASM_F64_DIV(x, y) x, y, kExprF64Div
#define WASM_F64_MIN(x, y) x, y, kExprF64Min
#define WASM_F64_MAX(x, y) x, y, kExprF64Max
#define WASM_F64_ABS(x) x, kExprF64Abs
#define WASM_F64_NEG(x) x, kExprF64Neg
#define WASM_F64_COPYSIGN(x, y) x, y, kExprF64CopySign
#define WASM_F64_CEIL(x) x, kExprF64Ceil
#define WASM_F64_FLOOR(x) x, kExprF64Floor
#define WASM_F64_TRUNC(x) x, kExprF64Trunc
#define WASM_F64_NEARESTINT(x) x, kExprF64NearestInt
#define WASM_F64_SQRT(x) x, kExprF64Sqrt
#define WASM_F64_EQ(x, y) x, y, kExprF64Eq
#define WASM_F64_NE(x, y) x, y, kExprF64Ne
#define WASM_F64_LT(x, y) x, y, kExprF64Lt
#define WASM_F64_LE(x, y) x, y, kExprF64Le
#define WASM_F64_GT(x, y) x, y, kExprF64Gt
#define WASM_F64_GE(x, y) x, y, kExprF64Ge
//your_sha256_hash--------------
// Type conversions.
//your_sha256_hash--------------
#define WASM_I32_SCONVERT_F32(x) x, kExprI32SConvertF32
#define WASM_I32_SCONVERT_F64(x) x, kExprI32SConvertF64
#define WASM_I32_UCONVERT_F32(x) x, kExprI32UConvertF32
#define WASM_I32_UCONVERT_F64(x) x, kExprI32UConvertF64
#define WASM_I32_CONVERT_I64(x) x, kExprI32ConvertI64
#define WASM_I64_SCONVERT_F32(x) x, kExprI64SConvertF32
#define WASM_I64_SCONVERT_F64(x) x, kExprI64SConvertF64
#define WASM_I64_UCONVERT_F32(x) x, kExprI64UConvertF32
#define WASM_I64_UCONVERT_F64(x) x, kExprI64UConvertF64
#define WASM_I64_SCONVERT_I32(x) x, kExprI64SConvertI32
#define WASM_I64_UCONVERT_I32(x) x, kExprI64UConvertI32
#define WASM_F32_SCONVERT_I32(x) x, kExprF32SConvertI32
#define WASM_F32_UCONVERT_I32(x) x, kExprF32UConvertI32
#define WASM_F32_SCONVERT_I64(x) x, kExprF32SConvertI64
#define WASM_F32_UCONVERT_I64(x) x, kExprF32UConvertI64
#define WASM_F32_CONVERT_F64(x) x, kExprF32ConvertF64
#define WASM_F32_REINTERPRET_I32(x) x, kExprF32ReinterpretI32
#define WASM_F64_SCONVERT_I32(x) x, kExprF64SConvertI32
#define WASM_F64_UCONVERT_I32(x) x, kExprF64UConvertI32
#define WASM_F64_SCONVERT_I64(x) x, kExprF64SConvertI64
#define WASM_F64_UCONVERT_I64(x) x, kExprF64UConvertI64
#define WASM_F64_CONVERT_F32(x) x, kExprF64ConvertF32
#define WASM_F64_REINTERPRET_I64(x) x, kExprF64ReinterpretI64
#define WASM_I32_REINTERPRET_F32(x) x, kExprI32ReinterpretF32
#define WASM_I64_REINTERPRET_F64(x) x, kExprI64ReinterpretF64
//your_sha256_hash--------------
// Numeric operations
//your_sha256_hash--------------
#define WASM_NUMERIC_OP(op) kNumericPrefix, static_cast<byte>(op)
#define WASM_I32_SCONVERT_SAT_F32(x) x, WASM_NUMERIC_OP(kExprI32SConvertSatF32)
#define WASM_I32_UCONVERT_SAT_F32(x) x, WASM_NUMERIC_OP(kExprI32UConvertSatF32)
#define WASM_I32_SCONVERT_SAT_F64(x) x, WASM_NUMERIC_OP(kExprI32SConvertSatF64)
#define WASM_I32_UCONVERT_SAT_F64(x) x, WASM_NUMERIC_OP(kExprI32UConvertSatF64)
#define WASM_I64_SCONVERT_SAT_F32(x) x, WASM_NUMERIC_OP(kExprI64SConvertSatF32)
#define WASM_I64_UCONVERT_SAT_F32(x) x, WASM_NUMERIC_OP(kExprI64UConvertSatF32)
#define WASM_I64_SCONVERT_SAT_F64(x) x, WASM_NUMERIC_OP(kExprI64SConvertSatF64)
#define WASM_I64_UCONVERT_SAT_F64(x) x, WASM_NUMERIC_OP(kExprI64UConvertSatF64)
//your_sha256_hash--------------
// Memory Operations.
//your_sha256_hash--------------
#define WASM_GROW_MEMORY(x) x, kExprGrowMemory, 0
#define WASM_MEMORY_SIZE kExprMemorySize, 0
#define SIG_ENTRY_v_v kWasmFunctionTypeCode, 0, 0
#define SIZEOF_SIG_ENTRY_v_v 3
#define SIG_ENTRY_v_x(a) kWasmFunctionTypeCode, 1, a, 0
#define SIG_ENTRY_v_xx(a, b) kWasmFunctionTypeCode, 2, a, b, 0
#define SIG_ENTRY_v_xxx(a, b, c) kWasmFunctionTypeCode, 3, a, b, c, 0
#define SIZEOF_SIG_ENTRY_v_x 4
#define SIZEOF_SIG_ENTRY_v_xx 5
#define SIZEOF_SIG_ENTRY_v_xxx 6
#define SIG_ENTRY_x(r) kWasmFunctionTypeCode, 0, 1, r
#define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeCode, 1, a, 1, r
#define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeCode, 2, a, b, 1, r
#define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeCode, 3, a, b, c, 1, r
#define SIZEOF_SIG_ENTRY_x 4
#define SIZEOF_SIG_ENTRY_x_x 5
#define SIZEOF_SIG_ENTRY_x_xx 6
#define SIZEOF_SIG_ENTRY_x_xxx 7
#define WASM_BRV(depth, ...) __VA_ARGS__, kExprBr, static_cast<byte>(depth)
#define WASM_BRV_IF(depth, val, cond) \
val, cond, kExprBrIf, static_cast<byte>(depth)
#define WASM_BRV_IFD(depth, val, cond) \
val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop
#define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd
#define WASM_BR_TABLEV(val, key, count, ...) \
val, key, kExprBrTable, U32V_1(count), __VA_ARGS__
//your_sha256_hash--------------
// Atomic Operations.
//your_sha256_hash--------------
#define WASM_ATOMICS_OP(op) kAtomicPrefix, static_cast<byte>(op)
#define WASM_ATOMICS_BINOP(op, x, y, representation) \
x, y, WASM_ATOMICS_OP(op), \
static_cast<byte>(ElementSizeLog2Of(representation)), ZERO_OFFSET
#define WASM_ATOMICS_TERNARY_OP(op, x, y, z, representation) \
x, y, z, WASM_ATOMICS_OP(op), \
static_cast<byte>(ElementSizeLog2Of(representation)), ZERO_OFFSET
#define WASM_ATOMICS_LOAD_OP(op, x, representation) \
x, WASM_ATOMICS_OP(op), \
static_cast<byte>(ElementSizeLog2Of(representation)), ZERO_OFFSET
#define WASM_ATOMICS_STORE_OP(op, x, y, representation) \
x, y, WASM_ATOMICS_OP(op), \
static_cast<byte>(ElementSizeLog2Of(representation)), ZERO_OFFSET
//your_sha256_hash--------------
// Sign Externsion Operations.
//your_sha256_hash--------------
#define WASM_I32_SIGN_EXT_I8(x) x, kExprI32SExtendI8
#define WASM_I32_SIGN_EXT_I16(x) x, kExprI32SExtendI16
#define WASM_I64_SIGN_EXT_I8(x) x, kExprI64SExtendI8
#define WASM_I64_SIGN_EXT_I16(x) x, kExprI64SExtendI16
#define WASM_I64_SIGN_EXT_I32(x) x, kExprI64SExtendI32
#endif // V8_WASM_MACRO_GEN_H_
```
|
Kuduro (or kuduru) is a type of music and dance from Angola. It is characterized as uptempo, energetic, and danceable. Kuduro was developed in Luanda, Angola in the late 1980s. Producers sampled traditional carnival music like soca and zouk béton ("hard" zouk) from the Caribbean to Angola, techno and accordion playing from Europe and laid this around a fast four-to-the-floor beat.
The kuduro is similar to the kizomba rhythm.
Origins
The roots of kuduro can be traced to the late 1980s when producers in Luanda, Angola started mixing African percussion samples with zouk béton ("hard" zouk) and soca to create a style of music then known as Batida ("Beat"). European and American electronic music had begun appearing in the market, which attracted Angolan musicians and inspired them to incorporate their own musical styles. Young producers began adding heavy African percussion to both European and American beats. In Europe, western house and techno producers mixed it with house and techno. Kuduro is primarily a genre of electronic dance music. In addition to the aforementioned influences, Kuduro also incorporates regional styles that are based on global and local influences that highlight sonic expressions of personal and collective identities. These collective and personal identities were formed due to Angola's turbulent history.
The history of kuduro has come about in a time of Angolan civil unrest, and provided a means of coping with hardship and positivity for the younger generation. Angola experienced periods of war, repression, and some instances of political tranquility. The origin of Kuduro came from and due to this political instability. There was significant anti-colonial resistance to Portuguese rule and influence which created a transitional government composed of two political parties. These two parties engaged in power-based struggles and tensions that led to the Angolan Civil War. Such shift in attitude away from optimism was reflected through Kuduro's increasing distortion in timbre and hardened aesthetics, while lyrics of the genre often reflected experiences of life in the musseques (Luanda’s informal, unpaved and marginal neighborhoods).
Kuduro's establishment of collective and individual identities created stereotypes of Africanness that permeate the Western mind. With the strong immigration to Portugal of Angolan citizens kuduro spread and evolved further in the neighborhoods of Lisbon, with the inclusion of additional musical elements from genres of Western European electronic music, giving origin to the progressive kuduro. This also allowed Kuduro to spread in terms of popularity as it became increasingly available to more populations. The youth also became a large part of the influence and spread of Kuduro. With the increase in popularity of electronic music in periods of relative political tranquility, youth played Kuduro in side-street markets, local parties, and nightclubs.
While listenership is primarily Angolan, there are some sonically diaspora communities and niche communities across a wide range of age groups that enjoy, experience, and produce Kuduro. Technology, global citizenships and intercultural communities impact the evolution of the genre as it has endured various "generations" of sound. Each of the three Kuduro generations lasted nearly a decade. Kuduro also endured various tempo fluctuations over time as well as the presence or absence of vocals and the distortion or clarity of sound.
Kuduro’s hybridity directly reflects its technological evolution; the music was codified in its constitutive technology. For example, contemporarily, kuduro vocals are rendered with relative low fidelity. This is a trace of the genre’s early technological limitations as early 1990s Angola studios lacked the necessary technology to record vocals. Furthermore, early producers created batidas in direct conversation with their techno and house influences and thus kuduro is predominantly loop-based and instrumental (ibid). These composition choices demonstrate how music styles arise as active negotiations of imagination and availability; these choices are both the result of “technical limitations and creative decisions” (ibid). The technology continues to define the music when one unfolds the history of the Fruity Loops drum samples. As the Civil War abated, instating a coalition government between UNITA and MPLA, the Angolan economy liberalized and there was a wider availability of personal computers (ibid). This resulted in DIY kuduro production using the Fruity Loops interface, which democratized the enterprise of creating batidas (ibid). The Fruity Loops interface is described by Garth Sheridan in the following manner: The Fruity Loops interface is centred on a row of on/off controls for each sound, known as the step sequence that resemble the user interface of the Roland TR series of drum machines. In the default 4/4 setting these 16 controls represent 4 bars of quarter notes. Drums, samples and software synthesisers are controlled using the step sequencer and, in later versions, also a digital piano roll. These loops could then be arranged and burned onto CD or recorded to tape.This production source unified the kuduro sound so it coalesced into an identifiable entity: “Producers using Fruity Loops had created the archetypal kuduro rhythms (see Fig. 1) and timbres”. Software availability also contributes to the ideological connotations surrounding the genre as the accessibility of these technologies lowered the barrier to entry to kuduro production, and thus the genre became increasingly working class and vulnerable to denigration as it became associated with Angola's mousseques (ibid).
According to Tony Amado, self-proclaimed creator of Kuduro, he got the idea for the dance, after seeing Jean-Claude Van Damme in the 1989 film Kickboxer, in which he appears in a bar drunk, and dances in a hard and unusual style. As Vivian Host points out in her article, despite the common assumption that "world music" from non-Western countries holds no commonalities with Western modern music, Angolan kuduro does contain "elements in common with punk, deep tribal house, and even Daft Punk." And although Angolan kuduro reflects an understanding and an interpretation of Western musical forms, the world music category that it fits under, tends to reject the idea of Western musical imperialism. DJ Riot of Sistema said, "Kuduro was never world music… It wasn’t born on congas and bongos, as some traditional folk-music. It was kids making straight-up dance-music from, like, ’96. Playing this new music, this new African music, that feels straight-up political in itself."
Kuduristas use body movements that often emanate movement/stillness, incoordination, falling, pop & lock, and breakdancing. This style of dance seems to “break down” body parts into isolations and staccato movements, serving as a reflection of debility and the mixture of abled/disabled bodies in performance. Popular Angolan dancer Costuleta, whose leg has been amputated, is known for his captivating performances displaying dexterity and sexuality. The incorporation of debility complicates normative notions of “abled-ness” while recalling motifs of black survival throughout the diaspora, specifically in relation to the land mines planted after Angola's war of independence that has left many Angolans amputated. Kuduristas contort their bodies in direct response to their spatial environments: Kuduristas, acutely aware of the six to twenty million landmines still waiting to be detonated, as well as the fact that one out of every 334 Angolans has lost a limb as a result of landmine detonation, emulate to various degrees the movements of the land mine victims around them, and are themselves victims.Young also argues that kuduristas use their dancing “to signify on the normative landscape of the black body,” and by extension, their spatial order. Acts of oppression (colonialism) and violence have composed their environments as sites of subjugation, but these dancers influence the essence of their settings by taking up space and recasting it through their bodies and movement.
Terminology
The name of the dance refers to a peculiar movement in which the dancers seem to have hard buttocks ("Cu Duro" in Portuguese), simulating an aggressive and agitated dance style.
Generations of kuduro
There were three primary generations of kuduro that each lasted nearly a decade. Through all generations, the primary common vein was storytelling of social and political messages. These messages are innately representative of the diaspora as it spreads the influence of Africanness transnationally, using African-originated and influenced sounds as a global genre.
The first generation
The first generation began in the early 1990s. It consisted primarily of middle-class youth and was representative of influences that resulted from political unrest. Artists and producers experimented with localized versions of techno and house music which aligned with much of the music that already permeated the club scene. It ranged from 128-135 beats per minute and vocals were rarely used to convey the message of the music. Kuduro in this generation also favored synthesized productions of acoustic instruments.
The second generation
This generation had a 'do it yourself' aesthetic which expanded the industry through establishing lower-income neighborhoods as the center of production. By this time, many home studios were based around Fruity Loops which were sequencers that incorporated a range of synthesizers and samples. The increase in availability of computers and pirated technology, especially the music production software FruityLoops made kuduro more widely available to the masses for production. This generation was characterized by sped-up versions of the first generation's tempo at 140 beats per minute. "Urgent" vocal styles were used in kuduro songs during this generation.
The third generation
This generation, too, focused on more neighborhood-based performance. There was an increase in participatory aspects in this genre as well. The use of Afrohouse and N'dombolo both had slower beats represented the globally connected nature of the genre. This generation also had slower beats. Technologically, this generation marked a shift away from FL Studio as the primary means of production to sequence-based software such as Cubase or Logic Pro.
Popularity
Kuduro is very popular across former Portuguese overseas countries in Africa, as well as in the suburbs of Lisbon, Portugal (namely Amadora and Queluz), due to the large number of Angolan immigrants.
In the Lisbon variety (or progressive kuduro), which mixes kuduro with house and techno music, Buraka Som Sistema a Portuguese/Angolan electronic dance music project based in Portugal, was responsible for the internationalisation of kuduro, presenting the genre across Europe. It featured in several international music magazines, after their appearance with their hit "Yah!" ("Yeah!"). Buraka Som Sistema takes its name from Buraca, a Lisbon suburb in the municipality of Amadora. Since the explosion of the Buraka Som Sistema, kuduro dance performance videos find an increasing audience on internet video platforms like YouTube. The videos range in quality from MTV standard to barely recognizable mobile-phone footage.
I Love Kuduro (festival)
A travelling festival that has become known as one of the largest gatherings dedicated to the Kuduro genre and lifestyle. It was created by Angolan artist Coréon Dú in 2011 with premiere events in the Showcase Club in Paris followed Arena Club in Berlin under the name Kuduro Sessions. It included Angolan legends such as Noite e Dia, Nacobeta, Bruno M, DJ Znobia, Big Nelo, the then up and coming Titica, Francis Boy Os Namayer, DJ Djeff & DJ Sylivi, as well as with a slew of international guests / Kuduro supporters such as Louie Vega & Anané Vega, Ousunlade, Daniel Haaksman, John Digweed, Hernan Cattaneo, Trentemoller, Tiefshwarz, Diego Miranda, and Wretch 32, among others.
The first event of Love Kuduro in Luanda was two day festival that received over 14,000 Kuduro fans in January 2012 at the Luanda International Fair grounds. The even has happened annually in Luanda, with various events happening around the world in cities such as Paris, Amsterdam, Stockholm, Rio de Janeiro, New York and Washington DC . Recent including a recent event at the 2014 TechnoParade in Paris, as the Os Kuduristas tour (a follow-up to the Kuduro Sessions theme tour) which focused mainly on bringing the broader Luanda urban culture to Kuduro lovers around the world, with an emphasis on dance.
The most recent event was an I Love Kuduro pop up float at the 2014 TechnoParade in Paris.
I Love Kuduro (film)
The film I Love Kuduro directed by brothers Mário and Pedro Patrocínio and Coréon Dú premiered with great success at the International Film Festival of Rio de Janeiro, the largest film festival in Latin America, and at Portugal, in DocLisboa. I Love Kuduro was shot in Angola and presents the origin of the kuduro phenomenon.
M.I.A. has supported kuduro music, working on the song "Sound of Kuduro" with Buraka Som Sistema in Angola. "It initially came from kids not having anything to make music on other than cellphones, using samples they'd get from their PCs and mobiles' sound buttons," M.I.A. said of kuduro. "It's a rave-y, beat oriented sound. Now that it's growing, they've got proper PCs to make music on."
References
External links
Long Academic Article on Kuduro
Blog about Kuduro
La Kiz
Jayna Brown, Global Pop Music and Utopian Impulse, “Buzz and Rumble”
20th-century music genres
Portuguese music
African dances
Angolan culture
Angolan music
African electronic dance music
|
The Khoshut (Mongolian: Хошууд,, qoşūd, ; literally "bannermen," from Middle Mongolian qosighu "flag, banner") are one of the four major tribes of the Oirat people. They established the Khoshut Khanate in the area of Tibet in 1642–1717.
History
Originally, Khoshuuds were one of the Khorchin tribes in southeastern Mongolian Plateau, but in the mid-15th century they migrated to western Mongolian Plateau to become an ally of the Oirats to counter the military power in central Mongolian Plateau. Their ruling family Galwas was the Hasarid-Khorchins who were deported by the Western Mongols.
The Khoshuts first appeared in the 1580s and by the 1620s were the most powerful Oirat tribe. They led others in converting to Buddhism. In 1636 Güshi Khan led many Khoshuds to occupy Kokenuur (Qinghai), and he was enthroned as king in Tibet by the 5th Dalai Lama. The Khoshut Khanate was established in 1642. Some time after 1645, his brother Kondeleng Ubashi migrated to the Volga, joining the Kalmyks. However, many Khoshuts remained in the Oirat homeland Dzungaria under Ochirtu Setsen.
After the Dzungar leader Galdan Boshogtu Khan killed Ochirtu, the Khoshut chief Khoroli submitted to the Qing dynasty with his people in 1686 and resettled in Alashan.
The Khoshuts of the Dzungar Khanate remained influential until the Qing annihilated them in 1755. In 1771 the Volga Khoshuts fled back to Dzungaria with the Kalmyks and were resettled by the Qing around Bosten Lake. Their small remnants under a Tumen family in Kalmykia were influential until 1917. Another part of them was formed into a separate banner in Bulgan Province, Khovd Province; but they were counted as Torghut who migrated with them in much larger numbers.
20th century
The Khoshuts in Alashan numbered 36,900 in 1990.
The Khoshuts around Bosten Lake numbered more than 12,000 in 1999.
See also
Lha-bzang Khan, Khoshut chief and King of Tibet
Upper Mongols
References
Санчиров В. П. О Происхождении этнонима торгут и народа, носившего это название // Монголо-бурятские этнонимы: cб. ст. — Улан-Удэ: БНЦ СО РАН, 1996. C. 31—50. - in Russian
Ovtchinnikova O., Druzina E., Galushkin S., Spitsyn V., Ovtchinnikov I. An Azian-specific 9-bp deletion in region V of mitochondrial DNA is found in Europe // Medizinische Genetic. 9 Tahrestagung der Gesellschaft für Humangenetik, 1997, p. 85.
Galushkin S.K., Spitsyn V.A., Crawford M.H. Genetic Structure of Mongolic-speaking Kalmyks // Human Biology, December 2001, v.73, no. 6, pp. 823–834.
Хойт С.К. Генетическая структура европейских ойратских групп по локусам ABO, RH, HP, TF, GC, ACP1, PGM1, ESD, GLO1, SOD-A // Проблемы этнической истории и культуры тюрко-монгольских народов. Сборник научных трудов. Вып. I. Элиста: КИГИ РАН, 2009. с. 146-183. - in Russian
[hamagmongol.narod.ru/library/khoyt_2008_r.htm Хойт С.К. Антропологические характеристики калмыков по данным исследователей XVIII-XIX вв. // Вестник Прикаспия: археология, история, этнография. No. 1. Элиста: Изд-во КГУ, 2008. с. 220-243.]
Хойт С.К. Кереиты в этногенезе народов Евразии: историография проблемы. Элиста: Изд-во КГУ, 2008. – 82 с. (Khoyt S.K. Kereits in enthnogenesis of peoples of Eurasia: historiography of the problem. Elista: Kalmyk State University Press, 2008. – 82 p. (in Russian))
[hamagmongol.narod.ru/library/khoyt_2012_r.htm Хойт С.К. Калмыки в работах антропологов первой половины XX вв. // Вестник Прикаспия: археология, история, этнография. No. 3, 2012. с. 215-245.]
Boris Malyarchuk, Miroslava Derenko, Galina Denisova, Sanj Khoyt, Marcin Wozniak, Tomasz Grzybowski and Ilya Zakharov Y-chromosome diversity in the Kalmyks at theethnical and tribal levels // Journal of Human Genetics (2013), 1–8.
Хойт С.К. Этническая история ойратских групп. Элиста, 2015. 199 с. (Khoyt S.K. Ethnic history of oyirad groups. Elista, 2015. 199 p. in Russian)
video about khoshuuds
Хойт С.К. Данные фольклора для изучения путей этногенеза ойратских групп // Международная научная конференция «Сетевое востоковедение: образование, наука, культура», 7-10 декабря 2017 г.: материалы. Элиста: Изд-во Калм. ун-та, 2017. с. 286-289. (in Russian)
Mongols
Oirats
Mongol peoples
|
For the civil use of Brookley AFB after 1969, see: Mobile Downtown Airport
Brookley Air Force Base is a former United States Air Force base located in Mobile, Alabama. After it closed in 1969, it became what is now known as the Mobile Aeroplex at Brookley.
History
Brookley Air Force Base had its aeronautical beginnings with Mobile's first municipal airport, the original Bates Field. However, the site itself had been occupied from the time of Mobile's founding, starting with the home of Mobile's founding father, Jean-Baptiste Le Moyne, Sieur de Bienville, in the early 18th century.
In 1938 the Army Air Corps took over the then Bates Field site and established the Brookley Army Air Field. The military was attracted to the site because of the area's generally good flying weather and the bay-front location, but Alabama Congressman Frank Boykin's influence in Washington was important in convincing the Army to locate the new military field in Mobile instead of Tampa, Florida. However, later that year, Tampa was also chosen for a military flying installation of its own, which would be named MacDill Field, home of present-day MacDill Air Force Base.
World War II
During World War II, Brookley Army Air Field became the major Army Air Forces supply base for the Air Materiel Command in the southeastern United States and the Caribbean.
Many air depot personnel, logisticians, mechanics, and other support personnel were trained at Brookley during the war. Both Air Materiel and Technical Services Command organized mobile Depot Groups at Brookley, then once trained were deployed around the world as Air Depot Groups, Depot Repair Squadrons, Quartermaster Squadrons, Ordnance Maintenance, Military Police, and many other units whose mission was to support the front-line combat units with depot-level maintenance for aircraft and logistical support to maintain their operations. Air Transport Command operated large numbers of cargo and passenger aircraft from the base as part of its Domestic Wing.
During the war, Brookley became Mobile's largest employer, with about 17,000 skilled civilians capable of performing delicate work with fragile instruments and machinery. In 1944, the Army decided to take advantage of Brookley's large, skilled workforce for its top-secret "Ivory Soap" project to hasten victory in the Pacific. The project required 24 large vessels to be re-modeled into Aircraft Repair and Maintenance Units that had to be able to provide repair and maintenance services to B-29 bombers, P-51 Mustang, Sikorsky R-4, and amphibious vehicles.
The Air Force delivered 24 vessels to Mobile, Alabama, in spring 1944 to start conversion. Six Liberty ships were converted into shops to repair aircraft. They were designated Aircraft Repair Units, Floating and were equipped to repair planes as big as the B-29 Stratofortresses. Eighteen smaller ships were outfitted as Aircraft Maintenance Units. They were made to repair fighter aircraft. About 5,000 men underwent a complex training process that prepared them to rebuild the vessels and operate them once on the water. By the end of the year, the vessels departed Mobile.
Postwar use
Following World War II and the creation of an independent United States Air Force, the installation became Brookley Air Force Base. In 1947 with the closure of Morrison Field, Florida, the C-74 Globemaster project was moved to Brookley. The C-74 was, at the time, the largest military transport aircraft in the world. It was developed by Douglas Aircraft after the Japanese attack on Pearl Harbor. The long distances across the Atlantic, and especially the Pacific Ocean to the combat areas indicated a need for a transoceanic heavy-lift military transport aircraft.
The "C-74 squadron" (later 521st Air Transport Group, 1701st Air Transport Wing), Air Transport Command operated two squadrons of C-74 Globemasters from Brookley from 1947 until their retirement in 1955. The eleven aircraft were used extensively for worldwide transport of personnel and equipment, supporting United States military missions. They saw extensive service supporting the Berlin Airlift and the Korean War being used on scheduled MATS overseas routes through the late 1940s and mid-1950s. Additionally, logistic support flights for Strategic Air Command (SAC), and Tactical Air Command (TAC) saw the Globemaster in North Africa, the Middle East, Europe, the Caribbean, and within the United States. Two C-74s were used to support the first TAC Republic F-84 Thunderjet flight across the Pacific Ocean to Japan. SAC also continued to use the Globemasters to rotate Boeing B-47 Stratojet Medium Bombardment Groups on temporary duty in England and Morocco as part of their REFLEX operation. The C-74s were retired in 1955 due to lack of logistical support. The 1701st ATW flew strategic airlift missions on a worldwide scale with its C-124 Globemaster II fleet after the retirement of the C-74 until 1957 when Military Air Transport Service moved out of Brookley AFB and the base came under the full jurisdiction of Air Materiel Command.
In 1962, the Air Materiel Command was renamed as the Air Force Logistics Command (AFLC) and Brookley AFB became an AFLC installation and the host base of the modification and repair center's successor organization, the Mobile Air Materiel Area (MOAMA).
After an immediate end to many of the wartime jobs of World War II, the base's civilian workforce again expanded to around 16,000 people by 1962, a result of both the Cold War and other USAF base closings in other areas of the country. During this time, AFLC's Mobile Air Materiel Area (MOAMA) provided depot-level maintenance for various USAF aircraft of the period, to include the C-119 Flying Boxcar, C-131 Samaritan, F-84 Thunderstreak, RF-84 Thunderflash, the F-104 Starfighter and the Republic F-105 Thunderchief.
In 1964, the Air Force Reserve 908th Tactical Airlift Group moved to Brookley from Bates Field. It operated C-119 Flying Boxcar transports.
Closure
On 19 November 1964, the Department of Defense announced a progressive reduction in employment and the eventual closure of Brookley Air Force Base. The costs of the escalation of the Vietnam War was cited as the primary reason for the closure. Robert McNamara, the Secretary of Defense, was unpopular both with Congress and with the public. Military bases were sources of employment and federal dollars for states and local communities, which allowed them to handle the cost of them and sales to military people stationed at the base.
Moreover, McNamara worked for President Lyndon B. Johnson, who had a reputation for rewarding friends and punishing opponents. When McNamara began the base closure announcements, suspicion began that Johnson was picking bases to close as retribution for the recent 1964 Presidential Election. The Republican candidate, Senator Barry Goldwater, had carried Alabama in the election and it was believed that Johnson was penalizing Alabama for defecting from its traditional Democratic Party ties. McNamara, however, had another agenda, as he wanted to curb the Air Force's reliance on large aircraft in favor of long-range missiles and closing maintenance facilities such as Brookley was a way to do that. McNamara denied that politics played any part in the decision to close several Air Force bases including Brookley.
The reserve 908th TAG was moved to Maxwell AFB, Alabama in April. The incoming Nixon Administration in 1969 confirmed the closure of Brookley as a way to save money because of the Vietnam War, and when it finally closed in June 1969, Brookley AFB represented the largest base closure in U.S. history up to that time, eliminating 10% of local jobs for the Mobile workforce, which provided an annual payroll of $95 million to the local economy.
Major USAF units assigned
1701st Air Transport Wing
1703d Air Transport Group
908th Tactical Airlift Group
26th Weather Squadron
Post-military use
After closure, the base was returned to the City of Mobile. Later, the city transferred it to the Mobile Airport Authority, and it became known as the Mobile Downtown Airport. The city had created the Mobile Airport Authority in 1982 to oversee the operation of the Mobile Regional Airport and what would become the Mobile Aeroplex at Brookley. The Mobile Airport Authority is autonomous and is not a part of the city or Mobile County. The Authority's five board members are appointed by Mobile's mayor, approved by the Mobile City Council, and serve six-year terms.
Following a catastrophic Hurricane Katrina striking New Orleans, first responders from across the Southeast and beyond, came to help. Among them was a team of 30 special agents from the U.S. Bureau of Alcohol, Tobacco, Firearms & Explosives (ATF) who made camp in a dorm on Brookley grounds for the entire month of September 2005. Mobile and most of southern Alabama having been spared the worst of her fury, extensive flooding did occur throughout the city. Once all gun stores and explosive storage sites were secured, the ATF team turned its attention to the three southern-most, coastal counties in Mississippi. Coordinating with other federal, State, and local officials operating from a command post in Gautier, Mississippi, the team assisted law enforcement and national guard personnel in Biloxi, Pascagoula, Gulfport, and elsewhere along the I-10 corridor.
Airbus currently has an aircraft final assembly line at Brookley, producing the Airbus A320 series airliners. Airbus had previously attempted to enter the market at Brookley Field when its military division EADS partnered with Northrop Grumman to produce the KC-45, billed as the next generation of air refueling and cargo aircraft for the US Air Force as a replacement to the aging fleet of KC-135s. EADS/Northrop Grumman originally won the contract bid to produce the aircraft, but the plans were put in limbo after rival Boeing filed a protest over the bidding process. In 2011, Boeing was declared the winner of the rebidding.
In popular culture
In the 1977 film Close Encounters of the Third Kind, the entire landing strip complex behind Devils Tower was actually constructed and filmed in an abandoned aircraft hangar at the former Brookley AFB.
See also
Alabama World War II Army Airfields
References
External links
Aerial image as of 4 March 2002 from USGS The National Map
Defunct airports in Alabama
Installations of the United States Air Force in Alabama
1938 establishments in Alabama
Airfields of the United States Army Air Corps
Airfields of the United States Army Air Forces Technical Service Command
Airfields of the United States Army Air Forces in Alabama
Initial United States Air Force installations
Transportation in Mobile, Alabama
Airfields of the United States Army Air Forces Air Transport Command in North America
1969 disestablishments in Alabama
Buildings and structures in Mobile, Alabama
Airports in Mobile County, Alabama
Military airbases established in 1938
Military installations closed in 1969
|
```smalltalk
namespace Xamarin.Forms
{
public interface IEffectControlProvider
{
void RegisterEffect(Effect effect);
}
}
```
|
Enaliosuchus is a dubious genus of extinct marine crocodyliform within the family Metriorhynchidae that lived during the Valanginian stage of the Early Cretaceous. It is known from fossil remains found in France and Germany and it was first described in 1883,. The name Enaliosuchus means "Marine crocodile", and is derived from the Greek Enalios- ("marine") and -suchos ("crocodile"). Two species are known: the type species E. macrospondylus, described in 1883, and the second species E. schroederi, described in 1936, which was likely the same animal as E. macrospondylus.
Description
Enaliosuchus was a carnivore that spent much, if not all, its life out at sea. No Enaliosuchus eggs or nest have been discovered, so little is known of the reptile's lifecycle, unlike other large marine reptiles of the Mesozoic, such as plesiosaurs or ichthyosaurs which are known to give birth to live young out at sea. Where Enaliosuchus mated, whether on land or at sea, is currently unknown.
Species
The species within Enaliosuchus include :
E. macrospondylus: type species from France and Germany of the Early Cretaceous (Valanginian).
E. schroederi: from Germany of the Early Cretaceous Valanginian. (likely a junior synonym of E. macrospondylus ).
Recent phylogenetic analysis supports the monophyly of Enaliosuchus. However, Enaliosuchus was later found to be a highly derived member of the genus Geosaurus or Cricosaurus, but Sachs et al. (2020) supports the theory that Enaliosuchus is a separate genus and Sachs et al. also found E. schroederi conspecific to E. macrospondylus.
References
Prehistoric pseudosuchian genera
Prehistoric marine crocodylomorphs
Early Cretaceous extinctions
Early Cretaceous crocodylomorphs of Europe
Fossil taxa described in 1883
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cmp_wav.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9102D366-6707-4789-938B-A373675F5B4C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cmp_wav</RootNamespace>
<OutDir>.\</OutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../pjsip/include;../../../pjlib/include;../../../pjlib-util/include;../../../pjmedia/include;../../../pjnath/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;libpjproject-i386-Win32-vc14-Debug.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmtd.lib</IgnoreSpecificDefaultLibraries>
<OutputFile>$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../pjsip/include;../../../pjlib/include;../../../pjlib-util/include;../../../pjmedia/include;../../../pjnath/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;libpjproject-x86_64-x64-vc14-Debug.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<OutputFile>$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../pjsip/include;../../../pjlib/include;../../../pjlib-util/include;../../../pjmedia/include;../../../pjnath/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;libpjproject-i386-Win32-vc14-Release.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<OutputFile>$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../pjsip/include;../../../pjlib/include;../../../pjlib-util/include;../../../pjmedia/include;../../../pjnath/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;libpjproject-x86_64-x64-vc14-Release.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<OutputFile>$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
```
|
Velsk () is a town and the administrative center of Velsky District in Arkhangelsk Oblast, Russia, located on the left bank of the Vel River at its confluence with the Vaga River, south of Arkhangelsk, the administrative center of the oblast. Population:
History
First attested in 1137, Velsk regularly suffered from inundations before it was moved to a higher spot in the 16th century. It was known as a pogost before 1555, as a posad between 1555 and 1780, whereupon it was incorporated as a town of Vologda Viceroyalty. Velsk developed as a merchant town, having profited from its location on the Vaga and late on the road connecting Moscow and Arkhangelsk (which in the 17th century was the only major trade harbor in European Russia). Trade fairs were held in Velsk; the most important one was the St. Athanasius Trade Fair.
In 1796, Velsky Uyezd was transferred to Vologda Governorate and remained there until 1929, when several governorates were merged into Northern Krai. On July 15, 1929, the uyezds were abolished and Velsk became the administrative center of Velsky District, a part of Nyandoma Okrug of Northern Krai. In 1936, the krai was transformed into Northern Oblast and in 1937, Northern Oblast was split into Arkhangelsk Oblast and Vologda Oblast.
Administrative and municipal status
Within the framework of administrative divisions, Velsk serves as the administrative center of Velsky District. As an administrative division, it is, together with the railway station of Vaga, incorporated within Velsky District as the town of district significance of Velsk. As a municipal division, the town of district significance of Velsk, together with two rural localities in Ust-Velsky Selsoviet of Velsky District, are incorporated within Velsky Municipal District as Velskoye Urban Settlement.
Economy
Industry
Town's economy is dominated by timber industry. Vaga was used for timber rafting until the 1990s. Food production is also present.
Transportation
Velsk is located on the M8 Highway—one of the principal highways in Russia connecting Moscow and Arkhangelsk. The secondary roads lead east to Oktyabrsky and west to Konosha, branching off in Velsk.
Velsk has a railway station (since 1942) on the railroad connecting Konosha and Kotlas, which eventually continues to Vorkuta.
The Velsk Airport provided passenger service until the 1990s, but has not been used since. In 2011, after a long break, a helicopter was tanked in Velsk. There are plans to use it as a base for the forest patrol aviation.
Culture and recreation
The historical center of Velsk, though having lost many of its historical buildings, conforms to the 1780 town plan and is regarded as a historically preserved area. In all, Velsk contains nineteen objects classified as cultural and historical heritage of local importance, most of them being former merchant houses. The following objects are on the list:
the whole architectural ensemble of Velsk
Salnikov House (end of the 19th-beginning of the 20th century)
Istomakhin House (1888)
Shelovanova House (end of the 19th-beginning of the 20th century)
Gorbunova House (1880)
Orlov House (1885)
Kotutin House (1902)
Living House (end of the 19th-beginning of the 20th century)
Trading House (end of the 19th-beginning of the 20th century)
Transfiguration Cathedral (1898–1913)
a house at 46 Dzerzhinsky Street
a house at 49 Dzerzhinsky Street
Assumption Church (wooden, 1795–1796)
a house at 4 Komsomolskaya Street
the ensemble of the Lenin Square, including the Popov house and a trading house
prison church
monument to the victims of the Civil War
Velsk hosts the Velsky District Museum.
Education
In Velsk, there are five high schools, three high professional schools, two colleges (Velsk Agriculture College and Velsk College of Economics), and four regional branches of universities located elsewhere.
Climate
Notable people
Georgii Karpechenko (1899–1941), Russian and Soviet biologist.
Arseny Roginsky (1946–2017), Russian historian and human rights activist.
References
Notes
Sources
Cities and towns in Arkhangelsk Oblast
Velsky Uyezd
|
```javascript
var baseFlatten = require('./_baseFlatten');
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
```
|
```smalltalk
using System.Collections.Generic;
using System.Linq;
using WalletWasabi.Tor.Control.Exceptions;
using WalletWasabi.Tor.Control.Messages.CircuitStatus;
namespace WalletWasabi.Tor.Control.Messages;
public record GetInfoCircuitStatusReply
{
public GetInfoCircuitStatusReply(IList<CircuitInfo> circuits)
{
Circuits = circuits;
}
public IList<CircuitInfo> Circuits { get; }
/// <exception cref="TorControlReplyParseException"/>
public static GetInfoCircuitStatusReply FromReply(TorControlReply reply)
{
if (!reply.Success)
{
throw new TorControlReplyParseException("GETINFO[circuit-status]: Expected reply with OK status.");
}
if (reply.ResponseLines.First() != "circuit-status=")
{
throw new TorControlReplyParseException("GETINFO[circuit-status]: First line is invalid.");
}
if (reply.ResponseLines[^2] != ".")
{
throw new TorControlReplyParseException("GETINFO[circuit-status]: Last line must be equal to dot ('.').");
}
IList<CircuitInfo> circuits = new List<CircuitInfo>();
foreach (string line in reply.ResponseLines.Skip(1).SkipLast(2))
{
circuits.Add(CircuitInfo.ParseLine(line));
}
return new GetInfoCircuitStatusReply(circuits);
}
}
```
|
Harry M. Koons (August 18, 1862 – April 5, 1932) was a third baseman in Major League Baseball. He played for the Altoona Mountain City and the Chicago Browns in 1884. Koons died in 1932 after being hit by a bus driver.
References
External links
1862 births
1932 deaths
Major League Baseball third basemen
Altoona Mountain Citys players
Chicago Browns/Pittsburgh Stogies players
19th-century baseball players
Baseball players from Philadelphia
Manchester Farmers players
Harrisburg Ponies players
Reading Actives players
Johnstown Pirates players
Road incident deaths in New Jersey
Pedestrian road incident deaths
|
Horistonotus is a genus of beetles belonging to the family Elateridae.
The species of this genus are found in America.
Species:
Horistonotus angustifrons Casari, 2011
References
Elateridae
Elateridae genera
|
```objective-c
#ifndef __AR_LIVE_SDK_TYPE_DEF_H__
#define __AR_LIVE_SDK_TYPE_DEF_H__
/////////////////////////////////////////////////////////////////////////////////
//
// onNetStatus
//
/////////////////////////////////////////////////////////////////////////////////
/**
* ArLivePushListener ArLivePlayListener onNetStatus() 2s
* key-value key
*/
#define NET_STATUS_CPU_USAGE "CPU_USAGE" ///> CPU
#define NET_STATUS_CPU_USAGE_D "CPU_USAGE_DEVICE" ///> CPU
#define NET_STATUS_VIDEO_WIDTH "VIDEO_WIDTH" ///>
#define NET_STATUS_VIDEO_HEIGHT "VIDEO_HEIGHT" ///>
#define NET_STATUS_VIDEO_FPS "VIDEO_FPS" ///>
#define NET_STATUS_VIDEO_GOP "VIDEO_GOP" ///> (I)
#define NET_STATUS_VIDEO_BITRATE "VIDEO_BITRATE" ///> kbps
#define NET_STATUS_AUDIO_BITRATE "AUDIO_BITRATE" ///> kbps
#define NET_STATUS_NET_SPEED "NET_SPEED" ///>
#define NET_STATUS_VIDEO_CACHE "VIDEO_CACHE" ///> ArLivePusherArLivePlayer
#define NET_STATUS_AUDIO_CACHE "AUDIO_CACHE" ///> ArLivePusherArLivePlayer
#define NET_STATUS_VIDEO_DROP "VIDEO_DROP" ///> ArLivePusherArLivePlayer: N/A
#define NET_STATUS_AUDIO_DROP "AUDIO_DROP" ///>
#define NET_STATUS_V_DEC_CACHE_SIZE "V_DEC_CACHE_SIZE" ///> ArLivePlayerAndroid
#define NET_STATUS_V_SUM_CACHE_SIZE "V_SUM_CACHE_SIZE" ///> ArLivePlayer
#define NET_STATUS_AV_PLAY_INTERVAL "AV_PLAY_INTERVAL" ///> ArLivePlayer ms
#define NET_STATUS_AV_RECV_INTERVAL "AV_RECV_INTERVAL" ///> ArLivePlayer ms
#define NET_STATUS_AUDIO_CACHE_THRESHOLD "AUDIO_CACHE_THRESHOLD" ///> ArLivePlayer
#define NET_STATUS_AUDIO_INFO "AUDIO_INFO" ///>
#define NET_STATUS_NET_JITTER "NET_JITTER" ///>
#define NET_STATUS_QUALITY_LEVEL "NET_QUALITY_LEVEL" ///> 0 1 2 3 4 5 6
#define NET_STATUS_SERVER_IP "SERVER_IP" ///> Server IP
/////////////////////////////////////////////////////////////////////////////////
//
// onPushEvent onPlayEvent
//
/////////////////////////////////////////////////////////////////////////////////
/**
* anyRTC ArLivePushListener onPushEvent()ArLivePlayListener onPlayEvent()
* - SDK
* -
* - SDK
*
* key-value key
*/
#define EVT_MSG "EVT_MSG" ///> ID
#define EVT_TIME "EVT_TIME" ///> UTC
#define EVT_UTC_TIME "EVT_UTC_TIME" ///> UTC()
#define EVT_BLOCK_DURATION "EVT_BLOCK_DURATION" ///>
#define EVT_PARAM1 "EVT_PARAM1" ///> 1
#define EVT_PARAM2 "EVT_PARAM2" ///> 2
#define EVT_GET_MSG "EVT_GET_MSG" ///> PLAY_EVT_GET_MESSAGE
#define EVT_PLAY_PROGRESS "EVT_PLAY_PROGRESS" ///>
#define EVT_PLAY_DURATION "EVT_PLAY_DURATION" ///>
#define EVT_PLAYABLE_DURATION "PLAYABLE_DURATION" ///>
#define EVT_PLAY_COVER_URL "EVT_PLAY_COVER_URL" ///>
#define EVT_PLAY_URL "EVT_PLAY_URL" ///>
#define EVT_PLAY_NAME "EVT_PLAY_NAME" ///>
#define EVT_PLAY_DESCRIPTION "EVT_PLAY_DESCRIPTION" ///>
#define STREAM_ID "STREAM_ID"
#endif // __AR_LIVE_SDK_TYPE_DEF_H__
```
|
The Birmingham and Derby Junction Railway was a British railway company. From Birmingham it connected at Derby with the North Midland Railway and the Midland Counties Railway at what became known as the Tri Junct Station. It now forms part of the main route between the West Country and the North East.
Origins
Although Birmingham was served by an extensive canal network (indeed, it is suggested they were a factor in its growth as an engineering centre), there were technical problems since Birmingham was on rising ground.
As early as 1824, Birmingham businessmen had been looking at the possibilities of the railway. The London and Birmingham Railway and the Grand Junction Railway had obtained their necessary Acts of Parliament in 1833 and a scheme for a line to Gloucester and Bristol was in the air. The North Midland had been floated in 1833 and a proposal was made to connect to its terminus at Derby
George Stephenson surveyed the route in 1835. The bill envisaged the line as running through Whitacre to meet the London and Birmingham Railway with a junction at Stechford to travel into the latter's terminus at Curzon Street. It would also run from Whitacre to Hampton-in-Arden, where it would join the L&B for connections to London.
The promoters came into conflict with those of the Midland Counties Railway even before the bills were presented to Parliament since the lines would compete with each other. In the end, the Birmingham and Derby line agreed to withdraw its branch to Hampton if it the Midland Counties withdrew its line along the Erewash valley.
The Hampton branch was removed, but when the Midland Counties presented its bill, it still contained the Erewash line (although it was later dropped on the insistence of the North Midland Railway). Samuel Carter, the Birmingham and Derby solicitor, immediately issued the statutory notices for its branch and was able to incorporate it in the act. Royal assent for the Birmingham and Derby Junction Railway Bill was given on 19 May 1836 with the active support of the prime minister Robert Peel, the member for Tamworth. The branch later became known as the Stonebridge Railway.
Construction
George's son Robert Stephenson took on the post of engineer, with an assistant, John Birkinshaw. Some long, there was no gradient steeper than 1 in 339. The design included two viaducts (the Anker Viaduct, now known as the Bolehall Viaduct) and the Wichnor Viaduct (also known as the Croxall Viaduct), seventy eight bridges and a cutting at the approach to Derby, consideration being given to the danger of flooding by the River Trent.
The Anker Viaduct is long, and the Croxall Viaduct is long.
The rails were single parallel form, , set in chairs upon cross sleepers. Although the standard gauge was used to match the other railways it was associated with, the rails were actually set at apart to allow extra play.
History
Competition
The B&DJR opened on 12 August 1839 with the line into Hampton, where the trains would reverse for Birmingham. There were six stations in addition to Hampton and Derby. These were Coleshill (later renamed Maxstoke), Kingsbury, Tamworth, Walton, Burton and Willington.
From the start the joint use of Curzon Street terminus, with the London and Birmingham, gave problems. On 10 February 1842 a new line was opened with a new terminus at Lawley Street. This proceeded to Whitacre via Castle Bromwich, Water Orton and Forge Mills (later renamed Coleshill). The line from Whitacre to Stechford which had not been built, was abandoned, and that to Hampton was reduced to single track.
Strong competition between the line and the Midland Counties Railway for transport, particularly of coal, to London, almost drove both of them out of business.
The B&DJR offered a time from Derby to London of around seven hours, but when the MCR began operating it was able to make the journey in an hour less. The B&DJR lowered its fares but this simply resulted in a price war. In a war of "dirty tricks", the MCR made an agreement with the North Midland for exclusive access to its passengers. In retaliation the Birmingham board opposed a bill that the MCR had submitted to Parliament. Both lines were in dire straits and paying minuscule dividends.
The North Midland was also suffering severe financial problems arising from the original cost of the line and its buildings. At length George Hudson took control of the NMR and adopted Robert Stephenson's suggestion that the best outcome would be for the three lines to merge.
Hudson foresaw that the directors of the MCR world resist the idea and made a secret agreement with the B&DJR for the NMR to take it over. This would of course take away the MCR's customers from Derby and the North and, when news leaked out, shares in the B&DJR rose dramatically.
Hudson was able to give the MCR directors an ultimatum, and persuaded the line's shareholders to override their board and the stage was set for amalgamation.
Midland Railway
In 1844, the Birmingham and Derby Junction Railway, the Midland Counties and the North Midland Railway merged to form the new Midland Railway.
The route to Hampton-in-Arden immediately lost all importance when the companies merged, since London traffic was redirected through the shorter Midland Counties route via Rugby. Known as the Stonebridge Railway, it became a minor branch line, and struggled on as such with only one daily passenger train until 1917, when this train was withdrawn as a wartime economy measure. The line remained open until 1935 for freight-only closing when one of the original timber bridges failed. The old Birmingham and Derby Junction station building at Hampton can still be seen.
The line into Lawley Street remained important, however, for passengers to the South West, who would join the Birmingham and Gloucester Railway at Camp Hill station or, from 1841, Curzon Street.
Present day
It is now part of the main line from the North East and Newcastle, via Derby and Birmingham New Street, to the south West at Bristol Temple Meads. CrossCountry is now the principal operator on the line.
See also Birmingham and Derby Junction Railway Locomotives
References
Clinker. C.R., (1982) The Birmingham and Derby Junction Railway, Avon-AngliA Publications and Services.
Williams, R., (1988) The Midland Railway: A New History, Newton Abbot: David and Charles
Whishaw, F., (1842) The Railways of Great Britain and Ireland London: John Weale repub Clinker, C.R. ed (1969) Whishaw's Railways of Great Britain and Ireland Newton Abbot: David and Charles
Pixton, B., (2005) Birmingham-Derby: Portrait of a Famous Route, Runpast Publishing
Further reading
External links
The Birmingham and Derby Junction Railway
The Hampton to Whitacre Line
Railway companies established in 1836
Railway lines opened in 1839
Railway companies disestablished in 1844
Midland Railway
Rail transport in Derby
Early British railway companies
1836 establishments in England
British companies established in 1836
British companies disestablished in 1844
|
```java
package razerdp.demo.model.common;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import razerdp.basepopup.R;
import razerdp.demo.model.DemoCommonUsageInfo;
import razerdp.demo.popup.DemoPopup;
import razerdp.demo.popup.PopupDesc;
/**
* Created by on 2019/9/26.
* - BottomSheetDialog
*/
public class CommonBottomSheetDialogInfo extends DemoCommonUsageInfo {
TestSheetDialog mSheetDialog;
PopupDesc mPopupDesc;
public CommonBottomSheetDialogInfo() {
title = "BottomSheetDialogBasePopup";
option = "";
sourceVisible = false;
}
@Override
public void toShow(View v) {
if (mSheetDialog == null) {
mSheetDialog = new TestSheetDialog(v.getContext());
}
mSheetDialog.show();
}
@Override
public void toOption(View v) {
if (mPopupDesc == null) {
mPopupDesc = new PopupDesc(v.getContext());
mPopupDesc.setTitle("BottomSheetDialogBasePopup")
.setDesc(new StringBuilder("")
.append('\n')
.append("BottomSheetDialogFragmentBasePopupActivityDecorViewWindowTokenBottomSheetDialogFragment")
.append('\n')
.append("BasePopupBasePopup-Compat"));
}
mPopupDesc.showPopupWindow();
}
static class TestSheetDialog extends BottomSheetDialog {
TextView tvShow;
DemoPopup mDemoPopup;
TestSheetDialog(@NonNull Context context) {
super(context);
setContentView(R.layout.view_bottom_sheet);
tvShow = findViewById(R.id.tv_show);
tvShow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPopup();
}
});
}
private void showPopup() {
if (mDemoPopup == null) {
mDemoPopup = new DemoPopup(this).setText("\n\nBttomSheetDialogBasePopup");
}
mDemoPopup.setPopupGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
mDemoPopup.showPopupWindow(tvShow);
}
}
}
```
|
```powershell
function Send-ALToastNotification
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Activity,
[Parameter(Mandatory = $true)]
[System.String]
$Message
)
$isFullGui = $true # Client
if (Get-Item 'HKLM:\software\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels' -ErrorAction SilentlyContinue)
{
[bool]$core = [int](Get-ItemProperty 'HKLM:\software\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels' -Name ServerCore -ErrorAction SilentlyContinue).ServerCore
[bool]$guimgmt = [int](Get-ItemProperty 'HKLM:\software\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels' -Name Server-Gui-Mgmt -ErrorAction SilentlyContinue).'Server-Gui-Mgmt'
[bool]$guimgmtshell = [int](Get-ItemProperty 'HKLM:\software\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels' -Name Server-Gui-Shell -ErrorAction SilentlyContinue).'Server-Gui-Shell'
$isFullGui = $core -and $guimgmt -and $guimgmtshell
}
if ($PSVersionTable.BuildVersion -lt 6.3 -or -not $isFullGui)
{
Write-PSFMessage -Message 'No toasts for OS version < 6.3 or Server Core'
return
}
# Hardcoded toaster from PowerShell - no custom Toast providers after 1709
$toastProvider = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe"
$imageLocation = Get-LabConfigurationItem -Name Notifications.NotificationProviders.Toast.Image
$imagePath = "$((Get-LabConfigurationItem -Name LabAppDataRoot))\Assets"
$imageFilePath = Join-Path $imagePath -ChildPath (Split-Path $imageLocation -Leaf)
if (-not (Test-Path -Path $imagePath))
{
[void](New-Item -ItemType Directory -Path $imagePath)
}
if (-not (Test-Path -Path $imageFilePath))
{
$file = Get-LabInternetFile -Uri $imageLocation -Path $imagePath -PassThru
}
$lab = Get-Lab
$template = "<?xml version=`"1.0`" encoding=`"utf-8`"?><toast><visual><binding template=`"ToastGeneric`"><text>{2}</text><text>Deployment of {0} on {1}, current status '{2}'. Message {3}.</text><image src=`"{4}`" placement=`"appLogoOverride`" hint-crop=`"circle`" /></binding></visual></toast>" -f `
$lab.Name, $lab.DefaultVirtualizationEngine, $Activity, $Message, $imageFilePath
try
{
[void]([Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime])
[void]([Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime])
[void]([Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime])
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($template)
$toast = New-Object Windows.UI.Notifications.ToastNotification $xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($toastProvider).Show($toast)
}
catch
{
Write-PSFMessage "Error sending toast notification: $($_.Exception.Message)"
}
}
```
|
The Elberfeld system was a system for aiding the poor in 19th-century Germany. It was a success when it was inaugurated in Elberfeld in 1853 and was adopted by many other German cities, but by the turn of the century an increasing population became more than the Elberfeld system (which relied on volunteer social workers) could handle, and it fell out of use.
Background
The first attempts to create a reformed poor relief system in Elberfeld began in 1800, when, dissatisfied with existing conditions, the city appointed six visitors to investigate applications for relief. The visitors were increased to 12 the following year. In 1802 there was a great increase. The city was divided into eight districts and these districts into four sections, and a board of supervisors chosen.
At the time (the first half of the 19th century), the textile-manufacturing cities of Barmen and Elberfeld were pioneering the industrialization of Germany. Immigration swelled the population of Elberfeld from 16,000 to 19,000 in 1810 to 31,000 to 40,000 in 1840, and the two cities were among the most densely populated municipalities in Germany.
The 1802 system was further extended in 1841. In 1850, dissatisfaction having arisen in several quarters, the Lutheran church attempted to do the work. Matters were not improved. The population of poor people was disproportionately high. And the centrally managed system of urban poor relief that the two cities had inherited proved to be too expensive and inefficient to cope with the new scale of the problem.
The Elberfeld system was a new structure of care that attempted to adapt to the new conditions.
The system
In 1852, a plan proposed by a banker, Daniel von Heydt, was put in operation. The administration of poor relief was decentralized. Working under a citywide poor office, subdepartments were established in smaller precincts - their relief workers worked on behalf of the central office. There were 252 precincts, each to care for four to 10 families.
Each precinct was in the care of an unsalaried almoner whose duty was to investigate each applicant for aid and to make visits every two weeks as long as aid was given. (Although, aid was not always extended - initial assistance was limited to two weeks and further services had to be approved again.) Fourteen precincts formed a district. The almoners met every two weeks under direction of an unpaid overseer to discuss the cases and to vote on needed relief. Those proceedings were reported to the directors, being the mayor as ex officio chairman, four councilmen, and four citizens (also unpaid), who met the day following to review and supervise the work throughout the city. In emergency cases the almoner might furnish assistance.
Relief was granted in money according to a fixed schedule for two weeks at a time, any earning the family may have garnered being deducted. Tools were furnished when advisable. The funds distributed to the poor came either from city coffers or from existing charitable foundations.
Key to the system was that the almoners and overseers served voluntarily. They came mostly from the middle class, being minor officials, craftsmen or merchants. Women were also accepted as almoners, giving them a rare (for the time) opportunity to participate in public life. The larger number of volunteers decreased both the number of clients per almoner, and the total system costs.
The system gave great satisfaction; the expenses in proportion to the population gradually decreased, and the condition of the poor is said to have improved. The essential principles of the Elberfeld system found application in the public-relief administration of the cities of the Rhineland, notably in Cologne, Crefeld, Düsseldorf, Aix-la-Chapelle, and Remscheid. A similar system had been employed in Hamburg. The Elberfeld system influenced the reorganization of relief systems in most of the German cities. Attempts to introduce the system in non-German cities were unsuccessful.
In the last third of the 19th century, however, immigration fuelled by industrialization once again increased the numbers of the needy, and the poor relief volunteers reached the limits of their capabilities. In the larger cities particularly, there was a return to greater centralization and professionalisation of poor relief.
In 1903, sculptor Wilhelm Neumann-Torborg (who was born in Elberfeld) created a bronze sculpture, The "Elberfeld Poor Relief Monument," to commemorate the 50th anniversary of the founding of the Elberfeld system. The statue was mostly destroyed during the Second World War, when the bronze figures were melted down for metal. But in 2003, the granite pedestal of the monument was rediscovered during excavations at the Elberfeld Old Reformed Church, and placed on display in Blankstrasse, Wuppertal. In 2011, it was restored thanks to 24 private donations. The bronze figures were recast at the Kayser Art Foundry by sculptor Shwan Kamal in Düsseldorf.
References
Bibliography
Gerhard Deimling: 150 Jahre Elberfelder System. Ein Nachruf, in: Geschichte im Wuppertal 12 (2003), pp. 46-57
Barbara Lube: Mythos und Wirklichkeit des Elberfelder Systems, in: Karl-Hermann Beeck (editor), Gründerzeit. Versuch einer Grenzbestimmung im Wuppertal (= Schriften des Vereins für Rheinische Kirchengeschichte, Volume 80), Köln/Bonn 1984, pp. 158-184
History of North Rhine-Westphalia
Wuppertal
Poverty law
Social history of Germany
|
```html
{{define "verification_verify_page"}}
{{template "cp_head" .}}
<header class="page-header">
<h2>Verification - {{.ActiveGuild.Name}}</h2>
</header>
{{template "cp_alerts" .}}
<div class="row justify-content-center">
<div class="col-md-6">
{{if .REValid}}
<h2>Success! you can now return to Discord.</h2>
{{else if .GoogleReCaptchaSiteKey}}
{{.RenderedPageContent}}
<form method="POST">
<div class="g-recaptcha" data-sitekey="{{.GoogleReCaptchaSiteKey}}"></div>
<br/>
<input type="submit" class="btn btn-success" value="Continue">
</form>
{{end}}
</div>
</div>
{{template "cp_footer"}}
{{end}}
```
|
Lists of lighthouses in the United Kingdom cover lighthouses, structures that emit light to serve as navigational aids, in the United Kingdom. They are organized by region. The list for Ireland includes both Northern Ireland and the Republic of Ireland.
Lists
England
Ireland
Scotland
Wales
See also
Lists of lighthouses
Lists of lightvessels
Lightvessels in the United Kingdom
External links
Lighthouses
|
Erich Joch (17 February 1913 – 9 March 2003) was a German athlete. He competed in the men's triple jump at the 1936 Summer Olympics.
References
1913 births
2003 deaths
Athletes (track and field) at the 1936 Summer Olympics
German male triple jumpers
Olympic athletes for Germany
Place of birth missing
|
Giovanni Aguilar (born March 8, 1998) is an American soccer player who plays as a midfielder for Whitecaps FC 2 of the MLS Next Pro.
Career
Youth
Aguilar attended high school at Lindhurst High School in Olivehurst, California, where he was a three-time All-League selection, and was named high school MVP as a junior. In 2015, he joined the Sacramento Republic academy for their inaugural season, after previously playing with local side Davis Legacy. With Sacramento, Aguilar earned U.S. Development Academy Best XI honors in the Western Conference region in 2015.
College
In 2017, Aguilar attended California State University, Northridge to play college soccer. In four seasons with the Matadors, Aguilar made 72 appearances, scoring three goals and tallying eleven assists. In his freshman year he was named Big West Conference All-Freshman Team and in his senior year was Big West First Team All-Conference.
While at college, Aguilar spent time with USL League Two side FC Golden State Force, making two regular season appearances during their 2019 season.
Professional
On December 10, 2021, it was announced that Aguilar had signed with his former academy side Sacramento Republic ahead of their 2022 USL Championship season. On January 11, 2022, Aguilar was selected 49th overall in the 2022 MLS SuperDraft by Vancouver Whitecaps FC. A week later, Aguilar joined Vancouver for their preseason training camp. On March 18, 2022, it was announced that Aguilar had been transferred from Sacramento to Vancouver, where he'd opted to join the club's MLS Next Pro side Whitecaps FC 2. In his debut professional season, he made 22 appearances and scored four goals in the MLS Next Pro.
References
1998 births
Living people
American expatriate sportspeople in Canada
American men's soccer players
Men's association football midfielders
Cal State Northridge Matadors men's soccer players
Expatriate men's soccer players in Canada
FC Golden State Force players
MLS Next Pro players
Sacramento Republic FC players
USL League Two players
Vancouver Whitecaps FC draft picks
Whitecaps FC 2 players
|
The A140 is an 'A-class' road in Norfolk and Suffolk, East Anglia, England partly following the route of the Roman Pye Road. It runs from the A14 near Needham Market to the A149 south of Cromer. It is of primary status for the entirety of its route. It is approximately 56 miles (90 km) in length.
Route
Ipswich to Diss
The road starts as dual carriageway from junction 51 with the A14 road; it then travels north to its junction with the A1120. It then continues to the Suffolk countryside providing access to the villages of Little Stonham, Mendlesham and Mendlesham Green. It passes through Brockford Street (where it crosses the River Dove), Thwaite, Stoke Ash, Thornham Parva, Yaxley and Brome where it meets its junction with the B1077. later it reaches a roundabout with the A143 – where it enters Norfolk and becomes dual carriageway – and a second outside Scole links it with the A1066. This section of road bypasses Scole to the east of Diss.
Diss to Norwich
The road bypasses Scole and then Thelveton after which it meets a roundabout marking the end of the dual carriageway. It continues north, bypassing Dickleburgh, to a junction with the B1134, a few miles later it enters Long Stratton, Stratton Saint Michael, Upper Tasburgh, Saxlingham Thorpe, Newton Flotman and Swainsthorpe. Shortly after it crosses the A47 at the Harford Interchange and River Yare. South of Norwich it turns left making up the west portion of the outer ring road. In the ring road it has junctions with the A11, B1108, A1074, A1067 and other unnumbered roads.
Norwich to Cromer
North of Norwich it passes Norwich Airport and the Norwich airport park and ride before reaching the roundabout with the B1149 which is adjacent to Manor Park, home of the Norfolk County Cricket Club. It heads north close to Horsham St Faith and then Newton St Faith. The road passes through mixed woodland close to the villages of Hainford, Stratton Strawless, Hevingham and Marsham. Before reaching the roundabout on the southern outskirts of Aylsham where it turns east to join the Aylsham by-pass and then pass the B1354 before crossing the River Bure and the junction of the B1145 close to Banningham. From here it heads in a northerly direction close to the villages of Erpingham and Alby with Thwaite, passing through Roughton where it meets the B1436 and then merging with the A149 road.
History
The A140 formed part of a Roman road, known later as Pye Road which ran from Camulodunum (Colchester) to Venta Icenorum (near Norwich).
The southern section from the junction with the A14 to Scole once formed part of Suffolk's first turnpike trust in which ran from Ipswich to Scole (and also from Claydon to Stowmarket and Haughley). The trust was either established in 1741 (or in 1711). A turnpike trust was established from Scole Bridge to Norwich by act of parliament much later in 1826. Most turnpikes in Suffolk were removed in the 1870s. The 1826 Act was not however officially repealed until 2008 by the Statute Law (Repeals) Act 2008.
In 1986 the government's Roads for Prosperity White Paper proposed the dualling of the entire Suffolk stretch of the A140 from its junction with the A14 (then the A45) and Scole. This proposal was never pursued.
Between 1997 and 2003 (78 months) there were 9 fatalities, 36 serious and 147 slight injuries on the road and as a result in 2004 a temporary 50 mph speed limit was introduced on the Suffolk section and permanent 30 mph through the villages of Earl Stonham and Brockford and 40 mph through Brome. The 30 mph zones had 40 mph 'buffers' either side. Between 2006 and 2008 Suffolk County Council removed a number of 40 mph buffers to "improve compliance and understanding" and extended some 30 mph zones slightly at the same time.
In February 2016, Nicholas Churchill, a disgruntled middle aged construction worker stole his employer's mining truck and drove for about 50 km on this highway and other roads. During this time, he drove into various structures and police vehicles. He finally stopped the truck in Brandon where he was arrested.
Proposed developments
Long Stratton bypass
A long-standing development proposal for the A140 is a bypass for the village of Long Stratton. In 2002 Norfolk County Council held a public consultation which resulted in a preferred route being selected in 2003, which bypassed to the east of the village. A planning application for the scheme was submitted in 2004 and the application was approved in February 2005. However, changes in the way road schemes are funded meant that no central government funding was approved. Since then Norfolk County Council has been unable to secure further funding for the scheme.
External links
SABRE Roads by 10 – A140
References
Roads in England
Transport in Norfolk
Roads in Suffolk
|
Yang Yue (; born 1983) is a Paralympian athlete from China competing mainly in category F42–46 discus throw events.
She competed in the 2004 Summer Paralympics in Athens, Greece where she competed unsuccessfully in both the F42–46 discus and javelin.
She also competed in the 2008 Summer Paralympics in Beijing, China. There she won a silver medal in the women's F42–46 discus throw event as part of a Chinese clean sweep of medals.
External links
Paralympic athletes for China
Athletes (track and field) at the 2004 Summer Paralympics
Athletes (track and field) at the 2008 Summer Paralympics
Paralympic silver medalists for China
Living people
Chinese female discus throwers
Medalists at the 2008 Summer Paralympics
Medalists at the 2012 Summer Paralympics
Athletes (track and field) at the 2012 Summer Paralympics
1983 births
Paralympic medalists in athletics (track and field)
21st-century Chinese women
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/js-generic-lowering.h"
#include "src/ast/ast.h"
#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
#include "src/feedback-vector.h"
#include "src/objects/scope-info.h"
namespace v8 {
namespace internal {
namespace compiler {
namespace {
CallDescriptor::Flags FrameStateFlagForCall(Node* node) {
return OperatorProperties::HasFrameStateInput(node->op())
? CallDescriptor::kNeedsFrameState
: CallDescriptor::kNoFlags;
}
} // namespace
JSGenericLowering::JSGenericLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
JSGenericLowering::~JSGenericLowering() {}
Reduction JSGenericLowering::Reduce(Node* node) {
switch (node->opcode()) {
#define DECLARE_CASE(x) \
case IrOpcode::k##x: \
Lower##x(node); \
break;
JS_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
default:
// Nothing to see.
return NoChange();
}
return Changed(node);
}
#define REPLACE_STUB_CALL(Name) \
void JSGenericLowering::LowerJS##Name(Node* node) { \
CallDescriptor::Flags flags = FrameStateFlagForCall(node); \
Callable callable = Builtins::CallableFor(isolate(), Builtins::k##Name); \
ReplaceWithStubCall(node, callable, flags); \
}
REPLACE_STUB_CALL(Add)
REPLACE_STUB_CALL(Subtract)
REPLACE_STUB_CALL(Multiply)
REPLACE_STUB_CALL(Divide)
REPLACE_STUB_CALL(Modulus)
REPLACE_STUB_CALL(Exponentiate)
REPLACE_STUB_CALL(BitwiseAnd)
REPLACE_STUB_CALL(BitwiseOr)
REPLACE_STUB_CALL(BitwiseXor)
REPLACE_STUB_CALL(ShiftLeft)
REPLACE_STUB_CALL(ShiftRight)
REPLACE_STUB_CALL(ShiftRightLogical)
REPLACE_STUB_CALL(LessThan)
REPLACE_STUB_CALL(LessThanOrEqual)
REPLACE_STUB_CALL(GreaterThan)
REPLACE_STUB_CALL(GreaterThanOrEqual)
REPLACE_STUB_CALL(BitwiseNot)
REPLACE_STUB_CALL(Decrement)
REPLACE_STUB_CALL(Increment)
REPLACE_STUB_CALL(Negate)
REPLACE_STUB_CALL(HasProperty)
REPLACE_STUB_CALL(Equal)
REPLACE_STUB_CALL(ToInteger)
REPLACE_STUB_CALL(ToLength)
REPLACE_STUB_CALL(ToNumber)
REPLACE_STUB_CALL(ToNumeric)
REPLACE_STUB_CALL(ToName)
REPLACE_STUB_CALL(ToObject)
REPLACE_STUB_CALL(ToString)
REPLACE_STUB_CALL(ForInEnumerate)
REPLACE_STUB_CALL(FulfillPromise)
REPLACE_STUB_CALL(PerformPromiseThen)
REPLACE_STUB_CALL(PromiseResolve)
REPLACE_STUB_CALL(RejectPromise)
REPLACE_STUB_CALL(ResolvePromise)
#undef REPLACE_STUB_CALL
void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
CallDescriptor::Flags flags) {
ReplaceWithStubCall(node, callable, flags, node->op()->properties());
}
void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
CallDescriptor::Flags flags,
Operator::Properties properties,
int result_size) {
const CallInterfaceDescriptor& descriptor = callable.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), flags,
properties, MachineType::AnyTagged(), result_size);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
node->InsertInput(zone(), 0, stub_code);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::ReplaceWithRuntimeCall(Node* node,
Runtime::FunctionId f,
int nargs_override) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Operator::Properties properties = node->op()->properties();
const Runtime::Function* fun = Runtime::FunctionForId(f);
int nargs = (nargs_override < 0) ? fun->nargs : nargs_override;
auto call_descriptor =
Linkage::GetRuntimeCallDescriptor(zone(), f, nargs, properties, flags);
Node* ref = jsgraph()->ExternalConstant(ExternalReference(f, isolate()));
Node* arity = jsgraph()->Int32Constant(nargs);
node->InsertInput(zone(), 0, jsgraph()->CEntryStubConstant(fun->result_size));
node->InsertInput(zone(), nargs + 1, ref);
node->InsertInput(zone(), nargs + 2, arity);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSStrictEqual(Node* node) {
// The === operator doesn't need the current context.
NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
Callable callable = Builtins::CallableFor(isolate(), Builtins::kStrictEqual);
node->RemoveInput(4); // control
ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags,
Operator::kEliminatable);
}
void JSGenericLowering::LowerJSLoadProperty(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const PropertyAccess& p = PropertyAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedLoadICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSLoadNamed(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kLoadICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable = CodeFactory::LoadGlobalIC(isolate(), p.typeof_mode());
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreProperty(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
PropertyAccess const& p = PropertyAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedStoreICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreNamed(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreNamedOwn(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
StoreNamedOwnParameters const& p = StoreNamedOwnParametersOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable = CodeFactory::StoreOwnIC(isolate());
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = CodeFactory::StoreOwnICInOptimizedCode(isolate());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const StoreGlobalParameters& p = StoreGlobalParametersOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreGlobalICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreGlobalIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreDataPropertyInLiteral(Node* node) {
FeedbackParameter const& p = FeedbackParameterOf(node->op());
node->InsertInputs(zone(), 4, 2);
node->ReplaceInput(4, jsgraph()->HeapConstant(p.feedback().vector()));
node->ReplaceInput(5, jsgraph()->SmiConstant(p.feedback().index()));
ReplaceWithRuntimeCall(node, Runtime::kDefineDataPropertyInLiteral);
}
void JSGenericLowering::LowerJSStoreInArrayLiteral(Node* node) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreInArrayLiteralIC);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
FeedbackParameter const& p = FeedbackParameterOf(node->op());
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 4, jsgraph()->HeapConstant(p.feedback().vector()));
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kDeleteProperty);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSGetSuperConstructor(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kGetSuperConstructor);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSHasInPrototypeChain(Node* node) {
ReplaceWithRuntimeCall(node, Runtime::kHasInPrototypeChain);
}
void JSGenericLowering::LowerJSInstanceOf(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = Builtins::CallableFor(isolate(), Builtins::kInstanceOf);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSOrdinaryHasInstance(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kOrdinaryHasInstance);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSLoadContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSStoreContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreate(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kFastNewObject);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSCreateArguments(Node* node) {
CreateArgumentsType const type = CreateArgumentsTypeOf(node->op());
switch (type) {
case CreateArgumentsType::kMappedArguments:
ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic);
break;
case CreateArgumentsType::kUnmappedArguments:
ReplaceWithRuntimeCall(node, Runtime::kNewStrictArguments);
break;
case CreateArgumentsType::kRestParameter:
ReplaceWithRuntimeCall(node, Runtime::kNewRestParameter);
break;
}
}
void JSGenericLowering::LowerJSCreateArray(Node* node) {
CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
int const arity = static_cast<int>(p.arity());
Handle<AllocationSite> const site = p.site();
ArrayConstructorDescriptor descriptor(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, arity + 1,
CallDescriptor::kNeedsFrameState, node->op()->properties(),
MachineType::AnyTagged());
Node* stub_code = jsgraph()->ArrayConstructorStubConstant();
Node* stub_arity = jsgraph()->Int32Constant(arity);
Node* type_info = site.is_null() ? jsgraph()->UndefinedConstant()
: jsgraph()->HeapConstant(site);
Node* receiver = jsgraph()->UndefinedConstant();
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 3, stub_arity);
node->InsertInput(zone(), 4, type_info);
node->InsertInput(zone(), 5, receiver);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCreateArrayIterator(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateCollectionIterator(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateBoundFunction(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateClosure(Node* node) {
CreateClosureParameters const& p = CreateClosureParametersOf(node->op());
Handle<SharedFunctionInfo> const shared_info = p.shared_info();
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info));
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.feedback_cell()));
node->RemoveInput(4); // control
// Use the FastNewClosure builtin only for functions allocated in new space.
if (p.pretenure() == NOT_TENURED) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kFastNewClosure);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
ReplaceWithStubCall(node, callable, flags);
} else {
ReplaceWithRuntimeCall(node, Runtime::kNewClosure_Tenured);
}
}
void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
const CreateFunctionContextParameters& parameters =
CreateFunctionContextParametersOf(node->op());
int slot_count = parameters.slot_count();
ScopeType scope_type = parameters.scope_type();
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
if (slot_count <= ConstructorBuiltins::MaximumFunctionContextSlots()) {
Callable callable =
CodeFactory::FastNewFunctionContext(isolate(), scope_type);
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
ReplaceWithStubCall(node, callable, flags);
} else {
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(scope_type));
ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
}
}
void JSGenericLowering::LowerJSCreateGeneratorObject(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateGeneratorObject);
node->RemoveInput(4); // control
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateStringIterator(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreatePromise(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateTypedArray(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateTypedArray);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
// Use the CreateShallowArrayLiteratlr builtin only for shallow boilerplates
// without properties up to the number of elements that the stubs can handle.
if ((p.flags() & AggregateLiteral::kIsShallow) != 0 &&
p.length() < ConstructorBuiltins::kMaximumClonedShallowArrayElements) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateShallowArrayLiteral);
ReplaceWithStubCall(node, callable, flags);
} else {
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral);
}
}
void JSGenericLowering::LowerJSCreateEmptyLiteralArray(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
FeedbackParameter const& p = FeedbackParameterOf(node->op());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->RemoveInput(4); // control
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateEmptyArrayLiteral);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) {
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
// Use the CreateShallowObjectLiteratal builtin only for shallow boilerplates
// without elements up to the number of properties that the stubs can handle.
if ((p.flags() & AggregateLiteral::kIsShallow) != 0 &&
p.length() <=
ConstructorBuiltins::kMaximumClonedShallowObjectProperties) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateShallowObjectLiteral);
ReplaceWithStubCall(node, callable, flags);
} else {
ReplaceWithRuntimeCall(node, Runtime::kCreateObjectLiteral);
}
}
void JSGenericLowering::LowerJSCreateEmptyLiteralObject(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) {
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kCreateRegExpLiteral);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.feedback().vector()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSCreateCatchContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateWithContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSCreateBlockContext(Node* node) {
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info));
ReplaceWithRuntimeCall(node, Runtime::kPushBlockContext);
}
void JSGenericLowering::LowerJSConstructForwardVarargs(Node* node) {
ConstructForwardVarargsParameters p =
ConstructForwardVarargsParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::ConstructForwardVarargs(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* start_index = jsgraph()->Uint32Constant(p.start_index());
Node* new_target = node->InputAt(arg_count + 1);
Node* receiver = jsgraph()->UndefinedConstant();
node->RemoveInput(arg_count + 1); // Drop new target.
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, new_target);
node->InsertInput(zone(), 3, stub_arity);
node->InsertInput(zone(), 4, start_index);
node->InsertInput(zone(), 5, receiver);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSConstruct(Node* node) {
ConstructParameters const& p = ConstructParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::Construct(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* new_target = node->InputAt(arg_count + 1);
Node* receiver = jsgraph()->UndefinedConstant();
node->RemoveInput(arg_count + 1); // Drop new target.
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, new_target);
node->InsertInput(zone(), 3, stub_arity);
node->InsertInput(zone(), 4, receiver);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSConstructWithArrayLike(Node* node) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kConstructWithArrayLike);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* receiver = jsgraph()->UndefinedConstant();
Node* arguments_list = node->InputAt(1);
Node* new_target = node->InputAt(2);
node->InsertInput(zone(), 0, stub_code);
node->ReplaceInput(2, new_target);
node->ReplaceInput(3, arguments_list);
node->InsertInput(zone(), 4, receiver);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSConstructWithSpread(Node* node) {
ConstructParameters const& p = ConstructParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
int const spread_index = arg_count;
int const new_target_index = arg_count + 1;
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::ConstructWithSpread(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stack_arg_count = jsgraph()->Int32Constant(arg_count - 1);
Node* new_target = node->InputAt(new_target_index);
Node* spread = node->InputAt(spread_index);
Node* receiver = jsgraph()->UndefinedConstant();
DCHECK(new_target_index > spread_index);
node->RemoveInput(new_target_index); // Drop new target.
node->RemoveInput(spread_index);
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, new_target);
node->InsertInput(zone(), 3, stack_arg_count);
node->InsertInput(zone(), 4, spread);
node->InsertInput(zone(), 5, receiver);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCallForwardVarargs(Node* node) {
CallForwardVarargsParameters p = CallForwardVarargsParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::CallForwardVarargs(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* start_index = jsgraph()->Uint32Constant(p.start_index());
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, stub_arity);
node->InsertInput(zone(), 3, start_index);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCall(Node* node) {
CallParameters const& p = CallParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
ConvertReceiverMode const mode = p.convert_mode();
Callable callable = CodeFactory::Call(isolate(), mode);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, stub_arity);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCallWithArrayLike(Node* node) {
Callable callable = CodeFactory::CallWithArrayLike(isolate());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* receiver = node->InputAt(1);
Node* arguments_list = node->InputAt(2);
node->InsertInput(zone(), 0, stub_code);
node->ReplaceInput(3, receiver);
node->ReplaceInput(2, arguments_list);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCallWithSpread(Node* node) {
CallParameters const& p = CallParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
int const spread_index = static_cast<int>(p.arity() + 1);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::CallWithSpread(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
// We pass the spread in a register, not on the stack.
Node* stack_arg_count = jsgraph()->Int32Constant(arg_count - 1);
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, stack_arg_count);
node->InsertInput(zone(), 3, node->InputAt(spread_index));
node->RemoveInput(spread_index + 1);
NodeProperties::ChangeOp(node, common()->Call(call_descriptor));
}
void JSGenericLowering::LowerJSCallRuntime(Node* node) {
const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op());
ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity()));
}
void JSGenericLowering::LowerJSForInNext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSForInPrepare(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSLoadMessage(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSStoreMessage(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSLoadModule(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSStoreModule(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorStore(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorRestoreContinuation(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorRestoreContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorRestoreInputOrDebugPos(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorRestoreRegister(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSStackCheck(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* limit = effect = graph()->NewNode(
machine()->Load(MachineType::Pointer()),
jsgraph()->ExternalConstant(
ExternalReference::address_of_stack_limit(isolate())),
jsgraph()->IntPtrConstant(0), effect, control);
Node* pointer = graph()->NewNode(machine()->LoadStackPointer());
Node* check = graph()->NewNode(machine()->UintLessThan(), limit, pointer);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* etrue = effect;
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
NodeProperties::ReplaceControlInput(node, if_false);
NodeProperties::ReplaceEffectInput(node, effect);
Node* efalse = if_false = node;
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge);
// Wire the new diamond into the graph, {node} can still throw.
NodeProperties::ReplaceUses(node, node, ephi, merge, merge);
NodeProperties::ReplaceControlInput(merge, if_false, 1);
NodeProperties::ReplaceEffectInput(ephi, efalse, 1);
// This iteration cuts out potential {IfSuccess} or {IfException} projection
// uses of the original node and places them inside the diamond, so that we
// can change the original {node} into the slow-path runtime call.
for (Edge edge : merge->use_edges()) {
if (!NodeProperties::IsControlEdge(edge)) continue;
if (edge.from()->opcode() == IrOpcode::kIfSuccess) {
NodeProperties::ReplaceUses(edge.from(), nullptr, nullptr, merge);
NodeProperties::ReplaceControlInput(merge, edge.from(), 1);
edge.UpdateTo(node);
}
if (edge.from()->opcode() == IrOpcode::kIfException) {
NodeProperties::ReplaceEffectInput(edge.from(), node);
edge.UpdateTo(node);
}
}
// Turn the stack check into a runtime call.
ReplaceWithRuntimeCall(node, Runtime::kStackGuard);
}
void JSGenericLowering::LowerJSDebugger(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::HandleDebuggerStatement(isolate());
ReplaceWithStubCall(node, callable, flags);
}
Zone* JSGenericLowering::zone() const { return graph()->zone(); }
Isolate* JSGenericLowering::isolate() const { return jsgraph()->isolate(); }
Graph* JSGenericLowering::graph() const { return jsgraph()->graph(); }
CommonOperatorBuilder* JSGenericLowering::common() const {
return jsgraph()->common();
}
MachineOperatorBuilder* JSGenericLowering::machine() const {
return jsgraph()->machine();
}
} // namespace compiler
} // namespace internal
} // namespace v8
```
|
The World Socialist Web Site (WSWS) is the website of the International Committee of the Fourth International (ICFI). It describes itself as an "online newspaper of the international Trotskyist movement". The WSWS publishes articles and analysis of news and events from around the world, updated daily. The site also includes coverage of the history of working-class political and organized labor movements.
About
The WSWS was established on February 14, 1998. The site was redesigned on October 22, 2008, and then again on October 1, 2020.
The WSWS supports and helps campaign for the Socialist Equality Parties in elections. The site has no advertisements, except for material from Mehring Books, the ICFI's publishing arm. David North serves as Chairman of the site's International Editorial Board.
Content
The WSWS publishes articles on politics, finance and economics, culture, police violence, racism, war, media and information technology, corporate power, history, and labor issues.
The WSWS periodically undertakes focused political campaigns, during which numerous articles, videos, interviews, and perspectives are published on the topic. Campaigns undertaken include defending Julian Assange, Chelsea Manning, and Edward Snowden, civil rights and free speech, and the opposition to utility shutoffs and bankruptcy in Detroit.
Demotion in Google searches
According to Julianne Tvetan writing in In These Times, in July 2017 the WSWS drew attention to new Google search algorithms intended to remove fake news, which WSWS believed to be a form of censorship by Google. Using evidence from SEMrush, an analytics suite for search engine optimization, the WSWS alleged that several sites, such as AlterNet and Globalresearch.ca, had received reduced traffic from Google due to changes in its search algorithm. According to the WSWS, between late April 2017 and the beginning of August 2017 its Google search traffic fell by 67%. Google said that it had not deliberately targeted any particular website, and Google vice-president Ben Gomes wrote that Google had "adjusted [its] signals to help surface more authoritative pages and demote low-quality content." According to WSWS, the documentary film-maker John Pilger offered his support to a webinar involving David North and Chris Hedges about the issue because he said the website, along with WikiLeaks, Consortium News, Global Research, Democracy Now!, and CounterPunch, were increasingly being tagged as "offensive" by Google.
The 1619 Project
In 2019, WSWS received considerable attention for its criticisms of the New York Times''' The 1619 Project, which aimed to reframe American history by placing the consequences of slavery and the contributions of Black Americans at the center of the country's national narrative. WSWS described the project as "one component of a deliberate effort to inject racial politics into the heart of the 2020 elections and foment divisions among the working class." According to The Washington Post:On Dec. 16 [2020], Wall Street Journal opinion columnist Elliot Kaufman brought into the mainstream criticisms of the 1619 Project from four historians who had been questioning it for months on the World Socialist website, a fringe news publication founded upon the principles of Trotskyism. Some of what those professors wrote had gained momentum in the Twitterverse and sparked discussion about their analysis of the 1619 Project. WSWS received considerable praise from right-wing commentators for its criticisms. For example, the National Review described it as "one of the few media outlets examining the 1619 Project in critical detail" and extensively cited contributions by historians Gordon S. Wood and James M. McPherson; the research director of the right-wing American Institute for Economic Research told the Dartmouth Review that there was a "strange alliance" between conservative historians and the Trotskyists of WSWS, who he described as "old-school historians" following the data; and Michael Barone in the conservative New York Post gave positive attention to historian Sean Wilentz's criticisms of the project in WSWS.
Criticism
In an article for the socialist magazine New Politics, the Lebanese Trotskyist academic Gilbert Achcar described the WSWS as "pro-Putin, pro-Assad and 'left-wing' propaganda" combined with "gutter journalism ... run by a 'Trotskyist' cult ... which perpetuates a long worn-out tradition of inter-Trotskyist sectarian quarrels in fulfilling its role as apologist for Putin, Assad, and their friends."Reason has said that a 2020 viral false account of New York University agreeing to racially segregated student housing was partially due to an inaccurate report on the World Socialist Website. Reason'' commented: "As a socialist publication, TWSW sometimes criticizes the progressive left for being preoccupied with issues unrelated to class."
References
External links
The Bulletin (1964–1974) Internet Archive, Marxists Internet Archive, www.marxists.org
International Committee of the Fourth International
Socialist publications
Socialist newspapers
American political websites
Multilingual news services
American news websites
Internet properties established in 1998
Trotskyist works
|
```javascript
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, callbacks = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId])
/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]);
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);
/******/ while(callbacks.length)
/******/ callbacks.shift().call(null, __webpack_require__);
/******/ if(moreModules[0]) {
/******/ installedModules[0] = 0;
/******/ return __webpack_require__(0);
/******/ }
/******/ };
/******/ // The module cache
/******/ var installedModules = {};
/******/ // object to store loaded and loading chunks
/******/ // "0" means "already loaded"
/******/ // Array means "loading", array contains callbacks
/******/ var installedChunks = {
/******/ 1:0
/******/ };
/******/ // 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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) {
/******/ // "0" is the signal for "already loaded"
/******/ if(installedChunks[chunkId] === 0)
/******/ return callback.call(null, __webpack_require__);
/******/ // an array means "currently loading".
/******/ if(installedChunks[chunkId] !== undefined) {
/******/ installedChunks[chunkId].push(callback);
/******/ } else {
/******/ // start chunk loading
/******/ installedChunks[chunkId] = [callback];
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ script.type = 'text/javascript';
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"0":"app"}[chunkId]||chunkId) + ".js";
/******/ head.appendChild(script);
/******/ }
/******/ };
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(1);
module.exports = __webpack_require__(159);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(2);
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule React
*/
'use strict';
var ReactDOM = __webpack_require__(3);
var ReactDOMServer = __webpack_require__(148);
var ReactIsomorphic = __webpack_require__(152);
var assign = __webpack_require__(39);
var deprecated = __webpack_require__(157);
// `version` will be added here by ReactIsomorphic.
var React = {};
assign(React, ReactIsomorphic);
assign(React, {
// ReactDOM
findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
// ReactDOMServer
renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
});
React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
module.exports = React;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOM
*/
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
'use strict';
var ReactCurrentOwner = __webpack_require__(5);
var ReactDOMTextComponent = __webpack_require__(6);
var ReactDefaultInjection = __webpack_require__(71);
var ReactInstanceHandles = __webpack_require__(45);
var ReactMount = __webpack_require__(28);
var ReactPerf = __webpack_require__(18);
var ReactReconciler = __webpack_require__(50);
var ReactUpdates = __webpack_require__(54);
var ReactVersion = __webpack_require__(146);
var findDOMNode = __webpack_require__(91);
var renderSubtreeIntoContainer = __webpack_require__(147);
var warning = __webpack_require__(25);
ReactDefaultInjection.inject();
var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
findDOMNode: findDOMNode,
render: render,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
version: ReactVersion,
/* eslint-disable camelcase */
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
};
// Inject the runtime into a devtools global hook regardless of browser.
// Allows for debugging when the hook is injected on the page.
/* eslint-enable camelcase */
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
CurrentOwner: ReactCurrentOwner,
InstanceHandles: ReactInstanceHandles,
Mount: ReactMount,
Reconciler: ReactReconciler,
TextComponent: ReactDOMTextComponent
});
}
if (process.env.NODE_ENV !== 'production') {
var ExecutionEnvironment = __webpack_require__(9);
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// First check if devtools is not installed
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
// If we're in Chrome or Firefox, provide a download link if not installed.
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
console.debug('Download the React DevTools for a better development experience: ' + 'path_to_url
}
}
// If we're in IE8, check to see if we are in compatibility mode and provide
// information on preventing compatibility mode
var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined;
var expectedFeatures = [
// shims
Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
// shams
Object.create, Object.freeze];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
console.error('One or more ES5 shim/shams expected by React are not available: ' + 'path_to_url
break;
}
}
}
}
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 4 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(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;
clearTimeout(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) {
setTimeout(drainQueue, 0);
}
};
// 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.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; };
/***/ },
/* 5 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactCurrentOwner
*/
'use strict';
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMTextComponent
* @typechecks static-only
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(7);
var DOMPropertyOperations = __webpack_require__(22);
var ReactComponentBrowserEnvironment = __webpack_require__(26);
var ReactMount = __webpack_require__(28);
var assign = __webpack_require__(39);
var escapeTextContentForBrowser = __webpack_require__(21);
var setTextContent = __webpack_require__(20);
var validateDOMNesting = __webpack_require__(70);
/**
* Text nodes violate a couple assumptions that React makes about components:
*
* - When mounting text into the DOM, adjacent text nodes are merged.
* - Text nodes cannot be assigned a React root ID.
*
* This component is used to wrap strings in elements so that they can undergo
* the same reconciliation that is applied to elements.
*
* TODO: Investigate representing React components in the DOM with text nodes.
*
* @class ReactDOMTextComponent
* @extends ReactComponent
* @internal
*/
var ReactDOMTextComponent = function (props) {
// This constructor and its argument is currently used by mocks.
};
assign(ReactDOMTextComponent.prototype, {
/**
* @param {ReactText} text
* @internal
*/
construct: function (text) {
// TODO: This is really a ReactText (ReactNode), not a ReactElement
this._currentElement = text;
this._stringText = '' + text;
// Properties
this._rootNodeID = null;
this._mountIndex = 0;
},
/**
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function (rootID, transaction, context) {
if (process.env.NODE_ENV !== 'production') {
if (context[validateDOMNesting.ancestorInfoContextKey]) {
validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
}
}
this._rootNodeID = rootID;
if (transaction.useCreateElement) {
var ownerDocument = context[ReactMount.ownerDocumentContextKey];
var el = ownerDocument.createElement('span');
DOMPropertyOperations.setAttributeForID(el, rootID);
// Populate node cache
ReactMount.getID(el);
setTextContent(el, this._stringText);
return el;
} else {
var escapedText = escapeTextContentForBrowser(this._stringText);
if (transaction.renderToStaticMarkup) {
// Normally we'd wrap this in a `span` for the reasons stated above, but
// since this is a situation where React won't take over (static pages),
// we can simply return the text as it is.
return escapedText;
}
return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
}
},
/**
* Updates this component by updating the text content.
*
* @param {ReactText} nextText The next text content
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function (nextText, transaction) {
if (nextText !== this._currentElement) {
this._currentElement = nextText;
var nextStringText = '' + nextText;
if (nextStringText !== this._stringText) {
// TODO: Save this as pending props and use performUpdateIfNecessary
// and/or updateComponent to do the actual update for consistency with
// other component types?
this._stringText = nextStringText;
var node = ReactMount.getNode(this._rootNodeID);
DOMChildrenOperations.updateTextContent(node, nextStringText);
}
}
},
unmountComponent: function () {
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
}
});
module.exports = ReactDOMTextComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule DOMChildrenOperations
* @typechecks static-only
*/
'use strict';
var Danger = __webpack_require__(8);
var ReactMultiChildUpdateTypes = __webpack_require__(16);
var ReactPerf = __webpack_require__(18);
var setInnerHTML = __webpack_require__(19);
var setTextContent = __webpack_require__(20);
var invariant = __webpack_require__(13);
/**
* Inserts `childNode` as a child of `parentNode` at the `index`.
*
* @param {DOMElement} parentNode Parent node in which to insert.
* @param {DOMElement} childNode Child node to insert.
* @param {number} index Index at which to insert the child.
* @internal
*/
function insertChildAt(parentNode, childNode, index) {
// By exploiting arrays returning `undefined` for an undefined index, we can
// rely exclusively on `insertBefore(node, null)` instead of also using
// `appendChild(node)`. However, using `undefined` is not allowed by all
// browsers so we must replace it with `null`.
// fix render order error in safari
// IE8 will throw error when index out of list size.
var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
parentNode.insertBefore(childNode, beforeChild);
}
/**
* Operations for updating with DOM children.
*/
var DOMChildrenOperations = {
dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
updateTextContent: setTextContent,
/**
* Updates a component's children by processing a series of updates. The
* update configurations are each expected to have a `parentNode` property.
*
* @param {array<object>} updates List of update configurations.
* @param {array<string>} markupList List of markup strings.
* @internal
*/
processUpdates: function (updates, markupList) {
var update;
// Mapping from parent IDs to initial child orderings.
var initialChildren = null;
// List of children that will be moved or removed.
var updatedChildren = null;
for (var i = 0; i < updates.length; i++) {
update = updates[i];
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
var updatedIndex = update.fromIndex;
var updatedChild = update.parentNode.childNodes[updatedIndex];
var parentID = update.parentID;
!updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined;
initialChildren = initialChildren || {};
initialChildren[parentID] = initialChildren[parentID] || [];
initialChildren[parentID][updatedIndex] = updatedChild;
updatedChildren = updatedChildren || [];
updatedChildren.push(updatedChild);
}
}
var renderedMarkup;
// markupList is either a list of markup or just a list of elements
if (markupList.length && typeof markupList[0] === 'string') {
renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
} else {
renderedMarkup = markupList;
}
// Remove updated children first so that `toIndex` is consistent.
if (updatedChildren) {
for (var j = 0; j < updatedChildren.length; j++) {
updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
}
}
for (var k = 0; k < updates.length; k++) {
update = updates[k];
switch (update.type) {
case ReactMultiChildUpdateTypes.INSERT_MARKUP:
insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex);
break;
case ReactMultiChildUpdateTypes.MOVE_EXISTING:
insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex);
break;
case ReactMultiChildUpdateTypes.SET_MARKUP:
setInnerHTML(update.parentNode, update.content);
break;
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
setTextContent(update.parentNode, update.content);
break;
case ReactMultiChildUpdateTypes.REMOVE_NODE:
// Already removed by the for-loop above.
break;
}
}
}
};
ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
updateTextContent: 'updateTextContent'
});
module.exports = DOMChildrenOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule Danger
* @typechecks static-only
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var createNodesFromMarkup = __webpack_require__(10);
var emptyFunction = __webpack_require__(15);
var getMarkupWrap = __webpack_require__(14);
var invariant = __webpack_require__(13);
var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
var RESULT_INDEX_ATTR = 'data-danger-index';
/**
* Extracts the `nodeName` from a string of markup.
*
* NOTE: Extracting the `nodeName` does not require a regular expression match
* because we make assumptions about React-generated markup (i.e. there are no
* spaces surrounding the opening tag and there is at least one attribute).
*
* @param {string} markup String of markup.
* @return {string} Node name of the supplied markup.
* @see path_to_url
*/
function getNodeName(markup) {
return markup.substring(1, markup.indexOf(' '));
}
var Danger = {
/**
* Renders markup into an array of nodes. The markup is expected to render
* into a list of root nodes. Also, the length of `resultList` and
* `markupList` should be the same.
*
* @param {array<string>} markupList List of markup strings to render.
* @return {array<DOMElement>} List of rendered nodes.
* @internal
*/
dangerouslyRenderMarkup: function (markupList) {
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined;
var nodeName;
var markupByNodeName = {};
// Group markup by `nodeName` if a wrap is necessary, else by '*'.
for (var i = 0; i < markupList.length; i++) {
!markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
nodeName = getNodeName(markupList[i]);
nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
markupByNodeName[nodeName][i] = markupList[i];
}
var resultList = [];
var resultListAssignmentCount = 0;
for (nodeName in markupByNodeName) {
if (!markupByNodeName.hasOwnProperty(nodeName)) {
continue;
}
var markupListByNodeName = markupByNodeName[nodeName];
// This for-in loop skips the holes of the sparse array. The order of
// iteration should follow the order of assignment, which happens to match
// numerical index order, but we don't rely on that.
var resultIndex;
for (resultIndex in markupListByNodeName) {
if (markupListByNodeName.hasOwnProperty(resultIndex)) {
var markup = markupListByNodeName[resultIndex];
// Push the requested markup with an additional RESULT_INDEX_ATTR
// attribute. If the markup does not start with a < character, it
// will be discarded below (with an appropriate console.error).
markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
// This index will be parsed back out below.
'$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
}
}
// Render each group of markup with similar wrapping `nodeName`.
var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
);
for (var j = 0; j < renderNodes.length; ++j) {
var renderNode = renderNodes[j];
if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
renderNode.removeAttribute(RESULT_INDEX_ATTR);
!!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
resultList[resultIndex] = renderNode;
// This should match resultList.length and markupList.length when
// we're done.
resultListAssignmentCount += 1;
} else if (process.env.NODE_ENV !== 'production') {
console.error('Danger: Discarding unexpected node:', renderNode);
}
}
}
// Although resultList was populated out of order, it should now be a dense
// array.
!(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
!(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
return resultList;
},
/**
* Replaces a node with a string of markup at its current position within its
* parent. The markup must render into a single root node.
*
* @param {DOMElement} oldChild Child node to replace.
* @param {string} markup Markup to render in place of the child node.
* @internal
*/
dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
!markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
!(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : undefined;
var newChild;
if (typeof markup === 'string') {
newChild = createNodesFromMarkup(markup, emptyFunction)[0];
} else {
newChild = markup;
}
oldChild.parentNode.replaceChild(newChild, oldChild);
}
};
module.exports = Danger;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 9 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ExecutionEnvironment
*/
'use strict';
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;
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule createNodesFromMarkup
* @typechecks
*/
/*eslint-disable fb-www/unsafe-html*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var createArrayFromMixed = __webpack_require__(11);
var getMarkupWrap = __webpack_require__(14);
var invariant = __webpack_require__(13);
/**
* Dummy container used to render all markup.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Pattern used by `getNodeName`.
*/
var nodeNamePattern = /^\s*<(\w+)/;
/**
* Extracts the `nodeName` of the first element in a string of markup.
*
* @param {string} markup String of markup.
* @return {?string} Node name of the supplied markup.
*/
function getNodeName(markup) {
var nodeNameMatch = markup.match(nodeNamePattern);
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
}
/**
* Creates an array containing the nodes rendered from the supplied markup. The
* optionally supplied `handleScript` function will be invoked once for each
* <script> element that is rendered. If no `handleScript` function is supplied,
* an exception is thrown if any <script> elements are rendered.
*
* @param {string} markup A string of valid HTML markup.
* @param {?function} handleScript Invoked once for each rendered <script>.
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
*/
function createNodesFromMarkup(markup, handleScript) {
var node = dummyNode;
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
var nodeName = getNodeName(markup);
var wrap = nodeName && getMarkupWrap(nodeName);
if (wrap) {
node.innerHTML = wrap[1] + markup + wrap[2];
var wrapDepth = wrap[0];
while (wrapDepth--) {
node = node.lastChild;
}
} else {
node.innerHTML = markup;
}
var scripts = node.getElementsByTagName('script');
if (scripts.length) {
!handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
createArrayFromMixed(scripts).forEach(handleScript);
}
var nodes = createArrayFromMixed(node.childNodes);
while (node.lastChild) {
node.removeChild(node.lastChild);
}
return nodes;
}
module.exports = createNodesFromMarkup;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule createArrayFromMixed
* @typechecks
*/
'use strict';
var toArray = __webpack_require__(12);
/**
* Perform a heuristic test to determine if an object is "array-like".
*
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
* Joshu replied: "Mu."
*
* This function determines if its argument has "array nature": it returns
* true if the argument is an actual array, an `arguments' object, or an
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
*
* It will return false for other array-like objects like Filelist.
*
* @param {*} obj
* @return {boolean}
*/
function hasArrayNature(obj) {
return(
// not null/false
!!obj && (
// arrays are objects, NodeLists are functions in Safari
typeof obj == 'object' || typeof obj == 'function') &&
// quacks like an array
'length' in obj &&
// not window
!('setInterval' in obj) &&
// no DOM node should be considered an array-like
// a 'select' element has 'length' and 'item' properties on IE8
typeof obj.nodeType != 'number' && (
// a real array
Array.isArray(obj) ||
// arguments
'callee' in obj ||
// HTMLCollection/NodeList
'item' in obj)
);
}
/**
* Ensure that the argument is an array by wrapping it in an array if it is not.
* Creates a copy of the argument if it is already an array.
*
* This is mostly useful idiomatically:
*
* var createArrayFromMixed = require('createArrayFromMixed');
*
* function takesOneOrMoreThings(things) {
* things = createArrayFromMixed(things);
* ...
* }
*
* This allows you to treat `things' as an array, but accept scalars in the API.
*
* If you need to convert an array-like object, like `arguments`, into an array
* use toArray instead.
*
* @param {*} obj
* @return {array}
*/
function createArrayFromMixed(obj) {
if (!hasArrayNature(obj)) {
return [obj];
} else if (Array.isArray(obj)) {
return obj.slice();
} else {
return toArray(obj);
}
}
module.exports = createArrayFromMixed;
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule toArray
* @typechecks
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* Convert array-like objects to arrays.
*
* This API assumes the caller knows the contents of the data type. For less
* well defined inputs use createArrayFromMixed.
*
* @param {object|function|filelist} obj
* @return {array}
*/
function toArray(obj) {
var length = obj.length;
// Some browse builtin objects can report typeof 'function' (e.g. NodeList in
// old versions of Safari).
!(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
!(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
!(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
// without method will throw during the slice call and skip straight to the
// fallback.
if (obj.hasOwnProperty) {
try {
return Array.prototype.slice.call(obj);
} catch (e) {
// IE < 9 does not support Array#slice on collections objects
}
}
// Fall back to copying key by key. This assumes all keys have a value,
// so will not preserve sparsely populated inputs.
var ret = Array(length);
for (var ii = 0; ii < length; ii++) {
ret[ii] = obj[ii];
}
return ret;
}
module.exports = toArray;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule invariant
*/
'use strict';
/**
* 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.
*/
function invariant(condition, format, a, b, c, d, e, f) {
if (process.env.NODE_ENV !== 'production') {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
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;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule getMarkupWrap
*/
/*eslint-disable fb-www/unsafe-html */
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var invariant = __webpack_require__(13);
/**
* Dummy container used to detect which wraps are necessary.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Some browsers cannot use `innerHTML` to render certain elements standalone,
* so we wrap them, render the wrapped nodes, then extract the desired node.
*
* In IE8, certain elements cannot render alone, so wrap all elements ('*').
*/
var shouldWrap = {};
var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '<table>', '</table>'];
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
var svgWrap = [1, '<svg xmlns="path_to_url">', '</svg>'];
var markupWrap = {
'*': [1, '?<div>', '</div>'],
'area': [1, '<map>', '</map>'],
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
'legend': [1, '<fieldset>', '</fieldset>'],
'param': [1, '<object>', '</object>'],
'tr': [2, '<table><tbody>', '</tbody></table>'],
'optgroup': selectWrap,
'option': selectWrap,
'caption': tableWrap,
'colgroup': tableWrap,
'tbody': tableWrap,
'tfoot': tableWrap,
'thead': tableWrap,
'td': trWrap,
'th': trWrap
};
// Initialize the SVG elements since we know they'll always need to be wrapped
// consistently. If they are created inside a <div> they will be initialized in
// the wrong namespace (and will not display).
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
svgElements.forEach(function (nodeName) {
markupWrap[nodeName] = svgWrap;
shouldWrap[nodeName] = true;
});
/**
* Gets the markup wrap configuration for the supplied `nodeName`.
*
* NOTE: This lazily detects which wraps are necessary for the current browser.
*
* @param {string} nodeName Lowercase `nodeName`.
* @return {?array} Markup wrap configuration, if applicable.
*/
function getMarkupWrap(nodeName) {
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
if (!markupWrap.hasOwnProperty(nodeName)) {
nodeName = '*';
}
if (!shouldWrap.hasOwnProperty(nodeName)) {
if (nodeName === '*') {
dummyNode.innerHTML = '<link />';
} else {
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
}
shouldWrap[nodeName] = !dummyNode.firstChild;
}
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}
module.exports = getMarkupWrap;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 15 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule emptyFunction
*/
"use strict";
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.
*/
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;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactMultiChildUpdateTypes
*/
'use strict';
var keyMirror = __webpack_require__(17);
/**
* When a component's children are updated, a series of update configuration
* objects are created in order to batch and serialize the required changes.
*
* Enumerates all the possible types of update configurations.
*
* @internal
*/
var ReactMultiChildUpdateTypes = keyMirror({
INSERT_MARKUP: null,
MOVE_EXISTING: null,
REMOVE_NODE: null,
SET_MARKUP: null,
TEXT_CONTENT: null
});
module.exports = ReactMultiChildUpdateTypes;
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule keyMirror
* @typechecks static-only
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* 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 (obj) {
var ret = {};
var key;
!(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
for (key in obj) {
if (!obj.hasOwnProperty(key)) {
continue;
}
ret[key] = key;
}
return ret;
};
module.exports = keyMirror;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactPerf
* @typechecks static-only
*/
'use strict';
/**
* ReactPerf is a general AOP system designed to measure performance. This
* module only has the hooks: see ReactDefaultPerf for the analysis tool.
*/
var ReactPerf = {
/**
* Boolean to enable/disable measurement. Set to false by default to prevent
* accidental logging and perf loss.
*/
enableMeasure: false,
/**
* Holds onto the measure function in use. By default, don't measure
* anything, but we'll override this if we inject a measure function.
*/
storedMeasure: _noMeasure,
/**
* @param {object} object
* @param {string} objectName
* @param {object<string>} methodNames
*/
measureMethods: function (object, objectName, methodNames) {
if (process.env.NODE_ENV !== 'production') {
for (var key in methodNames) {
if (!methodNames.hasOwnProperty(key)) {
continue;
}
object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
}
}
},
/**
* Use this to wrap methods you want to measure. Zero overhead in production.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
measure: function (objName, fnName, func) {
if (process.env.NODE_ENV !== 'production') {
var measuredFunc = null;
var wrapper = function () {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
}
return measuredFunc.apply(this, arguments);
}
return func.apply(this, arguments);
};
wrapper.displayName = objName + '_' + fnName;
return wrapper;
}
return func;
},
injection: {
/**
* @param {function} measure
*/
injectMeasure: function (measure) {
ReactPerf.storedMeasure = measure;
}
}
};
/**
* Simply passes through the measured function, without measuring it.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
function _noMeasure(objName, fnName, func) {
return func;
}
module.exports = ReactPerf;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule setInnerHTML
*/
/* globals MSApp */
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
/**
* Set the innerHTML property of a node, ensuring that whitespace is preserved
* even in IE8.
*
* @param {DOMElement} node
* @param {string} html
* @internal
*/
var setInnerHTML = function (node, html) {
node.innerHTML = html;
};
// Win8 apps: Allow all html to be inserted
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
setInnerHTML = function (node, html) {
MSApp.execUnsafeLocalFunction(function () {
node.innerHTML = html;
});
};
}
if (ExecutionEnvironment.canUseDOM) {
// IE8: When updating a just created node with innerHTML only leading
// whitespace is removed. When updating an existing node with innerHTML
// whitespace in root TextNodes is also collapsed.
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
// Feature detection; only IE8 is known to behave improperly like this.
var testElement = document.createElement('div');
testElement.innerHTML = ' ';
if (testElement.innerHTML === '') {
setInnerHTML = function (node, html) {
// Magic theory: IE8 supposedly differentiates between added and updated
// nodes when processing innerHTML, innerHTML on updated nodes suffers
// from worse whitespace behavior. Re-adding a node like this triggers
// the initial and more favorable whitespace behavior.
// TODO: What to do on a detached node?
if (node.parentNode) {
node.parentNode.replaceChild(node, node);
}
// We also implement a workaround for non-visible tags disappearing into
// thin air on IE8, this only happens if there is no visible text
// in-front of the non-visible tags. Piggyback on the whitespace fix
// and simply check if any non-visible tags appear in the source.
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
// Recover leading whitespace by temporarily prepending any character.
// \uFEFF has the potential advantage of being zero-width/invisible.
// UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
// in hopes that this is preserved even if "\uFEFF" is transformed to
// the actual Unicode character (by Babel, for example).
// path_to_url#L216
node.innerHTML = String.fromCharCode(0xFEFF) + html;
// deleteData leaves an empty `TextNode` which offsets the index of all
// children. Definitely want to avoid this.
var textNode = node.firstChild;
if (textNode.data.length === 1) {
node.removeChild(textNode);
} else {
textNode.deleteData(0, 1);
}
} else {
node.innerHTML = html;
}
};
}
}
module.exports = setInnerHTML;
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule setTextContent
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var escapeTextContentForBrowser = __webpack_require__(21);
var setInnerHTML = __webpack_require__(19);
/**
* Set the textContent property of a node, ensuring that whitespace is preserved
* even in IE8. innerText is a poor substitute for textContent and, among many
* issues, inserts <br> instead of the literal newline chars. innerHTML behaves
* as it should.
*
* @param {DOMElement} node
* @param {string} text
* @internal
*/
var setTextContent = function (node, text) {
node.textContent = text;
};
if (ExecutionEnvironment.canUseDOM) {
if (!('textContent' in document.documentElement)) {
setTextContent = function (node, text) {
setInnerHTML(node, escapeTextContentForBrowser(text));
};
}
}
module.exports = setTextContent;
/***/ },
/* 21 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule escapeTextContentForBrowser
*/
'use strict';
var ESCAPE_LOOKUP = {
'&': '&',
'>': '>',
'<': '<',
'"': '"',
'\'': '''
};
var ESCAPE_REGEX = /[&><"']/g;
function escaper(match) {
return ESCAPE_LOOKUP[match];
}
/**
* Escapes text to prevent scripting attacks.
*
* @param {*} text Text value to escape.
* @return {string} An escaped string.
*/
function escapeTextContentForBrowser(text) {
return ('' + text).replace(ESCAPE_REGEX, escaper);
}
module.exports = escapeTextContentForBrowser;
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule DOMPropertyOperations
* @typechecks static-only
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var ReactPerf = __webpack_require__(18);
var quoteAttributeValueForBrowser = __webpack_require__(24);
var warning = __webpack_require__(25);
// Simplified subset
var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
return true;
}
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
return false;
}
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
validatedAttributeNameCache[attributeName] = true;
return true;
}
illegalAttributeNameCache[attributeName] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
return false;
}
function shouldIgnoreValue(propertyInfo, value) {
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
}
if (process.env.NODE_ENV !== 'production') {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true
};
var warnedProperties = {};
var warnUnknownProperty = function (name) {
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return;
}
warnedProperties[name] = true;
var lowerCasedName = name.toLowerCase();
// data-* attributes should be lowercase; suggest the lowercase version
var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
// For now, only warn when we have a suggested correction. This prevents
// logging too much when using transferPropsTo.
process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
};
}
/**
* Operations for dealing with DOM properties.
*/
var DOMPropertyOperations = {
/**
* Creates markup for the ID property.
*
* @param {string} id Unescaped ID.
* @return {string} Markup string.
*/
createMarkupForID: function (id) {
return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
},
setAttributeForID: function (node, id) {
node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
},
/**
* Creates markup for a property.
*
* @param {string} name
* @param {*} value
* @return {?string} Markup string, or null if the property was invalid.
*/
createMarkupForProperty: function (name, value) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
if (shouldIgnoreValue(propertyInfo, value)) {
return '';
}
var attributeName = propertyInfo.attributeName;
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
return attributeName + '=""';
}
return attributeName + '=' + quoteAttributeValueForBrowser(value);
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
} else if (process.env.NODE_ENV !== 'production') {
warnUnknownProperty(name);
}
return null;
},
/**
* Creates markup for a custom property.
*
* @param {string} name
* @param {*} value
* @return {string} Markup string, or empty string if the property was invalid.
*/
createMarkupForCustomAttribute: function (name, value) {
if (!isAttributeNameSafe(name) || value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
},
/**
* Sets the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
* @param {*} value
*/
setValueForProperty: function (node, name, value) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, value);
} else if (shouldIgnoreValue(propertyInfo, value)) {
this.deleteValueForProperty(node, name);
} else if (propertyInfo.mustUseAttribute) {
var attributeName = propertyInfo.attributeName;
var namespace = propertyInfo.attributeNamespace;
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
if (namespace) {
node.setAttributeNS(namespace, attributeName, '' + value);
} else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
node.setAttribute(attributeName, '');
} else {
node.setAttribute(attributeName, '' + value);
}
} else {
var propName = propertyInfo.propertyName;
// Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
// property type before comparing; only `value` does and is string.
if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
// Contrary to `setAttribute`, object properties are properly
// `toString`ed by IE8/9.
node[propName] = value;
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
DOMPropertyOperations.setValueForAttribute(node, name, value);
} else if (process.env.NODE_ENV !== 'production') {
warnUnknownProperty(name);
}
},
setValueForAttribute: function (node, name, value) {
if (!isAttributeNameSafe(name)) {
return;
}
if (value == null) {
node.removeAttribute(name);
} else {
node.setAttribute(name, '' + value);
}
},
/**
* Deletes the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForProperty: function (node, name) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, undefined);
} else if (propertyInfo.mustUseAttribute) {
node.removeAttribute(propertyInfo.attributeName);
} else {
var propName = propertyInfo.propertyName;
var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
node[propName] = defaultValue;
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
node.removeAttribute(name);
} else if (process.env.NODE_ENV !== 'production') {
warnUnknownProperty(name);
}
}
};
ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
setValueForProperty: 'setValueForProperty',
setValueForAttribute: 'setValueForAttribute',
deleteValueForProperty: 'deleteValueForProperty'
});
module.exports = DOMPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule DOMProperty
* @typechecks static-only
*/
'use strict';
var invariant = __webpack_require__(13);
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var DOMPropertyInjection = {
/**
* Mapping from normalized, camelcased property names to a configuration that
* specifies how the associated DOM property should be accessed or rendered.
*/
MUST_USE_ATTRIBUTE: 0x1,
MUST_USE_PROPERTY: 0x2,
HAS_SIDE_EFFECTS: 0x4,
HAS_BOOLEAN_VALUE: 0x8,
HAS_NUMERIC_VALUE: 0x10,
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
/**
* Inject some specialized knowledge about the DOM. This takes a config object
* with the following properties:
*
* isCustomAttribute: function that given an attribute name will return true
* if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
* attributes where it's impossible to enumerate all of the possible
* attribute names,
*
* Properties: object mapping DOM property name to one of the
* DOMPropertyInjection constants or null. If your attribute isn't in here,
* it won't get written to the DOM.
*
* DOMAttributeNames: object mapping React attribute name to the DOM
* attribute name. Attribute names not specified use the **lowercase**
* normalized name.
*
* DOMAttributeNamespaces: object mapping React attribute name to the DOM
* attribute namespace URL. (Attribute names not specified use no namespace.)
*
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
* Property names not specified use the normalized name.
*
* DOMMutationMethods: Properties that require special mutation methods. If
* `value` is undefined, the mutation method should unset the property.
*
* @param {object} domPropertyConfig the config as described above.
*/
injectDOMPropertyConfig: function (domPropertyConfig) {
var Injection = DOMPropertyInjection;
var Properties = domPropertyConfig.Properties || {};
var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
if (domPropertyConfig.isCustomAttribute) {
DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
}
for (var propName in Properties) {
!!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined;
var lowerCased = propName.toLowerCase();
var propConfig = Properties[propName];
var propertyInfo = {
attributeName: lowerCased,
attributeNamespace: null,
propertyName: propName,
mutationMethod: null,
mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE),
mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
};
!(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined;
!(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined;
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[lowerCased] = propName;
}
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
propertyInfo.attributeName = attributeName;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[attributeName] = propName;
}
}
if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
}
if (DOMPropertyNames.hasOwnProperty(propName)) {
propertyInfo.propertyName = DOMPropertyNames[propName];
}
if (DOMMutationMethods.hasOwnProperty(propName)) {
propertyInfo.mutationMethod = DOMMutationMethods[propName];
}
DOMProperty.properties[propName] = propertyInfo;
}
}
};
var defaultValueCache = {};
/**
* DOMProperty exports lookup objects that can be used like functions:
*
* > DOMProperty.isValid['id']
* true
* > DOMProperty.isValid['foobar']
* undefined
*
* Although this may be confusing, it performs better in general.
*
* @see path_to_url
* @see path_to_url
*/
var DOMProperty = {
ID_ATTRIBUTE_NAME: 'data-reactid',
/**
* Map from property "standard name" to an object with info about how to set
* the property in the DOM. Each object contains:
*
* attributeName:
* Used when rendering markup or with `*Attribute()`.
* attributeNamespace
* propertyName:
* Used on DOM node instances. (This includes properties that mutate due to
* external factors.)
* mutationMethod:
* If non-null, used instead of the property or `setAttribute()` after
* initial render.
* mustUseAttribute:
* Whether the property must be accessed and mutated using `*Attribute()`.
* (This includes anything that fails `<propName> in <element>`.)
* mustUseProperty:
* Whether the property must be accessed and mutated as an object property.
* hasSideEffects:
* Whether or not setting a value causes side effects such as triggering
* resources to be loaded or text selection changes. If true, we read from
* the DOM before updating to ensure that the value is only set if it has
* changed.
* hasBooleanValue:
* Whether the property should be removed when set to a falsey value.
* hasNumericValue:
* Whether the property must be numeric or parse as a numeric and should be
* removed when set to a falsey value.
* hasPositiveNumericValue:
* Whether the property must be positive numeric or parse as a positive
* numeric and should be removed when set to a falsey value.
* hasOverloadedBooleanValue:
* Whether the property can be used as a flag as well as with a value.
* Removed when strictly equal to false; present without a value when
* strictly equal to true; present with a value otherwise.
*/
properties: {},
/**
* Mapping from lowercase property names to the properly cased version, used
* to warn in the case of missing properties. Available only in __DEV__.
* @type {Object}
*/
getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
/**
* All of the isCustomAttribute() functions that have been injected.
*/
_isCustomAttributeFunctions: [],
/**
* Checks whether a property name is a custom attribute.
* @method
*/
isCustomAttribute: function (attributeName) {
for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
if (isCustomAttributeFn(attributeName)) {
return true;
}
}
return false;
},
/**
* Returns the default property value for a DOM property (i.e., not an
* attribute). Most default values are '' or false, but not all. Worse yet,
* some (in particular, `type`) vary depending on the type of element.
*
* TODO: Is it better to grab all the possible properties when creating an
* element to avoid having to create the same element twice?
*/
getDefaultValueForProperty: function (nodeName, prop) {
var nodeDefaults = defaultValueCache[nodeName];
var testElement;
if (!nodeDefaults) {
defaultValueCache[nodeName] = nodeDefaults = {};
}
if (!(prop in nodeDefaults)) {
testElement = document.createElement(nodeName);
nodeDefaults[prop] = testElement[prop];
}
return nodeDefaults[prop];
},
injection: DOMPropertyInjection
};
module.exports = DOMProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule quoteAttributeValueForBrowser
*/
'use strict';
var escapeTextContentForBrowser = __webpack_require__(21);
/**
* Escapes attribute value to prevent scripting attacks.
*
* @param {*} value Value to escape.
* @return {string} An escaped string.
*/
function quoteAttributeValueForBrowser(value) {
return '"' + escapeTextContentForBrowser(value) + '"';
}
module.exports = quoteAttributeValueForBrowser;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule warning
*/
'use strict';
var emptyFunction = __webpack_require__(15);
/**
* 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 (process.env.NODE_ENV !== 'production') {
warning = function (condition, format) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
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) {
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) {}
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactComponentBrowserEnvironment
*/
'use strict';
var ReactDOMIDOperations = __webpack_require__(27);
var ReactMount = __webpack_require__(28);
/**
* Abstracts away all functionality of the reconciler that requires knowledge of
* the browser context. TODO: These callers should be refactored to avoid the
* need for this injection.
*/
var ReactComponentBrowserEnvironment = {
processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
/**
* If a particular environment requires that some resources be cleaned up,
* specify this in the injected Mixin. In the DOM, we would likely want to
* purge any cached node ID lookups.
*
* @private
*/
unmountIDFromEnvironment: function (rootNodeID) {
ReactMount.purgeID(rootNodeID);
}
};
module.exports = ReactComponentBrowserEnvironment;
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMIDOperations
* @typechecks static-only
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(7);
var DOMPropertyOperations = __webpack_require__(22);
var ReactMount = __webpack_require__(28);
var ReactPerf = __webpack_require__(18);
var invariant = __webpack_require__(13);
/**
* Errors for properties that should not be updated with `updatePropertyByID()`.
*
* @type {object}
* @private
*/
var INVALID_PROPERTY_ERRORS = {
dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
style: '`style` must be set using `updateStylesByID()`.'
};
/**
* Operations used to process updates to DOM nodes.
*/
var ReactDOMIDOperations = {
/**
* Updates a DOM node with new property values. This should only be used to
* update DOM properties in `DOMProperty`.
*
* @param {string} id ID of the node to update.
* @param {string} name A valid property name, see `DOMProperty`.
* @param {*} value New value of the property.
* @internal
*/
updatePropertyByID: function (id, name, value) {
var node = ReactMount.getNode(id);
!!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
// If we're updating to null or undefined, we should remove the property
// from the DOM node instead of inadvertantly setting to a string. This
// brings us in line with the same behavior we have on initial render.
if (value != null) {
DOMPropertyOperations.setValueForProperty(node, name, value);
} else {
DOMPropertyOperations.deleteValueForProperty(node, name);
}
},
/**
* Replaces a DOM node that exists in the document with markup.
*
* @param {string} id ID of child to be replaced.
* @param {string} markup Dangerous markup to inject in place of child.
* @internal
* @see {Danger.dangerouslyReplaceNodeWithMarkup}
*/
dangerouslyReplaceNodeWithMarkupByID: function (id, markup) {
var node = ReactMount.getNode(id);
DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
},
/**
* Updates a component's children by processing a series of updates.
*
* @param {array<object>} updates List of update configurations.
* @param {array<string>} markup List of markup strings.
* @internal
*/
dangerouslyProcessChildrenUpdates: function (updates, markup) {
for (var i = 0; i < updates.length; i++) {
updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
}
DOMChildrenOperations.processUpdates(updates, markup);
}
};
ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
});
module.exports = ReactDOMIDOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactMount
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var ReactBrowserEventEmitter = __webpack_require__(29);
var ReactCurrentOwner = __webpack_require__(5);
var ReactDOMFeatureFlags = __webpack_require__(41);
var ReactElement = __webpack_require__(42);
var ReactEmptyComponentRegistry = __webpack_require__(44);
var ReactInstanceHandles = __webpack_require__(45);
var ReactInstanceMap = __webpack_require__(47);
var ReactMarkupChecksum = __webpack_require__(48);
var ReactPerf = __webpack_require__(18);
var ReactReconciler = __webpack_require__(50);
var ReactUpdateQueue = __webpack_require__(53);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var emptyObject = __webpack_require__(58);
var containsNode = __webpack_require__(59);
var instantiateReactComponent = __webpack_require__(62);
var invariant = __webpack_require__(13);
var setInnerHTML = __webpack_require__(19);
var shouldUpdateReactComponent = __webpack_require__(67);
var validateDOMNesting = __webpack_require__(70);
var warning = __webpack_require__(25);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var nodeCache = {};
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2);
/** Mapping from reactRootID to React component instance. */
var instancesByReactRootID = {};
/** Mapping from reactRootID to `container` nodes. */
var containersByReactRootID = {};
if (process.env.NODE_ENV !== 'production') {
/** __DEV__-only mapping from reactRootID to root elements. */
var rootElementsByReactRootID = {};
}
// Used to store breadth-first search state in findComponentRoot.
var findComponentRootReusableArray = [];
/**
* Finds the index of the first character
* that's not common between the two given strings.
*
* @return {number} the index of the character where the strings diverge
*/
function firstDifferenceIndex(string1, string2) {
var minLen = Math.min(string1.length, string2.length);
for (var i = 0; i < minLen; i++) {
if (string1.charAt(i) !== string2.charAt(i)) {
return i;
}
}
return string1.length === string2.length ? -1 : minLen;
}
/**
* @param {DOMElement|DOMDocument} container DOM element that may contain
* a React component
* @return {?*} DOM element that may have the reactRoot ID, or null.
*/
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOC_NODE_TYPE) {
return container.documentElement;
} else {
return container.firstChild;
}
}
/**
* @param {DOMElement} container DOM element that may contain a React component.
* @return {?string} A "reactRoot" ID, if a React component is rendered.
*/
function getReactRootID(container) {
var rootElement = getReactRootElementInContainer(container);
return rootElement && ReactMount.getID(rootElement);
}
/**
* Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
* element can return its control whose name or ID equals ATTR_NAME. All
* DOM nodes support `getAttributeNode` but this can also get called on
* other objects so just return '' if we're given something other than a
* DOM node (such as window).
*
* @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
* @return {string} ID of the supplied `domNode`.
*/
function getID(node) {
var id = internalGetID(node);
if (id) {
if (nodeCache.hasOwnProperty(id)) {
var cached = nodeCache[id];
if (cached !== node) {
!!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
nodeCache[id] = node;
}
} else {
nodeCache[id] = node;
}
}
return id;
}
function internalGetID(node) {
// If node is something like a window, document, or text node, none of
// which support attributes or a .getAttribute method, gracefully return
// the empty string, as if the attribute were missing.
return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
}
/**
* Sets the React-specific ID of the given node.
*
* @param {DOMElement} node The DOM node whose ID will be set.
* @param {string} id The value of the ID attribute.
*/
function setID(node, id) {
var oldID = internalGetID(node);
if (oldID !== id) {
delete nodeCache[oldID];
}
node.setAttribute(ATTR_NAME, id);
nodeCache[id] = node;
}
/**
* Finds the node with the supplied React-generated DOM ID.
*
* @param {string} id A React-generated DOM ID.
* @return {DOMElement} DOM node with the suppled `id`.
* @internal
*/
function getNode(id) {
if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
nodeCache[id] = ReactMount.findReactNodeByID(id);
}
return nodeCache[id];
}
/**
* Finds the node with the supplied public React instance.
*
* @param {*} instance A public React instance.
* @return {?DOMElement} DOM node with the suppled `id`.
* @internal
*/
function getNodeFromInstance(instance) {
var id = ReactInstanceMap.get(instance)._rootNodeID;
if (ReactEmptyComponentRegistry.isNullComponentID(id)) {
return null;
}
if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
nodeCache[id] = ReactMount.findReactNodeByID(id);
}
return nodeCache[id];
}
/**
* A node is "valid" if it is contained by a currently mounted container.
*
* This means that the node does not have to be contained by a document in
* order to be considered valid.
*
* @param {?DOMElement} node The candidate DOM node.
* @param {string} id The expected ID of the node.
* @return {boolean} Whether the node is contained by a mounted container.
*/
function isValid(node, id) {
if (node) {
!(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
var container = ReactMount.findReactContainerForID(id);
if (container && containsNode(container, node)) {
return true;
}
}
return false;
}
/**
* Causes the cache to forget about one React-specific ID.
*
* @param {string} id The ID to forget.
*/
function purgeID(id) {
delete nodeCache[id];
}
var deepestNodeSoFar = null;
function findDeepestCachedAncestorImpl(ancestorID) {
var ancestor = nodeCache[ancestorID];
if (ancestor && isValid(ancestor, ancestorID)) {
deepestNodeSoFar = ancestor;
} else {
// This node isn't populated in the cache, so presumably none of its
// descendants are. Break out of the loop.
return false;
}
}
/**
* Return the deepest cached node whose ID is a prefix of `targetID`.
*/
function findDeepestCachedAncestor(targetID) {
deepestNodeSoFar = null;
ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);
var foundNode = deepestNodeSoFar;
deepestNodeSoFar = null;
return foundNode;
}
/**
* Mounts this component and inserts it into the DOM.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {ReactReconcileTransaction} transaction
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
if (ReactDOMFeatureFlags.useCreateElement) {
context = assign({}, context);
if (container.nodeType === DOC_NODE_TYPE) {
context[ownerDocumentContextKey] = container;
} else {
context[ownerDocumentContextKey] = container.ownerDocument;
}
}
if (process.env.NODE_ENV !== 'production') {
if (context === emptyObject) {
context = {};
}
var tag = container.nodeName.toLowerCase();
context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
}
var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
componentInstance._renderedComponent._topLevelWrapper = componentInstance;
ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction);
}
/**
* Batched mount.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) {
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
/* forceHTML */shouldReuseMarkup);
transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context);
ReactUpdates.ReactReconcileTransaction.release(transaction);
}
/**
* Unmounts a component and removes it from the DOM.
*
* @param {ReactComponent} instance React component instance.
* @param {DOMElement} container DOM element to unmount from.
* @final
* @internal
* @see {ReactMount.unmountComponentAtNode}
*/
function unmountComponentFromNode(instance, container) {
ReactReconciler.unmountComponent(instance);
if (container.nodeType === DOC_NODE_TYPE) {
container = container.documentElement;
}
// path_to_url
while (container.lastChild) {
container.removeChild(container.lastChild);
}
}
/**
* True if the supplied DOM node has a direct React-rendered child that is
* not a React root element. Useful for warning in `render`,
* `unmountComponentAtNode`, etc.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM element contains a direct child that was
* rendered by React but is not a root element.
* @internal
*/
function hasNonRootReactChild(node) {
var reactRootID = getReactRootID(node);
return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false;
}
/**
* Returns the first (deepest) ancestor of a node which is rendered by this copy
* of React.
*/
function findFirstReactDOMImpl(node) {
// This node might be from another React instance, so we make sure not to
// examine the node cache here
for (; node && node.parentNode !== node; node = node.parentNode) {
if (node.nodeType !== 1) {
// Not a DOMElement, therefore not a React component
continue;
}
var nodeID = internalGetID(node);
if (!nodeID) {
continue;
}
var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
// If containersByReactRootID contains the container we find by crawling up
// the tree, we know that this instance of React rendered the node.
// nb. isValid's strategy (with containsNode) does not work because render
// trees may be nested and we don't want a false positive in that case.
var current = node;
var lastID;
do {
lastID = internalGetID(current);
current = current.parentNode;
if (current == null) {
// The passed-in node has been detached from the container it was
// originally rendered into.
return null;
}
} while (lastID !== reactRootID);
if (current === containersByReactRootID[reactRootID]) {
return node;
}
}
return null;
}
/**
* Temporary (?) hack so that we can store all top-level pending updates on
* composites instead of having to worry about different types of components
* here.
*/
var TopLevelWrapper = function () {};
TopLevelWrapper.prototype.isReactComponent = {};
if (process.env.NODE_ENV !== 'production') {
TopLevelWrapper.displayName = 'TopLevelWrapper';
}
TopLevelWrapper.prototype.render = function () {
// this.props is actually a ReactElement
return this.props;
};
/**
* Mounting is the process of initializing a React component by creating its
* representative DOM elements and inserting them into a supplied `container`.
* Any prior content inside `container` is destroyed in the process.
*
* ReactMount.render(
* component,
* document.getElementById('container')
* );
*
* <div id="container"> <-- Supplied `container`.
* <div data-reactid=".3"> <-- Rendered reactRoot of React
* // ... component.
* </div>
* </div>
*
* Inside of `container`, the first element rendered is the "reactRoot".
*/
var ReactMount = {
TopLevelWrapper: TopLevelWrapper,
/** Exposed for debugging purposes **/
_instancesByReactRootID: instancesByReactRootID,
/**
* This is a hook provided to support rendering React components while
* ensuring that the apparent scroll position of its `container` does not
* change.
*
* @param {DOMElement} container The `container` being rendered into.
* @param {function} renderCallback This must be called once to do the render.
*/
scrollMonitor: function (container, renderCallback) {
renderCallback();
},
/**
* Take a component that's already mounted into the DOM and replace its props
* @param {ReactComponent} prevComponent component instance already in the DOM
* @param {ReactElement} nextElement component instance to render
* @param {DOMElement} container container to render into
* @param {?function} callback function triggered on completion
*/
_updateRootComponent: function (prevComponent, nextElement, container, callback) {
ReactMount.scrollMonitor(container, function () {
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
if (callback) {
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
}
});
if (process.env.NODE_ENV !== 'production') {
// Record the root element in case it later gets transplanted.
rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
}
return prevComponent;
},
/**
* Register a component into the instance map and starts scroll value
* monitoring
* @param {ReactComponent} nextComponent component instance to render
* @param {DOMElement} container container to render into
* @return {string} reactRoot ID prefix
*/
_registerComponent: function (nextComponent, container) {
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
var reactRootID = ReactMount.registerContainer(container);
instancesByReactRootID[reactRootID] = nextComponent;
return reactRootID;
},
/**
* Render a new component into the DOM.
* @param {ReactElement} nextElement element to render
* @param {DOMElement} container container to render into
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion
* @return {ReactComponent} nextComponent
*/
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case.
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
var componentInstance = instantiateReactComponent(nextElement, null);
var reactRootID = ReactMount._registerComponent(componentInstance, container);
// The initial render is synchronous but any updates that happen during
// rendering, in componentWillMount or componentDidMount, will be batched
// according to the current batching strategy.
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
if (process.env.NODE_ENV !== 'production') {
// Record the root element in case it later gets transplanted.
rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
}
return componentInstance;
},
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactComponent} parentComponent The conceptual parent of this render tree.
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`.
*/
renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
!(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
},
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
!ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
// Check if it quacks like an element
nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined;
var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
var prevComponent = instancesByReactRootID[getReactRootID(container)];
if (prevComponent) {
var prevWrappedElement = prevComponent._currentElement;
var prevElement = prevWrappedElement.props;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
var publicInst = prevComponent._renderedComponent.getPublicInstance();
var updatedCallback = callback && function () {
callback.call(publicInst);
};
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
return publicInst;
} else {
ReactMount.unmountComponentAtNode(container);
}
}
var reactRootElement = getReactRootElementInContainer(container);
var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
var containerHasNonRootReactChild = hasNonRootReactChild(container);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined;
if (!containerHasReactMarkup || reactRootElement.nextSibling) {
var rootElementSibling = reactRootElement;
while (rootElementSibling) {
if (internalGetID(rootElementSibling)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined;
break;
}
rootElementSibling = rootElementSibling.nextSibling;
}
}
}
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
if (callback) {
callback.call(component);
}
return component;
},
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`.
*/
render: function (nextElement, container, callback) {
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
},
/**
* Registers a container node into which React components will be rendered.
* This also creates the "reactRoot" ID that will be assigned to the element
* rendered within.
*
* @param {DOMElement} container DOM element to register as a container.
* @return {string} The "reactRoot" ID of elements rendered within.
*/
registerContainer: function (container) {
var reactRootID = getReactRootID(container);
if (reactRootID) {
// If one exists, make sure it is a valid "reactRoot" ID.
reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
}
if (!reactRootID) {
// No valid "reactRoot" ID found, create one.
reactRootID = ReactInstanceHandles.createReactRootID();
}
containersByReactRootID[reactRootID] = container;
return reactRootID;
},
/**
* Unmounts and destroys the React component rendered in the `container`.
*
* @param {DOMElement} container DOM element containing a React component.
* @return {boolean} True if a component was found in and unmounted from
* `container`
*/
unmountComponentAtNode: function (container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (Strictly speaking, unmounting won't cause a
// render but we still don't expect to be in a render call here.)
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
var reactRootID = getReactRootID(container);
var component = instancesByReactRootID[reactRootID];
if (!component) {
// Check if the node being unmounted was rendered by React, but isn't a
// root node.
var containerHasNonRootReactChild = hasNonRootReactChild(container);
// Check if the container itself is a React root node.
var containerID = internalGetID(container);
var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined;
}
return false;
}
ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
delete instancesByReactRootID[reactRootID];
delete containersByReactRootID[reactRootID];
if (process.env.NODE_ENV !== 'production') {
delete rootElementsByReactRootID[reactRootID];
}
return true;
},
/**
* Finds the container DOM element that contains React component to which the
* supplied DOM `id` belongs.
*
* @param {string} id The ID of an element rendered by a React component.
* @return {?DOMElement} DOM element that contains the `id`.
*/
findReactContainerForID: function (id) {
var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
var container = containersByReactRootID[reactRootID];
if (process.env.NODE_ENV !== 'production') {
var rootElement = rootElementsByReactRootID[reactRootID];
if (rootElement && rootElement.parentNode !== container) {
process.env.NODE_ENV !== 'production' ? warning(
// Call internalGetID here because getID calls isValid which calls
// findReactContainerForID (this function).
internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
var containerChild = container.firstChild;
if (containerChild && reactRootID === internalGetID(containerChild)) {
// If the container has a new child with the same ID as the old
// root element, then rootElementsByReactRootID[reactRootID] is
// just stale and needs to be updated. The case that deserves a
// warning is when the container is empty.
rootElementsByReactRootID[reactRootID] = containerChild;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
}
}
}
return container;
},
/**
* Finds an element rendered by React with the supplied ID.
*
* @param {string} id ID of a DOM node in the React component.
* @return {DOMElement} Root DOM node of the React component.
*/
findReactNodeByID: function (id) {
var reactRoot = ReactMount.findReactContainerForID(id);
return ReactMount.findComponentRoot(reactRoot, id);
},
/**
* Traverses up the ancestors of the supplied node to find a node that is a
* DOM representation of a React component rendered by this copy of React.
*
* @param {*} node
* @return {?DOMEventTarget}
* @internal
*/
getFirstReactDOM: function (node) {
return findFirstReactDOMImpl(node);
},
/**
* Finds a node with the supplied `targetID` inside of the supplied
* `ancestorNode`. Exploits the ID naming scheme to perform the search
* quickly.
*
* @param {DOMEventTarget} ancestorNode Search from this root.
* @pararm {string} targetID ID of the DOM representation of the component.
* @return {DOMEventTarget} DOM node with the supplied `targetID`.
* @internal
*/
findComponentRoot: function (ancestorNode, targetID) {
var firstChildren = findComponentRootReusableArray;
var childIndex = 0;
var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
if (process.env.NODE_ENV !== 'production') {
// This will throw on the next line; give an early warning
process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined;
}
firstChildren[0] = deepestAncestor.firstChild;
firstChildren.length = 1;
while (childIndex < firstChildren.length) {
var child = firstChildren[childIndex++];
var targetChild;
while (child) {
var childID = ReactMount.getID(child);
if (childID) {
// Even if we find the node we're looking for, we finish looping
// through its siblings to ensure they're cached so that we don't have
// to revisit this node again. Otherwise, we make n^2 calls to getID
// when visiting the many children of a single node in order.
if (targetID === childID) {
targetChild = child;
} else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
// If we find a child whose ID is an ancestor of the given ID,
// then we can be sure that we only want to search the subtree
// rooted at this child, so we can throw out the rest of the
// search state.
firstChildren.length = childIndex = 0;
firstChildren.push(child.firstChild);
}
} else {
// If this child had no ID, then there's a chance that it was
// injected automatically by the browser, as when a `<table>`
// element sprouts an extra `<tbody>` child as a side effect of
// `.innerHTML` parsing. Optimistically continue down this
// branch, but not before examining the other siblings.
firstChildren.push(child.firstChild);
}
child = child.nextSibling;
}
if (targetChild) {
// Emptying firstChildren/findComponentRootReusableArray is
// not necessary for correctness, but it helps the GC reclaim
// any nodes that were left at the end of the search.
firstChildren.length = 0;
return targetChild;
}
}
firstChildren.length = 0;
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
},
_mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) {
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
if (shouldReuseMarkup) {
var rootElement = getReactRootElementInContainer(container);
if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
return;
} else {
var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
var rootMarkup = rootElement.outerHTML;
rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
var normalizedMarkup = markup;
if (process.env.NODE_ENV !== 'production') {
// because rootMarkup is retrieved from the DOM, various normalizations
// will have occurred which will not be present in `markup`. Here,
// insert markup into a <div> or <iframe> depending on the container
// type to perform the same normalizations before comparing.
var normalizer;
if (container.nodeType === ELEMENT_NODE_TYPE) {
normalizer = document.createElement('div');
normalizer.innerHTML = markup;
normalizedMarkup = normalizer.innerHTML;
} else {
normalizer = document.createElement('iframe');
document.body.appendChild(normalizer);
normalizer.contentDocument.write(markup);
normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
document.body.removeChild(normalizer);
}
}
var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined;
}
}
}
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
if (transaction.useCreateElement) {
while (container.lastChild) {
container.removeChild(container.lastChild);
}
container.appendChild(markup);
} else {
setInnerHTML(container, markup);
}
},
ownerDocumentContextKey: ownerDocumentContextKey,
/**
* React ID utilities.
*/
getReactRootID: getReactRootID,
getID: getID,
setID: setID,
getNode: getNode,
getNodeFromInstance: getNodeFromInstance,
isValid: isValid,
purgeID: purgeID
};
ReactPerf.measureMethods(ReactMount, 'ReactMount', {
_renderNewRootComponent: '_renderNewRootComponent',
_mountImageIntoNode: '_mountImageIntoNode'
});
module.exports = ReactMount;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactBrowserEventEmitter
* @typechecks static-only
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPluginHub = __webpack_require__(31);
var EventPluginRegistry = __webpack_require__(32);
var ReactEventEmitterMixin = __webpack_require__(37);
var ReactPerf = __webpack_require__(18);
var ViewportMetrics = __webpack_require__(38);
var assign = __webpack_require__(39);
var isEventSupported = __webpack_require__(40);
/**
* Summary of `ReactBrowserEventEmitter` event handling:
*
* - Top-level delegation is used to trap most native browser events. This
* may only occur in the main thread and is the responsibility of
* ReactEventListener, which is injected and can therefore support pluggable
* event sources. This is the only work that occurs in the main thread.
*
* - We normalize and de-duplicate events to account for browser quirks. This
* may be done in the worker thread.
*
* - Forward these native events (with the associated top-level type used to
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want
* to extract any synthetic events.
*
* - The `EventPluginHub` will then process each event by annotating them with
* "dispatches", a sequence of listeners and IDs that care about that event.
*
* - The `EventPluginHub` then dispatches the events.
*
* Overview of React and the event system:
*
* +------------+ .
* | DOM | .
* +------------+ .
* | .
* v .
* +------------+ .
* | ReactEvent | .
* | Listener | .
* +------------+ . +-----------+
* | . +--------+|SimpleEvent|
* | . | |Plugin |
* +-----|------+ . v +-----------+
* | | | . +--------------+ +------------+
* | +-----------.--->|EventPluginHub| | Event |
* | | . | | +-----------+ | Propagators|
* | ReactEvent | . | | |TapEvent | |------------|
* | Emitter | . | |<---+|Plugin | |other plugin|
* | | . | | +-----------+ | utilities |
* | +-----------.--->| | +------------+
* | | | . +--------------+
* +-----|------+ . ^ +-----------+
* | . | |Enter/Leave|
* + . +-------+|Plugin |
* +-------------+ . +-----------+
* | application | .
* |-------------| .
* | | .
* | | .
* +-------------+ .
* .
* React Core . General Purpose Event Plugin System
*/
var alreadyListeningTo = {};
var isMonitoringScrollValue = false;
var reactTopListenersCounter = 0;
// For events like 'submit' which don't consistently bubble (which we trap at a
// lower node than `document`), binding at `document` would cause duplicate
// events so we don't include them here
var topEventMapping = {
topAbort: 'abort',
topBlur: 'blur',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topChange: 'change',
topClick: 'click',
topCompositionEnd: 'compositionend',
topCompositionStart: 'compositionstart',
topCompositionUpdate: 'compositionupdate',
topContextMenu: 'contextmenu',
topCopy: 'copy',
topCut: 'cut',
topDoubleClick: 'dblclick',
topDrag: 'drag',
topDragEnd: 'dragend',
topDragEnter: 'dragenter',
topDragExit: 'dragexit',
topDragLeave: 'dragleave',
topDragOver: 'dragover',
topDragStart: 'dragstart',
topDrop: 'drop',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topFocus: 'focus',
topInput: 'input',
topKeyDown: 'keydown',
topKeyPress: 'keypress',
topKeyUp: 'keyup',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topMouseDown: 'mousedown',
topMouseMove: 'mousemove',
topMouseOut: 'mouseout',
topMouseOver: 'mouseover',
topMouseUp: 'mouseup',
topPaste: 'paste',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topScroll: 'scroll',
topSeeked: 'seeked',
topSeeking: 'seeking',
topSelectionChange: 'selectionchange',
topStalled: 'stalled',
topSuspend: 'suspend',
topTextInput: 'textInput',
topTimeUpdate: 'timeupdate',
topTouchCancel: 'touchcancel',
topTouchEnd: 'touchend',
topTouchMove: 'touchmove',
topTouchStart: 'touchstart',
topVolumeChange: 'volumechange',
topWaiting: 'waiting',
topWheel: 'wheel'
};
/**
* To ensure no conflicts with other potential React instances on the page
*/
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
function getListeningForDocument(mountAt) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
// directly.
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
mountAt[topListenersIDKey] = reactTopListenersCounter++;
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
}
return alreadyListeningTo[mountAt[topListenersIDKey]];
}
/**
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
* example:
*
* ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
*
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
*
* @internal
*/
var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
/**
* Injectable event backend
*/
ReactEventListener: null,
injection: {
/**
* @param {object} ReactEventListener
*/
injectReactEventListener: function (ReactEventListener) {
ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
}
},
/**
* Sets whether or not any created callbacks should be enabled.
*
* @param {boolean} enabled True if callbacks should be enabled.
*/
setEnabled: function (enabled) {
if (ReactBrowserEventEmitter.ReactEventListener) {
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
}
},
/**
* @return {boolean} True if callbacks are enabled.
*/
isEnabled: function () {
return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
},
/**
* We listen for bubbled touch events on the document object.
*
* Firefox v8.01 (and possibly others) exhibited strange behavior when
* mounting `onmousemove` events at some node that was not the document
* element. The symptoms were that if your mouse is not moving over something
* contained within that mount point (for example on the background) the
* top-level listeners for `onmousemove` won't be called. However, if you
* register the `mousemove` on the document object, then it will of course
* catch all `mousemove`s. This along with iOS quirks, justifies restricting
* top-level listeners to the document object only, at least for these
* movement types of events and possibly all events.
*
* @see path_to_url
*
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
* they bubble to document.
*
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {object} contentDocumentHandle Document which owns the container
*/
listenTo: function (registrationName, contentDocumentHandle) {
var mountAt = contentDocumentHandle;
var isListening = getListeningForDocument(mountAt);
var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
var topLevelTypes = EventConstants.topLevelTypes;
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
if (dependency === topLevelTypes.topWheel) {
if (isEventSupported('wheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
} else if (isEventSupported('mousewheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
} else {
// Firefox needs to capture a different mouse scroll event.
// @see path_to_url
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
}
} else if (dependency === topLevelTypes.topScroll) {
if (isEventSupported('scroll', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
} else {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
}
} else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
if (isEventSupported('focus', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
} else if (isEventSupported('focusin')) {
// IE has `focusin` and `focusout` events which bubble.
// @see path_to_url
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
}
// to make sure blur and focus event listeners are only attached once
isListening[topLevelTypes.topBlur] = true;
isListening[topLevelTypes.topFocus] = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
}
isListening[dependency] = true;
}
}
},
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
},
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
},
/**
* Listens to window scroll and resize events. We cache scroll values so that
* application code can access them without triggering reflows.
*
* NOTE: Scroll events do not bubble.
*
* @see path_to_url
*/
ensureScrollValueMonitoring: function () {
if (!isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
isMonitoringScrollValue = true;
}
},
eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
registrationNameModules: EventPluginHub.registrationNameModules,
putListener: EventPluginHub.putListener,
getListener: EventPluginHub.getListener,
deleteListener: EventPluginHub.deleteListener,
deleteAllListeners: EventPluginHub.deleteAllListeners
});
ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
putListener: 'putListener',
deleteListener: 'deleteListener'
});
module.exports = ReactBrowserEventEmitter;
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule EventConstants
*/
'use strict';
var keyMirror = __webpack_require__(17);
var PropagationPhases = keyMirror({ bubbled: null, captured: null });
/**
* Types of raw signals from the browser caught at the top level.
*/
var topLevelTypes = keyMirror({
topAbort: null,
topBlur: null,
topCanPlay: null,
topCanPlayThrough: null,
topChange: null,
topClick: null,
topCompositionEnd: null,
topCompositionStart: null,
topCompositionUpdate: null,
topContextMenu: null,
topCopy: null,
topCut: null,
topDoubleClick: null,
topDrag: null,
topDragEnd: null,
topDragEnter: null,
topDragExit: null,
topDragLeave: null,
topDragOver: null,
topDragStart: null,
topDrop: null,
topDurationChange: null,
topEmptied: null,
topEncrypted: null,
topEnded: null,
topError: null,
topFocus: null,
topInput: null,
topKeyDown: null,
topKeyPress: null,
topKeyUp: null,
topLoad: null,
topLoadedData: null,
topLoadedMetadata: null,
topLoadStart: null,
topMouseDown: null,
topMouseMove: null,
topMouseOut: null,
topMouseOver: null,
topMouseUp: null,
topPaste: null,
topPause: null,
topPlay: null,
topPlaying: null,
topProgress: null,
topRateChange: null,
topReset: null,
topScroll: null,
topSeeked: null,
topSeeking: null,
topSelectionChange: null,
topStalled: null,
topSubmit: null,
topSuspend: null,
topTextInput: null,
topTimeUpdate: null,
topTouchCancel: null,
topTouchEnd: null,
topTouchMove: null,
topTouchStart: null,
topVolumeChange: null,
topWaiting: null,
topWheel: null
});
var EventConstants = {
topLevelTypes: topLevelTypes,
PropagationPhases: PropagationPhases
};
module.exports = EventConstants;
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule EventPluginHub
*/
'use strict';
var EventPluginRegistry = __webpack_require__(32);
var EventPluginUtils = __webpack_require__(33);
var ReactErrorUtils = __webpack_require__(34);
var accumulateInto = __webpack_require__(35);
var forEachAccumulated = __webpack_require__(36);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
/**
* Internal store for event listeners
*/
var listenerBank = {};
/**
* Internal queue of events that have accumulated their dispatches and are
* waiting to have their dispatches executed.
*/
var eventQueue = null;
/**
* Dispatches an event and releases it back into the pool, unless persistent.
*
* @param {?object} event Synthetic event to be dispatched.
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @private
*/
var executeDispatchesAndRelease = function (event, simulated) {
if (event) {
EventPluginUtils.executeDispatchesInOrder(event, simulated);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
var executeDispatchesAndReleaseSimulated = function (e) {
return executeDispatchesAndRelease(e, true);
};
var executeDispatchesAndReleaseTopLevel = function (e) {
return executeDispatchesAndRelease(e, false);
};
/**
* - `InstanceHandle`: [required] Module that performs logical traversals of DOM
* hierarchy given ids of the logical DOM elements involved.
*/
var InstanceHandle = null;
function validateInstanceHandle() {
var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
}
/**
* This is a unified interface for event plugins to be installed and configured.
*
* Event plugins can implement the following properties:
*
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
* Required. When a top-level event is fired, this method is expected to
* extract synthetic events that will in turn be queued and dispatched.
*
* `eventTypes` {object}
* Optional, plugins that fire events must publish a mapping of registration
* names that are used to register listeners. Values of this mapping must
* be objects that contain `registrationName` or `phasedRegistrationNames`.
*
* `executeDispatch` {function(object, function, string)}
* Optional, allows plugins to override how an event gets dispatched. By
* default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
*
* @public
*/
var EventPluginHub = {
/**
* Methods for injecting dependencies.
*/
injection: {
/**
* @param {object} InjectedMount
* @public
*/
injectMount: EventPluginUtils.injection.injectMount,
/**
* @param {object} InjectedInstanceHandle
* @public
*/
injectInstanceHandle: function (InjectedInstanceHandle) {
InstanceHandle = InjectedInstanceHandle;
if (process.env.NODE_ENV !== 'production') {
validateInstanceHandle();
}
},
getInstanceHandle: function () {
if (process.env.NODE_ENV !== 'production') {
validateInstanceHandle();
}
return InstanceHandle;
},
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
*/
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
},
eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
registrationNameModules: EventPluginRegistry.registrationNameModules,
/**
* Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
*
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {?function} listener The callback to store.
*/
putListener: function (id, registrationName, listener) {
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
bankForRegistrationName[id] = listener;
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.didPutListener) {
PluginModule.didPutListener(id, registrationName, listener);
}
},
/**
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
getListener: function (id, registrationName) {
var bankForRegistrationName = listenerBank[registrationName];
return bankForRegistrationName && bankForRegistrationName[id];
},
/**
* Deletes a listener from the registration bank.
*
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
*/
deleteListener: function (id, registrationName) {
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(id, registrationName);
}
var bankForRegistrationName = listenerBank[registrationName];
// TODO: This should never be null -- when is it?
if (bankForRegistrationName) {
delete bankForRegistrationName[id];
}
},
/**
* Deletes all listeners for the DOM element with the supplied ID.
*
* @param {string} id ID of the DOM element.
*/
deleteAllListeners: function (id) {
for (var registrationName in listenerBank) {
if (!listenerBank[registrationName][id]) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(id, registrationName);
}
delete listenerBank[registrationName][id];
}
},
/**
* Allows registered plugins an opportunity to extract events from top-level
* native browser events.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @internal
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var events;
var plugins = EventPluginRegistry.plugins;
for (var i = 0; i < plugins.length; i++) {
// Not every plugin in the ordering may be loaded at runtime.
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
},
/**
* Enqueues a synthetic event that should be dispatched when
* `processEventQueue` is invoked.
*
* @param {*} events An accumulation of synthetic events.
* @internal
*/
enqueueEvents: function (events) {
if (events) {
eventQueue = accumulateInto(eventQueue, events);
}
},
/**
* Dispatches all synthetic events on the event queue.
*
* @internal
*/
processEventQueue: function (simulated) {
// Set `eventQueue` to null before processing it so that we can tell if more
// events get enqueued while processing.
var processingEventQueue = eventQueue;
eventQueue = null;
if (simulated) {
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
} else {
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
}
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
// This would be a good time to rethrow if any of the event handlers threw.
ReactErrorUtils.rethrowCaughtError();
},
/**
* These are needed for tests only. Do not use!
*/
__purge: function () {
listenerBank = {};
},
__getListenerBank: function () {
return listenerBank;
}
};
module.exports = EventPluginHub;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule EventPluginRegistry
* @typechecks static-only
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* Injectable ordering of event plugins.
*/
var EventPluginOrder = null;
/**
* Injectable mapping from names to event plugin modules.
*/
var namesToPlugins = {};
/**
* Recomputes the plugin list using the injected plugins and plugin ordering.
*
* @private
*/
function recomputePluginOrdering() {
if (!EventPluginOrder) {
// Wait until an `EventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var PluginModule = namesToPlugins[pluginName];
var pluginIndex = EventPluginOrder.indexOf(pluginName);
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
if (EventPluginRegistry.plugins[pluginIndex]) {
continue;
}
!PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
EventPluginRegistry.plugins[pluginIndex] = PluginModule;
var publishedEvents = PluginModule.eventTypes;
for (var eventName in publishedEvents) {
!publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugin.
*
* @param {object} dispatchConfig Dispatch configuration for the event.
* @param {object} PluginModule Plugin publishing the event.
* @return {boolean} True if the event was successfully published.
* @private
*/
function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
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;
}
/**
* Publishes a registration name that is used to identify dispatched events and
* can be used with `EventPluginHub.putListener` to register listeners.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, PluginModule, eventName) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
}
/**
* Registers plugins so that they can extract and dispatch events.
*
* @see {EventPluginHub}
*/
var EventPluginRegistry = {
/**
* Ordered list of injected plugins.
*/
plugins: [],
/**
* Mapping from event name to dispatch config
*/
eventNameDispatchConfigs: {},
/**
* Mapping from registration name to plugin module
*/
registrationNameModules: {},
/**
* Mapping from registration name to event name
*/
registrationNameDependencies: {},
/**
* Injects an ordering of plugins (by plugin name). This allows the ordering
* to be decoupled from injection of the actual plugins so that ordering is
* always deterministic regardless of packaging, on-the-fly injection, etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
injectEventPluginOrder: function (InjectedEventPluginOrder) {
!!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
// Clone the ordering so it cannot be dynamically mutated.
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
recomputePluginOrdering();
},
/**
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
* in the ordering injected by `injectEventPluginOrder`.
*
* Plugins can be injected as part of page initialization or on-the-fly.
*
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
* @internal
* @see {EventPluginHub.injection.injectEventPluginsByName}
*/
injectEventPluginsByName: function (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) {
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
namesToPlugins[pluginName] = PluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
},
/**
* Looks up the plugin for the supplied event.
*
* @param {object} event A synthetic event.
* @return {?object} The plugin that created the supplied event.
* @internal
*/
getPluginModuleForEvent: function (event) {
var dispatchConfig = event.dispatchConfig;
if (dispatchConfig.registrationName) {
return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
}
for (var phase in dispatchConfig.phasedRegistrationNames) {
if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
if (PluginModule) {
return PluginModule;
}
}
return null;
},
/**
* Exposed for unit testing.
* @private
*/
_resetEventPlugins: function () {
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];
}
}
}
};
module.exports = EventPluginRegistry;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule EventPluginUtils
*/
'use strict';
var EventConstants = __webpack_require__(30);
var ReactErrorUtils = __webpack_require__(34);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
/**
* Injected dependencies:
*/
/**
* - `Mount`: [required] Module that can convert between React dom IDs and
* actual node references.
*/
var injection = {
Mount: null,
injectMount: function (InjectedMount) {
injection.Mount = InjectedMount;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
}
}
};
var topLevelTypes = EventConstants.topLevelTypes;
function isEndish(topLevelType) {
return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
}
function isMoveish(topLevelType) {
return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
}
function isStartish(topLevelType) {
return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
}
var validateEventDispatches;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches = function (event) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
var listenersIsArr = Array.isArray(dispatchListeners);
var idsIsArr = Array.isArray(dispatchIDs);
var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
};
}
/**
* Dispatch the event to the listener.
* @param {SyntheticEvent} event SyntheticEvent to handle
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @param {function} listener Application-level callback
* @param {string} domID DOM id to pass to the callback.
*/
function executeDispatch(event, simulated, listener, domID) {
var type = event.type || 'unknown-event';
event.currentTarget = injection.Mount.getNode(domID);
if (simulated) {
ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID);
} else {
ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID);
}
event.currentTarget = null;
}
/**
* Standard/simple iteration through an event's collected dispatches.
*/
function executeDispatchesInOrder(event, simulated) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and IDs are two parallel arrays that are always in sync.
executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, simulated, dispatchListeners, dispatchIDs);
}
event._dispatchListeners = null;
event._dispatchIDs = null;
}
/**
* Standard/simple iteration through an event's collected dispatches, but stops
* at the first dispatch execution returning true, and returns that id.
*
* @return {?string} id of the first dispatch execution who's listener returns
* true, or null if no listener returned true.
*/
function executeDispatchesInOrderStopAtTrueImpl(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and IDs are two parallel arrays that are always in sync.
if (dispatchListeners[i](event, dispatchIDs[i])) {
return dispatchIDs[i];
}
}
} else if (dispatchListeners) {
if (dispatchListeners(event, dispatchIDs)) {
return dispatchIDs;
}
}
return null;
}
/**
* @see executeDispatchesInOrderStopAtTrueImpl
*/
function executeDispatchesInOrderStopAtTrue(event) {
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
event._dispatchIDs = null;
event._dispatchListeners = null;
return ret;
}
/**
* Execution of a "direct" dispatch - there must be at most one dispatch
* accumulated on the event or it is considered an error. It doesn't really make
* sense for an event with multiple dispatches (bubbled) to keep track of the
* return values at each dispatch execution, but it does tend to make sense when
* dealing with "direct" dispatches.
*
* @return {*} The return value of executing the single dispatch.
*/
function executeDirectDispatch(event) {
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchID = event._dispatchIDs;
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
event._dispatchListeners = null;
event._dispatchIDs = null;
return res;
}
/**
* @param {SyntheticEvent} event
* @return {boolean} True iff number of dispatches accumulated is greater than 0.
*/
function hasDispatches(event) {
return !!event._dispatchListeners;
}
/**
* General utilities that are useful in creating custom Event Plugins.
*/
var EventPluginUtils = {
isEndish: isEndish,
isMoveish: isMoveish,
isStartish: isStartish,
executeDirectDispatch: executeDirectDispatch,
executeDispatchesInOrder: executeDispatchesInOrder,
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
hasDispatches: hasDispatches,
getNode: function (id) {
return injection.Mount.getNode(id);
},
getID: function (node) {
return injection.Mount.getID(node);
},
injection: injection
};
module.exports = EventPluginUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactErrorUtils
* @typechecks
*/
'use strict';
var caughtError = null;
/**
* Call a function while guarding against errors that happens within it.
*
* @param {?String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} a First argument
* @param {*} b Second argument
*/
function invokeGuardedCallback(name, func, a, b) {
try {
return func(a, b);
} catch (x) {
if (caughtError === null) {
caughtError = x;
}
return undefined;
}
}
var ReactErrorUtils = {
invokeGuardedCallback: invokeGuardedCallback,
/**
* Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
* handler are sure to be rethrown by rethrowCaughtError.
*/
invokeGuardedCallbackWithCatch: invokeGuardedCallback,
/**
* During execution of guarded functions we will capture the first error which
* we will rethrow to be handled by the top level error handler.
*/
rethrowCaughtError: function () {
if (caughtError) {
var error = caughtError;
caughtError = null;
throw error;
}
}
};
if (process.env.NODE_ENV !== 'production') {
/**
* To help development we can get better devtools integration by simulating a
* real browser event.
*/
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
var fakeNode = document.createElement('react');
ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
var boundFunc = func.bind(null, a, b);
var evtType = 'react-' + name;
fakeNode.addEventListener(evtType, boundFunc, false);
var evt = document.createEvent('Event');
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
};
}
}
module.exports = ReactErrorUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule accumulateInto
*/
'use strict';
var invariant = __webpack_require__(13);
/**
*
* Accumulates items that must not be null or undefined into the first one. This
* is used to conserve memory by avoiding array allocations, and thus sacrifices
* API cleanness. Since `current` can be null before being passed in and not
* null after this function, make sure to assign it back to `current`:
*
* `a = accumulateInto(a, b);`
*
* This API should be sparingly used. Try `accumulate` for something cleaner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
var currentIsArray = Array.isArray(current);
var nextIsArray = Array.isArray(next);
if (currentIsArray && nextIsArray) {
current.push.apply(current, next);
return current;
}
if (currentIsArray) {
current.push(next);
return current;
}
if (nextIsArray) {
// A bit too dangerous to mutate `next`.
return [current].concat(next);
}
return [current, next];
}
module.exports = accumulateInto;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 36 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule forEachAccumulated
*/
'use strict';
/**
* @param {array} arr an "accumulation" of items which is either an Array or
* a single item. Useful when paired with the `accumulate` module. This is a
* simple utility that allows us to reason about a collection of items, but
* handling the case when there is exactly one item (and we do not need to
* allocate an array).
*/
var forEachAccumulated = function (arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
};
module.exports = forEachAccumulated;
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactEventEmitterMixin
*/
'use strict';
var EventPluginHub = __webpack_require__(31);
function runEventQueueInBatch(events) {
EventPluginHub.enqueueEvents(events);
EventPluginHub.processEventQueue(false);
}
var ReactEventEmitterMixin = {
/**
* Streams a fired top-level event to `EventPluginHub` where plugins have the
* opportunity to create `ReactEvent`s to be dispatched.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native environment event.
*/
handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
runEventQueueInBatch(events);
}
};
module.exports = ReactEventEmitterMixin;
/***/ },
/* 38 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ViewportMetrics
*/
'use strict';
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function (scrollPosition) {
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
/***/ },
/* 39 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule Object.assign
*/
// path_to_url~jorendorff/es6-draft.html#sec-object.assign
'use strict';
function assign(target, sources) {
if (target == null) {
throw new TypeError('Object.assign target cannot be null or undefined');
}
var to = Object(target);
var hasOwnProperty = Object.prototype.hasOwnProperty;
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
var nextSource = arguments[nextIndex];
if (nextSource == null) {
continue;
}
var from = Object(nextSource);
// We don't currently support accessors nor proxies. Therefore this
// copy cannot throw. If we ever supported this then we must handle
// exceptions and side-effects. We don't support symbols so they won't
// be transferred.
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
}
return to;
}
module.exports = assign;
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule isEventSupported
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature = document.implementation && document.implementation.hasFeature &&
// always returns true in newer browsers as per the standard.
// @see path_to_url#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = (eventName in document);
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
module.exports = isEventSupported;
/***/ },
/* 41 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactDOMFeatureFlags
*/
'use strict';
var ReactDOMFeatureFlags = {
useCreateElement: false
};
module.exports = ReactDOMFeatureFlags;
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactElement
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(5);
var assign = __webpack_require__(39);
var canDefineProperty = __webpack_require__(43);
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
/**
* Base constructor for all React elements. This is only used to make this
* work with a dynamic instanceof check. Nothing should live on this prototype.
*
* @param {*} type
* @param {*} key
* @param {string|object} ref
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
* @param {*} owner
* @param {*} props
* @internal
*/
var ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allow us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// Record the component responsible for creating this element.
_owner: owner
};
if (process.env.NODE_ENV !== 'production') {
// The validation flag is currently mutative. We put it on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
element._store = {};
// To make comparing ReactElements easier for testing purposes, we make
// the validation flag non-enumerable (where possible, which should
// include every environment we run tests in), so the test framework
// ignores it.
if (canDefineProperty) {
Object.defineProperty(element._store, 'validated', {
configurable: false,
enumerable: false,
writable: true,
value: false
});
// self and source are DEV only properties.
Object.defineProperty(element, '_self', {
configurable: false,
enumerable: false,
writable: false,
value: self
});
// Two elements created in two different places should be considered
// equal for testing purposes and therefore we hide it from enumeration.
Object.defineProperty(element, '_source', {
configurable: false,
enumerable: false,
writable: false,
value: source
});
} else {
element._store.validated = false;
element._self = self;
element._source = source;
}
Object.freeze(element.props);
Object.freeze(element);
}
return element;
};
ReactElement.createElement = function (type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var key = null;
var ref = null;
var self = null;
var source = null;
if (config != null) {
ref = config.ref === undefined ? null : config.ref;
key = config.key === undefined ? null : '' + config.key;
self = config.__self === undefined ? null : config.__self;
source = config.__source === undefined ? null : config.__source;
// Remaining properties are added to a new props object
for (propName in config) {
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
// Resolve default props
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (typeof props[propName] === 'undefined') {
props[propName] = defaultProps[propName];
}
}
}
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
};
ReactElement.createFactory = function (type) {
var factory = ReactElement.createElement.bind(null, type);
// Expose the type on the factory and the prototype so that it can be
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
// This should not be named `constructor` since this may not be the function
// that created the element, and it may not even be a constructor.
// Legacy hook TODO: Warn if this is accessed
factory.type = type;
return factory;
};
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
};
ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
if (process.env.NODE_ENV !== 'production') {
// If the key on the original is valid, then the clone is valid
newElement._store.validated = oldElement._store.validated;
}
return newElement;
};
ReactElement.cloneElement = function (element, config, children) {
var propName;
// Original props are copied
var props = assign({}, element.props);
// Reserved names are extracted
var key = element.key;
var ref = element.ref;
// Self is preserved since the owner is preserved.
var self = element._self;
// Source is preserved since cloneElement is unlikely to be targeted by a
// transpiler, and the original source is probably a better indicator of the
// true owner.
var source = element._source;
// Owner will be preserved, unless ref is overridden
var owner = element._owner;
if (config != null) {
if (config.ref !== undefined) {
// Silently steal the ref from the parent.
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (config.key !== undefined) {
key = '' + config.key;
}
// Remaining properties override existing props
for (propName in config) {
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
return ReactElement(element.type, key, ref, self, source, owner, props);
};
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
module.exports = ReactElement;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule canDefineProperty
*/
'use strict';
var canDefineProperty = false;
if (process.env.NODE_ENV !== 'production') {
try {
Object.defineProperty({}, 'x', { get: function () {} });
canDefineProperty = true;
} catch (x) {
// IE will fail on defineProperty
}
}
module.exports = canDefineProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 44 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactEmptyComponentRegistry
*/
'use strict';
// This registry keeps track of the React IDs of the components that rendered to
// `null` (in reality a placeholder such as `noscript`)
var nullComponentIDsRegistry = {};
/**
* @param {string} id Component's `_rootNodeID`.
* @return {boolean} True if the component is rendered to null.
*/
function isNullComponentID(id) {
return !!nullComponentIDsRegistry[id];
}
/**
* Mark the component as having rendered to null.
* @param {string} id Component's `_rootNodeID`.
*/
function registerNullComponentID(id) {
nullComponentIDsRegistry[id] = true;
}
/**
* Unmark the component as having rendered to null: it renders to something now.
* @param {string} id Component's `_rootNodeID`.
*/
function deregisterNullComponentID(id) {
delete nullComponentIDsRegistry[id];
}
var ReactEmptyComponentRegistry = {
isNullComponentID: isNullComponentID,
registerNullComponentID: registerNullComponentID,
deregisterNullComponentID: deregisterNullComponentID
};
module.exports = ReactEmptyComponentRegistry;
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactInstanceHandles
* @typechecks static-only
*/
'use strict';
var ReactRootIndex = __webpack_require__(46);
var invariant = __webpack_require__(13);
var SEPARATOR = '.';
var SEPARATOR_LENGTH = SEPARATOR.length;
/**
* Maximum depth of traversals before we consider the possibility of a bad ID.
*/
var MAX_TREE_DEPTH = 10000;
/**
* Creates a DOM ID prefix to use when mounting React components.
*
* @param {number} index A unique integer
* @return {string} React root ID.
* @internal
*/
function getReactRootIDString(index) {
return SEPARATOR + index.toString(36);
}
/**
* Checks if a character in the supplied ID is a separator or the end.
*
* @param {string} id A React DOM ID.
* @param {number} index Index of the character to check.
* @return {boolean} True if the character is a separator or end of the ID.
* @private
*/
function isBoundary(id, index) {
return id.charAt(index) === SEPARATOR || index === id.length;
}
/**
* Checks if the supplied string is a valid React DOM ID.
*
* @param {string} id A React DOM ID, maybe.
* @return {boolean} True if the string is a valid React DOM ID.
* @private
*/
function isValidID(id) {
return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
}
/**
* Checks if the first ID is an ancestor of or equal to the second ID.
*
* @param {string} ancestorID
* @param {string} descendantID
* @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
* @internal
*/
function isAncestorIDOf(ancestorID, descendantID) {
return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
}
/**
* Gets the parent ID of the supplied React DOM ID, `id`.
*
* @param {string} id ID of a component.
* @return {string} ID of the parent, or an empty string.
* @private
*/
function getParentID(id) {
return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
}
/**
* Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
* supplied `destinationID`. If they are equal, the ID is returned.
*
* @param {string} ancestorID ID of an ancestor node of `destinationID`.
* @param {string} destinationID ID of the destination node.
* @return {string} Next ID on the path from `ancestorID` to `destinationID`.
* @private
*/
function getNextDescendantID(ancestorID, destinationID) {
!(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
!isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
if (ancestorID === destinationID) {
return ancestorID;
}
// Skip over the ancestor and the immediate separator. Traverse until we hit
// another separator or we reach the end of `destinationID`.
var start = ancestorID.length + SEPARATOR_LENGTH;
var i;
for (i = start; i < destinationID.length; i++) {
if (isBoundary(destinationID, i)) {
break;
}
}
return destinationID.substr(0, i);
}
/**
* Gets the nearest common ancestor ID of two IDs.
*
* Using this ID scheme, the nearest common ancestor ID is the longest common
* prefix of the two IDs that immediately preceded a "marker" in both strings.
*
* @param {string} oneID
* @param {string} twoID
* @return {string} Nearest common ancestor ID, or the empty string if none.
* @private
*/
function getFirstCommonAncestorID(oneID, twoID) {
var minLength = Math.min(oneID.length, twoID.length);
if (minLength === 0) {
return '';
}
var lastCommonMarkerIndex = 0;
// Use `<=` to traverse until the "EOL" of the shorter string.
for (var i = 0; i <= minLength; i++) {
if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
lastCommonMarkerIndex = i;
} else if (oneID.charAt(i) !== twoID.charAt(i)) {
break;
}
}
var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
!isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
return longestCommonID;
}
/**
* Traverses the parent path between two IDs (either up or down). The IDs must
* not be the same, and there must exist a parent path between them. If the
* callback returns `false`, traversal is stopped.
*
* @param {?string} start ID at which to start traversal.
* @param {?string} stop ID at which to end traversal.
* @param {function} cb Callback to invoke each ID with.
* @param {*} arg Argument to invoke the callback with.
* @param {?boolean} skipFirst Whether or not to skip the first node.
* @param {?boolean} skipLast Whether or not to skip the last node.
* @private
*/
function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
start = start || '';
stop = stop || '';
!(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
var traverseUp = isAncestorIDOf(stop, start);
!(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
// Traverse from `start` to `stop` one depth at a time.
var depth = 0;
var traverse = traverseUp ? getParentID : getNextDescendantID;
for (var id = start;; /* until break */id = traverse(id, stop)) {
var ret;
if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
ret = cb(id, traverseUp, arg);
}
if (ret === false || id === stop) {
// Only break //after// visiting `stop`.
break;
}
!(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
}
}
/**
* Manages the IDs assigned to DOM representations of React components. This
* uses a specific scheme in order to traverse the DOM efficiently (e.g. in
* order to simulate events).
*
* @internal
*/
var ReactInstanceHandles = {
/**
* Constructs a React root ID
* @return {string} A React root ID.
*/
createReactRootID: function () {
return getReactRootIDString(ReactRootIndex.createReactRootIndex());
},
/**
* Constructs a React ID by joining a root ID with a name.
*
* @param {string} rootID Root ID of a parent component.
* @param {string} name A component's name (as flattened children).
* @return {string} A React ID.
* @internal
*/
createReactID: function (rootID, name) {
return rootID + name;
},
/**
* Gets the DOM ID of the React component that is the root of the tree that
* contains the React component with the supplied DOM ID.
*
* @param {string} id DOM ID of a React component.
* @return {?string} DOM ID of the React component that is the root.
* @internal
*/
getReactRootIDFromNodeID: function (id) {
if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
var index = id.indexOf(SEPARATOR, 1);
return index > -1 ? id.substr(0, index) : id;
}
return null;
},
/**
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
* should would receive a `mouseEnter` or `mouseLeave` event.
*
* NOTE: Does not invoke the callback on the nearest common ancestor because
* nothing "entered" or "left" that element.
*
* @param {string} leaveID ID being left.
* @param {string} enterID ID being entered.
* @param {function} cb Callback to invoke on each entered/left ID.
* @param {*} upArg Argument to invoke the callback with on left IDs.
* @param {*} downArg Argument to invoke the callback with on entered IDs.
* @internal
*/
traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
if (ancestorID !== leaveID) {
traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
}
if (ancestorID !== enterID) {
traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
}
},
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*
* NOTE: This traversal happens on IDs without touching the DOM.
*
* @param {string} targetID ID of the target node.
* @param {function} cb Callback to invoke.
* @param {*} arg Argument to invoke the callback with.
* @internal
*/
traverseTwoPhase: function (targetID, cb, arg) {
if (targetID) {
traverseParentPath('', targetID, cb, arg, true, false);
traverseParentPath(targetID, '', cb, arg, false, true);
}
},
/**
* Same as `traverseTwoPhase` but skips the `targetID`.
*/
traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
if (targetID) {
traverseParentPath('', targetID, cb, arg, true, true);
traverseParentPath(targetID, '', cb, arg, true, true);
}
},
/**
* Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
* example, passing `.0.$row-0.1` would result in `cb` getting called
* with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
*
* NOTE: This traversal happens on IDs without touching the DOM.
*
* @param {string} targetID ID of the target node.
* @param {function} cb Callback to invoke.
* @param {*} arg Argument to invoke the callback with.
* @internal
*/
traverseAncestors: function (targetID, cb, arg) {
traverseParentPath('', targetID, cb, arg, true, false);
},
getFirstCommonAncestorID: getFirstCommonAncestorID,
/**
* Exposed for unit testing.
* @private
*/
_getNextDescendantID: getNextDescendantID,
isAncestorIDOf: isAncestorIDOf,
SEPARATOR: SEPARATOR
};
module.exports = ReactInstanceHandles;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 46 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactRootIndex
* @typechecks
*/
'use strict';
var ReactRootIndexInjection = {
/**
* @param {function} _createReactRootIndex
*/
injectCreateReactRootIndex: function (_createReactRootIndex) {
ReactRootIndex.createReactRootIndex = _createReactRootIndex;
}
};
var ReactRootIndex = {
createReactRootIndex: null,
injection: ReactRootIndexInjection
};
module.exports = ReactRootIndex;
/***/ },
/* 47 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactInstanceMap
*/
'use strict';
/**
* `ReactInstanceMap` maintains a mapping from a public facing stateful
* instance (key) and the internal representation (value). This allows public
* methods to accept the user facing instance as an argument and map them back
* to internal methods.
*/
// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
var ReactInstanceMap = {
/**
* This API should be called `delete` but we'd have to make sure to always
* transform these to strings for IE support. When this transform is fully
* supported we can rename it.
*/
remove: function (key) {
key._reactInternalInstance = undefined;
},
get: function (key) {
return key._reactInternalInstance;
},
has: function (key) {
return key._reactInternalInstance !== undefined;
},
set: function (key, value) {
key._reactInternalInstance = value;
}
};
module.exports = ReactInstanceMap;
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactMarkupChecksum
*/
'use strict';
var adler32 = __webpack_require__(49);
var TAG_END = /\/?>/;
var ReactMarkupChecksum = {
CHECKSUM_ATTR_NAME: 'data-react-checksum',
/**
* @param {string} markup Markup string
* @return {string} Markup string with checksum attribute attached
*/
addChecksumToMarkup: function (markup) {
var checksum = adler32(markup);
// Add checksum (handle both parent tags and self-closing tags)
return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
},
/**
* @param {string} markup to use
* @param {DOMElement} element root React element
* @returns {boolean} whether or not the markup is the same
*/
canReuseMarkup: function (markup, element) {
var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
var markupChecksum = adler32(markup);
return markupChecksum === existingChecksum;
}
};
module.exports = ReactMarkupChecksum;
/***/ },
/* 49 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule adler32
*/
'use strict';
var MOD = 65521;
// adler32 is not cryptographically strong, and is only used to sanity check that
// markup generated on the server matches the markup generated on the client.
// This implementation (a modified version of the SheetJS version) has been optimized
// for our use case, at the expense of conforming to the adler32 specification
// for non-ascii inputs.
function adler32(data) {
var a = 1;
var b = 0;
var i = 0;
var l = data.length;
var m = l & ~0x3;
while (i < m) {
for (; i < Math.min(i + 4096, m); i += 4) {
b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
}
a %= MOD;
b %= MOD;
}
for (; i < l; i++) {
b += a += data.charCodeAt(i);
}
a %= MOD;
b %= MOD;
return a | b << 16;
}
module.exports = adler32;
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactReconciler
*/
'use strict';
var ReactRef = __webpack_require__(51);
/**
* Helper to call ReactRef.attachRefs with this composite component, split out
* to avoid allocations in the transaction mount-ready queue.
*/
function attachRefs() {
ReactRef.attachRefs(this, this._currentElement);
}
var ReactReconciler = {
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {ReactComponent} internalInstance
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (internalInstance, rootID, transaction, context) {
var markup = internalInstance.mountComponent(rootID, transaction, context);
if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
return markup;
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (internalInstance) {
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent();
},
/**
* Update a component using a new element.
*
* @param {ReactComponent} internalInstance
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @internal
*/
receiveComponent: function (internalInstance, nextElement, transaction, context) {
var prevElement = internalInstance._currentElement;
if (nextElement === prevElement && context === internalInstance._context) {
// Since elements are immutable after the owner is rendered,
// we can do a cheap identity compare here to determine if this is a
// superfluous reconcile. It's possible for state to be mutable but such
// change should trigger an update of the owner which would recreate
// the element. We explicitly check for the existence of an owner since
// it's possible for an element created outside a composite to be
// deeply mutated and reused.
// TODO: Bailing out early is just a perf optimization right?
// TODO: Removing the return statement should affect correctness?
return;
}
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
if (refsChanged) {
ReactRef.detachRefs(internalInstance, prevElement);
}
internalInstance.receiveComponent(nextElement, transaction, context);
if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
},
/**
* Flush any dirty changes in a component.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (internalInstance, transaction) {
internalInstance.performUpdateIfNecessary(transaction);
}
};
module.exports = ReactReconciler;
/***/ },
/* 51 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactRef
*/
'use strict';
var ReactOwner = __webpack_require__(52);
var ReactRef = {};
function attachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(component.getPublicInstance());
} else {
// Legacy ref
ReactOwner.addComponentAsRefTo(component, ref, owner);
}
}
function detachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(null);
} else {
// Legacy ref
ReactOwner.removeComponentAsRefFrom(component, ref, owner);
}
}
ReactRef.attachRefs = function (instance, element) {
if (element === null || element === false) {
return;
}
var ref = element.ref;
if (ref != null) {
attachRef(ref, instance, element._owner);
}
};
ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
// If either the owner or a `ref` has changed, make sure the newest owner
// has stored a reference to `this`, and the previous owner (if different)
// has forgotten the reference to `this`. We use the element instead
// of the public this.props because the post processing cannot determine
// a ref. The ref conceptually lives on the element.
// TODO: Should this even be possible? The owner cannot change because
// it's forbidden by shouldUpdateReactComponent. The ref can change
// if you swap the keys of but not the refs. Reconsider where this check
// is made. It probably belongs where the key checking and
// instantiateReactComponent is done.
var prevEmpty = prevElement === null || prevElement === false;
var nextEmpty = nextElement === null || nextElement === false;
return(
// This has a few false positives w/r/t empty components.
prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
);
};
ReactRef.detachRefs = function (instance, element) {
if (element === null || element === false) {
return;
}
var ref = element.ref;
if (ref != null) {
detachRef(ref, instance, element._owner);
}
};
module.exports = ReactRef;
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactOwner
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* ReactOwners are capable of storing references to owned components.
*
* All components are capable of //being// referenced by owner components, but
* only ReactOwner components are capable of //referencing// owned components.
* The named reference is known as a "ref".
*
* Refs are available when mounted and updated during reconciliation.
*
* var MyComponent = React.createClass({
* render: function() {
* return (
* <div onClick={this.handleClick}>
* <CustomComponent ref="custom" />
* </div>
* );
* },
* handleClick: function() {
* this.refs.custom.handleClick();
* },
* componentDidMount: function() {
* this.refs.custom.initialize();
* }
* });
*
* Refs should rarely be used. When refs are used, they should only be done to
* control data that is not handled by React's data flow.
*
* @class ReactOwner
*/
var ReactOwner = {
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid owner.
* @final
*/
isValidOwner: function (object) {
return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
},
/**
* Adds a component by ref to an owner component.
*
* @param {ReactComponent} component Component to reference.
* @param {string} ref Name by which to refer to the component.
* @param {ReactOwner} owner Component on which to record the ref.
* @final
* @internal
*/
addComponentAsRefTo: function (component, ref, owner) {
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: path_to_url : invariant(false) : undefined;
owner.attachRef(ref, component);
},
/**
* Removes a component by ref from an owner component.
*
* @param {ReactComponent} component Component to dereference.
* @param {string} ref Name of the ref to remove.
* @param {ReactOwner} owner Component on which the ref is recorded.
* @final
* @internal
*/
removeComponentAsRefFrom: function (component, ref, owner) {
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: path_to_url : invariant(false) : undefined;
// Check that `component` is still the current ref because we do not want to
// detach the ref if another component stole it.
if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) {
owner.detachRef(ref);
}
}
};
module.exports = ReactOwner;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 53 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactUpdateQueue
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(5);
var ReactElement = __webpack_require__(42);
var ReactInstanceMap = __webpack_require__(47);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
function enqueueUpdate(internalInstance) {
ReactUpdates.enqueueUpdate(internalInstance);
}
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
var internalInstance = ReactInstanceMap.get(publicInstance);
if (!internalInstance) {
if (process.env.NODE_ENV !== 'production') {
// Only warn when we have a callerName. Otherwise we should be silent.
// We're probably calling from enqueueCallback. We don't want to warn
// there because we already warned for the corresponding lifecycle method.
process.env.NODE_ENV !== 'production' ? 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, publicInstance.constructor.displayName) : undefined;
}
return null;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
}
return internalInstance;
}
/**
* ReactUpdateQueue allows for state updates to be scheduled into a later
* reconciliation step.
*/
var ReactUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? 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') : undefined;
owner._warnedAboutRefsInRender = true;
}
}
var internalInstance = ReactInstanceMap.get(publicInstance);
if (internalInstance) {
// During componentWillMount and render this will still be null but after
// that will always render to something. At least for now. So we can use
// this hack.
return !!internalInstance._renderedComponent;
} else {
return false;
}
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
enqueueCallback: function (publicInstance, callback) {
!(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
// Previously we would throw an error if we didn't have an internal
// instance. Since we want to make it a no-op instead, we mirror the same
// behavior we have in other enqueue* methods.
// We also need to ignore callbacks in componentWillMount. See
// enqueueUpdates.
if (!internalInstance) {
return null;
}
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
// TODO: The callback here is ignored when setState is called from
// componentWillMount. Either fix it or disallow doing so completely in
// favor of getInitialState. Alternatively, we can disallow
// componentWillMount during server-side rendering.
enqueueUpdate(internalInstance);
},
enqueueCallbackInternal: function (internalInstance, callback) {
!(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
enqueueUpdate(internalInstance);
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
if (!internalInstance) {
return;
}
internalInstance._pendingForceUpdate = true;
enqueueUpdate(internalInstance);
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
if (!internalInstance) {
return;
}
internalInstance._pendingStateQueue = [completeState];
internalInstance._pendingReplaceState = true;
enqueueUpdate(internalInstance);
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
if (!internalInstance) {
return;
}
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
queue.push(partialState);
enqueueUpdate(internalInstance);
},
/**
* Sets a subset of the props.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialProps Subset of the next props.
* @internal
*/
enqueueSetProps: function (publicInstance, partialProps) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
if (!internalInstance) {
return;
}
ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
},
enqueueSetPropsInternal: function (internalInstance, partialProps) {
var topLevelWrapper = internalInstance._topLevelWrapper;
!topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
// Merge with the pending element if it exists, otherwise with existing
// element props.
var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
var element = wrapElement.props;
var props = assign({}, element.props, partialProps);
topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
enqueueUpdate(topLevelWrapper);
},
/**
* Replaces all of the props.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} props New props.
* @internal
*/
enqueueReplaceProps: function (publicInstance, props) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
if (!internalInstance) {
return;
}
ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
},
enqueueReplacePropsInternal: function (internalInstance, props) {
var topLevelWrapper = internalInstance._topLevelWrapper;
!topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
// Merge with the pending element if it exists, otherwise with existing
// element props.
var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
var element = wrapElement.props;
topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
enqueueUpdate(topLevelWrapper);
},
enqueueElementInternal: function (internalInstance, newElement) {
internalInstance._pendingElement = newElement;
enqueueUpdate(internalInstance);
}
};
module.exports = ReactUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactUpdates
*/
'use strict';
var CallbackQueue = __webpack_require__(55);
var PooledClass = __webpack_require__(56);
var ReactPerf = __webpack_require__(18);
var ReactReconciler = __webpack_require__(50);
var Transaction = __webpack_require__(57);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var dirtyComponents = [];
var asapCallbackQueue = CallbackQueue.getPooled();
var asapEnqueued = false;
var batchingStrategy = null;
function ensureInjected() {
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
}
var NESTED_UPDATES = {
initialize: function () {
this.dirtyComponentsLength = dirtyComponents.length;
},
close: function () {
if (this.dirtyComponentsLength !== dirtyComponents.length) {
// Additional updates were enqueued by componentDidUpdate handlers or
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
// these new updates so that if A's componentDidUpdate calls setState on
// B, B will update before the callback A's updater provided when calling
// setState.
dirtyComponents.splice(0, this.dirtyComponentsLength);
flushBatchedUpdates();
} else {
dirtyComponents.length = 0;
}
}
};
var UPDATE_QUEUEING = {
initialize: function () {
this.callbackQueue.reset();
},
close: function () {
this.callbackQueue.notifyAll();
}
};
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
function ReactUpdatesFlushTransaction() {
this.reinitializeTransaction();
this.dirtyComponentsLength = null;
this.callbackQueue = CallbackQueue.getPooled();
this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
}
assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
destructor: function () {
this.dirtyComponentsLength = null;
CallbackQueue.release(this.callbackQueue);
this.callbackQueue = null;
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
this.reconcileTransaction = null;
},
perform: function (method, scope, a) {
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
// with this transaction's wrappers around it.
return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
}
});
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
function batchedUpdates(callback, a, b, c, d, e) {
ensureInjected();
batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
}
/**
* Array comparator for ReactComponents by mount ordering.
*
* @param {ReactComponent} c1 first component you're comparing
* @param {ReactComponent} c2 second component you're comparing
* @return {number} Return value usable by Array.prototype.sort().
*/
function mountOrderComparator(c1, c2) {
return c1._mountOrder - c2._mountOrder;
}
function runBatchedUpdates(transaction) {
var len = transaction.dirtyComponentsLength;
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
// Since reconciling a component higher in the owner hierarchy usually (not
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
// them before their children by sorting the array.
dirtyComponents.sort(mountOrderComparator);
for (var i = 0; i < len; i++) {
// If a component is unmounted before pending changes apply, it will still
// be here, but we assume that it has cleared its _pendingCallbacks and
// that performUpdateIfNecessary is a noop.
var component = dirtyComponents[i];
// If performUpdateIfNecessary happens to enqueue any new updates, we
// shouldn't execute the callbacks until the next render happens, so
// stash the callbacks first
var callbacks = component._pendingCallbacks;
component._pendingCallbacks = null;
ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
if (callbacks) {
for (var j = 0; j < callbacks.length; j++) {
transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
}
}
}
}
var flushBatchedUpdates = function () {
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
// array and perform any updates enqueued by mount-ready handlers (i.e.,
// componentDidUpdate) but we need to check here too in order to catch
// updates enqueued by setState callbacks and asap calls.
while (dirtyComponents.length || asapEnqueued) {
if (dirtyComponents.length) {
var transaction = ReactUpdatesFlushTransaction.getPooled();
transaction.perform(runBatchedUpdates, null, transaction);
ReactUpdatesFlushTransaction.release(transaction);
}
if (asapEnqueued) {
asapEnqueued = false;
var queue = asapCallbackQueue;
asapCallbackQueue = CallbackQueue.getPooled();
queue.notifyAll();
CallbackQueue.release(queue);
}
}
};
flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);
/**
* Mark a component as needing a rerender, adding an optional callback to a
* list of functions which will be executed once the rerender occurs.
*/
function enqueueUpdate(component) {
ensureInjected();
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (This is called by each top-level update
// function, like setProps, setState, forceUpdate, etc.; creation and
// destruction of top-level components is guarded in ReactMount.)
if (!batchingStrategy.isBatchingUpdates) {
batchingStrategy.batchedUpdates(enqueueUpdate, component);
return;
}
dirtyComponents.push(component);
}
/**
* Enqueue a callback to be run at the end of the current batching cycle. Throws
* if no updates are currently being performed.
*/
function asap(callback, context) {
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
}
var ReactUpdatesInjection = {
injectReconcileTransaction: function (ReconcileTransaction) {
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function (_batchingStrategy) {
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
batchingStrategy = _batchingStrategy;
}
};
var ReactUpdates = {
/**
* React references `ReactReconcileTransaction` using this property in order
* to allow dependency injection.
*
* @internal
*/
ReactReconcileTransaction: null,
batchedUpdates: batchedUpdates,
enqueueUpdate: enqueueUpdate,
flushBatchedUpdates: flushBatchedUpdates,
injection: ReactUpdatesInjection,
asap: asap
};
module.exports = ReactUpdates;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule CallbackQueue
*/
'use strict';
var PooledClass = __webpack_require__(56);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
/**
* A specialized pseudo-event module to help keep track of components waiting to
* be notified when their DOM representations are available for use.
*
* This implements `PooledClass`, so you should never need to instantiate this.
* Instead, use `CallbackQueue.getPooled()`.
*
* @class ReactMountReady
* @implements PooledClass
* @internal
*/
function CallbackQueue() {
this._callbacks = null;
this._contexts = null;
}
assign(CallbackQueue.prototype, {
/**
* Enqueues a callback to be invoked when `notifyAll` is invoked.
*
* @param {function} callback Invoked when `notifyAll` is invoked.
* @param {?object} context Context to call `callback` with.
* @internal
*/
enqueue: function (callback, context) {
this._callbacks = this._callbacks || [];
this._contexts = this._contexts || [];
this._callbacks.push(callback);
this._contexts.push(context);
},
/**
* Invokes all enqueued callbacks and clears the queue. This is invoked after
* the DOM representation of a component has been created or updated.
*
* @internal
*/
notifyAll: function () {
var callbacks = this._callbacks;
var contexts = this._contexts;
if (callbacks) {
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined;
this._callbacks = null;
this._contexts = null;
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].call(contexts[i]);
}
callbacks.length = 0;
contexts.length = 0;
}
},
/**
* Resets the internal queue.
*
* @internal
*/
reset: function () {
this._callbacks = null;
this._contexts = null;
},
/**
* `PooledClass` looks for this.
*/
destructor: function () {
this.reset();
}
});
PooledClass.addPoolingTo(CallbackQueue);
module.exports = CallbackQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule PooledClass
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add them
* here, or in their own files.
*/
var oneArgumentPooler = function (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 (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 (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 (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 fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4, a5);
return instance;
} else {
return new Klass(a1, a2, a3, a4, a5);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances (optional).
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler,
fiveArgumentPooler: fiveArgumentPooler
};
module.exports = PooledClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule Transaction
*/
'use strict';
var invariant = __webpack_require__(13);
/**
* `Transaction` creates a black box that is able to wrap any method such that
* certain invariants are maintained before and after the method is invoked
* (Even if an exception is thrown while invoking the wrapped method). Whoever
* instantiates a transaction can provide enforcers of the invariants at
* creation time. The `Transaction` class itself will supply one additional
* automatic invariant for you - the invariant that any transaction instance
* should not be run while it is already being run. You would typically create a
* single instance of a `Transaction` for reuse multiple times, that potentially
* is used to wrap several different methods. Wrappers are extremely simple -
* they only require implementing two methods.
*
* <pre>
* wrappers (injected at creation time)
* + +
* | |
* +-----------------|--------|--------------+
* | v | |
* | +---------------+ | |
* | +--| wrapper1 |---|----+ |
* | | +---------------+ v | |
* | | +-------------+ | |
* | | +----| wrapper2 |--------+ |
* | | | +-------------+ | | |
* | | | | | |
* | v v v v | wrapper
* | +---+ +---+ +---------+ +---+ +---+ | invariants
* perform(anyMethod) | | | | | | | | | | | | maintained
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | +---+ +---+ +---------+ +---+ +---+ |
* | initialize close |
* +-----------------------------------------+
* </pre>
*
* Use cases:
* - Preserving the input selection ranges before/after reconciliation.
* Restoring selection even in the event of an unexpected error.
* - Deactivating events while rearranging the DOM, preventing blurs/focuses,
* while guaranteeing that afterwards, the event system is reactivated.
* - Flushing a queue of collected DOM mutations to the main UI thread after a
* reconciliation takes place in a worker thread.
* - Invoking any collected `componentDidUpdate` callbacks after rendering new
* content.
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
* to preserve the `scrollTop` (an automatic scroll aware DOM).
* - (Future use case): Layout calculations before and after DOM updates.
*
* Transactional plugin API:
* - A module that has an `initialize` method that returns any precomputation.
* - and a `close` method that accepts the precomputation. `close` is invoked
* when the wrapped process is completed, or has failed.
*
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
* that implement `initialize` and `close`.
* @return {Transaction} Single transaction for reuse in thread.
*
* @class Transaction
*/
var Mixin = {
/**
* Sets up this instance so that it is prepared for collecting metrics. Does
* so such that this setup method may be used on an instance that is already
* initialized, in a way that does not consume additional memory upon reuse.
* That can be useful if you decide to make your subclass of this mixin a
* "PooledClass".
*/
reinitializeTransaction: function () {
this.transactionWrappers = this.getTransactionWrappers();
if (this.wrapperInitData) {
this.wrapperInitData.length = 0;
} else {
this.wrapperInitData = [];
}
this._isInTransaction = false;
},
_isInTransaction: false,
/**
* @abstract
* @return {Array<TransactionWrapper>} Array of transaction wrappers.
*/
getTransactionWrappers: null,
isInTransaction: function () {
return !!this._isInTransaction;
},
/**
* Executes the function within a safety window. Use this for the top level
* methods that result in large amounts of computation/mutations that would
* need to be safety checked. The optional arguments helps prevent the need
* to bind in many cases.
*
* @param {function} method Member of scope to call.
* @param {Object} scope Scope to invoke from.
* @param {Object?=} a Argument to pass to the method.
* @param {Object?=} b Argument to pass to the method.
* @param {Object?=} c Argument to pass to the method.
* @param {Object?=} d Argument to pass to the method.
* @param {Object?=} e Argument to pass to the method.
* @param {Object?=} f Argument to pass to the method.
*
* @return {*} Return value from `method`.
*/
perform: function (method, scope, a, b, c, d, e, f) {
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
var errorThrown;
var ret;
try {
this._isInTransaction = true;
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// one of these calls threw.
errorThrown = true;
this.initializeAll(0);
ret = method.call(scope, a, b, c, d, e, f);
errorThrown = false;
} finally {
try {
if (errorThrown) {
// If `method` throws, prefer to show that stack trace over any thrown
// by invoking `closeAll`.
try {
this.closeAll(0);
} catch (err) {}
} else {
// Since `method` didn't throw, we don't want to silence the exception
// here.
this.closeAll(0);
}
} finally {
this._isInTransaction = false;
}
}
return ret;
},
initializeAll: function (startIndex) {
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
try {
// Catching errors makes debugging more difficult, so we start with the
// OBSERVED_ERROR state before overwriting it with the real return value
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
// block, it means wrapper.initialize threw.
this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
} finally {
if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
// The initializer for wrapper i threw an error; initialize the
// remaining wrappers but silence any exceptions from them to ensure
// that the first error is the one to bubble up.
try {
this.initializeAll(i + 1);
} catch (err) {}
}
}
}
},
/**
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into
* them the respective return values of `this.transactionWrappers.init[i]`
* (`close`rs that correspond to initializers that failed will not be
* invoked).
*/
closeAll: function (startIndex) {
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
var initData = this.wrapperInitData[i];
var errorThrown;
try {
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// wrapper.close threw.
errorThrown = true;
if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
wrapper.close.call(this, initData);
}
errorThrown = false;
} finally {
if (errorThrown) {
// The closer for wrapper i threw an error; close the remaining
// wrappers but silence any exceptions from them to ensure that the
// first error is the one to bubble up.
try {
this.closeAll(i + 1);
} catch (e) {}
}
}
}
this.wrapperInitData.length = 0;
}
};
var Transaction = {
Mixin: Mixin,
/**
* Token to look for to determine if an error occurred.
*/
OBSERVED_ERROR: {}
};
module.exports = Transaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule emptyObject
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 59 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule containsNode
* @typechecks
*/
'use strict';
var isTextNode = __webpack_require__(60);
/*eslint-disable no-bitwise */
/**
* Checks if a given DOM node contains or is another DOM node.
*
* @param {?DOMNode} outerNode Outer DOM node.
* @param {?DOMNode} innerNode Inner DOM node.
* @return {boolean} True if `outerNode` contains or is `innerNode`.
*/
function containsNode(_x, _x2) {
var _again = true;
_function: while (_again) {
var outerNode = _x,
innerNode = _x2;
_again = false;
if (!outerNode || !innerNode) {
return false;
} else if (outerNode === innerNode) {
return true;
} else if (isTextNode(outerNode)) {
return false;
} else if (isTextNode(innerNode)) {
_x = outerNode;
_x2 = innerNode.parentNode;
_again = true;
continue _function;
} else if (outerNode.contains) {
return outerNode.contains(innerNode);
} else if (outerNode.compareDocumentPosition) {
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
} else {
return false;
}
}
}
module.exports = containsNode;
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule isTextNode
* @typechecks
*/
'use strict';
var isNode = __webpack_require__(61);
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM text node.
*/
function isTextNode(object) {
return isNode(object) && object.nodeType == 3;
}
module.exports = isTextNode;
/***/ },
/* 61 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule isNode
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
'use strict';
function isNode(object) {
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
module.exports = isNode;
/***/ },
/* 62 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule instantiateReactComponent
* @typechecks static-only
*/
'use strict';
var ReactCompositeComponent = __webpack_require__(63);
var ReactEmptyComponent = __webpack_require__(68);
var ReactNativeComponent = __webpack_require__(69);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
// To avoid a cyclic dependency, we create the final class in this module
var ReactCompositeComponentWrapper = function () {};
assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
_instantiateReactComponent: instantiateReactComponent
});
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Check if the type reference is a known internal type. I.e. not a user
* provided composite type.
*
* @param {function} type
* @return {boolean} Returns true if this is a valid internal type.
*/
function isInternalComponentType(type) {
return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
}
/**
* Given a ReactNode, create an instance that will actually be mounted.
*
* @param {ReactNode} node
* @return {object} A new instance of the element's constructor.
* @protected
*/
function instantiateReactComponent(node) {
var instance;
if (node === null || node === false) {
instance = new ReactEmptyComponent(instantiateReactComponent);
} else if (typeof node === 'object') {
var element = node;
!(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
// Special case string values
if (typeof element.type === 'string') {
instance = ReactNativeComponent.createInternalComponent(element);
} else if (isInternalComponentType(element.type)) {
// This is temporarily available for custom components that are not string
// representations. I.e. ART. Once those are updated to use the string
// representation, we can drop this code path.
instance = new element.type(element);
} else {
instance = new ReactCompositeComponentWrapper();
}
} else if (typeof node === 'string' || typeof node === 'number') {
instance = ReactNativeComponent.createInstanceForText(node);
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
}
// Sets up the instance. This can probably just move into the constructor now.
instance.construct(node);
// These two fields are used by the DOM and ART diffing algorithms
// respectively. Instead of using expandos on components, we should be
// storing the state needed by the diffing algorithms elsewhere.
instance._mountIndex = 0;
instance._mountImage = null;
if (process.env.NODE_ENV !== 'production') {
instance._isOwnerNecessary = false;
instance._warnedAboutRefsInRender = false;
}
// Internal instances should fully constructed at this point, so they should
// not get any new fields added to them at this point.
if (process.env.NODE_ENV !== 'production') {
if (Object.preventExtensions) {
Object.preventExtensions(instance);
}
}
return instance;
}
module.exports = instantiateReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 63 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactCompositeComponent
*/
'use strict';
var ReactComponentEnvironment = __webpack_require__(64);
var ReactCurrentOwner = __webpack_require__(5);
var ReactElement = __webpack_require__(42);
var ReactInstanceMap = __webpack_require__(47);
var ReactPerf = __webpack_require__(18);
var ReactPropTypeLocations = __webpack_require__(65);
var ReactPropTypeLocationNames = __webpack_require__(66);
var ReactReconciler = __webpack_require__(50);
var ReactUpdateQueue = __webpack_require__(53);
var assign = __webpack_require__(39);
var emptyObject = __webpack_require__(58);
var invariant = __webpack_require__(13);
var shouldUpdateReactComponent = __webpack_require__(67);
var warning = __webpack_require__(25);
function getDeclarationErrorAddendum(component) {
var owner = component._currentElement._owner || null;
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
function StatelessComponent(Component) {}
StatelessComponent.prototype.render = function () {
var Component = ReactInstanceMap.get(this)._currentElement.type;
return Component(this.props, this.context, this.updater);
};
/**
* ------------------ The Life-Cycle of a Composite Component ------------------
*
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
* - [children's componentWillMount and render]
* - [children's componentDidMount]
* - componentDidMount
*
* Update Phases:
* - componentWillReceiveProps (only called if parent updated)
* - shouldComponentUpdate
* - componentWillUpdate
* - render
* - [children's constructors or receive props phases]
* - componentDidUpdate
*
* - componentWillUnmount
* - [children's componentWillUnmount]
* - [children destroyed]
* - (destroyed): The instance is now blank, released by React and ready for GC.
*
* your_sha256_hash-------------
*/
/**
* An incrementing ID assigned to each component when it is mounted. This is
* used to enforce the order in which `ReactUpdates` updates dirty components.
*
* @private
*/
var nextMountID = 1;
/**
* @lends {ReactCompositeComponent.prototype}
*/
var ReactCompositeComponentMixin = {
/**
* Base constructor for all composite component.
*
* @param {ReactElement} element
* @final
* @internal
*/
construct: function (element) {
this._currentElement = element;
this._rootNodeID = null;
this._instance = null;
// See ReactUpdateQueue
this._pendingElement = null;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._renderedComponent = null;
this._context = null;
this._mountOrder = 0;
this._topLevelWrapper = null;
// See ReactUpdates and ReactUpdateQueue.
this._pendingCallbacks = null;
},
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (rootID, transaction, context) {
this._context = context;
this._mountOrder = nextMountID++;
this._rootNodeID = rootID;
var publicProps = this._processProps(this._currentElement.props);
var publicContext = this._processContext(context);
var Component = this._currentElement.type;
// Initialize the public class
var inst;
var renderedElement;
// This is a way to detect if Component is a stateless arrow function
// component, which is not newable. It might not be 100% reliable but is
// something we can do until we start detecting that Component extends
// React.Component. We already assume that typeof Component === 'function'.
var canInstantiate = ('prototype' in Component);
if (canInstantiate) {
if (process.env.NODE_ENV !== 'production') {
ReactCurrentOwner.current = this;
try {
inst = new Component(publicProps, publicContext, ReactUpdateQueue);
} finally {
ReactCurrentOwner.current = null;
}
} else {
inst = new Component(publicProps, publicContext, ReactUpdateQueue);
}
}
if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) {
renderedElement = inst;
inst = new StatelessComponent(Component);
}
if (process.env.NODE_ENV !== 'production') {
// This will throw later in _renderValidatedComponent, but add an early
// warning now to help debugging
if (inst.render == null) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined;
} else {
// We support ES6 inheriting from React.Component, the module pattern,
// and stateless components, but not ES6 classes that don't extend
process.env.NODE_ENV !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined;
}
}
// These should be set up in the constructor, but as a convenience for
// simpler class abstractions, we set them up after the fact.
inst.props = publicProps;
inst.context = publicContext;
inst.refs = emptyObject;
inst.updater = ReactUpdateQueue;
this._instance = inst;
// Store a reference from the instance back to the internal representation
ReactInstanceMap.set(inst, this);
if (process.env.NODE_ENV !== 'production') {
// Since plain JS classes are defined without any special initialization
// logic, we can not catch common errors early. Therefore, we have to
// catch them here, at initialization time, instead.
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined;
}
var initialState = inst.state;
if (initialState === undefined) {
inst.state = initialState = null;
}
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
if (inst.componentWillMount) {
inst.componentWillMount();
// When mounting, calls to `setState` by `componentWillMount` will set
// `this._pendingStateQueue` without triggering a re-render.
if (this._pendingStateQueue) {
inst.state = this._processPendingState(inst.props, inst.context);
}
}
// If not a stateless component, we now render
if (renderedElement === undefined) {
renderedElement = this._renderValidatedComponent();
}
this._renderedComponent = this._instantiateReactComponent(renderedElement);
var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context));
if (inst.componentDidMount) {
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
}
return markup;
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function () {
var inst = this._instance;
if (inst.componentWillUnmount) {
inst.componentWillUnmount();
}
ReactReconciler.unmountComponent(this._renderedComponent);
this._renderedComponent = null;
this._instance = null;
// Reset pending fields
// Even if this component is scheduled for another update in ReactUpdates,
// it would still be ignored because these fields are reset.
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._pendingCallbacks = null;
this._pendingElement = null;
// These fields do not really need to be reset since this object is no
// longer accessible.
this._context = null;
this._rootNodeID = null;
this._topLevelWrapper = null;
// Delete the reference from the instance to this internal representation
// which allow the internals to be properly cleaned up even if the user
// leaks a reference to the public instance.
ReactInstanceMap.remove(inst);
// Some existing components rely on inst.props even after they've been
// destroyed (in event handlers).
// TODO: inst.props = null;
// TODO: inst.state = null;
// TODO: inst.context = null;
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`
*
* @param {object} context
* @return {?object}
* @private
*/
_maskContext: function (context) {
var maskedContext = null;
var Component = this._currentElement.type;
var contextTypes = Component.contextTypes;
if (!contextTypes) {
return emptyObject;
}
maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
}
return maskedContext;
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`, and asserts that they are valid.
*
* @param {object} context
* @return {?object}
* @private
*/
_processContext: function (context) {
var maskedContext = this._maskContext(context);
if (process.env.NODE_ENV !== 'production') {
var Component = this._currentElement.type;
if (Component.contextTypes) {
this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
}
}
return maskedContext;
},
/**
* @param {object} currentContext
* @return {object}
* @private
*/
_processChildContext: function (currentContext) {
var Component = this._currentElement.type;
var inst = this._instance;
var childContext = inst.getChildContext && inst.getChildContext();
if (childContext) {
!(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
if (process.env.NODE_ENV !== 'production') {
this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
}
for (var name in childContext) {
!(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined;
}
return assign({}, currentContext, childContext);
}
return currentContext;
},
/**
* Processes props by setting default values for unspecified props and
* asserting that the props are valid. Does not mutate its argument; returns
* a new props object with defaults merged in.
*
* @param {object} newProps
* @return {object}
* @private
*/
_processProps: function (newProps) {
if (process.env.NODE_ENV !== 'production') {
var Component = this._currentElement.type;
if (Component.propTypes) {
this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
}
}
return newProps;
},
/**
* Assert that the props are valid
*
* @param {object} propTypes Map of prop name to a ReactPropType
* @param {object} props
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
_checkPropTypes: function (propTypes, props, location) {
// TODO: Stop validating prop types here and only use the element
// validation.
var componentName = this.getName();
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
!(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
error = propTypes[propName](props, propName, componentName, location);
} catch (ex) {
error = ex;
}
if (error instanceof Error) {
// We may want to extend this logic for similar errors in
// top-level render calls, so I'm abstracting it away into
// a function to minimize refactoring in the future
var addendum = getDeclarationErrorAddendum(this);
if (location === ReactPropTypeLocations.prop) {
// Preface gives us something to blacklist in warning module
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined;
}
}
}
}
},
receiveComponent: function (nextElement, transaction, nextContext) {
var prevElement = this._currentElement;
var prevContext = this._context;
this._pendingElement = null;
this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
},
/**
* If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
* is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (transaction) {
if (this._pendingElement != null) {
ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context);
}
if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
}
},
/**
* Perform an update to a mounted component. The componentWillReceiveProps and
* shouldComponentUpdate methods are called, then (assuming the update isn't
* skipped) the remaining update lifecycle methods are called and the DOM
* representation is updated.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevParentElement
* @param {ReactElement} nextParentElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
var inst = this._instance;
var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext);
var nextProps;
// Distinguish between a props update versus a simple state update
if (prevParentElement === nextParentElement) {
// Skip checking prop types again -- we don't read inst.props to avoid
// warning for DOM component props in this upgrade
nextProps = nextParentElement.props;
} else {
nextProps = this._processProps(nextParentElement.props);
// An update here will schedule an update but immediately set
// _pendingStateQueue which will ensure that any state updates gets
// immediately reconciled instead of waiting for the next batch.
if (inst.componentWillReceiveProps) {
inst.componentWillReceiveProps(nextProps, nextContext);
}
}
var nextState = this._processPendingState(nextProps, nextContext);
var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined;
}
if (shouldUpdate) {
this._pendingForceUpdate = false;
// Will set `this.props`, `this.state` and `this.context`.
this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
} else {
// If it's determined that a component should not update, we still want
// to set props and state but we shortcut the rest of the update.
this._currentElement = nextParentElement;
this._context = nextUnmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
}
},
_processPendingState: function (props, context) {
var inst = this._instance;
var queue = this._pendingStateQueue;
var replace = this._pendingReplaceState;
this._pendingReplaceState = false;
this._pendingStateQueue = null;
if (!queue) {
return inst.state;
}
if (replace && queue.length === 1) {
return queue[0];
}
var nextState = assign({}, replace ? queue[0] : inst.state);
for (var i = replace ? 1 : 0; i < queue.length; i++) {
var partial = queue[i];
assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
}
return nextState;
},
/**
* Merges new props and state, notifies delegate methods of update and
* performs update.
*
* @param {ReactElement} nextElement Next element
* @param {object} nextProps Next public object to set as properties.
* @param {?object} nextState Next object to set as state.
* @param {?object} nextContext Next public object to set as context.
* @param {ReactReconcileTransaction} transaction
* @param {?object} unmaskedContext
* @private
*/
_performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
var inst = this._instance;
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
var prevProps;
var prevState;
var prevContext;
if (hasComponentDidUpdate) {
prevProps = inst.props;
prevState = inst.state;
prevContext = inst.context;
}
if (inst.componentWillUpdate) {
inst.componentWillUpdate(nextProps, nextState, nextContext);
}
this._currentElement = nextElement;
this._context = unmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
this._updateRenderedComponent(transaction, unmaskedContext);
if (hasComponentDidUpdate) {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
}
},
/**
* Call the component's `render` method and update the DOM accordingly.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
_updateRenderedComponent: function (transaction, context) {
var prevComponentInstance = this._renderedComponent;
var prevRenderedElement = prevComponentInstance._currentElement;
var nextRenderedElement = this._renderValidatedComponent();
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
} else {
// These two IDs are actually the same! But nothing should rely on that.
var thisID = this._rootNodeID;
var prevComponentID = prevComponentInstance._rootNodeID;
ReactReconciler.unmountComponent(prevComponentInstance);
this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context));
this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
}
},
/**
* @protected
*/
_replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) {
ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
},
/**
* @protected
*/
_renderValidatedComponentWithoutOwnerOrContext: function () {
var inst = this._instance;
var renderedComponent = inst.render();
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
renderedComponent = null;
}
}
return renderedComponent;
},
/**
* @private
*/
_renderValidatedComponent: function () {
var renderedComponent;
ReactCurrentOwner.current = this;
try {
renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
} finally {
ReactCurrentOwner.current = null;
}
!(
// TODO: An `isValidNode` function would probably be more appropriate
renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
return renderedComponent;
},
/**
* Lazily allocates the refs object and stores `component` as `ref`.
*
* @param {string} ref Reference name.
* @param {component} component Component to store as `ref`.
* @final
* @private
*/
attachRef: function (ref, component) {
var inst = this.getPublicInstance();
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined;
var publicComponentInstance = component.getPublicInstance();
if (process.env.NODE_ENV !== 'production') {
var componentName = component && component.getName ? component.getName() : 'a component';
process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined;
}
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
refs[ref] = publicComponentInstance;
},
/**
* Detaches a reference name.
*
* @param {string} ref Name to dereference.
* @final
* @private
*/
detachRef: function (ref) {
var refs = this.getPublicInstance().refs;
delete refs[ref];
},
/**
* Get a text description of the component that can be used to identify it
* in error messages.
* @return {string} The name or null.
* @internal
*/
getName: function () {
var type = this._currentElement.type;
var constructor = this._instance && this._instance.constructor;
return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
},
/**
* Get the publicly accessible representation of this component - i.e. what
* is exposed by refs and returned by render. Can be null for stateless
* components.
*
* @return {ReactComponent} the public component instance.
* @internal
*/
getPublicInstance: function () {
var inst = this._instance;
if (inst instanceof StatelessComponent) {
return null;
}
return inst;
},
// Stub
_instantiateReactComponent: null
};
ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
mountComponent: 'mountComponent',
updateComponent: 'updateComponent',
_renderValidatedComponent: '_renderValidatedComponent'
});
var ReactCompositeComponent = {
Mixin: ReactCompositeComponentMixin
};
module.exports = ReactCompositeComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactComponentEnvironment
*/
'use strict';
var invariant = __webpack_require__(13);
var injected = false;
var ReactComponentEnvironment = {
/**
* Optionally injectable environment dependent cleanup hook. (server vs.
* browser etc). Example: A browser system caches DOM nodes based on component
* ID and must remove that cache entry when this instance is unmounted.
*/
unmountIDFromEnvironment: null,
/**
* Optionally injectable hook for swapping out mount images in the middle of
* the tree.
*/
replaceNodeWithMarkupByID: null,
/**
* Optionally injectable hook for processing a queue of child updates. Will
* later move into MultiChildComponents.
*/
processChildrenUpdates: null,
injection: {
injectEnvironment: function (environment) {
!!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined;
ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID;
ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
injected = true;
}
}
};
module.exports = ReactComponentEnvironment;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactPropTypeLocations
*/
'use strict';
var keyMirror = __webpack_require__(17);
var ReactPropTypeLocations = keyMirror({
prop: null,
context: null,
childContext: null
});
module.exports = ReactPropTypeLocations;
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactPropTypeLocationNames
*/
'use strict';
var ReactPropTypeLocationNames = {};
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 67 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule shouldUpdateReactComponent
* @typechecks static-only
*/
'use strict';
/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced by a new
* instance. Both arguments are elements. This ensures that this logic can
* operate on stateless trees without any backing instance.
*
* @param {?object} prevElement
* @param {?object} nextElement
* @return {boolean} True if the existing instance should be updated.
* @protected
*/
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;
}
return false;
}
module.exports = shouldUpdateReactComponent;
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactEmptyComponent
*/
'use strict';
var ReactElement = __webpack_require__(42);
var ReactEmptyComponentRegistry = __webpack_require__(44);
var ReactReconciler = __webpack_require__(50);
var assign = __webpack_require__(39);
var placeholderElement;
var ReactEmptyComponentInjection = {
injectEmptyComponent: function (component) {
placeholderElement = ReactElement.createElement(component);
}
};
var ReactEmptyComponent = function (instantiate) {
this._currentElement = null;
this._rootNodeID = null;
this._renderedComponent = instantiate(placeholderElement);
};
assign(ReactEmptyComponent.prototype, {
construct: function (element) {},
mountComponent: function (rootID, transaction, context) {
ReactEmptyComponentRegistry.registerNullComponentID(rootID);
this._rootNodeID = rootID;
return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
},
receiveComponent: function () {},
unmountComponent: function (rootID, transaction, context) {
ReactReconciler.unmountComponent(this._renderedComponent);
ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
this._rootNodeID = null;
this._renderedComponent = null;
}
});
ReactEmptyComponent.injection = ReactEmptyComponentInjection;
module.exports = ReactEmptyComponent;
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactNativeComponent
*/
'use strict';
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var autoGenerateWrapperClass = null;
var genericComponentClass = null;
// This registry keeps track of wrapper classes around native tags.
var tagToComponentClass = {};
var textComponentClass = null;
var ReactNativeComponentInjection = {
// This accepts a class that receives the tag string. This is a catch all
// that can render any kind of tag.
injectGenericComponentClass: function (componentClass) {
genericComponentClass = componentClass;
},
// This accepts a text component class that takes the text string to be
// rendered as props.
injectTextComponentClass: function (componentClass) {
textComponentClass = componentClass;
},
// This accepts a keyed object with classes as values. Each key represents a
// tag. That particular tag will use this class instead of the generic one.
injectComponentClasses: function (componentClasses) {
assign(tagToComponentClass, componentClasses);
}
};
/**
* Get a composite component wrapper class for a specific tag.
*
* @param {ReactElement} element The tag for which to get the class.
* @return {function} The React class constructor function.
*/
function getComponentClassForElement(element) {
if (typeof element.type === 'function') {
return element.type;
}
var tag = element.type;
var componentClass = tagToComponentClass[tag];
if (componentClass == null) {
tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
}
return componentClass;
}
/**
* Get a native internal component class for a specific tag.
*
* @param {ReactElement} element The element to create.
* @return {function} The internal class constructor function.
*/
function createInternalComponent(element) {
!genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined;
return new genericComponentClass(element.type, element.props);
}
/**
* @param {ReactText} text
* @return {ReactComponent}
*/
function createInstanceForText(text) {
return new textComponentClass(text);
}
/**
* @param {ReactComponent} component
* @return {boolean}
*/
function isTextComponent(component) {
return component instanceof textComponentClass;
}
var ReactNativeComponent = {
getComponentClassForElement: getComponentClassForElement,
createInternalComponent: createInternalComponent,
createInstanceForText: createInstanceForText,
isTextComponent: isTextComponent,
injection: ReactNativeComponentInjection
};
module.exports = ReactNativeComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule validateDOMNesting
*/
'use strict';
var assign = __webpack_require__(39);
var emptyFunction = __webpack_require__(15);
var warning = __webpack_require__(25);
var validateDOMNesting = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
// This validation code was written based on the HTML5 parsing spec:
// path_to_url#has-an-element-in-scope
//
// Note: this does not catch all invalid nesting, nor does it try to (as it's
// not clear what practical benefit doing so provides); instead, we warn only
// for cases where the parser will give a parse tree differing from what React
// intended. For example, <b><div></div></b> is invalid but we don't warn
// because it still parses correctly; we do warn for other cases like nested
// <p> tags where the beginning of the second element implicitly closes the
// first, causing a confusing mess.
// path_to_url#special
var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
// path_to_url#has-an-element-in-scope
var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
// path_to_url#html-integration-point
// TODO: Distinguish by namespace here -- for <title>, including it here
// errs on the side of fewer warnings
'foreignObject', 'desc', 'title'];
// path_to_url#has-an-element-in-button-scope
var buttonScopeTags = inScopeTags.concat(['button']);
// path_to_url#generate-implied-end-tags
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
var emptyAncestorInfo = {
parentTag: null,
formTag: null,
aTagInScope: null,
buttonTagInScope: null,
nobrTagInScope: null,
pTagInButtonScope: null,
listItemTagAutoclosing: null,
dlItemTagAutoclosing: null
};
var updatedAncestorInfo = function (oldInfo, tag, instance) {
var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
var info = { tag: tag, instance: instance };
if (inScopeTags.indexOf(tag) !== -1) {
ancestorInfo.aTagInScope = null;
ancestorInfo.buttonTagInScope = null;
ancestorInfo.nobrTagInScope = null;
}
if (buttonScopeTags.indexOf(tag) !== -1) {
ancestorInfo.pTagInButtonScope = null;
}
// See rules for 'li', 'dd', 'dt' start tags in
// path_to_url#parsing-main-inbody
if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
ancestorInfo.listItemTagAutoclosing = null;
ancestorInfo.dlItemTagAutoclosing = null;
}
ancestorInfo.parentTag = info;
if (tag === 'form') {
ancestorInfo.formTag = info;
}
if (tag === 'a') {
ancestorInfo.aTagInScope = info;
}
if (tag === 'button') {
ancestorInfo.buttonTagInScope = info;
}
if (tag === 'nobr') {
ancestorInfo.nobrTagInScope = info;
}
if (tag === 'p') {
ancestorInfo.pTagInButtonScope = info;
}
if (tag === 'li') {
ancestorInfo.listItemTagAutoclosing = info;
}
if (tag === 'dd' || tag === 'dt') {
ancestorInfo.dlItemTagAutoclosing = info;
}
return ancestorInfo;
};
/**
* Returns whether
*/
var isTagValidWithParent = function (tag, parentTag) {
// First, let's check if we're in an unusual parsing mode...
switch (parentTag) {
// path_to_url#parsing-main-inselect
case 'select':
return tag === 'option' || tag === 'optgroup' || tag === '#text';
case 'optgroup':
return tag === 'option' || tag === '#text';
// Strictly speaking, seeing an <option> doesn't mean we're in a <select>
// but
case 'option':
return tag === '#text';
// path_to_url#parsing-main-intd
// path_to_url#parsing-main-incaption
// No special behavior since these rules fall back to "in body" mode for
// all except special table nodes which cause bad parsing behavior anyway.
// path_to_url#parsing-main-intr
case 'tr':
return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
// path_to_url#parsing-main-intbody
case 'tbody':
case 'thead':
case 'tfoot':
return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
// path_to_url#parsing-main-incolgroup
case 'colgroup':
return tag === 'col' || tag === 'template';
// path_to_url#parsing-main-intable
case 'table':
return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
// path_to_url#parsing-main-inhead
case 'head':
return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
// path_to_url#the-html-element
case 'html':
return tag === 'head' || tag === 'body';
}
// Probably in the "in body" parsing mode, so we outlaw only tag combos
// where the parsing rules cause implicit opens or closes to be added.
// path_to_url#parsing-main-inbody
switch (tag) {
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
case 'rp':
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;
case 'caption':
case 'col':
case 'colgroup':
case 'frame':
case 'head':
case 'tbody':
case 'td':
case 'tfoot':
case 'th':
case 'thead':
case 'tr':
// These tags are only valid with a few parents that have special child
// parsing rules -- if we're down here, then none of those matched and
// so we allow it only if we don't know what the parent is, as all other
// cases are invalid.
return parentTag == null;
}
return true;
};
/**
* Returns whether
*/
var findInvalidAncestorForTag = function (tag, ancestorInfo) {
switch (tag) {
case 'address':
case 'article':
case 'aside':
case 'blockquote':
case 'center':
case 'details':
case 'dialog':
case 'dir':
case 'div':
case 'dl':
case 'fieldset':
case 'figcaption':
case 'figure':
case 'footer':
case 'header':
case 'hgroup':
case 'main':
case 'menu':
case 'nav':
case 'ol':
case 'p':
case 'section':
case 'summary':
case 'ul':
case 'pre':
case 'listing':
case 'table':
case 'hr':
case 'xmp':
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return ancestorInfo.pTagInButtonScope;
case 'form':
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
case 'li':
return ancestorInfo.listItemTagAutoclosing;
case 'dd':
case 'dt':
return ancestorInfo.dlItemTagAutoclosing;
case 'button':
return ancestorInfo.buttonTagInScope;
case 'a':
// Spec says something about storing a list of markers, but it sounds
// equivalent to this check.
return ancestorInfo.aTagInScope;
case 'nobr':
return ancestorInfo.nobrTagInScope;
}
return null;
};
/**
* Given a ReactCompositeComponent instance, return a list of its recursive
* owners, starting at the root and ending with the instance itself.
*/
var findOwnerStack = function (instance) {
if (!instance) {
return [];
}
var stack = [];
/*eslint-disable space-after-keywords */
do {
/*eslint-enable space-after-keywords */
stack.push(instance);
} while (instance = instance._currentElement._owner);
stack.reverse();
return stack;
};
var didWarn = {};
validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.parentTag;
var parentTag = parentInfo && parentInfo.tag;
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
var problematic = invalidParent || invalidAncestor;
if (problematic) {
var ancestorTag = problematic.tag;
var ancestorInstance = problematic.instance;
var childOwner = childInstance && childInstance._currentElement._owner;
var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
var childOwners = findOwnerStack(childOwner);
var ancestorOwners = findOwnerStack(ancestorOwner);
var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
var i;
var deepestCommon = -1;
for (i = 0; i < minStackLen; i++) {
if (childOwners[i] === ancestorOwners[i]) {
deepestCommon = i;
} else {
break;
}
}
var UNKNOWN = '(unknown)';
var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
return inst.getName() || UNKNOWN;
});
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
return inst.getName() || UNKNOWN;
});
var ownerInfo = [].concat(
// If the parent and child instances have a common owner ancestor, start
// with that -- otherwise we just start with the parent's owners.
deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
// If we're warning about an invalid (non-parent) ancestry, add '...'
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
if (didWarn[warnKey]) {
return;
}
didWarn[warnKey] = true;
if (invalidParent) {
var info = '';
if (ancestorTag === 'table' && childTag === 'tr') {
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
}
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
}
}
};
validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
// For testing
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.parentTag;
var parentTag = parentInfo && parentInfo.tag;
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
};
}
module.exports = validateDOMNesting;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 71 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDefaultInjection
*/
'use strict';
var BeforeInputEventPlugin = __webpack_require__(72);
var ChangeEventPlugin = __webpack_require__(80);
var ClientReactRootIndex = __webpack_require__(83);
var DefaultEventPluginOrder = __webpack_require__(84);
var EnterLeaveEventPlugin = __webpack_require__(85);
var ExecutionEnvironment = __webpack_require__(9);
var HTMLDOMPropertyConfig = __webpack_require__(89);
var ReactBrowserComponentMixin = __webpack_require__(90);
var ReactComponentBrowserEnvironment = __webpack_require__(26);
var ReactDefaultBatchingStrategy = __webpack_require__(92);
var ReactDOMComponent = __webpack_require__(93);
var ReactDOMTextComponent = __webpack_require__(6);
var ReactEventListener = __webpack_require__(118);
var ReactInjection = __webpack_require__(121);
var ReactInstanceHandles = __webpack_require__(45);
var ReactMount = __webpack_require__(28);
var ReactReconcileTransaction = __webpack_require__(125);
var SelectEventPlugin = __webpack_require__(130);
var ServerReactRootIndex = __webpack_require__(131);
var SimpleEventPlugin = __webpack_require__(132);
var SVGDOMPropertyConfig = __webpack_require__(141);
var alreadyInjected = false;
function inject() {
if (alreadyInjected) {
// TODO: This is currently true because these injections are shared between
// the client and the server package. They should be built independently
// and not share any injection state. Then this problem will be solved.
return;
}
alreadyInjected = true;
ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
/**
* Inject modules for resolving DOM hierarchy and plugin ordering.
*/
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
ReactInjection.EventPluginHub.injectMount(ReactMount);
/**
* Some important event plugins included by default (without having to require
* them).
*/
ReactInjection.EventPluginHub.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex);
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
if (process.env.NODE_ENV !== 'production') {
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
var ReactDefaultPerf = __webpack_require__(142);
ReactDefaultPerf.start();
}
}
}
module.exports = {
inject: inject
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule BeforeInputEventPlugin
* @typechecks static-only
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPropagators = __webpack_require__(73);
var ExecutionEnvironment = __webpack_require__(9);
var FallbackCompositionState = __webpack_require__(74);
var SyntheticCompositionEvent = __webpack_require__(76);
var SyntheticInputEvent = __webpack_require__(78);
var keyOf = __webpack_require__(79);
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;
var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
var documentMode = null;
if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
documentMode = document.documentMode;
}
// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
/**
* Opera <= 12 includes TextEvent in window, but does not fire
* text input events. Rely on keypress instead.
*/
function isPresto() {
var opera = window.opera;
return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
}
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
var topLevelTypes = EventConstants.topLevelTypes;
// Events and their corresponding property names.
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: keyOf({ onBeforeInput: null }),
captured: keyOf({ onBeforeInputCapture: null })
},
dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionEnd: null }),
captured: keyOf({ onCompositionEndCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
},
compositionStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionStart: null }),
captured: keyOf({ onCompositionStartCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionUpdate: null }),
captured: keyOf({ onCompositionUpdateCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
}
};
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
/**
* Return whether a native keypress event is assumed to be a command.
* This is required because Firefox fires `keypress` events for key commands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
* Translate native top level events into event types.
*
* @param {string} topLevelType
* @return {object}
*/
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case topLevelTypes.topCompositionStart:
return eventTypes.compositionStart;
case topLevelTypes.topCompositionEnd:
return eventTypes.compositionEnd;
case topLevelTypes.topCompositionUpdate:
return eventTypes.compositionUpdate;
}
}
/**
* Does our fallback best-guess model think this event signifies that
* composition has begun?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionStart(topLevelType, nativeEvent) {
return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
}
/**
* Does our fallback mode think that this event is the end of composition?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case topLevelTypes.topKeyUp:
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case topLevelTypes.topKeyDown:
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.keyCode !== START_KEYCODE;
case topLevelTypes.topKeyPress:
case topLevelTypes.topMouseDown:
case topLevelTypes.topBlur:
// Events are not possible without cancelling IME.
return true;
default:
return false;
}
}
/**
* Google Input Tools provides composition data via a CustomEvent,
* with the `data` property populated in the `detail` object. If this
* is available on the event object, use it. If not, this is a plain
* composition event and we have nothing special to extract.
*
* @param {object} nativeEvent
* @return {?string}
*/
function getDataFromCustomEvent(nativeEvent) {
var detail = nativeEvent.detail;
if (typeof detail === 'object' && 'data' in detail) {
return detail.data;
}
return null;
}
// Track the current IME composition fallback object, if any.
var currentComposition = null;
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {?object} A SyntheticCompositionEvent.
*/
function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var eventType;
var fallbackData;
if (canUseCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!currentComposition) {
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (!eventType) {
return null;
}
if (useFallbackCompositionData) {
// The current composition is stored statically and must not be
// overwritten while composition continues.
if (!currentComposition && eventType === eventTypes.compositionStart) {
currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (currentComposition) {
fallbackData = currentComposition.getData();
}
}
}
var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget);
if (fallbackData) {
// Inject data generated from fallback path into the synthetic event.
// This matches the property of native CompositionEventInterface.
event.data = fallbackData;
} else {
var customData = getDataFromCustomEvent(nativeEvent);
if (customData !== null) {
event.data = customData;
}
}
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The string corresponding to this `beforeInput` event.
*/
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case topLevelTypes.topCompositionEnd:
return getDataFromCustomEvent(nativeEvent);
case topLevelTypes.topKeyPress:
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key.
* In Webkit, preventing default on a spacebar `textInput` event
* cancels character insertion, but it *also* causes the browser
* to fall back to its default spacebar behavior of scrolling the
* page.
*
* Tracking at:
* path_to_url
*
* To avoid this issue, use the keypress event as if no `textInput`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case topLevelTypes.topTextInput:
// Record the characters to be added to the DOM.
var chars = nativeEvent.data;
// If it's a spacebar character, assume that we have already handled
// it at the keypress level and bail immediately. Android Chrome
// doesn't give us keycodes, so we need to blacklist it.
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return null;
}
return chars;
default:
// For other native event types, do nothing.
return null;
}
}
/**
* For browsers that do not provide the `textInput` event, extract the
* appropriate string to use for SyntheticInputEvent.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The fallback string for this `beforeInput` event.
*/
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
// If we are currently composing (IME) and using a fallback to do so,
// try to extract the composed characters from the fallback object.
if (currentComposition) {
if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
var chars = currentComposition.getData();
FallbackCompositionState.release(currentComposition);
currentComposition = null;
return chars;
}
return null;
}
switch (topLevelType) {
case topLevelTypes.topPaste:
// If a paste event occurs after a keypress, throw out the input
// chars. Paste events should not lead to BeforeInput events.
return null;
case topLevelTypes.topKeyPress:
/**
* As of v27, Firefox may fire keypress events even when no character
* will be inserted. A few possibilities:
*
* - `which` is `0`. Arrow keys, Esc key, etc.
*
* - `which` is the pressed key code, but no char is available.
* Ex: 'AltGr + d` in Polish. There is no modified character for
* this key combination and no character is inserted into the
* document, but FF fires the keypress for char code `100` anyway.
* No `input` event will occur.
*
* - `which` is the pressed key code, but a command combination is
* being used. Ex: `Cmd+C`. No character is inserted, and no
* `input` event will occur.
*/
if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
return String.fromCharCode(nativeEvent.which);
}
return null;
case topLevelTypes.topCompositionEnd:
return useFallbackCompositionData ? null : nativeEvent.data;
default:
return null;
}
}
/**
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
* `textInput` or fallback behavior.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {?object} A SyntheticInputEvent.
*/
function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var chars;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
}
// If no characters are being inserted, no BeforeInput event should
// be fired.
if (!chars) {
return null;
}
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget);
event.data = chars;
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* Create an `onBeforeInput` event to match
* path_to_url#events-inputevents.
*
* This event plugin is based on the native `textInput` event
* available in Chrome, Safari, Opera, and IE. This event fires after
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
*
* `beforeInput` is spec'd but not implemented in any browsers, and
* the `input` event does not provide any useful information about what has
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
*
* This plugin is also responsible for emitting `composition` events, thus
* allowing us to share composition fallback code for both `beforeInput` and
* `composition` event types.
*/
var BeforeInputEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)];
}
};
module.exports = BeforeInputEventPlugin;
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule EventPropagators
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPluginHub = __webpack_require__(31);
var warning = __webpack_require__(25);
var accumulateInto = __webpack_require__(35);
var forEachAccumulated = __webpack_require__(36);
var PropagationPhases = EventConstants.PropagationPhases;
var getListener = EventPluginHub.getListener;
/**
* Some event types have a notion of different registration names for different
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(id, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(id, registrationName);
}
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
* here, allows us to not have to bind or create functions for each event.
* Mutating the event's members allows us to not have to create a wrapping
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(domID, upwards, event) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
}
var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
var listener = listenerAtPhase(domID, event, phase);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
}
}
/**
* Collect dispatches (must be entirely collected before dispatching - see unit
* tests). Lazily allocate the array to conserve memory. We must loop through
* each event and perform the traversal for each one. We cannot perform a
* single traversal for the entire collection of events because each event may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);
}
}
/**
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
*/
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but without
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(id, ignoredDirection, event) {
if (event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(id, registrationName);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
}
}
}
/**
* Accumulates dispatches on an `SyntheticEvent`, but only for the
* `dispatchMarker`.
* @param {SyntheticEvent} event
*/
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event.dispatchMarker, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateTwoPhaseDispatchesSkipTarget(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
}
function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
/**
* A small set of propagation patterns, each of which will accept a small amount
* of information, and generate a set of "dispatch ready event objects" - which
* are sets of events that have already been annotated with a set of dispatched
* listener functions/ids. The API is designed this way to discourage these
* propagation strategies from actually executing the dispatches, since we
* always want to collect the entire set of dispatches before executing event a
* single one.
*
* @constructor EventPropagators
*/
var EventPropagators = {
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
accumulateDirectDispatches: accumulateDirectDispatches,
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
};
module.exports = EventPropagators;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 74 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule FallbackCompositionState
* @typechecks static-only
*/
'use strict';
var PooledClass = __webpack_require__(56);
var assign = __webpack_require__(39);
var getTextContentAccessor = __webpack_require__(75);
/**
* This helper class stores information about text content of a target node,
* allowing comparison of content before and after a given event.
*
* Identify the node where selection currently begins, then observe
* both its text content and its current position in the DOM. Since the
* browser may natively replace the target node during composition, we can
* use its position to find its replacement.
*
* @param {DOMEventTarget} root
*/
function FallbackCompositionState(root) {
this._root = root;
this._startText = this.getText();
this._fallbackText = null;
}
assign(FallbackCompositionState.prototype, {
destructor: function () {
this._root = null;
this._startText = null;
this._fallbackText = null;
},
/**
* Get current text of input.
*
* @return {string}
*/
getText: function () {
if ('value' in this._root) {
return this._root.value;
}
return this._root[getTextContentAccessor()];
},
/**
* Determine the differing substring between the initially stored
* text content and the current content.
*
* @return {string}
*/
getData: function () {
if (this._fallbackText) {
return this._fallbackText;
}
var start;
var startValue = this._startText;
var startLength = startValue.length;
var end;
var endValue = this.getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue[start] !== endValue[start]) {
break;
}
}
var minEnd = startLength - start;
for (end = 1; end <= minEnd; end++) {
if (startValue[startLength - end] !== endValue[endLength - end]) {
break;
}
}
var sliceTail = end > 1 ? 1 - end : undefined;
this._fallbackText = endValue.slice(start, sliceTail);
return this._fallbackText;
}
});
PooledClass.addPoolingTo(FallbackCompositionState);
module.exports = FallbackCompositionState;
/***/ },
/* 75 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule getTextContentAccessor
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var contentKey = null;
/**
* Gets the key used to access text content on a DOM node.
*
* @return {?string} Key used to access text content.
* @internal
*/
function getTextContentAccessor() {
if (!contentKey && ExecutionEnvironment.canUseDOM) {
// Prefer textContent to innerText because many browsers support both but
// SVG <text> elements don't support innerText even when <div> does.
contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
}
return contentKey;
}
module.exports = getTextContentAccessor;
/***/ },
/* 76 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticCompositionEvent
* @typechecks static-only
*/
'use strict';
var SyntheticEvent = __webpack_require__(77);
/**
* @interface Event
* @see path_to_url#events-compositionevents
*/
var CompositionEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
module.exports = SyntheticCompositionEvent;
/***/ },
/* 77 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule SyntheticEvent
* @typechecks static-only
*/
'use strict';
var PooledClass = __webpack_require__(56);
var assign = __webpack_require__(39);
var emptyFunction = __webpack_require__(15);
var warning = __webpack_require__(25);
/**
* @interface Event
* @see path_to_url
*/
var EventInterface = {
type: null,
// currentTarget is set when dispatching; no use in copying it here
currentTarget: emptyFunction.thatReturnsNull,
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function (event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
/**
* Synthetic events are dispatched by event plugins, typically in response to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of garbage
* collection. The system should check `isPersistent` to determine whether the
* event should be released into the pool after being dispatched. Users that
* need a persisted event should invoke `persist`.
*
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
* normalizing browser quirks. Subclasses do not necessarily have to implement a
* DOM interface; custom application-specific events can also subclass this.
*
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
*/
function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
this.dispatchConfig = dispatchConfig;
this.dispatchMarker = dispatchMarker;
this.nativeEvent = nativeEvent;
this.target = nativeEventTarget;
this.currentTarget = nativeEventTarget;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
this[propName] = nativeEvent[propName];
}
}
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
if (defaultPrevented) {
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
} else {
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
}
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
}
assign(SyntheticEvent.prototype, {
preventDefault: function () {
this.defaultPrevented = true;
var event = this.nativeEvent;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'path_to_url for more information.') : undefined;
}
if (!event) {
return;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
},
stopPropagation: function () {
var event = this.nativeEvent;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'path_to_url for more information.') : undefined;
}
if (!event) {
return;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},
/**
* We release all dispatched `SyntheticEvent`s after each event loop, adding
* them back into the pool. This allows a way to hold onto a reference that
* won't be added back into the pool.
*/
persist: function () {
this.isPersistent = emptyFunction.thatReturnsTrue;
},
/**
* Checks if this event should be released back into the pool.
*
* @return {boolean} True if this should not be released, false otherwise.
*/
isPersistent: emptyFunction.thatReturnsFalse,
/**
* `PooledClass` looks for `destructor` on each instance it releases.
*/
destructor: function () {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
this[propName] = null;
}
this.dispatchConfig = null;
this.dispatchMarker = null;
this.nativeEvent = null;
}
});
SyntheticEvent.Interface = EventInterface;
/**
* Helper to reduce boilerplate when creating subclasses.
*
* @param {function} Class
* @param {?object} Interface
*/
SyntheticEvent.augmentClass = function (Class, Interface) {
var Super = this;
var prototype = Object.create(Super.prototype);
assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = assign({}, Super.Interface, Interface);
Class.augmentClass = Super.augmentClass;
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
};
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
module.exports = SyntheticEvent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 78 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticInputEvent
* @typechecks static-only
*/
'use strict';
var SyntheticEvent = __webpack_require__(77);
/**
* @interface Event
* @see path_to_url
* /#events-inputevents
*/
var InputEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
module.exports = SyntheticInputEvent;
/***/ },
/* 79 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule keyOf
*/
/**
* 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.
*/
"use strict";
var keyOf = function (oneKeyObj) {
var key;
for (key in oneKeyObj) {
if (!oneKeyObj.hasOwnProperty(key)) {
continue;
}
return key;
}
return null;
};
module.exports = keyOf;
/***/ },
/* 80 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ChangeEventPlugin
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPluginHub = __webpack_require__(31);
var EventPropagators = __webpack_require__(73);
var ExecutionEnvironment = __webpack_require__(9);
var ReactUpdates = __webpack_require__(54);
var SyntheticEvent = __webpack_require__(77);
var getEventTarget = __webpack_require__(81);
var isEventSupported = __webpack_require__(40);
var isTextInputElement = __webpack_require__(82);
var keyOf = __webpack_require__(79);
var topLevelTypes = EventConstants.topLevelTypes;
var eventTypes = {
change: {
phasedRegistrationNames: {
bubbled: keyOf({ onChange: null }),
captured: keyOf({ onChangeCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
}
};
/**
* For IE shims
*/
var activeElement = null;
var activeElementID = null;
var activeElementValue = null;
var activeElementValueProp = null;
/**
* SECTION: handle `change` event
*/
function shouldUseChangeEvent(elem) {
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
}
function manualDispatchChangeEvent(nativeEvent) {
var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent));
EventPropagators.accumulateTwoPhaseDispatches(event);
// If change and propertychange bubbled, we'd just bind to it like all the
// other events and have it go through ReactBrowserEventEmitter. Since it
// doesn't, we manually listen for the events and so we have to enqueue and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handlers run
// before the next rerender (including event handlers attached to ancestor
// elements instead of directly on the input). Without this, controlled
// components don't work properly in conjunction with event bubbling because
// the component is rerendered and the value reverted before all the event
// handlers can run. See path_to_url
ReactUpdates.batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
EventPluginHub.enqueueEvents(event);
EventPluginHub.processEventQueue(false);
}
function startWatchingForChangeEventIE8(target, targetID) {
activeElement = target;
activeElementID = targetID;
activeElement.attachEvent('onchange', manualDispatchChangeEvent);
}
function stopWatchingForChangeEventIE8() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onchange', manualDispatchChangeEvent);
activeElement = null;
activeElementID = null;
}
function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topChange) {
return topLevelTargetID;
}
}
function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topFocus) {
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForChangeEventIE8();
startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForChangeEventIE8();
}
}
/**
* SECTION: handle `input` event
*/
var isInputEventSupported = false;
if (ExecutionEnvironment.canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events
isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
}
/**
* (For old IE.) Replacement getter/setter for the `value` property that gets
* set on the active element.
*/
var newValueProp = {
get: function () {
return activeElementValueProp.get.call(this);
},
set: function (val) {
// Cast to a string so we can do equality checks.
activeElementValue = '' + val;
activeElementValueProp.set.call(this, val);
}
};
/**
* (For old IE.) Starts tracking propertychange events on the passed-in element
* and override the value property so that we can distinguish user events from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetID) {
activeElement = target;
activeElementID = targetID;
activeElementValue = target.value;
activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
// Not guarded in a canDefineProperty check: IE8 supports defineProperty only
// on DOM elements
Object.defineProperty(activeElement, 'value', newValueProp);
activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
* (For old IE.) Removes the event listeners from the currently-tracked element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
// delete restores the original property definition
delete activeElement.value;
activeElement.detachEvent('onpropertychange', handlePropertyChange);
activeElement = null;
activeElementID = null;
activeElementValue = null;
activeElementValueProp = null;
}
/**
* (For old IE.) Handles a propertychange event, sending a `change` event if
* the value of the active element has changed.
*/
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
var value = nativeEvent.srcElement.value;
if (value === activeElementValue) {
return;
}
activeElementValue = value;
manualDispatchChangeEvent(nativeEvent);
}
/**
* If a `change` event should be fired, returns the target's ID.
*/
function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topInput) {
// In modern browsers (i.e., not IE8 or IE9), the input event is exactly
// what we want so fall through here and trigger an abstract event
return topLevelTargetID;
}
}
// For IE8 and IE9.
function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topFocus) {
// In IE8, we can capture almost all .value changes by adding a
// propertychange handler and looking for events with propertyName
// equal to 'value'
// In IE9, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases so we catch those and
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the value
// is changed from JS so we redefine a setter for `.value` that updates
// our activeElementValue variable, allowing us to ignore those changes
//
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForValueChange();
startWatchingForValueChange(topLevelTarget, topLevelTargetID);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
//
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
// propertychange on the first input event after setting `value` from a
// script and fires only keydown, keypress, keyup. Catching keyup usually
// gets it and catching keydown lets us fire an event for the first
// keystroke if user does a key repeat (it'll be a little delayed: right
// before the second keystroke). Other input methods (e.g., paste) seem to
// fire selectionchange normally.
if (activeElement && activeElement.value !== activeElementValue) {
activeElementValue = activeElement.value;
return activeElementID;
}
}
}
/**
* SECTION: handle `click` event
*/
function shouldUseClickEvent(elem) {
// Use the `click` event to detect changes to checkbox and radio inputs.
// This approach works across all browsers, whereas `change` does not fire
// until `blur` in IE8.
return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}
function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) {
if (topLevelType === topLevelTypes.topClick) {
return topLevelTargetID;
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible to
* change the element's value without seeing a flicker.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - select
*/
var ChangeEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var getTargetIDFunc, handleEventFunc;
if (shouldUseChangeEvent(topLevelTarget)) {
if (doesChangeEventBubble) {
getTargetIDFunc = getTargetIDForChangeEvent;
} else {
handleEventFunc = handleEventsForChangeEventIE8;
}
} else if (isTextInputElement(topLevelTarget)) {
if (isInputEventSupported) {
getTargetIDFunc = getTargetIDForInputEvent;
} else {
getTargetIDFunc = getTargetIDForInputEventIE;
handleEventFunc = handleEventsForInputEventIE;
}
} else if (shouldUseClickEvent(topLevelTarget)) {
getTargetIDFunc = getTargetIDForClickEvent;
}
if (getTargetIDFunc) {
var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID);
if (targetID) {
var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget);
event.type = 'change';
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID);
}
}
};
module.exports = ChangeEventPlugin;
/***/ },
/* 81 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getEventTarget
* @typechecks static-only
*/
'use strict';
/**
* Gets the target node from a native browser event by accounting for
* inconsistencies in browser DOM APIs.
*
* @param {object} nativeEvent Native browser event.
* @return {DOMEventTarget} Target node.
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see path_to_url
return target.nodeType === 3 ? target.parentNode : target;
}
module.exports = getEventTarget;
/***/ },
/* 82 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule isTextInputElement
*/
'use strict';
/**
* @see path_to_url#input-type-attr-summary
*/
var supportedInputTypes = {
'color': true,
'date': true,
'datetime': true,
'datetime-local': true,
'email': true,
'month': true,
'number': true,
'password': true,
'range': true,
'search': true,
'tel': true,
'text': true,
'time': true,
'url': true,
'week': true
};
function isTextInputElement(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
}
module.exports = isTextInputElement;
/***/ },
/* 83 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ClientReactRootIndex
* @typechecks
*/
'use strict';
var nextReactRootIndex = 0;
var ClientReactRootIndex = {
createReactRootIndex: function () {
return nextReactRootIndex++;
}
};
module.exports = ClientReactRootIndex;
/***/ },
/* 84 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule DefaultEventPluginOrder
*/
'use strict';
var keyOf = __webpack_require__(79);
/**
* Module that is injectable into `EventPluginHub`, that specifies a
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
* plugins, without having to package every one of them. This is better than
* having plugins be ordered in the same order that they are injected because
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
*/
var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
module.exports = DefaultEventPluginOrder;
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule EnterLeaveEventPlugin
* @typechecks static-only
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPropagators = __webpack_require__(73);
var SyntheticMouseEvent = __webpack_require__(86);
var ReactMount = __webpack_require__(28);
var keyOf = __webpack_require__(79);
var topLevelTypes = EventConstants.topLevelTypes;
var getFirstReactDOM = ReactMount.getFirstReactDOM;
var eventTypes = {
mouseEnter: {
registrationName: keyOf({ onMouseEnter: null }),
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
},
mouseLeave: {
registrationName: keyOf({ onMouseLeave: null }),
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
}
};
var extractedEvents = [null, null];
var EnterLeaveEventPlugin = {
eventTypes: eventTypes,
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
* we do not extract duplicate events. However, moving the mouse into the
* browser from outside will not fire a `mouseout` event. In this case, we use
* the `mouseover` top-level event.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
// Must not be a mouse in or mouse out - ignoring.
return null;
}
var win;
if (topLevelTarget.window === topLevelTarget) {
// `topLevelTarget` is probably a window object.
win = topLevelTarget;
} else {
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
var doc = topLevelTarget.ownerDocument;
if (doc) {
win = doc.defaultView || doc.parentWindow;
} else {
win = window;
}
}
var from;
var to;
var fromID = '';
var toID = '';
if (topLevelType === topLevelTypes.topMouseOut) {
from = topLevelTarget;
fromID = topLevelTargetID;
to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement);
if (to) {
toID = ReactMount.getID(to);
} else {
to = win;
}
to = to || win;
} else {
from = win;
to = topLevelTarget;
toID = topLevelTargetID;
}
if (from === to) {
// Nothing pertains to our managed components.
return null;
}
var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
leave.type = 'mouseleave';
leave.target = from;
leave.relatedTarget = to;
var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
enter.type = 'mouseenter';
enter.target = to;
enter.relatedTarget = from;
EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
extractedEvents[0] = leave;
extractedEvents[1] = enter;
return extractedEvents;
}
};
module.exports = EnterLeaveEventPlugin;
/***/ },
/* 86 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticMouseEvent
* @typechecks static-only
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(87);
var ViewportMetrics = __webpack_require__(38);
var getEventModifierState = __webpack_require__(88);
/**
* @interface MouseEvent
* @see path_to_url
*/
var MouseEventInterface = {
screenX: null,
screenY: null,
clientX: null,
clientY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: function (event) {
// Webkit, Firefox, IE9+
// which: 1 2 3
// button: 0 1 2 (standard)
var button = event.button;
if ('which' in event) {
return button;
}
// IE<9
// which: undefined
// button: 0 0 0
// button: 1 4 2 (onmouseup)
return button === 2 ? 2 : button === 4 ? 1 : 0;
},
buttons: null,
relatedTarget: function (event) {
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
},
// "Proprietary" Interface.
pageX: function (event) {
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
},
pageY: function (event) {
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
module.exports = SyntheticMouseEvent;
/***/ },
/* 87 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticUIEvent
* @typechecks static-only
*/
'use strict';
var SyntheticEvent = __webpack_require__(77);
var getEventTarget = __webpack_require__(81);
/**
* @interface UIEvent
* @see path_to_url
*/
var UIEventInterface = {
view: function (event) {
if (event.view) {
return event.view;
}
var target = getEventTarget(event);
if (target != null && target.window === target) {
// target is a window object
return target;
}
var doc = target.ownerDocument;
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
if (doc) {
return doc.defaultView || doc.parentWindow;
} else {
return window;
}
},
detail: function (event) {
return event.detail || 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
module.exports = SyntheticUIEvent;
/***/ },
/* 88 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getEventModifierState
* @typechecks static-only
*/
'use strict';
/**
* Translation from modifier key to the associated property in the event.
* @see path_to_url#keys-Modifiers
*/
var modifierKeyToProp = {
'Alt': 'altKey',
'Control': 'ctrlKey',
'Meta': 'metaKey',
'Shift': 'shiftKey'
};
// IE8 does not implement getModifierState so we simply map it to the only
// modifier keys exposed by the event itself, does not support Lock-keys.
// Currently, all major browsers except Chrome seems to support Lock-keys.
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
}
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
}
module.exports = getEventModifierState;
/***/ },
/* 89 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule HTMLDOMPropertyConfig
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var ExecutionEnvironment = __webpack_require__(9);
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
var hasSVG;
if (ExecutionEnvironment.canUseDOM) {
var implementation = document.implementation;
hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('path_to_url#BasicStructure', '1.1');
}
var HTMLDOMPropertyConfig = {
isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),
Properties: {
/**
* Standard Properties
*/
accept: null,
acceptCharset: null,
accessKey: null,
action: null,
allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
allowTransparency: MUST_USE_ATTRIBUTE,
alt: null,
async: HAS_BOOLEAN_VALUE,
autoComplete: null,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: HAS_BOOLEAN_VALUE,
autoPlay: HAS_BOOLEAN_VALUE,
capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
cellPadding: null,
cellSpacing: null,
charSet: MUST_USE_ATTRIBUTE,
challenge: MUST_USE_ATTRIBUTE,
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
classID: MUST_USE_ATTRIBUTE,
// To set className on SVG elements, it's necessary to use .setAttribute;
// this works on HTML elements too in all browsers except IE8. Conveniently,
// IE8 doesn't support SVG and so we can simply use the attribute in
// browsers that support SVG and the property in browsers that don't,
// regardless of whether the element is HTML or SVG.
className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
colSpan: null,
content: null,
contentEditable: null,
contextMenu: MUST_USE_ATTRIBUTE,
controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
coords: null,
crossOrigin: null,
data: null, // For `<object />` acts as `src`.
dateTime: MUST_USE_ATTRIBUTE,
'default': HAS_BOOLEAN_VALUE,
defer: HAS_BOOLEAN_VALUE,
dir: null,
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
download: HAS_OVERLOADED_BOOLEAN_VALUE,
draggable: null,
encType: null,
form: MUST_USE_ATTRIBUTE,
formAction: MUST_USE_ATTRIBUTE,
formEncType: MUST_USE_ATTRIBUTE,
formMethod: MUST_USE_ATTRIBUTE,
formNoValidate: HAS_BOOLEAN_VALUE,
formTarget: MUST_USE_ATTRIBUTE,
frameBorder: MUST_USE_ATTRIBUTE,
headers: null,
height: MUST_USE_ATTRIBUTE,
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
high: null,
href: null,
hrefLang: null,
htmlFor: null,
httpEquiv: null,
icon: null,
id: MUST_USE_PROPERTY,
inputMode: MUST_USE_ATTRIBUTE,
integrity: null,
is: MUST_USE_ATTRIBUTE,
keyParams: MUST_USE_ATTRIBUTE,
keyType: MUST_USE_ATTRIBUTE,
kind: null,
label: null,
lang: null,
list: MUST_USE_ATTRIBUTE,
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
low: null,
manifest: MUST_USE_ATTRIBUTE,
marginHeight: null,
marginWidth: null,
max: null,
maxLength: MUST_USE_ATTRIBUTE,
media: MUST_USE_ATTRIBUTE,
mediaGroup: null,
method: null,
min: null,
minLength: MUST_USE_ATTRIBUTE,
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: null,
nonce: MUST_USE_ATTRIBUTE,
noValidate: HAS_BOOLEAN_VALUE,
open: HAS_BOOLEAN_VALUE,
optimum: null,
pattern: null,
placeholder: null,
poster: null,
preload: null,
radioGroup: null,
readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
rel: null,
required: HAS_BOOLEAN_VALUE,
reversed: HAS_BOOLEAN_VALUE,
role: MUST_USE_ATTRIBUTE,
rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
rowSpan: null,
sandbox: null,
scope: null,
scoped: HAS_BOOLEAN_VALUE,
scrolling: null,
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
shape: null,
size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
sizes: MUST_USE_ATTRIBUTE,
span: HAS_POSITIVE_NUMERIC_VALUE,
spellCheck: null,
src: null,
srcDoc: MUST_USE_PROPERTY,
srcLang: null,
srcSet: MUST_USE_ATTRIBUTE,
start: HAS_NUMERIC_VALUE,
step: null,
style: null,
summary: null,
tabIndex: null,
target: null,
title: null,
type: null,
useMap: null,
value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
width: MUST_USE_ATTRIBUTE,
wmode: MUST_USE_ATTRIBUTE,
wrap: null,
/**
* RDFa Properties
*/
about: MUST_USE_ATTRIBUTE,
datatype: MUST_USE_ATTRIBUTE,
inlist: MUST_USE_ATTRIBUTE,
prefix: MUST_USE_ATTRIBUTE,
// property is also supported for OpenGraph in meta tags.
property: MUST_USE_ATTRIBUTE,
resource: MUST_USE_ATTRIBUTE,
'typeof': MUST_USE_ATTRIBUTE,
vocab: MUST_USE_ATTRIBUTE,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: MUST_USE_ATTRIBUTE,
autoCorrect: MUST_USE_ATTRIBUTE,
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
autoSave: null,
// color is for Safari mask-icon link
color: null,
// itemProp, itemScope, itemType are for
// Microdata support. See path_to_url
itemProp: MUST_USE_ATTRIBUTE,
itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
itemType: MUST_USE_ATTRIBUTE,
// itemID and itemRef are for Microdata support as well but
// only specified in the the WHATWG spec document. See
// path_to_url#microdata-dom-api
itemID: MUST_USE_ATTRIBUTE,
itemRef: MUST_USE_ATTRIBUTE,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: null,
// IE-only attribute that specifies security restrictions on an iframe
// as an alternative to the sandbox attribute on IE<10
security: MUST_USE_ATTRIBUTE,
// IE-only attribute that controls focus behavior
unselectable: MUST_USE_ATTRIBUTE
},
DOMAttributeNames: {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
},
DOMPropertyNames: {
autoComplete: 'autocomplete',
autoFocus: 'autofocus',
autoPlay: 'autoplay',
autoSave: 'autosave',
// `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
// path_to_url#dom-fs-encoding
encType: 'encoding',
hrefLang: 'hreflang',
radioGroup: 'radiogroup',
spellCheck: 'spellcheck',
srcDoc: 'srcdoc',
srcSet: 'srcset'
}
};
module.exports = HTMLDOMPropertyConfig;
/***/ },
/* 90 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactBrowserComponentMixin
*/
'use strict';
var ReactInstanceMap = __webpack_require__(47);
var findDOMNode = __webpack_require__(91);
var warning = __webpack_require__(25);
var didWarnKey = '_getDOMNodeDidWarn';
var ReactBrowserComponentMixin = {
/**
* Returns the DOM node rendered by this component.
*
* @return {DOMElement} The root node of this component.
* @final
* @protected
*/
getDOMNode: function () {
process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
this.constructor[didWarnKey] = true;
return findDOMNode(this);
}
};
module.exports = ReactBrowserComponentMixin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 91 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule findDOMNode
* @typechecks static-only
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(5);
var ReactInstanceMap = __webpack_require__(47);
var ReactMount = __webpack_require__(28);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
/**
* Returns the DOM node rendered by this element.
*
* @param {ReactComponent|DOMElement} componentOrElement
* @return {?DOMElement} The root node of this element.
*/
function findDOMNode(componentOrElement) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or findDOMNode 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') : undefined;
owner._warnedAboutRefsInRender = true;
}
}
if (componentOrElement == null) {
return null;
}
if (componentOrElement.nodeType === 1) {
return componentOrElement;
}
if (ReactInstanceMap.has(componentOrElement)) {
return ReactMount.getNodeFromInstance(componentOrElement);
}
!(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
}
module.exports = findDOMNode;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 92 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactDefaultBatchingStrategy
*/
'use strict';
var ReactUpdates = __webpack_require__(54);
var Transaction = __webpack_require__(57);
var assign = __webpack_require__(39);
var emptyFunction = __webpack_require__(15);
var RESET_BATCHED_UPDATES = {
initialize: emptyFunction,
close: function () {
ReactDefaultBatchingStrategy.isBatchingUpdates = false;
}
};
var FLUSH_BATCHED_UPDATES = {
initialize: emptyFunction,
close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
};
var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
function ReactDefaultBatchingStrategyTransaction() {
this.reinitializeTransaction();
}
assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
}
});
var transaction = new ReactDefaultBatchingStrategyTransaction();
var ReactDefaultBatchingStrategy = {
isBatchingUpdates: false,
/**
* Call the provided function in a context within which calls to `setState`
* and friends are batched such that components aren't updated unnecessarily.
*/
batchedUpdates: function (callback, a, b, c, d, e) {
var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
ReactDefaultBatchingStrategy.isBatchingUpdates = true;
// The code is written this way to avoid extra allocations
if (alreadyBatchingUpdates) {
callback(a, b, c, d, e);
} else {
transaction.perform(callback, null, a, b, c, d, e);
}
}
};
module.exports = ReactDefaultBatchingStrategy;
/***/ },
/* 93 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMComponent
* @typechecks static-only
*/
/* global hasOwnProperty:true */
'use strict';
var AutoFocusUtils = __webpack_require__(94);
var CSSPropertyOperations = __webpack_require__(96);
var DOMProperty = __webpack_require__(23);
var DOMPropertyOperations = __webpack_require__(22);
var EventConstants = __webpack_require__(30);
var ReactBrowserEventEmitter = __webpack_require__(29);
var ReactComponentBrowserEnvironment = __webpack_require__(26);
var ReactDOMButton = __webpack_require__(104);
var ReactDOMInput = __webpack_require__(105);
var ReactDOMOption = __webpack_require__(109);
var ReactDOMSelect = __webpack_require__(112);
var ReactDOMTextarea = __webpack_require__(113);
var ReactMount = __webpack_require__(28);
var ReactMultiChild = __webpack_require__(114);
var ReactPerf = __webpack_require__(18);
var ReactUpdateQueue = __webpack_require__(53);
var assign = __webpack_require__(39);
var canDefineProperty = __webpack_require__(43);
var escapeTextContentForBrowser = __webpack_require__(21);
var invariant = __webpack_require__(13);
var isEventSupported = __webpack_require__(40);
var keyOf = __webpack_require__(79);
var setInnerHTML = __webpack_require__(19);
var setTextContent = __webpack_require__(20);
var shallowEqual = __webpack_require__(117);
var validateDOMNesting = __webpack_require__(70);
var warning = __webpack_require__(25);
var deleteListener = ReactBrowserEventEmitter.deleteListener;
var listenTo = ReactBrowserEventEmitter.listenTo;
var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
// For quickly matching children type, to test if can be treated as content.
var CONTENT_TYPES = { 'string': true, 'number': true };
var CHILDREN = keyOf({ children: null });
var STYLE = keyOf({ style: null });
var HTML = keyOf({ __html: null });
var ELEMENT_NODE_TYPE = 1;
function getDeclarationErrorAddendum(internalInstance) {
if (internalInstance) {
var owner = internalInstance._currentElement._owner || null;
if (owner) {
var name = owner.getName();
if (name) {
return ' This DOM node was rendered by `' + name + '`.';
}
}
}
return '';
}
var legacyPropsDescriptor;
if (process.env.NODE_ENV !== 'production') {
legacyPropsDescriptor = {
props: {
enumerable: false,
get: function () {
var component = this._reactInternalComponent;
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
return component._currentElement.props;
}
}
};
}
function legacyGetDOMNode() {
if (process.env.NODE_ENV !== 'production') {
var component = this._reactInternalComponent;
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
}
return this;
}
function legacyIsMounted() {
var component = this._reactInternalComponent;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
}
return !!component;
}
function legacySetStateEtc() {
if (process.env.NODE_ENV !== 'production') {
var component = this._reactInternalComponent;
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
}
}
function legacySetProps(partialProps, callback) {
var component = this._reactInternalComponent;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
}
if (!component) {
return;
}
ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
if (callback) {
ReactUpdateQueue.enqueueCallbackInternal(component, callback);
}
}
function legacyReplaceProps(partialProps, callback) {
var component = this._reactInternalComponent;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
}
if (!component) {
return;
}
ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
if (callback) {
ReactUpdateQueue.enqueueCallbackInternal(component, callback);
}
}
function friendlyStringify(obj) {
if (typeof obj === 'object') {
if (Array.isArray(obj)) {
return '[' + obj.map(friendlyStringify).join(', ') + ']';
} else {
var pairs = [];
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
}
}
return '{' + pairs.join(', ') + '}';
}
} else if (typeof obj === 'string') {
return JSON.stringify(obj);
} else if (typeof obj === 'function') {
return '[function object]';
}
// Differs from JSON.stringify in that undefined becauses undefined and that
// inf and nan don't become null
return String(obj);
}
var styleMutationWarning = {};
function checkAndWarnForMutatedStyle(style1, style2, component) {
if (style1 == null || style2 == null) {
return;
}
if (shallowEqual(style1, style2)) {
return;
}
var componentName = component._tag;
var owner = component._currentElement._owner;
var ownerName;
if (owner) {
ownerName = owner.getName();
}
var hash = ownerName + '|' + componentName;
if (styleMutationWarning.hasOwnProperty(hash)) {
return;
}
styleMutationWarning[hash] = true;
process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : undefined;
}
/**
* @param {object} component
* @param {?object} props
*/
function assertValidProps(component, props) {
if (!props) {
return;
}
// Note the use of `==` which checks for null or undefined.
if (process.env.NODE_ENV !== 'production') {
if (voidElementTags[component._tag]) {
process.env.NODE_ENV !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined;
}
}
if (props.dangerouslySetInnerHTML != null) {
!(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined;
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit path_to_url ' + 'for more information.') : invariant(false) : undefined;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined;
process.env.NODE_ENV !== 'production' ? warning(!props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : undefined;
}
!(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined;
}
function enqueuePutListener(id, registrationName, listener, transaction) {
if (process.env.NODE_ENV !== 'production') {
// IE8 has no API for event capturing and the `onScroll` event doesn't
// bubble.
process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
}
var container = ReactMount.findReactContainerForID(id);
if (container) {
var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
listenTo(registrationName, doc);
}
transaction.getReactMountReady().enqueue(putListener, {
id: id,
registrationName: registrationName,
listener: listener
});
}
function putListener() {
var listenerToPut = this;
ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
}
// There are so many media events, it makes sense to just
// maintain a list rather than create a `trapBubbledEvent` for each
var mediaEvents = {
topAbort: 'abort',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topSeeked: 'seeked',
topSeeking: 'seeking',
topStalled: 'stalled',
topSuspend: 'suspend',
topTimeUpdate: 'timeupdate',
topVolumeChange: 'volumechange',
topWaiting: 'waiting'
};
function trapBubbledEventsLocal() {
var inst = this;
// If a component renders to null or if another component fatals and causes
// the state of the tree to be corrupted, `node` here can be null.
!inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
var node = ReactMount.getNode(inst._rootNodeID);
!node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
switch (inst._tag) {
case 'iframe':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
break;
case 'video':
case 'audio':
inst._wrapperState.listeners = [];
// create listener for each media event
for (var event in mediaEvents) {
if (mediaEvents.hasOwnProperty(event)) {
inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
}
}
break;
case 'img':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
break;
case 'form':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
break;
}
}
function mountReadyInputWrapper() {
ReactDOMInput.mountReadyWrapper(this);
}
function postUpdateSelectWrapper() {
ReactDOMSelect.postUpdateWrapper(this);
}
// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special cased tags.
var omittedCloseTags = {
'area': true,
'base': true,
'br': true,
'col': true,
'embed': true,
'hr': true,
'img': true,
'input': true,
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
};
// NOTE: menuitem's close tag should be omitted, but that causes problems.
var newlineEatingTags = {
'listing': true,
'pre': true,
'textarea': true
};
// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
var voidElementTags = assign({
'menuitem': true
}, omittedCloseTags);
// We accept any tag to be rendered but since this gets injected into arbitrary
// HTML, we want to make sure that it's a safe tag.
// path_to_url#NT-Name
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
var validatedTagCache = {};
var hasOwnProperty = ({}).hasOwnProperty;
function validateDangerousTag(tag) {
if (!hasOwnProperty.call(validatedTagCache, tag)) {
!VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined;
validatedTagCache[tag] = true;
}
}
function processChildContextDev(context, inst) {
// Pass down our tag name to child components for validation purposes
context = assign({}, context);
var info = context[validateDOMNesting.ancestorInfoContextKey];
context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
return context;
}
function isCustomComponent(tagName, props) {
return tagName.indexOf('-') >= 0 || props.is != null;
}
/**
* Creates a new React class that is idempotent and capable of containing other
* React components. It accepts event listeners and DOM properties that are
* valid according to `DOMProperty`.
*
* - Event listeners: `onClick`, `onMouseDown`, etc.
* - DOM properties: `className`, `name`, `title`, etc.
*
* The `style` property functions differently from the DOM API. It accepts an
* object mapping of style properties to values.
*
* @constructor ReactDOMComponent
* @extends ReactMultiChild
*/
function ReactDOMComponent(tag) {
validateDangerousTag(tag);
this._tag = tag.toLowerCase();
this._renderedChildren = null;
this._previousStyle = null;
this._previousStyleCopy = null;
this._rootNodeID = null;
this._wrapperState = null;
this._topLevelWrapper = null;
this._nodeWithLegacyProperties = null;
if (process.env.NODE_ENV !== 'production') {
this._unprocessedContextDev = null;
this._processedContextDev = null;
}
}
ReactDOMComponent.displayName = 'ReactDOMComponent';
ReactDOMComponent.Mixin = {
construct: function (element) {
this._currentElement = element;
},
/**
* Generates root tag markup then recurses. This method has side effects and
* is not idempotent.
*
* @internal
* @param {string} rootID The root DOM ID for this node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} context
* @return {string} The computed markup.
*/
mountComponent: function (rootID, transaction, context) {
this._rootNodeID = rootID;
var props = this._currentElement.props;
switch (this._tag) {
case 'iframe':
case 'img':
case 'form':
case 'video':
case 'audio':
this._wrapperState = {
listeners: null
};
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'button':
props = ReactDOMButton.getNativeProps(this, props, context);
break;
case 'input':
ReactDOMInput.mountWrapper(this, props, context);
props = ReactDOMInput.getNativeProps(this, props, context);
break;
case 'option':
ReactDOMOption.mountWrapper(this, props, context);
props = ReactDOMOption.getNativeProps(this, props, context);
break;
case 'select':
ReactDOMSelect.mountWrapper(this, props, context);
props = ReactDOMSelect.getNativeProps(this, props, context);
context = ReactDOMSelect.processChildContext(this, props, context);
break;
case 'textarea':
ReactDOMTextarea.mountWrapper(this, props, context);
props = ReactDOMTextarea.getNativeProps(this, props, context);
break;
}
assertValidProps(this, props);
if (process.env.NODE_ENV !== 'production') {
if (context[validateDOMNesting.ancestorInfoContextKey]) {
validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
}
}
if (process.env.NODE_ENV !== 'production') {
this._unprocessedContextDev = context;
this._processedContextDev = processChildContextDev(context, this);
context = this._processedContextDev;
}
var mountImage;
if (transaction.useCreateElement) {
var ownerDocument = context[ReactMount.ownerDocumentContextKey];
var el = ownerDocument.createElement(this._currentElement.type);
DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
// Populate node cache
ReactMount.getID(el);
this._updateDOMProperties({}, props, transaction, el);
this._createInitialChildren(transaction, props, context, el);
mountImage = el;
} else {
var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
var tagContent = this._createContentMarkup(transaction, props, context);
if (!tagContent && omittedCloseTags[this._tag]) {
mountImage = tagOpen + '/>';
} else {
mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
}
}
switch (this._tag) {
case 'input':
transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
// falls through
case 'button':
case 'select':
case 'textarea':
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
}
return mountImage;
},
/**
* Creates markup for the open tag and all attributes.
*
* This method has side effects because events get registered.
*
* Iterating over object properties is faster than iterating over arrays.
* @see path_to_url
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} props
* @return {string} Markup of opening tag.
*/
_createOpenTagMarkupAndPutListeners: function (transaction, props) {
var ret = '<' + this._currentElement.type;
for (var propKey in props) {
if (!props.hasOwnProperty(propKey)) {
continue;
}
var propValue = props[propKey];
if (propValue == null) {
continue;
}
if (registrationNameModules.hasOwnProperty(propKey)) {
if (propValue) {
enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
}
} else {
if (propKey === STYLE) {
if (propValue) {
if (process.env.NODE_ENV !== 'production') {
// See `_updateDOMProperties`. style block
this._previousStyle = propValue;
}
propValue = this._previousStyleCopy = assign({}, props.style);
}
propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
}
var markup = null;
if (this._tag != null && isCustomComponent(this._tag, props)) {
if (propKey !== CHILDREN) {
markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
}
} else {
markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
}
if (markup) {
ret += ' ' + markup;
}
}
}
// For static pages, no need to put React ID and checksum. Saves lots of
// bytes.
if (transaction.renderToStaticMarkup) {
return ret;
}
var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
return ret + ' ' + markupForID;
},
/**
* Creates markup for the content between the tags.
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} props
* @param {object} context
* @return {string} Content markup.
*/
_createContentMarkup: function (transaction, props, context) {
var ret = '';
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
ret = innerHTML.__html;
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
var childrenToUse = contentToUse != null ? null : props.children;
if (contentToUse != null) {
// TODO: Validate that text is allowed as a child of this node
ret = escapeTextContentForBrowser(contentToUse);
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction, context);
ret = mountImages.join('');
}
}
if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
// text/html ignores the first character in these tags if it's a newline
// Prefer to break application/xml over text/html (for now) by adding
// a newline specifically to get eaten by the parser. (Alternately for
// textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
// \r is normalized out by HTMLTextAreaElement#value.)
// See: <path_to_url#newlines-in-textarea-and-pre>
// See: <path_to_url#element-restrictions>
// See: <path_to_url#newlines>
// See: Parsing of "textarea" "listing" and "pre" elements
// from <path_to_url#parsing-main-inbody>
return '\n' + ret;
} else {
return ret;
}
},
_createInitialChildren: function (transaction, props, context, el) {
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
setInnerHTML(el, innerHTML.__html);
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
var childrenToUse = contentToUse != null ? null : props.children;
if (contentToUse != null) {
// TODO: Validate that text is allowed as a child of this node
setTextContent(el, contentToUse);
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction, context);
for (var i = 0; i < mountImages.length; i++) {
el.appendChild(mountImages[i]);
}
}
}
},
/**
* Receives a next element and updates the component.
*
* @internal
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} context
*/
receiveComponent: function (nextElement, transaction, context) {
var prevElement = this._currentElement;
this._currentElement = nextElement;
this.updateComponent(transaction, prevElement, nextElement, context);
},
/**
* Updates a native DOM component after it has already been allocated and
* attached to the DOM. Reconciles the root DOM node, then recurses.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevElement
* @param {ReactElement} nextElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevElement, nextElement, context) {
var lastProps = prevElement.props;
var nextProps = this._currentElement.props;
switch (this._tag) {
case 'button':
lastProps = ReactDOMButton.getNativeProps(this, lastProps);
nextProps = ReactDOMButton.getNativeProps(this, nextProps);
break;
case 'input':
ReactDOMInput.updateWrapper(this);
lastProps = ReactDOMInput.getNativeProps(this, lastProps);
nextProps = ReactDOMInput.getNativeProps(this, nextProps);
break;
case 'option':
lastProps = ReactDOMOption.getNativeProps(this, lastProps);
nextProps = ReactDOMOption.getNativeProps(this, nextProps);
break;
case 'select':
lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
break;
case 'textarea':
ReactDOMTextarea.updateWrapper(this);
lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
break;
}
if (process.env.NODE_ENV !== 'production') {
// If the context is reference-equal to the old one, pass down the same
// processed object so the update bailout in ReactReconciler behaves
// correctly (and identically in dev and prod). See #5005.
if (this._unprocessedContextDev !== context) {
this._unprocessedContextDev = context;
this._processedContextDev = processChildContextDev(context, this);
}
context = this._processedContextDev;
}
assertValidProps(this, nextProps);
this._updateDOMProperties(lastProps, nextProps, transaction, null);
this._updateDOMChildren(lastProps, nextProps, transaction, context);
if (!canDefineProperty && this._nodeWithLegacyProperties) {
this._nodeWithLegacyProperties.props = nextProps;
}
if (this._tag === 'select') {
// <select> value update needs to occur after <option> children
// reconciliation
transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
}
},
/**
* Reconciles the properties by detecting differences in property values and
* updating the DOM as necessary. This function is probably the single most
* critical path for performance optimization.
*
* TODO: Benchmark whether checking for changed values in memory actually
* improves performance (especially statically positioned elements).
* TODO: Benchmark the effects of putting this at the top since 99% of props
* do not change for a given reconciliation.
* TODO: Benchmark areas that can be improved with caching.
*
* @private
* @param {object} lastProps
* @param {object} nextProps
* @param {ReactReconcileTransaction} transaction
* @param {?DOMElement} node
*/
_updateDOMProperties: function (lastProps, nextProps, transaction, node) {
var propKey;
var styleName;
var styleUpdates;
for (propKey in lastProps) {
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
continue;
}
if (propKey === STYLE) {
var lastStyle = this._previousStyleCopy;
for (styleName in lastStyle) {
if (lastStyle.hasOwnProperty(styleName)) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
this._previousStyleCopy = null;
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (lastProps[propKey]) {
// Only call deleteListener if there was a listener previously or
// else willDeleteListener gets called when there wasn't actually a
// listener (e.g., onClick={null})
deleteListener(this._rootNodeID, propKey);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
if (!node) {
node = ReactMount.getNode(this._rootNodeID);
}
DOMPropertyOperations.deleteValueForProperty(node, propKey);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
continue;
}
if (propKey === STYLE) {
if (nextProp) {
if (process.env.NODE_ENV !== 'production') {
checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
this._previousStyle = nextProp;
}
nextProp = this._previousStyleCopy = assign({}, nextProp);
} else {
this._previousStyleCopy = null;
}
if (lastProp) {
// Unset styles on `lastProp` but not on `nextProp`.
for (styleName in lastProp) {
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
// Update styles that changed since `lastProp`.
for (styleName in nextProp) {
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = nextProp[styleName];
}
}
} else {
// Relies on `updateStylesByID` not mutating `styleUpdates`.
styleUpdates = nextProp;
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp) {
enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
} else if (lastProp) {
deleteListener(this._rootNodeID, propKey);
}
} else if (isCustomComponent(this._tag, nextProps)) {
if (!node) {
node = ReactMount.getNode(this._rootNodeID);
}
if (propKey === CHILDREN) {
nextProp = null;
}
DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
if (!node) {
node = ReactMount.getNode(this._rootNodeID);
}
// If we're updating to null or undefined, we should remove the property
// from the DOM node instead of inadvertantly setting to a string. This
// brings us in line with the same behavior we have on initial render.
if (nextProp != null) {
DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
} else {
DOMPropertyOperations.deleteValueForProperty(node, propKey);
}
}
}
if (styleUpdates) {
if (!node) {
node = ReactMount.getNode(this._rootNodeID);
}
CSSPropertyOperations.setValueForStyles(node, styleUpdates);
}
},
/**
* Reconciles the children with the various properties that affect the
* children content.
*
* @param {object} lastProps
* @param {object} nextProps
* @param {ReactReconcileTransaction} transaction
* @param {object} context
*/
_updateDOMChildren: function (lastProps, nextProps, transaction, context) {
var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
// Note the use of `!=` which checks for null or undefined.
var lastChildren = lastContent != null ? null : lastProps.children;
var nextChildren = nextContent != null ? null : nextProps.children;
// If we're switching from children to content/html or vice versa, remove
// the old content
var lastHasContentOrHtml = lastContent != null || lastHtml != null;
var nextHasContentOrHtml = nextContent != null || nextHtml != null;
if (lastChildren != null && nextChildren == null) {
this.updateChildren(null, transaction, context);
} else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
this.updateTextContent('');
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
this.updateMarkup('' + nextHtml);
}
} else if (nextChildren != null) {
this.updateChildren(nextChildren, transaction, context);
}
},
/**
* Destroys all event registrations for this instance. Does not remove from
* the DOM. That must be done by the parent.
*
* @internal
*/
unmountComponent: function () {
switch (this._tag) {
case 'iframe':
case 'img':
case 'form':
case 'video':
case 'audio':
var listeners = this._wrapperState.listeners;
if (listeners) {
for (var i = 0; i < listeners.length; i++) {
listeners[i].remove();
}
}
break;
case 'input':
ReactDOMInput.unmountWrapper(this);
break;
case 'html':
case 'head':
case 'body':
/**
* Components like <html> <head> and <body> can't be removed or added
* easily in a cross-browser way, however it's valuable to be able to
* take advantage of React's reconciliation for styling and <title>
* management. So we just document it and throw in dangerous cases.
*/
true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : undefined;
break;
}
this.unmountChildren();
ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
this._rootNodeID = null;
this._wrapperState = null;
if (this._nodeWithLegacyProperties) {
var node = this._nodeWithLegacyProperties;
node._reactInternalComponent = null;
this._nodeWithLegacyProperties = null;
}
},
getPublicInstance: function () {
if (!this._nodeWithLegacyProperties) {
var node = ReactMount.getNode(this._rootNodeID);
node._reactInternalComponent = this;
node.getDOMNode = legacyGetDOMNode;
node.isMounted = legacyIsMounted;
node.setState = legacySetStateEtc;
node.replaceState = legacySetStateEtc;
node.forceUpdate = legacySetStateEtc;
node.setProps = legacySetProps;
node.replaceProps = legacyReplaceProps;
if (process.env.NODE_ENV !== 'production') {
if (canDefineProperty) {
Object.defineProperties(node, legacyPropsDescriptor);
} else {
// updateComponent will update this property on subsequent renders
node.props = this._currentElement.props;
}
} else {
// updateComponent will update this property on subsequent renders
node.props = this._currentElement.props;
}
this._nodeWithLegacyProperties = node;
}
return this._nodeWithLegacyProperties;
}
};
ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
mountComponent: 'mountComponent',
updateComponent: 'updateComponent'
});
assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
module.exports = ReactDOMComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule AutoFocusUtils
* @typechecks static-only
*/
'use strict';
var ReactMount = __webpack_require__(28);
var findDOMNode = __webpack_require__(91);
var focusNode = __webpack_require__(95);
var Mixin = {
componentDidMount: function () {
if (this.props.autoFocus) {
focusNode(findDOMNode(this));
}
}
};
var AutoFocusUtils = {
Mixin: Mixin,
focusDOMComponent: function () {
focusNode(ReactMount.getNode(this._rootNodeID));
}
};
module.exports = AutoFocusUtils;
/***/ },
/* 95 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule focusNode
*/
'use strict';
/**
* @param {DOMElement} node input/textarea to focus
*/
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisible,
// not enabled, or of a type that does not accept the focus." for all kinds of
// reasons that are too expensive and fragile to test.
try {
node.focus();
} catch (e) {}
}
module.exports = focusNode;
/***/ },
/* 96 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule CSSPropertyOperations
* @typechecks static-only
*/
'use strict';
var CSSProperty = __webpack_require__(97);
var ExecutionEnvironment = __webpack_require__(9);
var ReactPerf = __webpack_require__(18);
var camelizeStyleName = __webpack_require__(98);
var dangerousStyleValue = __webpack_require__(100);
var hyphenateStyleName = __webpack_require__(101);
var memoizeStringOnly = __webpack_require__(103);
var warning = __webpack_require__(25);
var processStyleName = memoizeStringOnly(function (styleName) {
return hyphenateStyleName(styleName);
});
var hasShorthandPropertyBug = false;
var styleFloatAccessor = 'cssFloat';
if (ExecutionEnvironment.canUseDOM) {
var tempStyle = document.createElement('div').style;
try {
// IE8 throws "Invalid argument." if resetting shorthand style properties.
tempStyle.font = '';
} catch (e) {
hasShorthandPropertyBug = true;
}
// IE8 only supports accessing cssFloat (standard) as styleFloat
if (document.documentElement.style.cssFloat === undefined) {
styleFloatAccessor = 'styleFloat';
}
}
if (process.env.NODE_ENV !== 'production') {
// 'msTransform' is correct, but the other prefixes should be capitalized
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
// style values shouldn't contain a semicolon
var badStyleValueWithSemicolonPattern = /;\s*$/;
var warnedStyleNames = {};
var warnedStyleValues = {};
var warnHyphenatedStyleName = function (name) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined;
};
var warnBadVendoredStyleName = function (name) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined;
};
var warnStyleValueWithSemicolon = function (name, value) {
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
return;
}
warnedStyleValues[value] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined;
};
/**
* @param {string} name
* @param {*} value
*/
var warnValidStyle = function (name, value) {
if (name.indexOf('-') > -1) {
warnHyphenatedStyleName(name);
} else if (badVendoredStyleNamePattern.test(name)) {
warnBadVendoredStyleName(name);
} else if (badStyleValueWithSemicolonPattern.test(value)) {
warnStyleValueWithSemicolon(name, value);
}
};
}
/**
* Operations for dealing with CSS properties.
*/
var CSSPropertyOperations = {
/**
* Serializes a mapping of style properties for use as inline styles:
*
* > createMarkupForStyles({width: '200px', height: 0})
* "width:200px;height:0;"
*
* Undefined values are ignored so that declarative programming is easier.
* The result should be HTML-escaped before insertion into the DOM.
*
* @param {object} styles
* @return {?string}
*/
createMarkupForStyles: function (styles) {
var serialized = '';
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var styleValue = styles[styleName];
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styleValue);
}
if (styleValue != null) {
serialized += processStyleName(styleName) + ':';
serialized += dangerousStyleValue(styleName, styleValue) + ';';
}
}
return serialized || null;
},
/**
* Sets the value for multiple styles on a node. If a value is specified as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
*/
setValueForStyles: function (node, styles) {
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styles[styleName]);
}
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
if (styleName === 'float') {
styleName = styleFloatAccessor;
}
if (styleValue) {
style[styleName] = styleValue;
} else {
var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
if (expansion) {
// Shorthand property that IE8 won't like unsetting, so unset each
// component to placate it
for (var individualStyleName in expansion) {
style[individualStyleName] = '';
}
} else {
style[styleName] = '';
}
}
}
}
};
ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
setValueForStyles: 'setValueForStyles'
});
module.exports = CSSPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 97 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule CSSProperty
*/
'use strict';
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
animationIterationCount: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
stopOpacity: true,
strokeDashoffset: true,
strokeOpacity: true,
strokeWidth: true
};
/**
* @param {string} prefix vendor-specific prefix, eg: Webkit
* @param {string} key style name, eg: transitionDuration
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
* WebkitTransitionDuration
*/
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
* Support style names that may come passed in prefixed by adding permutations
* of vendor prefixes.
*/
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
prefixes.forEach(function (prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See path_to_url
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
var shorthandPropertyExpansions = {
background: {
backgroundAttachment: true,
backgroundColor: true,
backgroundImage: true,
backgroundPositionX: true,
backgroundPositionY: true,
backgroundRepeat: true
},
backgroundPosition: {
backgroundPositionX: true,
backgroundPositionY: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
},
outline: {
outlineWidth: true,
outlineStyle: true,
outlineColor: true
}
};
var CSSProperty = {
isUnitlessNumber: isUnitlessNumber,
shorthandPropertyExpansions: shorthandPropertyExpansions
};
module.exports = CSSProperty;
/***/ },
/* 98 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule camelizeStyleName
* @typechecks
*/
'use strict';
var camelize = __webpack_require__(99);
var msPattern = /^-ms-/;
/**
* Camelcases a hyphenated CSS property name, for example:
*
* > camelizeStyleName('background-color')
* < "backgroundColor"
* > camelizeStyleName('-moz-transition')
* < "MozTransition"
* > camelizeStyleName('-ms-transition')
* < "msTransition"
*
* As Andi Smith suggests
* (path_to_url an `-ms` prefix
* is converted to lowercase `ms`.
*
* @param {string} string
* @return {string}
*/
function camelizeStyleName(string) {
return camelize(string.replace(msPattern, 'ms-'));
}
module.exports = camelizeStyleName;
/***/ },
/* 99 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule camelize
* @typechecks
*/
"use strict";
var _hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(_hyphenPattern, function (_, character) {
return character.toUpperCase();
});
}
module.exports = camelize;
/***/ },
/* 100 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule dangerousStyleValue
* @typechecks static-only
*/
'use strict';
var CSSProperty = __webpack_require__(97);
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
/**
* Convert a value into the proper css writable value. The style name `name`
* should be logical (no hyphens), as specified
* in `CSSProperty.isUnitlessNumber`.
*
* @param {string} name CSS property name such as `topMargin`.
* @param {*} value CSS property value such as `10px`.
* @return {string} Normalized style value with dimensions applied.
*/
function dangerousStyleValue(name, value) {
// Note that we've removed escapeTextForBrowser() calls here since the
// whole string will be escaped when the attribute is injected into
// the markup. If you provide unsafe user data here they can inject
// arbitrary CSS which may be problematic (I couldn't repro this):
// path_to_url
// path_to_url
// This is not an XSS hole but instead a potential CSS injection issue
// which has lead to a greater discussion about how we're going to
// trust URLs moving forward. See #2115901
var isEmpty = value == null || typeof value === 'boolean' || value === '';
if (isEmpty) {
return '';
}
var isNonNumeric = isNaN(value);
if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
return '' + value; // cast to string
}
if (typeof value === 'string') {
value = value.trim();
}
return value + 'px';
}
module.exports = dangerousStyleValue;
/***/ },
/* 101 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule hyphenateStyleName
* @typechecks
*/
'use strict';
var hyphenate = __webpack_require__(102);
var msPattern = /^ms-/;
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (path_to_url#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return hyphenate(string).replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
/***/ },
/* 102 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule hyphenate
* @typechecks
*/
'use strict';
var _uppercasePattern = /([A-Z])/g;
/**
* Hyphenates a camelcased string, for example:
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works properly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
module.exports = hyphenate;
/***/ },
/* 103 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule memoizeStringOnly
* @typechecks static-only
*/
'use strict';
/**
* Memoizes the return value of a function that accepts one string argument.
*
* @param {function} callback
* @return {function}
*/
function memoizeStringOnly(callback) {
var cache = {};
return function (string) {
if (!cache.hasOwnProperty(string)) {
cache[string] = callback.call(this, string);
}
return cache[string];
};
}
module.exports = memoizeStringOnly;
/***/ },
/* 104 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactDOMButton
*/
'use strict';
var mouseListenerNames = {
onClick: true,
onDoubleClick: true,
onMouseDown: true,
onMouseMove: true,
onMouseUp: true,
onClickCapture: true,
onDoubleClickCapture: true,
onMouseDownCapture: true,
onMouseMoveCapture: true,
onMouseUpCapture: true
};
/**
* Implements a <button> native component that does not receive mouse events
* when `disabled` is set.
*/
var ReactDOMButton = {
getNativeProps: function (inst, props, context) {
if (!props.disabled) {
return props;
}
// Copy the props, except the mouse listeners
var nativeProps = {};
for (var key in props) {
if (props.hasOwnProperty(key) && !mouseListenerNames[key]) {
nativeProps[key] = props[key];
}
}
return nativeProps;
}
};
module.exports = ReactDOMButton;
/***/ },
/* 105 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMInput
*/
'use strict';
var ReactDOMIDOperations = __webpack_require__(27);
var LinkedValueUtils = __webpack_require__(106);
var ReactMount = __webpack_require__(28);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var instancesByReactID = {};
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMInput.updateWrapper(this);
}
}
/**
* Implements an <input> native component that allows setting these optional
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
*
* If `checked` or `value` are not supplied (or null/undefined), user actions
* that affect the checked state or value will trigger updates to the element.
*
* If they are supplied (and not null/undefined), the rendered element will not
* trigger updates to the element. Instead, the props must change in order for
* the rendered element to be updated.
*
* The rendered element will be initialized as unchecked (or `defaultChecked`)
* with an empty value (or `defaultValue`).
*
* @see path_to_url
*/
var ReactDOMInput = {
getNativeProps: function (inst, props, context) {
var value = LinkedValueUtils.getValue(props);
var checked = LinkedValueUtils.getChecked(props);
var nativeProps = assign({}, props, {
defaultChecked: undefined,
defaultValue: undefined,
value: value != null ? value : inst._wrapperState.initialValue,
checked: checked != null ? checked : inst._wrapperState.initialChecked,
onChange: inst._wrapperState.onChange
});
return nativeProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
}
var defaultValue = props.defaultValue;
inst._wrapperState = {
initialChecked: props.defaultChecked || false,
initialValue: defaultValue != null ? defaultValue : null,
onChange: _handleChange.bind(inst)
};
},
mountReadyWrapper: function (inst) {
// Can't be in mountWrapper or else server rendering leaks.
instancesByReactID[inst._rootNodeID] = inst;
},
unmountWrapper: function (inst) {
delete instancesByReactID[inst._rootNodeID];
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
// TODO: Shouldn't this be getChecked(props)?
var checked = props.checked;
if (checked != null) {
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false);
}
var value = LinkedValueUtils.getValue(props);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
// Here we use asap to wait until all updates have propagated, which
// is important when using controlled components within layers:
// path_to_url
ReactUpdates.asap(forceUpdateIfMounted, this);
var name = props.name;
if (props.type === 'radio' && name != null) {
var rootNode = ReactMount.getNode(this._rootNodeID);
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
// If `rootNode.form` was non-null, then we could try `form.elements`,
// but that sometimes behaves strangely in IE8. We could also try using
// `form.getElementsByName`, but that will only return direct children
// and won't include inputs that use the HTML5 `form=` attribute. Since
// the input might not even be in a form, let's just use the global
// `querySelectorAll` to ensure we don't miss anything.
var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
for (var i = 0; i < group.length; i++) {
var otherNode = group[i];
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
continue;
}
// This will throw if radio buttons rendered by different copies of React
// and the same name are rendered into the same form (same as #1939).
// That's probably okay; we don't support it just as we don't support
// mixing React with non-React.
var otherID = ReactMount.getID(otherNode);
!otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
var otherInstance = instancesByReactID[otherID];
!otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
// If this is a controlled radio button group, forcing the input that
// was previously checked to update will cause it to be come re-checked
// as appropriate.
ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
}
}
return returnValue;
}
module.exports = ReactDOMInput;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 106 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule LinkedValueUtils
* @typechecks static-only
*/
'use strict';
var ReactPropTypes = __webpack_require__(107);
var ReactPropTypeLocations = __webpack_require__(65);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true
};
function _assertSingleLink(inputProps) {
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
}
function _assertValueLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
}
function _assertCheckedLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
}
var propTypes = {
value: function (props, propName, componentName) {
if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
checked: function (props, propName, componentName) {
if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
onChange: ReactPropTypes.func
};
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
var LinkedValueUtils = {
checkPropTypes: function (tagName, props, owner) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var addendum = getDeclarationErrorAddendum(owner);
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
}
}
},
/**
* @param {object} inputProps Props for form component
* @return {*} current value of the input either from value prop or link.
*/
getValue: function (inputProps) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.value;
}
return inputProps.value;
},
/**
* @param {object} inputProps Props for form component
* @return {*} current checked status of the input either from checked prop
* or link.
*/
getChecked: function (inputProps) {
if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.value;
}
return inputProps.checked;
},
/**
* @param {object} inputProps Props for form component
* @param {SyntheticEvent} event change event to handle
*/
executeOnChange: function (inputProps, event) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.requestChange(event.target.value);
} else if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.requestChange(event.target.checked);
} else if (inputProps.onChange) {
return inputProps.onChange.call(undefined, event);
}
}
};
module.exports = LinkedValueUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactPropTypes
*/
'use strict';
var ReactElement = __webpack_require__(42);
var ReactPropTypeLocationNames = __webpack_require__(66);
var emptyFunction = __webpack_require__(15);
var getIteratorFn = __webpack_require__(108);
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (props[propName] == null) {
var locationName = ReactPropTypeLocationNames[location];
if (isRequired) {
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
var locationName = ReactPropTypeLocationNames[location];
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturns(null));
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var locationName = ReactPropTypeLocationNames[location];
var propType = getPropType(propValue);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!ReactElement.isValidElement(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var locationName = ReactPropTypeLocationNames[location];
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
});
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (propValue === expectedValues[i]) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
var valuesString = JSON.stringify(expectedValues);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
});
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName) == null) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || ReactElement.isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return '<<anonymous>>';
}
return propValue.constructor.name;
}
module.exports = ReactPropTypes;
/***/ },
/* 108 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getIteratorFn
* @typechecks static-only
*/
'use strict';
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ },
/* 109 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMOption
*/
'use strict';
var ReactChildren = __webpack_require__(110);
var ReactDOMSelect = __webpack_require__(112);
var assign = __webpack_require__(39);
var warning = __webpack_require__(25);
var valueContextKey = ReactDOMSelect.valueContextKey;
/**
* Implements an <option> native component that warns when `selected` is set.
*/
var ReactDOMOption = {
mountWrapper: function (inst, props, context) {
// TODO (yungsters): Remove support for `selected` in <option>.
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
}
// Look up whether this option is 'selected' via context
var selectValue = context[valueContextKey];
// If context key is null (e.g., no specified value or after initial mount)
// or missing (e.g., for <datalist>), we don't change props.selected
var selected = null;
if (selectValue != null) {
selected = false;
if (Array.isArray(selectValue)) {
// multiple
for (var i = 0; i < selectValue.length; i++) {
if ('' + selectValue[i] === '' + props.value) {
selected = true;
break;
}
}
} else {
selected = '' + selectValue === '' + props.value;
}
}
inst._wrapperState = { selected: selected };
},
getNativeProps: function (inst, props, context) {
var nativeProps = assign({ selected: undefined, children: undefined }, props);
// Read state only from initial mount because <select> updates value
// manually; we need the initial state only for server rendering
if (inst._wrapperState.selected != null) {
nativeProps.selected = inst._wrapperState.selected;
}
var content = '';
// Flatten children and warn if they aren't strings or numbers;
// invalid types are ignored.
ReactChildren.forEach(props.children, function (child) {
if (child == null) {
return;
}
if (typeof child === 'string' || typeof child === 'number') {
content += child;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
}
});
nativeProps.children = content;
return nativeProps;
}
};
module.exports = ReactDOMOption;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 110 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactChildren
*/
'use strict';
var PooledClass = __webpack_require__(56);
var ReactElement = __webpack_require__(42);
var emptyFunction = __webpack_require__(15);
var traverseAllChildren = __webpack_require__(111);
var twoArgumentPooler = PooledClass.twoArgumentPooler;
var fourArgumentPooler = PooledClass.fourArgumentPooler;
var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* traversal. Allows avoiding binding callbacks.
*
* @constructor ForEachBookKeeping
* @param {!function} forEachFunction Function to perform traversal with.
* @param {?*} forEachContext Context to perform context with.
*/
function ForEachBookKeeping(forEachFunction, forEachContext) {
this.func = forEachFunction;
this.context = forEachContext;
this.count = 0;
}
ForEachBookKeeping.prototype.destructor = function () {
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func;
var context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
/**
* Iterates through children that are typically specified as `props.children`.
*
* The provided forEachFunc(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc
* @param {*} forEachContext Context for forEachContext.
*/
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
ForEachBookKeeping.release(traverseContext);
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* mapping. Allows avoiding binding callbacks.
*
* @constructor MapBookKeeping
* @param {!*} mapResult Object containing the ordered map of results.
* @param {!function} mapFunction Function to perform mapping with.
* @param {?*} mapContext Context to perform mapping with.
*/
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
this.result = mapResult;
this.keyPrefix = keyPrefix;
this.func = mapFunction;
this.context = mapContext;
this.count = 0;
}
MapBookKeeping.prototype.destructor = function () {
this.result = null;
this.keyPrefix = null;
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result;
var keyPrefix = bookKeeping.keyPrefix;
var func = bookKeeping.func;
var context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
} else if (mappedChild != null) {
if (ReactElement.isValidElement(mappedChild)) {
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
}
result.push(mappedChild);
}
}
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = '';
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
}
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
MapBookKeeping.release(traverseContext);
}
/**
* Maps children that are typically specified as `props.children`.
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} func The map function.
* @param {*} context Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
}
function forEachSingleChildDummy(traverseContext, child, name) {
return null;
}
/**
* Count the number of children that are typically specified as
* `props.children`.
*
* @param {?*} children Children tree container.
* @return {number} The number of children.
*/
function countChildren(children, context) {
return traverseAllChildren(children, forEachSingleChildDummy, null);
}
/**
* Flatten a children object (typically specified as `props.children`) and
* return an array with appropriately re-keyed children.
*/
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
return result;
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
count: countChildren,
toArray: toArray
};
module.exports = ReactChildren;
/***/ },
/* 111 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule traverseAllChildren
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(5);
var ReactElement = __webpack_require__(42);
var ReactInstanceHandles = __webpack_require__(45);
var getIteratorFn = __webpack_require__(108);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
var SUBSEPARATOR = ':';
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var userProvidedKeyEscaperLookup = {
'=': '=0',
'.': '=1',
':': '=2'
};
var userProvidedKeyEscapeRegex = /[=.:]/g;
var didWarnAboutMaps = false;
function userProvidedKeyEscaper(match) {
return userProvidedKeyEscaperLookup[match];
}
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provided.
* @return {string}
*/
function getComponentKey(component, index) {
if (component && component.key != null) {
// Explicit key
return wrapUserProvidedKey(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* Escape a component key so that it is safe to use in a reactid.
*
* @param {*} text Component key to be escaped.
* @return {string} An escaped string.
*/
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
}
/**
* Wrap a `key` value explicitly provided by the user to distinguish it from
* implicitly-generated keys generated by a component's index in its parent.
*
* @param {string} key Value of a user-provided `key` attribute
* @return {string}
*/
function wrapUserProvidedKey(key) {
return '$' + escapeUserProvidedKey(key);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
callback(traverseContext, children,
// If it's the only child, treat the name as if it was wrapped in an array
// so that it's consistent if the number of children grows.
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if (process.env.NODE_ENV !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext);
}
module.exports = traverseAllChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 112 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMSelect
*/
'use strict';
var LinkedValueUtils = __webpack_require__(106);
var ReactMount = __webpack_require__(28);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var warning = __webpack_require__(25);
var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
function updateOptionsIfPendingUpdateAndMounted() {
if (this._rootNodeID && this._wrapperState.pendingUpdate) {
this._wrapperState.pendingUpdate = false;
var props = this._currentElement.props;
var value = LinkedValueUtils.getValue(props);
if (value != null) {
updateOptions(this, Boolean(props.multiple), value);
}
}
}
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
var valuePropNames = ['value', 'defaultValue'];
/**
* Validation function for `value` and `defaultValue`.
* @private
*/
function checkSelectPropTypes(inst, props) {
var owner = inst._currentElement._owner;
LinkedValueUtils.checkPropTypes('select', props, owner);
for (var i = 0; i < valuePropNames.length; i++) {
var propName = valuePropNames[i];
if (props[propName] == null) {
continue;
}
if (props.multiple) {
process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
} else {
process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
}
}
}
/**
* @param {ReactDOMComponent} inst
* @param {boolean} multiple
* @param {*} propValue A stringable (with `multiple`, a list of stringables).
* @private
*/
function updateOptions(inst, multiple, propValue) {
var selectedValue, i;
var options = ReactMount.getNode(inst._rootNodeID).options;
if (multiple) {
selectedValue = {};
for (i = 0; i < propValue.length; i++) {
selectedValue['' + propValue[i]] = true;
}
for (i = 0; i < options.length; i++) {
var selected = selectedValue.hasOwnProperty(options[i].value);
if (options[i].selected !== selected) {
options[i].selected = selected;
}
}
} else {
// Do not set `select.value` as exact behavior isn't consistent across all
// browsers for all cases.
selectedValue = '' + propValue;
for (i = 0; i < options.length; i++) {
if (options[i].value === selectedValue) {
options[i].selected = true;
return;
}
}
if (options.length) {
options[0].selected = true;
}
}
}
/**
* Implements a <select> native component that allows optionally setting the
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
* stringable. If `multiple` is true, the prop must be an array of stringables.
*
* If `value` is not supplied (or null/undefined), user actions that change the
* selected option will trigger updates to the rendered options.
*
* If it is supplied (and not null/undefined), the rendered options will not
* update in response to user actions. Instead, the `value` prop must change in
* order for the rendered options to update.
*
* If `defaultValue` is provided, any options with the supplied values will be
* selected.
*/
var ReactDOMSelect = {
valueContextKey: valueContextKey,
getNativeProps: function (inst, props, context) {
return assign({}, props, {
onChange: inst._wrapperState.onChange,
value: undefined
});
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
checkSelectPropTypes(inst, props);
}
var value = LinkedValueUtils.getValue(props);
inst._wrapperState = {
pendingUpdate: false,
initialValue: value != null ? value : props.defaultValue,
onChange: _handleChange.bind(inst),
wasMultiple: Boolean(props.multiple)
};
},
processChildContext: function (inst, props, context) {
// Pass down initial value so initial generated markup has correct
// `selected` attributes
var childContext = assign({}, context);
childContext[valueContextKey] = inst._wrapperState.initialValue;
return childContext;
},
postUpdateWrapper: function (inst) {
var props = inst._currentElement.props;
// After the initial mount, we control selected-ness manually so don't pass
// the context value down
inst._wrapperState.initialValue = undefined;
var wasMultiple = inst._wrapperState.wasMultiple;
inst._wrapperState.wasMultiple = Boolean(props.multiple);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
inst._wrapperState.pendingUpdate = false;
updateOptions(inst, Boolean(props.multiple), value);
} else if (wasMultiple !== Boolean(props.multiple)) {
// For simplicity, reapply `defaultValue` if `multiple` is toggled.
if (props.defaultValue != null) {
updateOptions(inst, Boolean(props.multiple), props.defaultValue);
} else {
// Revert the select back to its default unselected state.
updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
}
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
this._wrapperState.pendingUpdate = true;
ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
return returnValue;
}
module.exports = ReactDOMSelect;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 113 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMTextarea
*/
'use strict';
var LinkedValueUtils = __webpack_require__(106);
var ReactDOMIDOperations = __webpack_require__(27);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMTextarea.updateWrapper(this);
}
}
/**
* Implements a <textarea> native component that allows setting `value`, and
* `defaultValue`. This differs from the traditional DOM API because value is
* usually set as PCDATA children.
*
* If `value` is not supplied (or null/undefined), user actions that affect the
* value will trigger updates to the element.
*
* If `value` is supplied (and not null/undefined), the rendered element will
* not trigger updates to the element. Instead, the `value` prop must change in
* order for the rendered element to be updated.
*
* The rendered element will be initialized with an empty value, the prop
* `defaultValue` if specified, or the children content (deprecated).
*/
var ReactDOMTextarea = {
getNativeProps: function (inst, props, context) {
!(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined;
// Always set children to the same thing. In IE9, the selection range will
// get reset if `textContent` is mutated.
var nativeProps = assign({}, props, {
defaultValue: undefined,
value: undefined,
children: inst._wrapperState.initialValue,
onChange: inst._wrapperState.onChange
});
return nativeProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
}
var defaultValue = props.defaultValue;
// TODO (yungsters): Remove support for children content in <textarea>.
var children = props.children;
if (children != null) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined;
}
!(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined;
if (Array.isArray(children)) {
!(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined;
children = children[0];
}
defaultValue = '' + children;
}
if (defaultValue == null) {
defaultValue = '';
}
var value = LinkedValueUtils.getValue(props);
inst._wrapperState = {
// We save the initial value so that `ReactDOMComponent` doesn't update
// `textContent` (unnecessary since we update value).
// The initial value can be a boolean or object so that's why it's
// forced to be a string.
initialValue: '' + (value != null ? value : defaultValue),
onChange: _handleChange.bind(inst)
};
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
var value = LinkedValueUtils.getValue(props);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
ReactUpdates.asap(forceUpdateIfMounted, this);
return returnValue;
}
module.exports = ReactDOMTextarea;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 114 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactMultiChild
* @typechecks static-only
*/
'use strict';
var ReactComponentEnvironment = __webpack_require__(64);
var ReactMultiChildUpdateTypes = __webpack_require__(16);
var ReactCurrentOwner = __webpack_require__(5);
var ReactReconciler = __webpack_require__(50);
var ReactChildReconciler = __webpack_require__(115);
var flattenChildren = __webpack_require__(116);
/**
* Updating children of a component may trigger recursive updates. The depth is
* used to batch recursive updates to render markup more efficiently.
*
* @type {number}
* @private
*/
var updateDepth = 0;
/**
* Queue of update configuration objects.
*
* Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
*
* @type {array<object>}
* @private
*/
var updateQueue = [];
/**
* Queue of markup to be rendered.
*
* @type {array<string>}
* @private
*/
var markupQueue = [];
/**
* Enqueues markup to be rendered and inserted at a supplied index.
*
* @param {string} parentID ID of the parent component.
* @param {string} markup Markup that renders into an element.
* @param {number} toIndex Destination index.
* @private
*/
function enqueueInsertMarkup(parentID, markup, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
markupIndex: markupQueue.push(markup) - 1,
content: null,
fromIndex: null,
toIndex: toIndex
});
}
/**
* Enqueues moving an existing element to another index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Source index of the existing element.
* @param {number} toIndex Destination index of the element.
* @private
*/
function enqueueMove(parentID, fromIndex, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
markupIndex: null,
content: null,
fromIndex: fromIndex,
toIndex: toIndex
});
}
/**
* Enqueues removing an element at an index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Index of the element to remove.
* @private
*/
function enqueueRemove(parentID, fromIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.REMOVE_NODE,
markupIndex: null,
content: null,
fromIndex: fromIndex,
toIndex: null
});
}
/**
* Enqueues setting the markup of a node.
*
* @param {string} parentID ID of the parent component.
* @param {string} markup Markup that renders into an element.
* @private
*/
function enqueueSetMarkup(parentID, markup) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.SET_MARKUP,
markupIndex: null,
content: markup,
fromIndex: null,
toIndex: null
});
}
/**
* Enqueues setting the text content.
*
* @param {string} parentID ID of the parent component.
* @param {string} textContent Text content to set.
* @private
*/
function enqueueTextContent(parentID, textContent) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
markupIndex: null,
content: textContent,
fromIndex: null,
toIndex: null
});
}
/**
* Processes any enqueued updates.
*
* @private
*/
function processQueue() {
if (updateQueue.length) {
ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);
clearQueue();
}
}
/**
* Clears any enqueued updates.
*
* @private
*/
function clearQueue() {
updateQueue.length = 0;
markupQueue.length = 0;
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile multiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
_reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
if (process.env.NODE_ENV !== 'production') {
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
} finally {
ReactCurrentOwner.current = null;
}
}
}
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
},
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) {
var nextChildren;
if (process.env.NODE_ENV !== 'production') {
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
nextChildren = flattenChildren(nextNestedChildrenElements);
} finally {
ReactCurrentOwner.current = null;
}
return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
}
}
nextChildren = flattenChildren(nextNestedChildrenElements);
return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
},
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildren Nested child maps.
* @return {array} An array of mounted representations.
* @internal
*/
mountChildren: function (nestedChildren, transaction, context) {
var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
this._renderedChildren = children;
var mountImages = [];
var index = 0;
for (var name in children) {
if (children.hasOwnProperty(name)) {
var child = children[name];
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
child._mountIndex = index++;
mountImages.push(mountImage);
}
}
return mountImages;
},
/**
* Replaces any rendered children with a text content string.
*
* @param {string} nextContent String of content.
* @internal
*/
updateTextContent: function (nextContent) {
updateDepth++;
var errorThrown = true;
try {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren);
// TODO: The setTextContent operation should be enough
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
this._unmountChild(prevChildren[name]);
}
}
// Set new text content.
this.setTextContent(nextContent);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
if (errorThrown) {
clearQueue();
} else {
processQueue();
}
}
}
},
/**
* Replaces any rendered children with a markup string.
*
* @param {string} nextMarkup String of markup.
* @internal
*/
updateMarkup: function (nextMarkup) {
updateDepth++;
var errorThrown = true;
try {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren);
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
this._unmountChildByName(prevChildren[name], name);
}
}
this.setMarkup(nextMarkup);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
if (errorThrown) {
clearQueue();
} else {
processQueue();
}
}
}
},
/**
* Updates the rendered children with new children.
*
* @param {?object} nextNestedChildrenElements Nested child element maps.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
updateChildren: function (nextNestedChildrenElements, transaction, context) {
updateDepth++;
var errorThrown = true;
try {
this._updateChildren(nextNestedChildrenElements, transaction, context);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
if (errorThrown) {
clearQueue();
} else {
processQueue();
}
}
}
},
/**
* Improve performance by isolating this hot code path from the try/catch
* block in `updateChildren`.
*
* @param {?object} nextNestedChildrenElements Nested child element maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function (nextNestedChildrenElements, transaction, context) {
var prevChildren = this._renderedChildren;
var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
this._renderedChildren = nextChildren;
if (!nextChildren && !prevChildren) {
return;
}
var name;
// `nextIndex` will increment for each child in `nextChildren`, but
// `lastIndex` will be the last index visited in `prevChildren`.
var lastIndex = 0;
var nextIndex = 0;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var prevChild = prevChildren && prevChildren[name];
var nextChild = nextChildren[name];
if (prevChild === nextChild) {
this.moveChild(prevChild, nextIndex, lastIndex);
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
this._unmountChild(prevChild);
}
// The child must be instantiated before it's mounted.
this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
}
nextIndex++;
}
// Remove children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
this._unmountChild(prevChildren[name]);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @internal
*/
unmountChildren: function () {
var renderedChildren = this._renderedChildren;
ReactChildReconciler.unmountChildren(renderedChildren);
this._renderedChildren = null;
},
/**
* Moves a child component to the supplied index.
*
* @param {ReactComponent} child Component to move.
* @param {number} toIndex Destination index of the element.
* @param {number} lastIndex Last index visited of the siblings of `child`.
* @protected
*/
moveChild: function (child, toIndex, lastIndex) {
// If the index of `child` is less than `lastIndex`, then it needs to
// be moved. Otherwise, we do not need to move it because a child will be
// inserted or moved before `child`.
if (child._mountIndex < lastIndex) {
enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
}
},
/**
* Creates a child component.
*
* @param {ReactComponent} child Component to create.
* @param {string} mountImage Markup to insert.
* @protected
*/
createChild: function (child, mountImage) {
enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
},
/**
* Removes a child component.
*
* @param {ReactComponent} child Child to remove.
* @protected
*/
removeChild: function (child) {
enqueueRemove(this._rootNodeID, child._mountIndex);
},
/**
* Sets this text content string.
*
* @param {string} textContent Text content to set.
* @protected
*/
setTextContent: function (textContent) {
enqueueTextContent(this._rootNodeID, textContent);
},
/**
* Sets this markup string.
*
* @param {string} markup Markup to set.
* @protected
*/
setMarkup: function (markup) {
enqueueSetMarkup(this._rootNodeID, markup);
},
/**
* Mounts a child with the supplied name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to mount.
* @param {string} name Name of the child.
* @param {number} index Index at which to insert the child.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildByNameAtIndex: function (child, name, index, transaction, context) {
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
child._mountIndex = index;
this.createChild(child, mountImage);
},
/**
* Unmounts a rendered child.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to unmount.
* @private
*/
_unmountChild: function (child) {
this.removeChild(child);
child._mountIndex = null;
}
}
};
module.exports = ReactMultiChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 115 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactChildReconciler
* @typechecks static-only
*/
'use strict';
var ReactReconciler = __webpack_require__(50);
var instantiateReactComponent = __webpack_require__(62);
var shouldUpdateReactComponent = __webpack_require__(67);
var traverseAllChildren = __webpack_require__(111);
var warning = __webpack_require__(25);
function instantiateChild(childInstances, child, name) {
// We found a component instance.
var keyUnique = childInstances[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(keyUnique, '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.', name) : undefined;
}
if (child != null && keyUnique) {
childInstances[name] = instantiateReactComponent(child, null);
}
}
/**
* ReactChildReconciler provides helpers for initializing or updating a set of
* children. Its output is suitable for passing it onto ReactMultiChild which
* does diffed reordering and insertion.
*/
var ReactChildReconciler = {
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildNodes Nested child maps.
* @return {?object} A set of child instances.
* @internal
*/
instantiateChildren: function (nestedChildNodes, transaction, context) {
if (nestedChildNodes == null) {
return null;
}
var childInstances = {};
traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
return childInstances;
},
/**
* Updates the rendered children and returns a new set of children.
*
* @param {?object} prevChildren Previously initialized set of children.
* @param {?object} nextChildren Flat child element maps.
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @return {?object} A new set of child instances.
* @internal
*/
updateChildren: function (prevChildren, nextChildren, transaction, context) {
// We currently don't have a way to track moves here but if we use iterators
// instead of for..in we can zip the iterators and check if an item has
// moved.
// TODO: If nothing has changed, return the prevChildren object so that we
// can quickly bailout if nothing has changed.
if (!nextChildren && !prevChildren) {
return null;
}
var name;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var 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) {
ReactReconciler.unmountComponent(prevChild, name);
}
// The child must be instantiated before it's mounted.
var nextChildInstance = instantiateReactComponent(nextElement, null);
nextChildren[name] = nextChildInstance;
}
}
// Unmount children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
ReactReconciler.unmountComponent(prevChildren[name]);
}
}
return nextChildren;
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @param {?object} renderedChildren Previously initialized set of children.
* @internal
*/
unmountChildren: function (renderedChildren) {
for (var name in renderedChildren) {
if (renderedChildren.hasOwnProperty(name)) {
var renderedChild = renderedChildren[name];
ReactReconciler.unmountComponent(renderedChild);
}
}
}
};
module.exports = ReactChildReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 116 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule flattenChildren
*/
'use strict';
var traverseAllChildren = __webpack_require__(111);
var warning = __webpack_require__(25);
/**
* @param {function} traverseContext Context passed through traversal.
* @param {?ReactComponent} child React child component.
* @param {!string} name String name of key path to child.
*/
function flattenSingleChildIntoContext(traverseContext, child, name) {
// We found a component instance.
var result = traverseContext;
var keyUnique = result[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(keyUnique, '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.', name) : undefined;
}
if (keyUnique && child != null) {
result[name] = child;
}
}
/**
* Flattens children that are typically specified as `props.children`. Any null
* children will not be included in the resulting object.
* @return {!object} flattened children keyed by name.
*/
function flattenChildren(children) {
if (children == null) {
return children;
}
var result = {};
traverseAllChildren(children, flattenSingleChildIntoContext, result);
return result;
}
module.exports = flattenChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 117 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule shallowEqual
* @typechecks
*
*/
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* 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 (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.
var bHasOwnProperty = hasOwnProperty.bind(objB);
for (var i = 0; i < keysA.length; i++) {
if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ },
/* 118 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactEventListener
* @typechecks static-only
*/
'use strict';
var EventListener = __webpack_require__(119);
var ExecutionEnvironment = __webpack_require__(9);
var PooledClass = __webpack_require__(56);
var ReactInstanceHandles = __webpack_require__(45);
var ReactMount = __webpack_require__(28);
var ReactUpdates = __webpack_require__(54);
var assign = __webpack_require__(39);
var getEventTarget = __webpack_require__(81);
var getUnboundedScrollPosition = __webpack_require__(120);
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
/**
* Finds the parent React component of `node`.
*
* @param {*} node
* @return {?DOMEventTarget} Parent container, or `null` if the specified node
* is not nested.
*/
function findParent(node) {
// TODO: It may be a good idea to cache this to prevent unnecessary DOM
// traversal, but caching is difficult to do correctly without using a
// mutation observer to listen for all DOM changes.
var nodeID = ReactMount.getID(node);
var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
var container = ReactMount.findReactContainerForID(rootID);
var parent = ReactMount.getFirstReactDOM(container);
return parent;
}
// Used to store ancestor hierarchy in top level callback
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
this.topLevelType = topLevelType;
this.nativeEvent = nativeEvent;
this.ancestors = [];
}
assign(TopLevelCallbackBookKeeping.prototype, {
destructor: function () {
this.topLevelType = null;
this.nativeEvent = null;
this.ancestors.length = 0;
}
});
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
function handleTopLevelImpl(bookKeeping) {
// TODO: Re-enable event.path handling
//
// if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
// // New browsers have a path attribute on native events
// handleTopLevelWithPath(bookKeeping);
// } else {
// // Legacy browsers don't have a path attribute on native events
// handleTopLevelWithoutPath(bookKeeping);
// }
void handleTopLevelWithPath; // temporarily unused
handleTopLevelWithoutPath(bookKeeping);
}
// Legacy browsers don't have a path attribute on native events
function handleTopLevelWithoutPath(bookKeeping) {
var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
// Loop through the hierarchy, in case there's any nested components.
// It's important that we build the array of ancestors before calling any
// event handlers, because event handlers can modify the DOM, leading to
// inconsistencies with ReactMount's node cache. See #1105.
var ancestor = topLevelTarget;
while (ancestor) {
bookKeeping.ancestors.push(ancestor);
ancestor = findParent(ancestor);
}
for (var i = 0; i < bookKeeping.ancestors.length; i++) {
topLevelTarget = bookKeeping.ancestors[i];
var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
}
}
// New browsers have a path attribute on native events
function handleTopLevelWithPath(bookKeeping) {
var path = bookKeeping.nativeEvent.path;
var currentNativeTarget = path[0];
var eventsFired = 0;
for (var i = 0; i < path.length; i++) {
var currentPathElement = path[i];
if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
currentNativeTarget = path[i + 1];
}
// TODO: slow
var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
if (reactParent === currentPathElement) {
var currentPathElementID = ReactMount.getID(currentPathElement);
var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
bookKeeping.ancestors.push(currentPathElement);
var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
eventsFired++;
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
// Jump to the root of this React render tree
while (currentPathElementID !== newRootID) {
i++;
currentPathElement = path[i];
currentPathElementID = ReactMount.getID(currentPathElement);
}
}
}
if (eventsFired === 0) {
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
}
}
function scrollValueMonitor(cb) {
var scrollPosition = getUnboundedScrollPosition(window);
cb(scrollPosition);
}
var ReactEventListener = {
_enabled: true,
_handleTopLevel: null,
WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
setHandleTopLevel: function (handleTopLevel) {
ReactEventListener._handleTopLevel = handleTopLevel;
},
setEnabled: function (enabled) {
ReactEventListener._enabled = !!enabled;
},
isEnabled: function () {
return ReactEventListener._enabled;
},
/**
* Traps top-level events by using event bubbling.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return null;
}
return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
},
/**
* Traps a top-level event by using event capturing.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return null;
}
return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
},
monitorScrollValue: function (refresh) {
var callback = scrollValueMonitor.bind(null, refresh);
EventListener.listen(window, 'scroll', callback);
},
dispatchEvent: function (topLevelType, nativeEvent) {
if (!ReactEventListener._enabled) {
return;
}
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
try {
// Event queue being processed in the same cycle allows
// `preventDefault`.
ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
} finally {
TopLevelCallbackBookKeeping.release(bookKeeping);
}
}
};
module.exports = ReactEventListener;
/***/ },
/* 119 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* @providesModule EventListener
* @typechecks
*/
'use strict';
var emptyFunction = __webpack_require__(15);
/**
* Upstream version of event listener. Does not take into account specific
* nature of platform.
*/
var EventListener = {
/**
* Listen to DOM events during the bubble phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen: function (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function () {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function () {
target.detachEvent('on' + eventType, callback);
}
};
}
},
/**
* Listen to DOM events during the capture phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
capture: function (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, true);
return {
remove: function () {
target.removeEventListener(eventType, callback, true);
}
};
} else {
if (process.env.NODE_ENV !== 'production') {
console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
}
return {
remove: emptyFunction
};
}
},
registerDefault: function () {}
};
module.exports = EventListener;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 120 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getUnboundedScrollPosition
* @typechecks
*/
'use strict';
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are unbounded, unlike `getScrollPosition`. This means they
* may be negative or exceed the element boundaries (which is possible using
* inertial scrolling).
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getUnboundedScrollPosition(scrollable) {
if (scrollable === window) {
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
/***/ },
/* 121 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactInjection
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var EventPluginHub = __webpack_require__(31);
var ReactComponentEnvironment = __webpack_require__(64);
var ReactClass = __webpack_require__(122);
var ReactEmptyComponent = __webpack_require__(68);
var ReactBrowserEventEmitter = __webpack_require__(29);
var ReactNativeComponent = __webpack_require__(69);
var ReactPerf = __webpack_require__(18);
var ReactRootIndex = __webpack_require__(46);
var ReactUpdates = __webpack_require__(54);
var ReactInjection = {
Component: ReactComponentEnvironment.injection,
Class: ReactClass.injection,
DOMProperty: DOMProperty.injection,
EmptyComponent: ReactEmptyComponent.injection,
EventPluginHub: EventPluginHub.injection,
EventEmitter: ReactBrowserEventEmitter.injection,
NativeComponent: ReactNativeComponent.injection,
Perf: ReactPerf.injection,
RootIndex: ReactRootIndex.injection,
Updates: ReactUpdates.injection
};
module.exports = ReactInjection;
/***/ },
/* 122 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactClass
*/
'use strict';
var ReactComponent = __webpack_require__(123);
var ReactElement = __webpack_require__(42);
var ReactPropTypeLocations = __webpack_require__(65);
var ReactPropTypeLocationNames = __webpack_require__(66);
var ReactNoopUpdateQueue = __webpack_require__(124);
var assign = __webpack_require__(39);
var emptyObject = __webpack_require__(58);
var invariant = __webpack_require__(13);
var keyMirror = __webpack_require__(17);
var keyOf = __webpack_require__(79);
var warning = __webpack_require__(25);
var MIXINS_KEY = keyOf({ mixins: null });
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var SpecPolicy = keyMirror({
/**
* These methods may be defined only once by the class specification or mixin.
*/
DEFINE_ONCE: null,
/**
* These methods may be defined by both the class specification and mixins.
* Subsequent definitions will be chained. These methods must return void.
*/
DEFINE_MANY: null,
/**
* These methods are overriding the base class.
*/
OVERRIDE_BASE: null,
/**
* These methods are similar to DEFINE_MANY, except we assume they return
* objects. We try to merge the keys of the return values of all the mixed in
* functions. If there is a key conflict we throw.
*/
DEFINE_MANY_MERGED: null
});
var injectedMixins = [];
var warnedSetProps = false;
function warnSetProps() {
if (!warnedSetProps) {
warnedSetProps = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined;
}
}
/**
* Composite components are higher-level components that compose other composite
* or native components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: SpecPolicy.DEFINE_MANY,
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: SpecPolicy.DEFINE_MANY,
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: SpecPolicy.DEFINE_MANY,
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
/**
* @return {object}
* @optional
*/
getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: SpecPolicy.DEFINE_ONCE,
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: SpecPolicy.DEFINE_MANY,
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: SpecPolicy.OVERRIDE_BASE
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function (Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function (Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function (Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
}
Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
}
Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
}
Constructor.propTypes = assign({}, Constructor.propTypes, propTypes);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
// noop
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an invariant so components
// don't show up in prod but not in __DEV__
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined;
}
}
}
function validateMethodOverride(proto, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
!(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined;
}
// Disallow defining methods more than once unless explicitly allowed.
if (proto.hasOwnProperty(name)) {
!(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined;
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classses.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
return;
}
!(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
!!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
var proto = Constructor.prototype;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
validateMethodOverride(proto, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isAlreadyDefined = proto.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
if (shouldAutoBind) {
if (!proto.__reactAutoBindMap) {
proto.__reactAutoBindMap = {};
}
proto.__reactAutoBindMap[name] = property;
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
!(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === SpecPolicy.DEFINE_MANY) {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = (name in RESERVED_SPEC_KEYS);
!!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : undefined;
var isInherited = (name in Constructor);
!!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined;
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
!(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : undefined;
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (process.env.NODE_ENV !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
/* eslint-disable block-scoped-var, no-undef */
boundMethod.bind = function (newThis) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
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) : undefined;
} 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) : undefined;
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
/* eslint-enable */
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
for (var autoBindKey in component.__reactAutoBindMap) {
if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
var method = component.__reactAutoBindMap[autoBindKey];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
}
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function (newState, callback) {
this.updater.enqueueReplaceState(this, newState);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function () {
return this.updater.isMounted(this);
},
/**
* Sets a subset of the props.
*
* @param {object} partialProps Subset of the next props.
* @param {?function} callback Called after props are updated.
* @final
* @public
* @deprecated
*/
setProps: function (partialProps, callback) {
if (process.env.NODE_ENV !== 'production') {
warnSetProps();
}
this.updater.enqueueSetProps(this, partialProps);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
},
/**
* Replace all the props.
*
* @param {object} newProps Subset of the next props.
* @param {?function} callback Called after props are updated.
* @final
* @public
* @deprecated
*/
replaceProps: function (newProps, callback) {
if (process.env.NODE_ENV !== 'production') {
warnSetProps();
}
this.updater.enqueueReplaceProps(this, newProps);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
}
};
var ReactClassComponent = function () {};
assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
/**
* Module for creating composite components.
*
* @class ReactClass
*/
var ReactClass = {
/**
* Creates a composite component class given a class specification.
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
createClass: function (spec) {
var Constructor = function (props, context, updater) {
// This constructor is overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: path_to_url : undefined;
}
// Wire up auto-binding
if (this.__reactAutoBindMap) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined;
this.state = initialState;
};
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
!Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined;
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined;
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
},
injection: {
injectMixin: function (mixin) {
injectedMixins.push(mixin);
}
}
};
module.exports = ReactClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 123 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactComponent
*/
'use strict';
var ReactNoopUpdateQueue = __webpack_require__(124);
var canDefineProperty = __webpack_require__(43);
var emptyObject = __webpack_require__(58);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
/**
* Base class helpers for the updating state of a component.
*/
function ReactComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
ReactComponent.prototype.isReactComponent = {};
/**
* Sets a subset of the state. Always use this to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* callback that will be executed when the call to setState is actually
* completed.
*
* When a function is provided to setState, it will be called at some point in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be different
* from this.* because your function may be called after receiveProps but before
* shouldComponentUpdate, and this new state, props, and context will not yet be
* assigned to this.
*
* @param {object|function} partialState Next partial state or function to
* produce next partial state to be merged with current state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
ReactComponent.prototype.setState = function (partialState, callback) {
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined;
}
this.updater.enqueueSetState(this, partialState);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
ReactComponent.prototype.forceUpdate = function (callback) {
this.updater.enqueueForceUpdate(this);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
};
/**
* Deprecated APIs. These APIs used to exist on classic React classes but since
* we would like to deprecate them, we're not going to move them over to this
* modern base class. Instead, we define a getter that warns if it's accessed.
*/
if (process.env.NODE_ENV !== 'production') {
var deprecatedAPIs = {
getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'],
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
replaceProps: ['replaceProps', 'Instead, call render again at the top level.'],
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'path_to_url
setProps: ['setProps', 'Instead, call render again at the top level.']
};
var defineDeprecationWarning = function (methodName, info) {
if (canDefineProperty) {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined;
return undefined;
}
});
}
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
module.exports = ReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 124 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactNoopUpdateQueue
*/
'use strict';
var warning = __webpack_require__(25);
function warnTDZ(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, '%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, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined;
}
}
/**
* This is the abstract API for an update queue.
*/
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
return false;
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
enqueueCallback: function (publicInstance, callback) {},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
warnTDZ(publicInstance, 'forceUpdate');
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
warnTDZ(publicInstance, 'replaceState');
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
warnTDZ(publicInstance, 'setState');
},
/**
* Sets a subset of the props.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialProps Subset of the next props.
* @internal
*/
enqueueSetProps: function (publicInstance, partialProps) {
warnTDZ(publicInstance, 'setProps');
},
/**
* Replaces all of the props.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} props New props.
* @internal
*/
enqueueReplaceProps: function (publicInstance, props) {
warnTDZ(publicInstance, 'replaceProps');
}
};
module.exports = ReactNoopUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 125 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactReconcileTransaction
* @typechecks static-only
*/
'use strict';
var CallbackQueue = __webpack_require__(55);
var PooledClass = __webpack_require__(56);
var ReactBrowserEventEmitter = __webpack_require__(29);
var ReactDOMFeatureFlags = __webpack_require__(41);
var ReactInputSelection = __webpack_require__(126);
var Transaction = __webpack_require__(57);
var assign = __webpack_require__(39);
/**
* Ensures that, when possible, the selection range (currently selected text
* input) is not disturbed by performing the transaction.
*/
var SELECTION_RESTORATION = {
/**
* @return {Selection} Selection information.
*/
initialize: ReactInputSelection.getSelectionInformation,
/**
* @param {Selection} sel Selection information returned from `initialize`.
*/
close: ReactInputSelection.restoreSelection
};
/**
* Suppresses events (blur/focus) that could be inadvertently dispatched due to
* high level DOM manipulations (like temporarily removing a text input from the
* DOM).
*/
var EVENT_SUPPRESSION = {
/**
* @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
* the reconciliation.
*/
initialize: function () {
var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
ReactBrowserEventEmitter.setEnabled(false);
return currentlyEnabled;
},
/**
* @param {boolean} previouslyEnabled Enabled status of
* `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
* restores the previous value.
*/
close: function (previouslyEnabled) {
ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
}
};
/**
* Provides a queue for collecting `componentDidMount` and
* `componentDidUpdate` callbacks during the the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function () {
this.reactMountReady.reset();
},
/**
* After DOM is flushed, invoke all registered `onDOMReady` callbacks.
*/
close: function () {
this.reactMountReady.notifyAll();
}
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
/**
* Currently:
* - The order that these are listed in the transaction is critical:
* - Suppresses events.
* - Restores selection range.
*
* Future:
* - Restore document/overflow scroll positions that were unintentionally
* modified via DOM insertions above the top viewport boundary.
* - Implement/integrate with customized constraint based layout system and keep
* track of which dimensions must be remeasured.
*
* @class ReactReconcileTransaction
*/
function ReactReconcileTransaction(forceHTML) {
this.reinitializeTransaction();
// Only server-side rendering really needs this option (see
// `ReactServerRendering`), but server-side uses
// `ReactServerRenderingTransaction` instead. This option is here so that it's
// accessible and defaults to false when `ReactDOMComponent` and
// `ReactTextComponent` checks it in `mountComponent`.`
this.renderToStaticMarkup = false;
this.reactMountReady = CallbackQueue.getPooled(null);
this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array<object>} List of operation wrap procedures.
* TODO: convert to array<TransactionWrapper>
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return this.reactMountReady;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be reused.
*/
destructor: function () {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
}
};
assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
PooledClass.addPoolingTo(ReactReconcileTransaction);
module.exports = ReactReconcileTransaction;
/***/ },
/* 126 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactInputSelection
*/
'use strict';
var ReactDOMSelection = __webpack_require__(127);
var containsNode = __webpack_require__(59);
var focusNode = __webpack_require__(95);
var getActiveElement = __webpack_require__(129);
function isInDocument(node) {
return containsNode(document.documentElement, node);
}
/**
* @ReactInputSelection: React input selection module. Based on Selection.js,
* but modified to be suitable for react and has a couple of bug fixes (doesn't
* assume buttons have range selections allowed).
* Input selection module for React.
*/
var ReactInputSelection = {
hasSelectionCapabilities: function (elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
},
getSelectionInformation: function () {
var focusedElem = getActiveElement();
return {
focusedElem: focusedElem,
selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
};
},
/**
* @restoreSelection: If any selection information was potentially lost,
* restore it. This is useful when performing operations that could remove dom
* nodes and place them back in, resulting in focus being lost.
*/
restoreSelection: function (priorSelectionInformation) {
var curFocusedElem = getActiveElement();
var priorFocusedElem = priorSelectionInformation.focusedElem;
var priorSelectionRange = priorSelectionInformation.selectionRange;
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
}
focusNode(priorFocusedElem);
}
},
/**
* @getSelection: Gets the selection bounds of a focused textarea, input or
* contentEditable node.
* -@input: Look up selection bounds of this input
* -@return {start: selectionStart, end: selectionEnd}
*/
getSelection: function (input) {
var selection;
if ('selectionStart' in input) {
// Modern browser with input or textarea.
selection = {
start: input.selectionStart,
end: input.selectionEnd
};
} else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
// IE8 input.
var range = document.selection.createRange();
// There can only be one selection per document in IE, so it must
// be in our element.
if (range.parentElement() === input) {
selection = {
start: -range.moveStart('character', -input.value.length),
end: -range.moveEnd('character', -input.value.length)
};
}
} else {
// Content editable or old IE textarea.
selection = ReactDOMSelection.getOffsets(input);
}
return selection || { start: 0, end: 0 };
},
/**
* @setSelection: Sets the selection bounds of a textarea or input and focuses
* the input.
* -@input Set selection bounds of this input or textarea
* -@offsets Object of same form that is returned from get*
*/
setSelection: function (input, offsets) {
var start = offsets.start;
var end = offsets.end;
if (typeof end === 'undefined') {
end = start;
}
if ('selectionStart' in input) {
input.selectionStart = start;
input.selectionEnd = Math.min(end, input.value.length);
} else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
var range = input.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', end - start);
range.select();
} else {
ReactDOMSelection.setOffsets(input, offsets);
}
}
};
module.exports = ReactInputSelection;
/***/ },
/* 127 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactDOMSelection
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var getNodeForCharacterOffset = __webpack_require__(128);
var getTextContentAccessor = __webpack_require__(75);
/**
* While `isCollapsed` is available on the Selection object and `collapsed`
* is available on the Range object, IE11 sometimes gets them wrong.
* If the anchor/focus nodes and offsets are the same, the range is collapsed.
*/
function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
return anchorNode === focusNode && anchorOffset === focusOffset;
}
/**
* Get the appropriate anchor and focus node/offset pairs for IE.
*
* The catch here is that IE's selection API doesn't provide information
* about whether the selection is forward or backward, so we have to
* behave as though it's always forward.
*
* IE text differs from modern selection in that it behaves as though
* block elements end with a new line. This means character offsets will
* differ between the two APIs.
*
* @param {DOMElement} node
* @return {object}
*/
function getIEOffsets(node) {
var selection = document.selection;
var selectedRange = selection.createRange();
var selectedLength = selectedRange.text.length;
// Duplicate selection so we can move range without breaking user selection.
var fromStart = selectedRange.duplicate();
fromStart.moveToElementText(node);
fromStart.setEndPoint('EndToStart', selectedRange);
var startOffset = fromStart.text.length;
var endOffset = startOffset + selectedLength;
return {
start: startOffset,
end: endOffset
};
}
/**
* @param {DOMElement} node
* @return {?object}
*/
function getModernOffsets(node) {
var selection = window.getSelection && window.getSelection();
if (!selection || selection.rangeCount === 0) {
return null;
}
var anchorNode = selection.anchorNode;
var anchorOffset = selection.anchorOffset;
var focusNode = selection.focusNode;
var focusOffset = selection.focusOffset;
var currentRange = selection.getRangeAt(0);
// In Firefox, range.startContainer and range.endContainer can be "anonymous
// divs", e.g. the up/down buttons on an <input type="number">. Anonymous
// divs do not seem to expose properties, triggering a "Permission denied
// error" if any of its properties are accessed. The only seemingly possible
// way to avoid erroring is to access a property that typically works for
// non-anonymous divs and catch any error that may otherwise arise. See
// path_to_url
try {
/* eslint-disable no-unused-expressions */
currentRange.startContainer.nodeType;
currentRange.endContainer.nodeType;
/* eslint-enable no-unused-expressions */
} catch (e) {
return null;
}
// If the node and offset values are the same, the selection is collapsed.
// `Selection.isCollapsed` is available natively, but IE sometimes gets
// this value wrong.
var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
var tempRange = currentRange.cloneRange();
tempRange.selectNodeContents(node);
tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
var end = start + rangeLength;
// Detect whether the selection is backward.
var detectionRange = document.createRange();
detectionRange.setStart(anchorNode, anchorOffset);
detectionRange.setEnd(focusNode, focusOffset);
var isBackward = detectionRange.collapsed;
return {
start: isBackward ? end : start,
end: isBackward ? start : end
};
}
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setIEOffsets(node, offsets) {
var range = document.selection.createRange().duplicate();
var start, end;
if (typeof offsets.end === 'undefined') {
start = offsets.start;
end = start;
} else if (offsets.start > offsets.end) {
start = offsets.end;
end = offsets.start;
} else {
start = offsets.start;
end = offsets.end;
}
range.moveToElementText(node);
range.moveStart('character', start);
range.setEndPoint('EndToStart', range);
range.moveEnd('character', end - start);
range.select();
}
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not possible
* to programatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
var selection = window.getSelection();
var length = node[getTextContentAccessor()].length;
var start = Math.min(offsets.start, length);
var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length);
// IE 11 uses modern selection, but doesn't support the extend method.
// Flip backward selections, so we can set with a single range.
if (!selection.extend && start > end) {
var temp = end;
end = start;
start = temp;
}
var startMarker = getNodeForCharacterOffset(node, start);
var endMarker = getNodeForCharacterOffset(node, end);
if (startMarker && endMarker) {
var range = document.createRange();
range.setStart(startMarker.node, startMarker.offset);
selection.removeAllRanges();
if (start > end) {
selection.addRange(range);
selection.extend(endMarker.node, endMarker.offset);
} else {
range.setEnd(endMarker.node, endMarker.offset);
selection.addRange(range);
}
}
}
var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
var ReactDOMSelection = {
/**
* @param {DOMElement} node
*/
getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
};
module.exports = ReactDOMSelection;
/***/ },
/* 128 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getNodeForCharacterOffset
*/
'use strict';
/**
* Given any node return the first leaf node without children.
*
* @param {DOMElement|DOMTextNode} node
* @return {DOMElement|DOMTextNode}
*/
function getLeafNode(node) {
while (node && node.firstChild) {
node = node.firstChild;
}
return node;
}
/**
* Get the next sibling within a container. This will walk up the
* DOM if a node's siblings have been exhausted.
*
* @param {DOMElement|DOMTextNode} node
* @return {?DOMElement|DOMTextNode}
*/
function getSiblingNode(node) {
while (node) {
if (node.nextSibling) {
return node.nextSibling;
}
node = node.parentNode;
}
}
/**
* Get object describing the nodes which contain characters at offset.
*
* @param {DOMElement|DOMTextNode} root
* @param {number} offset
* @return {?object}
*/
function getNodeForCharacterOffset(root, offset) {
var node = getLeafNode(root);
var nodeStart = 0;
var nodeEnd = 0;
while (node) {
if (node.nodeType === 3) {
nodeEnd = nodeStart + node.textContent.length;
if (nodeStart <= offset && nodeEnd >= offset) {
return {
node: node,
offset: offset - nodeStart
};
}
nodeStart = nodeEnd;
}
node = getLeafNode(getSiblingNode(node));
}
}
module.exports = getNodeForCharacterOffset;
/***/ },
/* 129 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getActiveElement
* @typechecks
*/
/* eslint-disable fb-www/typeof-undefined */
/**
* Same as document.activeElement but wraps in a try-catch block. In IE it is
* not safe to call document.activeElement if there is nothing focused.
*
* The activeElement will be null only if the document or document body is not
* yet defined.
*/
'use strict';
function getActiveElement() /*?DOMElement*/{
if (typeof document === 'undefined') {
return null;
}
try {
return document.activeElement || document.body;
} catch (e) {
return document.body;
}
}
module.exports = getActiveElement;
/***/ },
/* 130 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SelectEventPlugin
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventPropagators = __webpack_require__(73);
var ExecutionEnvironment = __webpack_require__(9);
var ReactInputSelection = __webpack_require__(126);
var SyntheticEvent = __webpack_require__(77);
var getActiveElement = __webpack_require__(129);
var isTextInputElement = __webpack_require__(82);
var keyOf = __webpack_require__(79);
var shallowEqual = __webpack_require__(117);
var topLevelTypes = EventConstants.topLevelTypes;
var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
var eventTypes = {
select: {
phasedRegistrationNames: {
bubbled: keyOf({ onSelect: null }),
captured: keyOf({ onSelectCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
}
};
var activeElement = null;
var activeElementID = null;
var lastSelection = null;
var mouseDown = false;
// Track whether a listener exists for this plugin. If none exist, we do
// not extract events.
var hasListener = false;
var ON_SELECT_KEY = keyOf({ onSelect: null });
/**
* Get an object which is a unique representation of the current selection.
*
* The return value will not be consistent across nodes or browsers, but
* two identical selections on the same node will return identical objects.
*
* @param {DOMElement} node
* @return {object}
*/
function getSelection(node) {
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
return {
start: node.selectionStart,
end: node.selectionEnd
};
} else if (window.getSelection) {
var selection = window.getSelection();
return {
anchorNode: selection.anchorNode,
anchorOffset: selection.anchorOffset,
focusNode: selection.focusNode,
focusOffset: selection.focusOffset
};
} else if (document.selection) {
var range = document.selection.createRange();
return {
parentElement: range.parentElement(),
text: range.text,
top: range.boundingTop,
left: range.boundingLeft
};
}
}
/**
* Poll selection to see whether it's changed.
*
* @param {object} nativeEvent
* @return {?SyntheticEvent}
*/
function constructSelectEvent(nativeEvent, nativeEventTarget) {
// Ensure we have the right element, and that the user is not dragging a
// selection (this matches native `select` event behavior). In HTML5, select
// fires only on input and textarea thus if there's no focused element we
// won't dispatch.
if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
return null;
}
// Only fire when selection has actually changed.
var currentSelection = getSelection(activeElement);
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
lastSelection = currentSelection;
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
syntheticEvent.type = 'select';
syntheticEvent.target = activeElement;
EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
return syntheticEvent;
}
return null;
}
/**
* This plugin creates an `onSelect` event that normalizes select events
* across form elements.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - contentEditable
*
* This differs from native browser implementations in the following ways:
* - Fires on contentEditable fields as well as inputs.
* - Fires for collapsed selection.
* - Fires after user input.
*/
var SelectEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
if (!hasListener) {
return null;
}
switch (topLevelType) {
// Track the input node that has focus.
case topLevelTypes.topFocus:
if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
activeElement = topLevelTarget;
activeElementID = topLevelTargetID;
lastSelection = null;
}
break;
case topLevelTypes.topBlur:
activeElement = null;
activeElementID = null;
lastSelection = null;
break;
// Don't fire the event while the user is dragging. This matches the
// semantics of the native select event.
case topLevelTypes.topMouseDown:
mouseDown = true;
break;
case topLevelTypes.topContextMenu:
case topLevelTypes.topMouseUp:
mouseDown = false;
return constructSelectEvent(nativeEvent, nativeEventTarget);
// Chrome and IE fire non-standard event when selection is changed (and
// sometimes when it hasn't). IE's event fires out of order with respect
// to key and input events on deletion, so we discard it.
//
// Firefox doesn't support selectionchange, so check selection status
// after each key entry. The selection changes after keydown and before
// keyup, but we check on keydown as well in the case of holding down a
// key, when multiple keydown events are fired but only one keyup is.
// This is also our approach for IE handling, for the reason above.
case topLevelTypes.topSelectionChange:
if (skipSelectionChangeEvent) {
break;
}
// falls through
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
return constructSelectEvent(nativeEvent, nativeEventTarget);
}
return null;
},
didPutListener: function (id, registrationName, listener) {
if (registrationName === ON_SELECT_KEY) {
hasListener = true;
}
}
};
module.exports = SelectEventPlugin;
/***/ },
/* 131 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ServerReactRootIndex
* @typechecks
*/
'use strict';
/**
* Size of the reactRoot ID space. We generate random numbers for React root
* IDs and if there's a collision the events and DOM update system will
* get confused. In the future we need a way to generate GUIDs but for
* now this will work on a smaller scale.
*/
var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
var ServerReactRootIndex = {
createReactRootIndex: function () {
return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
}
};
module.exports = ServerReactRootIndex;
/***/ },
/* 132 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule SimpleEventPlugin
*/
'use strict';
var EventConstants = __webpack_require__(30);
var EventListener = __webpack_require__(119);
var EventPropagators = __webpack_require__(73);
var ReactMount = __webpack_require__(28);
var SyntheticClipboardEvent = __webpack_require__(133);
var SyntheticEvent = __webpack_require__(77);
var SyntheticFocusEvent = __webpack_require__(134);
var SyntheticKeyboardEvent = __webpack_require__(135);
var SyntheticMouseEvent = __webpack_require__(86);
var SyntheticDragEvent = __webpack_require__(138);
var SyntheticTouchEvent = __webpack_require__(139);
var SyntheticUIEvent = __webpack_require__(87);
var SyntheticWheelEvent = __webpack_require__(140);
var emptyFunction = __webpack_require__(15);
var getEventCharCode = __webpack_require__(136);
var invariant = __webpack_require__(13);
var keyOf = __webpack_require__(79);
var topLevelTypes = EventConstants.topLevelTypes;
var eventTypes = {
abort: {
phasedRegistrationNames: {
bubbled: keyOf({ onAbort: true }),
captured: keyOf({ onAbortCapture: true })
}
},
blur: {
phasedRegistrationNames: {
bubbled: keyOf({ onBlur: true }),
captured: keyOf({ onBlurCapture: true })
}
},
canPlay: {
phasedRegistrationNames: {
bubbled: keyOf({ onCanPlay: true }),
captured: keyOf({ onCanPlayCapture: true })
}
},
canPlayThrough: {
phasedRegistrationNames: {
bubbled: keyOf({ onCanPlayThrough: true }),
captured: keyOf({ onCanPlayThroughCapture: true })
}
},
click: {
phasedRegistrationNames: {
bubbled: keyOf({ onClick: true }),
captured: keyOf({ onClickCapture: true })
}
},
contextMenu: {
phasedRegistrationNames: {
bubbled: keyOf({ onContextMenu: true }),
captured: keyOf({ onContextMenuCapture: true })
}
},
copy: {
phasedRegistrationNames: {
bubbled: keyOf({ onCopy: true }),
captured: keyOf({ onCopyCapture: true })
}
},
cut: {
phasedRegistrationNames: {
bubbled: keyOf({ onCut: true }),
captured: keyOf({ onCutCapture: true })
}
},
doubleClick: {
phasedRegistrationNames: {
bubbled: keyOf({ onDoubleClick: true }),
captured: keyOf({ onDoubleClickCapture: true })
}
},
drag: {
phasedRegistrationNames: {
bubbled: keyOf({ onDrag: true }),
captured: keyOf({ onDragCapture: true })
}
},
dragEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragEnd: true }),
captured: keyOf({ onDragEndCapture: true })
}
},
dragEnter: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragEnter: true }),
captured: keyOf({ onDragEnterCapture: true })
}
},
dragExit: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragExit: true }),
captured: keyOf({ onDragExitCapture: true })
}
},
dragLeave: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragLeave: true }),
captured: keyOf({ onDragLeaveCapture: true })
}
},
dragOver: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragOver: true }),
captured: keyOf({ onDragOverCapture: true })
}
},
dragStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragStart: true }),
captured: keyOf({ onDragStartCapture: true })
}
},
drop: {
phasedRegistrationNames: {
bubbled: keyOf({ onDrop: true }),
captured: keyOf({ onDropCapture: true })
}
},
durationChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onDurationChange: true }),
captured: keyOf({ onDurationChangeCapture: true })
}
},
emptied: {
phasedRegistrationNames: {
bubbled: keyOf({ onEmptied: true }),
captured: keyOf({ onEmptiedCapture: true })
}
},
encrypted: {
phasedRegistrationNames: {
bubbled: keyOf({ onEncrypted: true }),
captured: keyOf({ onEncryptedCapture: true })
}
},
ended: {
phasedRegistrationNames: {
bubbled: keyOf({ onEnded: true }),
captured: keyOf({ onEndedCapture: true })
}
},
error: {
phasedRegistrationNames: {
bubbled: keyOf({ onError: true }),
captured: keyOf({ onErrorCapture: true })
}
},
focus: {
phasedRegistrationNames: {
bubbled: keyOf({ onFocus: true }),
captured: keyOf({ onFocusCapture: true })
}
},
input: {
phasedRegistrationNames: {
bubbled: keyOf({ onInput: true }),
captured: keyOf({ onInputCapture: true })
}
},
keyDown: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyDown: true }),
captured: keyOf({ onKeyDownCapture: true })
}
},
keyPress: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyPress: true }),
captured: keyOf({ onKeyPressCapture: true })
}
},
keyUp: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyUp: true }),
captured: keyOf({ onKeyUpCapture: true })
}
},
load: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoad: true }),
captured: keyOf({ onLoadCapture: true })
}
},
loadedData: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadedData: true }),
captured: keyOf({ onLoadedDataCapture: true })
}
},
loadedMetadata: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadedMetadata: true }),
captured: keyOf({ onLoadedMetadataCapture: true })
}
},
loadStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadStart: true }),
captured: keyOf({ onLoadStartCapture: true })
}
},
// Note: We do not allow listening to mouseOver events. Instead, use the
// onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
mouseDown: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseDown: true }),
captured: keyOf({ onMouseDownCapture: true })
}
},
mouseMove: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseMove: true }),
captured: keyOf({ onMouseMoveCapture: true })
}
},
mouseOut: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseOut: true }),
captured: keyOf({ onMouseOutCapture: true })
}
},
mouseOver: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseOver: true }),
captured: keyOf({ onMouseOverCapture: true })
}
},
mouseUp: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseUp: true }),
captured: keyOf({ onMouseUpCapture: true })
}
},
paste: {
phasedRegistrationNames: {
bubbled: keyOf({ onPaste: true }),
captured: keyOf({ onPasteCapture: true })
}
},
pause: {
phasedRegistrationNames: {
bubbled: keyOf({ onPause: true }),
captured: keyOf({ onPauseCapture: true })
}
},
play: {
phasedRegistrationNames: {
bubbled: keyOf({ onPlay: true }),
captured: keyOf({ onPlayCapture: true })
}
},
playing: {
phasedRegistrationNames: {
bubbled: keyOf({ onPlaying: true }),
captured: keyOf({ onPlayingCapture: true })
}
},
progress: {
phasedRegistrationNames: {
bubbled: keyOf({ onProgress: true }),
captured: keyOf({ onProgressCapture: true })
}
},
rateChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onRateChange: true }),
captured: keyOf({ onRateChangeCapture: true })
}
},
reset: {
phasedRegistrationNames: {
bubbled: keyOf({ onReset: true }),
captured: keyOf({ onResetCapture: true })
}
},
scroll: {
phasedRegistrationNames: {
bubbled: keyOf({ onScroll: true }),
captured: keyOf({ onScrollCapture: true })
}
},
seeked: {
phasedRegistrationNames: {
bubbled: keyOf({ onSeeked: true }),
captured: keyOf({ onSeekedCapture: true })
}
},
seeking: {
phasedRegistrationNames: {
bubbled: keyOf({ onSeeking: true }),
captured: keyOf({ onSeekingCapture: true })
}
},
stalled: {
phasedRegistrationNames: {
bubbled: keyOf({ onStalled: true }),
captured: keyOf({ onStalledCapture: true })
}
},
submit: {
phasedRegistrationNames: {
bubbled: keyOf({ onSubmit: true }),
captured: keyOf({ onSubmitCapture: true })
}
},
suspend: {
phasedRegistrationNames: {
bubbled: keyOf({ onSuspend: true }),
captured: keyOf({ onSuspendCapture: true })
}
},
timeUpdate: {
phasedRegistrationNames: {
bubbled: keyOf({ onTimeUpdate: true }),
captured: keyOf({ onTimeUpdateCapture: true })
}
},
touchCancel: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchCancel: true }),
captured: keyOf({ onTouchCancelCapture: true })
}
},
touchEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchEnd: true }),
captured: keyOf({ onTouchEndCapture: true })
}
},
touchMove: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchMove: true }),
captured: keyOf({ onTouchMoveCapture: true })
}
},
touchStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchStart: true }),
captured: keyOf({ onTouchStartCapture: true })
}
},
volumeChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onVolumeChange: true }),
captured: keyOf({ onVolumeChangeCapture: true })
}
},
waiting: {
phasedRegistrationNames: {
bubbled: keyOf({ onWaiting: true }),
captured: keyOf({ onWaitingCapture: true })
}
},
wheel: {
phasedRegistrationNames: {
bubbled: keyOf({ onWheel: true }),
captured: keyOf({ onWheelCapture: true })
}
}
};
var topLevelEventsToDispatchConfig = {
topAbort: eventTypes.abort,
topBlur: eventTypes.blur,
topCanPlay: eventTypes.canPlay,
topCanPlayThrough: eventTypes.canPlayThrough,
topClick: eventTypes.click,
topContextMenu: eventTypes.contextMenu,
topCopy: eventTypes.copy,
topCut: eventTypes.cut,
topDoubleClick: eventTypes.doubleClick,
topDrag: eventTypes.drag,
topDragEnd: eventTypes.dragEnd,
topDragEnter: eventTypes.dragEnter,
topDragExit: eventTypes.dragExit,
topDragLeave: eventTypes.dragLeave,
topDragOver: eventTypes.dragOver,
topDragStart: eventTypes.dragStart,
topDrop: eventTypes.drop,
topDurationChange: eventTypes.durationChange,
topEmptied: eventTypes.emptied,
topEncrypted: eventTypes.encrypted,
topEnded: eventTypes.ended,
topError: eventTypes.error,
topFocus: eventTypes.focus,
topInput: eventTypes.input,
topKeyDown: eventTypes.keyDown,
topKeyPress: eventTypes.keyPress,
topKeyUp: eventTypes.keyUp,
topLoad: eventTypes.load,
topLoadedData: eventTypes.loadedData,
topLoadedMetadata: eventTypes.loadedMetadata,
topLoadStart: eventTypes.loadStart,
topMouseDown: eventTypes.mouseDown,
topMouseMove: eventTypes.mouseMove,
topMouseOut: eventTypes.mouseOut,
topMouseOver: eventTypes.mouseOver,
topMouseUp: eventTypes.mouseUp,
topPaste: eventTypes.paste,
topPause: eventTypes.pause,
topPlay: eventTypes.play,
topPlaying: eventTypes.playing,
topProgress: eventTypes.progress,
topRateChange: eventTypes.rateChange,
topReset: eventTypes.reset,
topScroll: eventTypes.scroll,
topSeeked: eventTypes.seeked,
topSeeking: eventTypes.seeking,
topStalled: eventTypes.stalled,
topSubmit: eventTypes.submit,
topSuspend: eventTypes.suspend,
topTimeUpdate: eventTypes.timeUpdate,
topTouchCancel: eventTypes.touchCancel,
topTouchEnd: eventTypes.touchEnd,
topTouchMove: eventTypes.touchMove,
topTouchStart: eventTypes.touchStart,
topVolumeChange: eventTypes.volumeChange,
topWaiting: eventTypes.waiting,
topWheel: eventTypes.wheel
};
for (var type in topLevelEventsToDispatchConfig) {
topLevelEventsToDispatchConfig[type].dependencies = [type];
}
var ON_CLICK_KEY = keyOf({ onClick: null });
var onClickListeners = {};
var SimpleEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case topLevelTypes.topAbort:
case topLevelTypes.topCanPlay:
case topLevelTypes.topCanPlayThrough:
case topLevelTypes.topDurationChange:
case topLevelTypes.topEmptied:
case topLevelTypes.topEncrypted:
case topLevelTypes.topEnded:
case topLevelTypes.topError:
case topLevelTypes.topInput:
case topLevelTypes.topLoad:
case topLevelTypes.topLoadedData:
case topLevelTypes.topLoadedMetadata:
case topLevelTypes.topLoadStart:
case topLevelTypes.topPause:
case topLevelTypes.topPlay:
case topLevelTypes.topPlaying:
case topLevelTypes.topProgress:
case topLevelTypes.topRateChange:
case topLevelTypes.topReset:
case topLevelTypes.topSeeked:
case topLevelTypes.topSeeking:
case topLevelTypes.topStalled:
case topLevelTypes.topSubmit:
case topLevelTypes.topSuspend:
case topLevelTypes.topTimeUpdate:
case topLevelTypes.topVolumeChange:
case topLevelTypes.topWaiting:
// HTML Events
// @see path_to_url#events-0
EventConstructor = SyntheticEvent;
break;
case topLevelTypes.topKeyPress:
// FireFox creates a keypress event for function keys too. This removes
// the unwanted keypress events. Enter is however both printable and
// non-printable. One would expect Tab to be as well (but it isn't).
if (getEventCharCode(nativeEvent) === 0) {
return null;
}
/* falls through */
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
EventConstructor = SyntheticKeyboardEvent;
break;
case topLevelTypes.topBlur:
case topLevelTypes.topFocus:
EventConstructor = SyntheticFocusEvent;
break;
case topLevelTypes.topClick:
// Firefox creates a click event on right mouse clicks. This removes the
// unwanted click events.
if (nativeEvent.button === 2) {
return null;
}
/* falls through */
case topLevelTypes.topContextMenu:
case topLevelTypes.topDoubleClick:
case topLevelTypes.topMouseDown:
case topLevelTypes.topMouseMove:
case topLevelTypes.topMouseOut:
case topLevelTypes.topMouseOver:
case topLevelTypes.topMouseUp:
EventConstructor = SyntheticMouseEvent;
break;
case topLevelTypes.topDrag:
case topLevelTypes.topDragEnd:
case topLevelTypes.topDragEnter:
case topLevelTypes.topDragExit:
case topLevelTypes.topDragLeave:
case topLevelTypes.topDragOver:
case topLevelTypes.topDragStart:
case topLevelTypes.topDrop:
EventConstructor = SyntheticDragEvent;
break;
case topLevelTypes.topTouchCancel:
case topLevelTypes.topTouchEnd:
case topLevelTypes.topTouchMove:
case topLevelTypes.topTouchStart:
EventConstructor = SyntheticTouchEvent;
break;
case topLevelTypes.topScroll:
EventConstructor = SyntheticUIEvent;
break;
case topLevelTypes.topWheel:
EventConstructor = SyntheticWheelEvent;
break;
case topLevelTypes.topCopy:
case topLevelTypes.topCut:
case topLevelTypes.topPaste:
EventConstructor = SyntheticClipboardEvent;
break;
}
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
},
didPutListener: function (id, registrationName, listener) {
// Mobile Safari does not fire properly bubble click events on
// non-interactive elements, which means delegated click listeners do not
// fire. The workaround for this bug involves attaching an empty click
// listener on the target node.
if (registrationName === ON_CLICK_KEY) {
var node = ReactMount.getNode(id);
if (!onClickListeners[id]) {
onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
}
}
},
willDeleteListener: function (id, registrationName) {
if (registrationName === ON_CLICK_KEY) {
onClickListeners[id].remove();
delete onClickListeners[id];
}
}
};
module.exports = SimpleEventPlugin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 133 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticClipboardEvent
* @typechecks static-only
*/
'use strict';
var SyntheticEvent = __webpack_require__(77);
/**
* @interface Event
* @see path_to_url
*/
var ClipboardEventInterface = {
clipboardData: function (event) {
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
module.exports = SyntheticClipboardEvent;
/***/ },
/* 134 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticFocusEvent
* @typechecks static-only
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(87);
/**
* @interface FocusEvent
* @see path_to_url
*/
var FocusEventInterface = {
relatedTarget: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
module.exports = SyntheticFocusEvent;
/***/ },
/* 135 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticKeyboardEvent
* @typechecks static-only
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(87);
var getEventCharCode = __webpack_require__(136);
var getEventKey = __webpack_require__(137);
var getEventModifierState = __webpack_require__(88);
/**
* @interface KeyboardEvent
* @see path_to_url
*/
var KeyboardEventInterface = {
key: getEventKey,
location: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
repeat: null,
locale: null,
getModifierState: getEventModifierState,
// Legacy Interface
charCode: function (event) {
// `charCode` is the result of a KeyPress event and represents the value of
// the actual printable character.
// KeyPress is deprecated, but its replacement is not yet final and not
// implemented in any major browser. Only KeyPress has charCode.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
return 0;
},
keyCode: function (event) {
// `keyCode` is the result of a KeyDown/Up event and represents the value of
// physical keyboard key.
// The actual meaning of the value depends on the users' keyboard layout
// which cannot be detected. Assuming that it is a US keyboard layout
// provides a surprisingly accurate mapping for US and European users.
// Due to this, it is left to the user to implement at this time.
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
},
which: function (event) {
// `which` is an alias for either `keyCode` or `charCode` depending on the
// type of the event.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
module.exports = SyntheticKeyboardEvent;
/***/ },
/* 136 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule getEventCharCode
* @typechecks static-only
*/
'use strict';
/**
* `charCode` represents the actual "character code" and is safe to use with
* `String.fromCharCode`. As such, only keys that correspond to printable
* characters produce a valid `charCode`, the only exception to this is Enter.
* The Tab-key is considered non-printable and does not have a `charCode`,
* presumably because it does not produce a tab-character in browsers.
*
* @param {object} nativeEvent Native browser event.
* @return {number} Normalized `charCode` property.
*/
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode;
// FF does not set `charCode` for the Enter-key, check against `keyCode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
}
} else {
// IE8 does not implement `charCode`, but `keyCode` has the correct value.
charCode = keyCode;
}
// Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
return charCode;
}
return 0;
}
module.exports = getEventCharCode;
/***/ },
/* 137 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule getEventKey
* @typechecks static-only
*/
'use strict';
var getEventCharCode = __webpack_require__(136);
/**
* Normalization of deprecated HTML5 `key` values
* @see path_to_url#Key_names
*/
var normalizeKey = {
'Esc': 'Escape',
'Spacebar': ' ',
'Left': 'ArrowLeft',
'Up': 'ArrowUp',
'Right': 'ArrowRight',
'Down': 'ArrowDown',
'Del': 'Delete',
'Win': 'OS',
'Menu': 'ContextMenu',
'Apps': 'ContextMenu',
'Scroll': 'ScrollLock',
'MozPrintableKey': 'Unidentified'
};
/**
* Translation from legacy `keyCode` to HTML5 `key`
* Only special keys supported, all others depend on keyboard layout or browser
* @see path_to_url#Key_names
*/
var translateToKey = {
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
18: 'Alt',
19: 'Pause',
20: 'CapsLock',
27: 'Escape',
32: ' ',
33: 'PageUp',
34: 'PageDown',
35: 'End',
36: 'Home',
37: 'ArrowLeft',
38: 'ArrowUp',
39: 'ArrowRight',
40: 'ArrowDown',
45: 'Insert',
46: 'Delete',
112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
144: 'NumLock',
145: 'ScrollLock',
224: 'Meta'
};
/**
* @param {object} nativeEvent Native browser event.
* @return {string} Normalized `key` property.
*/
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`), ignore it.
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
if (key !== 'Unidentified') {
return key;
}
}
// Browser does not implement `key`, polyfill as much of it as we can.
if (nativeEvent.type === 'keypress') {
var charCode = getEventCharCode(nativeEvent);
// The enter-key is technically both printable and non-printable and can
// thus be captured by `keypress`, no other non-printable key should.
return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
}
if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
// While user keyboard layout determines the actual meaning of each
// `keyCode` value, almost all function keys have a universal value.
return translateToKey[nativeEvent.keyCode] || 'Unidentified';
}
return '';
}
module.exports = getEventKey;
/***/ },
/* 138 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticDragEvent
* @typechecks static-only
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(86);
/**
* @interface DragEvent
* @see path_to_url
*/
var DragEventInterface = {
dataTransfer: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
module.exports = SyntheticDragEvent;
/***/ },
/* 139 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticTouchEvent
* @typechecks static-only
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(87);
var getEventModifierState = __webpack_require__(88);
/**
* @interface TouchEvent
* @see path_to_url
*/
var TouchEventInterface = {
touches: null,
targetTouches: null,
changedTouches: null,
altKey: null,
metaKey: null,
ctrlKey: null,
shiftKey: null,
getModifierState: getEventModifierState
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
module.exports = SyntheticTouchEvent;
/***/ },
/* 140 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SyntheticWheelEvent
* @typechecks static-only
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(86);
/**
* @interface WheelEvent
* @see path_to_url
*/
var WheelEventInterface = {
deltaX: function (event) {
return 'deltaX' in event ? event.deltaX :
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
},
deltaY: function (event) {
return 'deltaY' in event ? event.deltaY :
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
'wheelDeltaY' in event ? -event.wheelDeltaY :
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
'wheelDelta' in event ? -event.wheelDelta : 0;
},
deltaZ: null,
// Browsers without "deltaMode" is reporting in raw wheel delta where one
// notch on the scroll is always +/- 120, roughly equivalent to pixels.
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
deltaMode: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticMouseEvent}
*/
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
module.exports = SyntheticWheelEvent;
/***/ },
/* 141 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule SVGDOMPropertyConfig
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
var NS = {
xlink: 'path_to_url
xml: 'path_to_url
};
var SVGDOMPropertyConfig = {
Properties: {
clipPath: MUST_USE_ATTRIBUTE,
cx: MUST_USE_ATTRIBUTE,
cy: MUST_USE_ATTRIBUTE,
d: MUST_USE_ATTRIBUTE,
dx: MUST_USE_ATTRIBUTE,
dy: MUST_USE_ATTRIBUTE,
fill: MUST_USE_ATTRIBUTE,
fillOpacity: MUST_USE_ATTRIBUTE,
fontFamily: MUST_USE_ATTRIBUTE,
fontSize: MUST_USE_ATTRIBUTE,
fx: MUST_USE_ATTRIBUTE,
fy: MUST_USE_ATTRIBUTE,
gradientTransform: MUST_USE_ATTRIBUTE,
gradientUnits: MUST_USE_ATTRIBUTE,
markerEnd: MUST_USE_ATTRIBUTE,
markerMid: MUST_USE_ATTRIBUTE,
markerStart: MUST_USE_ATTRIBUTE,
offset: MUST_USE_ATTRIBUTE,
opacity: MUST_USE_ATTRIBUTE,
patternContentUnits: MUST_USE_ATTRIBUTE,
patternUnits: MUST_USE_ATTRIBUTE,
points: MUST_USE_ATTRIBUTE,
preserveAspectRatio: MUST_USE_ATTRIBUTE,
r: MUST_USE_ATTRIBUTE,
rx: MUST_USE_ATTRIBUTE,
ry: MUST_USE_ATTRIBUTE,
spreadMethod: MUST_USE_ATTRIBUTE,
stopColor: MUST_USE_ATTRIBUTE,
stopOpacity: MUST_USE_ATTRIBUTE,
stroke: MUST_USE_ATTRIBUTE,
strokeDasharray: MUST_USE_ATTRIBUTE,
strokeLinecap: MUST_USE_ATTRIBUTE,
strokeOpacity: MUST_USE_ATTRIBUTE,
strokeWidth: MUST_USE_ATTRIBUTE,
textAnchor: MUST_USE_ATTRIBUTE,
transform: MUST_USE_ATTRIBUTE,
version: MUST_USE_ATTRIBUTE,
viewBox: MUST_USE_ATTRIBUTE,
x1: MUST_USE_ATTRIBUTE,
x2: MUST_USE_ATTRIBUTE,
x: MUST_USE_ATTRIBUTE,
xlinkActuate: MUST_USE_ATTRIBUTE,
xlinkArcrole: MUST_USE_ATTRIBUTE,
xlinkHref: MUST_USE_ATTRIBUTE,
xlinkRole: MUST_USE_ATTRIBUTE,
xlinkShow: MUST_USE_ATTRIBUTE,
xlinkTitle: MUST_USE_ATTRIBUTE,
xlinkType: MUST_USE_ATTRIBUTE,
xmlBase: MUST_USE_ATTRIBUTE,
xmlLang: MUST_USE_ATTRIBUTE,
xmlSpace: MUST_USE_ATTRIBUTE,
y1: MUST_USE_ATTRIBUTE,
y2: MUST_USE_ATTRIBUTE,
y: MUST_USE_ATTRIBUTE
},
DOMAttributeNamespaces: {
xlinkActuate: NS.xlink,
xlinkArcrole: NS.xlink,
xlinkHref: NS.xlink,
xlinkRole: NS.xlink,
xlinkShow: NS.xlink,
xlinkTitle: NS.xlink,
xlinkType: NS.xlink,
xmlBase: NS.xml,
xmlLang: NS.xml,
xmlSpace: NS.xml
},
DOMAttributeNames: {
clipPath: 'clip-path',
fillOpacity: 'fill-opacity',
fontFamily: 'font-family',
fontSize: 'font-size',
gradientTransform: 'gradientTransform',
gradientUnits: 'gradientUnits',
markerEnd: 'marker-end',
markerMid: 'marker-mid',
markerStart: 'marker-start',
patternContentUnits: 'patternContentUnits',
patternUnits: 'patternUnits',
preserveAspectRatio: 'preserveAspectRatio',
spreadMethod: 'spreadMethod',
stopColor: 'stop-color',
stopOpacity: 'stop-opacity',
strokeDasharray: 'stroke-dasharray',
strokeLinecap: 'stroke-linecap',
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
textAnchor: 'text-anchor',
viewBox: 'viewBox',
xlinkActuate: 'xlink:actuate',
xlinkArcrole: 'xlink:arcrole',
xlinkHref: 'xlink:href',
xlinkRole: 'xlink:role',
xlinkShow: 'xlink:show',
xlinkTitle: 'xlink:title',
xlinkType: 'xlink:type',
xmlBase: 'xml:base',
xmlLang: 'xml:lang',
xmlSpace: 'xml:space'
}
};
module.exports = SVGDOMPropertyConfig;
/***/ },
/* 142 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactDefaultPerf
* @typechecks static-only
*/
'use strict';
var DOMProperty = __webpack_require__(23);
var ReactDefaultPerfAnalysis = __webpack_require__(143);
var ReactMount = __webpack_require__(28);
var ReactPerf = __webpack_require__(18);
var performanceNow = __webpack_require__(144);
function roundFloat(val) {
return Math.floor(val * 100) / 100;
}
function addValue(obj, key, val) {
obj[key] = (obj[key] || 0) + val;
}
var ReactDefaultPerf = {
_allMeasurements: [], // last item in the list is the current one
_mountStack: [0],
_injected: false,
start: function () {
if (!ReactDefaultPerf._injected) {
ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
}
ReactDefaultPerf._allMeasurements.length = 0;
ReactPerf.enableMeasure = true;
},
stop: function () {
ReactPerf.enableMeasure = false;
},
getLastMeasurements: function () {
return ReactDefaultPerf._allMeasurements;
},
printExclusive: function (measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
console.table(summary.map(function (item) {
return {
'Component class name': item.componentName,
'Total inclusive time (ms)': roundFloat(item.inclusive),
'Exclusive mount time (ms)': roundFloat(item.exclusive),
'Exclusive render time (ms)': roundFloat(item.render),
'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
'Render time per instance (ms)': roundFloat(item.render / item.count),
'Instances': item.count
};
}));
// TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
// number.
},
printInclusive: function (measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
console.table(summary.map(function (item) {
return {
'Owner > component': item.componentName,
'Inclusive time (ms)': roundFloat(item.time),
'Instances': item.count
};
}));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
},
getMeasurementsSummaryMap: function (measurements) {
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
return summary.map(function (item) {
return {
'Owner > component': item.componentName,
'Wasted time (ms)': item.time,
'Instances': item.count
};
});
},
printWasted: function (measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
},
printDOM: function (measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
console.table(summary.map(function (item) {
var result = {};
result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
result.type = item.type;
result.args = JSON.stringify(item.args);
return result;
}));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
},
_recordWrite: function (id, fnName, totalTime, args) {
// TODO: totalTime isn't that useful since it doesn't count paints/reflows
var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes;
writes[id] = writes[id] || [];
writes[id].push({
type: fnName,
time: totalTime,
args: args
});
},
measure: function (moduleName, fnName, func) {
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var totalTime;
var rv;
var start;
if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') {
// A "measurement" is a set of metrics recorded for each flush. We want
// to group the metrics for a given flush together so we can look at the
// components that rendered and the DOM operations that actually
// happened to determine the amount of "wasted work" performed.
ReactDefaultPerf._allMeasurements.push({
exclusive: {},
inclusive: {},
render: {},
counts: {},
writes: {},
displayNames: {},
totalTime: 0,
created: {}
});
start = performanceNow();
rv = func.apply(this, args);
ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start;
return rv;
} else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') {
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
if (fnName === '_mountImageIntoNode') {
var mountID = ReactMount.getID(args[1]);
ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
} else if (fnName === 'dangerouslyProcessChildrenUpdates') {
// special format
args[0].forEach(function (update) {
var writeArgs = {};
if (update.fromIndex !== null) {
writeArgs.fromIndex = update.fromIndex;
}
if (update.toIndex !== null) {
writeArgs.toIndex = update.toIndex;
}
if (update.textContent !== null) {
writeArgs.textContent = update.textContent;
}
if (update.markupIndex !== null) {
writeArgs.markup = args[1][update.markupIndex];
}
ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs);
});
} else {
// basic format
var id = args[0];
if (typeof id === 'object') {
id = ReactMount.getID(args[0]);
}
ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1));
}
return rv;
} else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()?
fnName === '_renderValidatedComponent')) {
if (this._currentElement.type === ReactMount.TopLevelWrapper) {
return func.apply(this, args);
}
var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID;
var isRender = fnName === '_renderValidatedComponent';
var isMount = fnName === 'mountComponent';
var mountStack = ReactDefaultPerf._mountStack;
var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1];
if (isRender) {
addValue(entry.counts, rootNodeID, 1);
} else if (isMount) {
entry.created[rootNodeID] = true;
mountStack.push(0);
}
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
if (isRender) {
addValue(entry.render, rootNodeID, totalTime);
} else if (isMount) {
var subMountTime = mountStack.pop();
mountStack[mountStack.length - 1] += totalTime;
addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
addValue(entry.inclusive, rootNodeID, totalTime);
} else {
addValue(entry.inclusive, rootNodeID, totalTime);
}
entry.displayNames[rootNodeID] = {
current: this.getName(),
owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>'
};
return rv;
} else {
return func.apply(this, args);
}
};
}
};
module.exports = ReactDefaultPerf;
/***/ },
/* 143 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactDefaultPerfAnalysis
*/
'use strict';
var assign = __webpack_require__(39);
// Don't try to save users less than 1.2ms (a number I made up)
var DONT_CARE_THRESHOLD = 1.2;
var DOM_OPERATION_TYPES = {
'_mountImageIntoNode': 'set innerHTML',
INSERT_MARKUP: 'set innerHTML',
MOVE_EXISTING: 'move',
REMOVE_NODE: 'remove',
SET_MARKUP: 'set innerHTML',
TEXT_CONTENT: 'set textContent',
'setValueForProperty': 'update attribute',
'setValueForAttribute': 'update attribute',
'deleteValueForProperty': 'remove attribute',
'setValueForStyles': 'update styles',
'replaceNodeWithMarkup': 'replace',
'updateTextContent': 'set textContent'
};
function getTotalTime(measurements) {
// TODO: return number of DOM ops? could be misleading.
// TODO: measure dropped frames after reconcile?
// TODO: log total time of each reconcile and the top-level component
// class that triggered it.
var totalTime = 0;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
totalTime += measurement.totalTime;
}
return totalTime;
}
function getDOMSummary(measurements) {
var items = [];
measurements.forEach(function (measurement) {
Object.keys(measurement.writes).forEach(function (id) {
measurement.writes[id].forEach(function (write) {
items.push({
id: id,
type: DOM_OPERATION_TYPES[write.type] || write.type,
args: write.args
});
});
});
});
return items;
}
function getExclusiveSummary(measurements) {
var candidates = {};
var displayName;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
for (var id in allIDs) {
displayName = measurement.displayNames[id].current;
candidates[displayName] = candidates[displayName] || {
componentName: displayName,
inclusive: 0,
exclusive: 0,
render: 0,
count: 0
};
if (measurement.render[id]) {
candidates[displayName].render += measurement.render[id];
}
if (measurement.exclusive[id]) {
candidates[displayName].exclusive += measurement.exclusive[id];
}
if (measurement.inclusive[id]) {
candidates[displayName].inclusive += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[displayName].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (displayName in candidates) {
if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
arr.push(candidates[displayName]);
}
}
arr.sort(function (a, b) {
return b.exclusive - a.exclusive;
});
return arr;
}
function getInclusiveSummary(measurements, onlyClean) {
var candidates = {};
var inclusiveKey;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
var cleanComponents;
if (onlyClean) {
cleanComponents = getUnchangedComponents(measurement);
}
for (var id in allIDs) {
if (onlyClean && !cleanComponents[id]) {
continue;
}
var displayName = measurement.displayNames[id];
// Inclusive time is not useful for many components without knowing where
// they are instantiated. So we aggregate inclusive time with both the
// owner and current displayName as the key.
inclusiveKey = displayName.owner + ' > ' + displayName.current;
candidates[inclusiveKey] = candidates[inclusiveKey] || {
componentName: inclusiveKey,
time: 0,
count: 0
};
if (measurement.inclusive[id]) {
candidates[inclusiveKey].time += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[inclusiveKey].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (inclusiveKey in candidates) {
if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
arr.push(candidates[inclusiveKey]);
}
}
arr.sort(function (a, b) {
return b.time - a.time;
});
return arr;
}
function getUnchangedComponents(measurement) {
// For a given reconcile, look at which components did not actually
// render anything to the DOM and return a mapping of their ID to
// the amount of time it took to render the entire subtree.
var cleanComponents = {};
var dirtyLeafIDs = Object.keys(measurement.writes);
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
for (var id in allIDs) {
var isDirty = false;
// For each component that rendered, see if a component that triggered
// a DOM op is in its subtree.
for (var i = 0; i < dirtyLeafIDs.length; i++) {
if (dirtyLeafIDs[i].indexOf(id) === 0) {
isDirty = true;
break;
}
}
// check if component newly created
if (measurement.created[id]) {
isDirty = true;
}
if (!isDirty && measurement.counts[id] > 0) {
cleanComponents[id] = true;
}
}
return cleanComponents;
}
var ReactDefaultPerfAnalysis = {
getExclusiveSummary: getExclusiveSummary,
getInclusiveSummary: getInclusiveSummary,
getDOMSummary: getDOMSummary,
getTotalTime: getTotalTime
};
module.exports = ReactDefaultPerfAnalysis;
/***/ },
/* 144 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule performanceNow
* @typechecks
*/
'use strict';
var performance = __webpack_require__(145);
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 () {
return performance.now();
};
} else {
performanceNow = function () {
return Date.now();
};
}
module.exports = performanceNow;
/***/ },
/* 145 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule performance
* @typechecks
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(9);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.webkitPerformance;
}
module.exports = performance || {};
/***/ },
/* 146 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactVersion
*/
'use strict';
module.exports = '0.14.6';
/***/ },
/* 147 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule renderSubtreeIntoContainer
*/
'use strict';
var ReactMount = __webpack_require__(28);
module.exports = ReactMount.renderSubtreeIntoContainer;
/***/ },
/* 148 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactDOMServer
*/
'use strict';
var ReactDefaultInjection = __webpack_require__(71);
var ReactServerRendering = __webpack_require__(149);
var ReactVersion = __webpack_require__(146);
ReactDefaultInjection.inject();
var ReactDOMServer = {
renderToString: ReactServerRendering.renderToString,
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
version: ReactVersion
};
module.exports = ReactDOMServer;
/***/ },
/* 149 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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
* @providesModule ReactServerRendering
*/
'use strict';
var ReactDefaultBatchingStrategy = __webpack_require__(92);
var ReactElement = __webpack_require__(42);
var ReactInstanceHandles = __webpack_require__(45);
var ReactMarkupChecksum = __webpack_require__(48);
var ReactServerBatchingStrategy = __webpack_require__(150);
var ReactServerRenderingTransaction = __webpack_require__(151);
var ReactUpdates = __webpack_require__(54);
var emptyObject = __webpack_require__(58);
var instantiateReactComponent = __webpack_require__(62);
var invariant = __webpack_require__(13);
/**
* @param {ReactElement} element
* @return {string} the HTML markup
*/
function renderToString(element) {
!ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined;
var transaction;
try {
ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
var id = ReactInstanceHandles.createReactRootID();
transaction = ReactServerRenderingTransaction.getPooled(false);
return transaction.perform(function () {
var componentInstance = instantiateReactComponent(element, null);
var markup = componentInstance.mountComponent(id, transaction, emptyObject);
return ReactMarkupChecksum.addChecksumToMarkup(markup);
}, null);
} finally {
ReactServerRenderingTransaction.release(transaction);
// Revert to the DOM batching strategy since these two renderers
// currently share these stateful modules.
ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
}
}
/**
* @param {ReactElement} element
* @return {string} the HTML markup, without the extra React ID and checksum
* (for generating static pages)
*/
function renderToStaticMarkup(element) {
!ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined;
var transaction;
try {
ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
var id = ReactInstanceHandles.createReactRootID();
transaction = ReactServerRenderingTransaction.getPooled(true);
return transaction.perform(function () {
var componentInstance = instantiateReactComponent(element, null);
return componentInstance.mountComponent(id, transaction, emptyObject);
}, null);
} finally {
ReactServerRenderingTransaction.release(transaction);
// Revert to the DOM batching strategy since these two renderers
// currently share these stateful modules.
ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
}
}
module.exports = {
renderToString: renderToString,
renderToStaticMarkup: renderToStaticMarkup
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 150 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactServerBatchingStrategy
* @typechecks
*/
'use strict';
var ReactServerBatchingStrategy = {
isBatchingUpdates: false,
batchedUpdates: function (callback) {
// Don't do anything here. During the server rendering we don't want to
// schedule any updates. We will simply ignore them.
}
};
module.exports = ReactServerBatchingStrategy;
/***/ },
/* 151 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule ReactServerRenderingTransaction
* @typechecks
*/
'use strict';
var PooledClass = __webpack_require__(56);
var CallbackQueue = __webpack_require__(55);
var Transaction = __webpack_require__(57);
var assign = __webpack_require__(39);
var emptyFunction = __webpack_require__(15);
/**
* Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
* during the performing of the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function () {
this.reactMountReady.reset();
},
close: emptyFunction
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
/**
* @class ReactServerRenderingTransaction
* @param {boolean} renderToStaticMarkup
*/
function ReactServerRenderingTransaction(renderToStaticMarkup) {
this.reinitializeTransaction();
this.renderToStaticMarkup = renderToStaticMarkup;
this.reactMountReady = CallbackQueue.getPooled(null);
this.useCreateElement = false;
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array} Empty list of operation wrap procedures.
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return this.reactMountReady;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be reused.
*/
destructor: function () {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
}
};
assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
PooledClass.addPoolingTo(ReactServerRenderingTransaction);
module.exports = ReactServerRenderingTransaction;
/***/ },
/* 152 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactIsomorphic
*/
'use strict';
var ReactChildren = __webpack_require__(110);
var ReactComponent = __webpack_require__(123);
var ReactClass = __webpack_require__(122);
var ReactDOMFactories = __webpack_require__(153);
var ReactElement = __webpack_require__(42);
var ReactElementValidator = __webpack_require__(154);
var ReactPropTypes = __webpack_require__(107);
var ReactVersion = __webpack_require__(146);
var assign = __webpack_require__(39);
var onlyChild = __webpack_require__(156);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (process.env.NODE_ENV !== 'production') {
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var React = {
// Modern
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
count: ReactChildren.count,
toArray: ReactChildren.toArray,
only: onlyChild
},
Component: ReactComponent,
createElement: createElement,
cloneElement: cloneElement,
isValidElement: ReactElement.isValidElement,
// Classic
PropTypes: ReactPropTypes,
createClass: ReactClass.createClass,
createFactory: createFactory,
createMixin: function (mixin) {
// Currently a noop. Will be used to validate and trace mixins.
return mixin;
},
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.
DOM: ReactDOMFactories,
version: ReactVersion,
// Hook for JSX spread, don't use this for anything else.
__spread: assign
};
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 153 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactDOMFactories
* @typechecks static-only
*/
'use strict';
var ReactElement = __webpack_require__(42);
var ReactElementValidator = __webpack_require__(154);
var mapObject = __webpack_require__(155);
/**
* Create a factory that creates HTML tag elements.
*
* @param {string} tag Tag name (e.g. `div`).
* @private
*/
function createDOMFactory(tag) {
if (process.env.NODE_ENV !== 'production') {
return ReactElementValidator.createFactory(tag);
}
return ReactElement.createFactory(tag);
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
* This is also accessible via `React.DOM`.
*
* @public
*/
var ReactDOMFactories = mapObject({
a: 'a',
abbr: 'abbr',
address: 'address',
area: 'area',
article: 'article',
aside: 'aside',
audio: 'audio',
b: 'b',
base: 'base',
bdi: 'bdi',
bdo: 'bdo',
big: 'big',
blockquote: 'blockquote',
body: 'body',
br: 'br',
button: 'button',
canvas: 'canvas',
caption: 'caption',
cite: 'cite',
code: 'code',
col: 'col',
colgroup: 'colgroup',
data: 'data',
datalist: 'datalist',
dd: 'dd',
del: 'del',
details: 'details',
dfn: 'dfn',
dialog: 'dialog',
div: 'div',
dl: 'dl',
dt: 'dt',
em: 'em',
embed: 'embed',
fieldset: 'fieldset',
figcaption: 'figcaption',
figure: 'figure',
footer: 'footer',
form: 'form',
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
h6: 'h6',
head: 'head',
header: 'header',
hgroup: 'hgroup',
hr: 'hr',
html: 'html',
i: 'i',
iframe: 'iframe',
img: 'img',
input: 'input',
ins: 'ins',
kbd: 'kbd',
keygen: 'keygen',
label: 'label',
legend: 'legend',
li: 'li',
link: 'link',
main: 'main',
map: 'map',
mark: 'mark',
menu: 'menu',
menuitem: 'menuitem',
meta: 'meta',
meter: 'meter',
nav: 'nav',
noscript: 'noscript',
object: 'object',
ol: 'ol',
optgroup: 'optgroup',
option: 'option',
output: 'output',
p: 'p',
param: 'param',
picture: 'picture',
pre: 'pre',
progress: 'progress',
q: 'q',
rp: 'rp',
rt: 'rt',
ruby: 'ruby',
s: 's',
samp: 'samp',
script: 'script',
section: 'section',
select: 'select',
small: 'small',
source: 'source',
span: 'span',
strong: 'strong',
style: 'style',
sub: 'sub',
summary: 'summary',
sup: 'sup',
table: 'table',
tbody: 'tbody',
td: 'td',
textarea: 'textarea',
tfoot: 'tfoot',
th: 'th',
thead: 'thead',
time: 'time',
title: 'title',
tr: 'tr',
track: 'track',
u: 'u',
ul: 'ul',
'var': 'var',
video: 'video',
wbr: 'wbr',
// SVG
circle: 'circle',
clipPath: 'clipPath',
defs: 'defs',
ellipse: 'ellipse',
g: 'g',
image: 'image',
line: 'line',
linearGradient: 'linearGradient',
mask: 'mask',
path: 'path',
pattern: 'pattern',
polygon: 'polygon',
polyline: 'polyline',
radialGradient: 'radialGradient',
rect: 'rect',
stop: 'stop',
svg: 'svg',
text: 'text',
tspan: 'tspan'
}, createDOMFactory);
module.exports = ReactDOMFactories;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 154 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule ReactElementValidator
*/
/**
* ReactElementValidator provides a wrapper around a element factory
* which validates the props passed to the element. This is intended to be
* used only in DEV and could be replaced by a static type checker for languages
* that support it.
*/
'use strict';
var ReactElement = __webpack_require__(42);
var ReactPropTypeLocations = __webpack_require__(65);
var ReactPropTypeLocationNames = __webpack_require__(66);
var ReactCurrentOwner = __webpack_require__(5);
var canDefineProperty = __webpack_require__(43);
var getIteratorFn = __webpack_require__(108);
var invariant = __webpack_require__(13);
var warning = __webpack_require__(25);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Warn if there's no key explicitly set on dynamic arrays of children or
* object keys are not valid. This allows us to keep track of children between
* updates.
*/
var ownerHasKeyUseWarning = {};
var loggedTypeFailures = {};
/**
* Warn if the element doesn't have an explicit key assigned to it.
* This element is in an array. The array could grow and shrink or be
* reordered. All children that haven't already been validated are required to
* have a "key" property assigned to it.
*
* @internal
* @param {ReactElement} element Element that requires a key.
* @param {*} parentType element's parent's type.
*/
function validateExplicitKey(element, parentType) {
if (!element._store || element._store.validated || element.key != null) {
return;
}
element._store.validated = true;
var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
if (addenda === null) {
// we already showed the warning
return;
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
}
/**
* Shared warning and monitoring code for the key warnings.
*
* @internal
* @param {string} messageType A key used for de-duping warnings.
* @param {ReactElement} element Component that requires a key.
* @param {*} parentType element's parent's type.
* @returns {?object} A set of addenda to use in the warning message, or null
* if the warning has already been shown before (and shouldn't be shown again).
*/
function getAddendaForKeyUse(messageType, element, parentType) {
var addendum = getDeclarationErrorAddendum();
if (!addendum) {
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
if (parentName) {
addendum = ' Check the top-level render call using <' + parentName + '>.';
}
}
var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
if (memoizer[addendum]) {
return null;
}
memoizer[addendum] = true;
var addenda = {
parentOrOwner: addendum,
url: ' See path_to_url for more information.',
childOwner: null
};
// Usually the current owner is the offender, but if it accepts children as a
// property, it may be the creator of the child that's responsible for
// assigning it a key.
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
// Give the component that originally created this child.
addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
}
return addenda;
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
function validateChildKeys(node, parentType) {
if (typeof node !== 'object') {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (ReactElement.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (ReactElement.isValidElement(node)) {
// This element was passed in a valid location.
if (node._store) {
node._store.validated = true;
}
} else if (node) {
var iteratorFn = getIteratorFn(node);
// Entry iterators provide implicit keys.
if (iteratorFn) {
if (iteratorFn !== node.entries) {
var iterator = iteratorFn.call(node);
var step;
while (!(step = iterator.next()).done) {
if (ReactElement.isValidElement(step.value)) {
validateExplicitKey(step.value, parentType);
}
}
}
}
}
}
/**
* Assert that the props are valid
*
* @param {string} componentName Name of the component for error messages.
* @param {object} propTypes Map of prop name to a ReactPropType
* @param {object} props
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
function checkPropTypes(componentName, propTypes, props, location) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
!(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
error = propTypes[propName](props, propName, componentName, location);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var addendum = getDeclarationErrorAddendum();
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
* provided by the type.
*
* @param {ReactElement} element
*/
function validatePropTypes(element) {
var componentClass = element.type;
if (typeof componentClass !== 'function') {
return;
}
var name = componentClass.displayName || componentClass.name;
if (componentClass.propTypes) {
checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
}
if (typeof componentClass.getDefaultProps === 'function') {
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
}
}
var ReactElementValidator = {
createElement: function (type, props, children) {
var validType = typeof type === 'string' || typeof type === 'function';
// We warn in this case but don't throw. We expect the element creation to
// succeed and there will likely be errors in render.
process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
var element = ReactElement.createElement.apply(this, arguments);
// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if (element == null) {
return element;
}
// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
// fixed, the key warnings will appear.)
if (validType) {
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], type);
}
}
validatePropTypes(element);
return element;
},
createFactory: function (type) {
var validatedFactory = ReactElementValidator.createElement.bind(null, type);
// Legacy hook TODO: Warn if this is accessed
validatedFactory.type = type;
if (process.env.NODE_ENV !== 'production') {
if (canDefineProperty) {
Object.defineProperty(validatedFactory, 'type', {
enumerable: false,
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
Object.defineProperty(this, 'type', {
value: type
});
return type;
}
});
}
}
return validatedFactory;
},
cloneElement: function (element, props, children) {
var newElement = ReactElement.cloneElement.apply(this, arguments);
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], newElement.type);
}
validatePropTypes(newElement);
return newElement;
}
};
module.exports = ReactElementValidator;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 155 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule mapObject
*/
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Executes the provided `callback` once for each enumerable own property in the
* object and constructs a new object from the results. The `callback` is
* invoked with three arguments:
*
* - the property value
* - the property name
* - the object being traversed
*
* Properties that are added after the call to `mapObject` will not be visited
* by `callback`. If the values of existing properties are changed, the value
* passed to `callback` will be the value at the time `mapObject` visits them.
* Properties that are deleted before being visited are not visited.
*
* @grep function objectMap()
* @grep function objMap()
*
* @param {?object} object
* @param {function} callback
* @param {*} context
* @return {?object}
*/
function mapObject(object, callback, context) {
if (!object) {
return null;
}
var result = {};
for (var name in object) {
if (hasOwnProperty.call(object, name)) {
result[name] = callback.call(context, object[name], name, object);
}
}
return result;
}
module.exports = mapObject;
/***/ },
/* 156 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule onlyChild
*/
'use strict';
var ReactElement = __webpack_require__(42);
var invariant = __webpack_require__(13);
/**
* Returns the first child in a collection of children and verifies that there
* is only one child in the collection. The current implementation of this
* function assumes that a single child gets passed without a wrapper, but the
* purpose of this helper function is to abstract away the particular structure
* of children.
*
* @param {?object} children Child collection structure.
* @return {ReactComponent} The first and only `ReactComponent` contained in the
* structure.
*/
function onlyChild(children) {
!ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
return children;
}
module.exports = onlyChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 157 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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.
*
* @providesModule deprecated
*/
'use strict';
var assign = __webpack_require__(39);
var warning = __webpack_require__(25);
/**
* This will log a single deprecation notice per function and forward the call
* on to the new API.
*
* @param {string} fnName The name of the function
* @param {string} newModule The module that fn will exist in
* @param {string} newPackage The module that fn will exist in
* @param {*} ctx The context this forwarded call should run in
* @param {function} fn The function to forward on to
* @return {function} The function that will warn once and then call fn
*/
function deprecated(fnName, newModule, newPackage, ctx, fn) {
var warned = false;
if (process.env.NODE_ENV !== 'production') {
var newFn = function () {
process.env.NODE_ENV !== 'production' ? warning(warned,
// Require examples in this string must be split to prevent React's
// build tools from mistaking them for real requires.
// Otherwise the build tools will attempt to build a '%s' module.
'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
warned = true;
return fn.apply(ctx, arguments);
};
// We need to make sure all properties of the original fn are copied over.
// In particular, this is needed to support PropTypes
return assign(newFn, fn);
}
return fn;
}
module.exports = deprecated;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 158 */,
/* 159 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createStore = __webpack_require__(160);
var _createStore2 = _interopRequireDefault(_createStore);
var _utilsCombineReducers = __webpack_require__(162);
var _utilsCombineReducers2 = _interopRequireDefault(_utilsCombineReducers);
var _utilsBindActionCreators = __webpack_require__(165);
var _utilsBindActionCreators2 = _interopRequireDefault(_utilsBindActionCreators);
var _utilsApplyMiddleware = __webpack_require__(166);
var _utilsApplyMiddleware2 = _interopRequireDefault(_utilsApplyMiddleware);
var _utilsCompose = __webpack_require__(167);
var _utilsCompose2 = _interopRequireDefault(_utilsCompose);
exports.createStore = _createStore2['default'];
exports.combineReducers = _utilsCombineReducers2['default'];
exports.bindActionCreators = _utilsBindActionCreators2['default'];
exports.applyMiddleware = _utilsApplyMiddleware2['default'];
exports.compose = _utilsCompose2['default'];
/***/ },
/* 160 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports['default'] = createStore;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _utilsIsPlainObject = __webpack_require__(161);
var _utilsIsPlainObject2 = _interopRequireDefault(_utilsIsPlainObject);
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var ActionTypes = {
INIT: '@@redux/INIT'
};
exports.ActionTypes = ActionTypes;
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [initialState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
function createStore(reducer, initialState) {
if (typeof reducer !== 'function') {
throw new Error('Expected the reducer to be a function.');
}
var currentReducer = reducer;
var currentState = initialState;
var listeners = [];
var isDispatching = false;
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
listeners.push(listener);
var isSubscribed = true;
return function unsubscribe() {
if (!isSubscribed) {
return;
}
isSubscribed = false;
var index = listeners.indexOf(listener);
listeners.splice(index, 1);
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing what changed. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!_utilsIsPlainObject2['default'](action)) {
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
}
if (typeof action.type === 'undefined') {
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
}
if (isDispatching) {
throw new Error('Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
listeners.slice().forEach(function (listener) {
return listener();
});
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
currentReducer = nextReducer;
dispatch({ type: ActionTypes.INIT });
}
// When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({ type: ActionTypes.INIT });
return {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
};
}
/***/ },
/* 161 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports['default'] = isPlainObject;
var fnToString = function fnToString(fn) {
return Function.prototype.toString.call(fn);
};
var objStringValue = fnToString(Object);
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (!obj || typeof obj !== 'object') {
return false;
}
var proto = typeof obj.constructor === 'function' ? Object.getPrototypeOf(obj) : Object.prototype;
if (proto === null) {
return true;
}
var constructor = proto.constructor;
return typeof constructor === 'function' && constructor instanceof constructor && fnToString(constructor) === objStringValue;
}
module.exports = exports['default'];
/***/ },
/* 162 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports['default'] = combineReducers;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createStore = __webpack_require__(160);
var _isPlainObject = __webpack_require__(161);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _mapValues = __webpack_require__(163);
var _mapValues2 = _interopRequireDefault(_mapValues);
var _pick = __webpack_require__(164);
var _pick2 = _interopRequireDefault(_pick);
/* eslint-disable no-console */
function getUndefinedStateErrorMessage(key, action) {
var actionType = action && action.type;
var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
return 'Reducer "' + key + '" returned undefined handling ' + actionName + '. ' + 'To ignore an action, you must explicitly return the previous state.';
}
function getUnexpectedStateKeyWarningMessage(inputState, outputState, action) {
var reducerKeys = Object.keys(outputState);
var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!_isPlainObject2['default'](inputState)) {
return 'The ' + argumentName + ' has unexpected type of "' + ({}).toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return reducerKeys.indexOf(key) < 0;
});
if (unexpectedKeys.length > 0) {
return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
}
}
function assertReducerSanity(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
if (typeof initialState === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
}
var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
if (typeof reducer(undefined, { type: type }) === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var finalReducers = _pick2['default'](reducers, function (val) {
return typeof val === 'function';
});
var sanityError;
try {
assertReducerSanity(finalReducers);
} catch (e) {
sanityError = e;
}
var defaultState = _mapValues2['default'](finalReducers, function () {
return undefined;
});
return function combination(state, action) {
if (state === undefined) state = defaultState;
if (sanityError) {
throw sanityError;
}
var hasChanged = false;
var finalState = _mapValues2['default'](finalReducers, function (reducer, key) {
var previousStateForKey = state[key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var errorMessage = getUndefinedStateErrorMessage(key, action);
throw new Error(errorMessage);
}
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
return nextStateForKey;
});
if (process.env.NODE_ENV !== 'production') {
var warningMessage = getUnexpectedStateKeyWarningMessage(state, finalState, action);
if (warningMessage) {
console.error(warningMessage);
}
}
return hasChanged ? finalState : state;
};
}
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 163 */
/***/ function(module, exports) {
/**
* Applies a function to every key-value pair inside an object.
*
* @param {Object} obj The source object.
* @param {Function} fn The mapper function that receives the value and the key.
* @returns {Object} A new object that contains the mapped values for the keys.
*/
"use strict";
exports.__esModule = true;
exports["default"] = mapValues;
function mapValues(obj, fn) {
return Object.keys(obj).reduce(function (result, key) {
result[key] = fn(obj[key], key);
return result;
}, {});
}
module.exports = exports["default"];
/***/ },
/* 164 */
/***/ function(module, exports) {
/**
* Picks key-value pairs from an object where values satisfy a predicate.
*
* @param {Object} obj The object to pick from.
* @param {Function} fn The predicate the values must satisfy to be copied.
* @returns {Object} The object with the values that satisfied the predicate.
*/
"use strict";
exports.__esModule = true;
exports["default"] = pick;
function pick(obj, fn) {
return Object.keys(obj).reduce(function (result, key) {
if (fn(obj[key])) {
result[key] = obj[key];
}
return result;
}, {});
}
module.exports = exports["default"];
/***/ },
/* 165 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports['default'] = bindActionCreators;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _mapValues = __webpack_require__(163);
var _mapValues2 = _interopRequireDefault(_mapValues);
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(undefined, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass a single function as the first argument,
* and get a function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null || actionCreators === undefined) {
throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
}
return _mapValues2['default'](actionCreators, function (actionCreator) {
return bindActionCreator(actionCreator, dispatch);
});
}
module.exports = exports['default'];
/***/ },
/* 166 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports['default'] = applyMiddleware;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _compose = __webpack_require__(167);
var _compose2 = _interopRequireDefault(_compose);
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (next) {
return function (reducer, initialState) {
var store = next(reducer, initialState);
var _dispatch = store.dispatch;
var chain = [];
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch(action) {
return _dispatch(action);
}
};
chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
return _extends({}, store, {
dispatch: _dispatch
});
};
};
}
module.exports = exports['default'];
/***/ },
/* 167 */
/***/ function(module, exports) {
/**
* Composes single-argument functions from right to left.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing functions from right to
* left. For example, compose(f, g, h) is identical to arg => f(g(h(arg))).
*/
"use strict";
exports.__esModule = true;
exports["default"] = compose;
function compose() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
return function (arg) {
return funcs.reduceRight(function (composed, f) {
return f(composed);
}, arg);
};
}
module.exports = exports["default"];
/***/ }
/******/ ]);
```
|
```c++
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#if defined(__EMSCRIPTEN__)
#include "osfiber_emscripten.h"
#include "marl/export.h"
extern "C" {
MARL_EXPORT
void marl_fiber_trampoline(void (*target)(void*), void* arg) {
target(arg);
}
MARL_EXPORT
void marl_main_fiber_init(marl_fiber_context* ctx) {
emscripten_fiber_init_from_current_context(
&ctx->context,
ctx->asyncify_stack.data(),
ctx->asyncify_stack.size());
}
MARL_EXPORT
void marl_fiber_set_target(marl_fiber_context* ctx,
void* stack,
uint32_t stack_size,
void (*target)(void*),
void* arg) {
emscripten_fiber_init(
&ctx->context,
target,
arg,
stack,
stack_size,
ctx->asyncify_stack.data(),
ctx->asyncify_stack.size());
}
MARL_EXPORT
extern void marl_fiber_swap(marl_fiber_context* from,
const marl_fiber_context* to) {
emscripten_fiber_swap(&from->context, const_cast<emscripten_fiber_t*>(&to->context));
}
}
#endif // defined(__EMSCRIPTEN__)
```
|
```java
package swati4star.createpdf.util;
import java.io.File;
import java.util.Date;
public class FileInfoUtils {
// GET PDF DETAILS
/**
* Gives a formatted last modified date for pdf ListView
*
* @param file file object whose last modified date is to be returned
* @return String date modified in formatted form
**/
public static String getFormattedDate(File file) {
Date lastModDate = new Date(file.lastModified());
String[] formatDate = lastModDate.toString().split(" ");
String time = formatDate[3];
String[] formatTime = time.split(":");
String date = formatTime[0] + ":" + formatTime[1];
return formatDate[0] + ", " + formatDate[1] + " " + formatDate[2] + " at " + date;
}
/**
* Gives a formatted size in MB for every pdf in pdf ListView
*
* @param file file object whose size is to be returned
* @return String Size of pdf in formatted form
*/
public static String getFormattedSize(File file) {
return String.format("%.2f MB", (double) file.length() / (1024 * 1024));
}
}
```
|
Sport Club Penedense is a Brazilian football club based in Penedo, Alagoas. The senior team currently doesn't play in any league, having last participated in the Campeonato Alagoano Segunda Divisão in the 2019 season.
History
The club was founded on 3 January 1909. Penedense won the Campeonato Alagoano Second Level in 2000 and in 2004. They finished in the second position in the Campeonato Alagoano Second Level in 2011, losing the competition to CEO and thus they were promoted to the 2012 Campeonato Alagoano.
Achievements
Campeonato Alagoano Second Level:
Winners (3): 2000, 2004, 2023
Stadium
Sport Club Penedense play their home games at Estádio Alfredo Leahy. The stadium has a maximum capacity of 6,000 people.
References
Association football clubs established in 1909
Football clubs in Alagoas
1909 establishments in Brazil
|
```go
package matchers
import (
"fmt"
"github.com/onsi/gomega/format"
)
type HaveLenMatcher struct {
Count int
}
func (matcher *HaveLenMatcher) Match(actual interface{}) (success bool, err error) {
length, ok := lengthOf(actual)
if !ok {
return false, fmt.Errorf("HaveLen matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1))
}
return length == matcher.Count, nil
}
func (matcher *HaveLenMatcher) FailureMessage(actual interface{}) (message string) {
return fmt.Sprintf("Expected\n%s\nto have length %d", format.Object(actual, 1), matcher.Count)
}
func (matcher *HaveLenMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return fmt.Sprintf("Expected\n%s\nnot to have length %d", format.Object(actual, 1), matcher.Count)
}
```
|
```cmake
add_cmake_project(OpenCSG
EXCLUDE_FROM_ALL ON # No need to build this lib by default. Only used in experiment in sandboxes/opencsg
URL path_to_url
URL_HASH SHA256=your_sha256_hash
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
)
set(DEP_OpenCSG_DEPENDS GLEW ZLIB)
```
|
```javascript
!function(e){function t(o){if(i[o])return i[o].exports;var r=i[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],i=this.loggers=[];AFRAME.log=function(o,r){t.push([o,r]),i.forEach(function(e){e.receiveLog(o,r)}),e.console&&console.log("[log:"+(r||"")+"] "+o)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach(function(t){e.receiveLog.apply(e,t)})},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)}),window.onerror=function(t,i,o,r,n){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var i=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),i.channel&&t&&i.channel!==t||i.filter&&e.indexOf(i.filter)===-1||(this.logs.push(e),i.max&&this.logs.length>i.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})}]);
```
|
```xml
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.7.0-alpha01" type="baseline" client="gradle" dependencies="false" name="AGP (8.7.0-alpha01)" variant="all" version="8.7.0-alpha01">
<issue
id="MoshiUsageNonMoshiClassPlatform"
message="Platform type 'Instant' is not natively supported by Moshi."
errorLine1=" @Json(name = "showcased_at") val showcasedAt: Instant,"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/catchup/service/uplabs/model/UplabsModels.kt"
line="25"
column="49"/>
</issue>
<issue
id="MoshiUsageNonMoshiClassPlatform"
message="Platform type 'Instant' is not natively supported by Moshi."
errorLine1=" @Json(name = "created_at") val createdAt: Instant,"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/catchup/service/uplabs/model/UplabsModels.kt"
line="60"
column="45"/>
</issue>
</issues>
```
|
```go
// +build linux aix zos
// +build !js
package logrus
import "golang.org/x/sys/unix"
const ioctlReadTermios = unix.TCGETS
func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
return err == nil
}
```
|
```shell
Use `short` status to make output more compact
Get the most out of **Git**
Git Ignore
GitHub
General **GitHub** workflow
```
|
```dart
import 'dart:collection';
import 'package:charcode/ascii.dart';
import 'package:string_scanner/string_scanner.dart';
import '../ast/ast.dart';
final RegExp _whitespace = RegExp(r'[ \n\r\t]+');
final RegExp _id =
RegExp(r'@?(([A-Za-z][A-Za-z0-9_]*-)*([A-Za-z][A-Za-z0-9_]*))');
final RegExp _string1 = RegExp(
r"'((\\(['\\/bfnrt]|(u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))|([^'\\]))*'");
final RegExp _string2 = RegExp(
r'"((\\(["\\/bfnrt]|(u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))|([^"\\]))*"');
Scanner scan(String text, {sourceUrl, bool asDSX = false}) =>
_Scanner(text, sourceUrl)..scan(asDSX: asDSX);
abstract class Scanner {
List<JaelError> get errors;
List<Token> get tokens;
}
final RegExp _htmlComment = RegExp(r'<!--[^$]*-->');
final Map<Pattern, TokenType> _expressionPatterns = {
//final Map<Pattern, TokenType> _htmlPatterns = {
'{{': TokenType.lDoubleCurly,
'{{-': TokenType.lDoubleCurly,
//
_htmlComment: TokenType.htmlComment,
'!DOCTYPE': TokenType.doctype,
'!doctype': TokenType.doctype,
'<': TokenType.lt,
'>': TokenType.gt,
'/': TokenType.slash,
'=': TokenType.equals,
'!=': TokenType.nequ,
_string1: TokenType.string,
_string2: TokenType.string,
_id: TokenType.id,
//};
//final Map<Pattern, TokenType> _expressionPatterns = {
'}}': TokenType.rDoubleCurly,
// Keywords
'new': TokenType.$new,
// Misc.
'*': TokenType.asterisk,
':': TokenType.colon,
',': TokenType.comma,
'.': TokenType.dot,
'??': TokenType.elvis,
'?.': TokenType.elvis_dot,
'=': TokenType.equals,
'!': TokenType.exclamation,
'-': TokenType.minus,
'%': TokenType.percent,
'+': TokenType.plus,
'[': TokenType.lBracket,
']': TokenType.rBracket,
'{': TokenType.lCurly,
'}': TokenType.rCurly,
'(': TokenType.lParen,
')': TokenType.rParen,
'/': TokenType.slash,
'<': TokenType.lt,
'<=': TokenType.lte,
'>': TokenType.gt,
'>=': TokenType.gte,
'==': TokenType.equ,
'!=': TokenType.nequ,
'=': TokenType.equals,
RegExp(r'-?[0-9]+(\.[0-9]+)?([Ee][0-9]+)?'): TokenType.number,
RegExp(r'0x[A-Fa-f0-9]+'): TokenType.hex,
_string1: TokenType.string,
_string2: TokenType.string,
_id: TokenType.id,
};
class _Scanner implements Scanner {
final List<JaelError> errors = [];
final List<Token> tokens = [];
_ScannerState state = _ScannerState.html;
final Queue<String> openTags = Queue();
SpanScanner _scanner;
_Scanner(String text, sourceUrl) {
_scanner = SpanScanner(text, sourceUrl: sourceUrl);
}
void scan({bool asDSX = false}) {
while (!_scanner.isDone) {
if (state == _ScannerState.html) {
scanHtml(asDSX);
} else if (state == _ScannerState.freeText) {
// Just keep parsing until we hit "</"
var start = _scanner.state, end = start;
while (!_scanner.isDone) {
// Skip through comments
if (_scanner.scan(_htmlComment)) continue;
// Break on {{ or {
if (_scanner.matches(asDSX ? '{' : '{{')) {
state = _ScannerState.html;
//_scanner.position--;
break;
}
var ch = _scanner.readChar();
if (ch == $lt) {
// && !_scanner.isDone) {
if (_scanner.matches('/')) {
// If we reached "</", backtrack and break into HTML
openTags.removeFirst();
_scanner.position--;
state = _ScannerState.html;
break;
} else if (_scanner.matches(_id)) {
// Also break when we reach <foo.
//
// HOWEVER, that is also JavaScript. So we must
// only break in this case when the current tag is NOT "script".
var shouldBreak =
(openTags.isEmpty || openTags.first != 'script');
if (!shouldBreak) {
// Try to see if we are closing a script tag
var replay = _scanner.state;
_scanner
..readChar()
..scan(_whitespace);
//print(_scanner.emptySpan.highlight());
if (_scanner.matches(_id)) {
//print(_scanner.lastMatch[0]);
shouldBreak = _scanner.lastMatch[0] == 'script';
_scanner.position--;
}
if (!shouldBreak) {
_scanner.state = replay;
}
}
if (shouldBreak) {
openTags.removeFirst();
_scanner.position--;
state = _ScannerState.html;
break;
}
}
}
// Otherwise, just add to the "buffer"
end = _scanner.state;
}
var span = _scanner.spanFrom(start, end);
if (span.text.isNotEmpty) {
tokens.add(Token(TokenType.text, span, null));
}
}
}
}
void scanHtml(bool asDSX) {
var brackets = Queue<Token>();
do {
// Only continue if we find a left bracket
if (true) {
// || _scanner.matches('<') || _scanner.matches('{{')) {
var potential = <Token>[];
while (true) {
// Scan whitespace
_scanner.scan(_whitespace);
_expressionPatterns.forEach((pattern, type) {
if (_scanner.matches(pattern)) {
potential.add(Token(type, _scanner.lastSpan, _scanner.lastMatch));
}
});
potential.sort((a, b) => b.span.length.compareTo(a.span.length));
if (potential.isEmpty) break;
var token = potential.first;
tokens.add(token);
_scanner.scan(token.span.text);
if (token.type == TokenType.lt) {
brackets.addFirst(token);
// Try to see if we are at a tag.
var replay = _scanner.state;
_scanner.scan(_whitespace);
if (_scanner.matches(_id)) {
openTags.addFirst(_scanner.lastMatch[0]);
} else {
_scanner.state = replay;
}
} else if (token.type == TokenType.slash) {
// Only push if we're at </foo
if (brackets.isNotEmpty && brackets.first.type == TokenType.lt) {
brackets
..removeFirst()
..addFirst(token);
}
} else if (token.type == TokenType.gt) {
// Only pop the bracket if we're at foo>, </foo> or foo/>
if (brackets.isNotEmpty && brackets.first.type == TokenType.slash) {
// </foo>
brackets.removeFirst();
// Now, ONLY continue parsing HTML if the next character is '<'.
var replay = _scanner.state;
_scanner.scan(_whitespace);
if (!_scanner.matches('<')) {
_scanner.state = replay;
state = _ScannerState.freeText;
break;
}
}
//else if (_scanner.matches('>')) brackets.removeFirst();
else if (brackets.isNotEmpty &&
brackets.first.type == TokenType.lt) {
// We're at foo>, try to parse text?
brackets.removeFirst();
var replay = _scanner.state;
_scanner.scan(_whitespace);
if (!_scanner.matches('<')) {
_scanner.state = replay;
state = _ScannerState.freeText;
break;
}
}
} else if (token.type ==
(asDSX ? TokenType.rCurly : TokenType.rDoubleCurly)) {
state = _ScannerState.freeText;
break;
}
potential.clear();
}
}
} while (brackets.isNotEmpty && !_scanner.isDone);
state = _ScannerState.freeText;
}
}
enum _ScannerState { html, freeText }
```
|
```javascript
[
{
"class": "title_bar",
"settings": [
"!ui_native_titlebar"
],
"bg": "#10141c",
"fg": "#bfbdb6"
},
{
"class": "title_bar",
"settings": [
"!ui_native_titlebar",
"ui_separator"
],
"bg": "#0d1017"
},
{
"class": "sidebar_container",
"content_margin": [
0,
6,
0,
0
],
"layer0.opacity": 1,
"layer0.tint": "#10141c"
},
{
"class": "sidebar_container",
"settings": [
"ui_separator"
],
"layer0.tint": "#0d1017",
"layer1.texture": "ayu/assets/separator-sidebar.png",
"layer1.inner_margin": [
0,
38,
2,
1
],
"layer1.opacity": 1,
"layer1.tint": "#1b1f29"
},
{
"class": "sidebar_tree",
"indent_top_level": false,
"row_padding": [
20,
5
],
"dark_content": false,
"spacer_rows": true,
"indent_offset": 2,
"indent": 8
},
{
"class": "sidebar_heading",
"color": "#565b66",
"font.bold": true,
"font.size": 11
},
{
"class": "tree_row",
"layer0.texture": "ayu/assets/tree-highlight.png",
"layer0.tint": "#47526600",
"layer0.inner_margin": [
8,
4
],
"layer0.opacity": 1,
"layer1.texture": "ayu/assets/tree-highlight-border.png",
"layer1.tint": "#47526640",
"layer1.inner_margin": [
8,
4
],
"layer1.opacity": 0
},
{
"class": "tree_row",
"attributes": [
"selectable",
"hover"
],
"layer0.tint": "#47526640",
"layer1.opacity": 1
},
{
"class": "tree_row",
"attributes": [
"selectable",
"selected"
],
"layer0.tint": "#47526633"
},
{
"class": "tree_row",
"attributes": [
"selectable",
"selected",
"hover"
],
"layer0.tint": "#47526640"
},
{
"class": "sidebar_label",
"fg": "#565b66",
"font.size": 12
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"hover"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"selected"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"expandable"
]
}
],
"fg": "#565b66",
"font.bold": false
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"expandable"
]
}
],
"settings": [
"bold_folder_labels"
],
"font.bold": true
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"expandable",
"hover"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"expanded"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "sidebar_label",
"parents": [
{
"class": "tree_row",
"attributes": [
"expanded"
]
}
],
"settings": [
"bold_folder_labels"
],
"font.bold": true
},
{
"class": "sidebar_label",
"attributes": [
"transient"
],
"font.italic": false
},
{
"class": "sidebar_label",
"parents": [
{
"class": "file_system_entry",
"attributes": [
"ignored"
]
}
],
"fg": "#565b6680"
},
{
"class": "disclosure_button_control",
"content_margin": [
0,
0,
0,
0
]
},
{
"class": "close_button",
"content_margin": [
6,
8
],
"layer0.texture": "ayu/assets/close.png",
"layer0.opacity": 0,
"layer0.inner_margin": [
0,
0
],
"layer0.tint": "#565b66"
},
{
"class": "close_button",
"parents": [
{
"class": "tree_row",
"attributes": [
"hover"
]
}
],
"layer0.opacity": 1
},
{
"class": "close_button",
"attributes": [
"dirty"
],
"layer0.texture": "ayu/assets/dirty.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1
},
{
"class": "close_button",
"attributes": [
"hover"
],
"layer0.opacity": 1,
"layer0.tint": "#e6b450"
},
{
"class": "icon_folder",
"content_margin": [
9,
9
],
"layer0.tint": "#0d1017",
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/folder.png",
"layer1.tint": "#565b66bf",
"layer1.opacity": 1,
"layer2.texture": "ayu/assets/folder-open.png",
"layer2.tint": "#e6b450",
"layer2.opacity": 0
},
{
"class": "icon_folder",
"parents": [
{
"class": "tree_row",
"attributes": [
"expanded"
]
}
],
"layer1.opacity": 0,
"layer2.opacity": 1
},
{
"class": "icon_folder",
"parents": [
{
"class": "tree_row",
"attributes": [
"hover"
]
}
],
"layer1.tint": "#e6b450"
},
{
"class": "icon_folder",
"parents": [
{
"class": "tree_row",
"attributes": [
"expanded",
"hover"
]
}
],
"layer2.texture": {
"keyframes": [
"ayu/assets/folder-open-1.png",
"ayu/assets/folder-open-1.png",
"ayu/assets/folder-open-2.png",
"ayu/assets/folder-open-3.png",
"ayu/assets/folder-open-4.png",
"ayu/assets/folder-open-5.png",
"ayu/assets/folder-open-5.png",
"ayu/assets/folder-open-5.png",
"ayu/assets/folder-open-6.png",
"ayu/assets/folder-open-6.png",
"ayu/assets/folder-open-6.png",
"ayu/assets/folder-open-6.png",
"ayu/assets/folder-open.png"
],
"loop": false,
"frame_time": 0.02
},
"layer1.opacity": 0,
"layer2.opacity": 1
},
{
"class": "icon_folder",
"parents": [
{
"class": "tree_row",
"attributes": [
"selected"
]
}
],
"layer1.tint": "#e6b450"
},
{
"class": "icon_folder_loading",
"layer1.texture": {
"keyframes": [
"ayu/assets/spinner11.png",
"ayu/assets/spinner10.png",
"ayu/assets/spinner9.png",
"ayu/assets/spinner8.png",
"ayu/assets/spinner7.png",
"ayu/assets/spinner6.png",
"ayu/assets/spinner5.png",
"ayu/assets/spinner4.png",
"ayu/assets/spinner3.png",
"ayu/assets/spinner2.png",
"ayu/assets/spinner1.png",
"ayu/assets/spinner.png"
],
"loop": true,
"frame_time": 0.075
},
"layer1.tint": "#e6b450",
"layer0.opacity": 0,
"content_margin": [
8,
8
]
},
{
"class": "icon_folder_dup",
"content_margin": [
9,
9
],
"layer0.texture": "ayu/assets/folder.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"layer1.texture": "ayu/assets/folder-symlink.png",
"layer1.tint": "#565b66",
"layer1.opacity": 0.3
},
{
"class": "icon_folder_dup",
"parents": [
{
"class": "tree_row",
"attributes": [
"hover"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_folder_dup",
"parents": [
{
"class": "tree_row",
"attributes": [
"expanded"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_file_type",
"content_margin": [
8,
8
]
},
{
"class": "vcs_status_badge",
"attributes": [
"ignored"
],
"layer0.tint": "#565b664d"
},
{
"class": "vcs_status_badge",
"attributes": [
"added"
],
"layer0.tint": "#7fd96266"
},
{
"class": "vcs_status_badge",
"attributes": [
"modified"
],
"layer0.tint": "#73b8ff66"
},
{
"class": "vcs_status_badge",
"attributes": [
"deleted"
],
"layer0.tint": "#f26d7866"
},
{
"class": "sheet_contents",
"background_modifier": ""
},
{
"class": "sheet_contents",
"settings": {
"inactive_sheet_dimming": true
},
"attributes": [
"!highlighted"
],
"background_modifier": "blend(#0d1017 0%)"
},
{
"class": "tabset_control",
"mouse_wheel_switch": false,
"tab_min_width": 50,
"tab_overlap": 0,
"tab_height": 38,
"tab_width": 100,
"layer0.tint": "#10141c",
"layer0.opacity": 1,
"content_margin": [
10,
0
]
},
{
"class": "tabset_control",
"settings": [
"mouse_wheel_switches_tabs",
"!enable_tab_scrolling"
],
"mouse_wheel_switch": true
},
{
"class": "tabset_control",
"settings": [
"ui_separator"
],
"tab_overlap": 8,
"connector_height": 2,
"content_margin": [
0,
0,
0,
0
],
"layer0.tint": "#0d1017",
"layer1.texture": "ayu/assets/tabset-border.png",
"layer1.tint": "#1b1f29",
"layer1.inner_margin": [
1,
1,
1,
6
],
"layer1.opacity": 1
},
{
"class": "tab_connector",
"layer0.texture": "",
"layer0.opacity": 1,
"tint_index": 0
},
{
"class": "tab_control",
"settings": [
"!ui_separator"
],
"layer0.texture": "ayu/assets/separator-bottom.png",
"layer0.tint": "#1b1f29",
"layer0.inner_margin": [
0,
0,
0,
2
],
"layer0.opacity": 0,
"content_margin": [
15,
-2,
15,
0
],
"max_margin_trim": 12
},
{
"class": "tab_control",
"settings": [
"ui_separator"
],
"layer1.texture": "ayu/assets/tab.png",
"layer1.inner_margin": [
9,
0,
9,
0
],
"layer1.opacity": 0,
"layer2.texture": "ayu/assets/tab-border.png",
"layer2.inner_margin": [
9,
0,
9,
0
],
"layer2.tint": "#1b1f29",
"layer2.opacity": 0,
"content_margin": [
16,
5,
11,
4
],
"hit_test_level": 0
},
{
"class": "tab_control",
"attributes": [
"selected"
],
"settings": [
"!ui_separator"
],
"layer0.tint": "#e6b450",
"layer0.opacity": 1
},
{
"class": "tab_control",
"attributes": [
"selected",
"!highlighted"
],
"settings": [
"ui_separator"
],
"layer1.opacity": 1,
"layer1.tint": "#0d1017",
"layer2.opacity": 1
},
{
"class": "tab_control",
"attributes": [
"selected",
"highlighted"
],
"settings": [
"ui_separator"
],
"layer1.opacity": {
"target": 1,
"speed": 1,
"interpolation": "smoothstep"
},
"layer1.tint": "#10141c",
"layer2.opacity": 1
},
{
"class": "tab_control",
"attributes": [
"hover"
],
"settings": [
"!ui_separator"
],
"layer0.tint": "#e6b450",
"layer0.opacity": 1
},
{
"class": "tab_control",
"attributes": [
"hover"
],
"settings": [
"ui_separator"
]
},
{
"class": "tab_control",
"attributes": [
"selected",
"hover"
],
"settings": [
"!ui_separator"
],
"layer0.opacity": 1
},
{
"class": "tab_control",
"attributes": [
"selected",
"hover"
],
"settings": [
"ui_separator"
]
},
{
"class": "tab_label",
"fg": "#565b66",
"font.italic": false,
"font.bold": false,
"font.size": 12
},
{
"class": "tab_label",
"settings": [
"highlight_modified_tabs"
],
"font.italic": true,
"attributes": [
"dirty"
],
"fg": "#e6b450"
},
{
"class": "tab_label",
"parents": [
{
"class": "tab_control",
"attributes": [
"selected",
"highlighted"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "tab_label",
"parents": [
{
"class": "tab_control",
"attributes": [
"hover"
]
}
],
"fg": "#bfbdb6"
},
{
"class": "tab_label",
"attributes": [
"transient"
],
"font.italic": true
},
{
"class": "tab_close_button",
"content_margin": [
0,
0
],
"layer0.texture": "ayu/assets/close.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"layer1.texture": "ayu/assets/dirty.png",
"layer1.tint": "#565b66",
"layer1.opacity": 0
},
{
"class": "tab_close_button",
"settings": [
"show_tab_close_buttons"
],
"content_margin": [
6,
8
]
},
{
"class": "tab_close_button",
"settings": [
"show_tab_close_buttons",
"highlight_modified_tabs"
],
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "tab_close_button",
"parents": [
{
"class": "tab_control",
"attributes": [
"dirty"
]
}
],
"layer0.opacity": 0,
"layer1.opacity": 1,
"content_margin": [
6,
8
]
},
{
"class": "tab_close_button",
"parents": [
{
"class": "tab_control",
"attributes": [
"dirty"
]
}
],
"attributes": [
"hover"
],
"layer0.opacity": 1,
"layer1.opacity": 0
},
{
"class": "tab_close_button",
"parents": [
{
"class": "tab_control",
"attributes": [
"selected",
"dirty"
]
}
],
"layer0.opacity": 0,
"layer1.opacity": 1,
"layer1.tint": "#e6b450"
},
{
"class": "tab_close_button",
"parents": [
{
"class": "tab_control",
"attributes": [
"selected",
"dirty"
]
}
],
"attributes": [
"hover"
],
"layer0.opacity": 1,
"layer1.opacity": 0
},
{
"class": "scroll_tabs_left_button",
"content_margin": [
12,
15
],
"layer0.texture": "ayu/assets/arrow-left.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1
},
{
"class": "scroll_tabs_left_button",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "scroll_tabs_right_button",
"content_margin": [
12,
15
],
"layer0.texture": "ayu/assets/arrow-right.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1
},
{
"class": "scroll_tabs_right_button",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "show_tabs_dropdown_button",
"content_margin": [
12,
12
],
"layer0.texture": "ayu/assets/overflow-menu.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"layer0.inner_margin": [
0,
0
]
},
{
"class": "show_tabs_dropdown_button",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "overlay_control",
"layer0.texture": "ayu/assets/overlay-shadow.png",
"layer0.inner_margin": [
15,
35,
15,
25
],
"layer0.opacity": 1,
"layer0.tint": "#00000099",
"layer1.texture": "ayu/assets/overlay-border.png",
"layer1.inner_margin": [
15,
35,
15,
25
],
"layer1.opacity": 1,
"layer1.tint": "#1b1f29",
"layer2.texture": "ayu/assets/overlay-bg.png",
"layer2.inner_margin": [
15,
35,
15,
25
],
"layer2.opacity": 1,
"layer2.tint": "#141821",
"content_margin": [
10,
35,
10,
20
]
},
{
"class": "quick_panel",
"row_padding": [
13,
7
],
"layer0.tint": "#141821",
"layer0.opacity": 1
},
{
"class": "quick_panel",
"parents": [
{
"class": "overlay_control"
}
],
"row_padding": [
13,
7
],
"layer0.tint": "#141821",
"layer0.opacity": 1
},
{
"class": "mini_quick_panel_row",
"layer0.texture": "ayu/assets/tree-highlight.png",
"layer0.tint": "#47526640",
"layer0.inner_margin": [
8,
4
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/tree-highlight-border.png",
"layer1.tint": "#47526640",
"layer1.inner_margin": [
8,
4
],
"layer1.opacity": 0
},
{
"class": "mini_quick_panel_row",
"attributes": [
"selected"
],
"layer0.opacity": 1,
"layer1.opacity": 1
},
{
"class": "quick_panel_row",
"layer0.texture": "ayu/assets/tree-highlight.png",
"layer0.tint": "#47526640",
"layer0.inner_margin": [
8,
4
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/tree-highlight-border.png",
"layer1.tint": "#47526640",
"layer1.inner_margin": [
8,
4
],
"layer1.opacity": 0
},
{
"class": "quick_panel_row",
"attributes": [
"selected"
],
"layer0.opacity": 1,
"layer1.opacity": 1
},
{
"class": "quick_panel_label",
"fg": "#565b66",
"match_fg": "#e6b450",
"selected_fg": "#bfbdb6",
"selected_match_fg": "#e6b450"
},
{
"class": "quick_panel_label",
"parents": [
{
"class": "overlay_control"
}
],
"fg": "#565b66",
"match_fg": "#e6b450",
"selected_fg": "#bfbdb6",
"selected_match_fg": "#e6b450"
},
{
"class": "quick_panel_path_label",
"fg": "#565b66",
"match_fg": "#bfbdb6",
"selected_fg": "#565b66",
"selected_match_fg": "#bfbdb6"
},
{
"class": "quick_panel_detail_label",
"link_color": "#59c2ff"
},
{
"class": "grid_layout_control",
"border_size": 0,
"border_color": "#1b1f29"
},
{
"class": "grid_layout_control",
"settings": [
"ui_separator"
],
"border_size": 0
},
{
"class": "minimap_control",
"settings": [
"always_show_minimap_viewport"
],
"viewport_color": "#565b66",
"viewport_opacity": 0.3
},
{
"class": "minimap_control",
"settings": [
"!always_show_minimap_viewport"
],
"viewport_color": "#565b66",
"viewport_opacity": {
"target": 0,
"speed": 4,
"interpolation": "smoothstep"
}
},
{
"class": "minimap_control",
"attributes": [
"hover"
],
"settings": [
"!always_show_minimap_viewport"
],
"viewport_opacity": {
"target": 0.3,
"speed": 4,
"interpolation": "smoothstep"
}
},
{
"class": "fold_button_control",
"layer0.texture": "ayu/assets/unfold.png",
"layer0.opacity": 1,
"layer0.inner_margin": 0,
"layer0.tint": "#565b66",
"content_margin": [
8,
6,
8,
6
]
},
{
"class": "fold_button_control",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "fold_button_control",
"attributes": [
"expanded"
],
"layer0.texture": "ayu/assets/fold.png"
},
{
"class": "popup_shadow",
"layer0.texture": "ayu/assets/popup-shadow.png",
"layer0.inner_margin": [
14,
11,
14,
15
],
"layer0.opacity": 1,
"layer0.tint": "#00000099",
"layer0.draw_center": false,
"layer1.texture": "ayu/assets/popup-border.png",
"layer1.inner_margin": [
14,
11,
14,
15
],
"layer1.opacity": 1,
"layer1.tint": "#1b1f29",
"layer1.draw_center": false,
"content_margin": [
10,
7,
10,
13
]
},
{
"class": "popup_control",
"layer0.texture": "ayu/assets/popup-bg.png",
"layer0.inner_margin": [
4,
4,
4,
4
],
"layer0.opacity": 1,
"layer0.tint": "#141821",
"content_margin": [
0,
4
]
},
{
"class": "auto_complete",
"row_padding": [
5,
0
]
},
{
"class": "table_row",
"layer0.texture": "ayu/assets/tree-highlight.png",
"layer0.tint": "#47526640",
"layer0.inner_margin": [
8,
4
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/tree-highlight-border.png",
"layer1.tint": "#47526640",
"layer1.inner_margin": [
8,
4
],
"layer1.opacity": 0
},
{
"class": "table_row",
"attributes": [
"selected"
],
"layer0.opacity": 1,
"layer1.opacity": 1
},
{
"class": "auto_complete_label",
"fg": "transparent",
"match_fg": "#e6b450",
"selected_fg": "transparent",
"selected_match_fg": "#e6b450",
"fg_blend": true
},
{
"class": "auto_complete_hint",
"opacity": 0.7,
"font.italic": true
},
{
"class": "kind_container",
"layer0.texture": "ayu/assets/kind-bg.png",
"layer0.tint": "#141821",
"layer0.inner_margin": [
4,
4,
7,
4
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/kind-bg.png",
"layer1.tint": "#14182100",
"layer1.inner_margin": [
4,
4,
7,
4
],
"layer1.opacity": 0.3,
"layer2.texture": "ayu/assets/kind-border.png",
"layer2.tint": "#14182100",
"layer2.inner_margin": [
4,
4,
7,
4
],
"layer2.opacity": 0.1,
"content_margin": [
4,
0,
6,
0
]
},
{
"class": "kind_label",
"font.size": "1rem",
"font.bold": true,
"font.italic": true,
"color": "#565b66"
},
{
"class": "kind_label",
"parents": [
{
"class": "quick_panel"
}
],
"font.size": "1.1rem"
},
{
"class": "kind_container kind_function",
"layer0.opacity": 1,
"layer1.tint": "#ffb454",
"layer2.tint": "#ffb454"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_function"
}
],
"color": "#ffb454"
},
{
"class": "kind_container kind_keyword",
"layer0.opacity": 1,
"layer1.tint": "#ff8f40",
"layer2.tint": "#ff8f40"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_keyword"
}
],
"color": "#ff8f40"
},
{
"class": "kind_container kind_markup",
"layer0.opacity": 1,
"layer1.tint": "#39bae6",
"layer2.tint": "#39bae6"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_markup"
}
],
"color": "#39bae6"
},
{
"class": "kind_container kind_namespace",
"layer0.opacity": 1,
"layer1.tint": "#59c2ff",
"layer2.tint": "#59c2ff"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_namespace"
}
],
"color": "#59c2ff"
},
{
"class": "kind_container kind_navigation",
"layer0.opacity": 1,
"layer1.tint": "#e6b673",
"layer2.tint": "#e6b673"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_navigation"
}
],
"color": "#e6b673"
},
{
"class": "kind_container kind_snippet",
"layer0.opacity": 1,
"layer1.tint": "#f07178",
"layer2.tint": "#f07178"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_snippet"
}
],
"color": "#f07178"
},
{
"class": "kind_container kind_type",
"layer0.opacity": 1,
"layer1.tint": "#59c2ff",
"layer2.tint": "#59c2ff"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_type"
}
],
"color": "#59c2ff"
},
{
"class": "kind_container kind_variable",
"layer0.opacity": 1,
"layer1.tint": "#acb6bf8c",
"layer2.tint": "#acb6bf8c"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_variable"
}
],
"color": "#acb6bf8c"
},
{
"class": "kind_container kind_color_redish",
"layer0.opacity": 1,
"layer1.tint": "#f07178",
"layer2.tint": "#f07178"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_redish"
}
],
"color": "#f07178"
},
{
"class": "kind_container kind_color_orangish",
"layer0.opacity": 1,
"layer1.tint": "#ff8f40",
"layer2.tint": "#ff8f40"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_orangish"
}
],
"color": "#ff8f40"
},
{
"class": "kind_container kind_color_yellowish",
"layer0.opacity": 1,
"layer1.tint": "#ffb454",
"layer2.tint": "#ffb454"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_yellowish"
}
],
"color": "#ffb454"
},
{
"class": "kind_container kind_color_greenish",
"layer0.opacity": 1,
"layer1.tint": "#aad94c",
"layer2.tint": "#aad94c"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_greenish"
}
],
"color": "#aad94c"
},
{
"class": "kind_container kind_color_cyanish",
"layer0.opacity": 1,
"layer1.tint": "#95e6cb",
"layer2.tint": "#95e6cb"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_cyanish"
}
],
"color": "#95e6cb"
},
{
"class": "kind_container kind_color_bluish",
"layer0.opacity": 1,
"layer1.tint": "#39bae6",
"layer2.tint": "#39bae6"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_bluish"
}
],
"color": "#39bae6"
},
{
"class": "kind_container kind_color_purplish",
"layer0.opacity": 1,
"layer1.tint": "#d2a6ff",
"layer2.tint": "#d2a6ff"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_purplish"
}
],
"color": "#d2a6ff"
},
{
"class": "kind_container kind_color_pinkish",
"layer0.opacity": 1,
"layer1.tint": "#f29668",
"layer2.tint": "#f29668"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_pinkish"
}
],
"color": "#f29668"
},
{
"class": "kind_container kind_color_dark",
"layer0.opacity": 1,
"layer1.tint": "#565b66",
"layer2.tint": "#565b66"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_dark"
}
],
"color": "#565b66"
},
{
"class": "kind_container kind_color_light",
"layer0.opacity": 1,
"layer1.tint": "white",
"layer2.tint": "white"
},
{
"class": "kind_label",
"parents": [
{
"class": "kind_container kind_color_light"
}
],
"color": "#555"
},
{
"class": "symbol_container",
"content_margin": [
4,
3,
4,
3
]
},
{
"class": "trigger_container",
"content_margin": [
4,
3,
4,
3
]
},
{
"class": "auto_complete_detail_pane",
"layer0.opacity": 1,
"layer0.tint": "#141821",
"layer1.opacity": 1,
"layer1.tint": "#141821",
"content_margin": [
8,
10,
8,
5
]
},
{
"class": "auto_complete_kind_name_label",
"font.size": "0.9rem",
"font.italic": true,
"border_color": "#565b66"
},
{
"class": "auto_complete_details",
"background_color": "#141821",
"monospace_background_color": "#141821"
},
{
"class": "panel_control",
"layer0.tint": "#10141c",
"layer0.opacity": 1,
"content_margin": [
0,
5
]
},
{
"class": "panel_control",
"settings": [
"ui_separator"
],
"layer0.tint": "#0d1017",
"layer1.texture": "ayu/assets/separator-top.png",
"layer1.tint": "#1b1f29",
"layer1.inner_margin": [
1,
2,
1,
0
],
"layer1.opacity": 1
},
{
"class": "panel_grid_control"
},
{
"class": "panel_close_button",
"layer0.texture": "ayu/assets/close.png",
"layer0.opacity": 1,
"layer0.tint": "#565b66",
"content_margin": [
0,
0
]
},
{
"class": "panel_close_button",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "status_bar",
"layer0.texture": "",
"layer0.tint": "#10141c",
"layer0.opacity": 1,
"layer1.texture": "ayu/assets/separator-top.png",
"layer1.tint": "#1b1f29",
"layer1.inner_margin": [
1,
2,
1,
0
],
"content_margin": [
10,
2
]
},
{
"class": "status_bar",
"settings": [
"ui_separator"
],
"layer0.tint": "#0d1017",
"layer1.opacity": 1
},
{
"class": "panel_button_control",
"layer0.texture": "ayu/assets/switch-panel.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1
},
{
"class": "panel_button_control",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "status_container",
"content_margin": [
0,
5
]
},
{
"class": "status_button",
"min_size": [
100,
0
]
},
{
"class": "vcs_branch_icon",
"layer0.tint": "#565b66"
},
{
"class": "vcs_changes_annotation",
"border_color": "#565b66b3"
},
{
"class": "dialog",
"layer0.tint": "#0d1017",
"layer0.opacity": 1
},
{
"class": "progress_bar_control",
"layer0.tint": "#0d1017",
"layer0.opacity": 1
},
{
"class": "progress_gauge_control",
"layer0.tint": "#e6b450",
"layer0.opacity": 1,
"content_margin": [
0,
6
]
},
{
"class": "scroll_area_control",
"settings": [
"overlay_scroll_bars"
],
"overlay": true
},
{
"class": "scroll_area_control",
"settings": [
"!overlay_scroll_bars"
],
"overlay": false
},
{
"class": "scroll_bar_control",
"layer0.tint": "#0d1017",
"layer0.opacity": 1,
"layer1.texture": "ayu/assets/scrollbar-vertical-wide.png",
"layer1.tint": "#565b66",
"layer1.opacity": 0.1,
"layer1.inner_margin": [
0,
10
]
},
{
"class": "scroll_bar_control",
"parents": [
{
"class": "overlay_control"
}
],
"layer0.tint": "#141821"
},
{
"class": "scroll_bar_control",
"attributes": [
"horizontal"
],
"layer1.texture": "ayu/assets/scrollbar-horizontal-wide.png",
"layer1.inner_margin": [
10,
0
]
},
{
"class": "scroll_bar_control",
"settings": [
"overlay_scroll_bars"
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/scrollbar-vertical.png",
"layer1.inner_margin": [
4,
6,
6,
6
]
},
{
"class": "scroll_bar_control",
"settings": [
"overlay_scroll_bars",
"ui_wide_scrollbars"
],
"layer0.texture": "ayu/assets/scrollbar-vertical-wide.png"
},
{
"class": "scroll_bar_control",
"settings": [
"overlay_scroll_bars"
],
"attributes": [
"horizontal"
],
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/scrollbar-horizontal.png",
"layer1.inner_margin": [
6,
4,
6,
6
]
},
{
"class": "scroll_bar_control",
"attributes": [
"horizontal"
],
"settings": [
"overlay_scroll_bars",
"ui_wide_scrollbars"
],
"layer0.texture": "ayu/assets/scrollbar-horizontal-wide.png"
},
{
"class": "scroll_track_control",
"layer0.tint": "#0d1017",
"layer0.opacity": 1
},
{
"class": "scroll_corner_control",
"layer0.tint": "#0d1017",
"layer0.opacity": 1
},
{
"class": "puck_control",
"layer0.texture": "ayu/assets/scrollbar-vertical-wide.png",
"layer0.tint": "#565b66",
"layer0.opacity": 0.3,
"layer0.inner_margin": [
0,
10
],
"content_margin": [
6,
12
]
},
{
"class": "puck_control",
"attributes": [
"horizontal"
],
"layer0.texture": "ayu/assets/scrollbar-horizontal-wide.png",
"layer0.inner_margin": [
10,
0
],
"content_margin": [
12,
6
]
},
{
"class": "puck_control",
"settings": [
"overlay_scroll_bars"
],
"layer0.texture": "ayu/assets/scrollbar-vertical.png",
"layer0.inner_margin": [
4,
6,
6,
6
],
"content_margin": [
5,
20
]
},
{
"class": "puck_control",
"settings": [
"overlay_scroll_bars",
"ui_wide_scrollbars"
],
"layer0.texture": "ayu/assets/scrollbar-vertical-wide.png"
},
{
"class": "puck_control",
"settings": [
"overlay_scroll_bars"
],
"attributes": [
"horizontal"
],
"layer0.texture": "ayu/assets/scrollbar-horizontal.png",
"layer0.inner_margin": [
6,
4,
6,
6
],
"content_margin": [
20,
5
]
},
{
"class": "puck_control",
"attributes": [
"horizontal"
],
"settings": [
"overlay_scroll_bars",
"ui_wide_scrollbars"
],
"layer0.texture": "ayu/assets/scrollbar-horizontal-wide.png"
},
{
"class": "text_line_control",
"layer0.texture": "ayu/assets/input-bg.png",
"layer0.opacity": 1,
"layer0.inner_margin": [
10,
8
],
"layer0.tint": "#141821",
"layer1.texture": "ayu/assets/input-border.png",
"layer1.opacity": 1,
"layer1.inner_margin": [
10,
8
],
"layer1.tint": "#1b1f29",
"content_margin": [
10,
7,
10,
5
]
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control"
}
],
"layer0.texture": "",
"layer0.opacity": 0,
"layer1.texture": "ayu/assets/input-prompt.png",
"layer1.opacity": 1,
"layer1.tint": "#565b66",
"layer1.inner_margin": [
36,
26,
0,
0
],
"content_margin": [
38,
5,
10,
5
]
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control goto_file"
}
],
"layer1.texture": "ayu/assets/input-search.png"
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control command_palette"
}
],
"layer1.texture": "ayu/assets/input-command.png"
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control goto_symbol"
}
],
"layer1.texture": "ayu/assets/input-symbol.png"
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control goto_symbol_in_project"
}
],
"layer1.texture": "ayu/assets/input-symbol.png"
},
{
"class": "text_line_control",
"parents": [
{
"class": "overlay_control goto_word"
}
],
"layer1.texture": "ayu/assets/input-word.png"
},
{
"class": "dropdown_button_control",
"content_margin": [
12,
12
],
"layer0.texture": "ayu/assets/overflow-menu.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1
},
{
"class": "dropdown_button_control",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "button_control",
"content_margin": [
15,
9,
15,
10
],
"min_size": [
60,
0
],
"layer0.tint": "#e6b450",
"layer0.texture": "ayu/assets/input-bg.png",
"layer0.inner_margin": [
10,
8
],
"layer0.opacity": 0
},
{
"class": "button_control",
"attributes": [
"hover"
],
"layer0.opacity": 1
},
{
"class": "icon_button_control",
"layer0.tint": [
0,
0,
0
],
"layer0.opacity": 0,
"layer2.tint": "#bfbdb6",
"layer2.opacity": {
"target": 0,
"speed": 10,
"interpolation": "smoothstep"
},
"content_margin": [
10,
5
]
},
{
"class": "icon_regex",
"layer0.texture": "ayu/assets/regex.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_regex",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_case",
"layer0.texture": "ayu/assets/matchcase.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_case",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_whole_word",
"layer0.texture": "ayu/assets/word.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_whole_word",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_wrap",
"layer0.texture": "ayu/assets/wrap.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_wrap",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_in_selection",
"layer0.texture": "ayu/assets/inselection.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_in_selection",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_highlight",
"layer0.texture": "ayu/assets/highlight.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_highlight",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_preserve_case",
"layer0.texture": "ayu/assets/replace-preserve-case.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_preserve_case",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_context",
"layer0.texture": "ayu/assets/context.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_context",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_use_buffer",
"layer0.texture": "ayu/assets/buffer.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_use_buffer",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "icon_use_gitignore",
"layer0.texture": "ayu/assets/gitignore.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "icon_use_gitignore",
"parents": [
{
"class": "icon_button_control",
"attributes": [
"selected"
]
}
],
"layer0.tint": "#e6b450"
},
{
"class": "sidebar_button_control",
"layer0.texture": "ayu/assets/sidebar.png",
"layer0.tint": "#565b66",
"layer0.opacity": 1,
"content_margin": [
12,
12
]
},
{
"class": "sidebar_button_control",
"attributes": [
"hover"
],
"layer0.tint": "#e6b450"
},
{
"class": "label_control",
"color": "#565b66",
"shadow_color": [
0,
0,
0,
0
],
"shadow_offset": [
0,
0
],
"font.bold": false,
"font.size": 12
},
{
"class": "label_control",
"parents": [
{
"class": "status_bar"
}
],
"color": "#565b66",
"font.bold": false
},
{
"class": "label_control",
"parents": [
{
"class": "button_control"
}
],
"color": "#565b66"
},
{
"class": "label_control",
"parents": [
{
"class": "button_control",
"attributes": [
"hover"
]
}
],
"color": "#734d00"
},
{
"class": "title_label_control",
"color": "#e6b450"
},
{
"class": "tool_tip_control",
"layer0.tint": "#565b66",
"layer0.inner_margin": [
0,
0
],
"layer0.opacity": 1,
"content_margin": [
6,
3
]
},
{
"class": "tool_tip_label_control",
"color": "#0d1017",
"font.size": 12
}
]
```
|
```smalltalk
"
I am a fetcher looking for the messages implemented in a class.
"
Class {
#name : 'CoClassImplementedMessagesFetcher',
#superclass : 'CoClassBasedFetcher',
#category : 'HeuristicCompletion-Model-Fetchers',
#package : 'HeuristicCompletion-Model',
#tag : 'Fetchers'
}
{ #category : 'enumerating' }
CoClassImplementedMessagesFetcher >> entriesDo: aBlock [
self completionClass selectorsDo: [ :e |
aBlock value: (NECSelectorEntry contents: e node: astNode)]
]
```
|
```go
// Unless explicitly stated otherwise all files in this repository are licensed
// This product includes software developed at Datadog (path_to_url
// Package ecs contains the definition of the AWS ECS environment.
package ecs
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/DataDog/test-infra-definitions/common/config"
"github.com/DataDog/test-infra-definitions/components/datadog/agent"
"github.com/DataDog/test-infra-definitions/components/datadog/ecsagentparams"
fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake"
ecsComp "github.com/DataDog/test-infra-definitions/components/ecs"
"github.com/DataDog/test-infra-definitions/resources/aws"
"github.com/DataDog/test-infra-definitions/resources/aws/ecs"
"github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional"
)
const (
provisionerBaseID = "aws-ecs-"
defaultECS = "ecs"
)
// ProvisionerParams contains all the parameters needed to create the environment
type ProvisionerParams struct {
name string
agentOptions []ecsagentparams.Option
fakeintakeOptions []fakeintake.Option
extraConfigParams runner.ConfigMap
ecsFargate bool
ecsLinuxECSOptimizedNodeGroup bool
ecsLinuxECSOptimizedARMNodeGroup bool
ecsLinuxBottlerocketNodeGroup bool
ecsWindowsNodeGroup bool
infraShouldDeployFakeintakeWithLB bool
workloadAppFuncs []WorkloadAppFunc
awsEnv *aws.Environment
}
func newProvisionerParams() *ProvisionerParams {
// We use nil arrays to decide if we should create or not
return &ProvisionerParams{
name: defaultECS,
agentOptions: []ecsagentparams.Option{},
fakeintakeOptions: []fakeintake.Option{},
extraConfigParams: runner.ConfigMap{},
ecsFargate: false,
ecsLinuxECSOptimizedNodeGroup: false,
ecsLinuxECSOptimizedARMNodeGroup: false,
ecsLinuxBottlerocketNodeGroup: false,
ecsWindowsNodeGroup: false,
infraShouldDeployFakeintakeWithLB: false,
}
}
// GetProvisionerParams return ProvisionerParams from options opts setup
func GetProvisionerParams(opts ...ProvisionerOption) *ProvisionerParams {
params := newProvisionerParams()
err := optional.ApplyOptions(params, opts)
if err != nil {
panic(fmt.Errorf("unable to apply ProvisionerOption, err: %w", err))
}
return params
}
// ProvisionerOption is a function that modifies the ProvisionerParams
type ProvisionerOption func(*ProvisionerParams) error
// WithAgentOptions sets the options for the Docker Agent
func WithAgentOptions(opts ...ecsagentparams.Option) ProvisionerOption {
return func(params *ProvisionerParams) error {
params.agentOptions = append(params.agentOptions, opts...)
return nil
}
}
// WithExtraConfigParams sets the extra config params for the environment
func WithExtraConfigParams(configMap runner.ConfigMap) ProvisionerOption {
return func(params *ProvisionerParams) error {
params.extraConfigParams = configMap
return nil
}
}
// WithFakeIntakeOptions sets the options for the FakeIntake
func WithFakeIntakeOptions(opts ...fakeintake.Option) ProvisionerOption {
return func(params *ProvisionerParams) error {
params.fakeintakeOptions = append(params.fakeintakeOptions, opts...)
return nil
}
}
// WithECSFargateCapacityProvider enable Fargate ECS
func WithECSFargateCapacityProvider() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.ecsFargate = true
return nil
}
}
// WithECSLinuxECSOptimizedNodeGroup enable aws/ecs/linuxECSOptimizedNodeGroup
func WithECSLinuxECSOptimizedNodeGroup() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.ecsLinuxECSOptimizedNodeGroup = true
return nil
}
}
// WithECSLinuxECSOptimizedARMNodeGroup enable aws/ecs/linuxECSOptimizedARMNodeGroup
func WithECSLinuxECSOptimizedARMNodeGroup() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.ecsLinuxECSOptimizedARMNodeGroup = true
return nil
}
}
// WithECSLinuxBottlerocketNodeGroup enable aws/ecs/linuxBottlerocketNodeGroup
func WithECSLinuxBottlerocketNodeGroup() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.ecsLinuxBottlerocketNodeGroup = true
return nil
}
}
// WithECSWindowsNodeGroup enable aws/ecs/windowsLTSCNodeGroup
func WithECSWindowsNodeGroup() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.ecsWindowsNodeGroup = true
return nil
}
}
// WithInfraShouldDeployFakeintakeWithLB enable load balancer on Fakeintake
func WithInfraShouldDeployFakeintakeWithLB() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.infraShouldDeployFakeintakeWithLB = true
return nil
}
}
// WithoutFakeIntake deactivates the creation of the FakeIntake
func WithoutFakeIntake() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.fakeintakeOptions = nil
return nil
}
}
// WithoutAgent deactivates the creation of the Docker Agent
func WithoutAgent() ProvisionerOption {
return func(params *ProvisionerParams) error {
params.agentOptions = nil
return nil
}
}
// WithAwsEnv asks the provisioner to use the given environment, it is created otherwise
func WithAwsEnv(env *aws.Environment) ProvisionerOption {
return func(params *ProvisionerParams) error {
params.awsEnv = env
return nil
}
}
// WorkloadAppFunc is a function that deploys a workload app to an ECS cluster
type WorkloadAppFunc func(e aws.Environment, clusterArn pulumi.StringInput) (*ecsComp.Workload, error)
// WithWorkloadApp adds a workload app to the environment
func WithWorkloadApp(appFunc WorkloadAppFunc) ProvisionerOption {
return func(params *ProvisionerParams) error {
params.workloadAppFuncs = append(params.workloadAppFuncs, appFunc)
return nil
}
}
// Run deploys a ECS environment given a pulumi.Context
func Run(ctx *pulumi.Context, env *environments.ECS, params *ProvisionerParams) error {
var awsEnv aws.Environment
var err error
if params.awsEnv != nil {
awsEnv = *params.awsEnv
} else {
awsEnv, err = aws.NewEnvironment(ctx)
if err != nil {
return err
}
}
// Create cluster
ecsCluster, err := ecs.CreateEcsCluster(awsEnv, params.name)
if err != nil {
return err
}
// Export clusters properties
ctx.Export("ecs-cluster-name", ecsCluster.Name)
ctx.Export("ecs-cluster-arn", ecsCluster.Arn)
// Handle capacity providers
capacityProviders := pulumi.StringArray{}
if params.ecsFargate {
capacityProviders = append(capacityProviders, pulumi.String("FARGATE"))
}
linuxNodeGroupPresent := false
if params.ecsLinuxECSOptimizedNodeGroup {
cpName, err := ecs.NewECSOptimizedNodeGroup(awsEnv, ecsCluster.Name, false)
if err != nil {
return err
}
capacityProviders = append(capacityProviders, cpName)
linuxNodeGroupPresent = true
}
if params.ecsLinuxECSOptimizedARMNodeGroup {
cpName, err := ecs.NewECSOptimizedNodeGroup(awsEnv, ecsCluster.Name, true)
if err != nil {
return err
}
capacityProviders = append(capacityProviders, cpName)
linuxNodeGroupPresent = true
}
if params.ecsLinuxBottlerocketNodeGroup {
cpName, err := ecs.NewBottlerocketNodeGroup(awsEnv, ecsCluster.Name)
if err != nil {
return err
}
capacityProviders = append(capacityProviders, cpName)
linuxNodeGroupPresent = true
}
if params.ecsWindowsNodeGroup {
cpName, err := ecs.NewWindowsNodeGroup(awsEnv, ecsCluster.Name)
if err != nil {
return err
}
capacityProviders = append(capacityProviders, cpName)
}
// Associate capacity providers
_, err = ecs.NewClusterCapacityProvider(awsEnv, ctx.Stack(), ecsCluster.Name, capacityProviders)
if err != nil {
return err
}
var apiKeyParam *ssm.Parameter
var fakeIntake *fakeintakeComp.Fakeintake
// Create task and service
if params.agentOptions != nil {
if params.fakeintakeOptions != nil {
fakeIntakeOptions := []fakeintake.Option{}
fakeIntakeOptions = append(fakeIntakeOptions, params.fakeintakeOptions...)
if awsEnv.InfraShouldDeployFakeintakeWithLB() {
fakeIntakeOptions = append(fakeIntakeOptions, fakeintake.WithLoadBalancer())
}
if fakeIntake, err = fakeintake.NewECSFargateInstance(awsEnv, "ecs", fakeIntakeOptions...); err != nil {
return err
}
if err := fakeIntake.Export(awsEnv.Ctx(), &env.FakeIntake.FakeintakeOutput); err != nil {
return err
}
}
apiKeyParam, err = ssm.NewParameter(ctx, awsEnv.Namer.ResourceName("agent-apikey"), &ssm.ParameterArgs{
Name: awsEnv.CommonNamer().DisplayName(1011, pulumi.String("agent-apikey")),
Type: ssm.ParameterTypeSecureString,
Overwrite: pulumi.Bool(true),
Value: awsEnv.AgentAPIKey(),
}, awsEnv.WithProviders(config.ProviderAWS))
if err != nil {
return err
}
// Deploy EC2 Agent
if linuxNodeGroupPresent {
agentDaemon, err := agent.ECSLinuxDaemonDefinition(awsEnv, "ec2-linux-dd-agent", apiKeyParam.Name, fakeIntake, ecsCluster.Arn, params.agentOptions...)
if err != nil {
return err
}
ctx.Export("agent-ec2-linux-task-arn", agentDaemon.TaskDefinition.Arn())
ctx.Export("agent-ec2-linux-task-family", agentDaemon.TaskDefinition.Family())
ctx.Export("agent-ec2-linux-task-version", agentDaemon.TaskDefinition.Revision())
}
}
for _, appFunc := range params.workloadAppFuncs {
_, err := appFunc(awsEnv, ecsCluster.Arn)
if err != nil {
return err
}
}
return nil
}
// Provisioner creates a VM environment with an EC2 VM with Docker, an ECS Fargate FakeIntake and a Docker Agent configured to talk to each other.
// FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options.
func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.ECS] {
// We need to build params here to be able to use params.name in the provisioner name
params := GetProvisionerParams(opts...)
provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.ECS) error {
return Run(ctx, env, params)
}, params.extraConfigParams)
return provisioner
}
```
|
```java
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package com.haulmont.cuba.web.gui;
public enum MainTabSheetMode {
DEFAULT,
MANAGED
}
```
|
```php
<?php
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*/
namespace Google\Service\Looker;
class OAuthConfig extends \Google\Model
{
/**
* @var string
*/
public $clientId;
/**
* @var string
*/
public $clientSecret;
/**
* @param string
*/
public function setClientId($clientId)
{
$this->clientId = $clientId;
}
/**
* @return string
*/
public function getClientId()
{
return $this->clientId;
}
/**
* @param string
*/
public function setClientSecret($clientSecret)
{
$this->clientSecret = $clientSecret;
}
/**
* @return string
*/
public function getClientSecret()
{
return $this->clientSecret;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OAuthConfig::class, 'Google_Service_Looker_OAuthConfig');
```
|
Fergus Craig (born April 19, 1980) is a British stand-up comic and actor in theatre, television and radio. He studied at the University of Manchester.
Craig is one half of the double act Colin & Fergus, with actor and writer Colin Hoult.
Career
Between 2004-08 Craig and Hoult performed regularly on the London comedy circuit. They performed three shows at the Edinburgh Festival Fringe, Colin & Fergus '04, Colin & Fergus 2 '05 and Rutherford Lodge '06.
In 2006 Craig played Alan Bennett in Pete and Dud: Come Again, a play by Chris Bartlett and Nick Awde on the life of Peter Cook and Dudley Moore. The play ran at the 2006 Edinburgh Festival Fringe, then transferred to London's West End and toured New Zealand.
In 2007 he joined the cast of Channel 4's Star Stories and was a regular in Series 2 and 3 of the show.
In 2009, he won the Hackney Empire New Act of the Year with his solo stand-up act. He also joined the cast of the Bafta nominated BBC show Sorry, I've Got No Head the same year.
In 2010 he played the role of Devon Mills in BBC2 sitcom Popatron.
In 2011 he played the role of Lionel Putty in CBBC show Hotell Trubble
In 2012, he joined the cast of The Amazing World of Gumball as the character Sussie.
In 2014, Craig published a spoof advice guide, called "Tips For Actors", and in 2021 it was announced that Craig is publishing his first novel, entitled "Once Upon a Crime".
In 2020 Craig created a series of spoof extracts from a crime novel written by the character of Martin Fishback featuring the character of Detective Roger Le Carre. These have spawned two full length novels, plus a pilot for a sitcom.
Filmography
"Get a Grip" (2007) TV series - Various (2007)
"Comedy: Shuffle" (2007) TV series - Various (unknown episodes, 2007)
"Extras" - Runner (1 episode, 2007, series finale)
"Star Stories" - Nigel Martin-Smith, Declan Donnelly, Russell Brand (11 episodes, 2007-8)
"Mist: Sheepdog Tales" (13 episodes, 2007)
"EastEnders" - Chip Shop Assistant (1 episode, 22 March 2007)
"After You've Gone" - P.C. Walker (1 episode, 2007, Lock Back in Anger)
"Raging" (2007) (TV) - Various Characters
"Jonathan Creek" - Paramedic (1 episode, 2004, The Chequered Box)
Hut 33 (radio) - Gordon (18 episodes)
"The Amazing World of Gumball" - Sussie (2012-2016, seasons 2-4)
"Hoff the Record" (2015-2016, 12 episodes)
Books
References
External links
Living people
1980 births
English male television actors
English male comedians
English male stage actors
Actors from Sunderland
Alumni of the University of Manchester
Male actors from Tyne and Wear
Comedians from Tyne and Wear
|
```xml
/**
* Mnemonist PassjoinIndex Typings
* ================================
*/
type LevenshteinDistanceFunction<T> = (a: T, b: T) => number;
export default class PassjoinIndex<T> implements Iterable<T> {
// Members
size: number;
// Constructor
constructor(levenshtein: LevenshteinDistanceFunction<T>, k: number);
// Methods
add(value: T): this;
search(query: T): Set<T>;
clear(): void;
forEach(callback: (value: T, index: number, self: this) => void, scope?: any): void;
values(): IterableIterator<T>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;
// Statics
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
levenshtein: LevenshteinDistanceFunction<I>,
k: number
): PassjoinIndex<I>;
}
export function countKeys(k: number, s: number): number;
export function comparator<T>(a: T, b: T): number;
export function partition(k: number, l: number): Array<[number, number]>;
export function segments<T>(k: number, string: T): Array<T>;
export function segmentPos<T>(k: number, i: number, string: T): number;
export function multiMatchAwareInterval(
k: number,
delta: number,
i: number,
s: number,
pi: number,
li: number
): [number, number];
export function multiMatchAwareSubstrings<T>(
k: number,
string: T,
l: number,
i: number,
pi: number,
li: number
): Array<T>;
```
|
The Russo-Japanese War Medal or Medal in Memory of the Russo-Japanese War was a medal issued by the Russian Empire to those who had fought in the Russo-Japanese War and to nurses, medics, priest and other civilians who had distinguished themselves during combat operations. It was established on 21 January 1906 by Nicholas II of Russia and was awarded in silver, bronze and copper.
Sources
http://medalirus.ru/stati/lozovskiy-medal-russko-yaponskoy-voyny.php#_ftnref5
1906 establishments in the Russian Empire
Military awards and decorations of Russia
Russo-Japanese War
|
The Chittagong Hill Tracts lies in the south-eastern part of Bangladesh adjoining international boundaries with Myanmar on the southeast, the Indian states of Tripura on the north and Mizoram on the east. The Chittagong Hill Tracts, formally a single unified district was divided into three separate districts: Khagrachari, Bandarban, and Rangamati during the administrative reorganization in 1984.
Tribes in CHT
In Bangladesh there are many tribal people living in Sylhet, Dinajpur, Cox's Bazar, Mymensingh, Rajshahi etc. But the majority of tribal people live in Chittagong Hill tracts. It is the home of eleven tribes, the most beautiful indigenous people of Bangladesh. In this hilly area of immense beauty, eleven ethnic groups such as Chakma, Marma, Tripura, Tanchangya, Lushai, Pankho, Bawm, Mro, Khyang, Khumi and Chak live in harmony with nature. Among all of them the Chakma are the largest ethnic group in Bangladesh. The majority of them are Buddhists and the rest of them are Hindus, Christians etc. Also a good number of mainstream Bengali live in this area but their appearance, language and cultural traditions are markedly different from other Bengali-speaking people living in this area.
The tribal people of CHT lead an extremely interesting and attractive but simple life.
The tribal families are matriarchal and female is the head of a family. In their community the women are more hard-working than the male and basically they are the main productive force. The tribal people are extremely independent and self-confident. They grow their own food by Zum cultivation. Their girls weave their own cloths and they are very skillful in making beautiful handicrafts also. By selling the cloths and the handicrafts they earn some money and helps their family. The common feature is their way of life, which still speaks of their main occupation. Some of them still take pride in hunting with bows and arrows.
Culture
The culture of this tribal people is also very colorful. The greatest cultural festival of this people is the "Baisabi utsab". In Chittagong hill tracts all the tribal communities celebrate the festival in the same way. The only difference is the name. The Chakma calls it 'Biju', Tanchangya calls it Bishu, the Tripura calls it 'Baisu' and the Marma 'Sangrai' and the first 2-3 words of all the three names form the word 'Baisabi'. They celebrate the day from April 12 to 14 to say goodbye to the outgoing Bangla year and to welcome the New year.
In Chittagong Hill Tracts each tribe has its own dialect, distinctive dress, rites and rituals. But despite of these distinctive features there are strong bonds between them. They are generally peace-loving, honest, and hospitable.
References
Social groups of Bangladesh
|
Vendetta is a 2022 American action-thriller revenge film written and directed by Jared Cohn and starring Clive Standen, Theo Rossi, Mike Tyson, Thomas Jane, and Bruce Willis.
The film was released in limited theaters and on-demand platforms on May 17, 2022, by Redbox Entertainment.
Plot
In suburban Georgia, family man William Duncan (Clive Standen) picks up his daughter Kat (Maddie Nichols), a softball player with dreams of playing professionally. On their way to pick up dinner, Kat assures him that while she focuses on her sports, she will also study to become a lawyer. While William goes inside to order the food, Kat is left in the car. Brothers Rory (Theo Rossi) and Danny (Cabot Basden), working for their father, kingpin Donnie (Bruce Willis) turn up and drag her outside despite her pleas, with Rory informing her they only want her soul before Danny shoots and kills her. They are soon arrested by the authorities, but William intentionally doesn't identify Danny, allowing him to go free. The following night, William later stalks and hits Danny with his car, then proceeds to beat Danny to death with a softball bat. Returning home, he cleans his car and the bat and disposes of the bloody garments, later noticing and washing blood off his shirt, breaking down at the horror of what he's done.
Rory is informed of Danny's death and rushes to the scene but is told the investigation is ongoing. Detective Brody, the investigating detective finds out who Danny is and pays William a visit, informing him of Danny's murder and asking where he was that night, to which Danny states he was at home, and asks if he's a suspect. Brody says he's not but asks that he call if he thinks of anything. William's wife Jen confronts him and asks him where he was that night and begs him not to go back to his old ways, revealing that William was a former Marine. Rory questions a prostitute who tried to solicit William in the place where Danny was killed, and after confirming William's identity from a photo, Rory and his henchman ambush William the following day at a coffee shop. William manages to kill the henchman but loses his wallet which is picked up by Danny. Rushing home, William calls Brody and tells him the truth, and Brody leaves a squad car for his protection. William confesses to Jen what he has done, and she suggests they run away, but are ambushed by Rory and Donnie, who shoot him and Jen, killing her and leaving William to die.
William wakes up in the hospital, intent on revenge. Brody visits him and gives him a file on Donnie and Rory. After recuperating, Donnie escapes from the hospital in a janitor outfit and gets a change of clothes and a motel to stay in as well as money from the bank. Upon returning to the motel, William is accosted by a man named Dante, who reveals his knowledge of William from the court case and offers him firearms, revealing himself to be an arms dealer who lost his cousin to Donnie. After telling Dante of his past, William buys firearms and moves to a secluded location where he trains himself. Once done William comes back into town and seeks out one of Rory's henchmen, forcing him to reveal Donnie's location before shooting him dead. Upon learning of his henchman's death, Donnie orders Rory to kill William once and for all. Rory and his gang set out to find William, but William having already been at the club, sneaks inside and confronts Donnie. He tells Donnie that he has become emotionless to all that he has experienced, and that killing is normal for him now before shooting Donnie dead. He uses Donnie's phone to call Rory and inform him about his father's death. Upon reaching the club and seeing his father's body, Rory doesn't react as he hates his father due to Donnie constantly mentioning that Danny was better than him but orders his gang to find and kill William. William ambushes the gang but escapes to the motel, where the prostitute that identified him earlier tips off Rory. Dante learns of the ambush and helps William remove a bullet lodged in him, but Rory shows up at the motel and calls out to William. William opens fire on the gang and he and Dante escape with Rory in pursuit. Dante calls his friend Roach, who sets up an ambush for Rory and drives them away. Knowing they will be back, Dante, Roach and his gang prepare for the ambush, during which all gang members from both sides are killed, and Rory kills Roach, leaving him and William. Rory shoots William in the stomach and gloats over him, allowing William to grab a screwdriver and stab Rory in the neck. As he watches Rory die, smiling with insult, the face he wants William to never forget as he finally dies. Dante, having survived the assault, escapes upon hearing police sirens. Brody meets William and has a chat with him before William succumbs to his injuries as he dies. William finally avenges his family by not only killing the notorious Fetter family and their gang, but destroying their community, but at the cost of his own life. After William's death Brody states that he hopes is was worth it.
Cast
Clive Standen as William Duncan
Theo Rossi as Rory Fetter
Mike Tyson as Roach
Thomas Jane as Dante
Bruce Willis as Donnie Fetter
Cabot Basden as Danny Fetter
Kurt Yue as Detective Brody
Lauren Buglioli as Jen Duncan
Maddie Nichols as Kat Duncan
Derek Russo as Zach
Caia Coley as Nurse Pam
Production
Filming wrapped in September 2021.
That same month, Redbox Entertainment announced it had acquired American distribution rights to the film. Vendetta is one of the last films to star Willis, who retired from acting because he was diagnosed with frontotemporal dementia.
Release
Vendetta was released in limited theaters and on-demand platforms on May 17, 2022, by Redbox Entertainment.
Critical response
Rene Rodriguez of Variety gave a negative review, saying, "the body count starts to mount. So do the implausibilities, along with the boredom." Brian Costello of Common Sense Media also gave a negative review, saying, "when the most earnest and compelling performance in a movie is turned in by Sir Mike Tyson, you know you're in trouble."
Box office
As of February 17, 2023, Vendetta grossed $175,173 in the United Arab Emirates, Russia, and South Korea.
References
External links
2022 films
2022 action films
2022 independent films
American action thriller films
American independent films
2020s English-language films
Films directed by Jared Cohn
2020s American films
|
```python
#
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import unittest
import numpy as np
import paddle
from paddle import pir
from paddle.decomposition import decompose
from paddle.framework import core
paddle.enable_static()
def meshgrid_net(x1, x2, x3, x4):
return paddle.meshgrid(x1, x2, x3, x4)
class TestBuildOp(unittest.TestCase):
def setUp(self):
np.random.seed(2023)
self.dtype = "float32"
self.c_shape = [64]
self.init_x_shape = [1, 64, 512, 1024]
self.x1 = np.random.random(self.c_shape).astype(self.dtype)
self.x2 = np.random.random(self.c_shape).astype(self.dtype)
self.x3 = np.random.random(self.c_shape).astype(self.dtype)
self.x4 = np.random.random(self.c_shape).astype(self.dtype)
self.net = meshgrid_net
def get_ir_program(self):
paddle.enable_static()
with paddle.pir_utils.OldIrGuard():
main_program, start_program = (
paddle.static.Program(),
paddle.static.Program(),
)
with paddle.static.program_guard(main_program, start_program):
x1 = paddle.static.data('x1', self.c_shape, self.dtype)
x2 = paddle.static.data('x2', self.c_shape, self.dtype)
x3 = paddle.static.data('x3', self.c_shape, self.dtype)
x4 = paddle.static.data('x4', self.c_shape, self.dtype)
y = meshgrid_net(x1, x2, x3, x4)
res1 = paddle.tanh(y[0])
res2 = paddle.sin(y[1])
res3 = paddle.cos(y[2])
pir_program = pir.translate_to_pir(main_program.desc)
return pir_program
def test_build_op(self):
pir_program = self.get_ir_program()
y = pir_program.global_block().ops[-1].results()
orig_shape = y[0].shape
with paddle.pir_utils.IrGuard():
core._set_prim_forward_enabled(True)
y_new = decompose(pir_program, y)
core._set_prim_forward_enabled(False)
new_shape = y_new[0].shape
assert (
orig_shape == new_shape
), f"Original shape {orig_shape} is not equal to new shape {new_shape}"
op_name_list = [op.name() for op in pir_program.global_block().ops]
assert "pd_op.meshgrid" not in op_name_list
if __name__ == "__main__":
unittest.main()
```
|
Block Movement is the fifth album released by B-Legit. It was released on August 23, 2005 for Sick Wid It Records and SMC Recordings and featured production from Rick Rock, One Drop Scott, Jason Moss and G-Man Stan. Block Movement peaked at #91 on the Top R&B/Hip-Hop Albums and #33 on the Independent Albums chart.
Track listing
"Knock His Ass Out"- 3:03
"Trap Game"- 2:51
"Sick Wid It"- 3:40
"Dem Boyz"- 4:05
"Block 4 Life"- 3:50 (Featuring Jadakiss, Styles P & Clyde Carson)
"Round My Way"- 3:43
"Guess Who's Back"- 3:57 (Featuring E-40)
"Handle Up"- 3:26
"Kick It 2 Nite"- 4:02
"Where Dem Hoes At"- 3:24 (Featuring Paul Wall)
"Get High"- 4:31 (Featuring Keak da Sneak & Harm)
"Friendz"- 3:45
"Kill Somebody"- 3:23
"Shady"- 3:41
"Wanna Know Your Name"- 4:23
"Sewed Up"- 4:13
2005 albums
Albums produced by Rick Rock
B-Legit albums
|
Demetrius/Dimetrius "Dimmy" Frank/Franks (first ¼ 1876 – second ¼ 1954) was a Welsh rugby union, and professional rugby league footballer who played in the 1890s and 1900s. He played club level rugby union (RU) for Cardiff RFC, and club level rugby league (RL) for Hull FC, as a or , i.e. number 6, or 7.
Background
Dimmy Franks' birth was registered in Cardiff, Wales, he was the landlord of the Fleece Inn public house, Kingston upon Hull and the Myton Arms public house, Kingston upon Hull , as of November 1950 he was living in Cardiff, Wales., and his death aged was registered in East Glamorgan, Wales.
Background
Dimmy Franks' marriage was registered during fourth ¼ 1904 in Hull, England
References
External links
Search for "Franks" at rugbyleagueproject.org
(archived by web.archive.org) Stats → Past Players → "F"
(archived by web.archive.org) Statistics at hullfc.com
Search for "Dimmy Franks" at britishnewspaperarchive.co.uk
Search for "Demetrius Frank" at britishnewspaperarchive.co.uk
Search for "Demetrius Franks" at britishnewspaperarchive.co.uk
1876 births
1954 deaths
British publicans
Cardiff RFC players
Hull F.C. players
Place of death missing
Rugby league five-eighths
Rugby league halfbacks
Rugby league players from Cardiff
Rugby union players from Cardiff
Welsh rugby league players
Welsh rugby union players
|
```python
# flake8: noqa
# __streaming_example_start__
# File name: stream.py
from typing import AsyncGenerator, Generator
from ray import serve
from ray.serve.handle import DeploymentHandle, DeploymentResponseGenerator
@serve.deployment
class Streamer:
def __call__(self, limit: int) -> Generator[int, None, None]:
for i in range(limit):
yield i
@serve.deployment
class Caller:
def __init__(self, streamer: DeploymentHandle):
self._streamer = streamer.options(
# Must set `stream=True` on the handle, then the output will be a
# response generator.
stream=True,
)
async def __call__(self, limit: int) -> AsyncGenerator[int, None]:
# Response generator can be used in an `async for` block.
r: DeploymentResponseGenerator = self._streamer.remote(limit)
async for i in r:
yield i
app = Caller.bind(Streamer.bind())
handle: DeploymentHandle = serve.run(app).options(
stream=True,
)
# Response generator can also be used as a regular generator in a sync context.
r: DeploymentResponseGenerator = handle.remote(10)
assert list(r) == list(range(10))
# __streaming_example_end__
```
|
The Forest of Dean Sculpture Trail is a point of interest in the Forest of Dean in the county of Gloucestershire, England.
The Sculpture Trail links several different site-specific sculptures commissioned for the forest. It is open from dawn to dusk every day of the year. Admission is free, although there is a charge for car parking. There are currently 16 sculptures, made from various materials. A further 12 are no longer visible, or have been decommissioned due to safety reasons, and are being allowed to degrade naturally. The complete trail is ; shorter routes of visit a selection of the sculptures.
An estimated 300,000 people visit each year.
Commissioning commenced in 1986, originally in partnership with Arnolfini, Bristol's flagship contemporary art gallery, and following the establishment of the Trail has resulted in the presentation of more than 20 permanent sculptures, almost all of international significance, alongside temporary residencies and public events. The early sculptures were commissioned to be site-responsive and to interpret the forest, and the Trust adheres to this very particular strategy, which is what makes the Dean very different from other Sculpture Trails in the country.
Sculptures include Kevin Atherton's 15-foot by 10-foot stained glassed window Cathedral which hangs high in the canopy over the heads of walkers. Additional commissions include Neville Gabie’s Raw, a giant cube assembled from the entire mass of an oak tree, and acclaimed works by David Nash, Peter Randall-Page, Cornelia Parker and Annie Cattrell at crucial early stages in their careers.
The Forest of Dean Sculpture Trust continues to raise funds to commission additional works. The Trust (FODST) manages the Sculpture Trail, located at Beechenhurst, near Coleford in Gloucestershire, in partnership with the Forestry Commission in the Forest of Dean. The Trust is a registered charity and has a long record of commissioning sculpture and related temporary projects that are specific to the forest environment.
References
External links
Sculpture Trail website
Trail map from Sculpture Trail website
Photos of the Forest of Dean Sculpture Trail on geograph
Outdoor sculptures in England
Sculpture gardens, trails and parks in the United Kingdom
Tourist attractions in Gloucestershire
Forest of Dean
|
```xml
import { Notification } from '../Notification';
export interface TestMessage {
frame: number;
notification: Notification<any>;
isGhost?: boolean;
}
```
|
```swift
//
// MainWindowsController.swift
// RsyncOSX
//
// Created by Thomas Evensen on 01/12/2020.
//
import Cocoa
import Foundation
class MainWindowsController: NSWindowController {
func addtoolbar() {
globalMainQueue.async { () in
let toolbar = NSToolbar(identifier: "Toolbar")
toolbar.allowsUserCustomization = false
toolbar.autosavesConfiguration = false
toolbar.displayMode = .iconOnly
toolbar.delegate = self
self.window?.toolbar = toolbar
}
window?.toolbar?.validateVisibleItems()
}
override func windowDidLoad() {
super.windowDidLoad()
addtoolbar()
}
}
```
|
```xml
import type { MessageItem } from 'vscode';
import { QuickInputButtons, Uri, window, workspace } from 'vscode';
import type { Config } from '../../config';
import { proBadge, proBadgeSuperscript } from '../../constants';
import type { Container } from '../../container';
import { CancellationError } from '../../errors';
import { PlusFeatures } from '../../features';
import { convertLocationToOpenFlags, convertOpenFlagsToLocation, reveal } from '../../git/actions/worktree';
import {
ApplyPatchCommitError,
ApplyPatchCommitErrorReason,
WorktreeCreateError,
WorktreeCreateErrorReason,
WorktreeDeleteError,
WorktreeDeleteErrorReason,
} from '../../git/errors';
import { uncommitted, uncommittedStaged } from '../../git/models/constants';
import type { GitReference } from '../../git/models/reference';
import {
getNameWithoutRemote,
getReferenceLabel,
isBranchReference,
isRevisionReference,
isSha,
} from '../../git/models/reference';
import type { Repository } from '../../git/models/repository';
import type { GitWorktree } from '../../git/models/worktree';
import { showGenericErrorMessage } from '../../messages';
import type { QuickPickItemOfT } from '../../quickpicks/items/common';
import { createQuickPickSeparator } from '../../quickpicks/items/common';
import { Directive } from '../../quickpicks/items/directive';
import type { FlagsQuickPickItem } from '../../quickpicks/items/flags';
import { createFlagsQuickPickItem } from '../../quickpicks/items/flags';
import { configuration } from '../../system/configuration';
import { basename, isDescendant } from '../../system/path';
import type { Deferred } from '../../system/promise';
import { pluralize, truncateLeft } from '../../system/string';
import { getWorkspaceFriendlyPath, openWorkspace, revealInFileExplorer } from '../../system/utils';
import type { ViewsWithRepositoryFolders } from '../../views/viewBase';
import type {
AsyncStepResultGenerator,
CustomStep,
PartialStepState,
QuickPickStep,
StepGenerator,
StepResultGenerator,
StepSelection,
StepState,
} from '../quickCommand';
import {
canPickStepContinue,
canStepContinue,
createConfirmStep,
createCustomStep,
createPickStep,
endSteps,
QuickCommand,
StepResultBreak,
} from '../quickCommand';
import {
appendReposToTitle,
ensureAccessStep,
inputBranchNameStep,
pickBranchOrTagStep,
pickRepositoryStep,
pickWorktreesStep,
pickWorktreeStep,
} from '../quickCommand.steps';
interface Context {
repos: Repository[];
associatedView: ViewsWithRepositoryFolders;
defaultUri?: Uri;
pickedRootFolder?: Uri;
pickedSpecificFolder?: Uri;
showTags: boolean;
title: string;
worktrees?: GitWorktree[];
}
type CreateConfirmationChoice = Uri | 'changeRoot' | 'chooseFolder';
type CreateFlags = '--force' | '-b' | '--detach' | '--direct';
interface CreateState {
subcommand: 'create';
repo: string | Repository;
uri: Uri;
reference?: GitReference;
addRemote?: { name: string; url: string };
createBranch?: string;
flags: CreateFlags[];
result?: Deferred<GitWorktree | undefined>;
reveal?: boolean;
overrides?: {
title?: string;
};
onWorkspaceChanging?: (() => Promise<void>) | (() => void);
skipWorktreeConfirmations?: boolean;
}
type DeleteFlags = '--force';
interface DeleteState {
subcommand: 'delete';
repo: string | Repository;
uris: Uri[];
flags: DeleteFlags[];
overrides?: {
title?: string;
};
}
type OpenFlags = '--add-to-workspace' | '--new-window' | '--reveal-explorer';
interface OpenState {
subcommand: 'open';
repo: string | Repository;
worktree: GitWorktree;
flags: OpenFlags[];
openOnly?: boolean;
overrides?: {
disallowBack?: boolean;
title?: string;
confirmation?: {
title?: string;
placeholder?: string;
};
};
onWorkspaceChanging?: (() => Promise<void>) | (() => void);
skipWorktreeConfirmations?: boolean;
}
interface CopyChangesState {
subcommand: 'copy-changes';
repo: string | Repository;
worktree: GitWorktree;
changes:
| { baseSha?: string; contents?: string; type: 'index' | 'working-tree' }
| { baseSha: string; contents: string; type?: 'index' | 'working-tree' };
overrides?: {
title?: string;
};
}
type State = CreateState | DeleteState | OpenState | CopyChangesState;
type WorktreeStepState<T extends State> = SomeNonNullable<StepState<T>, 'subcommand'>;
type CreateStepState<T extends CreateState = CreateState> = WorktreeStepState<ExcludeSome<T, 'repo', string>>;
type DeleteStepState<T extends DeleteState = DeleteState> = WorktreeStepState<ExcludeSome<T, 'repo', string>>;
type OpenStepState<T extends OpenState = OpenState> = WorktreeStepState<ExcludeSome<T, 'repo', string>>;
type CopyChangesStepState<T extends CopyChangesState = CopyChangesState> = WorktreeStepState<
ExcludeSome<T, 'repo', string>
>;
function assertStateStepRepository(
state: PartialStepState<State>,
): asserts state is PartialStepState<State> & { repo: Repository } {
if (state.repo != null && typeof state.repo !== 'string') return;
debugger;
throw new Error('Missing repository');
}
const subcommandToTitleMap = new Map<State['subcommand'] | undefined, string>([
[undefined, `Worktrees ${proBadgeSuperscript}`],
['create', `Create Worktree`],
['delete', `Delete Worktrees`],
['open', `Open Worktree`],
['copy-changes', 'Copy Changes to'],
]);
function getTitle(subcommand: State['subcommand'] | undefined, suffix?: string) {
return `${subcommandToTitleMap.get(subcommand)}${suffix ?? ''}`;
}
export interface WorktreeGitCommandArgs {
readonly command: 'worktree';
confirm?: boolean;
state?: Partial<State>;
}
export class WorktreeGitCommand extends QuickCommand<State> {
private subcommand: State['subcommand'] | undefined;
constructor(container: Container, args?: WorktreeGitCommandArgs) {
super(container, 'worktree', 'worktree', `Worktrees ${proBadgeSuperscript}`, {
description: `${proBadge}\u00a0\u00a0open, create, or delete worktrees`,
});
let counter = 0;
if (args?.state?.subcommand != null) {
counter++;
switch (args.state.subcommand) {
case 'create':
if (args.state.uri != null) {
counter++;
}
if (args.state.reference != null) {
counter++;
}
break;
case 'delete':
if (args.state.uris != null && (!Array.isArray(args.state.uris) || args.state.uris.length !== 0)) {
counter++;
}
break;
case 'open':
if (args.state.worktree != null) {
counter++;
}
break;
case 'copy-changes':
if (args.state.worktree != null) {
counter++;
}
break;
}
}
if (args?.state?.repo != null) {
counter++;
}
this.initialState = {
counter: counter,
confirm: args?.confirm,
...args?.state,
};
}
override get canConfirm(): boolean {
return this.subcommand != null;
}
private _canSkipConfirmOverride: boolean | undefined;
override get canSkipConfirm(): boolean {
return this._canSkipConfirmOverride ?? this.subcommand === 'open';
}
override get skipConfirmKey() {
return `${this.key}${this.subcommand == null ? '' : `-${this.subcommand}`}:${this.pickedVia}`;
}
protected async *steps(state: PartialStepState<State>): StepGenerator {
const context: Context = {
repos: this.container.git.openRepositories,
associatedView: this.container.worktreesView,
showTags: false,
title: this.title,
};
let skippedStepTwo = false;
while (this.canStepsContinue(state)) {
context.title = state.overrides?.title ?? this.title;
if (state.counter < 1 || state.subcommand == null) {
this.subcommand = undefined;
const result = yield* this.pickSubcommandStep(state);
// Always break on the first step (so we will go back)
if (result === StepResultBreak) break;
state.subcommand = result;
}
this.subcommand = state.subcommand;
context.title = state.overrides?.title ?? getTitle(state.subcommand);
if (state.counter < 2 || state.repo == null || typeof state.repo === 'string') {
skippedStepTwo = false;
if (context.repos.length === 1) {
skippedStepTwo = true;
if (state.repo == null) {
state.counter++;
}
state.repo = context.repos[0];
} else {
const result = yield* pickRepositoryStep(state, context);
if (result === StepResultBreak) continue;
state.repo = result;
}
}
if (state.subcommand !== 'copy-changes') {
// Ensure we use the "main" repository if we are in a worktree already
state.repo = (await state.repo.getCommonRepository()) ?? state.repo;
}
assertStateStepRepository(state);
const result = yield* ensureAccessStep(state, context, PlusFeatures.Worktrees);
if (result === StepResultBreak) continue;
switch (state.subcommand) {
case 'create': {
yield* this.createCommandSteps(state as CreateStepState, context);
// Clear any chosen path, since we are exiting this subcommand
state.uri = undefined;
break;
}
case 'delete': {
if (state.uris != null && !Array.isArray(state.uris)) {
state.uris = [state.uris];
}
yield* this.deleteCommandSteps(state as DeleteStepState, context);
break;
}
case 'open': {
yield* this.openCommandSteps(state as OpenStepState, context);
break;
}
case 'copy-changes': {
yield* this.copyChangesCommandSteps(state as CopyChangesStepState, context);
break;
}
default:
endSteps(state);
break;
}
// If we skipped the previous step, make sure we back up past it
if (skippedStepTwo) {
state.counter--;
}
}
return state.counter < 0 ? StepResultBreak : undefined;
}
private *pickSubcommandStep(state: PartialStepState<State>): StepResultGenerator<State['subcommand']> {
const step = createPickStep<QuickPickItemOfT<State['subcommand']>>({
title: this.title,
placeholder: `Choose a ${this.label} command`,
items: [
{
label: 'open',
description: 'opens the specified worktree',
picked: state.subcommand === 'open',
item: 'open',
},
{
label: 'create',
description: 'creates a new worktree',
picked: state.subcommand === 'create',
item: 'create',
},
{
label: 'delete',
description: 'deletes the specified worktrees',
picked: state.subcommand === 'delete',
item: 'delete',
},
],
buttons: [QuickInputButtons.Back],
});
const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection) ? selection[0].item : StepResultBreak;
}
private async *createCommandSteps(state: CreateStepState, context: Context): AsyncStepResultGenerator<void> {
if (context.defaultUri == null) {
context.defaultUri = await state.repo.getWorktreesDefaultUri();
}
if (state.flags == null) {
state.flags = [];
}
context.pickedRootFolder = undefined;
context.pickedSpecificFolder = undefined;
// Don't allow skipping the confirm step
state.confirm = true;
this._canSkipConfirmOverride = undefined;
while (this.canStepsContinue(state)) {
if (state.counter < 3 || state.reference == null) {
const result = yield* pickBranchOrTagStep(state, context, {
placeholder: context =>
`Choose a branch${context.showTags ? ' or tag' : ''} to create the new worktree for`,
picked: state.reference?.ref ?? (await state.repo.getBranch())?.ref,
titleContext: ' for',
value: isRevisionReference(state.reference) ? state.reference.ref : undefined,
});
// Always break on the first step (so we will go back)
if (result === StepResultBreak) break;
state.reference = result;
}
if (state.uri == null) {
state.uri = context.defaultUri!;
}
if (this.confirm(state.confirm)) {
const result = yield* this.createCommandConfirmStep(state, context);
if (result === StepResultBreak) continue;
if (typeof result[0] === 'string') {
switch (result[0]) {
case 'changeRoot': {
const result = yield* this.createCommandChoosePathStep(state, context, {
title: `Choose a Different Root Folder for this Worktree`,
label: 'Choose Root Folder',
pickedUri: context.pickedRootFolder,
defaultUri: context.pickedRootFolder ?? context.defaultUri,
});
if (result === StepResultBreak) continue;
state.uri = result;
// Keep track of the actual uri they picked, because we will modify it in later steps
context.pickedRootFolder = state.uri;
context.pickedSpecificFolder = undefined;
continue;
}
case 'chooseFolder': {
const result = yield* this.createCommandChoosePathStep(state, context, {
title: `Choose a Specific Folder for this Worktree`,
label: 'Choose Worktree Folder',
pickedUri: context.pickedRootFolder,
defaultUri: context.pickedSpecificFolder ?? context.defaultUri,
});
if (result === StepResultBreak) continue;
state.uri = result;
// Keep track of the actual uri they picked, because we will modify it in later steps
context.pickedRootFolder = undefined;
context.pickedSpecificFolder = state.uri;
continue;
}
}
}
[state.uri, state.flags] = result;
}
// Reset any confirmation overrides
state.confirm = true;
this._canSkipConfirmOverride = undefined;
const isRemoteBranch = state.reference?.refType === 'branch' && state.reference?.remote;
if (isRemoteBranch && !state.flags.includes('-b')) {
state.flags.push('-b');
state.createBranch = getNameWithoutRemote(state.reference);
const branch = await state.repo.getBranch(state.createBranch);
if (branch != null) {
state.createBranch = state.reference.name;
}
}
if (state.flags.includes('-b')) {
let createBranchOverride: string | undefined;
if (state.createBranch != null) {
let valid = await this.container.git.validateBranchOrTagName(state.repo.path, state.createBranch);
if (valid) {
const alreadyExists = await state.repo.getBranch(state.createBranch);
valid = alreadyExists == null;
}
if (!valid) {
createBranchOverride = state.createBranch;
state.createBranch = undefined;
}
}
if (state.createBranch == null) {
const result = yield* inputBranchNameStep(state, context, {
titleContext: ` and New Branch from ${getReferenceLabel(state.reference, {
capitalize: true,
icon: false,
label: state.reference.refType !== 'branch',
})}`,
value: createBranchOverride ?? state.createBranch ?? getNameWithoutRemote(state.reference),
});
if (result === StepResultBreak) {
// Clear the flags, since we can backup after the confirm step below (which is non-standard)
state.flags = [];
continue;
}
state.createBranch = result;
}
}
const uri = state.flags.includes('--direct')
? state.uri
: Uri.joinPath(
state.uri,
...(state.createBranch ?? state.reference.name).replace(/\\/g, '/').split('/'),
);
let worktree: GitWorktree | undefined;
try {
if (state.addRemote != null) {
await state.repo.addRemote(state.addRemote.name, state.addRemote.url, { fetch: true });
}
worktree = await state.repo.createWorktree(uri, {
commitish: state.reference?.name,
createBranch: state.flags.includes('-b') ? state.createBranch : undefined,
detach: state.flags.includes('--detach'),
force: state.flags.includes('--force'),
});
state.result?.fulfill(worktree);
} catch (ex) {
if (
WorktreeCreateError.is(ex, WorktreeCreateErrorReason.AlreadyCheckedOut) &&
!state.flags.includes('--force')
) {
const createBranch: MessageItem = { title: 'Create New Branch' };
const force: MessageItem = { title: 'Create Anyway' };
const cancel: MessageItem = { title: 'Cancel', isCloseAffordance: true };
const result = await window.showWarningMessage(
`Unable to create the new worktree because ${getReferenceLabel(state.reference, {
icon: false,
quoted: true,
})} is already checked out.\n\nWould you like to create a new branch for this worktree or forcibly create it anyway?`,
{ modal: true },
createBranch,
force,
cancel,
);
if (result === createBranch) {
state.flags.push('-b');
this._canSkipConfirmOverride = true;
state.confirm = false;
continue;
}
if (result === force) {
state.flags.push('--force');
this._canSkipConfirmOverride = true;
state.confirm = false;
continue;
}
} else if (WorktreeCreateError.is(ex, WorktreeCreateErrorReason.AlreadyExists)) {
const confirm: MessageItem = { title: 'OK' };
const openFolder: MessageItem = { title: 'Open Folder' };
void window
.showErrorMessage(
`Unable to create a new worktree in '${getWorkspaceFriendlyPath(
uri,
)}' because the folder already exists and is not empty.`,
confirm,
openFolder,
)
.then(result => {
if (result === openFolder) {
void revealInFileExplorer(uri);
}
});
} else {
void showGenericErrorMessage(
`Unable to create a new worktree in '${getWorkspaceFriendlyPath(uri)}.`,
);
}
}
endSteps(state);
if (worktree == null) break;
if (state.reveal !== false) {
setTimeout(() => {
if (this.container.worktreesView.visible) {
void reveal(worktree, { select: true, focus: false });
}
}, 100);
}
type OpenAction = Config['worktrees']['openAfterCreate'];
const action: OpenAction = configuration.get('worktrees.openAfterCreate');
if (action !== 'never') {
let flags: OpenFlags[];
switch (action) {
case 'always':
flags = convertLocationToOpenFlags('currentWindow');
break;
case 'alwaysNewWindow':
flags = convertLocationToOpenFlags('newWindow');
break;
case 'onlyWhenEmpty':
flags = convertLocationToOpenFlags(
workspace.workspaceFolders?.length ? 'newWindow' : 'currentWindow',
);
break;
default:
flags = [];
break;
}
yield* this.openCommandSteps(
{
subcommand: 'open',
repo: state.repo,
worktree: worktree,
flags: flags,
counter: 3,
confirm: action === 'prompt',
openOnly: true,
overrides: { disallowBack: true },
skipWorktreeConfirmations: state.skipWorktreeConfirmations,
onWorkspaceChanging: state.onWorkspaceChanging,
} satisfies OpenStepState,
context,
);
}
}
}
private *createCommandChoosePathStep(
state: CreateStepState,
context: Context,
options: { title: string; label: string; pickedUri: Uri | undefined; defaultUri?: Uri },
): StepResultGenerator<Uri> {
const step = createCustomStep<Uri>({
show: async (_step: CustomStep<Uri>) => {
const uris = await window.showOpenDialog({
canSelectFiles: false,
canSelectFolders: true,
canSelectMany: false,
defaultUri: options.pickedUri ?? state.uri ?? context.defaultUri,
openLabel: options.label,
title: options.title,
});
if (uris == null || uris.length === 0) return Directive.Back;
return uris[0];
},
});
const value: StepSelection<typeof step> = yield step;
if (!canStepContinue(step, state, value)) return StepResultBreak;
return value;
}
private *createCommandConfirmStep(
state: CreateStepState,
context: Context,
): StepResultGenerator<[CreateConfirmationChoice, CreateFlags[]]> {
/**
* Here are the rules for creating the recommended path for the new worktree:
*
* If the user picks a folder outside the repo, it will be `<chosen-path>/<repo>.worktrees/<?branch>`
* If the user picks the repo folder, it will be `<repo>/../<repo>.worktrees/<?branch>`
* If the user picks a folder inside the repo, it will be `<repo>/../<repo>.worktrees/<?branch>`
*/
let createDirectlyInFolder = false;
if (context.pickedSpecificFolder != null) {
createDirectlyInFolder = true;
}
const pickedUri = context.pickedSpecificFolder ?? context.pickedRootFolder ?? state.uri;
const pickedFriendlyPath = truncateLeft(getWorkspaceFriendlyPath(pickedUri), 60);
let recommendedRootUri;
const repoUri = state.repo.uri;
const trailer = `${basename(repoUri.path)}.worktrees`;
if (repoUri.toString() !== pickedUri.toString()) {
if (isDescendant(pickedUri, repoUri)) {
recommendedRootUri = Uri.joinPath(repoUri, '..', trailer);
} else if (basename(pickedUri.path) === trailer) {
recommendedRootUri = pickedUri;
} else {
recommendedRootUri = Uri.joinPath(pickedUri, trailer);
}
} else {
recommendedRootUri = Uri.joinPath(repoUri, '..', trailer);
// Don't allow creating directly into the main worktree folder
createDirectlyInFolder = false;
}
const branchName = state.reference != null ? getNameWithoutRemote(state.reference) : undefined;
const recommendedFriendlyPath = `<root>/${truncateLeft(
`${trailer}/${branchName?.replace(/\\/g, '/') ?? ''}`,
65,
)}`;
const recommendedNewBranchFriendlyPath = `<root>/${trailer}/${state.createBranch || '<new-branch-name>'}`;
const isBranch = isBranchReference(state.reference);
const isRemoteBranch = isBranchReference(state.reference) && state.reference?.remote;
type StepType = FlagsQuickPickItem<CreateFlags, CreateConfirmationChoice>;
const defaultOption = createFlagsQuickPickItem<CreateFlags, Uri>(
state.flags,
[],
{
label: isRemoteBranch
? 'Create Worktree for New Local Branch'
: isBranch
? 'Create Worktree for Branch'
: context.title,
description: '',
detail: `Will create worktree in $(folder) ${recommendedFriendlyPath}`,
},
recommendedRootUri,
);
const confirmations: StepType[] = [];
if (!createDirectlyInFolder) {
if (!state.createBranch) {
if (state.skipWorktreeConfirmations) {
return [defaultOption.context, defaultOption.item];
}
confirmations.push(defaultOption);
}
confirmations.push(
createFlagsQuickPickItem<CreateFlags, Uri>(
state.flags,
['-b'],
{
label: isRemoteBranch
? 'Create Worktree for New Local Branch Named...'
: 'Create Worktree for New Branch Named...',
description: '',
detail: `Will create worktree in $(folder) ${recommendedNewBranchFriendlyPath}`,
},
recommendedRootUri,
),
);
} else {
if (!state.createBranch) {
confirmations.push(
createFlagsQuickPickItem<CreateFlags, Uri>(
state.flags,
['--direct'],
{
label: isRemoteBranch
? 'Create Worktree for Local Branch'
: isBranch
? 'Create Worktree for Branch'
: context.title,
description: '',
detail: `Will create worktree directly in $(folder) ${truncateLeft(
pickedFriendlyPath,
60,
)}`,
},
pickedUri,
),
);
}
confirmations.push(
createFlagsQuickPickItem<CreateFlags, Uri>(
state.flags,
['-b', '--direct'],
{
label: isRemoteBranch
? 'Create Worktree for New Local Branch'
: 'Create Worktree for New Branch',
description: '',
detail: `Will create worktree directly in $(folder) ${truncateLeft(pickedFriendlyPath, 60)}`,
},
pickedUri,
),
);
}
if (!createDirectlyInFolder) {
confirmations.push(
createQuickPickSeparator(),
createFlagsQuickPickItem<CreateFlags, CreateConfirmationChoice>(
[],
[],
{
label: 'Change Root Folder...',
description: `$(folder) ${truncateLeft(pickedFriendlyPath, 65)}`,
picked: false,
},
'changeRoot',
),
);
}
confirmations.push(
createFlagsQuickPickItem<CreateFlags, CreateConfirmationChoice>(
[],
[],
{
label: 'Choose a Specific Folder...',
description: '',
picked: false,
},
'chooseFolder',
),
);
const step = createConfirmStep(
appendReposToTitle(
`Confirm ${context.title} \u2022 ${
state.createBranch ||
getReferenceLabel(state.reference, {
icon: false,
label: false,
})
}`,
state,
context,
),
confirmations,
context,
);
const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection)
? [selection[0].context, selection[0].item]
: StepResultBreak;
}
private async *deleteCommandSteps(state: DeleteStepState, context: Context): StepGenerator {
context.worktrees = await state.repo.getWorktrees();
if (state.flags == null) {
state.flags = [];
}
while (this.canStepsContinue(state)) {
if (state.counter < 3 || state.uris == null || state.uris.length === 0) {
context.title = getTitle(state.subcommand);
const result = yield* pickWorktreesStep(state, context, {
filter: wt => !wt.main || !wt.opened, // Can't delete the main or opened worktree
includeStatus: true,
picked: state.uris?.map(uri => uri.toString()),
placeholder: 'Choose worktrees to delete',
});
// Always break on the first step (so we will go back)
if (result === StepResultBreak) break;
state.uris = result.map(w => w.uri);
}
context.title = getTitle(state.subcommand);
const result = yield* this.deleteCommandConfirmStep(state, context);
if (result === StepResultBreak) continue;
state.flags = result;
endSteps(state);
for (const uri of state.uris) {
let retry = false;
let skipHasChangesPrompt = false;
do {
retry = false;
const force = state.flags.includes('--force');
try {
if (force) {
const worktree = context.worktrees.find(wt => wt.uri.toString() === uri.toString());
let status;
try {
status = await worktree?.getStatus();
} catch {}
if ((status?.hasChanges ?? false) && !skipHasChangesPrompt) {
const confirm: MessageItem = { title: 'Force Delete' };
const cancel: MessageItem = { title: 'Cancel', isCloseAffordance: true };
const result = await window.showWarningMessage(
`The worktree in '${uri.fsPath}' has uncommitted changes.\n\nDeleting it will cause those changes to be FOREVER LOST.\nThis is IRREVERSIBLE!\n\nAre you sure you still want to delete it?`,
{ modal: true },
confirm,
cancel,
);
if (result !== confirm) return;
}
}
await state.repo.deleteWorktree(uri, { force: force });
} catch (ex) {
skipHasChangesPrompt = false;
if (WorktreeDeleteError.is(ex)) {
if (ex.reason === WorktreeDeleteErrorReason.MainWorkingTree) {
void window.showErrorMessage('Unable to delete the main worktree');
} else if (!force) {
const confirm: MessageItem = { title: 'Force Delete' };
const cancel: MessageItem = { title: 'Cancel', isCloseAffordance: true };
const result = await window.showErrorMessage(
ex.reason === WorktreeDeleteErrorReason.HasChanges
? `Unable to delete worktree because there are UNCOMMITTED changes in '${uri.fsPath}'.\n\nForcibly deleting it will cause those changes to be FOREVER LOST.\nThis is IRREVERSIBLE!\n\nWould you like to forcibly delete it?`
: `Unable to delete worktree in '${uri.fsPath}'.\n\nWould you like to try to forcibly delete it?`,
{ modal: true },
confirm,
cancel,
);
if (result === confirm) {
state.flags.push('--force');
retry = true;
skipHasChangesPrompt = ex.reason === WorktreeDeleteErrorReason.HasChanges;
}
}
} else {
void showGenericErrorMessage(`Unable to delete worktree in '${uri.fsPath}.`);
}
}
} while (retry);
}
}
}
private *deleteCommandConfirmStep(state: DeleteStepState, context: Context): StepResultGenerator<DeleteFlags[]> {
const step: QuickPickStep<FlagsQuickPickItem<DeleteFlags>> = createConfirmStep(
appendReposToTitle(`Confirm ${context.title}`, state, context),
[
createFlagsQuickPickItem<DeleteFlags>(state.flags, [], {
label: context.title,
detail: `Will delete ${pluralize('worktree', state.uris.length, {
only: state.uris.length === 1,
})}${state.uris.length === 1 ? ` in $(folder) ${getWorkspaceFriendlyPath(state.uris[0])}` : ''}`,
}),
createFlagsQuickPickItem<DeleteFlags>(state.flags, ['--force'], {
label: `Force ${context.title}`,
description: 'including ANY UNCOMMITTED changes',
detail: `Will forcibly delete ${pluralize('worktree', state.uris.length, {
only: state.uris.length === 1,
})} ${state.uris.length === 1 ? ` in $(folder) ${getWorkspaceFriendlyPath(state.uris[0])}` : ''}`,
}),
],
context,
);
const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection) ? selection[0].item : StepResultBreak;
}
private async *openCommandSteps(state: OpenStepState, context: Context): StepGenerator {
if (state.flags == null) {
state.flags = [];
}
// Allow skipping the confirm step
this._canSkipConfirmOverride = true;
while (this.canStepsContinue(state)) {
if (state.counter < 3 || state.worktree == null) {
context.title = getTitle(state.subcommand);
context.worktrees ??= await state.repo.getWorktrees();
const result = yield* pickWorktreeStep(state, context, {
excludeOpened: true,
includeStatus: true,
picked: state.worktree?.uri?.toString(),
placeholder: 'Choose worktree to open',
});
// Always break on the first step (so we will go back)
if (result === StepResultBreak) break;
state.worktree = result;
}
context.title = getTitle(state.subcommand, ` \u2022 ${state.worktree.name}`);
if (this.confirm(state.confirm)) {
const result = yield* this.openCommandConfirmStep(state, context);
if (result === StepResultBreak) continue;
state.flags = result;
}
endSteps(state);
if (state.flags.includes('--reveal-explorer')) {
void revealInFileExplorer(state.worktree.uri);
} else {
let name;
const repo = (await state.repo.getCommonRepository()) ?? state.repo;
if (repo.name !== state.worktree.name) {
name = `${repo.name}: ${state.worktree.name}`;
} else {
name = state.worktree.name;
}
const location = convertOpenFlagsToLocation(state.flags);
if (location === 'currentWindow' || location === 'newWindow') {
await state.onWorkspaceChanging?.();
}
openWorkspace(state.worktree.uri, { location: convertOpenFlagsToLocation(state.flags), name: name });
}
}
}
private *openCommandConfirmStep(state: OpenStepState, context: Context): StepResultGenerator<OpenFlags[]> {
type StepType = FlagsQuickPickItem<OpenFlags>;
const newWindowItem = createFlagsQuickPickItem<OpenFlags>(state.flags, ['--new-window'], {
label: `Open Worktree in a New Window`,
detail: 'Will open the worktree in a new window',
});
if (state.skipWorktreeConfirmations) {
return newWindowItem.item;
}
const confirmations: StepType[] = [
createFlagsQuickPickItem<OpenFlags>(state.flags, [], {
label: 'Open Worktree',
detail: 'Will open the worktree in the current window',
}),
newWindowItem,
createFlagsQuickPickItem<OpenFlags>(state.flags, ['--add-to-workspace'], {
label: `Add Worktree to Workspace`,
detail: 'Will add the worktree into the current workspace',
}),
];
if (!state.openOnly) {
confirmations.push(
createQuickPickSeparator(),
createFlagsQuickPickItem<OpenFlags>(state.flags, ['--reveal-explorer'], {
label: `Reveal in File Explorer`,
description: `$(folder) ${truncateLeft(getWorkspaceFriendlyPath(state.worktree.uri), 40)}`,
detail: 'Will open the worktree in the File Explorer',
}),
);
}
const step = createConfirmStep(
appendReposToTitle(state.overrides?.confirmation?.title ?? `Confirm ${context.title}`, state, context),
confirmations,
context,
undefined,
{
disallowBack: state.overrides?.disallowBack,
placeholder: state.overrides?.confirmation?.placeholder ?? 'Confirm Open Worktree',
},
);
const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection) ? selection[0].item : StepResultBreak;
}
private async *copyChangesCommandSteps(state: CopyChangesStepState, context: Context): StepGenerator {
while (this.canStepsContinue(state)) {
context.title = state?.overrides?.title ?? getTitle(state.subcommand);
if (state.counter < 3 || state.worktree == null) {
context.worktrees ??= await state.repo.getWorktrees();
let placeholder;
switch (state.changes.type) {
case 'index':
placeholder = 'Choose a worktree to copy your staged changes to';
break;
case 'working-tree':
placeholder = 'Choose a worktree to copy your working changes to';
break;
default:
placeholder = 'Choose a worktree to copy changes to';
break;
}
const result = yield* pickWorktreeStep(state, context, {
excludeOpened: true,
includeStatus: true,
picked: state.worktree?.uri?.toString(),
placeholder: placeholder,
});
// Always break on the first step (so we will go back)
if (result === StepResultBreak) break;
state.worktree = result;
}
if (!state.changes.contents || !state.changes.baseSha) {
const diff = await this.container.git.getDiff(
state.repo.uri,
state.changes.type === 'index' ? uncommittedStaged : uncommitted,
'HEAD',
);
if (!diff?.contents) {
void window.showErrorMessage(`No changes to copy`);
endSteps(state);
break;
}
state.changes.contents = diff.contents;
state.changes.baseSha = diff.from;
}
if (!isSha(state.changes.baseSha)) {
const commit = await this.container.git.getCommit(state.repo.uri, state.changes.baseSha);
if (commit != null) {
state.changes.baseSha = commit.sha;
}
}
if (this.confirm(state.confirm)) {
const result = yield* this.copyChangesCommandConfirmStep(state, context);
if (result === StepResultBreak) continue;
}
endSteps(state);
try {
const commit = await this.container.git.createUnreachableCommitForPatch(
state.worktree.uri,
state.changes.contents,
state.changes.baseSha,
'Copied Changes',
);
if (commit == null) return;
await this.container.git.applyUnreachableCommitForPatch(state.worktree.uri, commit.sha, {
stash: false,
});
void window.showInformationMessage(`Changes copied successfully`);
} catch (ex) {
if (ex instanceof CancellationError) return;
if (ex instanceof ApplyPatchCommitError) {
if (ex.reason === ApplyPatchCommitErrorReason.AppliedWithConflicts) {
void window.showWarningMessage('Changes copied with conflicts');
} else if (ex.reason === ApplyPatchCommitErrorReason.ApplyAbortedWouldOverwrite) {
void window.showErrorMessage(
'Unable to copy changes as some local changes would be overwritten',
);
return;
} else {
void window.showErrorMessage(`Unable to copy changes: ${ex.message}`);
return;
}
} else {
void window.showErrorMessage(`Unable to copy changes: ${ex.message}`);
return;
}
}
yield* this.openCommandSteps(
{
subcommand: 'open',
repo: state.repo,
worktree: state.worktree,
flags: [],
counter: 3,
confirm: true,
openOnly: true,
overrides: { disallowBack: true },
} satisfies OpenStepState,
context,
);
}
}
private async *copyChangesCommandConfirmStep(
state: CopyChangesStepState,
context: Context,
): AsyncStepResultGenerator<void> {
const files = await this.container.git.getDiffFiles(state.repo.uri, state.changes.contents!);
const count = files?.files.length ?? 0;
const confirmations = [];
switch (state.changes.type) {
case 'index':
confirmations.push({
label: 'Copy Staged Changes to Worktree',
detail: `Will copy the staged changes${
count > 0 ? ` (${pluralize('file', count)})` : ''
} to worktree '${state.worktree.name}'`,
});
break;
case 'working-tree':
confirmations.push({
label: 'Copy Working Changes to Worktree',
detail: `Will copy the working changes${
count > 0 ? ` (${pluralize('file', count)})` : ''
} to worktree '${state.worktree.name}'`,
});
break;
default:
confirmations.push(
createFlagsQuickPickItem([], [], {
label: 'Copy Changes to Worktree',
detail: `Will copy the changes${
count > 0 ? ` (${pluralize('file', count)})` : ''
} to worktree '${state.worktree.name}'`,
}),
);
break;
}
const step = createConfirmStep(
`Confirm ${context.title} \u2022 ${state.worktree.name}`,
confirmations,
context,
);
const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection) ? undefined : StepResultBreak;
}
}
```
|
```javascript
//your_sha256_hash---------------------------------------
//your_sha256_hash---------------------------------------
function print(x) { WScript.Echo(x+''); }
function inner(func) {
print(func.caller);
if (func.arguments)
{
print(func.arguments[0]);
print(func.arguments.caller);
}
if (func.caller) {
if (func.arguments.caller) {
print(func.arguments.caller[0]);
} else {
print("func.arguments.caller undefined");
}
}
print("");
}
function f() {
inner(f);
try {
try {
throw null;
}
finally {
inner(g);
}
}
catch (e) {
inner(f);
}
}
function g() {
f("f from g");
}
f("f from global");
g("g from global");
function callerA() {
AA(null);
}
function AA(x) {
print(AA.caller);
}
function callerB() {
eval("AB(null)");
}
function AB(x) {
print(AB.caller);
}
callerA();
callerB();
(function() {
print(arguments.caller);
print(delete arguments.caller);
print(arguments.caller);
arguments.caller = 0;
print(arguments.caller);
function f() {
print(arguments.caller);
print(delete arguments.caller);
print(arguments.caller);
arguments.caller = 0;
print(arguments.caller);
}
f();
})();
function test0(){
var func0 = function(){
var __loopvar1 = 0;
while(((b <<= (arguments.caller && arguments.caller[1]) ? 3 : 1)) && __loopvar1 < 3) {
__loopvar1++;
}
}
var func2 = function(){
func0();
}
var b = 1;
function bar0 () {
func2();
}
bar0(1, 1, 1);
WScript.Echo("b = " + (b|0));
};
// generate profile
test0();
test0();
```
|
The Parricide (also spelt The Parracide) is a 1736 tragedy by the Irish writer James Sterling.
The original Goodman's Fields Theatre cast included Benjamin Johnson as Altamar, William Havard as Montesini, Henry Giffard as Mirzabdi, Henry Woodward as Issouf, Anna Marcella Giffard as Beleyda and Sarah Hamilton as Amanthe.
References
Bibliography
Avery, Emmett Langdon . The London Stage, Volume III: A Calendar Of Plays, Entertainments And Afterpieces, Together With Casts, Box Receipts And Contemporary Comment. Southern Illinois University Press, 1961.
Burling, William J. A Checklist of New Plays and Entertainments on the London Stage, 1700-1737. Fairleigh Dickinson Univ Press, 1992.
1736 plays
British plays
Irish plays
West End plays
Tragedy plays
|
```smalltalk
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Roslynator.CSharp.CodeFixes;
using Roslynator.Testing.CSharp;
using Xunit;
namespace Roslynator.CSharp.Analysis.Tests;
public class RCS1154SortEnumMembersTests : AbstractCSharpDiagnosticVerifier<SortEnumMembersAnalyzer, EnumDeclarationCodeFixProvider>
{
public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SortEnumMembers;
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
B = 1,
A = 0,
D = 3,
C = 2
}
", @"
enum Foo
{
A = 0,
B = 1,
C = 2,
D = 3
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test_TrailingSeparator()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
B = 1,
A = 0,
D = 3,
C = 2,
}
", @"
enum Foo
{
A = 0,
B = 1,
C = 2,
D = 3,
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test_EmptyLines()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
B = 1,
A = 0,
D = 3,
C = 2
}
", @"
enum Foo
{
A = 0,
B = 1,
C = 2,
D = 3
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test_WithComments()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
/// <summary>B</summary>
B = 1, // B
/// <summary>A</summary>
A = 0, // A
/// <summary>D</summary>
D = 3, // D
/// <summary>C</summary>
C = 2, // C
}
", @"
enum Foo
{
/// <summary>A</summary>
A = 0, // A
/// <summary>B</summary>
B = 1, // B
/// <summary>C</summary>
C = 2, // C
/// <summary>D</summary>
D = 3, // D
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test_Comments_EmptyLines()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
/// <summary>B</summary>
B = 1, // B
/// <summary>A</summary>
A = 0, // A
/// <summary>D</summary>
D = 3, // D
/// <summary>C</summary>
C = 2 // C
}
", @"
enum Foo
{
/// <summary>A</summary>
A = 0, // A
/// <summary>B</summary>
B = 1, // B
/// <summary>C</summary>
C = 2, // C
/// <summary>D</summary>
D = 3 // D
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SortEnumMembers)]
public async Task Test_Comments_EmptyLines_TrailingSeparator()
{
await VerifyDiagnosticAndFixAsync(@"
enum [|Foo|]
{
/// <summary>B</summary>
B = 1, // B
/// <summary>A</summary>
A = 0, // A
/// <summary>D</summary>
D = 3, // D
/// <summary>C</summary>
C = 2, // C
}
", @"
enum Foo
{
/// <summary>A</summary>
A = 0, // A
/// <summary>B</summary>
B = 1, // B
/// <summary>C</summary>
C = 2, // C
/// <summary>D</summary>
D = 3, // D
}
");
}
}
```
|
```java
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*
*/
package org.quartz.examples.example9;
import static org.quartz.JobBuilder.newJob;
import static org.quartz.TriggerBuilder.newTrigger;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.JobListener;
import org.quartz.Matcher;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SchedulerMetaData;
import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.matchers.KeyMatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Demonstrates the behavior of <code>JobListener</code>s. In particular, this example will use a job listener to
* trigger another job after one job succesfully executes.
*/
public class ListenerExample {
public void run() throws Exception {
Logger log = LoggerFactory.getLogger(ListenerExample.class);
log.info("------- Initializing ----------------------");
// First we must get a reference to a scheduler
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
log.info("------- Initialization Complete -----------");
log.info("------- Scheduling Jobs -------------------");
// schedule a job to run immediately
JobDetail job = newJob(SimpleJob1.class).withIdentity("job1").build();
Trigger trigger = newTrigger().withIdentity("trigger1").startNow().build();
// Set up the listener
JobListener listener = new Job1Listener();
Matcher<JobKey> matcher = KeyMatcher.keyEquals(job.getKey());
sched.getListenerManager().addJobListener(listener, matcher);
// schedule the job to run
sched.scheduleJob(job, trigger);
// All of the jobs have been added to the scheduler, but none of the jobs
// will run until the scheduler has been started
log.info("------- Starting Scheduler ----------------");
sched.start();
// wait 30 seconds:
// note: nothing will run
log.info("------- Waiting 30 seconds... --------------");
try {
// wait 30 seconds to show jobs
Thread.sleep(30L * 1000L);
// executing...
} catch (Exception e) {
//
}
// shut down the scheduler
log.info("------- Shutting Down ---------------------");
sched.shutdown(true);
log.info("------- Shutdown Complete -----------------");
SchedulerMetaData metaData = sched.getMetaData();
log.info("Executed " + metaData.getNumberOfJobsExecuted() + " jobs.");
}
public static void main(String[] args) throws Exception {
ListenerExample example = new ListenerExample();
example.run();
}
}
```
|
```xml
//
//
// Microsoft Bot Framework: path_to_url
//
// Bot Framework Emulator Github:
// path_to_url
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import {
updateNewTunnelInfo,
updateTunnelError,
updateTunnelStatus,
NgrokTunnelActions,
TunnelInfo,
TunnelError,
TunnelStatus,
checkOnTunnel,
setTimeIntervalSinceLastPing,
TunnelCheckTimeInterval,
clearAllNotifications,
addNotification,
} from './ngrokTunnelActions';
describe('Ngrok Tunnel Actions', () => {
it('should create an update tunnel info action', () => {
const payload: TunnelInfo = {
publicUrl: 'path_to_url
inspectUrl: 'path_to_url
logPath: 'ngrok.log',
postmanCollectionPath: 'postman.json',
};
const action = updateNewTunnelInfo(payload);
expect(action.type).toBe(NgrokTunnelActions.setDetails);
expect(action.payload).toEqual(payload);
});
it('should create a update tunnel error action', () => {
const payload: TunnelError = {
statusCode: 402,
errorMessage: 'Tunnel has expired',
};
const action = updateTunnelError(payload);
expect(action.type).toBe(NgrokTunnelActions.updateOnError);
expect(action.payload).toEqual(payload);
});
it('should create a tunnel status update action', () => {
const mockDate = new Date(1466424490000);
jest.spyOn(global, 'Date').mockImplementation(() => mockDate as any);
const expectedStatus: TunnelStatus = TunnelStatus.Active;
const action = updateTunnelStatus({
tunnelStatus: expectedStatus,
});
expect(action.type).toBe(NgrokTunnelActions.setStatus);
expect(action.payload.timestamp).toBe(new Date().getTime());
expect(action.payload.status).toBe(expectedStatus);
});
it('should create a tunnel status update action on TunnelError', () => {
const mockDate = new Date(1466424490000);
jest.spyOn(global, 'Date').mockImplementation(() => mockDate as any);
const expectedStatus: TunnelStatus = TunnelStatus.Error;
const action = updateTunnelStatus({
tunnelStatus: expectedStatus,
});
expect(action.type).toBe(NgrokTunnelActions.setStatus);
expect(action.payload.timestamp).toBe(new Date().getTime());
expect(action.payload.status).toBe(expectedStatus);
});
it('should create a checkOnTunnel action', () => {
const action = checkOnTunnel({
onTunnelPingError: jest.fn(),
onTunnelPingSuccess: jest.fn(),
});
expect(action.type).toBe(NgrokTunnelActions.checkOnTunnel);
});
it('should create a setTimeIntervalSinceLastPing action', () => {
const action = setTimeIntervalSinceLastPing(TunnelCheckTimeInterval.SecondInterval);
expect(action.type).toBe(NgrokTunnelActions.setTimeIntervalSinceLastPing);
expect(action.payload).toBe(TunnelCheckTimeInterval.SecondInterval);
});
it('should create a clear notifications action', () => {
const action = clearAllNotifications();
expect(action.type).toBe(NgrokTunnelActions.clearAllNotifications);
expect(action.payload).toBeNull;
});
it('should create add notification action', () => {
const notificationId = 'notification-1';
const action = addNotification(notificationId);
expect(action.type).toBe(NgrokTunnelActions.addNotification);
expect(action.payload).toBe(notificationId);
});
});
```
|
The European Laboratory for Non-linear Spectroscopy (LENS) is an interdisciplinary research center established by the Italian Ministry of Education in 1991 within the University of Florence thanks to the initiative of Prof. Salvatore Califano.
Mission
LENS mission is focused on three main goals: facilitating the scientific collaboration between European researchers in the field of linear and non-linear spectroscopy; providing the most advanced equipment available, assistance and advice to qualified researchers; conceive, plan and carry out research projects in collaboration with other universities and institutions both nationally and internationally.
Structure
LENS has a strong international and interdisciplinary structure. The Directive Council is composed of experts in different fields of research covered by LENS. Such Council oversees all scientific, administrative and financial activities: the University of Florence, the Italian National Institute of Optics under the CNR, the Max Planck Institute of Quantum Optics, the Kaiserslautern University of Technology and the Pierre and Marie Curie University are all represented on the board.
The current LENS director, appointed by the Rector of the University of Florence on the proposal of the Directive Council, is Elisabetta Cerbai.
The director shall be assisted by a European Committee composed of the Rectors and Presidents of universities and affiliated research organizations or their representatives.
Head office
After many years on the historic hill of Arcetri, since 1995 LENS is located within the Science and Technology Campus in Sesto Fiorentino.
Scientific research
LENS foundation was started by a group of researchers involved in atomic and molecular laser spectroscopy, but during three decades its research activity has grown and diversified to also cover cold atoms physics (Bose–Einstein condensate and Fermi gas), physics of complex and disordered systems, photochemistry, biochemistry and biophysics, quantum biology, materials science, photonics, biophotonics, condensed matter physics, and the analysis, preservation and restoration of artistic heritage. All of these fields share the same fundamental methodology: the use of laser light to investigate matter.
LENS research groups are involved in three main research lines: quantum science and technology, photonic materials and biophotonics.
European Laserlab consortium
As a laser facility, LENS is part of the Laserlab-Europe consortium since its foundation, providing access to its labs within the Transnational Access To Research Infrastructures Programme of the European Commission. Main research interests are represented by five Joint Research Activities , two of which involve LENS: ALADIN and OPTBIO .
Training
LENS provides a PhD school, also supported by the University of Florence and others European universities, and a Postdoctoral fellowship programme. Both initiatives are partially supported by the EU Marie Curie Actions funded by the European Commission in various scientific disciplines and the European Erasmus Mundus programme.
Awards
In 2017, the Italian National Agency for the Evaluation of the University and Research Systems (ANVUR), in its triennial report about national research (referred to the 2011–2014 period), has ranked LENS at the top of Italian small scientific centers for physics and chemistry.
References
External links
European Laboratory for Non-Linear Spectroscopy
LaserLab-Europe
University of Florence
1991 establishments in Italy
Research lasers
Organisations based in Florence
|
In the Tradition may refer to:
In the Tradition (Alan Silva, Johannes Bauer, and Roger Turner album), 1996
In the Tradition (Anthony Braxton album), 1974
In the Tradition Volume 2, Anthony Braxton album recorded in 1974 and released in 1977
In the Tradition (Arthur Blythe album), 1978
In the Tradition (Dave Van Ronk album), 1964
|
```go
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package prometheus
import (
"testing"
dto "github.com/prometheus/client_model/go"
)
func TestTimerObserve(t *testing.T) {
var (
his = NewHistogram(HistogramOpts{Name: "test_histogram"})
sum = NewSummary(SummaryOpts{Name: "test_summary"})
gauge = NewGauge(GaugeOpts{Name: "test_gauge"})
)
func() {
hisTimer := NewTimer(his)
sumTimer := NewTimer(sum)
gaugeTimer := NewTimer(ObserverFunc(gauge.Set))
defer hisTimer.ObserveDuration()
defer sumTimer.ObserveDuration()
defer gaugeTimer.ObserveDuration()
}()
m := &dto.Metric{}
his.Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for histogram, got %d", want, got)
}
m.Reset()
sum.Write(m)
if want, got := uint64(1), m.GetSummary().GetSampleCount(); want != got {
t.Errorf("want %d observations for summary, got %d", want, got)
}
m.Reset()
gauge.Write(m)
if got := m.GetGauge().GetValue(); got <= 0 {
t.Errorf("want value > 0 for gauge, got %f", got)
}
}
func TestTimerEmpty(t *testing.T) {
emptyTimer := NewTimer(nil)
emptyTimer.ObserveDuration()
// Do nothing, just demonstrate it works without panic.
}
func TestTimerConditionalTiming(t *testing.T) {
var (
his = NewHistogram(HistogramOpts{
Name: "test_histogram",
})
timeMe = true
m = &dto.Metric{}
)
timedFunc := func() {
timer := NewTimer(ObserverFunc(func(v float64) {
if timeMe {
his.Observe(v)
}
}))
defer timer.ObserveDuration()
}
timedFunc() // This will time.
his.Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for histogram, got %d", want, got)
}
timeMe = false
timedFunc() // This will not time again.
m.Reset()
his.Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for histogram, got %d", want, got)
}
}
func TestTimerByOutcome(t *testing.T) {
var (
his = NewHistogramVec(
HistogramOpts{Name: "test_histogram"},
[]string{"outcome"},
)
outcome = "foo"
m = &dto.Metric{}
)
timedFunc := func() {
timer := NewTimer(ObserverFunc(func(v float64) {
his.WithLabelValues(outcome).Observe(v)
}))
defer timer.ObserveDuration()
if outcome == "foo" {
outcome = "bar"
return
}
outcome = "foo"
}
timedFunc()
his.WithLabelValues("foo").Write(m)
if want, got := uint64(0), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'foo' histogram, got %d", want, got)
}
m.Reset()
his.WithLabelValues("bar").Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'bar' histogram, got %d", want, got)
}
timedFunc()
m.Reset()
his.WithLabelValues("foo").Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'foo' histogram, got %d", want, got)
}
m.Reset()
his.WithLabelValues("bar").Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'bar' histogram, got %d", want, got)
}
timedFunc()
m.Reset()
his.WithLabelValues("foo").Write(m)
if want, got := uint64(1), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'foo' histogram, got %d", want, got)
}
m.Reset()
his.WithLabelValues("bar").Write(m)
if want, got := uint64(2), m.GetHistogram().GetSampleCount(); want != got {
t.Errorf("want %d observations for 'bar' histogram, got %d", want, got)
}
}
```
|
Nagyhajmás (, , ) is a village () in the Hegyhát District, northern Baranya county, in the Southern Transdanubia region of Hungary. Its population at the 2011 census was 346.
Geography
The village is located at 46° 22′ 22″ N, 18° 17′ 20″ E. Its area is . It is part of the Southern Transdanubia statistical region, and administratively it falls under Baranya County and Hegyhát District. It lies northeast of the town of Mágocs and north of Pécs.
Demographics
2011 census
As of the census of 2011, there were 346 residents, 129 households, and 96 families living in the village. The population density was . There were 142 dwellings at an average density of . The average household size was 2.64. The average number of children was 1.19. The average family size was 3.02.
Religious affiliation was 41.8% Roman Catholic, 11.2% Lutheran, 2.9% Calvinist, 0.3% Jewish, 0.6% other religion and 26.8% unaffiliated, with 16.5% declining to answer.
The village had an ethnic minority Roma population of 15.9% and a German population of 8.5%. A small number of residents also identified as Serb (0.3%) and other, non-native to Hungary (0.3%). The vast majority declared themselves as Hungarian (96.2%), with 3.5% declining to answer.
Local government
The village is governed by a mayor with a four-person council. The local government of the village operates a joint council office with the nearby localities of Alsómocsolád, Mágocs, and Mekényes. The seat of the joint council is in Mágocs.
As of the election of 2019, the village also has local minority self-governments for its German and Roma communities, each with three elected representatives.
Transportation
Railway
Mágocs-Alsómocsolád Train Station, southwest of the village. The station is on the Dombóvár-Bátaszék railway line and is operated by MÁV.
Notes
External links
OpenStreetMap
Detailed Gazetteer of Hungary
References
Populated places in Baranya County
|
Nabil Bechaouch (1970 – 7 October 2020) was a Tunisian footballer.
Biography
Bechaouch played for the Tunisia from 1993 to 1995. He played three matches during the 1996 African Cup of Nations qualification. He died on 7 October 2020 of a heart attack.
Awards
Winner of the CAF Cup in 1998 with CS Sfaxien
Winner of the Tunisian Cup in 1993 with Olympique Béja
Winner of the Tunisian Super Cup in 1995 with Olympique Béja
References
1970 births
2020 deaths
Tunisian men's footballers
Men's association football forwards
Tunisia men's international footballers
Olympique Béja players
CS Sfaxien players
Stade Tunisien players
|
HMS Cracker was a later Archer-class gun brig, launched in 1804. She participated in several actions and captured two small French privateers. She was sold for breaking up in 1816.
Career
Lieutenant William Henry Douglas commissioned Cracker in July 1804.
Cracker was in company with , , and the hired armed cutters Frances and Nelson on 16 April at the capture of Charlotte Christina.
On 23 July 1805, Cracker engaged a division of French gun-vessels that were sailing from Fecamp to Boulogne.
In October 1805 Lieutenant John Leach replaced Douglas. On 20 June 1808 Cracker was sailing off the coast of Suffolk when Leach sighted a large lug sail boat, fitted for 16 oars. He gave chase and after four hours captured her. She was the French privateer Été, with a crew of 22 men armed with small arms. She was under the command of Captain Louis Pequandiere, and though off St Vallery en Caux, was two days out of Dunkirk. She had not captured any prizes but had been hovering near five British merchant vessels when Cracker had arrived on the scene.
On 25 February 1806 Cracker recaptured Dove.
Cracker was in company with , , and when they captured the ship William Little, John J. P. Champlin, master, on 17 October 1806.
On 2 January 1807 Cracker recaptured the brig Resolution, of Exeter.
On 11 April 1807 Cracker and recaptured Rochdale.
On 25 April 1808, captured the French privateer Furet, which was pierced for 14 guns but only had six on board. Furet and her crew of 48 men were two days out from Boulogne and had not made any captures. Cracker was in company with Skylark.{{efn|This may be the Furet from Boulogne, commissioned in the summer of 1808. She was first under Jean-Baptiste-Benjamin Levillain, and later under Jacques-Antoine Altazan (or Altazin), but there are some discrepancies between the British and French records making identification uncertain.}}Cracker participated in the unsuccessful Walcheren Expedition, which took place between 30 July and 9 August 1809. On 13 August she was part of a squadron under Sir Home Riggs Popham that pushed up the West Scheld, but saw no action. The squadron's task was to sound the river and place buoys to permit the larger vessels to navigate the river safely. was at the siege of Flushing, and was instrumental in saving the brigs and Cracker after they had grounded within point-blank shot of the enemy.
She was among the myriad vessels listed as qualifying for the prize money from the campaign.
On 23 April 1810, Cracker, John Leach, commander, recaptured two colliers the brigs Hawke and Atlas.
Later in 1810 Lieutenant Henry Fyge Jauncey replaced Leach. On 20 November Cracker captured a small French privateer. The privateer was the lugger Diana (or Diani), of four guns and 22 men. She had left Dunkirk the day before and had not taken any prizes. Jauncey was promoted to the rank of commander on 1 February 1812.
On 1 April 1811 Cracker seized Elizabeth, of Aldborough. On the 28th she seized a galley, from Deal, of unknown name, and on 16 May 263 kegs of spirits and four anchors.
On 19 October Cracker captured a smuggling boat with tubs of alcohol onboard. On 27 October Cracker provided assistance to the merchant vessel Beaver. The owners gave Crackers crew £50 in thanks.
On 17 December Cracker provided assistance to the East Indiaman .
In February 1812 Lieutenant Michael Fitton took command of Cracker for service in the North Sea and Baltic. Cracker captured the American ship America on 1 August. Then on 26 August, Fitton captured the American ship Dido, and shared the prize money, by agreement, with .
On 26 April 1814, Cracker was in company with and Insolent when they captured Euranie.
Fate
The "Principal Officers and Commissioners of His Majesty's Navy" first offered the "Cracker gun bring, of 178 tons", "lying at Portmouth", for sale on 23 March 1815. Cracker'' was sold at Portsmouth for £750 on 23 November 1815 for breaking up.
Notes
Citations
References
1804 ships
Brigs of the Royal Navy
|
```ruby
class Sampler < Formula
desc "Tool for shell commands execution, visualization and alerting"
homepage "path_to_url"
url "path_to_url"
sha256 your_sha256_hash
license "GPL-3.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: your_sha256_hash
sha256 cellar: :any_skip_relocation, arm64_ventura: your_sha256_hash
sha256 cellar: :any_skip_relocation, arm64_monterey: your_sha256_hash
sha256 cellar: :any_skip_relocation, arm64_big_sur: your_sha256_hash
sha256 cellar: :any_skip_relocation, sonoma: your_sha256_hash
sha256 cellar: :any_skip_relocation, ventura: your_sha256_hash
sha256 cellar: :any_skip_relocation, monterey: your_sha256_hash
sha256 cellar: :any_skip_relocation, big_sur: your_sha256_hash
sha256 cellar: :any_skip_relocation, catalina: your_sha256_hash
sha256 cellar: :any_skip_relocation, mojave: your_sha256_hash
sha256 cellar: :any_skip_relocation, high_sierra: your_sha256_hash
sha256 cellar: :any_skip_relocation, x86_64_linux: your_sha256_hash
end
depends_on "go" => :build
on_linux do
depends_on "alsa-lib"
end
def install
system "go", "build", "-o", bin/"sampler"
end
test do
assert_includes "specify config file", shell_output(bin/"sampler")
end
end
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.